View Javadoc

1   /*
2    * Copyright 2007 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
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.rice.kew.removereplace.web;
17  
18  import java.util.ArrayList;
19  import java.util.List;
20  import java.util.Map;
21  
22  import org.apache.commons.collections.Factory;
23  import org.apache.commons.collections.ListUtils;
24  import org.kuali.rice.kew.removereplace.RemoveReplaceDocument;
25  import org.kuali.rice.kew.web.KewRoutingKualiForm;
26  import org.kuali.rice.kew.web.ShowHideTree;
27  import org.kuali.rice.kew.web.WorkflowRoutingForm;
28  import org.kuali.rice.kim.bo.Person;
29  
30  
31  /**
32   * A struts form for Remove/Replace.
33   *
34   * @author Kuali Rice Team (rice.collab@kuali.org)
35   */
36  public class RemoveReplaceForm extends KewRoutingKualiForm {
37  
38      private String methodToCall = "";
39      private String lookupableImplServiceName;
40      private String conversionFields;
41      private Map actionRequestCodes;
42      private String searchLink = "";
43      private String searchLinkText = "";
44  
45      // input fields
46      private String userId;
47      private String replacementUserId;
48      private String ruleDocumentTypeName;
49      private String ruleRuleTemplate;
50  
51      private String operation = RemoveReplaceDocument.REPLACE_OPERATION;
52      private List<RemoveReplaceRule> rules = ListUtils.lazyList(new ArrayList<RemoveReplaceRule>(),
53  	    new Factory() {
54  	     	public Object create() {
55  	     	    return new RemoveReplaceRule();
56  	     	}
57  	     });
58      private List<RemoveReplaceWorkgroup> workgroups = ListUtils.lazyList(new ArrayList<RemoveReplaceWorkgroup>(),
59  	    new Factory() {
60  	     	public Object create() {
61  	     	    return new RemoveReplaceWorkgroup();
62  	     	}
63  	     });
64  
65      // properties that are loaded by establishRequiredState
66      private Person user;
67      private Person replacementUser;
68  
69      private RemoveReplaceDocument document;
70  
71      private boolean operationSelected = false;
72      private ShowHideTree showHide = new ShowHideTree();
73      private boolean report = false;
74  
75      public RemoveReplaceForm() {
76      }
77  
78      public String getMethodToCall() {
79          return this.methodToCall;
80      }
81  
82      public void setMethodToCall(String methodToCall) {
83          this.methodToCall = methodToCall;
84      }
85  
86      public String getLookupableImplServiceName() {
87          return this.lookupableImplServiceName;
88      }
89  
90      public void setLookupableImplServiceName(String lookupableImplServiceName) {
91          this.lookupableImplServiceName = lookupableImplServiceName;
92      }
93  
94      public String getRuleDocumentTypeName() {
95          return this.ruleDocumentTypeName;
96      }
97  
98      public String getOperation() {
99          return this.operation;
100     }
101 
102     public void setOperation(String operation) {
103         this.operation = operation;
104     }
105 
106     public void setRuleDocumentTypeName(String ruleDocumentType) {
107         this.ruleDocumentTypeName = ruleDocumentType;
108     }
109 
110     public String getRuleRuleTemplate() {
111         return this.ruleRuleTemplate;
112     }
113 
114     public void setRuleRuleTemplate(String ruleRuleTemplate) {
115         this.ruleRuleTemplate = ruleRuleTemplate;
116     }
117 
118     public List<RemoveReplaceRule> getRules() {
119         return this.rules;
120     }
121 
122     public void setRules(List<RemoveReplaceRule> rules) {
123         this.rules = rules;
124     }
125 
126     public String getUserId() {
127         return this.userId;
128     }
129 
130     public void setUserId(String userId) {
131         this.userId = userId;
132     }
133 
134     public String getReplacementUserId() {
135         return this.replacementUserId;
136     }
137 
138     public void setReplacementUserId(String userIdToReplace) {
139         this.replacementUserId = userIdToReplace;
140     }
141 
142     public Person getUser() {
143         return this.user;
144     }
145 
146     public void setUser(Person user) {
147         this.user = user;
148     }
149 
150     public Person getReplacementUser() {
151         return this.replacementUser;
152     }
153 
154     public void setReplacementUser(Person replacementUser) {
155         this.replacementUser = replacementUser;
156     }
157 
158     public List<RemoveReplaceWorkgroup> getWorkgroups() {
159         return this.workgroups;
160     }
161 
162     public void setWorkgroups(List<RemoveReplaceWorkgroup> workgroups) {
163         this.workgroups = workgroups;
164     }
165 
166     public Map getActionRequestCodes() {
167         return this.actionRequestCodes;
168     }
169 
170     public void setActionRequestCodes(Map actionRequestCodes) {
171         this.actionRequestCodes = actionRequestCodes;
172     }
173 
174     public RemoveReplaceDocument getDocument() {
175         return this.document;
176     }
177 
178     public void setDocument(RemoveReplaceDocument document) {
179         this.document = document;
180     }
181 
182     public String getOperationDisplayName() {
183 	if (getOperation().equals(RemoveReplaceDocument.REMOVE_OPERATION)) {
184 	    return "Remove";
185 	} else if (getOperation().equals(RemoveReplaceDocument.REPLACE_OPERATION)) {
186 	    return "Replace";
187 	}
188 	return "";
189     }
190 
191     public boolean isReplace() {
192 	return getOperation().equals(RemoveReplaceDocument.REPLACE_OPERATION);
193     }
194 
195     public boolean isRemove() {
196 	return getOperation().equals(RemoveReplaceDocument.REMOVE_OPERATION);
197     }
198 
199     public boolean isOperationSelected() {
200         return this.operationSelected;
201     }
202 
203     public void setOperationSelected(boolean operationSelected) {
204         this.operationSelected = operationSelected;
205     }
206 
207     public String getConversionFields() {
208         return this.conversionFields;
209     }
210 
211     public void setConversionFields(String conversionFields) {
212         this.conversionFields = conversionFields;
213     }
214 
215     public ShowHideTree getShowHide() {
216         return this.showHide;
217     }
218 
219     public void setShowHide(ShowHideTree showHide) {
220         this.showHide = showHide;
221     }
222 
223     public boolean isReport() {
224         return this.report;
225     }
226 
227     public void setReport(boolean report) {
228         this.report = report;
229     }
230 
231     public String getSearchLink() {
232         return this.searchLink;
233     }
234 
235     public void setSearchLink(String searchLink) {
236         this.searchLink = searchLink;
237     }
238 
239     public String getSearchLinkText() {
240         return this.searchLinkText;
241     }
242 
243     public void setSearchLinkText(String searchLink) {
244         this.searchLinkText = searchLink;
245     }
246 
247 }