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.financial.web.struts.action;
17:
18: import javax.servlet.http.HttpServletRequest;
19: import javax.servlet.http.HttpServletResponse;
20:
21: import org.apache.struts.action.ActionForm;
22: import org.apache.struts.action.ActionForward;
23: import org.apache.struts.action.ActionMapping;
24: import org.kuali.core.util.GlobalVariables;
25: import org.kuali.core.web.struts.form.KualiDocumentFormBase;
26: import org.kuali.kfs.KFSKeyConstants;
27: import org.kuali.kfs.web.struts.action.KualiAccountingDocumentActionBase;
28: import org.kuali.module.financial.document.BudgetAdjustmentDocument;
29:
30: import edu.iu.uis.eden.exception.WorkflowException;
31:
32: /**
33: * This class handles specific Actions requests for the BudgetAdjustment.
34: */
35: public class BudgetAdjustmentAction extends
36: KualiAccountingDocumentActionBase {
37: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
38: .getLogger(BudgetAdjustmentAction.class);
39:
40: /**
41: * Do initialization for a new budget adjustment
42: *
43: * @see org.kuali.core.web.struts.action.KualiDocumentActionBase#createDocument(org.kuali.core.web.struts.form.KualiDocumentFormBase)
44: */
45: @Override
46: protected void createDocument(
47: KualiDocumentFormBase kualiDocumentFormBase)
48: throws WorkflowException {
49: super .createDocument(kualiDocumentFormBase);
50: ((BudgetAdjustmentDocument) kualiDocumentFormBase.getDocument())
51: .initiateDocument();
52:
53: }
54:
55: /**
56: * Add warning message about copying a document with generated labor benefits.
57: *
58: * @see org.kuali.core.web.struts.action.KualiTransactionalDocumentActionBase#copy(org.apache.struts.action.ActionMapping,
59: * org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
60: */
61: @Override
62: public ActionForward copy(ActionMapping mapping, ActionForm form,
63: HttpServletRequest request, HttpServletResponse response)
64: throws Exception {
65: GlobalVariables
66: .getMessageList()
67: .add(
68: KFSKeyConstants.WARNING_DOCUMENT_BA_COPY_LABOR_BENEFITS);
69: return super.copy(mapping, form, request, response);
70: }
71:
72: }
|