1 package com.instantbank.servicing.control.web.handlers;
2
3 import java.util.HashMap;
4 import java.util.ArrayList;
5 import java.util.Enumeration;
6 import java.util.Hashtable;
7 import java.util.StringTokenizer;
8
9 import javax.servlet.http.HttpServletRequest;
10 import javax.servlet.http.HttpSession;
11 import javax.servlet.ServletContext;
12 import com.instantbank.common.utilcomponents.CodeDescription;
13 import com.instantbank.servicing.control.event.ParmRestrictionsEvent;
14 import com.instantbank.servicing.control.util.JSPUtil;
15 import com.instantbank.servicing.control.util.WebKeys;
16 import com.instantbank.common.utilcomponents.Debug;
17 import com.instantbank.common.utilcomponents.ServicingGlobals;
18 import com.instantbank.servicing.control.ServicingEventException;
19 import com.instantbank.component.parameter.util.*;
20
21
22
29 public class ParmRestrictionsFlowHandler
30 implements FlowHandler {
31 private Debug debug = null;
32
33
34
39 public void doStart(HttpServletRequest request) { }
40
41
42
51 public String processFlow(HttpServletRequest request, Object answer,
52 ServletContext context)
53 throws ServicingEventException {
54
55 debug = new Debug();
56 debug.setDebugginOn(true);
57 debug.setPreMessage("** ParmRestrictionsFlowHandler: ");
58 debug.println("processFlow");
59
60 HttpSession session = request.getSession();
61
62 String nextScreen = null;
63 ParmRestrictionsEvent ce = null;
64
65 if(request.getAttribute(WebKeys.ParmRestrictionsEvent) != null) {
66 ce = (ParmRestrictionsEvent)request.getAttribute(WebKeys.ParmRestrictionsEvent);
67 }
68
69 if(request.getAttribute(WebKeys.ExceptionOcurred) != null) {
70 nextScreen = "1";
71
72 }
73 else if(ce.getActionType() == ParmRestrictionsEvent.LIST_PARM_RESTRICTIONS) {
74
75
76 int i;
77
78
79 int j;
80 Hashtable tableCodes = new Hashtable();
81 ArrayList listCodes = new ArrayList();
82
83 listCodes = (ArrayList)answer;
84 for(i = 0; i < listCodes.size(); i++) {
85 ArrayList parm = new ArrayList(((GroupParm)(listCodes.get(i))).getGroup());
86 for(j = 0; j < parm.size(); j++) {
87 ParmRestriction parmCode = null;
88 ParmRestrictionUpdate parmUpdate = new ParmRestrictionUpdate("", "", "", "");
89 parmCode = (ParmRestriction)parm.get(j);
90
91 String code = parmCode.getCodeParameter();
92 tableCodes.put(code, parmUpdate);
93 }
94 }
95
96 session.setAttribute(WebKeys.ParmRestrictionsTable, tableCodes);
97
98
99 request.setAttribute(WebKeys.ParmRestrictionsList, answer);
100
101 nextScreen = "2";
102
103 }
104 else if(ce.getActionType() == ParmRestrictionsEvent.UPDATE_PARM_RESTRICTIONS) {
105
106
107
108
109 request.setAttribute
110 (WebKeys.ParmRestrictionsList, answer);
111
112 nextScreen = "2";
113
114 }
115 return nextScreen;
116 }
117
118
119
124 public void doEnd(HttpServletRequest request) { }
125 }
126
127