[portal-commits] JBoss Portal SVN: r5921 - trunk/core/src/main/org/jboss/portal/core/aspects/controller

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Wed Dec 20 20:26:36 EST 2006


Author: julien at jboss.com
Date: 2006-12-20 20:26:34 -0500 (Wed, 20 Dec 2006)
New Revision: 5921

Modified:
   trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
Log:
- "Edit Content" really edit the current dashboard page
- renammed "Pages" to "Portal"

Modified: trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java	2006-12-21 01:12:34 UTC (rev 5920)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java	2006-12-21 01:26:34 UTC (rev 5921)
@@ -41,6 +41,7 @@
 import org.jboss.portal.core.model.portal.command.ViewDashboardCommand;
 import org.jboss.portal.identity.User;
 import org.jboss.portal.portlet.impl.PortletRequestDecoder;
+import org.jboss.portal.portlet.ParametersStateString;
 import org.jboss.portal.security.PortalSecurityException;
 import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
 import org.jboss.portal.server.request.URLContext;
@@ -154,11 +155,19 @@
       }
       else
       {
+         String configureURL = null;
+
          boolean dashboard = false;
          if (cc instanceof RenderPageCommand)
          {
             RenderPageCommand rpc = (RenderPageCommand)cc;
             dashboard = rpc.isDashboard();
+
+            //
+            ParametersStateString navState = new ParametersStateString();
+            navState.setValue("editPageSelect", rpc.getPage().getName());
+            InvokePortletInstanceRenderCommand command = new InvokePortletInstanceRenderCommand("ConfiguratorPortletInstance", navState);
+            configureURL = cc.getControllerContext().renderURL(command, null, null);
          }
          String pageURL;
          String label;
@@ -166,7 +175,7 @@
          {
             RenderPageCommand _rpc = new RenderPageCommand(new PortalObjectId(new String[]{"default", "default"}));
             pageURL = cc.getControllerContext().renderURL(_rpc, null, null);
-            label = "Pages";
+            label = "Portal";
          }
          else
          {
@@ -242,20 +251,15 @@
             }
          }
 
-         if (dashboard)
+         //
+         if (configureURL != null)
          {
-            PortletRequestDecoder decoder = new PortletRequestDecoder();
-            decoder.decode(cc.getControllerContext().getServerInvocation().getServerContext().getQueryParameterMap(), cc.getControllerContext().getServerInvocation().getServerContext().getBodyParameterMap());
-
-            InvokePortletInstanceRenderCommand command = new InvokePortletInstanceRenderCommand("ConfiguratorPortletInstance", decoder.getNavigationalstate());
-            String configureURL = cc.getControllerContext().renderURL(command, null, null);
-
             sb.append("  |  ");
             sb.append("<a href=\"").append(configureURL).append("\">Edit Content</a>");
          }
 
+         //
          sb.append("&nbsp;&nbsp;|&nbsp;&nbsp;");
-
          sb.append("<a href=\"").append(logoutURL).append("\">Logout</a>");
       }
       return sb;




More information about the portal-commits mailing list