[jboss-svn-commits] JBoss Portal SVN: r5379 - in trunk: core/src/main/org/jboss/portal/core/aspects/controller theme/src/main/org/jboss/portal/theme theme/src/main/org/jboss/portal/theme/impl/render/dynamic theme/src/main/org/jboss/portal/theme/page

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Oct 9 15:49:16 EDT 2006


Author: julien at jboss.com
Date: 2006-10-09 15:49:08 -0400 (Mon, 09 Oct 2006)
New Revision: 5379

Modified:
   trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
   trunk/theme/src/main/org/jboss/portal/theme/ThemeConstants.java
   trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaRegionRenderer.java
   trunk/theme/src/main/org/jboss/portal/theme/page/PageResult.java
   trunk/theme/src/main/org/jboss/portal/theme/page/Region.java
Log:
disable injection of dyna behavior on dashboard and tab

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-10-09 19:24:22 UTC (rev 5378)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java	2006-10-09 19:49:08 UTC (rev 5379)
@@ -39,6 +39,7 @@
 import org.jboss.portal.theme.page.WindowResult;
 import org.jboss.portal.theme.page.ModifiableWindowResult;
 import org.jboss.portal.theme.page.WindowContext;
+import org.jboss.portal.theme.page.Region;
 import org.jboss.portal.api.node.PortalNode;
 
 import java.util.Collections;
@@ -88,6 +89,7 @@
             if (tabbedNav != null)
             {
                Map windowProps = new HashMap();
+
                windowProps.put(ThemeConstants.PORTAL_PROP_WINDOW_RENDERER, "emptyRenderer");
                windowProps.put(ThemeConstants.PORTAL_PROP_DECORATION_RENDERER, "emptyRenderer");
                windowProps.put(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER, "emptyRenderer");
@@ -95,12 +97,17 @@
                WindowContext blah = new WindowContext("BLAH", "BLAH", "navigation", 0);
                rendition.getPageResult().addWindowContext(blah);
                rendition.getPageResult().addWindowResult("BLAH", res);
+
+               //
+               Region region = rendition.getPageResult().getRegion("navigation");
+               region.setProperty(ThemeConstants.PORTAL_AJAX_OBJECT_DISABLED, "true");
             }
 
             StringBuffer dashboardNav = injectDashboardNav(rpc);
             if (dashboardNav != null)
             {
                Map windowProps = new HashMap();
+               windowProps.put(ThemeConstants.PORTAL_AJAX_OBJECT_DISABLED, "true");
                windowProps.put(ThemeConstants.PORTAL_PROP_WINDOW_RENDERER, "emptyRenderer");
                windowProps.put(ThemeConstants.PORTAL_PROP_DECORATION_RENDERER, "emptyRenderer");
                windowProps.put(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER, "emptyRenderer");
@@ -108,6 +115,10 @@
                WindowContext bluh = new WindowContext("BLUH", "BLUH", "dashboardnav", 0);
                rendition.getPageResult().addWindowContext(bluh);
                rendition.getPageResult().addWindowResult("BLUH", res);
+
+               //
+               Region region = rendition.getPageResult().getRegion("dashboardnav");
+               region.setProperty(ThemeConstants.PORTAL_AJAX_OBJECT_DISABLED, "true");
             }
          }
       }

Modified: trunk/theme/src/main/org/jboss/portal/theme/ThemeConstants.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/ThemeConstants.java	2006-10-09 19:24:22 UTC (rev 5378)
+++ trunk/theme/src/main/org/jboss/portal/theme/ThemeConstants.java	2006-10-09 19:49:08 UTC (rev 5379)
@@ -105,4 +105,9 @@
     *
     */
    public static final String PORTAL_AJAX_REMOTE_URL = "theme.ajax.remove_url";
+
+   /**
+    *
+    */
+   public static final String PORTAL_AJAX_OBJECT_DISABLED = "theme.ajax.object_disabled";
 }

Modified: trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaRegionRenderer.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaRegionRenderer.java	2006-10-09 19:24:22 UTC (rev 5378)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaRegionRenderer.java	2006-10-09 19:49:08 UTC (rev 5379)
@@ -185,12 +185,17 @@
 
             markup.append("</script>\n");
             markup.append("\n\n\n");
-        } else {
-            markup.append(
-                    "<script>" +
-                            "regions_on_page[\"" + renderContext.getRegionID() + "\"]=\"" + region.getId() + "\";" +
-                            "</script>");
         }
+        else
+        {
+           if ("true".equals(region.getProperty(ThemeConstants.PORTAL_AJAX_OBJECT_DISABLED)) == false)
+           {
+              markup.append(
+              "<script>" +
+                 "regions_on_page[\"" + renderContext.getRegionID() + "\"]=\"" + region.getId() + "\";" +
+              "</script>");
+           }
+        }
 
         //
         delegate.render(renderContext, region, portletContexts, windowResults);

Modified: trunk/theme/src/main/org/jboss/portal/theme/page/PageResult.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/page/PageResult.java	2006-10-09 19:24:22 UTC (rev 5378)
+++ trunk/theme/src/main/org/jboss/portal/theme/page/PageResult.java	2006-10-09 19:49:08 UTC (rev 5379)
@@ -36,6 +36,7 @@
  */
 public class PageResult extends MarkupResult
 {
+   /** . */
    protected final Map portletRegions;
 
    public PageResult(String pageName, Map pageProperties, Map portalProperties)

Modified: trunk/theme/src/main/org/jboss/portal/theme/page/Region.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/page/Region.java	2006-10-09 19:24:22 UTC (rev 5378)
+++ trunk/theme/src/main/org/jboss/portal/theme/page/Region.java	2006-10-09 19:49:08 UTC (rev 5379)
@@ -24,6 +24,8 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
 
 /**
  * A region on a page.
@@ -34,11 +36,13 @@
  */
 public final class Region
 {
+
    private final String name;
    private boolean sorted;
    private final ArrayList windows;
    private String cssId;
    private RegionOrientation orientation;
+   private Map properties;
 
    /**
     * Create a region with default orientation (how the portlet windows are arranged) and the region name as the css id selector
@@ -70,6 +74,27 @@
       this.orientation = (orientation == null ? RegionOrientation.DEFAULT : orientation);
    }
 
+   public String getProperty(String name)
+   {
+      if (properties != null)
+      {
+         return (String)properties.get(name);
+      }
+      else
+      {
+         return null;
+      }
+   }
+
+   public void setProperty(String name, String value)
+   {
+      if (properties == null)
+      {
+         properties = new HashMap();
+      }
+      properties.put(name, value);
+   }
+
    /**
     * @return the identifier of this region (i.e. the name of this region)
     */




More information about the jboss-svn-commits mailing list