cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r331099 - in /cocoon/blocks: portal-sample/trunk/samples/conf/ portal-sample/trunk/samples/skins/basic/styles/ portal-sample/trunk/samples/skins/common/styles/ portal/trunk/ portal/trunk/java/org/apache/cocoon/portal/ portal/trunk/java/org/...
Date Sun, 06 Nov 2005 11:30:32 GMT
Author: cziegeler
Date: Sun Nov  6 03:28:59 2005
New Revision: 331099

URL: http://svn.apache.org/viewcvs?rev=331099&view=rev
Log:
Fix stylesheets
Fix remove operation
New implementation for full screen
Add global configuration to portal service

Added:
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutFeatures.java  
(with props)
Modified:
    cocoon/blocks/portal-sample/trunk/samples/conf/cocoon-portal-sample.xconf
    cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/borderless-window.xsl
    cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/window.xsl
    cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/borderless-window.xsl
    cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/window.xsl
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/PortalService.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/impl/InternalEventReceiver.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PageLabelManager.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/SizingAspect.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/wsrp/adapter/WSRPAdapter.java
    cocoon/blocks/portal/trunk/status.xml

Modified: cocoon/blocks/portal-sample/trunk/samples/conf/cocoon-portal-sample.xconf
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/conf/cocoon-portal-sample.xconf?rev=331099&r1=331098&r2=331099&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/conf/cocoon-portal-sample.xconf (original)
+++ cocoon/blocks/portal-sample/trunk/samples/conf/cocoon-portal-sample.xconf Sun Nov  6 03:28:59
2005
@@ -93,8 +93,6 @@
       <!-- wsrp support: -->
       <aspect adapter="wsrp"/>
     </aspects>
-    <!-- Set to false or remove to have no navigation when portlets are displayed full
screen -->
-    <fullScreenNav>true</fullScreenNav>
   </portal-manager>
 
   <portal-event-manager>

Modified: cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/borderless-window.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/borderless-window.xsl?rev=331099&r1=331098&r2=331099&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/borderless-window.xsl (original)
+++ cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/borderless-window.xsl Sun
Nov  6 03:28:59 2005
@@ -72,24 +72,19 @@
 	  			    <img src="images/view.gif" border="0" alt="View"/>
 	  			</a>
 			</xsl:if>
-			<xsl:if test="fullscreen-uri and not(maximize-uri)">
+			<xsl:if test="fullscreen-uri and not(normal-uri)">
 				<a href="{fullscreen-uri}">
 	  			    <img src="images/customize.gif" border="0" alt="Full Screen"/>
 	  			</a>
 			</xsl:if>
-			<xsl:if test="maxpage-uri">
-				<a href="{maxpage-uri}">
+			<xsl:if test="maximize-uri">
+				<a href="{maximize-uri}">
 	  			    <img src="images/show.gif" border="0" alt="Max Page"/>
 	  			</a>
 			</xsl:if>
-			<xsl:if test="minpage-uri">
-				<a href="{minpage-uri}">
-	  			    <img src="images/show.gif" border="0" alt="Min Page"/>
-	  			</a>
-			</xsl:if>
-			<xsl:if test="maximize-uri">
-				<a href="{maximize-uri}">
-	  			    <img src="images/maximize.gif" border="0" alt="Maximize"/>
+			<xsl:if test="normal-uri">
+				<a href="{normal-uri}">
+	  			    <img src="images/maximize.gif" border="0" alt="Normal"/>
 	  			</a>
 			</xsl:if>
 			<xsl:if test="minimize-uri">

Modified: cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/window.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/window.xsl?rev=331099&r1=331098&r2=331099&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/window.xsl (original)
+++ cocoon/blocks/portal-sample/trunk/samples/skins/basic/styles/window.xsl Sun Nov  6 03:28:59
2005
@@ -75,25 +75,19 @@
 	  			</a>
 			</xsl:if>
             <xsl:if test="fullscreen-uri and not(normal-uri)">
-              <td width="15">
                 <a href="{fullscreen-uri}">
                   <img src="images/customize.gif" border="0" alt="Full Screen"/>
                 </a>
-              </td>
             </xsl:if>
             <xsl:if test="maximize-uri">
-              <td width="15">
                 <a href="{maximize-uri}">
                   <img src="images/show.gif" border="0" alt="Max Page"/>
                 </a>
-              </td>
             </xsl:if>
             <xsl:if test="normal-uri">
-              <td width="15">
                 <a href="{normal-uri}">
                   <img src="images/maximize.gif" border="0" alt="Normal"/>
                 </a>
-              </td>
             </xsl:if>
 			<xsl:if test="minimize-uri">
 				<a href="{minimize-uri}">

Modified: cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/borderless-window.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/borderless-window.xsl?rev=331099&r1=331098&r2=331099&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/borderless-window.xsl (original)
+++ cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/borderless-window.xsl Sun
Nov  6 03:28:59 2005
@@ -85,31 +85,27 @@
               </a>
             </td>
           </xsl:if>
-          <xsl:if test="fullscreen-uri and not(maximize-uri)">
+          <xsl:if test="edit-uri or view-uri or help-uri">
+			  <td width="15">&#160;</td>
+          </xsl:if>
+          <xsl:if test="fullscreen-uri and not(normal-uri)">
             <td width="15">
               <a href="{fullscreen-uri}">
                 <img src="images/customize.gif" border="0" alt="Full Screen"/>
               </a>
             </td>
           </xsl:if>
-          <xsl:if test="maxpage-uri">
+          <xsl:if test="maximize-uri">
             <td width="15">
-              <a href="{maxpage-uri}">
+              <a href="{maximize-uri}">
                 <img src="images/show.gif" border="0" alt="Max Page"/>
               </a>
             </td>
           </xsl:if>
-          <xsl:if test="minpage-uri">
+          <xsl:if test="normal-uri">
             <td width="15">
-              <a href="{minpage-uri}">
-                <img src="images/show.gif" border="0" alt="Min Page"/>
-              </a>
-            </td>
-          </xsl:if>
-          <xsl:if test="maximize-uri">
-            <td width="15">
-              <a href="{maximize-uri}">
-                <img src="images/maximize.gif" border="0" alt="Maximize"/>
+              <a href="{normal-uri}">
+                <img src="images/maximize.gif" border="0" alt="Normal"/>
               </a>
             </td>
           </xsl:if>

Modified: cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/window.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/window.xsl?rev=331099&r1=331098&r2=331099&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/window.xsl (original)
+++ cocoon/blocks/portal-sample/trunk/samples/skins/common/styles/window.xsl Sun Nov  6 03:28:59
2005
@@ -47,101 +47,101 @@
             </xsl:otherwise>
           </xsl:choose>	
         </b></font>
-       </td>
+      </td>
       <td align="right" valign="middle" bgColor="{$bgColor}">
         <table cellSpacing="0" cellpadding="0" border="0"><tbody><tr>
-		  <xsl:if test="basket-add-link">
+          <xsl:if test="basket-add-link">
             <td width="15">
-				<a href="{basket-add-link}">
-	  			    <img src="images/basket.gif" border="0" alt="Add Link"/>
-	  			</a>
+              <a href="{basket-add-link}">
+                <img src="images/basket.gif" border="0" alt="Add Link"/>
+              </a>
             </td>
-		  </xsl:if>
-		  <xsl:if test="basket-add-content">
+          </xsl:if>
+          <xsl:if test="basket-add-content">
             <td width="15">
-				<a href="{basket-add-content}">
-	  			    <img src="images/basket.gif" border="0" alt="Add Content"/>
-	  			</a>
+              <a href="{basket-add-content}">
+                <img src="images/basket.gif" border="0" alt="Add Content"/>
+              </a>
             </td>
-		  </xsl:if>
-		  <xsl:if test="edit-uri">
+          </xsl:if>
+          <xsl:if test="edit-uri">
             <td width="15">
-				<a href="{edit-uri}">
-	  			    <img src="images/edit.gif" border="0" alt="Edit"/>
-	  			</a>
+              <a href="{edit-uri}">
+                <img src="images/edit.gif" border="0" alt="Edit"/>
+              </a>
             </td>
-		  </xsl:if>
-		  <xsl:if test="help-uri">
+          </xsl:if>
+          <xsl:if test="help-uri">
             <td width="15">
-				<a href="{help-uri}">
-	  			    <img src="images/help.gif" border="0" alt="Help"/>
-	  			</a>
+              <a href="{help-uri}">
+                <img src="images/help.gif" border="0" alt="Help"/>
+              </a>
             </td>
-		  </xsl:if>
-		  <xsl:if test="view-uri">
+          </xsl:if>
+          <xsl:if test="view-uri">
             <td width="15">
-				<a href="{view-uri}">
-	  			    <img src="images/view.gif" border="0" alt="View"/>
-	  			</a>
+              <a href="{view-uri}">
+                <img src="images/view.gif" border="0" alt="View"/>
+              </a>
             </td>
-		  </xsl:if>
+          </xsl:if>
           <xsl:if test="edit-uri or view-uri or help-uri">
 			  <td width="15">&#160;</td>
           </xsl:if>
-		  <xsl:if test="fullscreen-uri and not(normal-uri)">
+          <xsl:if test="fullscreen-uri and not(normal-uri)">
             <td width="15">
-				<a href="{fullscreen-uri}">
-	  			    <img src="images/customize.gif" border="0" alt="Full Screen"/>
-	  			</a>
+              <a href="{fullscreen-uri}">
+                <img src="images/customize.gif" border="0" alt="Full Screen"/>
+              </a>
             </td>
-		  </xsl:if>
-		  <xsl:if test="maximize-uri">
+          </xsl:if>
+          <xsl:if test="maximize-uri">
             <td width="15">
-				<a href="maximize-uri">
-	  			    <img src="images/show.gif" border="0" alt="Max Page"/>
-	  			</a>
+              <a href="{maximize-uri}">
+                <img src="images/show.gif" border="0" alt="Max Page"/>
+              </a>
             </td>
-		  </xsl:if>
-		  <xsl:if test="normal-uri">
+          </xsl:if>
+          <xsl:if test="normal-uri">
             <td width="15">
-				<a href="{normal-uri}">
-	  			    <img src="images/maximize.gif" border="0" alt="Normal"/>
-	  			</a>
+              <a href="{normal-uri}">
+                <img src="images/maximize.gif" border="0" alt="Normal"/>
+              </a>
             </td>
-		  </xsl:if>
-		  <xsl:if test="minimize-uri">
+          </xsl:if>
+          <xsl:if test="minimize-uri">
             <td width="15">
-				<a href="{minimize-uri}">
-	  			    <img src="images/minimize.gif" border="0" alt="Minimize"/>
-	  			</a>
+              <a href="{minimize-uri}">
+                <img src="images/minimize.gif" border="0" alt="Minimize"/>
+              </a>
             </td>
-		  </xsl:if>
-		  <xsl:if test="remove-uri">
+          </xsl:if>
+          <xsl:if test="remove-uri">
             <td width="15">
-				<a href="{remove-uri}">
-	  			    <img src="images/delete.gif" border="0" alt="Delete"/>
-	  			</a>
+              <a href="{remove-uri}">
+                <img src="images/delete.gif" border="0" alt="Delete"/>
+              </a>
             </td>
-		  </xsl:if>
+          </xsl:if>
         </tr></tbody></table>
-       </td>
-       <td width="5" style="background-color:#294563;" valign="top">
-         <img src="images/window-top-right.gif" border="0" width="5" height="5" alt="top-right"/>
-       </td>
-       <td width="1"/>
-     </tr>
-     <tr>
-		<td width="5" style="background-image:url(images/window-border-left.gif);"><img
src="images/space.gif" border="0" width="5" height="5" alt="space"/></td>
-		<td colSpan="2">
-               <xsl:apply-templates select="content"/>
-		</td>
-		<td width="6" colSpan="2" style="background-image:url(images/window-border-right.gif);"><img
src="images/space.gif" border="0" width="5" height="5" alt="space"/></td>
-	</tr>
-	<tr>
-		<td width="5"><img src="images/window-bottom-left.gif" border="0" width="5" height="5"
alt="top-left"/></td>
-		<td colspan="2" style="background-image:url(images/window-border-bottom.gif);"></td>
-		<td width="5"><img src="images/window-bottom-right.gif" border="0" width="5" height="5"
alt="top-left"/></td>
-	</tr>
+      </td>
+      <td width="5" style="background-color:#294563;" valign="top">
+        <img src="images/window-top-right.gif" border="0" width="5" height="5" alt="top-right"/>
+      </td>
+      <td width="1"/>
+    </tr>
+    <tr>
+      <td width="5" style="background-image:url(images/window-border-left.gif);"><img
src="images/space.gif" border="0" width="5" height="5" alt="space"/></td>
+      <td colSpan="2">
+        <xsl:apply-templates select="content"/>
+      </td>
+      <td width="6" colSpan="2" style="background-image:url(images/window-border-right.gif);"><img
src="images/space.gif" border="0" width="5" height="5" alt="space"/></td>
+    </tr>
+    <tr>
+      <td width="5"><img src="images/window-bottom-left.gif" border="0" width="5"
height="5" alt="top-left"/></td>
+      <td colspan="2" style="background-image:url(images/window-border-bottom.gif);"></td>
+      <td width="5"><img src="images/window-bottom-right.gif" border="0" width="5"
height="5" alt="top-left"/></td>
+    </tr>
   </tbody></table>
 </xsl:template>
 

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/PortalService.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/PortalService.java?rev=331099&r1=331098&r2=331099&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/PortalService.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/PortalService.java Sun Nov  6
03:28:59 2005
@@ -19,8 +19,6 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.cocoon.portal.layout.Layout;
-
 /**
  * This is the central component in the portal. It holds the configuration
  * of the portal, the current name etc.
@@ -35,6 +33,12 @@
     /** The role to lookup this component. */
     String ROLE = PortalService.class.getName();
 
+    /** Configuration key for full screen enabled (default is true). */
+    String CONFIGURATION_FULL_SCREEN_ENABLED = "enable-full-screen";
+
+    /** Configuration key for maximized enabled (default is true). */
+    String CONFIGURATION_MAXIMIZED_ENABLED = "enable-maximized";
+
     /**
      * The name of the portal - as defined in the portal configuration.
      */
@@ -96,13 +100,6 @@
     PortalComponentManager getComponentManager();
 
     /**
-     * FIXME this is for the full-screen function
-     * @param layoutKey TODO
-     */
-    void setEntryLayout(String layoutKey, Layout object);
-    Layout getEntryLayout(String layoutKey);
-
-    /**
      * Change the default layout key for most functions
      */
     void setDefaultLayoutKey(String layoutKey);
@@ -122,4 +119,8 @@
      * @since 2.1.8
      */
     Map getObjectModel();
+
+    String getConfiguration(String key);
+    String getConfiguration(String key, String defaultValue);
+    boolean getConfigurationAsBoolean(String key, boolean defaultValue);
 }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/impl/InternalEventReceiver.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/impl/InternalEventReceiver.java?rev=331099&r1=331098&r2=331099&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/impl/InternalEventReceiver.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/impl/InternalEventReceiver.java
Sun Nov  6 03:28:59 2005
@@ -30,6 +30,7 @@
 import org.apache.cocoon.portal.event.coplet.CopletInstanceSizingEvent;
 import org.apache.cocoon.portal.event.layout.LayoutChangeParameterEvent;
 import org.apache.cocoon.portal.layout.Layout;
+import org.apache.cocoon.portal.layout.LayoutFeatures;
 import org.apache.cocoon.portal.layout.impl.CopletLayout;
 import org.apache.cocoon.portal.profile.ProfileManager;
 import org.apache.commons.jxpath.JXPathContext;
@@ -58,8 +59,14 @@
     public void inform(JXPathEvent event, PortalService service) {
         final Object target = event.getTarget();
         if ( target != null && event.getPath() != null && event.getValue()
!= null) {
-            final JXPathContext jxpathContext = JXPathContext.newContext(target);
-            jxpathContext.setValue(event.getPath(), event.getValue());
+            if ( target instanceof CopletInstanceData && event.getPath().equals("size")
) {
+                int newSize = new Integer(event.getValue().toString()).intValue();
+                CopletInstanceSizingEvent e = new CopletInstanceSizingEvent((CopletInstanceData)target,
newSize);
+                this.inform(e, service);
+            } else {
+                final JXPathContext jxpathContext = JXPathContext.newContext(target);
+                jxpathContext.setValue(event.getPath(), event.getValue());
+            }
         }
     }
 
@@ -68,16 +75,20 @@
      */
     public void inform(CopletInstanceSizingEvent event, PortalService service) {
         final CopletInstanceData cid = (CopletInstanceData)event.getTarget();
+        Layout rootLayout = service.getComponentManager().getProfileManager().getPortalLayout(null,
null);
         if ( cid != null ) {
+            final int oldSize = cid.getSize();
             cid.setSize(event.getSize());
             if ( event.getSize() == CopletInstanceData.SIZE_FULLSCREEN ) {
-                Layout rootLayout = service.getComponentManager().getProfileManager().getPortalLayout(null,
null);
                 CopletLayout layout = CopletInstanceDataFeatures.searchLayout(cid.getId(),
rootLayout);
-                service.setEntryLayout(null, layout);
+                LayoutFeatures.setRenderInfo(rootLayout, new LayoutFeatures.RenderInfo(layout));
+            }
+            if ( oldSize == CopletInstanceData.SIZE_FULLSCREEN ) {
+                LayoutFeatures.setRenderInfo(rootLayout, null);
             }
         } else {
             if ( event.getSize() == CopletInstanceData.SIZE_FULLSCREEN ) {
-                service.setEntryLayout(null, null);
+                LayoutFeatures.setRenderInfo(rootLayout, null);
             }
         }
     }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PageLabelManager.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PageLabelManager.java?rev=331099&r1=331098&r2=331099&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PageLabelManager.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PageLabelManager.java Sun
Nov  6 03:28:59 2005
@@ -38,7 +38,9 @@
 import org.apache.cocoon.portal.layout.CompositeLayout;
 import org.apache.cocoon.portal.layout.Item;
 import org.apache.cocoon.portal.layout.Layout;
+import org.apache.cocoon.portal.layout.LayoutFeatures;
 import org.apache.cocoon.portal.layout.NamedItem;
+import org.apache.cocoon.portal.layout.LayoutFeatures.RenderInfo;
 import org.apache.cocoon.util.HashMap;
 
 /**
@@ -226,10 +228,14 @@
     private Map initializeLabels(PortalService service) {
         Map map = new HashMap();
 
-        Layout portalLayout = service.getEntryLayout(null);
+        Layout rootLayout = service.getComponentManager().getProfileManager().getPortalLayout(null,
null);
+        final RenderInfo info = LayoutFeatures.getRenderInfo(rootLayout);
+        Layout portalLayout = null;
+        if ( info != null ) {
+            portalLayout = info.layout;
+        }
         if (portalLayout == null) {
-            portalLayout =
-                service.getComponentManager().getProfileManager().getPortalLayout(null, null);
+            portalLayout = rootLayout;
         }
 
         if (portalLayout instanceof CompositeLayout) {

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java?rev=331099&r1=331098&r2=331099&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PortalManagerImpl.java Sun
Nov  6 03:28:59 2005
@@ -42,6 +42,8 @@
 import org.apache.cocoon.portal.coplet.adapter.CopletAdapter;
 import org.apache.cocoon.portal.event.EventManager;
 import org.apache.cocoon.portal.layout.Layout;
+import org.apache.cocoon.portal.layout.LayoutFeatures;
+import org.apache.cocoon.portal.layout.LayoutFeatures.RenderInfo;
 import org.apache.cocoon.portal.layout.renderer.Renderer;
 import org.apache.cocoon.portal.profile.ProfileManager;
 import org.apache.cocoon.xml.AttributesImpl;
@@ -63,9 +65,6 @@
     protected ServiceSelector aspectSelector;
     protected ServiceSelector adapterSelector;
 
-    private boolean fullScreenNav;
-    public static final String FULLSCREEN = "fullScreenNav";
-
     /**
      * @see org.apache.avalon.framework.service.Serviceable#service(ServiceManager)
      */
@@ -128,7 +127,6 @@
                              conf.getChild("aspects"), 
                              this, 
                              new Parameters());
-        this.fullScreenNav = conf.getChild(FULLSCREEN, true).getValueAsBoolean(false);
     }
 
     /**
@@ -194,13 +192,13 @@
                 portalLayout = profileManager.getPortalLayout(null, layoutId);
             } else {
                 // first check for a full screen layout
-
-                if (!this.fullScreenNav) {
-                    // If fullscreen mode - otherwise TabContentAspect will deal with the
layout
-                    portalLayout = this.portalService.getEntryLayout(null);
+                Layout rootLayout = profileManager.getPortalLayout(null, layoutId);
+                final RenderInfo info = LayoutFeatures.getRenderInfo(rootLayout);
+                if ( info != null ) {
+                    portalLayout = info.layout;
                 }
                 if ( portalLayout == null ) {
-                    portalLayout = profileManager.getPortalLayout(null, null);
+                    portalLayout = rootLayout;
                 }
             }
             if ( portalLayout == null) {

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java?rev=331099&r1=331098&r2=331099&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java Sun
Nov  6 03:28:59 2005
@@ -42,7 +42,6 @@
 import org.apache.cocoon.environment.Session;
 import org.apache.cocoon.portal.PortalComponentManager;
 import org.apache.cocoon.portal.PortalService;
-import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.layout.SkinDescription;
 import org.apache.cocoon.servlet.CocoonServlet;
 import org.apache.excalibur.source.Source;
@@ -86,6 +85,9 @@
 
     final protected static String KEY = PortalServiceImpl.class.getName();
 
+    /** The portal configuration. */
+    protected Configuration config;
+
     /**
      * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
      */
@@ -289,30 +291,7 @@
         } finally {
             this.manager.release(resolver);
         }
-    }
-
-    /**
-     * @see org.apache.cocoon.portal.PortalService#setEntryLayout(java.lang.String, org.apache.cocoon.portal.layout.Layout)
-     */
-    public void setEntryLayout(String layoutKey, Layout object) {
-        if ( layoutKey == null ) {
-            layoutKey = this.getDefaultLayoutKey();
-        }
-        if ( object == null ) {
-            this.removeTemporaryAttribute("DEFAULT_LAYOUT:" + layoutKey);
-        } else {
-            this.setTemporaryAttribute("DEFAULT_LAYOUT:" + layoutKey, object);
-        }
-    }
-
-    /**
-     * @see org.apache.cocoon.portal.PortalService#getEntryLayout(java.lang.String)
-     */
-    public Layout getEntryLayout(String layoutKey) {
-        if ( layoutKey == null ) {
-            layoutKey = this.getDefaultLayoutKey();
-        }
-        return (Layout)this.getTemporaryAttribute("DEFAULT_LAYOUT:" + layoutKey);
+        this.config = portal.getChild("configuration");
     }
 
     /**
@@ -352,4 +331,24 @@
         return ContextHelper.getObjectModel(this.context);
     }
 
+    /**
+     * @see org.apache.cocoon.portal.PortalService#getConfiguration(java.lang.String, java.lang.String)
+     */
+    public String getConfiguration(String key, String defaultValue) {
+        return this.config.getChild(key).getValue(defaultValue);
+    }
+
+    /**
+     * @see org.apache.cocoon.portal.PortalService#getConfiguration(java.lang.String)
+     */
+    public String getConfiguration(String key) {
+        return this.getConfiguration(key, null);
+    }
+
+    /**
+     * @see org.apache.cocoon.portal.PortalService#getConfigurationAsBoolean(java.lang.String,
boolean)
+     */
+    public boolean getConfigurationAsBoolean(String key, boolean defaultValue) {
+        return this.config.getChild(key).getValueAsBoolean(defaultValue);
+    }
 }

Added: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutFeatures.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutFeatures.java?rev=331099&view=auto
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutFeatures.java (added)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutFeatures.java Sun
Nov  6 03:28:59 2005
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.cocoon.portal.layout;
+
+
+/**
+ * This class contains constants and utility methods for the standard features
+ * of a layout object.
+ *
+ * @version $Id$
+ */
+public class LayoutFeatures {
+
+    /** This is the name of the temporary layout attribute containing the information
+     * about full screen and maximized layouts. */
+    public static final String ATTRIBUTE_RENDERINFO = "render-info";
+
+    public static final class RenderInfo {
+        public final Layout layout;
+
+        public RenderInfo(Layout l) {
+            this.layout = l;
+        }
+    }
+
+    public static RenderInfo getRenderInfo(Layout layout) {
+        return (RenderInfo) layout.getTemporaryAttribute(ATTRIBUTE_RENDERINFO);
+    }
+
+    public static void setRenderInfo(Layout layout, RenderInfo info) {
+        if ( info == null ) {
+            layout.removeTemporaryAttribute(ATTRIBUTE_RENDERINFO);
+        } else {
+            layout.setTemporaryAttribute(ATTRIBUTE_RENDERINFO, info);            
+        }
+    }
+}

Propchange: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutFeatures.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/LayoutFeatures.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java?rev=331099&r1=331098&r2=331099&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
Sun Nov  6 03:28:59 2005
@@ -39,6 +39,8 @@
 import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.layout.LayoutException;
 import org.apache.cocoon.portal.layout.LayoutFactory;
+import org.apache.cocoon.portal.layout.LayoutFeatures;
+import org.apache.cocoon.portal.layout.LayoutFeatures.RenderInfo;
 import org.apache.cocoon.portal.profile.ProfileManager;
 import org.apache.cocoon.util.ClassUtils;
 
@@ -108,7 +110,7 @@
  */
 public class DefaultLayoutFactory
 	extends AbstractComponent
-    implements LayoutFactory, Configurable {
+    implements LayoutFactory, Configurable, Receiver {
 
     protected Map layouts = new HashMap();
 
@@ -264,11 +266,8 @@
     /**
      * @see Receiver
      */
-    public void inform(LayoutEvent event, PortalService service) {
-        Layout layout = (Layout)event.getTarget();
-        if ( event instanceof LayoutRemoveEvent ) {
-            this.remove( layout );
-        }
+    public void inform(LayoutRemoveEvent event, PortalService service) {
+        this.remove( (Layout)event.getTarget() );
     }
 
     /**
@@ -292,7 +291,9 @@
             ProfileManager profileManager = this.portalService.getComponentManager().getProfileManager();
             if ( layout instanceof CopletLayout ) {
                 // full screen?
-                if ( layout.equals(this.portalService.getEntryLayout(null)) ) {
+                final Layout rootLayout = profileManager.getPortalLayout(null, null);
+                final RenderInfo info = LayoutFeatures.getRenderInfo(rootLayout);
+                if ( info != null && layout.equals(info.layout) ) {
                     Event event = new CopletInstanceSizingEvent(null, CopletInstanceData.SIZE_FULLSCREEN);
                     EventManager em = this.portalService.getComponentManager().getEventManager();
                     em.send(event);

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/SizingAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/SizingAspect.java?rev=331099&r1=331098&r2=331099&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/SizingAspect.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/SizingAspect.java
Sun Nov  6 03:28:59 2005
@@ -22,6 +22,8 @@
 import org.apache.cocoon.portal.event.Event;
 import org.apache.cocoon.portal.event.coplet.CopletInstanceSizingEvent;
 import org.apache.cocoon.portal.layout.Layout;
+import org.apache.cocoon.portal.layout.LayoutFeatures;
+import org.apache.cocoon.portal.layout.LayoutFeatures.RenderInfo;
 import org.apache.cocoon.portal.layout.impl.CopletLayout;
 import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
 import org.apache.cocoon.xml.XMLUtils;
@@ -54,6 +56,12 @@
  */
 public class SizingAspect extends AbstractAspect {
 
+    /** Is full-screen enabled? */
+    protected boolean enableFullScreen;
+
+    /** Is maximized enabled? */
+    protected boolean enableMaximized;
+
 	/**
 	 * @see org.apache.cocoon.portal.layout.renderer.aspect.RendererAspect#toSAX(RendererAspectContext,
org.apache.cocoon.portal.layout.Layout, org.apache.cocoon.portal.PortalService, org.xml.sax.ContentHandler)
 	 */
@@ -82,20 +90,25 @@
                 event = new CopletInstanceSizingEvent(cid, CopletInstanceData.SIZE_NORMAL);
                 XMLUtils.createElement(handler, "normal-uri", service.getComponentManager().getLinkService().getLinkURI(event));
             }
-            if ( size != CopletInstanceData.SIZE_MAXIMIZED ) {
-                event = new CopletInstanceSizingEvent(cid, CopletInstanceData.SIZE_MAXIMIZED);
-                XMLUtils.createElement(handler, "maximize-uri", service.getComponentManager().getLinkService().getLinkURI(event));
+            if ( this.enableMaximized ) {
+                if ( size != CopletInstanceData.SIZE_MAXIMIZED ) {
+                    event = new CopletInstanceSizingEvent(cid, CopletInstanceData.SIZE_MAXIMIZED);
+                    XMLUtils.createElement(handler, "maximize-uri", service.getComponentManager().getLinkService().getLinkURI(event));
+                }
             }
 
-            boolean supportsFullScreen = CopletDataFeatures.supportsFullScreenMode(cid.getCopletData());
-            if ( supportsFullScreen ) {
-                final Layout fullScreenLayout = service.getEntryLayout(null);
-                if ( fullScreenLayout != null && fullScreenLayout.equals( layout
)) {
-                    event = new CopletInstanceSizingEvent( cid, CopletInstanceData.SIZE_NORMAL
);
-                    XMLUtils.createElement(handler, "normal-uri", service.getComponentManager().getLinkService().getLinkURI(event));
-                } else {
-                    event = new CopletInstanceSizingEvent( cid, CopletInstanceData.SIZE_FULLSCREEN
);
-                    XMLUtils.createElement(handler, "fullscreen-uri", service.getComponentManager().getLinkService().getLinkURI(event));
+            if ( this.enableFullScreen ) {
+                boolean supportsFullScreen = CopletDataFeatures.supportsFullScreenMode(cid.getCopletData());
+                if ( supportsFullScreen ) {
+                    final Layout rootLayout = service.getComponentManager().getProfileManager().getPortalLayout(null,
null);
+                    final RenderInfo info = LayoutFeatures.getRenderInfo(rootLayout);
+                    if ( info != null && info.layout.equals( layout )) {
+                        event = new CopletInstanceSizingEvent( cid, CopletInstanceData.SIZE_NORMAL
);
+                        XMLUtils.createElement(handler, "normal-uri", service.getComponentManager().getLinkService().getLinkURI(event));
+                    } else {
+                        event = new CopletInstanceSizingEvent( cid, CopletInstanceData.SIZE_FULLSCREEN
);
+                        XMLUtils.createElement(handler, "fullscreen-uri", service.getComponentManager().getLinkService().getLinkURI(event));
+                    }
                 }
             }
 
@@ -108,4 +121,15 @@
             context.invokeNext(layout, service, handler);
         }
 	}
+
+    /**
+     * @see org.apache.avalon.framework.activity.Initializable#initialize()
+     */
+    public void initialize() throws Exception {
+        super.initialize();
+        this.enableFullScreen = this.portalService.getConfigurationAsBoolean(PortalService.CONFIGURATION_FULL_SCREEN_ENABLED,
true);
+        this.enableMaximized = this.portalService.getConfigurationAsBoolean(PortalService.CONFIGURATION_MAXIMIZED_ENABLED,
true);
+    }
+
+
 }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.java?rev=331099&r1=331098&r2=331099&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.java
Sun Nov  6 03:28:59 2005
@@ -27,7 +27,9 @@
 import org.apache.cocoon.portal.layout.CompositeLayout;
 import org.apache.cocoon.portal.layout.Item;
 import org.apache.cocoon.portal.layout.Layout;
+import org.apache.cocoon.portal.layout.LayoutFeatures;
 import org.apache.cocoon.portal.layout.NamedItem;
+import org.apache.cocoon.portal.layout.LayoutFeatures.RenderInfo;
 import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
 import org.apache.cocoon.xml.AttributesImpl;
 import org.apache.cocoon.xml.XMLUtils;
@@ -194,11 +196,12 @@
                 }
             }
         }
-        Layout nextLayout = service.getEntryLayout(null);
-        if (nextLayout == null) {
-            nextLayout = tab.getLayout();
+        final Layout rootLayout = service.getComponentManager().getProfileManager().getPortalLayout(null,
null);
+        final RenderInfo info = LayoutFeatures.getRenderInfo(rootLayout);
+        if (info == null) {
+            return tab.getLayout();
         }
-        return nextLayout;
+        return info.layout;
     }
 
     /*

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/wsrp/adapter/WSRPAdapter.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/wsrp/adapter/WSRPAdapter.java?rev=331099&r1=331098&r2=331099&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/wsrp/adapter/WSRPAdapter.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/wsrp/adapter/WSRPAdapter.java
Sun Nov  6 03:28:59 2005
@@ -63,6 +63,8 @@
 import org.apache.cocoon.portal.event.Receiver;
 import org.apache.cocoon.portal.event.coplet.CopletInstanceSizingEvent;
 import org.apache.cocoon.portal.layout.Layout;
+import org.apache.cocoon.portal.layout.LayoutFeatures;
+import org.apache.cocoon.portal.layout.LayoutFeatures.RenderInfo;
 import org.apache.cocoon.portal.serialization.IncludingHTMLSerializer;
 import org.apache.cocoon.portal.util.HtmlSaxParser;
 import org.apache.cocoon.portal.wsrp.consumer.ConsumerEnvironmentImpl;
@@ -688,9 +690,10 @@
             if (windowState != null) {
                 if ( !windowState.equals(windowSession.getWindowState()) ) {
                     final Layout layout = (Layout)coplet.getTemporaryAttribute(ATTRIBUTE_NAME_LAYOUT);
-                    final Layout fullScreenLayout = service.getEntryLayout(null);
-                    if ( fullScreenLayout != null 
-                         && fullScreenLayout.equals( layout )
+                    final Layout rootLayout = service.getComponentManager().getProfileManager().getPortalLayout(null,
null);
+                    final RenderInfo info = LayoutFeatures.getRenderInfo(rootLayout);
+                    if ( info != null 
+                         && info.layout.equals( layout )
                          && !windowState.equals(WindowStates._maximized) ) {
                         Event e = new CopletInstanceSizingEvent( coplet, CopletInstanceData.SIZE_FULLSCREEN
);
                         service.getComponentManager().getEventManager().send(e);

Modified: cocoon/blocks/portal/trunk/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/status.xml?rev=331099&r1=331098&r2=331099&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/status.xml (original)
+++ cocoon/blocks/portal/trunk/status.xml Sun Nov  6 03:28:59 2005
@@ -66,6 +66,10 @@
  <changes>
   <release version="@version@" date="@date@">
     <action dev="CZ" type="add">
+      Portal Service provides access to global configuration settings which can be
+      used throughout the portal.
+    </action>
+    <action dev="CZ" type="add">
       Add AJAX support.
     </action>
     <action dev="CZ" type="add">



Mime
View raw message