Source Code Cross Referenced for ActionRequestProcessor.java in  » Portal » jboss-portal-2.6.4 » org » jboss » portal » wsrp » producer » 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 » jboss portal 2.6.4 » org.jboss.portal.wsrp.producer 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /******************************************************************************
002:         * JBoss, a division of Red Hat                                               *
003:         * Copyright 2007, Red Hat Middleware, LLC, and individual                    *
004:         * contributors as indicated by the @authors tag. See the                     *
005:         * copyright.txt in the distribution for a full listing of                    *
006:         * individual contributors.                                                   *
007:         *                                                                            *
008:         * This is free software; you can redistribute it and/or modify it            *
009:         * under the terms of the GNU Lesser General Public License as                *
010:         * published by the Free Software Foundation; either version 2.1 of           *
011:         * the License, or (at your option) any later version.                        *
012:         *                                                                            *
013:         * This software is distributed in the hope that it will be useful,           *
014:         * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
015:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
016:         * Lesser General Public License for more details.                            *
017:         *                                                                            *
018:         * You should have received a copy of the GNU Lesser General Public           *
019:         * License along with this software; if not, write to the Free                *
020:         * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
021:         * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
022:         ******************************************************************************/package org.jboss.portal.wsrp.producer;
023:
024:        import org.jboss.portal.common.util.MarkupInfo;
025:        import org.jboss.portal.portlet.StateString;
026:        import org.jboss.portal.portlet.invocation.ActionInvocation;
027:        import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
028:        import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
029:        import org.jboss.portal.portlet.invocation.response.RenderResponse;
030:        import org.jboss.portal.portlet.spi.PortalContext;
031:        import org.jboss.portal.portlet.spi.SecurityContext;
032:        import org.jboss.portal.portlet.spi.UserContext;
033:        import org.jboss.portal.portlet.spi.WindowContext;
034:        import org.jboss.portal.portlet.state.AccessMode;
035:        import org.jboss.portal.wsrp.WSRPExceptionFactory;
036:        import org.jboss.portal.wsrp.WSRPTypeFactory;
037:        import org.jboss.portal.wsrp.WSRPUtils;
038:        import org.jboss.portal.wsrp.core.InteractionParams;
039:        import org.jboss.portal.wsrp.core.InvalidHandleFault;
040:        import org.jboss.portal.wsrp.core.InvalidRegistrationFault;
041:        import org.jboss.portal.wsrp.core.MarkupParams;
042:        import org.jboss.portal.wsrp.core.MissingParametersFault;
043:        import org.jboss.portal.wsrp.core.OperationFailedFault;
044:        import org.jboss.portal.wsrp.core.PerformBlockingInteraction;
045:        import org.jboss.portal.wsrp.core.PortletContext;
046:        import org.jboss.portal.wsrp.core.RegistrationContext;
047:        import org.jboss.portal.wsrp.core.RuntimeContext;
048:        import org.jboss.portal.wsrp.core.StateChange;
049:        import org.jboss.portal.wsrp.core.UnsupportedMimeTypeFault;
050:        import org.jboss.portal.wsrp.core.UnsupportedModeFault;
051:        import org.jboss.portal.wsrp.core.UnsupportedWindowStateFault;
052:        import org.jboss.portal.wsrp.core.UpdateResponse;
053:
054:        /**
055:         * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
056:         * @version $Revision: 8784 $
057:         * @since 2.6
058:         */
059:        class ActionRequestProcessor extends RequestProcessor {
060:            private final PerformBlockingInteraction performBlockingInteraction;
061:            private final InteractionParams interactionParams;
062:
063:            public ActionRequestProcessor(WSRPProducerImpl producer,
064:                    PerformBlockingInteraction performBlockingInteraction,
065:                    InteractionParams interactionParams)
066:                    throws UnsupportedMimeTypeFault,
067:                    UnsupportedWindowStateFault, InvalidHandleFault,
068:                    UnsupportedModeFault, MissingParametersFault,
069:                    InvalidRegistrationFault, OperationFailedFault {
070:                super (producer);
071:                this .performBlockingInteraction = performBlockingInteraction;
072:                this .interactionParams = interactionParams;
073:                prepareInvocation();
074:            }
075:
076:            RegistrationContext getRegistrationContext() {
077:                return performBlockingInteraction.getRegistrationContext();
078:            }
079:
080:            RuntimeContext getRuntimeContext() {
081:                return performBlockingInteraction.getRuntimeContext();
082:            }
083:
084:            MarkupParams getMarkupParams() {
085:                return performBlockingInteraction.getMarkupParams();
086:            }
087:
088:            PortletContext getPortletContext() {
089:                return performBlockingInteraction.getPortletContext();
090:            }
091:
092:            org.jboss.portal.wsrp.core.UserContext getUserContext() {
093:                return performBlockingInteraction.getUserContext();
094:            }
095:
096:            String getContextName() {
097:                return MarkupHandler.PBI;
098:            }
099:
100:            AccessMode getAccessMode() {
101:                StateChange stateChange = interactionParams
102:                        .getPortletStateChange();
103:                WSRPExceptionFactory
104:                        .throwMissingParametersFaultIfValueIsMissing(
105:                                stateChange, "portletStateChange",
106:                                "InteractionParams");
107:                return WSRPUtils.getAccessModeFromStateChange(stateChange);
108:            }
109:
110:            void initInvocation(StateString navigationalState,
111:                    SecurityContext securityContext, MarkupInfo markupInfo,
112:                    PortalContext portalContext, UserContext userContext,
113:                    WindowContext windowContext) {
114:
115:                StateString interactionState = createNavigationalState(interactionParams
116:                        .getInteractionState());
117:
118:                WSRPActionContext actionContext = WSRPActionContext
119:                        .createActionContext(navigationalState,
120:                                securityContext, markupInfo, portalContext,
121:                                userContext, instanceContext, windowContext,
122:                                markupRequest, interactionState,
123:                                interactionParams);
124:                setInvocation(new ActionInvocation(actionContext));
125:                actionContext.contextualize(invocation);
126:                invocation.setTarget(portlet.getContext());
127:            }
128:
129:            Object processResponse(PortletInvocationResponse response) {
130:                if (response instanceof  RenderResponse) {
131:                    RenderResponse renderResult = (RenderResponse) response;
132:                    UpdateResponse updateResponse = WSRPTypeFactory
133:                            .createUpdateResponse();
134:                    updateResponse
135:                            .setNewMode(WSRPUtils
136:                                    .convertJSR168PortletModeNameToWSRPName(getNewStateOrNull(
137:                                            renderResult, true)));
138:                    updateResponse
139:                            .setNewWindowState(WSRPUtils
140:                                    .convertJSR168WindowStateNameToWSRPName(getNewStateOrNull(
141:                                            renderResult, false)));
142:                    StateString ns = renderResult.getNavigationalState();
143:                    updateResponse.setNavigationalState(ns != null ? ns
144:                            .getStringValue() : null);
145:
146:                    // deal with implicit cloning and state modification
147:                    if (instanceContext.wasModified()) {
148:                        PortletContext updatedPortletContext = WSRPUtils
149:                                .convertToWSRPPortletContext(instanceContext
150:                                        .getPortletContext());
151:                        updateResponse.setPortletContext(updatedPortletContext);
152:                    }
153:
154:                    return WSRPTypeFactory
155:                            .createBlockingInteractionResponse(updateResponse);
156:                } else {
157:                    // result should be HTTPRedirectionResult
158:                    HTTPRedirectionResponse redirectionResult = (HTTPRedirectionResponse) response;
159:                    return WSRPTypeFactory
160:                            .createBlockingInteractionResponse(redirectionResult
161:                                    .getLocation());
162:                }
163:            }
164:
165:            private String getNewStateOrNull(RenderResponse renderResult,
166:                    boolean forMode) {
167:                Object state = forMode ? renderResult.getMode() : renderResult
168:                        .getWindowState();
169:                return state != null ? state.toString() : null;
170:            }
171:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.