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.validation.event; 017 018 import org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionGeneralLedger; 019 import org.kuali.kfs.module.bc.document.BudgetConstructionDocument; 020 import org.kuali.kfs.module.bc.document.validation.DeletePendingBudgetGeneralLedgerLineRule; 021 import org.kuali.rice.kns.document.Document; 022 import org.kuali.rice.kns.rule.BusinessRule; 023 import org.kuali.rice.kns.rule.event.KualiDocumentEventBase; 024 025 /** 026 * Defines the delete line event for revenue or expenditure tab rows on the Budget Construction Document. 027 */ 028 public class DeletePendingBudgetGeneralLedgerLineEvent extends KualiDocumentEventBase { 029 030 private BudgetConstructionDocument budgetConstructionDocument; 031 private PendingBudgetConstructionGeneralLedger pendingBudgetConstructionGeneralLedger; 032 private boolean isRevenue; 033 034 /** 035 * Constructs a DeletePendingBudgetGeneralLedgerLineEvent.java. 036 * @param description 037 * @param errorPathPrefix 038 */ 039 public DeletePendingBudgetGeneralLedgerLineEvent(String errorPathPrefix, Document document, PendingBudgetConstructionGeneralLedger pendingBudgetConstructionGeneralLedger, boolean isRev) { 040 super("", errorPathPrefix, document); 041 this.pendingBudgetConstructionGeneralLedger = pendingBudgetConstructionGeneralLedger; 042 this.budgetConstructionDocument = (BudgetConstructionDocument) document; 043 this.isRevenue = isRev; 044 } 045 046 /** 047 * @see org.kuali.rice.kns.rule.event.KualiDocumentEvent#getRuleInterfaceClass() 048 */ 049 public Class getRuleInterfaceClass() { 050 return DeletePendingBudgetGeneralLedgerLineRule.class; 051 } 052 053 /** 054 * @see org.kuali.rice.kns.rule.event.KualiDocumentEvent#invokeRuleMethod(org.kuali.rice.kns.rule.BusinessRule) 055 */ 056 public boolean invokeRuleMethod(BusinessRule rule) { 057 return ((DeletePendingBudgetGeneralLedgerLineRule) rule).processDeletePendingBudgetGeneralLedgerLineRules(budgetConstructionDocument, pendingBudgetConstructionGeneralLedger, isRevenue); 058 } 059 060 /** 061 * Gets the budgetConstructionDocument attribute. 062 * @return Returns the budgetConstructionDocument. 063 */ 064 public BudgetConstructionDocument getBudgetConstructionDocument() { 065 return budgetConstructionDocument; 066 } 067 068 /** 069 * Sets the budgetConstructionDocument attribute value. 070 * @param budgetConstructionDocument The budgetConstructionDocument to set. 071 */ 072 public void setBudgetConstructionDocument(BudgetConstructionDocument budgetConstructionDocument) { 073 this.budgetConstructionDocument = budgetConstructionDocument; 074 } 075 076 /** 077 * Gets the isRevenue attribute. 078 * @return Returns the isRevenue. 079 */ 080 public boolean isRevenue() { 081 return isRevenue; 082 } 083 084 /** 085 * Sets the isRevenue attribute value. 086 * @param isRevenue The isRevenue to set. 087 */ 088 public void setRevenue(boolean isRevenue) { 089 this.isRevenue = isRevenue; 090 } 091 092 /** 093 * Gets the pendingBudgetConstructionGeneralLedger attribute. 094 * @return Returns the pendingBudgetConstructionGeneralLedger. 095 */ 096 public PendingBudgetConstructionGeneralLedger getPendingBudgetConstructionGeneralLedger() { 097 return pendingBudgetConstructionGeneralLedger; 098 } 099 100 /** 101 * Sets the pendingBudgetConstructionGeneralLedger attribute value. 102 * @param pendingBudgetConstructionGeneralLedger The pendingBudgetConstructionGeneralLedger to set. 103 */ 104 public void setPendingBudgetConstructionGeneralLedger(PendingBudgetConstructionGeneralLedger pendingBudgetConstructionGeneralLedger) { 105 this.pendingBudgetConstructionGeneralLedger = pendingBudgetConstructionGeneralLedger; 106 } 107 108 }