001    /*
002     * Copyright 2011 The Kuali Foundation.
003     * 
004     * Licensed under the Educational Community License, Version 2.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/ecl2.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.kfs.module.ld.businessobject.inquiry;
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.gl.Constant;
024    import org.kuali.kfs.gl.businessobject.lookup.BusinessObjectFieldConverter;
025    import org.kuali.kfs.module.ld.businessobject.LedgerBalance;
026    import org.kuali.kfs.sys.KFSConstants;
027    import org.kuali.kfs.sys.KFSPropertyConstants;
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 AbstractLaborInquirableImpl {
034        private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(EmployeeFundingInquirableImpl.class);
035    
036        /**
037         * @see org.kuali.kfs.module.ld.businessobject.inquiry.AbstractLaborInquirableImpl#buildUserDefinedAttributeKeyList()
038         */
039        protected List buildUserDefinedAttributeKeyList() {
040            List<String> keys = new ArrayList<String>();
041    
042            keys.add(KFSPropertyConstants.EMPLID);
043            keys.add(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR);
044            keys.add(KFSPropertyConstants.FINANCIAL_BALANCE_TYPE_CODE);
045    
046            return keys;
047        }
048    
049        /**
050         * @see org.kuali.kfs.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getUserDefinedAttributeMap()
051         */
052        protected Map getUserDefinedAttributeMap() {
053    
054            Map userDefinedAttributeMap = new HashMap();
055            userDefinedAttributeMap.put(KFSPropertyConstants.MONTH1_AMOUNT, "");
056            userDefinedAttributeMap.put(KFSPropertyConstants.FINANCIAL_BALANCE_TYPE_CODE, KFSConstants.BALANCE_TYPE_ACTUAL);
057            return userDefinedAttributeMap;
058        }
059    
060        /**
061         * @see org.kuali.kfs.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getAttributeName(java.lang.String)
062         */
063        protected String getAttributeName(String attributeName) {
064            return attributeName;
065        }
066    
067        /**
068         * @see org.kuali.kfs.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getKeyValue(java.lang.String, java.lang.Object)
069         */
070        protected Object getKeyValue(String keyName, Object keyValue) {
071            if (isExclusiveField(keyName, keyValue)) {
072                keyValue = Constant.EMPTY_STRING;
073            }
074            return keyValue;
075        }
076    
077        /**
078         * @see org.kuali.kfs.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getKeyName(java.lang.String)
079         */
080        protected String getKeyName(String keyName) {
081            keyName = BusinessObjectFieldConverter.convertToTransactionPropertyName(keyName);
082            return keyName;
083        }
084    
085        /**
086         * @see org.kuali.kfs.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getLookupableImplAttributeName()
087         */
088        protected String getLookupableImplAttributeName() {
089            return "employeeFundingLookupable";
090        }
091    
092        /**
093         * @see org.kuali.kfs.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getBaseUrl()
094         */
095        protected String getBaseUrl() {
096            return KFSConstants.GL_MODIFIED_INQUIRY_ACTION;
097        }
098    
099        /**
100         * @see org.kuali.kfs.gl.businessobject.inquiry.AbstractGeneralLedgerInquirableImpl#getInquiryBusinessObjectClass(String)
101         */
102        protected Class getInquiryBusinessObjectClass(String attributeName) {
103            return LedgerBalance.class;
104        }
105    }