portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r897320 - in /portals/jetspeed-2/portal/trunk: applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/ components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/ jetspeed-commons/src/main/java/org/apache/jetspeed/portlets/layout/
Date Fri, 08 Jan 2010 20:48:04 GMT
Author: taylor
Date: Fri Jan  8 20:48:03 2010
New Revision: 897320

URL: http://svn.apache.org/viewvc?rev=897320&view=rev
Log:
JS2-1084
implement detached/maximize

Modified:
    portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui.jsp
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiAggregatorImpl.java
    portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java

Modified: portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui.jsp
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui.jsp?rev=897320&r1=897319&r2=897320&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui.jsp
(original)
+++ portals/jetspeed-2/portal/trunk/applications/jetspeed/src/main/webapp/WEB-INF/jetui/yui/jetui.jsp
Fri Jan  8 20:48:03 2010
@@ -19,6 +19,7 @@
 <%@ page import="java.util.Collection" %>
 <%@ page import="java.util.List" %>
 <%@ page import="java.util.Map" %>
+<%@ page import="org.apache.jetspeed.JetspeedActions" %>
 <%@ page import="org.apache.jetspeed.ui.Jetui" %>
 <%@ page import="org.apache.jetspeed.ui.Toolbar" %>
 <%@ page import="org.apache.jetspeed.request.RequestContext" %>
@@ -187,6 +188,7 @@
         request.setAttribute("decorator", decorator);
         request.setAttribute("fragment", maximized);
 		request.setAttribute("coordinate", columnLayout.getCoordinate(maximized));
+        // request.setAttribute("detached", new Boolean(true));            
 %>
 <div id="column_id_0"
      class="portal-layout-column"
@@ -215,7 +217,7 @@
             for (ContentFragment fragment : collections)
             {
                 String state = fragment.getState();
-                if (state == null || !state.equals("detach"))
+                if (state == null || !state.equals(JetspeedActions.DETACH))
                 {
                    //String content = jetui.renderPortletWindow(fragment.getId(), fragment.getName(),
rc);
                    String content = jetui.getRenderedContent((ContentFragment)fragment, rc);

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java?rev=897320&r1=897319&r2=897320&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java
Fri Jan  8 20:48:03 2010
@@ -115,7 +115,7 @@
             }
             else
             {
-                ColumnLayout columnLayout = new ColumnLayout(1, "maximized", rootFragment.getFragments(),
new String[] { "100%" });
+                ColumnLayout columnLayout = new ColumnLayout(1, "maximized", rootFragment.getFragments(),
new String[] { "100%" }, maximized);
                 request.setAttribute("columnLayout", columnLayout);                
             }
             dispatcher.include(request.getRequest(), request.getResponse());            

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiAggregatorImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiAggregatorImpl.java?rev=897320&r1=897319&r2=897320&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiAggregatorImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/JetuiAggregatorImpl.java
Fri Jan  8 20:48:03 2010
@@ -53,28 +53,28 @@
 
     protected void renderMaximizedWindow(RequestContext context, ContentPage page, ContentFragment
layoutContentFragment, PortletWindow window)
     {
-//        boolean maxedLayout = false;
-//        PortletWindow layoutWindow;
-//        if (window.getFragment().getId().equals(layoutContentFragment.getId()))
-//        {
-//            layoutWindow = window;
-//            maxedLayout = true;
-//        }
-//        else
-//        {
-//            layoutWindow = context.getPortletWindow(layoutContentFragment);
-//        }
+        boolean maxedLayout = false;
+        PortletWindow layoutWindow;
+        if (window.getFragment().getId().equals(layoutContentFragment.getId()))
+        {
+            layoutWindow = window;
+            maxedLayout = true;
+        }
+        else
+        {
+            layoutWindow = context.getPortletWindow(layoutContentFragment);
+        }
 
           context.setAttribute(PortalReservedParameters.MAXIMIZED_FRAGMENT_ATTRIBUTE, window.getFragment());
-//        layoutWindow.setAttribute(PortalReservedParameters.MAXIMIZED_LAYOUT_ATTRIBUTE,
page.getRootContentFragment());
+          layoutWindow.setAttribute(PortalReservedParameters.MAXIMIZED_LAYOUT_ATTRIBUTE,
page.getRootFragment());
 
         try
         {
             renderer.renderNow(window.getFragment(), context);
-//            if (!maxedLayout)
-//            {
-//                renderer.renderNow(layoutContentFragment, context);
-//            }
+            if (!maxedLayout)
+            {
+                renderer.renderNow(layoutContentFragment, context);
+            }
         }
         catch (Exception e)
         {

Modified: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java?rev=897320&r1=897319&r2=897320&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlets/layout/ColumnLayout.java
Fri Jan  8 20:48:03 2010
@@ -158,18 +158,23 @@
      *            are used.
      * @throws LayoutEventException
      */
-    public ColumnLayout(int numberOfColumns, String layoutType, Collection<ContentFragment>
fragments, String[] columnWidths) throws LayoutEventException
+    public ColumnLayout(int numberOfColumns, String layoutType, Collection<ContentFragment>
fragments, String[] columnWidths, ContentFragment maximized) throws LayoutEventException
     {
         this(numberOfColumns, layoutType, columnWidths);
         Iterator<ContentFragment> fragmentsItr = fragments.iterator();
         try
         {
+            if (maximized != null)
+            {
+                doAdd(getColumn(maximized), getRow(getColumn(maximized), maximized), maximized);
+                return;
+            }
             while (fragmentsItr.hasNext())
             {
                 ContentFragment fragment = (ContentFragment) fragmentsItr.next();
                 String windowState = fragment.getState();
                 if (windowState != null && windowState.equals(JetspeedActions.DETACH))
-                {
+                {                    
                     detachedPortlets.add(fragment);
                     continue;
                 }
@@ -185,6 +190,11 @@
             throw new LayoutError("A malformed fragment could not be adjusted.", e);
         }
     }
+    
+    public ColumnLayout(int numberOfColumns, String layoutType, Collection<ContentFragment>
fragments, String[] columnWidths) throws LayoutEventException
+    {
+        this(numberOfColumns, layoutType, fragments, columnWidths, null);
+    }
 
     /**
      * <p>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message