You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrp4j-dev@portals.apache.org by "Claire Chang (JIRA)" <ws...@ws.apache.org> on 2005/01/11 19:55:12 UTC

[jira] Commented: (WSRP4J-43) PortletInvokerImpl doesn't honor the portlet action response newMode/newWindowState on UpdateResponse to consumer

     [ http://issues.apache.org/jira/browse/WSRP4J-43?page=comments#action_57523 ]
     
Claire Chang commented on WSRP4J-43:
------------------------------------

If you look at PorletActionProviderImpl.java in org.apache.wsrp4j.producer.provider.pluto.driver package, in method changePortletMode and changePortletWindowState, what they do is just to set the new mode and new state into DynamicInformationProviderImpl. So I believe DynamicInformationProviderImpl is the place holder for the new mode and new state. I change the DynamicInformationProviderImpl locally to keep track of the inital states (preMode and preState) and in PortletInvokerImpl.java, access DynamicInformationProviderImpl through FactoryAccess and compare the current mode w/ previous mode to detect if there is a mode change.

> PortletInvokerImpl doesn't honor the portlet action response newMode/newWindowState on UpdateResponse to consumer
> -----------------------------------------------------------------------------------------------------------------
>
>          Key: WSRP4J-43
>          URL: http://issues.apache.org/jira/browse/WSRP4J-43
>      Project: WSRP4J
>         Type: Bug
>   Components: Producer
>     Versions: current (nightly)
>  Environment: Tomcat 4.1.30, Win XP, etc
>     Reporter: Ricky Frost

>
> When a produced portlet sets a newMode or newWindowState inside a processAction (by calling ActionResponse.setPortletMode or setWindowState). It isn't being returned to the remote consumer. The code in PortletInvokerImpl never considers the ones set by the portlet when it builds the UpdateResponse. In fact, the only things it seems to set are the navigationalState and markupContext (the WSRPEngine sets the portletContext upon returning). i.e. the sessionContext seems to be untouched as well...
> I fixed it locally by adding getNewMode/getNewWindowState to StoredResponse then calling them after setting the nav state
> updateResponse.setNavigationalState(navState);
> // ADD THESE: update the mode and state as well...
> updateResponse.setNewMode(servletResponse.getNewMode());
> updateResponse.setNewWindowState(servletResponse.getNewWindowState());
> Of course, the other part of this is to change StoredResponse to trap the call to sendRedirect and pick out the new values for the mode, and state and provide accessors for them... Here is that code:
>     private static final String MODE_SIG =
>         org.apache.wsrp4j.util.Constants.PORTLET_MODE+org.apache.wsrp4j.util.Constants.EQUALS;
>     private String _newMode = null;
>     public String getNewMode() {
>         return _newMode;
>     }
>     private static final String STATE_SIG =
>         org.apache.wsrp4j.util.Constants.WINDOW_STATE+org.apache.wsrp4j.util.Constants.EQUALS;
>     private String _newWindowState = null;
>     public String getNewWindowState() {
>         return _newWindowState;
>     }
> and this:
>         public void sendRedirect(String s)
>         {
>             _redirectURI = s;
>             // added these (and the method following...)
>             if( s != null && s.length() > 0 ) {
>                 _newMode = getURLSigValue( MODE_SIG, s );
>                 _newWindowState = getURLSigValue( STATE_SIG, s );
>             }
>         }
>         /*
>          * Here's what the typical redirectURL looks like...
>          * "wsrp_rewrite?wsrp-urlType=render&amp;wsrp-mode=wsrp:view&amp;
>          * wsrp-navigationalState=rO0ABXNyABFqYXZhLnV0aWwuSGFzaAAAeA**&amp;
>          * wsrp-windowState=wsrp:normal&amp;wsrp-secureURL=false/wsrp_rewrite"
>          */
>         private String getURLSigValue( final String sig, final String url ) {
>             int at = url.indexOf( sig );
>             if( at != -1 ) {
>                 at += sig.length();
>                 int end = url.indexOf( '&', at );
>                 if( end == -1 )
>                     end = url.indexOf( '/', at );
>                 if( end == -1 )
>                     end = url.length();
>                 return url.substring(at, end);
>             }
>             return null;
>         }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira