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.HashMap;
28 import java.util.List;
29 import java.util.Map;
30
31
32
33
34 public class AgendaInquiryHelperServiceImpl extends KualiInquirableImpl {
35
36 private transient KrmsRetriever krmsRetriever = new KrmsRetriever();
37
38 @Override
39 public AgendaEditor retrieveDataObject(Map fieldValues) {
40 AgendaEditor agendaEditor = null;
41
42 Map<String, Object> primaryKeys = new HashMap<String, Object>();
43 primaryKeys.put("id", fieldValues.get("id"));
44
45 AgendaBo agenda = getBusinessObjectService().findByPrimaryKey(AgendaBo.class, primaryKeys);
46 if (agenda != null) {
47 agendaEditor = new AgendaEditor();
48 agendaEditor.setAgenda(agenda);
49 agendaEditor.setNamespace(agenda.getContext().getNamespace());
50 agendaEditor.setContextName(agenda.getContext().getName());
51 agendaEditor.setCustomAttributesMap(agenda.getAttributes());
52 }
53
54 return agendaEditor;
55 }
56
57
58
59
60
61
62 private AgendaEditor retrieveAgendaEditor(InquiryForm model) {
63 InquiryForm inquiryForm = (InquiryForm)model;
64 return (AgendaEditor)inquiryForm.getDataObject();
65 }
66
67
68
69
70
71
72
73
74 public List<RemotableAttributeField> retrieveAgendaCustomAttributes(View view, Object model, Container container) {
75 AgendaEditor agendaEditor = retrieveAgendaEditor((InquiryForm) model);
76 return krmsRetriever.retrieveAgendaCustomAttributes(agendaEditor);
77 }
78
79
80
81
82
83
84
85
86 public List<RemotableAttributeField> retrieveRuleActionCustomAttributes(View view, Object model, Container container) {
87 AgendaEditor agendaEditor = retrieveAgendaEditor((InquiryForm)model);
88 return krmsRetriever.retrieveRuleActionCustomAttributes(agendaEditor);
89 }
90
91
92
93
94
95
96
97
98 public List<RemotableAttributeField> retrieveRuleCustomAttributes(View view, Object model, Container container) {
99 AgendaEditor agendaEditor = retrieveAgendaEditor((InquiryForm)model);
100 return krmsRetriever.retrieveRuleCustomAttributes(agendaEditor);
101 }
102
103
104
105
106
107
108
109
110
111
112
113 public List<RemotableAttributeField> retrieveTermParameters(View view, Object model, Container container) {
114 return Collections.emptyList();
115 }
116 }