Source Code Cross Referenced for ActionResponseImpl.java in  » Portal » stringbeans-3.5 » com » nabhinc » portal » container » 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 » Portal » stringbeans 3.5 » com.nabhinc.portal.container 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* 
002:         * (C) Copyright 2000 - 2003 Nabh Information Systems, Inc. 
003:         * 
004:         * This program is free software; you can redistribute it and/or
005:         * modify it under the terms of the GNU General Public License 
006:         * as published by the Free Software Foundation; either version 2
007:         * of the License, or (at your option) any later version.
008:         * 
009:         * This program is distributed in the hope that it will be useful,
010:         * but WITHOUT ANY WARRANTY; without even the implied warranty of 
011:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
012:         * GNU General Public License for more details.
013:         * 
014:         * You should have received a copy of the GNU General Public License
015:         * along with this program; if not, write to the Free Software 
016:         * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
017:         * 
018:         */
019:
020:        package com.nabhinc.portal.container;
021:
022:        import java.io.IOException;
023:        import java.util.HashMap;
024:        import java.util.Iterator;
025:        import java.util.Map;
026:        import java.util.Set;
027:
028:        import javax.portlet.ActionResponse;
029:        import javax.portlet.PortletMode;
030:        import javax.portlet.PortletModeException;
031:        import javax.portlet.WindowState;
032:        import javax.portlet.WindowStateException;
033:        import javax.servlet.http.HttpServletResponse;
034:
035:        /**
036:         * 
037:         *
038:         * @author Padmanabh dabke
039:         * (c) 2003 Nabh Information Systems, Inc. All Rights Reserved.
040:         */
041:        public class ActionResponseImpl extends PortletResponseImpl implements 
042:                ActionResponse {
043:
044:            // private PortletRequestImpl ariRenderRequest = null;
045:            private boolean ariModeStateRenderParamSet = false;
046:            private boolean ariRedirectSet = false;
047:            private String ariRedirect = null;
048:            private HashMap ariRenderParamMap = new HashMap();
049:            private ActionRequestImpl ariActionRequest = null;
050:
051:            public ActionResponseImpl(HttpServletResponse resp,
052:                    ActionRequestImpl actionRequest) {
053:                super (resp);
054:                ariActionRequest = actionRequest;
055:                // ariRenderRequest = req;
056:            }
057:
058:            /* (non-Javadoc)
059:             * @see javax.portlet.ActionResponse#setWindowState(javax.portlet.WindowState)
060:             */
061:            public void setWindowState(WindowState windowState)
062:                    throws WindowStateException {
063:                if (ariRedirectSet)
064:                    throw new IllegalStateException(
065:                            "Window state cannot be set after setting redirect URL.");
066:                ariActionRequest.setWindowState(windowState);
067:                ariModeStateRenderParamSet = true;
068:
069:            }
070:
071:            /* (non-Javadoc)
072:             * @see javax.portlet.ActionResponse#setPortletMode(javax.portlet.PortletMode)
073:             */
074:            public void setPortletMode(PortletMode portletMode)
075:                    throws PortletModeException {
076:                if (ariRedirectSet)
077:                    throw new IllegalStateException(
078:                            "Portlet mode cannot be set after setting redirect URL.");
079:                ariActionRequest.setPortletMode(portletMode);
080:                ariModeStateRenderParamSet = true;
081:
082:            }
083:
084:            /* (non-Javadoc)
085:             * @see javax.portlet.ActionResponse#sendRedirect(java.lang.String)
086:             */
087:            public void sendRedirect(String location) throws IOException {
088:                if (ariModeStateRenderParamSet)
089:                    throw new IllegalStateException(
090:                            "Redirect URL cannot be set after setting portlet mode, window state, or render parameters.");
091:                ariRedirect = location;
092:                ariRedirectSet = true;
093:
094:            }
095:
096:            /* (non-Javadoc)
097:             * @see javax.portlet.ActionResponse#setRenderParameters(java.util.Map)
098:             */
099:            @SuppressWarnings("unchecked")
100:            public void setRenderParameters(Map paramMap) {
101:                if (ariRedirectSet)
102:                    throw new IllegalStateException(
103:                            "Render parameters cannot be set after setting redirect URL.");
104:                ariModeStateRenderParamSet = true;
105:                if (paramMap == null) {
106:                    throw new IllegalArgumentException(
107:                            "Parameter map cannot be null.");
108:                }
109:                ariRenderParamMap.clear();
110:                Set entries = paramMap.entrySet();
111:                for (Iterator iter = entries.iterator(); iter.hasNext();) {
112:                    Map.Entry element = (Map.Entry) iter.next();
113:                    try {
114:                        String paramName = (String) element.getKey();
115:                        String[] paramValues = (String[]) element.getValue();
116:                        ariRenderParamMap.put(paramName, paramValues);
117:                    } catch (ClassCastException ex) {
118:                        throw new IllegalArgumentException(
119:                                "Parameter map keys must be strings and the values must be string arrays.");
120:                    }
121:
122:                }
123:            }
124:
125:            /* (non-Javadoc)
126:             * @see javax.portlet.ActionResponse#setRenderParameter(java.lang.String, java.lang.String)
127:             */
128:            @SuppressWarnings("unchecked")
129:            public void setRenderParameter(String key, String value) {
130:                if (ariRedirectSet)
131:                    throw new IllegalStateException(
132:                            "Render parameters cannot be set after setting redirect URL.");
133:                if (key == null)
134:                    throw new IllegalArgumentException(
135:                            "Render parameter name cannot be null.");
136:                if (value == null)
137:                    throw new IllegalArgumentException(
138:                            "Render parameter value cannot be null.");
139:                ariModeStateRenderParamSet = true;
140:                ariRenderParamMap.put(key, new String[] { value });
141:
142:            }
143:
144:            /* (non-Javadoc)
145:             * @see javax.portlet.ActionResponse#setRenderParameter(java.lang.String, java.lang.String[])
146:             */
147:            @SuppressWarnings("unchecked")
148:            public void setRenderParameter(String key, String[] values) {
149:                if (ariRedirectSet)
150:                    throw new IllegalStateException(
151:                            "Render parameters cannot be set after setting redirect URL.");
152:                if (key == null)
153:                    throw new IllegalArgumentException(
154:                            "Render parameter name cannot be null.");
155:                if (values == null)
156:                    throw new IllegalArgumentException(
157:                            "Render parameter value cannot be null.");
158:                ariModeStateRenderParamSet = true;
159:                ariRenderParamMap.put(key, values);
160:            }
161:
162:            public void setHttpServletResponse(HttpServletResponse resp) {
163:                super .setHttpServletResponse(resp);
164:                ariRenderParamMap.clear();
165:                ariModeStateRenderParamSet = false;
166:                ariRedirectSet = false;
167:                ariRedirect = null;
168:            }
169:
170:            public PortletMode getPortletMode() {
171:                // return ariPortletMode == null ? ariRenderRequest.getPortletMode() : ariPortletMode;
172:                return ariActionRequest.getPortletMode();
173:            }
174:
175:            public WindowState getWindowState() {
176:                // return ariWindowState == null ? ariRenderRequest.getWindowState() : ariWindowState;
177:                return ariActionRequest.getWindowState();
178:            }
179:
180:            public String getRedirect() {
181:                return ariRedirect;
182:            }
183:
184:            public Map getParamMap() {
185:                return ariRenderParamMap;
186:            }
187:
188:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.