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.BudgetConstructionMonthly;
019 import org.kuali.kfs.module.bc.businessobject.PendingBudgetConstructionGeneralLedger;
020 import org.kuali.kfs.module.bc.document.BudgetConstructionDocument;
021 import org.kuali.kfs.module.bc.document.validation.SaveMonthlyBudgetRule;
022 import org.kuali.rice.kns.document.Document;
023 import org.kuali.rice.kns.rule.BusinessRule;
024 import org.kuali.rice.kns.rule.event.KualiDocumentEventBase;
025
026 /**
027 * Defines the save monthly budget event for the monthly budget screen.
028 */
029 public class SaveMonthlyBudgetEvent extends KualiDocumentEventBase {
030
031 private BudgetConstructionDocument budgetConstructionDocument;
032 private BudgetConstructionMonthly budgetConstructionMonthly;
033
034 public SaveMonthlyBudgetEvent (String errorPathPrefix, Document document, BudgetConstructionMonthly budgetConstructionMonthly){
035 super("", errorPathPrefix, document);
036 this.budgetConstructionDocument = (BudgetConstructionDocument) document;
037 this.budgetConstructionMonthly = budgetConstructionMonthly;
038 }
039
040 /**
041 * @see org.kuali.rice.kns.rule.event.KualiDocumentEvent#getRuleInterfaceClass()
042 */
043 public Class getRuleInterfaceClass() {
044
045 return SaveMonthlyBudgetRule.class;
046 }
047
048 /**
049 * @see org.kuali.rice.kns.rule.event.KualiDocumentEvent#invokeRuleMethod(org.kuali.rice.kns.rule.BusinessRule)
050 */
051 public boolean invokeRuleMethod(BusinessRule rule) {
052
053 return ((SaveMonthlyBudgetRule<BudgetConstructionDocument, BudgetConstructionMonthly>) rule).processSaveMonthlyBudgetRules(budgetConstructionDocument, budgetConstructionMonthly);
054 }
055
056 /**
057 * Gets the budgetConstructionDocument attribute.
058 * @return Returns the budgetConstructionDocument.
059 */
060 public BudgetConstructionDocument getBudgetConstructionDocument() {
061 return budgetConstructionDocument;
062 }
063
064 /**
065 * Sets the budgetConstructionDocument attribute value.
066 * @param budgetConstructionDocument The budgetConstructionDocument to set.
067 */
068 public void setBudgetConstructionDocument(BudgetConstructionDocument budgetConstructionDocument) {
069 this.budgetConstructionDocument = budgetConstructionDocument;
070 }
071
072 /**
073 * Gets the budgetConstructionMonthly attribute.
074 * @return Returns the budgetConstructionMonthly.
075 */
076 public BudgetConstructionMonthly getBudgetConstructionMonthly() {
077 return budgetConstructionMonthly;
078 }
079
080 /**
081 * Sets the budgetConstructionMonthly attribute value.
082 * @param budgetConstructionMonthly The budgetConstructionMonthly to set.
083 */
084 public void setBudgetConstructionMonthly(BudgetConstructionMonthly budgetConstructionMonthly) {
085 this.budgetConstructionMonthly = budgetConstructionMonthly;
086 }
087
088 }