You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by "Boyce, Keith Garry" <Ke...@bcbsma.com> on 2006/02/08 17:19:34 UTC

Feature Request: allow httpServletRequest parameters to be converted into render parameters on a particular portlet or all portlets on a page.

I would like to suggest a jetspeed2 extension. I would like a way to
allow HttpServletRequest parameters to be converted into render
parameters on a particular portlet or all portlets on a page.

i.e:
http://localhost:8080/jetspeed/portal?_pp=MyPortlet-paramName-paramValue

 or  http://localhost:8080/jetspeed/portal?_pp=ALL-paramName-paramValue

In addition I need a way from portlet to add request params to resulting
redirected post.

i.e: On a form a post occurs. Portlet action fires. In there you can do
a response.sendRedirect. I need either a way to add request parameters
to normal redirected URL or a way to determine what that normal
redirected url would be so I could add the request parameters to it and
pass it to send redirect.

Is is possible?

Thanks,
Garry

This message is a PRIVATE communication.
If you are not the intended recipient, please do not read, copy,
or use it, and do not disclose it to others. Please notify the
sender of the delivery error by replying to this message, and then
delete it from your system. Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Re: Feature Request: allow httpServletRequest parameters to be converted into render parameters on a particular portlet or all portlets on a page.

Posted by David Sean Taylor <da...@bluesunrise.com>.
Try this out, its checked into the head:

package org.apache.jetspeed.container.state.impl;

import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import javax.portlet.PortletMode;
import javax.portlet.WindowState;

import org.apache.pluto.om.window.PortletWindow;

/**
  * HybridNavigationalState
  *
  * Only encodes render parameters that start with a given prefix
  *
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  * @version $Id: AbstractNavigationalState.java 333093 2005-11-13 
18:42:42Z taylor $
  */
public class HybridNavigationalState extends SessionNavigationalState
{
     protected String prefix;

     public HybridNavigationalState(NavigationalStateCodec codec, String 
prefix)
     {
         super(codec);
         this.prefix = prefix;
     }

     public String encode(PortletWindow window, Map parameters, 
PortletMode mode, WindowState state, boolean action)
     throws UnsupportedEncodingException
     {
         Map subset = new HashMap();
         Iterator params = parameters.keySet().iterator();
         while (params.hasNext())
         {
             String key = (String)params.next();
             if (key.startsWith(prefix))
             {
                 // only encode params that start with prefix
                 subset.put(key, parameters.get(key));
             }
         }
         return super.encode(window, subset, mode, state, action);
     }

     public boolean isNavigationalParameterStateFull()
     {
         return true;
     }

     public boolean isRenderParameterStateFull()
     {
         return false;
     }


}

Boyce, Keith Garry wrote:
> I would like to suggest a jetspeed2 extension. I would like a way to
> allow HttpServletRequest parameters to be converted into render
> parameters on a particular portlet or all portlets on a page.
> 
> 
> i.e:
> http://localhost:8080/jetspeed/portal?_pp=MyPortlet-paramName-paramValue
> 
>  or  http://localhost:8080/jetspeed/portal?_pp=ALL-paramName-paramValue
> 
> In addition I need a way from portlet to add request params to resulting
> redirected post.
> 
> i.e: On a form a post occurs. Portlet action fires. In there you can do
> a response.sendRedirect. I need either a way to add request parameters
> to normal redirected URL or a way to determine what that normal
> redirected url would be so I could add the request parameters to it and
> pass it to send redirect.
> 
> Is is possible?
> 
> Thanks,
> Garry
> 
> This message is a PRIVATE communication.
> If you are not the intended recipient, please do not read, copy,
> or use it, and do not disclose it to others. Please notify the
> sender of the delivery error by replying to this message, and then
> delete it from your system. Thank you.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
> 
> 
> 


-- 
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
[office] +01 707 773-4646
[mobile] +01 707 529 9194

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org