1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.gl.businessobject.inquiry;
17
18 import java.util.ArrayList;
19 import java.util.HashMap;
20 import java.util.List;
21 import java.util.Map;
22 import java.util.Properties;
23
24 import org.kuali.ole.gl.Constant;
25 import org.kuali.ole.gl.GeneralLedgerConstants;
26 import org.kuali.ole.gl.businessobject.AccountBalance;
27 import org.kuali.ole.gl.businessobject.AccountBalanceByLevel;
28 import org.kuali.ole.gl.businessobject.AccountBalanceByObject;
29 import org.kuali.ole.sys.OLEConstants;
30 import org.kuali.ole.sys.OLEPropertyConstants;
31 import org.kuali.rice.kns.service.BusinessObjectDictionaryService;
32 import org.kuali.rice.krad.service.LookupService;
33
34
35
36
37
38 public class AccountBalanceByLevelInquirableImpl extends AbstractGeneralLedgerInquirableImpl {
39 private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(AccountBalanceByLevelInquirableImpl.class);
40
41 private BusinessObjectDictionaryService dataDictionary;
42 private LookupService lookupService;
43 private Class businessObjectClass;
44
45
46
47
48
49
50 protected List buildUserDefinedAttributeKeyList() {
51 List keys = new ArrayList();
52
53 keys.add(OLEPropertyConstants.UNIVERSITY_FISCAL_YEAR);
54 keys.add(OLEPropertyConstants.ACCOUNT_NUMBER);
55 keys.add(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE);
56 keys.add(OLEPropertyConstants.SUB_ACCOUNT_NUMBER);
57 keys.add(GeneralLedgerConstants.BalanceInquiryDrillDowns.OBJECT_LEVEL_CODE);
58 keys.add(GeneralLedgerConstants.BalanceInquiryDrillDowns.REPORTING_SORT_CODE);
59 keys.add(Constant.COST_SHARE_OPTION);
60 keys.add(Constant.CONSOLIDATION_OPTION);
61 keys.add(Constant.PENDING_ENTRY_OPTION);
62
63 return keys;
64 }
65
66
67
68
69
70
71 protected Map getUserDefinedAttributeMap() {
72 Map userDefinedAttributeMap = new HashMap();
73 userDefinedAttributeMap.put(GeneralLedgerConstants.DummyBusinessObject.LINK_BUTTON_OPTION, "");
74 return userDefinedAttributeMap;
75 }
76
77
78
79
80
81
82
83 protected String getAttributeName(String attributeName) {
84 if (attributeName.equals(GeneralLedgerConstants.DummyBusinessObject.LINK_BUTTON_OPTION)) {
85 attributeName = OLEPropertyConstants.OBJECT_CODE;
86 }
87 return attributeName;
88 }
89
90
91
92
93
94
95
96
97 protected Object getKeyValue(String keyName, Object keyValue) {
98 if (isExclusiveField(keyName, keyValue)) {
99 keyValue = "";
100 }
101 return keyValue;
102 }
103
104
105
106
107
108
109
110 protected String getKeyName(String keyName) {
111 return keyName;
112 }
113
114
115
116
117
118
119 protected String getLookupableImplAttributeName() {
120 return Constant.GL_LOOKUPABLE_ACCOUNT_BALANCE_BY_OBJECT;
121 }
122
123
124
125
126
127
128 protected String getBaseUrl() {
129 return OLEConstants.GL_MODIFIED_INQUIRY_ACTION;
130 }
131
132
133
134
135
136
137
138 protected Class getInquiryBusinessObjectClass(String attributeName) {
139 Class c = null;
140
141
142
143 if (GeneralLedgerConstants.BalanceInquiryDrillDowns.OBJECT_LEVEL_CODE.equals(attributeName)) {
144 c = AccountBalance.class;
145 }
146 else if (OLEPropertyConstants.OBJECT_CODE.equals(attributeName)) {
147 c = AccountBalanceByObject.class;
148 }
149 else {
150 c = AccountBalanceByLevel.class;
151 }
152
153 return c;
154 }
155
156
157
158
159
160
161
162 protected void addMoreParameters(Properties parameter, String attributeName) {
163 parameter.put(OLEConstants.LOOKUPABLE_IMPL_ATTRIBUTE_NAME, getLookupableImplAttributeName());
164 }
165 }