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:
023: import org.kuali.kfs.KFSConstants;
024: import org.kuali.kfs.KFSPropertyConstants;
025: import org.kuali.module.gl.web.Constant;
026: import org.kuali.module.labor.LaborConstants;
027: import org.kuali.module.labor.bo.LaborCalculatedSalaryFoundationTracker;
028:
029: /**
030: * This class is used to generate the URL for the user-defined attributes for the Base Funds screen. It is entended the
031: * KualiInquirableImpl class, so it covers both the default implementation and customized implemetnation.
032: */
033: public class BaseFundsInquirableImpl extends
034: AbstractLaborInquirableImpl {
035: private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger
036: .getLogger(BaseFundsInquirableImpl.class);
037:
038: /**
039: * @see org.kuali.module.labor.web.inquirable.AbstractLaborInquirableImpl#buildUserDefinedAttributeKeyList()
040: */
041: protected List buildUserDefinedAttributeKeyList() {
042: List<String> keys = new ArrayList<String>();
043:
044: keys.add(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR);
045: keys.add(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE);
046: keys.add(KFSPropertyConstants.ACCOUNT_NUMBER);
047: keys.add(KFSPropertyConstants.SUB_ACCOUNT_NUMBER);
048: keys.add(KFSPropertyConstants.FINANCIAL_OBJECT_CODE);
049: keys.add(KFSPropertyConstants.FINANCIAL_SUB_OBJECT_CODE);
050:
051: return keys;
052: }
053:
054: /**
055: * @see org.kuali.module.labor.web.inquirable.AbstractLaborInquirableImpl#getUserDefinedAttributeMap()
056: */
057: protected Map getUserDefinedAttributeMap() {
058: Map userDefinedAttributeMap = new HashMap();
059: userDefinedAttributeMap.put(KFSPropertyConstants.CSF_AMOUNT,
060: KFSPropertyConstants.CSF_AMOUNT);
061: return userDefinedAttributeMap;
062: }
063:
064: /**
065: * @see org.kuali.module.labor.web.inquirable.AbstractLaborInquirableImpl#getAttributeName(java.lang.String)
066: */
067: protected String getAttributeName(String attributeName) {
068: return attributeName;
069: }
070:
071: /**
072: * @see org.kuali.module.labor.web.inquirable.AbstractLaborInquirableImpl#getKeyValue(java.lang.String, java.lang.Object)
073: */
074: protected Object getKeyValue(String keyName, Object keyValue) {
075: if (keyValue.toString().startsWith("-")) {
076: return keyValue;
077: }
078:
079: if (isExclusiveField(keyName, keyValue)) {
080: keyValue = Constant.EMPTY_STRING;
081: }
082: return keyValue;
083: }
084:
085: /**
086: * @see org.kuali.module.labor.web.inquirable.AbstractLaborInquirableImpl#getKeyName(java.lang.String)
087: */
088: protected String getKeyName(String keyName) {
089: return keyName;
090: }
091:
092: /**
093: * @see org.kuali.module.labor.web.inquirable.AbstractLaborInquirableImpl#getLookupableImplAttributeName()
094: */
095: protected String getLookupableImplAttributeName() {
096: return LaborConstants.LookupableBeanKeys.CSF_TRACKER;
097: }
098:
099: /**
100: * @see org.kuali.module.labor.web.inquirable.AbstractLaborInquirableImpl#getBaseUrl()
101: */
102: protected String getBaseUrl() {
103: return KFSConstants.GL_MODIFIED_INQUIRY_ACTION;
104: }
105:
106: /**
107: * @see org.kuali.module.labor.web.inquirable.AbstractLaborInquirableImpl#getInquiryBusinessObjectClass(java.lang.String)
108: */
109: protected Class getInquiryBusinessObjectClass(String attributeName) {
110: return LaborCalculatedSalaryFoundationTracker.class;
111: }
112: }
|