[portal-commits] JBoss Portal SVN: r5887 - in trunk/core/src: main/org/jboss/portal/core/aspects/controller main/org/jboss/portal/core/portlet/dashboard resources/portal-core-war/WEB-INF/jsp/dashboard

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Sun Dec 17 22:03:30 EST 2006


Author: roy.russo at jboss.com
Date: 2006-12-17 22:03:27 -0500 (Sun, 17 Dec 2006)
New Revision: 5887

Modified:
   trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
   trunk/core/src/main/org/jboss/portal/core/portlet/dashboard/Configurator.java
   trunk/core/src/resources/portal-core-war/WEB-INF/jsp/dashboard/editpage.jsp
Log:
JBPORTAL-1140 - users can customize dashboards with layouts/theme

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-17 15:18:04 UTC (rev 5886)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java	2006-12-18 03:03:27 UTC (rev 5887)
@@ -231,11 +231,14 @@
             sb.append("  |  ");
             sb.append("<a href=\"").append(showadminURL).append("\">Admin</a>");
          }
-/*         else
+         else
          {
-            sb.append("&nbsp;&nbsp;|&nbsp;&nbsp;");
-            sb.append("<a href=\"").append(showDefaultURL).append("\">Main</a>");
-         }*/
+            if (!dashboard)
+            {
+               sb.append("&nbsp;&nbsp;|&nbsp;&nbsp;");
+               sb.append("<a href=\"").append(showDefaultURL).append("\">Main</a>");
+            }
+         }
 
          if (dashboard)
          {
@@ -251,16 +254,6 @@
 
          sb.append("&nbsp;&nbsp;|&nbsp;&nbsp;");
 
-         //inject CMS Admin link  TODO: what is this?!
-/*
-         if (user != null && showadminURL == null)
-         {
-            sb.append("<a href=\"").append("/portal/portal/cms").append("\">CMS Admin Tool</a>");
-         }
-
-         sb.append("&nbsp;&nbsp;|&nbsp;&nbsp;");
-*/
-
          sb.append("<a href=\"").append(logoutURL).append("\">Logout</a>");
       }
       return sb;

Modified: trunk/core/src/main/org/jboss/portal/core/portlet/dashboard/Configurator.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/portlet/dashboard/Configurator.java	2006-12-17 15:18:04 UTC (rev 5886)
+++ trunk/core/src/main/org/jboss/portal/core/portlet/dashboard/Configurator.java	2006-12-18 03:03:27 UTC (rev 5887)
@@ -32,6 +32,7 @@
 import org.jboss.portal.core.model.portal.Window;
 import org.jboss.portal.theme.LayoutService;
 import org.jboss.portal.theme.PortalLayout;
+import org.jboss.portal.theme.PortalTheme;
 import org.jboss.portal.theme.ThemeConstants;
 import org.jboss.portal.theme.ThemeService;
 import org.jboss.portlet.JBossActionRequest;
@@ -176,14 +177,21 @@
          layoutId = page.getProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
       }
       PortalLayout currentLayout = layoutService.getLayout(layoutId, true);
-      String themeId = page.getProperty(ThemeConstants.PORTAL_PROP_THEME);
 
+      String themeId = page.getDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME);
+      if (themeId == null)
+      {
+         themeId = page.getProperty(ThemeConstants.PORTAL_PROP_THEME);
+      }
+      PortalTheme currentTheme = themeService.getTheme(themeId, true);
+
       // dispatch
       req.setAttribute("available_instances", available_instances);
       req.setAttribute("pages", pages);
       req.setAttribute("currentPage", page.getName());
       req.setAttribute("layouts", layouts);
       req.setAttribute("currentLayout", currentLayout.getLayoutInfo().getName());
+      req.setAttribute("currentTheme", currentTheme.getThemeInfo().getName());
       req.setAttribute("themes", themes);
       if (errorMessage != null)
       {
@@ -380,13 +388,13 @@
       }
       else if ("assignTheme".equals(op))
       {
-         String selectedLayout = actionRequest.getParameter("theme");
+         String selectedTheme = actionRequest.getParameter("theme");
 
-         PortalLayout checkLayout = layoutService.getLayout(selectedLayout, true);
+         PortalTheme checkTheme = themeService.getTheme(selectedTheme, true);
 
-         if (checkLayout != null)
+         if (checkTheme != null)
          {
-            page.setDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT, checkLayout.getLayoutInfo().getName());
+            page.setDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME, checkTheme.getThemeInfo().getName());
          }
 
          actionResponse.setRenderParameter("editPageSelect", editPage);

Modified: trunk/core/src/resources/portal-core-war/WEB-INF/jsp/dashboard/editpage.jsp
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/jsp/dashboard/editpage.jsp	2006-12-17 15:18:04 UTC (rev 5886)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/jsp/dashboard/editpage.jsp	2006-12-18 03:03:27 UTC (rev 5887)
@@ -3,9 +3,7 @@
 <%@ page import="org.jboss.portal.core.model.portal.Window" %>
 <%@ page import="org.jboss.portal.theme.PortalLayout" %>
 <%@ page import="org.jboss.portal.theme.PortalTheme" %>
-<%@ page import="java.util.ArrayList" %>
 <%@ page import="java.util.Collection" %>
-<%@ page import="java.util.Collections" %>
 <%@ page import="java.util.Iterator" %>
 <%@ page import="java.util.List" %>
 <%@ page import="java.util.Map" %>
@@ -22,6 +20,7 @@
    List pages = (List)request.getAttribute("pages");
 
    Map windowMap = (Map)request.getAttribute("windowMap");
+   List regions = (List)request.getAttribute("regions");
 
    String currentPage = (String)request.getAttribute("currentPage");
    String currentLayout = (String)request.getAttribute("currentLayout");
@@ -84,15 +83,9 @@
 <th colspan="2" class="portlet-section-header" align="center">Personal Dashboard Editor</th>
 <tr>
    <td class="portlet-section-body" align="center">
-      <table width="500">
+      <table width="100%">
          <tr>
-            <td align="left">
-               Use this tool to manage the content and appearance of your dashboard pages. <br/>
-               You can control the page titles, column layouts, page themes,
-               and add,
-               order, or remove portlets.
-            </td>
-            <td>
+            <td width="250">
                <table class="bottombuttonbar">
                   <tr>
                      <td align="left" valign="top"><b>Create a New Page:</b><br/>Page name:&nbsp;
@@ -107,6 +100,12 @@
                   </tr>
                </table>
             </td>
+            <td align="left" valign="top">
+               Use this tool to manage the content and appearance of your dashboard pages. <br/>
+               You can control the page titles, column layouts, page themes,
+               and add,
+               order, or remove portlets.
+            </td>
          </tr>
       </table>
    </td>
@@ -166,8 +165,7 @@
          </td>
       </tr>
       <tr>
-         <td>
-
+         <td>Choose a layout:<br/>
             <select name="layout">
                <%
                   for (Iterator iterator = layouts.iterator(); iterator.hasNext();)
@@ -186,11 +184,14 @@
                   }
                %>
             </select>&nbsp;<input type="submit" class="portlet-form-button" name="Select" value="Select"
-                            onclick="switchLayout('assignLayout');"/>
+                                  onclick="switchLayout('assignLayout');"/>
          </td>
       </tr>
       <tr>
-         <td>
+         <td height="20"></td>
+      </tr>
+      <tr>
+         <td>Choose a theme:<br/>
             <select name="theme">
                <%
                   for (Iterator iterator = themes.iterator(); iterator.hasNext();)
@@ -209,9 +210,12 @@
                   }
                %>
             </select>&nbsp;<input type="submit" class="portlet-form-button" name="Select" value="Select"
-                            onclick="switchTheme('assignTheme');"/>
+                                  onclick="switchTheme('assignTheme');"/>
          </td>
       </tr>
+      <tr>
+         <td height="20"></td>
+      </tr>
    </table>
 </td>
 <td class="portlet-section-body" valign="top" align="right"><b>Available Content</b><br/>
@@ -231,8 +235,6 @@
 <td>
 <table>
    <%
-      List regions = new ArrayList(windowMap.keySet());
-      Collections.sort(regions);
       for (Iterator i = regions.iterator(); i.hasNext();)
       {
          String region = (String)i.next();




More information about the portal-commits mailing list