001: /*
002: * Copyright 2005-2006 The Kuali Foundation.
003: *
004: *
005: * Licensed under the Educational Community License, Version 1.0 (the "License");
006: * you may not use this file except in compliance with the License.
007: * You may obtain a copy of the License at
008: *
009: * http://www.opensource.org/licenses/ecl1.php
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package edu.iu.uis.eden.superuser.web;
018:
019: import java.util.ArrayList;
020: import java.util.HashSet;
021: import java.util.List;
022: import java.util.Set;
023:
024: import javax.servlet.http.HttpServletRequest;
025:
026: import org.apache.struts.action.ActionMapping;
027:
028: import edu.iu.uis.eden.EdenConstants;
029: import edu.iu.uis.eden.clientapp.WorkflowInfo;
030: import edu.iu.uis.eden.doctype.DocumentType;
031: import edu.iu.uis.eden.routeheader.DocumentRouteHeaderValue;
032: import edu.iu.uis.eden.web.KeyValue;
033: import edu.iu.uis.eden.web.WorkflowRoutingForm;
034:
035: /**
036: * A Struts ActionForm for the {@link SuperUserAction}.
037: *
038: * @author bmcgough
039: * @author xqi
040: * @author temay
041: * @author rkirkend
042: */
043: public class SuperUserForm extends WorkflowRoutingForm {
044:
045: private static final long serialVersionUID = 982228198266403397L;
046: private Long routeHeaderId;
047: private String docHandlerUrl;
048: private Integer routeLevel;
049: private Set futureNodeNames = new HashSet();
050: private String destNodeName;
051: private String returnDestNodeName;
052: private String action;
053: private List actionRequests = new ArrayList();
054: private String actionTakenActionRequestId;
055: private String actionTakenNetworkId;
056: private String actionTakenWorkGroupId;
057: private String actionTakenRecipientCode;
058: private boolean authorized;
059: private boolean blanketApprove;
060: private String methodToCall = "";
061:
062: private String lookupableImplServiceName;
063: private String lookupType;
064:
065: private DocumentRouteHeaderValue routeHeader;
066:
067: public String getMethodToCall() {
068: return methodToCall;
069: }
070:
071: public void setMethodToCall(String methodToCall) {
072: this .methodToCall = methodToCall;
073: }
074:
075: public boolean isBlanketApprove() {
076: return blanketApprove;
077: }
078:
079: public void setBlanketApprove(boolean blanketApprove) {
080: this .blanketApprove = blanketApprove;
081: }
082:
083: public DocumentRouteHeaderValue getRouteHeader() {
084: return routeHeader;
085: }
086:
087: public void setRouteHeader(DocumentRouteHeaderValue routeHeader) {
088: this .routeHeader = routeHeader;
089: }
090:
091: public Long getRouteHeaderId() {
092: return routeHeaderId;
093: }
094:
095: public void setRouteHeaderId(Long routeHeaderId) {
096: this .routeHeaderId = routeHeaderId;
097: }
098:
099: public String getDocHandlerUrl() {
100: return docHandlerUrl;
101: }
102:
103: public void setDocHandlerUrl(String docHandlerUrl) {
104: this .docHandlerUrl = docHandlerUrl;
105: }
106:
107: public String getRouteHeaderIdString() {
108: return routeHeaderId.toString();
109: }
110:
111: public Integer getRouteLevel() {
112: return routeLevel;
113: }
114:
115: public void setRouteLevel(Integer routeLevel) {
116: this .routeLevel = routeLevel;
117: }
118:
119: public String getAction() {
120: return action;
121: }
122:
123: public void setAction(String action) {
124: this .action = action;
125: }
126:
127: public List getActionRequests() {
128: return actionRequests;
129: }
130:
131: public void setActionRequests(List actionRequests) {
132: this .actionRequests = actionRequests;
133: }
134:
135: public String getActionTakenActionRequestId() {
136: return actionTakenActionRequestId;
137: }
138:
139: public void setActionTakenActionRequestId(
140: String actionTakenActionRequestId) {
141: this .actionTakenActionRequestId = actionTakenActionRequestId;
142: }
143:
144: public String getActionTakenNetworkId() {
145: return actionTakenNetworkId;
146: }
147:
148: public void setActionTakenNetworkId(String actionTakenNetworkId) {
149: this .actionTakenNetworkId = actionTakenNetworkId;
150: }
151:
152: public String getActionTakenWorkGroupId() {
153: return actionTakenWorkGroupId;
154: }
155:
156: public void setActionTakenWorkGroupId(String actionTakenWorkGroupId) {
157: this .actionTakenWorkGroupId = actionTakenWorkGroupId;
158: }
159:
160: /*public List getRouteLevels() {
161: return routeLevels;
162: }
163:
164: public void setRouteLevels(List routeLevels) {
165: this.routeLevels = routeLevels;
166: }*/
167:
168: public boolean isAuthorized() {
169: return authorized;
170: }
171:
172: public void setAuthorized(boolean authorized) {
173: this .authorized = authorized;
174: }
175:
176: public void reset(ActionMapping mapping, HttpServletRequest request) {
177: this .futureNodeNames = new HashSet();
178: }
179:
180: public String getActionTakenRecipientCode() {
181: return actionTakenRecipientCode;
182: }
183:
184: public void setActionTakenRecipientCode(
185: String actionTakenRecipientCode) {
186: this .actionTakenRecipientCode = actionTakenRecipientCode;
187: }
188:
189: public boolean isSUDocument() {
190: if (EdenConstants.ROUTE_HEADER_INITIATED_CD.equals(routeHeader
191: .getDocRouteStatus())
192: || EdenConstants.ROUTE_HEADER_SAVED_CD
193: .equals(routeHeader.getDocRouteStatus())) {
194: return false;
195: }
196: return true;
197: }
198:
199: public DocumentType getDocumentType() {
200: return getRouteHeader().getDocumentType();
201: }
202:
203: public Set getPreviousNodes() throws Exception {
204: String[] nodeNames = new WorkflowInfo()
205: .getPreviousRouteNodeNames(routeHeader
206: .getRouteHeaderId());
207: Set previousNodes = new HashSet();
208: for (int i = 0; i < nodeNames.length; i++) {
209: String nodeName = nodeNames[i];
210: previousNodes.add(new KeyValue(nodeName, nodeName));
211: }
212: return previousNodes;
213: }
214:
215: public String getDestNodeName() {
216: return destNodeName;
217: }
218:
219: public void setDestNodeName(String previousNodeName) {
220: this .destNodeName = previousNodeName;
221: }
222:
223: public Set getFutureNodeNames() {
224: return futureNodeNames;
225: }
226:
227: public void setFutureNodeNames(Set futureNodeNames) {
228: this .futureNodeNames = futureNodeNames;
229: }
230:
231: public String getReturnDestNodeName() {
232: return returnDestNodeName;
233: }
234:
235: public void setReturnDestNodeName(String returnDestNodeName) {
236: this .returnDestNodeName = returnDestNodeName;
237: }
238:
239: public String getLookupableImplServiceName() {
240: return lookupableImplServiceName;
241: }
242:
243: public void setLookupableImplServiceName(
244: String lookupableImplServiceName) {
245: this .lookupableImplServiceName = lookupableImplServiceName;
246: }
247:
248: public String getLookupType() {
249: return lookupType;
250: }
251:
252: public void setLookupType(String lookupType) {
253: this.lookupType = lookupType;
254: }
255:
256: }
|