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