Source Code Cross Referenced for PageFlowControllerConfig.java in  » Library » Apache-beehive-1.0.2-src » org » apache » beehive » netui » pageflow » config » 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 » Library » Apache beehive 1.0.2 src » org.apache.beehive.netui.pageflow.config 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one or more
003:         * contributor license agreements.  See the NOTICE file distributed with
004:         * this work for additional information regarding copyright ownership.
005:         * The ASF licenses this file to You under the Apache License, Version 2.0
006:         * (the "License"); you may not use this file except in compliance with
007:         * the License.  You may obtain a copy of the License at
008:         * 
009:         *     http://www.apache.org/licenses/LICENSE-2.0
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:         * $Header:$
018:         */
019:        package org.apache.beehive.netui.pageflow.config;
020:
021:        import org.apache.struts.config.ControllerConfig;
022:        import org.apache.struts.upload.CommonsMultipartRequestHandler;
023:        import org.apache.beehive.netui.pageflow.internal.InternalUtils;
024:        import org.apache.beehive.netui.util.config.bean.MultipartHandler;
025:
026:        import java.util.LinkedHashMap;
027:        import java.util.Map;
028:
029:        /**
030:         * Bean class to handle our extensions to the Struts <controller> element.
031:         */
032:        public class PageFlowControllerConfig extends ControllerConfig {
033:            private static final String COMMONS_MULTIPART_HANDLER_CLASS = CommonsMultipartRequestHandler.class
034:                    .getName();
035:
036:            private boolean _isNestedPageFlow;
037:            private boolean _isLongLivedPageFlow;
038:            private boolean _isReturnToPageDisabled;
039:            private boolean _isReturnToActionDisabled;
040:            private boolean _isMissingDefaultMessages;
041:            private LinkedHashMap/*< String, String >*/_sharedFlowTypes;
042:            private String _controllerClass;
043:            private boolean _isSharedFlow;
044:            private boolean _isAbstract = false;
045:            private String _overrideMultipartClass = null;
046:            private String _overrideMemFileSize = null;
047:            private boolean _forceMultipartDisabled = false;
048:
049:            public boolean isNestedPageFlow() {
050:                return _isNestedPageFlow;
051:            }
052:
053:            public void setIsNestedPageFlow(boolean nestedPageFlow) {
054:                _isNestedPageFlow = nestedPageFlow;
055:            }
056:
057:            public boolean isLongLivedPageFlow() {
058:                return _isLongLivedPageFlow;
059:            }
060:
061:            public void setIsLongLivedPageFlow(boolean longLivedPageFlow) {
062:                _isLongLivedPageFlow = longLivedPageFlow;
063:            }
064:
065:            public boolean isReturnToPageDisabled() {
066:                return _isReturnToPageDisabled;
067:            }
068:
069:            public void setIsReturnToPageDisabled(boolean returnToPageDisabled) {
070:                _isReturnToPageDisabled = returnToPageDisabled;
071:            }
072:
073:            public boolean isReturnToActionDisabled() {
074:                return _isReturnToActionDisabled;
075:            }
076:
077:            public void setIsReturnToActionDisabled(
078:                    boolean returnToActionDisabled) {
079:                _isReturnToActionDisabled = returnToActionDisabled;
080:            }
081:
082:            public boolean isMissingDefaultMessages() {
083:                return _isMissingDefaultMessages;
084:            }
085:
086:            public void setIsMissingDefaultMessages(
087:                    boolean missingDefaultMessages) {
088:                _isMissingDefaultMessages = missingDefaultMessages;
089:            }
090:
091:            public void setSharedFlows(String sharedFlows) {
092:                if (sharedFlows == null || sharedFlows.length() == 0) {
093:                    _sharedFlowTypes = null;
094:                    return;
095:                }
096:
097:                String[] keyValues = sharedFlows.split(",");
098:                _sharedFlowTypes = new LinkedHashMap/*< String, String >*/();
099:
100:                for (int i = 0; i < keyValues.length; i++) {
101:                    String keyValue = keyValues[i];
102:                    int delim = keyValue.indexOf('=');
103:                    assert delim != -1 : "no delimiter in " + keyValue;
104:                    assert delim < keyValue.length() - 1 : "missing value in "
105:                            + keyValue;
106:                    _sharedFlowTypes.put(keyValue.substring(0, delim), keyValue
107:                            .substring(delim + 1));
108:                }
109:            }
110:
111:            public String getSharedFlows() {
112:                throw new UnsupportedOperationException(
113:                        "not implemented; uses getSharedFlowTypes");
114:            }
115:
116:            public Map/*< String, String >*/getSharedFlowTypes() {
117:                return _sharedFlowTypes;
118:            }
119:
120:            public String getControllerClass() {
121:                return _controllerClass;
122:            }
123:
124:            public void setControllerClass(String controllerClass) {
125:                _controllerClass = controllerClass;
126:            }
127:
128:            public boolean isSharedFlow() {
129:                return _isSharedFlow;
130:            }
131:
132:            public void setIsSharedFlow(boolean sharedFlow) {
133:                _isSharedFlow = sharedFlow;
134:            }
135:
136:            /**
137:             * This gets the multipart class.  If it was explicitly set on the associated <controller> element, just use that;
138:             * otherwise, get the value from WEB-INF/beehive-netui-config.xml.
139:             */
140:            public String getMultipartClass() {
141:                if (_forceMultipartDisabled)
142:                    return null;
143:                if (_overrideMultipartClass != null)
144:                    return _overrideMultipartClass;
145:
146:                MultipartHandler mpHandler = InternalUtils
147:                        .getMultipartHandlerType();
148:
149:                if (mpHandler != null) {
150:                    switch (mpHandler.getValue()) {
151:                    case MultipartHandler.INT_DISABLED:
152:                        return null;
153:                    case MultipartHandler.INT_MEMORY:
154:                        return COMMONS_MULTIPART_HANDLER_CLASS;
155:                    case MultipartHandler.INT_DISK:
156:                        return COMMONS_MULTIPART_HANDLER_CLASS;
157:                    default:
158:                        assert false : "unknown value for multipart handler: "
159:                                + mpHandler.toString();
160:                    }
161:                }
162:
163:                return null;
164:            }
165:
166:            public String getMemFileSize() {
167:                if (_overrideMemFileSize != null)
168:                    return _overrideMemFileSize;
169:
170:                MultipartHandler mpHandler = InternalUtils
171:                        .getMultipartHandlerType();
172:
173:                if (mpHandler != null) {
174:                    switch (mpHandler.getValue()) {
175:                    case MultipartHandler.INT_DISABLED:
176:                        return super .getMemFileSize();
177:                    case MultipartHandler.INT_MEMORY:
178:                        return super .getMemFileSize();
179:                    case MultipartHandler.INT_DISK:
180:                        return "0K"; // memory filesize threshold of zero.
181:                    default:
182:                        assert false : "unknown value for multipart handler: "
183:                                + mpHandler.toString();
184:                    }
185:                }
186:
187:                return super .getMemFileSize();
188:            }
189:
190:            public void setMultipartClass(String overrideMultipartClass) {
191:                if (overrideMultipartClass.equals("none")) {
192:                    _forceMultipartDisabled = true;
193:                } else {
194:                    _overrideMultipartClass = overrideMultipartClass;
195:                }
196:            }
197:
198:            public void setMemFileSize(String fileSize) {
199:                _overrideMemFileSize = fileSize;
200:            }
201:
202:            public boolean isAbstract() {
203:                return _isAbstract;
204:            }
205:
206:            public void setIsAbstract(boolean isAbstract) {
207:                _isAbstract = isAbstract;
208:            }
209:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.