| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.kuali.student.lum.common.server; |
| 17 |
|
|
| 18 |
|
import org.kuali.student.common.ui.server.gwt.AbstractDataService; |
| 19 |
|
import org.kuali.student.core.exceptions.DoesNotExistException; |
| 20 |
|
import org.kuali.student.core.exceptions.InvalidParameterException; |
| 21 |
|
import org.kuali.student.lum.lo.dto.LoCategoryInfo; |
| 22 |
|
import org.kuali.student.lum.lo.dto.LoInfo; |
| 23 |
|
import org.kuali.student.lum.lo.service.LearningObjectiveService; |
| 24 |
|
|
| 25 |
|
import org.kuali.student.lum.program.dto.MajorDisciplineInfo; |
| 26 |
|
import java.util.Map; |
| 27 |
|
|
|
|
|
| 0% |
Uncovered Elements: 26 (26) |
Complexity: 9 |
Complexity Density: 0.56 |
|
| 28 |
|
public class LoCategoryDataService extends AbstractDataService { |
| 29 |
|
|
| 30 |
|
private static final long serialVersionUID = 1L; |
| 31 |
|
|
| 32 |
|
private LearningObjectiveService loService; |
| 33 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 34 |
0
|
@Override... |
| 35 |
|
protected String getDefaultWorkflowDocumentType() { |
| 36 |
0
|
return null; |
| 37 |
|
} |
| 38 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 39 |
0
|
@Override... |
| 40 |
|
protected String getDefaultMetaDataState() { |
| 41 |
0
|
return null; |
| 42 |
|
} |
| 43 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.4 |
|
| 44 |
0
|
@Override... |
| 45 |
|
protected Object get(String id) throws Exception { |
| 46 |
|
|
| 47 |
|
|
| 48 |
0
|
Object returnDTO ; |
| 49 |
|
|
| 50 |
0
|
try { |
| 51 |
0
|
returnDTO = loService.getLoCategory(id); |
| 52 |
|
} |
| 53 |
|
catch (DoesNotExistException e) { |
| 54 |
0
|
throw new InvalidParameterException("Only LoCategoryInfo supported by this DataService implementation."); |
| 55 |
|
} |
| 56 |
0
|
return returnDTO; |
| 57 |
|
} |
| 58 |
|
|
|
|
|
| 0% |
Uncovered Elements: 11 (11) |
Complexity: 3 |
Complexity Density: 0.43 |
|
| 59 |
0
|
@Override... |
| 60 |
|
protected Object save(Object dto, Map<String, Object> properties) throws Exception { |
| 61 |
0
|
if (dto instanceof LoCategoryInfo) { |
| 62 |
0
|
LoCategoryInfo loCatInfo = (LoCategoryInfo) dto; |
| 63 |
0
|
if (loCatInfo.getId() == null ) { |
| 64 |
0
|
loCatInfo = loService.createLoCategory(loCatInfo.getLoRepository(), loCatInfo.getType(), loCatInfo); |
| 65 |
|
} else { |
| 66 |
0
|
loCatInfo = loService.updateLoCategory(loCatInfo.getId(), loCatInfo); |
| 67 |
|
} |
| 68 |
0
|
return loCatInfo; |
| 69 |
|
} else { |
| 70 |
0
|
throw new InvalidParameterException("Only LoCategoryInfo supported by this DataService implementation."); |
| 71 |
|
} |
| 72 |
|
} |
| 73 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 74 |
0
|
@Override... |
| 75 |
|
protected Class<?> getDtoClass() { |
| 76 |
0
|
return LoCategoryInfo.class; |
| 77 |
|
} |
| 78 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 79 |
0
|
public void setLearningObjectiveService(LearningObjectiveService loService) {... |
| 80 |
0
|
this.loService = loService; |
| 81 |
|
} |
| 82 |
|
|
| 83 |
|
|
| 84 |
|
} |