cvs commit: jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/services/information PortletURLProviderImpl.java

2005-04-21 Thread ate
ate 2005/04/21 02:03:32

  Modified:portal/src/java/org/apache/jetspeed/services/information
PortletURLProviderImpl.java
  Log:
  Code cleanup.
  The PortletURLProviderImpl now is only used by Pluto for generation of a 
normal PortletURL.
  The other usage for generating Portal DecoratorAction urls now no longer uses 
this but directly uses the PortalURL for that.
  
  Revision  ChangesPath
  1.10  +4 -27 
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/services/information/PortletURLProviderImpl.java
  
  Index: PortletURLProviderImpl.java
  ===
  RCS file: 
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/services/information/PortletURLProviderImpl.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- PortletURLProviderImpl.java   15 Oct 2004 22:58:43 -  1.9
  +++ PortletURLProviderImpl.java   21 Apr 2005 09:03:32 -  1.10
  @@ -15,8 +15,6 @@
*/
   package org.apache.jetspeed.services.information;
   
  -import java.util.HashMap;
  -import java.util.Iterator;
   import java.util.Map;
   
   import javax.portlet.PortletMode;
  @@ -41,7 +39,6 @@
   private WindowState state = null;
   private boolean action = false;
   private boolean secure = false;
  -private boolean clearParameters = false;
   private Map parameters = null;
   
   private PortalURL url;
  @@ -74,9 +71,8 @@
   }
   
   public void clearParameters()
  -{
  -// url.clearRenderParameters(portletWindow);
  -clearParameters = true;
  +{
  +// not used, handled by JetspeedNavigationalStateCodec itself
   }
   
   public void setParameters(Map parameters)
  @@ -86,25 +82,6 @@
   
   public String toString()
   {
  -if ( clearParameters )
  -{
  -if (parameters != null)
  -{
  -Iterator names = parameters.keySet().iterator();
  -Map map = new HashMap();
  -while (names.hasNext())
  -{
  -String name = (String) names.next();
  -Object value = parameters.get(name);
  -String[] values = value instanceof String ? new String[] 
{(String) value } : (String[]) value;
  -map.put(name,values);
  -}
  -}
  -return 
url.createPortletURL(portletWindow,parameters,mode,state,action,secure);
  -}
  -else
  -{
  -return url.createPortletURL(portletWindow,mode,state,secure);
  -}
  +return 
url.createPortletURL(portletWindow,parameters,mode,state,action,secure);
   }
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/services/information PortletURLProviderImpl.java

2004-04-01 Thread taylor
taylor  2004/04/01 09:18:46

  Modified:portal/src/java/org/apache/jetspeed/container/url/impl
PortalControlParameter.java PortalURLImpl.java
   portal/src/java/org/apache/jetspeed/container/session/impl
PathNavigationalState.java
SessionNavigationalState.java
   portal/src/java/org/apache/jetspeed/container/session
NavigationalState.java
   portal/src/java/org/apache/jetspeed/services/information
PortletURLProviderImpl.java
  Added:   portal/src/java/org/apache/jetspeed/container/session/impl
AbstractNavigationalState.java
  Log:
  - abstracting inteface between navigational state components

  - fixed bug in PortletURLProvider as reported by Ate Douma

  - continuing test cases an implementation of SessionNavigationalState and 
PathNavigationalState

  

  PR:

  Obtained from:

  Submitted by: 

  Reviewed by:  

  CVS: --

  CVS: PR:

  CVS:   If this change addresses a PR in the problem report tracking

  CVS:   database, then enter the PR number(s) here.

  CVS: Obtained from:

  CVS:   If this change has been taken from another system, such as NCSA,

  CVS:   then name the system in this line, otherwise delete it.

  CVS: Submitted by:

  CVS:   If this code has been contributed to Apache by someone else; i.e.,

  CVS:   they sent us a patch or a new module, then include their name/email

  CVS:   address here. If this is your work then delete this line.

  CVS: Reviewed by:

  CVS:   If we are doing pre-commit code reviews and someone else has

  CVS:   reviewed your changes, include their name(s) here.

  CVS:   If you have not had it reviewed then delete this line.

  
  Revision  ChangesPath
  1.3   +25 -24
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/url/impl/PortalControlParameter.java
  
  Index: PortalControlParameter.java
  ===
  RCS file: 
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/container/url/impl/PortalControlParameter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PortalControlParameter.java   31 Mar 2004 06:19:08 -  1.2
  +++ PortalControlParameter.java   1 Apr 2004 17:18:44 -   1.3
  @@ -18,6 +18,7 @@
   import java.util.ArrayList;
   import java.util.HashMap;
   import java.util.Iterator;
  +import java.util.List;
   import java.util.Map;
   import java.util.StringTokenizer;
   
  @@ -175,7 +176,7 @@
   
   public Iterator getRenderParamNames(PortletWindow window)
   {
  -ArrayList returnvalue = new ArrayList();
  +List returnvalue = new ArrayList();
   String prefix = getRenderParamKey(window);
   Iterator keyIterator = stateFullControlParameter.keySet().iterator();
   
  @@ -296,28 +297,6 @@
   return nav.getNavigationKey(NavigationalStateComponent.ID);
   }
   
  -public boolean isControlParameter(String param)
  -{
  -return 
param.startsWith(nav.getNavigationKey(NavigationalStateComponent.PREFIX));
  -}
  -
  -public boolean isStateFullParameter(String param)
  -{
  -if (isControlParameter(param))
  -{
  -String prefix = 
nav.getNavigationKey(NavigationalStateComponent.PREFIX);
  -if ((param.startsWith(prefix + 
nav.getNavigationKey(NavigationalStateComponent.MODE)))
  -|| (param.startsWith(prefix + 
nav.getNavigationKey(NavigationalStateComponent.PREV_MODE)))
  -|| (param.startsWith(prefix + 
nav.getNavigationKey(NavigationalStateComponent.STATE)))
  -|| (param.startsWith(prefix + 
nav.getNavigationKey(NavigationalStateComponent.PREV_STATE)))
  -|| (param.startsWith(prefix + 
nav.getNavigationKey(NavigationalStateComponent.RENDER_PARAM
  -{
  -return true;
  -}
  -}
  -return false;
  -}
  -
   public String decodeParameterName(String paramName)
   {
   int length = 
nav.getNavigationKey(NavigationalStateComponent.PREFIX).length();
  @@ -406,6 +385,28 @@
   value = StringUtils.replace(value, _, 0x1);
   value = StringUtils.replace(value, ., 0x2);
   return value;
  +}
  +
  +public boolean isNavigationalParameter(String token)
  +{
  +return 
token.startsWith(nav.getNavigationKey(NavigationalStateComponent.PREFIX));
  +}
  +
  +public boolean isStateFullParameter(String param)
  +{
  +if (isNavigationalParameter(param))
  +{
  +String prefix = 
nav.getNavigationKey(NavigationalStateComponent.PREFIX);
  +if ((param.startsWith(prefix +