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.bc.document.service.impl;
017
018 import java.util.Collection;
019 import java.util.List;
020 import java.util.Map;
021
022 import org.apache.commons.lang.StringUtils;
023 import org.kuali.kfs.module.bc.businessobject.BudgetConstructionOrganizationReports;
024 import org.kuali.kfs.module.bc.document.dataaccess.BudgetConstructionOrganizationReportsDao;
025 import org.kuali.kfs.module.bc.document.service.BudgetConstructionOrganizationReportsService;
026 import org.springframework.transaction.annotation.Transactional;
027
028 /**
029 * Implements the getByPrimaryId method defined by BudgetConstructionOrganizationReportsService.
030 *
031 * @param chartOfAccountsCode The FIN_COA_CD that is being searched for
032 * @param organizationCode the ORG_CD that is being searched for
033 * @return BudgetConstructionOrganizationReports Business Object
034 * @see org.kuali.kfs.module.bc.document.service.BudgetConstructionOrganizationReportsService#getByPrimaryId(java.lang.String,
035 * java.lang.String)
036 */
037 @Transactional
038 public class BudgetConstructionOrganizationReportsServiceImpl implements BudgetConstructionOrganizationReportsService {
039
040 private BudgetConstructionOrganizationReportsDao budgetConstructionOrganizationReportsDao;
041
042 /**
043 * @see org.kuali.kfs.module.bc.document.service.BudgetConstructionOrganizationReportsService#getByPrimaryId(java.lang.String,
044 * java.lang.String)
045 */
046 public BudgetConstructionOrganizationReports getByPrimaryId(String chartOfAccountsCode, String organizationCode) {
047 return budgetConstructionOrganizationReportsDao.getByPrimaryId(chartOfAccountsCode, organizationCode);
048 }
049
050 public List getBySearchCriteria(Class cls, Map searchCriteria) {
051 return (List)budgetConstructionOrganizationReportsDao.getBySearchCriteria(cls, searchCriteria);
052 }
053
054 public List getBySearchCriteriaOrderByList(Class cls, Map searchCriteria, List<String> orderList) {
055 return (List)budgetConstructionOrganizationReportsDao.getBySearchCriteriaWithOrderByList(cls, searchCriteria, orderList);
056 }
057
058 /**
059 * @see org.kuali.kfs.module.bc.document.service.BudgetConstructionOrganizationReportsService#getActiveChildOrgs(java.lang.String,
060 * java.lang.String)
061 */
062 public List getActiveChildOrgs(String chartOfAccountsCode, String organizationCode) {
063
064 if (StringUtils.isBlank(chartOfAccountsCode)) {
065 throw new IllegalArgumentException("String parameter chartOfAccountsCode was null or blank.");
066 }
067 if (StringUtils.isBlank(organizationCode)) {
068 throw new IllegalArgumentException("String parameter organizationCode was null or blank.");
069 }
070
071 return budgetConstructionOrganizationReportsDao.getActiveChildOrgs(chartOfAccountsCode, organizationCode);
072 }
073
074 /**
075 * Gets the budgetConstructionOrganizationReportsDao attribute.
076 *
077 * @return Returns the budgetConstructionOrganizationReportsDao.
078 */
079 public BudgetConstructionOrganizationReportsDao getBudgetConstructionOrganizationReportsDao() {
080 return budgetConstructionOrganizationReportsDao;
081 }
082
083 /**
084 * Sets the budgetConstructionOrganizationReportsDao attribute value.
085 *
086 * @param budgetConstructionOrganizationReportsDao The budgetConstructionOrganizationReportsDao to set.
087 */
088 public void setBudgetConstructionOrganizationReportsDao(BudgetConstructionOrganizationReportsDao budgetConstructionOrganizationReportsDao) {
089 this.budgetConstructionOrganizationReportsDao = budgetConstructionOrganizationReportsDao;
090 }
091
092 /**
093 * @see org.kuali.kfs.module.bc.document.service.BudgetConstructionOrganizationReportsService#isLeafOrg(java.lang.String,
094 * java.lang.String)
095 */
096 public boolean isLeafOrg(String chartOfAccountsCode, String organizationCode) {
097
098 if (StringUtils.isBlank(chartOfAccountsCode)) {
099 throw new IllegalArgumentException("String parameter chartOfAccountsCode was null or blank.");
100 }
101 if (StringUtils.isBlank(organizationCode)) {
102 throw new IllegalArgumentException("String parameter organizationCode was null or blank.");
103 }
104
105 return budgetConstructionOrganizationReportsDao.isLeafOrg(chartOfAccountsCode, organizationCode);
106 }
107
108 }