cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r326208 - in /cocoon: blocks/portal-sample/trunk/samples/conf/ blocks/portal/trunk/ blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/ blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/impl/ blocks/portal/trunk/java/or...
Date Tue, 18 Oct 2005 19:04:51 GMT
Author: cziegeler
Date: Tue Oct 18 12:04:01 2005
New Revision: 326208

URL: http://svn.apache.org/viewcvs?rev=326208&view=rev
Log:
Start refactoring of coplet sizing
Split up status file

Added:
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceDataFeatures.java
  (with props)
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/coplet/CopletInstanceSizingEvent.java
  (with props)
    cocoon/blocks/portal/trunk/status.xml   (with props)
Removed:
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/status/SizingStatus.java
Modified:
    cocoon/blocks/portal-sample/trunk/samples/conf/cocoon-portal-sample.xconf
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletBaseData.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletData.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/copletinstancedata.xml
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/impl/InternalEventReceiver.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/wsrp/adapter/WSRPAdapter.java
    cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/wsrp/adapter/WSRPPortletWindowAspect.java
    cocoon/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=326208&r1=326207&r2=326208&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 12:04:01
2005
@@ -430,11 +430,6 @@
               class="org.apache.cocoon.portal.coplet.CopletData">
         <coplet-instance-data-aspects>
            <!-- Choose from tempory, request and session aspect store: -->
-           <aspect name="size"
-                   class="java.lang.Integer"
-                   store="session"
-                   auto-create="true"
-                   value="1"/>
            <aspect name="fullScreen"
                    class="java.lang.Boolean"
                    store="temporary"

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletBaseData.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletBaseData.java?rev=326208&r1=326207&r2=326208&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletBaseData.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletBaseData.java Tue
Oct 18 12:04:01 2005
@@ -19,6 +19,10 @@
 import java.util.Map;
 
 /**
+ * A coplet base data defines a coplet type, like a pipeline based coplet,
+ * a JSR 168 portlet or a WSRP portlet. For each type exists a coplet base
+ * data with some configuration.
+ * Based on the coplet base data, coplets are created ({@link CopletData}.
  *
  * @version $Id$
  */

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletData.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletData.java?rev=326208&r1=326207&r2=326208&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletData.java (original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletData.java Tue Oct
18 12:04:01 2005
@@ -27,6 +27,9 @@
 import org.apache.commons.lang.StringUtils;
 
 /**
+ * A coplet data describes an available coplet. A coplet data can be seen
+ * as a class. A user can create one or more instances of the coplet
+ * ({@link CopletInstanceData}s).
  *
  * @version $Id$
  */

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java?rev=326208&r1=326207&r2=326208&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceData.java
Tue Oct 18 12:04:01 2005
@@ -29,25 +29,48 @@
 
 
 /**
+ * A coplet instance data describes an instance of a coplet.
+ *
+ * Sizing:
+ *   A coplet can have different sizes:
+ *   SIZE_NORMAL - this is the normal size, it means that the coplet shares it's
+ *                 space with other coplets.
+ *   SIZE_MINIMIZED - the coplet is minimized. Usually in this state only the
+ *                    title of the coplet is rendered.
+ *   SIZE_FULLSCREEN - the coplet is the only coplet on the screen.
+ *   SIZE_MAXPAGE - the coplet gets the most available space, but still shares
+ *                  its space with other coplets, e.g. a navigation etc.
+ *
+ * TODO - Remove dependency to pluto
  *
  * @version $Id$
  */
 public final class CopletInstanceData 
     extends AbstractProducible {
 
+    public final static int SIZE_MINIMIZED  = 0;
+    public final static int SIZE_NORMAL     = 1;
+    public final static int SIZE_MAXPAGED   = 2;
+    public final static int SIZE_FULLSCREEN = 3;
+
 	protected CopletData copletData;
 
+    /** Persistet attributes. */
     protected Map attributes = new HashMap();
 
-    /** Temporary attributes are not persisted */
+    /** Temporary attributes are not persisted. */
     protected Map temporaryAttributes = new HashMap();
 
-    /** Portlet preferences */
+    /** Portlet preferences. */
     protected PreferenceSetImpl preferences = new PreferenceSetImpl();
 
-    private String title;
+    /** The title of the coplet. */
+    protected String title;
 
-	/**
+    /** The size of the coplet. */
+    protected int size = SIZE_NORMAL;
+
+    /**
 	 * Constructor
 	 */
 	public CopletInstanceData() {
@@ -172,5 +195,22 @@
             // ignore
             return null;
         }
+    }
+
+    /**
+     * Return the actual size of this coplet.
+     */
+    public int getSize() {
+        return size;
+    }
+
+    /**
+     * Set the size of this coplet.
+     */
+    public void setSize(int size) {
+        if ( size < SIZE_MINIMIZED || size > SIZE_FULLSCREEN ) {
+            throw new IllegalArgumentException("Unknown size for coplet: " + size);
+        }
+        this.size = size;
     }
 }

Added: 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=326208&view=auto
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceDataFeatures.java
(added)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/CopletInstanceDataFeatures.java
Tue Oct 18 12:04:01 2005
@@ -0,0 +1,44 @@
+/*
+ * 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.coplet;
+
+import org.apache.cocoon.portal.event.CopletInstanceEvent;
+import org.apache.cocoon.portal.event.coplet.CopletInstanceSizingEvent;
+import org.apache.cocoon.portal.event.impl.CopletJXPathEvent;
+
+/**
+ * This class contains constants and utility methods for the standard features
+ * of a coplet instance.
+ *
+ * @version $Id$
+ */
+public final class CopletInstanceDataFeatures {
+
+    /**
+     * Tests if this is a sizing event for a coplet instance.
+     */
+    public static boolean isSizingEvent(CopletInstanceEvent cie) {
+        if ( cie instanceof CopletInstanceSizingEvent ) {
+            return true;
+        }
+        if ( cie instanceof CopletJXPathEvent ) {
+            if ( "size".equals(((CopletJXPathEvent)cie).getPath()) ) {
+                return true;
+            }
+        }
+        return false;
+    }
+}

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

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

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java?rev=326208&r1=326207&r2=326208&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
Tue Oct 18 12:04:01 2005
@@ -30,8 +30,8 @@
 import org.apache.cocoon.components.sax.XMLByteStreamInterpreter;
 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.CopletInstanceEvent;
-import org.apache.cocoon.portal.event.impl.ChangeCopletInstanceAspectDataEvent;
 import org.apache.cocoon.util.NetUtils;
 import org.apache.excalibur.source.SourceValidity;
 import org.xml.sax.ContentHandler;
@@ -191,7 +191,7 @@
         // do we ignore SizingEvents
         boolean ignoreSizing = ((Boolean)this.getConfiguration(coplet, CONFIGURATION_IGNORE_SIZING_EVENTS,
Boolean.TRUE)).booleanValue();
 
-        if ( !ignoreSizing || !isSizingEvent(event)) {
+        if ( !ignoreSizing || !CopletInstanceDataFeatures.isSizingEvent(event)) {
             // do we cache globally?
             boolean cacheGlobal = ((Boolean)this.getConfiguration(coplet, CONFIGURATION_CACHE_GLOBAL,
Boolean.FALSE)).booleanValue();
             if ( cacheGlobal ) {
@@ -202,18 +202,6 @@
                 coplet.removeTemporaryAttribute(CACHE);
             }
         }
-    }
-
-    /**
-     * Tests if the event is a sizing event for the coplet.
-     */
-    protected boolean isSizingEvent(CopletInstanceEvent event) {
-        if ( event instanceof ChangeCopletInstanceAspectDataEvent ) {
-            if (((ChangeCopletInstanceAspectDataEvent)event).getAspectName().equals("size"))
{
-                return true;
-            }
-        }
-        return false;
     }
 
     /**

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/copletinstancedata.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/copletinstancedata.xml?rev=326208&r1=326207&r2=326208&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/copletinstancedata.xml
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/coplet/copletinstancedata.xml
Tue Oct 18 12:04:01 2005
@@ -14,82 +14,81 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<!-- SVN $Id:$ -->
+<!-- $Id$ -->
 <mapping>
-	<description>Coplet instance data mapping file</description>
+  <description>Coplet instance data mapping file</description>
 
-	<class name="org.apache.cocoon.portal.aspect.impl.AbstractAspectalizable">
-        <field name="persistentAspectDatas" type="org.exolab.castor.mapping.MapItem" collection="map"
handler="org.apache.cocoon.portal.util.AspectDataFieldHandler">
-            <bind-xml name="aspect"/>
-        </field>
-    </class>
-
-	<class name="org.apache.cocoon.portal.factory.impl.AbstractProducible"
-	       extends="org.apache.cocoon.portal.aspect.impl.AbstractAspectalizable">
-        <field name="name" type="java.lang.String">
-            <bind-xml name="name" node="attribute" />
-        </field>
-        <field name="id" type="java.lang.String" >
-            <bind-xml name="id" node="attribute" />
-        </field>
-    </class>
+  <class name="org.apache.cocoon.portal.aspect.impl.AbstractAspectalizable">
+    <field name="persistentAspectDatas" type="org.exolab.castor.mapping.MapItem"
+           collection="map"
+           handler="org.apache.cocoon.portal.util.AspectDataFieldHandler">
+      <bind-xml name="aspect"/>
+    </field>
+  </class>
+
+  <class name="org.apache.cocoon.portal.factory.impl.AbstractProducible"
+	     extends="org.apache.cocoon.portal.aspect.impl.AbstractAspectalizable">
+    <field name="name" type="java.lang.String">
+      <bind-xml name="name" node="attribute" />
+    </field>
+    <field name="id" type="java.lang.String" >
+      <bind-xml name="id" node="attribute" />
+    </field>
+  </class>
 
   <class name="org.apache.cocoon.portal.pluto.om.common.PreferenceImpl">
     <field name="name" type="java.lang.String" required="true">
       <bind-xml name="name" node="element"/>
     </field>
-    <field name="castorValues" type="java.lang.String" collection="collection" required="true">
+    <field name="castorValues" type="java.lang.String"
+           collection="collection" required="true">
       <bind-xml name="value" node="element"/>
     </field>
-
   </class>
 
-
   <class name="org.apache.cocoon.portal.pluto.om.common.PreferenceSetImpl">
-    <field name="preferences" type="org.apache.cocoon.portal.pluto.om.common.PreferenceImpl"
-      collection="set">
+    <field name="preferences"
+           type="org.apache.cocoon.portal.pluto.om.common.PreferenceImpl"
+           collection="set">
       <bind-xml name="preference" node="element"/>
     </field>
-
   </class>
 
-	<class name="org.apache.cocoon.portal.profile.impl.CopletInstanceDataManager">
-		<map-to xml="coplets" />
+  <class name="org.apache.cocoon.portal.profile.impl.CopletInstanceDataManager">
+    <map-to xml="coplets" />
 
-		<field name="copletInstanceData" type="org.apache.cocoon.portal.coplet.CopletInstanceData"
collection="vector" handler="org.apache.cocoon.portal.util.CopletInstanceDataFieldHandler">
-			<bind-xml auto-naming="deriveByClass"/>
-		</field>
-	</class>
-
-	<class name="org.apache.cocoon.portal.coplet.CopletInstanceData"
-		   extends="org.apache.cocoon.portal.factory.impl.AbstractProducible">
-		<map-to xml="coplet-instance-data" />
-
-		<field name="copletData" type="java.lang.String" handler="org.apache.cocoon.portal.util.CopletDataReferenceFieldHandler"/>
+    <field name="copletInstanceData" type="org.apache.cocoon.portal.coplet.CopletInstanceData"
collection="vector" handler="org.apache.cocoon.portal.util.CopletInstanceDataFieldHandler">
+      <bind-xml auto-naming="deriveByClass"/>
+    </field>
+  </class>
 
-		<field name="attributes" type="org.apache.cocoon.portal.util.AttributedMapItem" collection="collection"
+  <class name="org.apache.cocoon.portal.coplet.CopletInstanceData"
+         extends="org.apache.cocoon.portal.factory.impl.AbstractProducible">
+    <map-to xml="coplet-instance-data"/>
+    <field name="copletData" type="java.lang.String" handler="org.apache.cocoon.portal.util.CopletDataReferenceFieldHandler"/>
+    <field name="attributes" type="org.apache.cocoon.portal.util.AttributedMapItem" collection="collection"
            get-method="getCastorAttributes" set-method="addAttribute">
-			<bind-xml name="attribute" node="element"/>
-		</field>
-
+      <bind-xml name="attribute" node="element"/>
+    </field>
     <field name="castorPreferences" type="org.apache.cocoon.portal.pluto.om.common.PreferenceSetImpl">
       <bind-xml name="preferences" node="element"/>
     </field>
-
     <field name="title" type="java.lang.String" get-method="getInstanceTitle" set-method="setTitle">
       <bind-xml name="title"/>
     </field>
-	</class>
+    <field name="size">
+      <bind-xml name="size"/>
+    </field>
+  </class>
 
-	<class name="org.exolab.castor.mapping.MapItem">
-		<field name="key" type="java.lang.String">
-			<bind-xml name="name"/>
-		</field>
-
-		<field name="value">
-			<bind-xml name="value"/>
-		</field>
-	</class>
+  <class name="org.exolab.castor.mapping.MapItem">
+    <field name="key" type="java.lang.String">
+      <bind-xml name="name"/>
+    </field>
+    <field name="value">
+      <bind-xml name="value"/>
+    </field>
+  </class>
 
   <!-- If you prefer to specify the name and value as attributes of the attribute element
        just add node="attribute" to the bind-xml elements -->
@@ -97,7 +96,6 @@
     <field name="key" type="java.lang.String">
       <bind-xml name="name"/>
     </field>
-
     <field name="value">
       <bind-xml name="value"/>
     </field>

Added: 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=326208&view=auto
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/coplet/CopletInstanceSizingEvent.java
(added)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/event/coplet/CopletInstanceSizingEvent.java
Tue Oct 18 12:04:01 2005
@@ -0,0 +1,94 @@
+/*
+ * 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.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;
+import org.apache.cocoon.portal.event.ComparableEvent;
+import org.apache.cocoon.portal.event.ConvertableEvent;
+import org.apache.cocoon.portal.event.CopletInstanceEvent;
+import org.apache.cocoon.portal.event.impl.AbstractActionEvent;
+
+/**
+ * This event is fired for resizing a coplet.
+ *
+ * @version $Id$
+ */
+public class CopletInstanceSizingEvent
+    extends AbstractActionEvent
+    implements CopletInstanceEvent, ComparableEvent {//, ConvertableEvent {
+
+    protected final int size;
+
+    public CopletInstanceSizingEvent(CopletInstanceData target, int size) {
+        super(target);
+        if ( size < CopletInstanceData.SIZE_MINIMIZED ||
+             size > CopletInstanceData.SIZE_FULLSCREEN ) {
+            throw new IllegalArgumentException("Unknown size for coplet: " + size);
+        }
+        this.size = size;
+    }
+
+    public int getSize() {
+        return this.size;
+    }
+
+    /**
+     * @see org.apache.cocoon.portal.event.ComparableEvent#equalsEvent(org.apache.cocoon.portal.event.ComparableEvent)
+     */
+    public boolean equalsEvent(ComparableEvent event) {
+        if ( event instanceof CopletInstanceEvent
+             && CopletInstanceDataFeatures.isSizingEvent((CopletInstanceEvent)event)
) {
+            if ( this.getTarget().equals( ((ActionEvent)event).getTarget()) ) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * @see org.apache.cocoon.portal.event.ConvertableEvent#asString()
+     */
+    public String asString() {
+        return ((CopletInstanceData)this.getTarget()).getId() + ':' + this.getSize();
+    }
+
+    /**
+     * @see org.apache.cocoon.portal.event.ConvertableEvent#getRequestParameterName()
+     */
+    public String getRequestParameterName() {
+        return "cocoon-portal-size";
+    }
+
+    /**
+     * 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);
+    }
+
+}

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

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

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=326208&r1=326207&r2=326208&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 12:04:01 2005
@@ -26,6 +26,7 @@
 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.profile.ProfileManager;
 import org.apache.commons.jxpath.JXPathContext;
 
@@ -57,6 +58,14 @@
             final JXPathContext jxpathContext = JXPathContext.newContext(target);
             jxpathContext.setValue(event.getPath(), event.getValue());
         }
+    }
+
+    /**
+     * @see Receiver
+     */
+    public void inform(CopletInstanceSizingEvent event, PortalService service) {
+        final CopletInstanceData cid = (CopletInstanceData)event.getTarget();
+        cid.setSize(event.getSize());
     }
 
     /**

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=326208&r1=326207&r2=326208&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 12:04:01 2005
@@ -18,8 +18,8 @@
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.coplet.CopletDataFeatures;
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
-import org.apache.cocoon.portal.coplet.status.SizingStatus;
-import org.apache.cocoon.portal.event.impl.ChangeCopletInstanceAspectDataEvent;
+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.impl.CopletLayout;
 import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
@@ -68,27 +68,21 @@
         boolean showContent = true;
 
         boolean sizable = CopletDataFeatures.isSizable(cid.getCopletData());
-        Integer size = null;
 
         if ( sizable ) {
-            size = (Integer)cid.getAspectData("size");
-            if ( size == null ) {
-                size = SizingStatus.STATUS_MAXIMIZED;
-            }
-
-            ChangeCopletInstanceAspectDataEvent event;    
+            int size = cid.getSize();
 
-            if ( size.equals(SizingStatus.STATUS_MAXIMIZED) ) {
-                event = new ChangeCopletInstanceAspectDataEvent(cid, "size", SizingStatus.STATUS_MINIMIZED);
+            if ( size == CopletInstanceData.SIZE_NORMAL ) {
+                Event event = new CopletInstanceSizingEvent(cid, CopletInstanceData.SIZE_MINIMIZED);
                 XMLUtils.createElement(handler, "minimize-uri", service.getComponentManager().getLinkService().getLinkURI(event));
             }
 
-            if ( size.equals(SizingStatus.STATUS_MINIMIZED)) {
-                event = new ChangeCopletInstanceAspectDataEvent(cid, "size", SizingStatus.STATUS_MAXIMIZED);
+            if ( size == CopletInstanceData.SIZE_MINIMIZED) {
+                Event event = new CopletInstanceSizingEvent(cid, CopletInstanceData.SIZE_NORMAL);
                 XMLUtils.createElement(handler, "maximize-uri", service.getComponentManager().getLinkService().getLinkURI(event));
             }
             
-            if (size.equals(SizingStatus.STATUS_MINIMIZED)) {
+            if (size == CopletInstanceData.SIZE_MINIMIZED) {
                 showContent = false;
             }
         } 

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=326208&r1=326207&r2=326208&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 12:04:01 2005
@@ -58,10 +58,10 @@
 import org.apache.cocoon.portal.coplet.CopletData;
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
 import org.apache.cocoon.portal.coplet.adapter.impl.AbstractCopletAdapter;
-import org.apache.cocoon.portal.coplet.status.SizingStatus;
+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.impl.ChangeCopletInstanceAspectDataEvent;
+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;
@@ -697,11 +697,11 @@
                         service.getComponentManager().getEventManager().send(e);
                     }
                     if ( windowState.equals(WindowStates._minimized) ) {
-                        ChangeCopletInstanceAspectDataEvent e = new ChangeCopletInstanceAspectDataEvent(coplet,
"size", SizingStatus.STATUS_MINIMIZED);
+                        Event e = new CopletInstanceSizingEvent(coplet, CopletInstanceData.SIZE_MINIMIZED);
                         service.getComponentManager().getEventManager().send(e);
                     }
                     if ( windowState.equals(WindowStates._normal) ) {
-                        ChangeCopletInstanceAspectDataEvent e = new ChangeCopletInstanceAspectDataEvent(coplet,
"size", SizingStatus.STATUS_MAXIMIZED);
+                        Event e = new CopletInstanceSizingEvent(coplet, CopletInstanceData.SIZE_NORMAL);
                         service.getComponentManager().getEventManager().send(e);
                     }
                     if ( windowState.equals(WindowStates._maximized) ) {

Modified: cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/wsrp/adapter/WSRPPortletWindowAspect.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/wsrp/adapter/WSRPPortletWindowAspect.java?rev=326208&r1=326207&r2=326208&view=diff
==============================================================================
--- cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/wsrp/adapter/WSRPPortletWindowAspect.java
(original)
+++ cocoon/blocks/portal/trunk/java/org/apache/cocoon/portal/wsrp/adapter/WSRPPortletWindowAspect.java
Tue Oct 18 12:04:01 2005
@@ -27,11 +27,8 @@
 import org.apache.avalon.framework.context.Contextualizable;
 import org.apache.avalon.framework.parameters.ParameterException;
 import org.apache.avalon.framework.parameters.Parameters;
-import org.apache.cocoon.portal.LinkService;
 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.ChangeCopletInstanceAspectDataEvent;
 import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.layout.impl.CopletLayout;
 import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
@@ -267,53 +264,5 @@
         pc.tagName = configuration.getParameter("tag-name", "window");
         pc.rootTag = configuration.getParameterAsBoolean("root-tag", true);
         return pc;
-    }
-
-    /**
-     * provides an link including the wsrp-link and the current event-state<br/>
-     * 
-     * @param linkService
-     * @param urlGenerator
-     * @param cid
-     * @param windowStates
-     * @param size
-     * @return String the link for the portal
-     */
-    protected String createLink(LinkService linkService,
-                                URLGenerator urlGenerator,
-                                CopletInstanceData cid,
-                                WindowStates windowStates,
-                                Integer size) {
-        ChangeCopletInstanceAspectDataEvent event;
-        event = new ChangeCopletInstanceAspectDataEvent(cid, "size", size);
-        
-        return this.createLink(linkService, urlGenerator, cid, windowStates, event);
-    }
-
-    /**
-     * provides an link including the wsrp-link and the current event-state<br/>
-     * 
-     * @param linkService
-     * @param urlGenerator
-     * @param cid
-     * @param windowStates
-     * @param event
-     * @return String the link for the portal
-     */
-    protected String createLink(LinkService linkService,
-                                URLGenerator urlGenerator,
-                                CopletInstanceData cid,
-                                WindowStates windowStates,
-                                Event event) {
-        // create the link for the wsrp window state first
-        final Map p = new HashMap();
-        p.put(Constants.URL_TYPE, Constants.URL_TYPE_RENDER);
-        p.put(Constants.WINDOW_STATE, windowStates.getValue());
-        final String wsrpLink = urlGenerator.getRenderURL(p);
-
-        String link_event = linkService.getLinkURI(event);
-        int pos = link_event.indexOf('?');
-
-        return wsrpLink + link_event.substring(pos+1);
     }
 }

Added: cocoon/blocks/portal/trunk/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/portal/trunk/status.xml?rev=326208&view=auto
==============================================================================
--- cocoon/blocks/portal/trunk/status.xml (added)
+++ cocoon/blocks/portal/trunk/status.xml Tue Oct 18 12:04:01 2005
@@ -0,0 +1,84 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+<!DOCTYPE status [
+<!ELEMENT status (developers, todo, changes)>
+<!ELEMENT developers (person+)>
+<!ELEMENT person EMPTY>
+<!ATTLIST person
+  name CDATA #REQUIRED
+  email CDATA #REQUIRED
+  id CDATA #REQUIRED
+>
+<!ELEMENT todo (actions+)>
+<!ELEMENT actions (action+)>
+<!ATTLIST actions
+  priority (high | medium | low) #REQUIRED
+>
+<!ELEMENT changes (release+)>
+<!ELEMENT release (action+)>
+<!ATTLIST release
+  version CDATA #REQUIRED
+  date CDATA #REQUIRED
+>
+<!ELEMENT action (#PCDATA | link | br | code | ul | strong)*>
+<!ATTLIST action
+  context (build | code | docs) #IMPLIED
+  assigned-to CDATA #IMPLIED
+  dev CDATA #IMPLIED
+  type (add | fix | remove | update) #IMPLIED
+  fixes-bug CDATA #IMPLIED
+  due-to CDATA #IMPLIED
+  due-to-email CDATA #IMPLIED
+>
+<!ELEMENT code (#PCDATA)>
+<!ELEMENT br EMPTY>
+<!ELEMENT strong (#PCDATA)>
+<!ELEMENT link (#PCDATA)>
+<!ATTLIST link
+  href CDATA #REQUIRED
+>
+<!ELEMENT ul (li)+>
+<!ELEMENT li (#PCDATA | link | br | code | ul)*>
+<!ENTITY eacute           "&#x000E9;">
+<!ENTITY ouml             "&#x000F6;">
+<!ENTITY uuml             "&#x000FC;">
+<!ENTITY ccedil           "&#x000E7;">
+]>
+
+<!-- SVN $Id$ -->
+
+<status>
+ <!-- The following list contains the changes since the latest 2.1.x version. -->
+ <changes>
+  <release version="@version@" date="@date@">
+    <action dev="CZ">
+      Portal block: Add coplet size to coplet instance data.
+    </action>
+    <action dev="CZ" type="add">
+      Portal block: Remove aspect datas from coplet datas. Attributes are now used instead.
+    </action>
+    <action dev="CZ" type="add">
+      Portal block: Remove deprecated Publisher, Subscriber, Filter and Register.
+    </action>
+    <action dev="CZ" type="add">
+      Portal block: Remove deprecated PortletPortalManager.
+    </action>
+  </release>
+ </changes>
+
+</status>
+

Propchange: cocoon/blocks/portal/trunk/status.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/blocks/portal/trunk/status.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/trunk/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/status.xml?rev=326208&r1=326207&r2=326208&view=diff
==============================================================================
--- cocoon/trunk/status.xml (original)
+++ cocoon/trunk/status.xml Tue Oct 18 12:04:01 2005
@@ -197,9 +197,6 @@
     <action dev="JH" type="fix" fixes-bug="33318" due-to="Dan Durkin" due-to-email="ddurkin@scilearn.com">
       CForms: Fixed JavaScript error in forms-lib.js when using keyword <code>undefined</code>
and Mac IE 5.0.
     </action>
-    <action dev="CZ" type="add">
-      Portal block: Remove aspect datas from coplet datas. Attributes are now used instead.
-    </action>
     <action dev="JHS" type="fix" fixes-bug="35537" due-to="Mark H. Butler" due-to-email="mark-h.butler@hp.com">
       Deli block updated to use the latest revision of DELI. This uses a more robust method
of loading configuration 
       files that should ensure DELI works on different apps servers or deployed as a WAR.
@@ -270,12 +267,6 @@
       elements before passing them to logicsheets.
       (This feature was not used by the standard logicsheets but check your
       custom logicsheets whether they depend on it.)
-    </action>
-    <action dev="CZ" type="add">
-      Portal block: Remove deprecated Publisher, Subscriber, Filter and Register.
-    </action>
-    <action dev="CZ" type="add">
-      Portal block: Remove deprecated PortletPortalManager.
     </action>
     <action dev="UH" type="add" due-to="Johan Stuyts">
       Mail block: The SendMailTransformer can now configure the smtp port.



Mime
View raw message