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