Source Code Cross Referenced for ComponentsForReturnableWebPageTag.java in  » Workflow-Engines » JFolder » org » jfolder » common » function » 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 » Workflow Engines » JFolder » org.jfolder.common.function 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * JFolder, Copyright 2001-2006 Gary Steinmetz
003:         *
004:         * Distributable under LGPL license.
005:         * See terms of license at gnu.org.
006:         */
007:
008:        package org.jfolder.common.function;
009:
010:        //base classes
011:        import java.io.IOException;
012:        import java.util.ArrayList;
013:        import javax.servlet.http.HttpServletRequest;
014:        import javax.servlet.jsp.PageContext;
015:
016:        //project specific classes
017:        import org.jfolder.common.UnexpectedSystemException;
018:        import org.jfolder.common.utils.misc.MiscHelper;
019:        import org.jfolder.common.utils.web.ParameterHelper;
020:        import org.jfolder.common.utils.web.ParameterSet;
021:
022:        //other classes
023:
024:        public class ComponentsForReturnableWebPageTag {
025:
026:            private ReturnValueAndClassForWebPageTagContext rvacfwtc = null;
027:            private ParameterSet ps = null;
028:            private PageContext pc = null;
029:            //
030:            private ArrayList selectedWorkflowInstances = null;
031:            private int selectedWorkflowInstancesIndex = 0;
032:            private ArrayList selectedWorkflowInstanceIds = null;
033:            //
034:            private String waitState = null;
035:            //
036:            private String selectedFormParameter = null;
037:            private int selectedFormParameterIndex = 0;
038:
039:            ComponentsForReturnableWebPageTag(
040:                    ReturnValueAndClassForWebPageTagContext inRvacfwtc) {
041:                //MiscHelper.println("<!-- ComForRetWebTag -->");
042:                //MiscHelper.println("ComForRetWebTag ~");
043:                //(new Exception()).printStackTrace();
044:                //MiscHelper.println("<!--------------------->");
045:                try {
046:                    this .rvacfwtc = inRvacfwtc;
047:                    this .pc = this .rvacfwtc.getPageContext();
048:                    HttpServletRequest hsr = (HttpServletRequest) this .pc
049:                            .getRequest();
050:                    this .ps = ParameterHelper.getParameterSet(hsr);
051:                    //
052:                    this .selectedWorkflowInstances = new ArrayList();
053:                    this .selectedWorkflowInstancesIndex = 1;
054:                    this .selectedWorkflowInstanceIds = new ArrayList();
055:                } catch (IOException ioe) {
056:                    throw new UnexpectedSystemException(ioe);
057:                }
058:            }
059:
060:            public void setForwardInvoked(boolean inInvoked) {
061:                this .rvacfwtc.setForwardInvoked(inInvoked);
062:            }
063:
064:            public PageContext getPageContext() {
065:                return this .pc;
066:            }
067:
068:            public String getApplicationName() {
069:
070:                String outValue = null;
071:
072:                //
073:                PageContext pc = this .rvacfwtc.getPageContext();
074:                HttpServletRequest hsr = (HttpServletRequest) pc.getRequest();
075:                //TO DO: duplicate code here and in ProjectApplicationServlet
076:                outValue = hsr.getContextPath();
077:                if (outValue.startsWith("/")) {
078:                    outValue = outValue.substring(1);
079:                }
080:                if (outValue.endsWith("/")) {
081:                    outValue = outValue.substring(0, outValue.length() - 1);
082:                }
083:
084:                return outValue;
085:            }
086:
087:            public ParameterSet getParameterSet() {
088:                return this .ps;
089:            }
090:
091:            //public UserHolder getCurrentUser() {
092:            //    
093:            //    UserHolder outValue = null;
094:            //    
095:            //    SecurityLifecycle uaaac =
096:            //        SecurityLifecycleHelper.getSecurityLifecycle();
097:            //    PageContext pc = this.rvacfwtc.getPageContext();
098:            //    HttpServletRequest hsr = (HttpServletRequest)pc.getRequest();
099:            //    
100:            //    UserHolderContext uhc = SecurityLifecycleHelper.getUserHolderContext(
101:            //        hsr, getParameterSet());
102:            //    
103:            //    outValue = uaaac.getUser(uhc);
104:            //    
105:            //    //MiscHelper.println("CompForRetWebTag outValue = " + outValue);
106:            //    //MiscHelper.println("CompForRetWebTag hsr = " + hsr);
107:            //    //MiscHelper.println("CompForRetWebTag getParSet = "
108:            //    //    + getParameterSet());
109:            //    
110:            //    return outValue;
111:            //}
112:
113:            public String getWaitState() {
114:                return this .waitState;
115:            }
116:
117:            //public void selectWorkflowInstances(String inWaitState,
118:            //    String inApplication, QueryContainer inQc) {
119:            //    
120:            //    WorkflowLifecycle wl =
121:            //        WorkflowLifecycleFactory.getWorkflowLifecycle();
122:            //    
123:            //    this.waitState = inWaitState;
124:            //    
125:            //    //add wait at state
126:            //    QueryContainer endQc =
127:            //WaitHelper.getWaitQC(inApplication, inWaitState);
128:            //    if (inQc != null) {
129:            //        endQc = AndQC.createQuery(endQc, inQc);
130:            //    }
131:            //    inQc = WaitHelper.getWaitQC(inApplication, inWaitState);
132:            //    
133:            //    //COLUMN
134:            //    ColumnContainer cc = ColumnContainer.createColumnContainer();
135:            //    cc.registerSystemString(AttributeSet.ID, null);
136:            //    
137:            //    //STATEMENT
138:            //    StatementContainer sc = StatementContainer.createStatement(cc, endQc);
139:            //    
140:            //    //RESULT SET
141:            //    ResultSetContainer rsc = wl.queryWorkflowInstances(sc);
142:            //    
143:            //    //this.idList = new ArrayList();
144:            //    this.selectedWorkflowInstances = new ArrayList();
145:            //    this.selectedWorkflowInstancesIndex = -1;
146:            //    this.selectedWorkflowInstanceIds = new ArrayList();
147:            //    
148:            //    //MiscHelper.println("rsc.getRowCount() = " + rsc.getRowCount());
149:            //    for (int i = 0; i < rsc.getRowCount(); i++) {
150:            //        String nextId = rsc.getValueAsString(i, 0);
151:            //        this.selectedWorkflowInstanceIds.add(nextId);
152:            //        WorkflowInstance nextWi = wl.retrieveWorkflowInstance(nextId);
153:            //        this.selectedWorkflowInstances.add(nextWi);
154:            //    }
155:            //    
156:            //    wl.close();
157:            //}
158:
159:            public boolean hasNextWorkflowInstance() {
160:
161:                boolean outValue = false;
162:
163:                int nextIndex = (this .selectedWorkflowInstancesIndex + 1);
164:
165:                if (nextIndex < this .selectedWorkflowInstances.size()) {
166:                    this .selectedWorkflowInstancesIndex = nextIndex;
167:                    outValue = true;
168:                }
169:
170:                //MiscHelper.println("CompForRetWebTag wfIndex = "
171:                //    + this.selectedWorkflowInstancesIndex);
172:                //MiscHelper.println("CompForRetWebTag outValue = " + outValue);
173:
174:                return outValue;
175:            }
176:
177:            //public WorkflowInstance getNextWorkflowInstance() {
178:            //    
179:            //    WorkflowInstance outValue = null;
180:            //    
181:            //    //MiscHelper.println("CompForRetWebTag wfNextIndex = "
182:            //    //    + this.selectedWorkflowInstancesIndex);
183:            //    //outValue = (WorkflowInstance)this.selectedWorkflowInstances.get(
184:            //    //    this.selectedWorkflowInstancesIndex);
185:            //    
186:            //    return outValue;
187:            //}
188:
189:            public void saveChangesToWorkflowIntances() {
190:
191:                //WorkflowServiceCaller wsc =
192:                //    WorkflowServiceCallerFactory.getWorkflowServiceCaller();
193:                //WorkflowLifecycle wl =
194:                //    WorkflowLifecycleFactory.getWorkflowLifecycle();
195:
196:                //for (int i = 0; i < this.selectedWorkflowInstances.size(); i++) {
197:                //    
198:                //    WorkflowInstance nextWi =
199:                //        (WorkflowInstance)this.selectedWorkflowInstances.get(i);
200:                //    wl.updateWorkflowInstance(nextWi);
201:                //}
202:
203:                //wl.close();
204:                throw UnexpectedSystemException.notImplemented();
205:            }
206:
207:            //
208:            public void selectFormParameters(String inParameter) {
209:                this .selectedFormParameter = inParameter;
210:                this .selectedFormParameterIndex = -1;
211:            }
212:
213:            public boolean hasNextFormParameter() {
214:
215:                boolean outValue = false;
216:
217:                int parameterLength = this .ps
218:                        .getParameterValuesLength(this .selectedFormParameter);
219:                this .selectedFormParameterIndex++;
220:
221:                if (this .selectedFormParameterIndex < parameterLength) {
222:                    outValue = true;
223:                }
224:
225:                return outValue;
226:            }
227:
228:            public String getNextFormParameter() {
229:                return this.ps.getParameter(this.selectedFormParameter,
230:                        this.selectedFormParameterIndex);
231:            }
232:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.