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 ta...@apache.org on 2006/12/22 01:11:00 UTC
svn commit: r489518 - in
/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration:
AbstractDecoratorActionsFactory.java DecorationValve.java
Author: taylor
Date: Thu Dec 21 16:10:59 2006
New Revision: 489518
URL: http://svn.apache.org/viewvc?view=rev&rev=489518
Log:
http://issues.apache.org/jira/browse/JS2-629
contribution from Thorsten Berger
Session tracking by url rewriting was broken in the page and decorator action links.
Modified:
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/AbstractDecoratorActionsFactory.java
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/DecorationValve.java
Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/AbstractDecoratorActionsFactory.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/AbstractDecoratorActionsFactory.java?view=diff&rev=489518&r1=489517&r2=489518
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/AbstractDecoratorActionsFactory.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/AbstractDecoratorActionsFactory.java Thu Dec 21 16:10:59 2006
@@ -1,56 +1,56 @@
-package org.apache.jetspeed.decoration;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.portlet.PortletMode;
-import javax.portlet.WindowState;
-
-import org.apache.jetspeed.container.url.PortalURL;
-import org.apache.jetspeed.om.common.portlet.PortletApplication;
-import org.apache.jetspeed.request.RequestContext;
-import org.apache.pluto.om.window.PortletWindow;
-
-public abstract class AbstractDecoratorActionsFactory implements DecoratorActionsFactory
-{
- public List getDecoratorActions(RequestContext rc, PortletApplication pa, PortletWindow pw, PortletMode pm,
- WindowState ws, Decoration decoration, List actionTemplates)
- {
- DecoratorAction action;
- ArrayList actions = new ArrayList();
-
- Iterator iter = actionTemplates.iterator();
- while (iter.hasNext())
- {
- action = createAction(rc, pw, decoration, (DecoratorActionTemplate)iter.next());
- if ( action != null )
- {
- actions.add(action);
- }
- }
- return actions;
- }
-
- protected DecoratorAction createAction(RequestContext rc, PortletWindow pw, Decoration decoration,
- DecoratorActionTemplate template)
- {
- String actionName = template.getAction();
-
- PortalURL portalURL = rc.getPortalURL();
- Boolean isAjaxRequest = (Boolean)rc.getAttribute(DecorationValve.IS_AJAX_DECORATION_REQUEST);
-
- String actionURL = (isAjaxRequest == null)
- ? portalURL.createPortletURL(pw, template.getCustomMode(), template.getCustomState(),
- portalURL.isSecure()).toString()
- : portalURL.createNavigationalEncoding(pw, template.getCustomMode(), template.getCustomState());
-
- String linkURL = decoration.getResource("images/" + actionName + ".gif");
-
- boolean customAction = (template.getMode() != null && !template.getMode().equals(template.getCustomMode()))
- || (template.getState() != null && !template.getState().equals(template.getCustomState()));
-
- return new DecoratorAction( actionName, rc.getLocale(), linkURL, actionURL, customAction, template.getActionType() );
- }
-
-}
+package org.apache.jetspeed.decoration;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.portlet.PortletMode;
+import javax.portlet.WindowState;
+
+import org.apache.jetspeed.container.url.PortalURL;
+import org.apache.jetspeed.om.common.portlet.PortletApplication;
+import org.apache.jetspeed.request.RequestContext;
+import org.apache.pluto.om.window.PortletWindow;
+
+public abstract class AbstractDecoratorActionsFactory implements DecoratorActionsFactory
+{
+ public List getDecoratorActions(RequestContext rc, PortletApplication pa, PortletWindow pw, PortletMode pm,
+ WindowState ws, Decoration decoration, List actionTemplates)
+ {
+ DecoratorAction action;
+ ArrayList actions = new ArrayList();
+
+ Iterator iter = actionTemplates.iterator();
+ while (iter.hasNext())
+ {
+ action = createAction(rc, pw, decoration, (DecoratorActionTemplate)iter.next());
+ if ( action != null )
+ {
+ actions.add(action);
+ }
+ }
+ return actions;
+ }
+
+ protected DecoratorAction createAction(RequestContext rc, PortletWindow pw, Decoration decoration,
+ DecoratorActionTemplate template)
+ {
+ String actionName = template.getAction();
+
+ PortalURL portalURL = rc.getPortalURL();
+ Boolean isAjaxRequest = (Boolean)rc.getAttribute(DecorationValve.IS_AJAX_DECORATION_REQUEST);
+
+ String actionURL = rc.getResponse().encodeURL( (isAjaxRequest == null)
+ ? portalURL.createPortletURL(pw, template.getCustomMode(), template.getCustomState(),
+ portalURL.isSecure()).toString()
+ : portalURL.createNavigationalEncoding(pw, template.getCustomMode(), template.getCustomState()) );
+
+ String linkURL = decoration.getResource("images/" + actionName + ".gif");
+
+ boolean customAction = (template.getMode() != null && !template.getMode().equals(template.getCustomMode()))
+ || (template.getState() != null && !template.getState().equals(template.getCustomState()));
+
+ return new DecoratorAction( actionName, rc.getLocale(), linkURL, actionURL, customAction, template.getActionType() );
+ }
+
+}
Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/DecorationValve.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/DecorationValve.java?view=diff&rev=489518&r1=489517&r2=489518
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/DecorationValve.java (original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/decoration/DecorationValve.java Thu Dec 21 16:10:59 2006
@@ -324,9 +324,9 @@
{
// switch back to VIEW mode and NORMAL state.
PortalURL portalURL = requestContext.getPortalURL();
- String action = (isAjaxRequest)
+ String action = requestContext.getResponse().encodeURL( (isAjaxRequest)
? portalURL.createNavigationalEncoding(window, PortletMode.VIEW, WindowState.NORMAL)
- : portalURL.createPortletURL(window, PortletMode.VIEW, WindowState.NORMAL, portalURL.isSecure()).toString();
+ : portalURL.createPortletURL(window, PortletMode.VIEW, WindowState.NORMAL, portalURL.isSecure()).toString() );
String actionName = PortletMode.VIEW.toString();
pageModes.add(new DecoratorAction(actionName, requestContext.getLocale(), decoration.getResource("images/" + actionName + ".gif"),action,DecoratorActionTemplate.ACTION_TYPE_MODE));
}
@@ -339,9 +339,9 @@
parameters.put("pageMode",paramValues);
// Use an ActionURL to set the oposite pageMode and always set VIEW mode and state NORMAL
- String action = (isAjaxRequest)
+ String action = requestContext.getResponse().encodeURL( (isAjaxRequest)
? portalURL.createNavigationalEncoding(window, parameters, PortletMode.VIEW, WindowState.NORMAL, true)
- : portalURL.createPortletURL(window, parameters, PortletMode.VIEW, WindowState.NORMAL, true, portalURL.isSecure()).toString();
+ : portalURL.createPortletURL(window, parameters, PortletMode.VIEW, WindowState.NORMAL, true, portalURL.isSecure()).toString() );
pageModes.add(new DecoratorAction(targetMode, requestContext.getLocale(), decoration.getResource("images/" + targetMode + ".gif"), action,DecoratorActionTemplate.ACTION_TYPE_MODE));
if (content.supportsPortletMode(PortletMode.HELP))
@@ -350,16 +350,16 @@
{
// force it back to VIEW mode first with an ActionURL, as well as setting HELP mode and MAXIMIZED state
paramValues[0] = PortletMode.VIEW.toString();
- action = (isAjaxRequest)
+ action = requestContext.getResponse().encodeURL( (isAjaxRequest)
? portalURL.createNavigationalEncoding(window, parameters, PortletMode.HELP, WindowState.MAXIMIZED, true)
- : portalURL.createPortletURL(window, parameters, PortletMode.HELP, WindowState.MAXIMIZED, true, portalURL.isSecure()).toString();
+ : portalURL.createPortletURL(window, parameters, PortletMode.HELP, WindowState.MAXIMIZED, true, portalURL.isSecure()).toString() );
}
else
{
// switch to mode HELP and state MAXIMIZED
- action = (isAjaxRequest)
+ action = requestContext.getResponse().encodeURL( (isAjaxRequest)
? portalURL.createNavigationalEncoding(window, PortletMode.HELP, WindowState.MAXIMIZED)
- : portalURL.createPortletURL(window,PortletMode.HELP, WindowState.MAXIMIZED, portalURL.isSecure()).toString();
+ : portalURL.createPortletURL(window,PortletMode.HELP, WindowState.MAXIMIZED, portalURL.isSecure()).toString() );
}
String actionName = PortletMode.HELP.toString();
pageModes.add(new DecoratorAction(actionName, requestContext.getLocale(), decoration.getResource("images/" + actionName + ".gif"), action,DecoratorActionTemplate.ACTION_TYPE_MODE));
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org