001: /*
002: * Copyright 2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.0 (the "License");
005: * you may not use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.opensource.org/licenses/ecl1.php
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License.
015: */
016: package org.kuali.module.labor.web.inquirable;
017:
018: import java.util.ArrayList;
019: import java.util.HashMap;
020: import java.util.List;
021: import java.util.Map;
022: import java.util.Properties;
023:
024: import org.kuali.kfs.KFSConstants;
025: import org.kuali.kfs.KFSPropertyConstants;
026: import org.kuali.module.gl.web.Constant;
027: import org.kuali.module.labor.bo.LedgerEntry;
028:
029: /**
030: * Service implementation of LedgerBalanceInquirable. This class is used to generate the URL for the user-defined attributes for the
031: * Ledger Balance screen. It is entended the KualiInquirableImpl class, so it covers both the default implementation and customized
032: * implemetnation.
033: */
034: public class LedgerBalanceInquirableImpl extends
035: AbstractLaborInquirableImpl {
036: private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger
037: .getLogger(LedgerBalanceInquirableImpl.class);
038:
039: /**
040: * @see org.kuali.module.gl.web.inquirable.AbstractGLInquirableImpl#buildUserDefinedAttributeKeyList()
041: */
042: protected List buildUserDefinedAttributeKeyList() {
043: List keys = new ArrayList();
044:
045: keys.add(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR);
046: keys.add(KFSPropertyConstants.ACCOUNT_NUMBER);
047: keys.add(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE);
048: keys.add(KFSPropertyConstants.FINANCIAL_BALANCE_TYPE_CODE);
049: keys.add(KFSPropertyConstants.SUB_ACCOUNT_NUMBER);
050: keys.add(KFSPropertyConstants.FINANCIAL_OBJECT_CODE);
051: keys.add(KFSPropertyConstants.FINANCIAL_SUB_OBJECT_CODE);
052: keys.add(KFSPropertyConstants.FINANCIAL_OBJECT_TYPE_CODE);
053: keys.add(KFSPropertyConstants.EMPLID);
054: keys.add(KFSPropertyConstants.POSITION_NUMBER);
055: keys.add(Constant.PENDING_ENTRY_OPTION);
056:
057: return keys;
058: }
059:
060: /**
061: * @see org.kuali.module.gl.web.inquirable.AbstractGLInquirableImpl#getUserDefinedAttributeMap()
062: */
063: protected Map getUserDefinedAttributeMap() {
064: Map userDefinedAttributeMap = new HashMap();
065:
066: userDefinedAttributeMap.put(KFSPropertyConstants.MONTH1_AMOUNT,
067: KFSConstants.MONTH1);
068: userDefinedAttributeMap.put(KFSPropertyConstants.MONTH2_AMOUNT,
069: KFSConstants.MONTH2);
070: userDefinedAttributeMap.put(KFSPropertyConstants.MONTH3_AMOUNT,
071: KFSConstants.MONTH3);
072:
073: userDefinedAttributeMap.put(KFSPropertyConstants.MONTH4_AMOUNT,
074: KFSConstants.MONTH4);
075: userDefinedAttributeMap.put(KFSPropertyConstants.MONTH5_AMOUNT,
076: KFSConstants.MONTH5);
077: userDefinedAttributeMap.put(KFSPropertyConstants.MONTH6_AMOUNT,
078: KFSConstants.MONTH6);
079:
080: userDefinedAttributeMap.put(KFSPropertyConstants.MONTH7_AMOUNT,
081: KFSConstants.MONTH7);
082: userDefinedAttributeMap.put(KFSPropertyConstants.MONTH8_AMOUNT,
083: KFSConstants.MONTH8);
084: userDefinedAttributeMap.put(KFSPropertyConstants.MONTH9_AMOUNT,
085: KFSConstants.MONTH9);
086:
087: userDefinedAttributeMap.put(
088: KFSPropertyConstants.MONTH10_AMOUNT,
089: KFSConstants.MONTH10);
090: userDefinedAttributeMap.put(
091: KFSPropertyConstants.MONTH11_AMOUNT,
092: KFSConstants.MONTH11);
093: userDefinedAttributeMap.put(
094: KFSPropertyConstants.MONTH12_AMOUNT,
095: KFSConstants.MONTH12);
096: userDefinedAttributeMap.put(
097: KFSPropertyConstants.MONTH13_AMOUNT,
098: KFSConstants.MONTH13);
099:
100: userDefinedAttributeMap
101: .put(
102: KFSPropertyConstants.FINANCIAL_BEGINNING_BALANCE_LINE_AMOUNT,
103: KFSConstants.PERIOD_CODE_BEGINNING_BALANCE);
104: userDefinedAttributeMap
105: .put(
106: KFSPropertyConstants.CONTRACTS_GRANTS_BEGINNING_BALANCE_AMOUNT,
107: KFSConstants.PERIOD_CODE_CG_BEGINNING_BALANCE);
108:
109: return userDefinedAttributeMap;
110: }
111:
112: /**
113: * @see org.kuali.module.gl.web.inquirable.AbstractGLInquirableImpl#getAttributeName(java.lang.String)
114: */
115: protected String getAttributeName(String attributeName) {
116: return attributeName;
117: }
118:
119: /**
120: * @see org.kuali.module.gl.web.inquirable.AbstractGLInquirableImpl#getKeyValue(java.lang.String, java.lang.Object)
121: */
122: protected Object getKeyValue(String keyName, Object keyValue) {
123: if (isExclusiveField(keyName, keyValue)) {
124: keyValue = Constant.EMPTY_STRING;
125: }
126: return keyValue;
127: }
128:
129: /**
130: * @see org.kuali.module.gl.web.inquirable.AbstractGLInquirableImpl#getKeyName(java.lang.String)
131: */
132: protected String getKeyName(String keyName) {
133: return keyName;
134: }
135:
136: /**
137: * @see org.kuali.module.gl.web.inquirable.AbstractGLInquirableImpl#getLookupableImplAttributeName()
138: */
139: protected String getLookupableImplAttributeName() {
140: return null;
141: }
142:
143: /**
144: * @see org.kuali.module.gl.web.inquirable.AbstractGLInquirableImpl#getBaseUrl()
145: */
146: protected String getBaseUrl() {
147: return KFSConstants.GL_MODIFIED_INQUIRY_ACTION;
148: }
149:
150: /**
151: * @see org.kuali.module.gl.web.inquirable.AbstractGLInquirableImpl#getInquiryBusinessObjectClass(String)
152: */
153: protected Class getInquiryBusinessObjectClass(String attributeName) {
154: return LedgerEntry.class;
155: }
156:
157: /**
158: * @see org.kuali.module.gl.web.inquirable.AbstractGLInquirableImpl#addMoreParameters(java.util.Properties, java.lang.String)
159: */
160: protected void addMoreParameters(Properties parameter,
161: String attributeName) {
162: String periodCode = (String) getUserDefinedAttributeMap().get(
163: attributeName);
164: parameter
165: .put(
166: KFSConstants.UNIVERSITY_FISCAL_PERIOD_CODE_PROPERTY_NAME,
167: periodCode);
168: }
169: }
|