01: /*
02: * Copyright 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: /*
17: * Created on Nov 2, 2004
18: *
19: */
20: package org.kuali.module.pdp.action.format;
21:
22: import javax.servlet.http.HttpServletRequest;
23: import javax.servlet.http.HttpServletResponse;
24:
25: import org.apache.struts.action.ActionForm;
26: import org.apache.struts.action.ActionForward;
27: import org.apache.struts.action.ActionMapping;
28: import org.kuali.kfs.context.SpringContext;
29: import org.kuali.module.pdp.action.BaseAction;
30: import org.kuali.module.pdp.service.FormatService;
31: import org.kuali.module.pdp.service.SecurityRecord;
32:
33: /**
34: * @author delyea
35: */
36: public class FormatResetAction extends BaseAction {
37: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
38: .getLogger(FormatResetAction.class);
39: private FormatService formatService;
40:
41: public FormatResetAction() {
42: super ();
43: setFormatService(SpringContext.getBean(FormatService.class));
44: }
45:
46: public void setFormatService(FormatService fas) {
47: formatService = fas;
48: }
49:
50: protected boolean isAuthorized(ActionMapping mapping,
51: ActionForm form, HttpServletRequest request,
52: HttpServletResponse response) {
53: SecurityRecord sr = getSecurityRecord(request);
54: return sr.isProcessRole();
55: }
56:
57: protected ActionForward executeLogic(ActionMapping mapping,
58: ActionForm form, HttpServletRequest request,
59: HttpServletResponse response) throws Exception {
60: LOG.debug("executeLogic() started");
61:
62: Integer procId = new Integer(request.getParameter("processId"));
63:
64: if ((procId != new Integer(0)) && (procId != null)) {
65: formatService.resetFormatPayments(procId);
66: }
67:
68: return mapping.findForward("selection");
69: }
70: }
|