Source Code Cross Referenced for DocumentTypeAction.java in  » ERP-CRM-Financial » Kuali-Financial-System » edu » iu » uis » eden » doctype » web » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ERP CRM Financial » Kuali Financial System » edu.iu.uis.eden.doctype.web 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


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.List;
020:
021:        import javax.servlet.http.HttpServletRequest;
022:        import javax.servlet.http.HttpServletResponse;
023:
024:        import org.apache.struts.action.ActionForm;
025:        import org.apache.struts.action.ActionForward;
026:        import org.apache.struts.action.ActionMapping;
027:        import org.apache.struts.action.ActionMessages;
028:
029:        import edu.iu.uis.eden.KEWServiceLocator;
030:        import edu.iu.uis.eden.clientapp.WorkflowDocument;
031:        import edu.iu.uis.eden.clientapp.vo.WorkflowIdVO;
032:        import edu.iu.uis.eden.doctype.DocumentType;
033:        import edu.iu.uis.eden.doctype.DocumentTypeService;
034:        import edu.iu.uis.eden.export.ExportDataSet;
035:        import edu.iu.uis.eden.export.ExportFormat;
036:        import edu.iu.uis.eden.services.ServiceConstants;
037:        import edu.iu.uis.eden.web.WorkflowAction;
038:        import edu.iu.uis.eden.workgroup.GroupNameId;
039:        import edu.iu.uis.eden.workgroup.WorkgroupService;
040:
041:        /**
042:         * Action for doing document type stuff from the web.  This is exists for reporting purposes 
043:         * only at this point.
044:         *
045:         * @author rkirkend
046:         * @author ewestfal
047:         */
048:        public class DocumentTypeAction extends WorkflowAction {
049:            private static String DOCUMENT_TYPE = "EDENSERVICE-DOCS.DocumentType";
050:
051:            public ActionForward start(ActionMapping mapping, ActionForm form,
052:                    HttpServletRequest request, HttpServletResponse response)
053:                    throws Exception {
054:                DocumentTypeForm documentTypeForm = (DocumentTypeForm) form;
055:                // setRouteLevelToException(documentTypeForm.getRouteLevel());
056:                documentTypeForm.getDocumentType().setActiveInd(
057:                        new Boolean(true));
058:                documentTypeForm.setDocTypeVisible(true);
059:                documentTypeForm.setPolicyVisible(true);
060:                documentTypeForm.setRouteLevelVisible(true);
061:                documentTypeForm.setSearchableAttributeVisible(true);
062:                documentTypeForm.setNewRouteModuleVisible("no");
063:                documentTypeForm.setDefaultApprove("true");
064:                documentTypeForm.setPreApprove("true");
065:                documentTypeForm.setInitiatorMustRoute("true");
066:                documentTypeForm.setInitiatorMustSave("true");
067:                return mapping.findForward("basic");
068:            }
069:
070:            public ActionMessages establishRequiredState(
071:                    HttpServletRequest request, ActionForm form)
072:                    throws Exception {
073:                DocumentTypeForm documentTypeForm = (DocumentTypeForm) form;
074:
075:                if (getWorkgroupService()
076:                        .isUserMemberOfGroup(
077:                                new GroupNameId(
078:                                        ServiceConstants.DOC_TYPE_BLANKET_APPRV_WRKGRP),
079:                                getUserSession(request).getWorkflowUser())) {
080:                    documentTypeForm.setShowBlanketApproveButton(true);
081:                }
082:
083:                if (documentTypeForm.getDocumentType().getDocumentTypeId() != null
084:                        && documentTypeForm.getDocumentType()
085:                                .getDocumentTypeId().longValue() != 0) {
086:                    DocumentType existing = getDocumentTypeService().findById(
087:                            documentTypeForm.getDocumentType()
088:                                    .getDocumentTypeId());
089:                    //			Workgroup workgroup = getWorkgroupService().getWorkgroup(new WorkflowGroupId(existing.getWorkgroupId()));
090:                    //			if (workgroup != null) {
091:                    //				existing.setWorkgroupId(workgroup.getWorkflowGroupId().getGroupId());
092:                    //			}
093:                    //			if (existing.getBlanketApproveWorkgroupId() != null) {
094:                    //				Workgroup blanketApproveWorkgroup = getWorkgroupService().getWorkgroup(new WorkflowGroupId(existing.getBlanketApproveWorkgroupId()));
095:                    //				if (blanketApproveWorkgroup != null) {
096:                    //					existing.setBlanketApproveWorkgroupId(blanketApproveWorkgroup.getWorkflowGroupId().getGroupId());
097:                    //				}
098:                    //			}
099:                    //			if (existing.getParentDocType() != null) {
100:                    //				existing.setCustomActionListAttributeClassName(existing
101:                    //						.retrieveAttributeClassName(existing.getCustomActionListAttributeClassName(), EdenConstants.ACTION_LIST_ATTRIBUTE_CLASS_PROPERTY));
102:                    //				existing.setCustomEmailAttributeClassName(existing.retrieveAttributeClassName(existing.getCustomEmailAttributeClassName(), EdenConstants.EMAIL_ATTRIBUTE_CLASS_PROPERTY));
103:                    //				existing.setCustomNoteAttributeClassName(existing.retrieveAttributeClassName(existing.getCustomNoteAttributeClassName(), EdenConstants.NOTE_ATTRIBUTE_CLASS_PROPERTY));
104:                    //			}
105:                    documentTypeForm.setExistingDocumentType(existing);
106:                }
107:                String parentDocTypeName = documentTypeForm
108:                        .getParentDocTypeName();
109:                if (parentDocTypeName != null
110:                        && !"".equals(parentDocTypeName.trim())) {
111:                    documentTypeForm.getDocumentType().setDocTypeParentId(
112:                            getDocumentTypeService().findByName(
113:                                    parentDocTypeName).getDocumentTypeId());
114:                    //			if (documentTypeForm.getDocumentType().getParentDocType() != null) {
115:                    //				documentTypeForm.getDocumentType().setCustomActionListAttributeClassName(
116:                    //						documentTypeForm.getDocumentType().retrieveAttributeClassName(documentTypeForm.getDocumentType().getCustomActionListAttributeClassName(),
117:                    //								EdenConstants.ACTION_LIST_ATTRIBUTE_CLASS_PROPERTY));
118:                    //				documentTypeForm.getDocumentType().setCustomEmailAttributeClassName(
119:                    //						documentTypeForm.getDocumentType().retrieveAttributeClassName(documentTypeForm.getDocumentType().getCustomEmailAttributeClassName(),
120:                    //								EdenConstants.EMAIL_ATTRIBUTE_CLASS_PROPERTY));
121:                    //				documentTypeForm.getDocumentType().setCustomNoteAttributeClassName(
122:                    //						documentTypeForm.getDocumentType()
123:                    //								.retrieveAttributeClassName(documentTypeForm.getDocumentType().getCustomNoteAttributeClassName(), EdenConstants.NOTE_ATTRIBUTE_CLASS_PROPERTY));
124:                    //			}
125:                }
126:
127:                // this code sucks and needs reworked RK
128:                if (documentTypeForm.getDocId() != null) { // I'm for the dochandler
129:                    documentTypeForm.setFlexDoc(new WorkflowDocument(
130:                            new WorkflowIdVO(getUserSession(request)
131:                                    .getWorkflowUser().getWorkflowId()),
132:                            documentTypeForm.getDocId()));
133:                    documentTypeForm.establishVisibleActionRequestCds();
134:                } else if (documentTypeForm.getDocTypeId() != null) { // I'm for the
135:                    // report
136:                    // do nothing I'm doing work in report method
137:                } else { // I'm for editing and creating new
138:                    documentTypeForm.setFlexDoc(new WorkflowDocument(
139:                            new WorkflowIdVO(getUserSession(request)
140:                                    .getWorkflowUser().getWorkflowId()),
141:                            DOCUMENT_TYPE));
142:                    documentTypeForm.setDocId(documentTypeForm.getFlexDoc()
143:                            .getRouteHeaderId());
144:                    documentTypeForm.establishVisibleActionRequestCds();
145:                }
146:                // seems like work could all be done on the generic docId to clear up
147:                // this mess
148:                return null;
149:            }
150:
151:            public ActionMessages establishFinalState(
152:                    HttpServletRequest request, ActionForm form)
153:                    throws Exception {
154:                return null;
155:            }
156:
157:            public ActionForward report(ActionMapping mapping, ActionForm form,
158:                    HttpServletRequest request, HttpServletResponse response)
159:                    throws Exception {
160:                DocumentTypeForm documentTypeForm = (DocumentTypeForm) form;
161:                DocumentType docType = getDocumentTypeService().findById(
162:                        new Long(request.getParameter("docTypeId")));
163:
164:                if (docType.getRouteHeaderId() != null
165:                        && docType.getRouteHeaderId().longValue() != 0) {
166:                    documentTypeForm.setFlexDoc(new WorkflowDocument(
167:                            new WorkflowIdVO(getUserSession(request)
168:                                    .getWorkflowUser().getWorkflowId()),
169:                            docType.getRouteHeaderId()));
170:                }
171:                documentTypeForm.establishVisibleActionRequestCds();
172:
173:                documentTypeForm.setDocumentType(docType);
174:
175:                ExportDataSet dataSet = new ExportDataSet(ExportFormat.XML);
176:                dataSet.getDocumentTypes().add(docType);
177:                byte[] data = KEWServiceLocator.getXmlExporterService().export(
178:                        dataSet.getFormat(), dataSet);
179:                documentTypeForm.setExportedXml(new String(data));
180:
181:                return mapping.findForward("report");
182:            }
183:
184:            public ActionForward export(ActionMapping mapping, ActionForm form,
185:                    HttpServletRequest request, HttpServletResponse response)
186:                    throws Exception {
187:                DocumentType docType = getDocumentTypeService().findById(
188:                        new Long(request.getParameter("docTypeId")));
189:                ExportDataSet dataSet = new ExportDataSet(ExportFormat.XML);
190:                dataSet.getDocumentTypes().add(docType);
191:                return exportDataSet(request, dataSet);
192:            }
193:
194:            public ActionForward exportHierarchy(ActionMapping mapping,
195:                    ActionForm form, HttpServletRequest request,
196:                    HttpServletResponse response) throws Exception {
197:                DocumentType docType = getDocumentTypeService().findById(
198:                        new Long(request.getParameter("docTypeId")));
199:                ExportDataSet dataSet = new ExportDataSet(ExportFormat.XML);
200:                List docTypes = dataSet.getDocumentTypes();
201:                do {
202:                    docTypes.add(docType);
203:                    docType = docType.getParentDocType();
204:                } while (docType != null);
205:                return exportDataSet(request, dataSet);
206:            }
207:
208:            private DocumentTypeService getDocumentTypeService() {
209:                return (DocumentTypeService) KEWServiceLocator
210:                        .getService(KEWServiceLocator.DOCUMENT_TYPE_SERVICE);
211:            }
212:
213:            private WorkgroupService getWorkgroupService() {
214:                return (WorkgroupService) KEWServiceLocator
215:                        .getService(KEWServiceLocator.WORKGROUP_SRV);
216:            }
217:
218:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.