cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r326220 - in /cocoon/blocks: portal-sample/trunk/samples/conf/ portal-sample/trunk/samples/coplets/gallery/ portal-sample/trunk/samples/coplets/news/ portal-sample/trunk/samples/coplets/news/styles/ portal/trunk/ portal/trunk/java/org/apach...
Date Tue, 18 Oct 2005 20:27:56 GMT
Author: cziegeler
Date: Tue Oct 18 13:27:09 2005
New Revision: 326220

URL: http://svn.apache.org/viewcvs?rev=326220&view=rev
Log:
Remove extra handling of full screen, it's just another size now

Added:
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/factories/
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/factories/CopletInstanceSizingEventFactory.java
  (with props)
Removed:
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/aspect/impl/FullScreenCopletEventAspect.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/impl/FullScreenCopletEvent.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/impl/FullScreenCopletEventFactory.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/FullScreenCopletAspect.java
Modified:
    cocoon/blocks/portal-sample/trunk/samples/conf/cocoon-portal-sample.xconf
    cocoon/blocks/portal-sample/trunk/samples/coplets/gallery/gallery.xsl
    cocoon/blocks/portal-sample/trunk/samples/coplets/gallery/sitemap.xmap
    cocoon/blocks/portal-sample/trunk/samples/coplets/news/sitemap.xmap
    cocoon/blocks/portal-sample/trunk/samples/coplets/news/styles/rss2html.xsl
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/acting/helpers/FullScreenMapping.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceDataFeatures.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/coplet/CopletInstanceSizingEvent.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/impl/DefaultEventConverter.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/impl/InternalEventReceiver.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/pluto/PortletURLProviderImpl.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/portal.roles
    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=326220&r1=326219&r2=326220&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 Tue Oct 18 13:27:09
2005
@@ -98,23 +98,21 @@
     <event-aspects>
         <!--  The client should not cache the page. -->
         <aspect type="no-client-caching"/>
-        <!-- Uncomment this aspect when marshalling JSR168 portlet events 
         <aspect type="convertable"/>
-        -->
         <!-- Use the action counter with great care. We recommend turning it off. -->
         <!-- Remove action-counter when using PageLabels -->
         <!-- aspect type="action-counter"/ -->
         <aspect type="frame"/>
         <aspect type="link"/>
-        <aspect type="full-screen-coplet"/>
   <!-- Uncomment the following when using PageLabels
         <aspect type="page-label"/>
         -->
         <!-- Comment the following out if you don't need WSRP: -->
         <aspect type="wsrp"/>
         <aspect type="request-parameter">
+          <parameter name="parameter-name" value="sizing"/>
           <!-- Uncomment the following when marshalling JSR168 portlet events
-          <parameter name="parameter-name" value="cocoon-portal-event,url"/>
+          <parameter name="parameter-name" value="cocoon-portal-event,url,sizing"/>
           -->
         </aspect>
     </event-aspects>
@@ -135,6 +133,9 @@
       | To enable PageLabels uncomment the following definition:
   <portal-event-converter class="org.apache.cocoon.portal.event.impl.PageLabelEventConverter"/>
       +-->
+  <portal-event-converter>
+    <parameter name="marshall-events" value="true"/>
+  </portal-event-converter>
 
   <page-label-manager>
     <!-- Uncomment to marshall JSR-168 portlet events
@@ -244,7 +245,6 @@
           <parameter name="root-tag" value="false"/>
         </aspect>
         <aspect type="coplet-removing"/>
-        <aspect type="coplet-full-screen"/>
         <aspect type="coplet-sizing"/>
         <aspect type="history"/>
         <aspect type="basket"/>
@@ -264,7 +264,6 @@
           <parameter name="root-tag" value="false"/>
         </aspect>
         <aspect type="coplet-removing"/>
-        <aspect type="coplet-full-screen"/>
         <aspect type="coplet-sizing"/>
         <aspect type="history"/>
         <aspect type="basket"/>
@@ -429,12 +428,6 @@
       <coplet name="standard"
               class="org.apache.cocoon.portal.coplet.CopletData">
         <coplet-instance-data-aspects>
-           <!-- Choose from tempory, request and session aspect store: -->
-           <aspect name="fullScreen"
-                   class="java.lang.Boolean"
-                   store="temporary"
-                   auto-create="true"
-                   value="false"/>
         </coplet-instance-data-aspects>
       </coplet>
     </coplets>

Modified: cocoon/blocks/portal-sample/trunk/samples/coplets/gallery/gallery.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/gallery/gallery.xsl?rev=326220&r1=326219&r2=326220&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/gallery/gallery.xsl (original)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/gallery/gallery.xsl Tue Oct 18 13:27:09
2005
@@ -24,13 +24,13 @@
 <!-- The current picture (index) to display -->
 <xsl:param name="pic"/>
 <!-- Is this full screen? -->
-<xsl:param name="fullscreen"/>
+<xsl:param name="size"/>
 
 <xsl:template match="pictures" xmlns:cl="http://apache.org/cocoon/portal/coplet/1.0">
   <xsl:variable name="maxp" select="count(picture)"/>
 
   <xsl:choose>
-    <xsl:when test="$fullscreen='true'">
+    <xsl:when test="$size='3'">
       <!-- This is the two column version: 
       <table><tbody>
         <xsl:for-each select="picture">

Modified: cocoon/blocks/portal-sample/trunk/samples/coplets/gallery/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/gallery/sitemap.xmap?rev=326220&r1=326219&r2=326220&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/gallery/sitemap.xmap (original)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/gallery/sitemap.xmap Tue Oct 18 13:27:09
2005
@@ -38,7 +38,7 @@
         </map:transform>
         <map:transform type="xslt" src="gallery.xsl">
             <map:parameter name="pic" value="{coplet:attributes/picture}"/>
-            <map:parameter name="fullscreen" value="{coplet:aspectDatas/fullScreen}"/>
+            <map:parameter name="size" value="{coplet:size}"/>
         </map:transform>
         <!-- This must be commented out if CachingURICopletAdapter is used in profiles/copletdata
              due to links that needs to be cached untranslated.

Modified: cocoon/blocks/portal-sample/trunk/samples/coplets/news/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/news/sitemap.xmap?rev=326220&r1=326219&r2=326220&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/news/sitemap.xmap (original)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/news/sitemap.xmap Tue Oct 18 13:27:09
2005
@@ -23,7 +23,7 @@
         <map:match pattern="live.rss">
             <map:generate type="file" src="{request-param:feed}" label="content" />
             <map:transform type="xslt" src="styles/rss2html.xsl">
-                <map:parameter name="fullscreen" value="{coplet:aspectDatas/fullScreen}"/>

+                <map:parameter name="size" value="{coplet:size}"/> 
             </map:transform>
             <map:serialize type="xml"/>
         </map:match>
@@ -34,7 +34,7 @@
             <map:transform type="rss"/>
        
             <map:transform type="xslt" src="styles/rss2html.xsl">
-                <map:parameter name="fullscreen" value="{coplet:aspectDatas/fullScreen}"/>

+                <map:parameter name="size" value="{coplet:size}"/> 
             </map:transform>
             <map:serialize type="xml"/>
         </map:match>
@@ -42,7 +42,7 @@
         <map:match pattern="*.rss">
             <map:generate type="file" src="offline/{1}.xml" label="content" />
             <map:transform type="xslt" src="styles/rss2html.xsl">
-                 <map:parameter name="fullscreen" value="{coplet:aspectDatas/fullScreen}"/>

+                 <map:parameter name="size" value="{coplet:size}"/> 
             </map:transform>
             <map:serialize type="xml"/>
         </map:match>
@@ -50,7 +50,7 @@
         <map:match pattern="*.weblog-rss">
             <map:generate type="file" src="offline/{1}.xml" label="content" />
             <map:transform type="xslt" src="styles/rss2html.xsl">
-                 <map:parameter name="fullscreen" value="{coplet:aspectDatas/fullScreen}"/>

+                 <map:parameter name="size" value="{coplet:size}"/> 
             </map:transform>
             <map:serialize type="xml"/>
         </map:match>

Modified: cocoon/blocks/portal-sample/trunk/samples/coplets/news/styles/rss2html.xsl
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal-sample/trunk/samples/coplets/news/styles/rss2html.xsl?rev=326220&r1=326219&r2=326220&view=diff
==============================================================================
--- cocoon/blocks/portal-sample/trunk/samples/coplets/news/styles/rss2html.xsl (original)
+++ cocoon/blocks/portal-sample/trunk/samples/coplets/news/styles/rss2html.xsl Tue Oct 18
13:27:09 2005
@@ -20,7 +20,7 @@
 <!-- $Id$ 
 
 -->
-<xsl:param name="fullscreen"/>
+<xsl:param name="size"/>
 
 <xsl:template match="rss">
   <xsl:apply-templates select="channel"/>
@@ -41,7 +41,7 @@
 
 <xsl:template match="item">
   <!-- Display the first 5 entries -->
-  <xsl:if test="$fullscreen='true' or position() &lt; 6">
+  <xsl:if test="$size='3' or position() &lt; 6">
     <tr>
       <td>
         <a target="_blank" href="{link}">

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/acting/helpers/FullScreenMapping.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/acting/helpers/FullScreenMapping.java?rev=326220&r1=326219&r2=326220&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/acting/helpers/FullScreenMapping.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/acting/helpers/FullScreenMapping.java
Tue Oct 18 13:27:09 2005
@@ -18,8 +18,7 @@
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
 import org.apache.cocoon.portal.event.Event;
-import org.apache.cocoon.portal.event.impl.FullScreenCopletEvent;
-import org.apache.cocoon.portal.layout.Layout;
+import org.apache.cocoon.portal.event.coplet.CopletInstanceSizingEvent;
 import org.apache.cocoon.portal.profile.ProfileManager;
 
 /**
@@ -38,9 +37,9 @@
     public Event getEvent(PortalService service, Object data) {
         final ProfileManager manager = service.getComponentManager().getProfileManager();
         final CopletInstanceData cid = manager.getCopletInstanceData(this.copletId);
-        final Layout layout = manager.getPortalLayout(null, layoutId) ;
+        //final Layout layout = manager.getPortalLayout(null, layoutId) ;
         
-        Event e = new FullScreenCopletEvent(cid, layout);
+        Event e = new CopletInstanceSizingEvent(cid, CopletInstanceData.SIZE_FULLSCREEN);
         return e;
     }
 }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceDataFeatures.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceDataFeatures.java?rev=326220&r1=326219&r2=326220&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceDataFeatures.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceDataFeatures.java
Tue Oct 18 13:27:09 2005
@@ -15,9 +15,15 @@
  */
 package org.apache.cocoon.portal.coplet;
 
+import java.util.Iterator;
+
 import org.apache.cocoon.portal.event.CopletInstanceEvent;
 import org.apache.cocoon.portal.event.coplet.CopletInstanceSizingEvent;
 import org.apache.cocoon.portal.event.impl.CopletJXPathEvent;
+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.impl.CopletLayout;
 
 /**
  * This class contains constants and utility methods for the standard features
@@ -41,4 +47,26 @@
         }
         return false;
     }
+
+    /**
+     * Search for a layout containing the coplet instance data.
+     */
+    public static CopletLayout searchLayout(CopletInstanceData cid, Layout rootLayout) {
+        if ( rootLayout instanceof CopletLayout ) {
+            if ( ((CopletLayout)rootLayout).getCopletInstanceData().equals(cid) ) {
+                return (CopletLayout) rootLayout;
+            }
+        } else if ( rootLayout instanceof CompositeLayout ) {
+            CompositeLayout cl = (CompositeLayout)rootLayout;
+            Iterator i = cl.getItems().iterator();
+            while ( i.hasNext() ) {
+                final Item current = (Item)i.next();
+                CopletLayout result = searchLayout(cid, current.getLayout());
+                if ( result != null ) {
+                    return result;
+                }
+            }
+        }
+        return null;
+     }
 }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/coplet/CopletInstanceSizingEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/coplet/CopletInstanceSizingEvent.java?rev=326220&r1=326219&r2=326220&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/coplet/CopletInstanceSizingEvent.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/coplet/CopletInstanceSizingEvent.java
Tue Oct 18 13:27:09 2005
@@ -15,7 +15,6 @@
  */
 package org.apache.cocoon.portal.event.coplet;
 
-import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
 import org.apache.cocoon.portal.coplet.CopletInstanceDataFeatures;
 import org.apache.cocoon.portal.event.ActionEvent;
@@ -31,7 +30,7 @@
  */
 public class CopletInstanceSizingEvent
     extends AbstractActionEvent
-    implements CopletInstanceEvent, ComparableEvent {//, ConvertableEvent {
+    implements CopletInstanceEvent, ComparableEvent, ConvertableEvent {
 
     protected final int size;
 
@@ -72,23 +71,6 @@
      * @see org.apache.cocoon.portal.event.ConvertableEvent#getRequestParameterName()
      */
     public String getRequestParameterName() {
-        return "cocoon-portal-size";
+        return "sizing";
     }
-
-    /**
-     * Create an instance of the event
-     * @param service The PortalService
-     * @param eventData The marshalled data for this event.
-     */
-    public CopletInstanceSizingEvent(PortalService service, String eventData) {
-        super(null);
-        final int pos = eventData.indexOf(':');
-        if ( pos == -1 ) {
-            throw new IllegalArgumentException("Corrupt event data: " + eventData);
-        }
-        final String cid = eventData.substring(0, pos);
-        this.size = new Integer(eventData.substring(pos+1)).intValue();
-        this.target = service.getComponentManager().getProfileManager().getCopletInstanceData(cid);
-    }
-
 }

Added: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/factories/CopletInstanceSizingEventFactory.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/factories/CopletInstanceSizingEventFactory.java?rev=326220&view=auto
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/factories/CopletInstanceSizingEventFactory.java
(added)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/factories/CopletInstanceSizingEventFactory.java
Tue Oct 18 13:27:09 2005
@@ -0,0 +1,43 @@
+/*
+ * 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.event.factories;
+
+import org.apache.avalon.framework.thread.ThreadSafe;
+import org.apache.cocoon.portal.PortalService;
+import org.apache.cocoon.portal.coplet.CopletInstanceData;
+import org.apache.cocoon.portal.event.ConvertableEvent;
+import org.apache.cocoon.portal.event.ConvertableEventFactory;
+import org.apache.cocoon.portal.event.coplet.CopletInstanceSizingEvent;
+
+/**
+ * This event is fired for resizing a coplet.
+ *
+ * @version $Id$
+ */
+public class CopletInstanceSizingEventFactory
+    implements ThreadSafe, ConvertableEventFactory {
+
+    public ConvertableEvent createEvent(PortalService service, String eventData) {
+        final int pos = eventData.indexOf(':');
+        if ( pos == -1 ) {
+            throw new IllegalArgumentException("Corrupt event data: " + eventData);
+        }
+        final String cid = eventData.substring(0, pos);
+        int size = new Integer(eventData.substring(pos+1)).intValue();
+        CopletInstanceData target = service.getComponentManager().getProfileManager().getCopletInstanceData(cid);
+        return new CopletInstanceSizingEvent(target, size);
+    }
+}

Propchange: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/factories/CopletInstanceSizingEventFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/factories/CopletInstanceSizingEventFactory.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/impl/DefaultEventConverter.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/impl/DefaultEventConverter.java?rev=326220&r1=326219&r2=326220&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/impl/DefaultEventConverter.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/impl/DefaultEventConverter.java
Tue Oct 18 13:27:09 2005
@@ -19,6 +19,9 @@
 import java.util.List;
 
 import org.apache.avalon.framework.logger.AbstractLogEnabled;
+import org.apache.avalon.framework.parameters.ParameterException;
+import org.apache.avalon.framework.parameters.Parameterizable;
+import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.avalon.framework.service.Serviceable;
@@ -34,13 +37,15 @@
  */
 public class DefaultEventConverter
     extends AbstractLogEnabled
-    implements EventConverter, Serviceable, ThreadSafe {
+    implements EventConverter, Serviceable, Parameterizable, ThreadSafe {
 
     protected static final String DECODE_LIST = DefaultEventConverter.class.getName() + "D";
     protected static final String ENCODE_LIST = DefaultEventConverter.class.getName() + "E";
 
     protected ServiceManager manager;
 
+    protected boolean isMarshallingEvents = false;
+
     /**
      * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
      */
@@ -49,6 +54,13 @@
     }
 
     /**
+     * @see org.apache.avalon.framework.parameters.Parameterizable#parameterize(org.apache.avalon.framework.parameters.Parameters)
+     */
+    public void parameterize(Parameters params) throws ParameterException {
+        this.isMarshallingEvents = params.getParameterAsBoolean("marshall-events", this.isMarshallingEvents);
+    }
+
+    /**
      * @see org.apache.cocoon.portal.event.EventConverter#encode(org.apache.cocoon.portal.event.Event)
      */
     public String encode(Event event) {
@@ -135,6 +147,6 @@
      * @see org.apache.cocoon.portal.event.EventConverter#isMarshallEvents()
      */
     public boolean isMarshallEvents() {
-        return false;
+        return this.isMarshallingEvents;
     }
 }

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=326220&r1=326219&r2=326220&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
Tue Oct 18 13:27:09 2005
@@ -22,11 +22,14 @@
 import org.apache.cocoon.portal.aspect.Aspectalizable;
 import org.apache.cocoon.portal.coplet.CopletData;
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
+import org.apache.cocoon.portal.coplet.CopletInstanceDataFeatures;
 import org.apache.cocoon.portal.event.CopletDataEvent;
 import org.apache.cocoon.portal.event.Event;
 import org.apache.cocoon.portal.event.EventManager;
 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.impl.CopletLayout;
 import org.apache.cocoon.portal.profile.ProfileManager;
 import org.apache.commons.jxpath.JXPathContext;
 
@@ -65,7 +68,18 @@
      */
     public void inform(CopletInstanceSizingEvent event, PortalService service) {
         final CopletInstanceData cid = (CopletInstanceData)event.getTarget();
-        cid.setSize(event.getSize());
+        if ( cid != null ) {
+            cid.setSize(event.getSize());
+            if ( event.getSize() == CopletInstanceData.SIZE_FULLSCREEN ) {
+                Layout rootLayout = service.getComponentManager().getProfileManager().getPortalLayout(null,
null);
+                CopletLayout layout = CopletInstanceDataFeatures.searchLayout(cid, rootLayout);
+                service.setEntryLayout(null, layout);
+            }
+        } else {
+            if ( event.getSize() == CopletInstanceData.SIZE_FULLSCREEN ) {
+                service.setEntryLayout(null, null);
+            }
+        }
     }
 
     /**

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=326220&r1=326219&r2=326220&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
Tue Oct 18 13:27:09 2005
@@ -41,11 +41,12 @@
 import org.apache.cocoon.portal.aspect.impl.DefaultAspectDataHandler;
 import org.apache.cocoon.portal.aspect.impl.DefaultAspectDescription;
 import org.apache.cocoon.portal.coplet.CopletFactory;
+import org.apache.cocoon.portal.coplet.CopletInstanceData;
 import org.apache.cocoon.portal.event.Event;
 import org.apache.cocoon.portal.event.EventManager;
 import org.apache.cocoon.portal.event.LayoutEvent;
 import org.apache.cocoon.portal.event.Receiver;
-import org.apache.cocoon.portal.event.impl.FullScreenCopletEvent;
+import org.apache.cocoon.portal.event.coplet.CopletInstanceSizingEvent;
 import org.apache.cocoon.portal.layout.CompositeLayout;
 import org.apache.cocoon.portal.layout.Item;
 import org.apache.cocoon.portal.layout.Layout;
@@ -417,7 +418,7 @@
                 if ( layout instanceof CopletLayout ) {
                     // full screen?
                     if ( layout.equals(service.getEntryLayout(null)) ) {
-                        Event event = new FullScreenCopletEvent(((CopletLayout)layout).getCopletInstanceData(),
null);
+                        Event event = new CopletInstanceSizingEvent(null, CopletInstanceData.SIZE_FULLSCREEN);
                         eventManager = (EventManager)this.manager.lookup(EventManager.ROLE);
                         eventManager.send(event);
                         service.getComponentManager().getLinkService().addEventToLink(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=326220&r1=326219&r2=326220&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
Tue Oct 18 13:27:09 2005
@@ -85,6 +85,17 @@
             if (size == CopletInstanceData.SIZE_MINIMIZED) {
                 showContent = false;
             }
+            boolean supportsFullScreen = CopletDataFeatures.supportsFullScreenMode(cid.getCopletData());
+            if ( supportsFullScreen ) {
+                final Layout fullScreenLayout = service.getEntryLayout(null);
+                if ( fullScreenLayout != null && fullScreenLayout.equals( layout
)) {
+                    Event event = new CopletInstanceSizingEvent( cid, CopletInstanceData.SIZE_NORMAL
);
+                    XMLUtils.createElement(handler, "maximize-uri", service.getComponentManager().getLinkService().getLinkURI(event));
+                } else {
+                    Event event = new CopletInstanceSizingEvent( cid, CopletInstanceData.SIZE_FULLSCREEN
);
+                    XMLUtils.createElement(handler, "fullscreen-uri", service.getComponentManager().getLinkService().getLinkURI(event));
+                }
+            }
         } 
 /*        boolean maxPageable = ((Boolean)cid.getCopletData().getAspectData("maxpageable")).booleanValue();
         if ( maxPageable ) {

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java?rev=326220&r1=326219&r2=326220&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java
Tue Oct 18 13:27:09 2005
@@ -34,7 +34,7 @@
 import org.apache.cocoon.portal.event.CopletInstanceEvent;
 import org.apache.cocoon.portal.event.Event;
 import org.apache.cocoon.portal.event.ConvertableEvent;
-import org.apache.cocoon.portal.event.impl.FullScreenCopletEvent;
+import org.apache.cocoon.portal.event.coplet.CopletInstanceSizingEvent;
 import org.apache.cocoon.portal.layout.impl.CopletLayout;
 import org.apache.cocoon.portal.pluto.om.PortletEntityImpl;
 import org.apache.cocoon.portal.pluto.om.PortletWindowImpl;
@@ -233,10 +233,10 @@
                 }
                 if ( this.state != null && !this.state.equals(oldState) ) {
                     if ( oldState.equals(WindowState.MAXIMIZED) ) {
-                        sizingEvent = new FullScreenCopletEvent( cid, null );           
        
+                        sizingEvent = new CopletInstanceSizingEvent( null, CopletInstanceData.SIZE_FULLSCREEN
);                    
                     } else {
                         if ( this.state.equals(WindowState.MAXIMIZED) ) {
-                            sizingEvent = new FullScreenCopletEvent( cid, cl );         
                                  
+                            sizingEvent = new CopletInstanceSizingEvent( cid, CopletInstanceData.SIZE_FULLSCREEN
);                                            
                         }
                     }
                 }

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/portal.roles
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/portal.roles?rev=326220&r1=326219&r2=326220&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/portal.roles (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/portal.roles Tue Oct 18 13:27:09
2005
@@ -42,8 +42,6 @@
     <role name="org.apache.cocoon.portal.event.aspect.EventAspect/convertable"
           default-class="org.apache.cocoon.portal.event.aspect.impl.ConvertableEventAspect"/>
 
-    <role name="org.apache.cocoon.portal.event.aspect.EventAspect/full-screen-coplet"
-          default-class="org.apache.cocoon.portal.event.aspect.impl.FullScreenCopletEventAspect"/>
 
     <!--+
         | This aspect sets headers on the response telling the client to not cache
@@ -92,12 +90,6 @@
           default-class="org.apache.cocoon.portal.layout.renderer.aspect.impl.RemovableAspect"/>
 
     <!--+
-        | This aspect can be used to render a full-screen button-
-        +-->
-    <role name="org.apache.cocoon.portal.layout.renderer.aspect.RendererAspect/coplet-full-screen"
-          default-class="org.apache.cocoon.portal.layout.renderer.aspect.impl.FullScreenCopletAspect"/>
-
-    <!--+
         | This aspect can be used to render cinclude statements that will be used to include
         | the coplet content, use the coplet aspect below to directly stream the content.
         +-->
@@ -161,12 +153,11 @@
     <role name="org.apache.cocoon.portal.event.ConvertableEventFactorySelector"
           default-class="org.apache.cocoon.core.container.DefaultServiceSelector"/>
 
-    <role name="org.apache.cocoon.portal.event.ConvertableEventFactory/cocoon-portal-fs"
-          default-class="org.apache.cocoon.portal.event.impl.FullScreenCopletEventFactory"/>
-
     <role name="org.apache.cocoon.portal.event.ConvertableEventFactory/url"
           default-class="org.apache.cocoon.portal.pluto.PortletURLProviderFactory"/>
 
+    <role name="org.apache.cocoon.portal.event.ConvertableEventFactory/sizing"
+          default-class="org.apache.cocoon.portal.event.factories.CopletInstanceSizingEventFactory"/>
 
   <!--+
       | Components.

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=326220&r1=326219&r2=326220&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
Tue Oct 18 13:27:09 2005
@@ -62,7 +62,6 @@
 import org.apache.cocoon.portal.event.EventManager;
 import org.apache.cocoon.portal.event.Receiver;
 import org.apache.cocoon.portal.event.coplet.CopletInstanceSizingEvent;
-import org.apache.cocoon.portal.event.impl.FullScreenCopletEvent;
 import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.serialization.IncludingHTMLSerializer;
 import org.apache.cocoon.portal.util.HtmlSaxParser;
@@ -693,7 +692,7 @@
                     if ( fullScreenLayout != null 
                          && fullScreenLayout.equals( layout )
                          && !windowState.equals(WindowStates._maximized) ) {
-                        FullScreenCopletEvent e = new FullScreenCopletEvent( coplet, null
);
+                        Event e = new CopletInstanceSizingEvent( coplet, CopletInstanceData.SIZE_FULLSCREEN
);
                         service.getComponentManager().getEventManager().send(e);
                     }
                     if ( windowState.equals(WindowStates._minimized) ) {
@@ -705,7 +704,7 @@
                         service.getComponentManager().getEventManager().send(e);
                     }
                     if ( windowState.equals(WindowStates._maximized) ) {
-                        FullScreenCopletEvent e = new FullScreenCopletEvent( coplet, layout
);
+                        Event e = new CopletInstanceSizingEvent( coplet, CopletInstanceData.SIZE_FULLSCREEN
);
                         service.getComponentManager().getEventManager().send(e);
                     }
                     windowSession.setWindowState(windowState);

Modified: cocoon/blocks/portal/trunk/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/status.xml?rev=326220&r1=326219&r2=326220&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/status.xml (original)
+++ cocoon/blocks/portal/trunk/status.xml Tue Oct 18 13:27:09 2005
@@ -66,7 +66,9 @@
  <changes>
   <release version="@version@" date="@date@">
     <action dev="CZ">
-      Portal block: Add coplet size to coplet instance data.
+      Portal block: Add coplet size to coplet instance data. The size can be minimized,
+                    normal or full-screen. This removed the need for a special full screen
+                    handling.
     </action>
     <action dev="CZ" type="add">
       Portal block: Remove aspect datas from coplet datas. Attributes are now used instead.



Mime
View raw message