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.coa.service.impl;
017    
018    import org.kuali.kfs.coa.businessobject.SubObjectCode;
019    import org.kuali.kfs.coa.dataaccess.SubObjectCodeDao;
020    import org.kuali.kfs.coa.service.SubObjectCodeService;
021    import org.kuali.kfs.sys.service.NonTransactional;
022    import org.kuali.kfs.sys.service.UniversityDateService;
023    
024    /**
025     * This class is the service implementation for the SubObjectCode structure. This is the default implementation that gets delivered
026     * with Kuali.
027     */
028    
029    @NonTransactional
030    public class SubObjectCodeServiceImpl implements SubObjectCodeService {
031        private SubObjectCodeDao subObjectCodeDao;
032        private UniversityDateService universityDateService;
033    
034        /**
035         * @see org.kuali.kfs.coa.service.SubObjectCodeService#getByPrimaryId(java.lang.Integer, java.lang.String,
036         *      java.lang.String, java.lang.String, java.lang.String)
037         */
038        public SubObjectCode getByPrimaryId(Integer universityFiscalYear, String chartOfAccountsCode, String accountNumber, String financialObjectCode, String financialSubObjectCode) {
039            return subObjectCodeDao.getByPrimaryId(universityFiscalYear, chartOfAccountsCode, accountNumber, financialObjectCode, financialSubObjectCode);
040        }
041    
042        /**
043         * @see org.kuali.kfs.coa.service.SubObjectCodeService#getByPrimaryIdForCurrentYear(java.lang.String, java.lang.String,
044         *      java.lang.String, java.lang.String)
045         */
046        public SubObjectCode getByPrimaryIdForCurrentYear(String chartOfAccountsCode, String accountNumber, String financialObjectCode, String financialSubObjectCode) {
047            return this.getByPrimaryId(universityDateService.getCurrentFiscalYear(), chartOfAccountsCode, accountNumber, financialObjectCode, financialSubObjectCode);
048        }
049    
050        /**
051         * 
052         * This method injects SubObjectCodeDao
053         * @param subObjectCodeDao
054         */
055        public void setSubObjectCodeDao(SubObjectCodeDao subObjectCodeDao) {
056            this.subObjectCodeDao = subObjectCodeDao;
057        }
058    
059        /**
060         * 
061         * This method injects UniversityDateService
062         * @param universityDateService
063         */
064        public void setUniversityDateService(UniversityDateService universityDateService) {
065            this.universityDateService = universityDateService;
066        }
067    }