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.businessobject.Entry;
26 import org.kuali.ole.gl.businessobject.lookup.BusinessObjectFieldConverter;
27 import org.kuali.ole.sys.OLEConstants;
28 import org.kuali.ole.sys.OLEPropertyConstants;
29 import org.kuali.rice.kns.service.BusinessObjectDictionaryService;
30 import org.kuali.rice.krad.service.LookupService;
31
32
33
34
35
36 public class BalanceInquirableImpl extends AbstractGeneralLedgerInquirableImpl {
37 private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(BalanceInquirableImpl.class);
38
39 private BusinessObjectDictionaryService dataDictionary;
40 private LookupService lookupService;
41 private Class businessObjectClass;
42
43
44
45
46
47
48 protected List buildUserDefinedAttributeKeyList() {
49 List keys = new ArrayList();
50
51 keys.add(OLEPropertyConstants.UNIVERSITY_FISCAL_YEAR);
52 keys.add(OLEPropertyConstants.ACCOUNT_NUMBER);
53 keys.add(OLEPropertyConstants.CHART_OF_ACCOUNTS_CODE);
54 keys.add(OLEPropertyConstants.BALANCE_TYPE_CODE);
55 keys.add(OLEPropertyConstants.SUB_ACCOUNT_NUMBER);
56 keys.add(OLEPropertyConstants.OBJECT_CODE);
57 keys.add(OLEPropertyConstants.SUB_OBJECT_CODE);
58 keys.add(OLEPropertyConstants.OBJECT_TYPE_CODE);
59 keys.add(Constant.PENDING_ENTRY_OPTION);
60
61 return keys;
62 }
63
64
65
66
67
68
69 protected Map getUserDefinedAttributeMap() {
70 Map userDefinedAttributeMap = new HashMap();
71
72 userDefinedAttributeMap.put(OLEPropertyConstants.MONTH1_AMOUNT, OLEConstants.MONTH1);
73 userDefinedAttributeMap.put(OLEPropertyConstants.MONTH2_AMOUNT, OLEConstants.MONTH2);
74 userDefinedAttributeMap.put(OLEPropertyConstants.MONTH3_AMOUNT, OLEConstants.MONTH3);
75
76 userDefinedAttributeMap.put(OLEPropertyConstants.MONTH4_AMOUNT, OLEConstants.MONTH4);
77 userDefinedAttributeMap.put(OLEPropertyConstants.MONTH5_AMOUNT, OLEConstants.MONTH5);
78 userDefinedAttributeMap.put(OLEPropertyConstants.MONTH6_AMOUNT, OLEConstants.MONTH6);
79
80 userDefinedAttributeMap.put(OLEPropertyConstants.MONTH7_AMOUNT, OLEConstants.MONTH7);
81 userDefinedAttributeMap.put(OLEPropertyConstants.MONTH8_AMOUNT, OLEConstants.MONTH8);
82 userDefinedAttributeMap.put(OLEPropertyConstants.MONTH9_AMOUNT, OLEConstants.MONTH9);
83
84 userDefinedAttributeMap.put(OLEPropertyConstants.MONTH10_AMOUNT, OLEConstants.MONTH10);
85 userDefinedAttributeMap.put(OLEPropertyConstants.MONTH11_AMOUNT, OLEConstants.MONTH11);
86 userDefinedAttributeMap.put(OLEPropertyConstants.MONTH12_AMOUNT, OLEConstants.MONTH12);
87 userDefinedAttributeMap.put(OLEPropertyConstants.MONTH13_AMOUNT, OLEConstants.MONTH13);
88
89 userDefinedAttributeMap.put(OLEPropertyConstants.BEGINNING_BALANCE_LINE_AMOUNT, OLEConstants.PERIOD_CODE_BEGINNING_BALANCE);
90 userDefinedAttributeMap.put(OLEPropertyConstants.CONTRACTS_GRANTS_BEGINNING_BALANCE_AMOUNT, OLEConstants.PERIOD_CODE_CG_BEGINNING_BALANCE);
91
92 return userDefinedAttributeMap;
93 }
94
95
96
97
98
99
100
101 protected String getAttributeName(String attributeName) {
102 return attributeName;
103 }
104
105
106
107
108
109
110
111
112 protected Object getKeyValue(String keyName, Object keyValue) {
113 if (isExclusiveField(keyName, keyValue)) {
114 keyValue = Constant.EMPTY_STRING;
115 }
116 return keyValue;
117 }
118
119
120
121
122
123
124
125 protected String getKeyName(String keyName) {
126 keyName = BusinessObjectFieldConverter.convertToTransactionPropertyName(keyName);
127 return keyName;
128 }
129
130
131
132
133
134
135 protected String getLookupableImplAttributeName() {
136 return Constant.GL_LOOKUPABLE_ENTRY;
137 }
138
139
140
141
142
143
144 protected String getBaseUrl() {
145 return OLEConstants.GL_MODIFIED_INQUIRY_ACTION;
146 }
147
148
149
150
151
152
153
154 protected Class getInquiryBusinessObjectClass(String attributeName) {
155 return Entry.class;
156 }
157
158
159
160
161
162
163
164 protected void addMoreParameters(Properties parameter, String attributeName) {
165 parameter.put(OLEConstants.LOOKUPABLE_IMPL_ATTRIBUTE_NAME, getLookupableImplAttributeName());
166
167 String periodCode = (String) getUserDefinedAttributeMap().get(attributeName);
168 parameter.put(OLEConstants.UNIVERSITY_FISCAL_PERIOD_CODE_PROPERTY_NAME, periodCode);
169 }
170 }