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 org.kuali.kfs.module.bc.document.dataaccess.BudgetOrganizationPushPullDao;
019 import org.kuali.kfs.module.bc.document.service.BudgetPushPullService;
020 import org.kuali.rice.kns.util.spring.Logged;
021 import org.springframework.transaction.annotation.Transactional;
022
023 /**
024 * Implements BudgetPushPullService by populating temporary tables with the potential set of documents to push down or pull up.
025 * The temporary tables are then used to drive the entire push down or pull up process. First, an attempt is made to place
026 * budget locks on each document. Successfully locked documents are then pushed down or pulled up by setting the associated
027 * BudgetConstructionHeader (ld_bcnstr_hdr_t) row with the appropriate level attribute values and releasing the locks.
028 */
029 @Transactional
030 public class BudgetPushPullServiceImpl implements BudgetPushPullService {
031 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(BudgetPushPullServiceImpl.class);
032
033 private BudgetOrganizationPushPullDao budgetOrganizationPushPullDao;
034
035 /**
036 * @see org.kuali.kfs.module.bc.document.service.BudgetPushPullService#pullupSelectedOrganizationDocuments(java.lang.String, java.lang.Integer, java.lang.String, java.lang.String)
037 */
038 public void pullupSelectedOrganizationDocuments(String principalId, Integer FiscalYear, String pointOfViewCharOfAccountsCode, String pointOfViewOrganizationCode) {
039 budgetOrganizationPushPullDao.pullupSelectedOrganizationDocuments(principalId, FiscalYear, pointOfViewCharOfAccountsCode, pointOfViewOrganizationCode);
040 }
041
042 /**
043 * @see org.kuali.kfs.module.bc.document.service.BudgetPushPullService#pushdownSelectedOrganizationDocuments(java.lang.String, java.lang.Integer, java.lang.String, java.lang.String)
044 */
045 public void pushdownSelectedOrganizationDocuments(String principalId, Integer FiscalYear, String pointOfViewCharOfAccountsCode, String pointOfViewOrganizationCode) {
046 budgetOrganizationPushPullDao.pushdownSelectedOrganizationDocuments(principalId, FiscalYear, pointOfViewCharOfAccountsCode, pointOfViewOrganizationCode);
047 }
048
049 /**
050 * @see org.kuali.kfs.module.bc.document.service.BudgetPushPullService#buildPullUpBudgetedDocuments(java.lang.String, java.lang.Integer, java.lang.String, java.lang.String)
051 */
052 public int buildPullUpBudgetedDocuments(String principalId, Integer FiscalYear, String pointOfViewCharOfAccountsCode, String pointOfViewOrganizationCode) {
053 return budgetOrganizationPushPullDao.buildPullUpBudgetedDocuments(principalId, FiscalYear, pointOfViewCharOfAccountsCode, pointOfViewOrganizationCode);
054 }
055
056 /**
057 * @see org.kuali.kfs.module.bc.document.service.BudgetPushPullService#buildPushDownBudgetedDocuments(java.lang.String, java.lang.Integer, java.lang.String, java.lang.String)
058 */
059 public int buildPushDownBudgetedDocuments(String principalId, Integer FiscalYear, String pointOfViewCharOfAccountsCode, String pointOfViewOrganizationCode) {
060 return budgetOrganizationPushPullDao.buildPushDownBudgetedDocuments(principalId, FiscalYear, pointOfViewCharOfAccountsCode, pointOfViewOrganizationCode);
061 }
062
063 /**
064 * Sets the budgetOrganizationPushPullDao attribute value.
065 * @param budgetOrganizationPushPullDao The budgetOrganizationPushPullDao to set.
066 */
067 public void setBudgetOrganizationPushPullDao(BudgetOrganizationPushPullDao budgetOrganizationPushPullDao) {
068 this.budgetOrganizationPushPullDao = budgetOrganizationPushPullDao;
069 }
070
071
072
073 }
074