| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
package org.kuali.student.lum.statement.config.context; |
| 17 |
|
|
| 18 |
|
import java.util.Map; |
| 19 |
|
|
| 20 |
|
import org.kuali.student.common.exceptions.OperationFailedException; |
| 21 |
|
import org.kuali.student.core.organization.dto.OrgInfo; |
| 22 |
|
import org.kuali.student.core.organization.service.OrganizationService; |
| 23 |
|
import org.kuali.student.core.statement.dto.ReqComponentInfo; |
| 24 |
|
import org.kuali.student.lum.statement.typekey.ReqComponentFieldTypes; |
| 25 |
|
|
| 26 |
|
|
| 27 |
|
|
| 28 |
|
|
|
|
|
| 0% |
Uncovered Elements: 16 (16) |
Complexity: 5 |
Complexity Density: 0.45 |
|
| 29 |
|
public class OrganizationContextImpl extends BasicContextImpl { |
| 30 |
|
|
| 31 |
|
private OrganizationService organizationService; |
| 32 |
|
|
| 33 |
|
public final static String ORG_TOKEN = "org"; |
| 34 |
|
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
| 35 |
0
|
public void setOrganizationService(OrganizationService organizationService) {... |
| 36 |
0
|
this.organizationService = organizationService; |
| 37 |
|
} |
| 38 |
|
|
|
|
|
| 0% |
Uncovered Elements: 7 (7) |
Complexity: 3 |
Complexity Density: 0.6 |
|
| 39 |
0
|
private OrgInfo getOrganization(String orgId) throws OperationFailedException {... |
| 40 |
0
|
if (orgId == null) { |
| 41 |
0
|
return null; |
| 42 |
|
} |
| 43 |
0
|
try { |
| 44 |
0
|
return organizationService.getOrganization(orgId); |
| 45 |
|
} catch (Exception e) { |
| 46 |
0
|
throw new OperationFailedException(e.getMessage(), e); |
| 47 |
|
} |
| 48 |
|
} |
| 49 |
|
|
| 50 |
|
|
| 51 |
|
|
| 52 |
|
|
| 53 |
|
@param |
| 54 |
|
@throws |
| 55 |
|
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 1 |
Complexity Density: 0.2 |
|
| 56 |
0
|
public Map<String, Object> createContextMap(ReqComponentInfo reqComponent) throws OperationFailedException {... |
| 57 |
0
|
String orgId = getReqComponentFieldValue(reqComponent, ReqComponentFieldTypes.ORGANIZATION_KEY.getId()); |
| 58 |
0
|
OrgInfo org = getOrganization(orgId); |
| 59 |
|
|
| 60 |
0
|
Map<String, Object> contextMap = super.createContextMap(reqComponent); |
| 61 |
0
|
contextMap.put(ORG_TOKEN, org); |
| 62 |
0
|
return contextMap; |
| 63 |
|
} |
| 64 |
|
} |