1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.ui.admin.atp;
17
18
19 import java.util.ArrayList;
20 import java.util.List;
21 import java.util.Map;
22 import javax.xml.namespace.QName;
23 import org.apache.log4j.Logger;
24 import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
25 import org.kuali.rice.krad.inquiry.InquirableImpl;
26 import org.kuali.student.enrollment.common.util.ContextBuilder;
27 import org.kuali.student.r2.common.dto.ContextInfo;
28 import org.kuali.student.r2.core.atp.dto.AtpAtpRelationInfo;
29 import org.kuali.student.r2.core.atp.service.AtpService;
30 import org.kuali.student.r2.core.constants.AtpServiceConstants;
31
32
33 public class AtpAtpRelationInfoAdminInquirableImpl extends InquirableImpl
34 {
35 private static final Logger LOG = Logger.getLogger(AtpAtpRelationInfoAdminInquirableImpl.class);
36 private transient AtpService atpService;
37 private final static String PRIMARY_KEY = "id";
38 private static final long serialVersionUID = 1L;
39 @Override
40 public AtpAtpRelationInfo retrieveDataObject(Map<String, String> parameters)
41 {
42 String key = parameters.get(PRIMARY_KEY);
43 try
44 {
45 AtpAtpRelationInfo info = this.getAtpService().getAtpAtpRelation(key, getContextInfo());
46 return info;
47 }
48 catch (Exception ex) {
49 throw new RuntimeException(ex);
50 }
51 }
52
53 public void setAtpService(AtpService atpService)
54 {
55 this.atpService = atpService;
56 }
57
58 public AtpService getAtpService()
59 {
60 if (atpService == null)
61 {
62 QName qname = new QName(AtpServiceConstants.NAMESPACE,AtpServiceConstants.SERVICE_NAME_LOCAL_PART);
63 atpService = (AtpService) GlobalResourceLoader.getService(qname);
64 }
65 return this.atpService;
66 }
67
68 private ContextInfo getContextInfo() {
69 return ContextBuilder.loadContextInfo();
70 }
71 }
72