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.AddBudgetConstructionDocumentRule;
021    import org.kuali.kfs.module.bc.document.validation.AddPendingBudgetGeneralLedgerLineRule;
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 add (create) Budget Construction document event for the BC Selection screen.
028     */
029    public class AddBudgetConstructionDocumentEvent extends KualiDocumentEventBase {
030        private BudgetConstructionDocument budgetConstructionDocument;
031        
032        /**
033         * Constructs a AddBudgetConstructionDocumentEvent.java.
034         * @param errorPathPrefix
035         * @param document
036         */
037        public AddBudgetConstructionDocumentEvent(String errorPathPrefix, Document document){
038            super("", errorPathPrefix, document);
039            this.budgetConstructionDocument = (BudgetConstructionDocument) document;
040            
041        }
042    
043        /**
044         * @see org.kuali.rice.kns.rule.event.KualiDocumentEvent#getRuleInterfaceClass()
045         */
046        public Class getRuleInterfaceClass() {
047            return AddPendingBudgetGeneralLedgerLineRule.class;
048        }
049    
050        /**
051         * @see org.kuali.rice.kns.rule.event.KualiDocumentEvent#invokeRuleMethod(org.kuali.rice.kns.rule.BusinessRule)
052         */
053        public boolean invokeRuleMethod(BusinessRule rule) {
054            return ((AddBudgetConstructionDocumentRule) rule).processAddBudgetConstructionDocumentRules(budgetConstructionDocument);
055        }
056    
057        /**
058         * Gets the budgetConstructionDocument attribute. 
059         * @return Returns the budgetConstructionDocument.
060         */
061        public BudgetConstructionDocument getBudgetConstructionDocument() {
062            return budgetConstructionDocument;
063        }
064    
065        /**
066         * Sets the budgetConstructionDocument attribute value.
067         * @param budgetConstructionDocument The budgetConstructionDocument to set.
068         */
069        public void setBudgetConstructionDocument(BudgetConstructionDocument budgetConstructionDocument) {
070            this.budgetConstructionDocument = budgetConstructionDocument;
071        }
072    
073    }