Source Code Cross Referenced for PortletExternalContext.java in  » Workflow-Engines » spring-webflow-1.0.4 » org » springframework » webflow » context » portlet » 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 » spring webflow 1.0.4 » org.springframework.webflow.context.portlet 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2004-2007 the original author or authors.
003:         * 
004:         * Licensed under the Apache License, Version 2.0 (the "License"); you may not
005:         * use this file except in compliance with the License. You may obtain a copy of
006:         * the License at
007:         * 
008:         * http://www.apache.org/licenses/LICENSE-2.0
009:         * 
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
012:         * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
013:         * License for the specific language governing permissions and limitations under
014:         * the License.
015:         */
016:        package org.springframework.webflow.context.portlet;
017:
018:        import java.util.Map;
019:
020:        import javax.portlet.PortletContext;
021:        import javax.portlet.PortletRequest;
022:        import javax.portlet.PortletResponse;
023:        import javax.portlet.PortletSession;
024:
025:        import org.springframework.core.style.ToStringCreator;
026:        import org.springframework.webflow.context.ExternalContext;
027:        import org.springframework.webflow.core.collection.LocalAttributeMap;
028:        import org.springframework.webflow.core.collection.LocalParameterMap;
029:        import org.springframework.webflow.core.collection.LocalSharedAttributeMap;
030:        import org.springframework.webflow.core.collection.MutableAttributeMap;
031:        import org.springframework.webflow.core.collection.ParameterMap;
032:        import org.springframework.webflow.core.collection.SharedAttributeMap;
033:
034:        /**
035:         * Provides contextual information about a JSR-168 Portlet environment that has
036:         * called into Spring Web Flow.
037:         * 
038:         * @author Keith Donald
039:         */
040:        public class PortletExternalContext implements  ExternalContext {
041:
042:            /**
043:             * The context.
044:             */
045:            private PortletContext context;
046:
047:            /**
048:             * The request.
049:             */
050:            private PortletRequest request;
051:
052:            /**
053:             * The response.
054:             */
055:            private PortletResponse response;
056:
057:            /**
058:             * An accessor for the portlet request parameter map.
059:             */
060:            private ParameterMap requestParameterMap;
061:
062:            /**
063:             * An accessor for the portlet request attribute map.
064:             */
065:            private MutableAttributeMap requestMap;
066:
067:            /**
068:             * An accessor for the local portlet session map.
069:             */
070:            private SharedAttributeMap sessionMap;
071:
072:            /**
073:             * An accessor for the global portlet session map.
074:             */
075:            private SharedAttributeMap globalSessionMap;
076:
077:            /**
078:             * An accessor for the portlet context application map.
079:             */
080:            private SharedAttributeMap applicationMap;
081:
082:            /**
083:             * An accessor for the portlet user info map.
084:             */
085:            private MutableAttributeMap userInfoMap;
086:
087:            /**
088:             * Create an external context wrapping given Portlet context, request and response.
089:             * @param context the Portlet context
090:             * @param request the Portlet request
091:             * @param response the Portlet response
092:             */
093:            public PortletExternalContext(PortletContext context,
094:                    PortletRequest request, PortletResponse response) {
095:                this .context = context;
096:                this .request = request;
097:                this .response = response;
098:                this .requestParameterMap = new LocalParameterMap(
099:                        new PortletRequestParameterMap(request));
100:                this .requestMap = new LocalAttributeMap(new PortletRequestMap(
101:                        request));
102:                this .sessionMap = new LocalSharedAttributeMap(
103:                        new PortletSessionMap(request,
104:                                PortletSession.PORTLET_SCOPE));
105:                this .globalSessionMap = new LocalSharedAttributeMap(
106:                        new PortletSessionMap(request,
107:                                PortletSession.APPLICATION_SCOPE));
108:                this .applicationMap = new LocalSharedAttributeMap(
109:                        new PortletContextMap(context));
110:                Map userInfo = (Map) request
111:                        .getAttribute(PortletRequest.USER_INFO);
112:                this .userInfoMap = userInfo != null ? new LocalAttributeMap(
113:                        userInfo) : null;
114:            }
115:
116:            public String getContextPath() {
117:                return request.getContextPath();
118:            }
119:
120:            public String getDispatcherPath() {
121:                // returns null in a portlet environment
122:                return null;
123:            }
124:
125:            public String getRequestPathInfo() {
126:                // returns null in a portlet environment
127:                return null;
128:            }
129:
130:            public ParameterMap getRequestParameterMap() {
131:                return requestParameterMap;
132:            }
133:
134:            public MutableAttributeMap getRequestMap() {
135:                return requestMap;
136:            }
137:
138:            public SharedAttributeMap getSessionMap() {
139:                return sessionMap;
140:            }
141:
142:            public SharedAttributeMap getGlobalSessionMap() {
143:                return globalSessionMap;
144:            }
145:
146:            public SharedAttributeMap getApplicationMap() {
147:                return applicationMap;
148:            }
149:
150:            /**
151:             * Returns the {@link PortletRequest#USER_INFO} map as a mutable attribute map.
152:             * @return the Portlet user info
153:             */
154:            public MutableAttributeMap getUserInfoMap() {
155:                return userInfoMap;
156:            }
157:
158:            /**
159:             * Returns the wrapped Portlet context.
160:             */
161:            public PortletContext getContext() {
162:                return context;
163:            }
164:
165:            /**
166:             * Returns the wrapped Portlet request.
167:             */
168:            public PortletRequest getRequest() {
169:                return request;
170:            }
171:
172:            /**
173:             * Returns the wrapped Portlet response.
174:             */
175:            public PortletResponse getResponse() {
176:                return response;
177:            }
178:
179:            public String toString() {
180:                return new ToStringCreator(this ).append("requestParameterMap",
181:                        getRequestParameterMap()).toString();
182:            }
183:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.