1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krms.impl.repository;
17
18 import org.kuali.rice.core.api.uif.RemotableAttributeField;
19 import org.kuali.rice.kns.inquiry.KualiInquirableImpl;
20 import org.kuali.rice.krad.uif.container.Container;
21 import org.kuali.rice.krad.uif.view.View;
22 import org.kuali.rice.krad.web.form.InquiryForm;
23 import org.kuali.rice.krms.impl.ui.AgendaEditor;
24 import org.kuali.rice.krms.impl.util.KrmsRetriever;
25
26 import java.util.Collections;
27 import java.util.List;
28 import java.util.Map;
29
30
31
32
33 public class AgendaStudentInquiryHelperServiceImpl extends KualiInquirableImpl {
34
35 private transient KrmsRetriever krmsRetriever = new KrmsRetriever();
36
37 @Override
38 public AgendaEditor retrieveDataObject(Map fieldValues) {
39 AgendaEditor agendaEditor = null;
40
41 String agendaId = (String) fieldValues.get("id");
42 AgendaBo agenda = getBusinessObjectService().findBySinglePrimaryKey(AgendaBo.class, agendaId);
43 if (agenda != null) {
44 agendaEditor = new AgendaEditor();
45 agendaEditor.setAgenda(agenda);
46 agendaEditor.setNamespace(agenda.getContext().getNamespace());
47 agendaEditor.setContextName(agenda.getContext().getName());
48 agendaEditor.setCustomAttributesMap(agenda.getAttributes());
49 }
50
51 return agendaEditor;
52 }
53
54
55
56
57
58
59 private AgendaEditor retrieveAgendaEditor(InquiryForm model) {
60 InquiryForm inquiryForm = (InquiryForm)model;
61 return (AgendaEditor)inquiryForm.getDataObject();
62 }
63
64
65
66
67
68
69
70
71 public List<RemotableAttributeField> retrieveAgendaCustomAttributes(View view, Object model, Container container) {
72 AgendaEditor agendaEditor = retrieveAgendaEditor((InquiryForm) model);
73 return krmsRetriever.retrieveAgendaCustomAttributes(agendaEditor);
74 }
75
76
77
78
79
80
81
82
83 public List<RemotableAttributeField> retrieveRuleActionCustomAttributes(View view, Object model, Container container) {
84 AgendaEditor agendaEditor = retrieveAgendaEditor((InquiryForm)model);
85 return krmsRetriever.retrieveRuleActionCustomAttributes(agendaEditor);
86 }
87
88
89
90
91
92
93
94
95 public List<RemotableAttributeField> retrieveRuleCustomAttributes(View view, Object model, Container container) {
96 AgendaEditor agendaEditor = retrieveAgendaEditor((InquiryForm)model);
97 return krmsRetriever.retrieveRuleCustomAttributes(agendaEditor);
98 }
99
100
101
102
103
104
105
106
107
108
109
110 public List<RemotableAttributeField> retrieveTermParameters(View view, Object model, Container container) {
111 return Collections.emptyList();
112 }
113 }