01: /*
02: * Copyright 2006-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.module.kra.service.impl;
17:
18: import org.kuali.module.kra.budget.document.BudgetDocument;
19: import org.kuali.module.kra.budget.service.BudgetService;
20: import org.kuali.module.kra.document.ResearchDocument;
21: import org.kuali.module.kra.routingform.document.RoutingFormDocument;
22: import org.kuali.module.kra.routingform.service.RoutingFormService;
23: import org.kuali.module.kra.service.ResearchDocumentService;
24: import org.springframework.transaction.annotation.Transactional;
25:
26: import edu.iu.uis.eden.exception.WorkflowException;
27:
28: @Transactional
29: public class ResearchDocumentServiceImpl implements
30: ResearchDocumentService {
31:
32: private BudgetService budgetService;
33: private RoutingFormService routingFormService;
34:
35: /**
36: * @see org.kuali.module.kra.budget.service.ResearchDocumentService#prepareResearchDocumentForSave(org.kuali.module.kra.budget.document.ResearchDocument)
37: */
38: public void prepareResearchDocumentForSave(
39: ResearchDocument researchDocument) throws WorkflowException {
40: if (researchDocument instanceof BudgetDocument) {
41: BudgetDocument budgetDocument = (BudgetDocument) researchDocument;
42: budgetService.prepareBudgetForSave(budgetDocument);
43: budgetDocument.setForceRefreshOfBOSubListsForSave(false);
44: } else if (researchDocument instanceof RoutingFormDocument) {
45: RoutingFormDocument routingFormDocument = (RoutingFormDocument) researchDocument;
46: routingFormService
47: .prepareRoutingFormForSave(routingFormDocument);
48: }
49: }
50:
51: public void setBudgetService(BudgetService budgetService) {
52: this .budgetService = budgetService;
53: }
54:
55: public void setRoutingFormService(
56: RoutingFormService routingFormService) {
57: this.routingFormService = routingFormService;
58: }
59: }
|