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.doctype.web;
018:
019: import java.util.ArrayList;
020: import java.util.List;
021:
022: import edu.iu.uis.eden.EdenConstants;
023: import edu.iu.uis.eden.KEWServiceLocator;
024: import edu.iu.uis.eden.doctype.DocumentType;
025: import edu.iu.uis.eden.doctype.DocumentTypeService;
026: import edu.iu.uis.eden.routetemplate.RuleAttribute;
027: import edu.iu.uis.eden.web.WorkflowRoutingForm;
028:
029: /**
030: * Struts form for {@link DocumentTypeAction}
031: *
032: * @author rkirkend
033: */
034: public class DocumentTypeForm extends WorkflowRoutingForm {
035: private static final long serialVersionUID = 6490421152680911514L;
036: private DocumentType documentType;
037: private String exportedXml; // used for report screen XML output
038: private DocumentType existingDocumentType;
039: private String methodToCall = "";
040: private String command;
041: private Integer routeLevelIndex;
042: private Integer searchableAttributeIndex;
043: private String lookupType;
044: private String parentDocTypeName;
045: private String annotation;
046: private boolean docTypeVisible;
047: private boolean policyVisible;
048: private boolean routeLevelVisible;
049: private boolean searchableAttributeVisible;
050: private String visibleSelected;
051: private RuleAttribute searchableAttribute;
052: private Boolean editingRouteLevelInd;
053: private Long docTypeId;
054: private List routeModules;
055: private Integer moveRouteLevel;
056: private int routeLevelSize;
057: private int searchableAttributeSize;
058: private String routeModuleName;
059: private String newRouteModuleName;
060: private String ruleTemplate;
061: private String newRouteModuleVisible;
062:
063: private String defaultApprove;
064: private String preApprove;
065: private String initiatorMustRoute;
066: private String initiatorMustSave;
067:
068: private String lookupableImplServiceName;
069:
070: public DocumentTypeForm() {
071: documentType = new DocumentType();
072: searchableAttribute = new RuleAttribute();
073: editingRouteLevelInd = new Boolean(false);
074: }
075:
076: public String getDefaultApprove() {
077: return defaultApprove;
078: }
079:
080: public void setDefaultApprove(String defaultApprove) {
081: this .defaultApprove = defaultApprove;
082: }
083:
084: public String getPreApprove() {
085: return preApprove;
086: }
087:
088: public void setPreApprove(String preApprove) {
089: this .preApprove = preApprove;
090: }
091:
092: public DocumentType getDocumentType() {
093: return documentType;
094: }
095:
096: public void setDocumentType(DocumentType documentType) {
097: this .documentType = documentType;
098: }
099:
100: public String getExportedXml() {
101: return exportedXml;
102: }
103:
104: public void setExportedXml(String exportedXml) {
105: this .exportedXml = exportedXml;
106: }
107:
108: public DocumentType getExistingDocumentType() {
109: return existingDocumentType;
110: }
111:
112: public void setExistingDocumentType(
113: DocumentType existingDocumentType) {
114: this .existingDocumentType = existingDocumentType;
115: }
116:
117: public String getMethodToCall() {
118: return methodToCall;
119: }
120:
121: public void setMethodToCall(String methodToCall) {
122: this .methodToCall = methodToCall;
123: }
124:
125: public String getAnnotation() {
126: return annotation;
127: }
128:
129: public void setAnnotation(String annotation) {
130: this .annotation = annotation;
131: }
132:
133: public Integer getRouteLevelIndex() {
134: return routeLevelIndex;
135: }
136:
137: public void setRouteLevelIndex(Integer routeLevelIndex) {
138: this .routeLevelIndex = routeLevelIndex;
139: }
140:
141: /**
142: * @param searchableAttributeIndex The searchableAttributeIndex to set.
143: */
144: public void setSearchableAttributeIndex(
145: Integer searchableAttributeIndex) {
146: this .searchableAttributeIndex = searchableAttributeIndex;
147: }
148:
149: /**
150: * @return Returns the searchableAttributeIndex.
151: */
152: public Integer getSearchableAttributeIndex() {
153: return searchableAttributeIndex;
154: }
155:
156: /**
157: * set variables on form from lookup return value
158: */
159: public void setDocTypeFullName(String docTypeFullName) {
160: if (docTypeFullName != null && !docTypeFullName.equals("")) {
161: this .setParentDocTypeName(docTypeFullName);
162:
163: this .documentType
164: .setDocTypeParentId(getDocumentTypeService()
165: .findByName(docTypeFullName)
166: .getDocumentTypeId());
167: this .documentType.getPreApprovePolicy()
168: .setPolicyValue(null);
169: this .documentType.getDefaultApprovePolicy().setPolicyValue(
170: null);
171: this .documentType.getInitiatorMustRoutePolicy()
172: .setPolicyValue(null);
173: this .documentType.getInitiatorMustSavePolicy()
174: .setPolicyValue(null);
175:
176: defaultApprove = EdenConstants.INHERITED_CD;
177: preApprove = EdenConstants.INHERITED_CD;
178: initiatorMustRoute = EdenConstants.INHERITED_CD;
179: initiatorMustSave = EdenConstants.INHERITED_CD;
180:
181: documentType.setRouteLevels(new ArrayList());
182:
183: //documentType.setSearchableAttributesInherited(new Boolean(true));
184: setSearchableAttribute(new RuleAttribute());
185: documentType.setDocumentTypeAttributes(new ArrayList());
186: } else {
187: documentType.setRouteLevels(new ArrayList());
188: documentType.setDocumentTypeAttributes(new ArrayList());
189: //DocumentTypeAction.clearParent(this);
190: }
191: setEditingRouteLevelInd(new Boolean(false));
192: }
193:
194: // public void setSuperUserWorkgroupId(String workgroupId) throws Exception {
195: // if (workgroupId != null && !workgroupId.equals("")) {
196: // this.documentType.setWorkgroupId(new Long(workgroupId));
197: // } else {
198: // this.documentType.setWorkgroupId(null);
199: // }
200: // }
201: //
202: // public void setBlanketApproveWorkgroupId(String workgroupId) throws Exception {
203: // if (workgroupId != null && !workgroupId.equals("")) {
204: // this.documentType.setBlanketApproveWorkgroupId(new Long(workgroupId));
205: // } else {
206: // this.documentType.setBlanketApproveWorkgroupId(null);
207: // }
208: // }
209:
210: private DocumentTypeService getDocumentTypeService() {
211: return (DocumentTypeService) KEWServiceLocator
212: .getService(KEWServiceLocator.DOCUMENT_TYPE_SERVICE);
213: }
214:
215: public String getParentDocTypeName() {
216: return parentDocTypeName;
217: }
218:
219: public void setParentDocTypeName(String parentDocTypeName) {
220: this .parentDocTypeName = parentDocTypeName;
221: }
222:
223: public boolean isDocTypeVisible() {
224: return docTypeVisible;
225: }
226:
227: public void setDocTypeVisible(boolean docTypeVisible) {
228: this .docTypeVisible = docTypeVisible;
229: }
230:
231: public String getLookupableImplServiceName() {
232: return lookupableImplServiceName;
233: }
234:
235: public void setLookupableImplServiceName(
236: String lookupableImplServiceName) {
237: this .lookupableImplServiceName = lookupableImplServiceName;
238: }
239:
240: public boolean isPolicyVisible() {
241: return policyVisible;
242: }
243:
244: public void setPolicyVisible(boolean policyVisible) {
245: this .policyVisible = policyVisible;
246: }
247:
248: public boolean isRouteLevelVisible() {
249: return routeLevelVisible;
250: }
251:
252: public void setRouteLevelVisible(boolean routeLevelVisible) {
253: this .routeLevelVisible = routeLevelVisible;
254: }
255:
256: public boolean isSearchableAttributeVisible() {
257: return searchableAttributeVisible;
258: }
259:
260: public void setSearchableAttributeVisible(
261: boolean searchableAttributeVisible) {
262: this .searchableAttributeVisible = searchableAttributeVisible;
263: }
264:
265: public String getVisibleSelected() {
266: return visibleSelected;
267: }
268:
269: public void setVisibleSelected(String visibleSelected) {
270: this .visibleSelected = visibleSelected;
271: }
272:
273: public Integer getMoveRouteLevel() {
274: return moveRouteLevel;
275: }
276:
277: public void setMoveRouteLevel(Integer moveRouteLevel) {
278: this .moveRouteLevel = moveRouteLevel;
279: }
280:
281: public int getRouteLevelSize() {
282: return routeLevelSize;
283: }
284:
285: public void setRouteLevelSize(int routeLevelSize) {
286: this .routeLevelSize = routeLevelSize;
287: }
288:
289: /**
290: * @param searchableAttributeSize The searchableAttributeSize to set.
291: */
292: public void setSearchableAttributeSize(int searchableAttributeSize) {
293: this .searchableAttributeSize = searchableAttributeSize;
294: }
295:
296: /**
297: * @return Returns the searchableAttributeSize.
298: */
299: public int getSearchableAttributeSize() {
300: return searchableAttributeSize;
301: }
302:
303: public String getLookupType() {
304: return lookupType;
305: }
306:
307: public void setLookupType(String lookupType) {
308: this .lookupType = lookupType;
309: }
310:
311: /**
312: * @param searchableAttribute The searchableAttribute to set.
313: */
314: public void setSearchableAttribute(RuleAttribute searchableAttribute) {
315: this .searchableAttribute = searchableAttribute;
316: }
317:
318: /**
319: * @return Returns the searchableAttribute.
320: */
321: public RuleAttribute getSearchableAttribute() {
322: return searchableAttribute;
323: }
324:
325: public Boolean getEditingRouteLevelInd() {
326: return editingRouteLevelInd;
327: }
328:
329: public void setEditingRouteLevelInd(Boolean editingRouteLevelInd) {
330: this .editingRouteLevelInd = editingRouteLevelInd;
331: }
332:
333: public String getCommand() {
334: return command;
335: }
336:
337: public void setCommand(String command) {
338: this .command = command;
339: }
340:
341: public String getSearchLink() {
342: return "Lookup.do?lookupableImplServiceName=DocumentTypeLookupableImplService";
343: }
344:
345: public String getSearchLinkText() {
346: return "Document Type Search";
347: }
348:
349: public Long getDocTypeId() {
350: return docTypeId;
351: }
352:
353: public void setDocTypeId(Long docTypeId) {
354: this .docTypeId = docTypeId;
355: }
356:
357: public String getInitiatorMustRoute() {
358: return initiatorMustRoute;
359: }
360:
361: public void setInitiatorMustRoute(String intiatorMustRoute) {
362: this .initiatorMustRoute = intiatorMustRoute;
363: }
364:
365: public String getInitiatorMustSave() {
366: return initiatorMustSave;
367: }
368:
369: public void setInitiatorMustSave(String intiatorMustSave) {
370: this .initiatorMustSave = intiatorMustSave;
371: }
372:
373: public List getRouteModules() {
374: return routeModules;
375: }
376:
377: public void setRouteModules(List routeModules) {
378: this .routeModules = routeModules;
379: }
380:
381: public String getRouteModuleName() {
382: return routeModuleName;
383: }
384:
385: public void setRouteModuleName(String routeModuleName) {
386: this .routeModuleName = routeModuleName;
387: }
388:
389: public String getNewRouteModuleName() {
390: return newRouteModuleName;
391: }
392:
393: public void setNewRouteModuleName(String newRouteModuleName) {
394: this .newRouteModuleName = newRouteModuleName;
395: }
396:
397: public String getNewRouteModuleVisible() {
398: return newRouteModuleVisible;
399: }
400:
401: public void setNewRouteModuleVisible(String newRouteModuleVisible) {
402: this .newRouteModuleVisible = newRouteModuleVisible;
403: }
404:
405: public String getRuleTemplate() {
406: return ruleTemplate;
407: }
408:
409: public void setRuleTemplate(String ruleTemplate) {
410: this.ruleTemplate = ruleTemplate;
411: }
412: }
|