portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From woon...@apache.org
Subject svn commit: r888923 - in /portals/jetspeed-2/portal/trunk: components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/layout/impl/ components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/ jetspeed-api/src/main/java/org/apache/jetspeed/la...
Date Wed, 09 Dec 2009 19:01:04 GMT
Author: woonsan
Date: Wed Dec  9 19:01:03 2009
New Revision: 888923

URL: http://svn.apache.org/viewvc?rev=888923&view=rev
Log:
JS2-1057: Adding a method to retrieve unlocked root fragment.

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/layout/impl/PageLayoutComponentImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/ui/Jetui.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/PageLayoutComponent.java
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pipelines.xml

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/layout/impl/PageLayoutComponentImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/layout/impl/PageLayoutComponentImpl.java?rev=888923&r1=888922&r2=888923&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/layout/impl/PageLayoutComponentImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-layout/src/main/java/org/apache/jetspeed/layout/impl/PageLayoutComponentImpl.java
Wed Dec  9 19:01:03 2009
@@ -1440,7 +1440,28 @@
             throw new PageLayoutComponentException("Unexpected exception: "+e, e);
         }
     }
-
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.layout.PageLayoutComponent#getUnlockedRootFragment(org.apache.jetspeed.om.page.ContentPage)
+     */
+    public ContentFragment getUnlockedRootFragment(ContentPage contentPage)
+    {
+        ContentFragment rootFragment = contentPage.getRootFragment();
+        
+        if (rootFragment.isLocked())
+        {
+            for (ContentFragment f : (List<ContentFragment>) rootFragment.getFragments())
+            {
+                if (!f.isLocked() && f.getType().equals(ContentFragment.LAYOUT))
+                {
+                    return f;
+                }
+            }
+        }
+        
+        return rootFragment;
+    }
+    
     /**
      * Merge content page attributes from source PSML page.
      * 

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=888923&r1=888922&r2=888923&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
Wed Dec  9 19:01:03 2009
@@ -29,6 +29,7 @@
 import org.apache.jetspeed.decoration.Theme;
 import org.apache.jetspeed.headerresource.HeaderResource;
 import org.apache.jetspeed.headerresource.HeaderResourceFactory;
+import org.apache.jetspeed.layout.PageLayoutComponent;
 import org.apache.jetspeed.om.page.ContentFragment;
 import org.apache.jetspeed.pipeline.PipelineException;
 import org.apache.jetspeed.portlet.HeadElement;
@@ -48,12 +49,14 @@
 {
     private PortletRenderer renderer;
     private HeaderResourceFactory headerFactory;
+    private PageLayoutComponent pageLayoutComponent;
     private String layoutTemplate;
     
-    public Jetui(PortletRenderer renderer, HeaderResourceFactory headerFactory, String layoutTemplate)
+    public Jetui(PortletRenderer renderer, HeaderResourceFactory headerFactory, PageLayoutComponent
pageLayoutComponent, String layoutTemplate)
     {
         this.renderer = renderer;
         this.headerFactory = headerFactory;
+        this.pageLayoutComponent = pageLayoutComponent;
         this.layoutTemplate = layoutTemplate;
     }
     
@@ -64,18 +67,7 @@
         {
             RequestDispatcher dispatcher = request.getRequest().getRequestDispatcher(layoutTemplate);
             request.setAttribute("jetui", this);
-            ContentFragment rootFragment = request.getPage().getRootFragment();     
-            if (rootFragment.isLocked())
-            {
-                for (ContentFragment f : (List<ContentFragment>)rootFragment.getFragments())
-                {
-                    if (!f.isLocked() && f.getType().equals(ContentFragment.LAYOUT))
-                    {
-                        rootFragment = f;
-                        break;
-                    }
-                }
-            }            
+            ContentFragment rootFragment = pageLayoutComponent.getUnlockedRootFragment(request.getPage());
             if (maximized == null)
             {
                 String jetspeedLayout = rootFragment.getName();

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/PageLayoutComponent.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/PageLayoutComponent.java?rev=888923&r1=888922&r2=888923&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/PageLayoutComponent.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/layout/PageLayoutComponent.java
Wed Dec  9 19:01:03 2009
@@ -280,4 +280,13 @@
      * @param shortTitle page short title
      */
     void updateTitles(ContentPage contentPage, String title, String shortTitle);
+    
+    /**
+     * Returns the root fragment which is not locked and not merged from a page template
+     * 
+     * @param contentPage content page context
+     * @return
+     */
+    ContentFragment getUnlockedRootFragment(ContentPage contentPage);
+    
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pipelines.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pipelines.xml?rev=888923&r1=888922&r2=888923&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pipelines.xml
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pipelines.xml
Wed Dec  9 19:01:03 2009
@@ -914,10 +914,11 @@
     <meta key="j2:cat" value="default" />
     <constructor-arg><ref bean="org.apache.jetspeed.aggregator.PortletRenderer"/></constructor-arg>
     <constructor-arg><ref bean="org.apache.jetspeed.headerresource.HeaderResourceFactory"/></constructor-arg>
+    <constructor-arg><ref bean="org.apache.jetspeed.layout.PageLayoutComponent"
/></constructor-arg>
     <constructor-arg><value>/WEB-INF/jetui/yui/jetui.jsp</value></constructor-arg>
       
   </bean>
   
-   <bean id="jetuiAggregator" class="org.apache.jetspeed.ui.JetuiAggregatorImpl">
+  <bean id="jetuiAggregator" class="org.apache.jetspeed.ui.JetuiAggregatorImpl">
     <meta key="j2:cat" value="default" />
     <constructor-arg index="0">
       <ref bean="org.apache.jetspeed.aggregator.PortletRenderer" />



---------------------------------------------------------------------
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