View Javadoc

1   /*
2    * Copyright 2008 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.fp.document.validation.impl;
17  
18  import org.kuali.ole.integration.cab.CapitalAssetBuilderModuleService;
19  import org.kuali.ole.sys.context.SpringContext;
20  import org.kuali.ole.sys.document.AccountingDocument;
21  import org.kuali.ole.sys.document.validation.GenericValidation;
22  import org.kuali.ole.sys.document.validation.event.AttributedDocumentEvent;
23  
24  /**
25   * validate the capital accounting lines associated with the accounting document for validation
26   */
27  public class ValidateAllCapitalAccountingLinesProcessed extends GenericValidation {
28      private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(ValidateAllCapitalAccountingLinesProcessed.class);
29  
30      private CapitalAssetBuilderModuleService capitalAssetBuilderModuleService;
31      private AccountingDocument accountingDocumentForValidation;
32  
33      /**
34       * @see org.kuali.ole.sys.document.validation.Validation#validate(org.kuali.ole.sys.document.validation.event.AttributedDocumentEvent)
35       */
36      public boolean validate(AttributedDocumentEvent event) {
37          capitalAssetBuilderModuleService = SpringContext.getBean(CapitalAssetBuilderModuleService.class);        
38          return capitalAssetBuilderModuleService.validateAllCapitalAccountingLinesProcessed(accountingDocumentForValidation);
39      }
40  
41      /**
42       * Sets the accountingDocumentForValidation attribute value.
43       * 
44       * @param accountingDocumentForValidation The accountingDocumentForValidation to set.
45       */
46      public void setAccountingDocumentForValidation(AccountingDocument accountingDocumentForValidation) {
47          this.accountingDocumentForValidation = accountingDocumentForValidation;
48      }
49  }