cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r369863 - in /cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal: coplet/adapter/impl/ deployment/impl/ event/ event/coplet/ event/impl/ event/layout/ event/user/ layout/ layout/impl/ persistence/castor/ pl...
Date Tue, 17 Jan 2006 18:56:10 GMT
Author: cziegeler
Date: Tue Jan 17 10:54:16 2006
New Revision: 369863

URL: http://svn.apache.org/viewcvs?rev=369863&view=rev
Log:
Refactor event and layout implementations

Added:
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/AbstractCopletDataEvent.java   (with props)
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/AbstractCopletInstanceEvent.java   (with props)
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/AbstractLayoutEvent.java   (with props)
Removed:
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/ActionEvent.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/AbstractActionEvent.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/AbstractLayout.java
Modified:
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/deployment/impl/DefaultDeploymentObject.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/CopletDataEvent.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/CopletInstanceEvent.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/LayoutEvent.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletDataAddedEvent.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletInstanceDataAddedEvent.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletInstanceDataRemovedEvent.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletInstanceSizingEvent.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletJXPathEvent.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/ChangeCopletsJXPathEvent.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/CopletLinkEvent.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/InternalEventReceiver.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/JXPathEvent.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/LayoutChangeParameterEvent.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/LayoutJXPathEvent.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/LayoutRemoveEvent.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/user/UserEvent.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/CompositeLayout.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/Layout.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/CompositeLayoutImpl.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/CopletLayout.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/FrameLayout.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/LinkLayout.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/persistence/castor/layout.xml
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/TestProfileManager.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/wsrp/adapter/WSRPAdapter.java
    cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/wsrp/adapter/WSRPEvent.java

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/CachingURICopletAdapter.java Tue Jan 17 10:54:16 2006
@@ -190,7 +190,7 @@
      * This adapter listens for CopletInstanceEvents. Each event sets the cache invalid.
      */
     public void handleCopletInstanceEvent(CopletInstanceEvent event) {
-        final CopletInstanceData coplet = (CopletInstanceData) event.getTarget();
+        final CopletInstanceData coplet = event.getTarget();
 
         // do we ignore SizingEvents
         boolean ignoreSizing = ((Boolean)this.getConfiguration(coplet, CONFIGURATION_IGNORE_SIZING_EVENTS, Boolean.TRUE)).booleanValue();

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/deployment/impl/DefaultDeploymentObject.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/deployment/impl/DefaultDeploymentObject.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/deployment/impl/DefaultDeploymentObject.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/deployment/impl/DefaultDeploymentObject.java Tue Jan 17 10:54:16 2006
@@ -113,9 +113,8 @@
         if (dot != -1) {
             final String ext = uri.substring(dot);
             return ext.equals(".war") || ext.equals(".jar") || ext.equals(".zip");
-        } else {
-            return false;
         }
+        return false;
     }
 
 }

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/CopletDataEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/CopletDataEvent.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/CopletDataEvent.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/CopletDataEvent.java Tue Jan 17 10:54:16 2006
@@ -15,6 +15,8 @@
  */
 package org.apache.cocoon.portal.event;
 
+import org.apache.cocoon.portal.coplet.CopletData;
+
 
 /**
  * This interface marks an event as an event for a coplet data (or
@@ -22,8 +24,7 @@
  *
  * @version $Id$
  */
-public interface CopletDataEvent 
-    extends ActionEvent {
+public interface CopletDataEvent extends Event {
 
-    // just a marker interface
+    CopletData getTarget();
 }

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/CopletInstanceEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/CopletInstanceEvent.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/CopletInstanceEvent.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/CopletInstanceEvent.java Tue Jan 17 10:54:16 2006
@@ -15,14 +15,15 @@
  */
 package org.apache.cocoon.portal.event;
 
+import org.apache.cocoon.portal.coplet.CopletInstanceData;
+
 
 /**
  * This interface marks an event as an event for a coplet instance.
  *
  * @version $Id$
  */
-public interface CopletInstanceEvent
-    extends ActionEvent {
+public interface CopletInstanceEvent extends Event {
 
-    // just a marker interface
+    CopletInstanceData getTarget();
 }

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/LayoutEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/LayoutEvent.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/LayoutEvent.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/LayoutEvent.java Tue Jan 17 10:54:16 2006
@@ -15,13 +15,15 @@
  */
 package org.apache.cocoon.portal.event;
 
+import org.apache.cocoon.portal.layout.Layout;
+
 /**
- * This interface marks an {@link ActionEvent} as targetted at a
+ * This interface marks an event as targetted at a
  * {@link org.apache.cocoon.portal.layout.Layout} object.
  *
  * @version $Id$
  */
-public interface LayoutEvent extends ActionEvent {
+public interface LayoutEvent extends Event {
 
-    // just a marker interface
+    Layout getTarget();
 }

Added: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/AbstractCopletDataEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/AbstractCopletDataEvent.java?rev=369863&view=auto
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/AbstractCopletDataEvent.java (added)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/AbstractCopletDataEvent.java Tue Jan 17 10:54:16 2006
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2006 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.coplet.CopletData;
+import org.apache.cocoon.portal.event.CopletDataEvent;
+
+public class AbstractCopletDataEvent
+    implements CopletDataEvent {
+
+    protected CopletData target;
+
+    public AbstractCopletDataEvent(CopletData target) {
+        this.target = target;
+    }
+
+    /**
+     * @see org.apache.cocoon.portal.event.CopletDataEvent#getTarget()
+     */
+    public CopletData getTarget() {
+        return this.target;
+    }
+}

Propchange: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/AbstractCopletDataEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/AbstractCopletDataEvent.java
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/AbstractCopletInstanceEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/AbstractCopletInstanceEvent.java?rev=369863&view=auto
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/AbstractCopletInstanceEvent.java (added)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/AbstractCopletInstanceEvent.java Tue Jan 17 10:54:16 2006
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2006 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.coplet.CopletInstanceData;
+import org.apache.cocoon.portal.event.CopletInstanceEvent;
+
+public class AbstractCopletInstanceEvent
+    implements CopletInstanceEvent {
+
+    protected CopletInstanceData target;
+
+    public AbstractCopletInstanceEvent(CopletInstanceData target) {
+        this.target = target;
+    }
+
+    /**
+     * @see org.apache.cocoon.portal.event.CopletDataEvent#getTarget()
+     */
+    public CopletInstanceData getTarget() {
+        return this.target;
+    }
+}
\ No newline at end of file

Propchange: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/AbstractCopletInstanceEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/AbstractCopletInstanceEvent.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletDataAddedEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletDataAddedEvent.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletDataAddedEvent.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletDataAddedEvent.java Tue Jan 17 10:54:16 2006
@@ -16,7 +16,6 @@
 package org.apache.cocoon.portal.event.coplet;
 
 import org.apache.cocoon.portal.coplet.CopletData;
-import org.apache.cocoon.portal.event.impl.AbstractActionEvent;
 
 /**
  * This event is fired when a new coplet is created.
@@ -24,7 +23,7 @@
  * @version $Id$
  */
 public class CopletDataAddedEvent
-    extends AbstractActionEvent {
+    extends AbstractCopletDataEvent {
 
     public CopletDataAddedEvent(CopletData target) {
         super(target);

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletInstanceDataAddedEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletInstanceDataAddedEvent.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletInstanceDataAddedEvent.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletInstanceDataAddedEvent.java Tue Jan 17 10:54:16 2006
@@ -16,8 +16,6 @@
 package org.apache.cocoon.portal.event.coplet;
 
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
-import org.apache.cocoon.portal.event.CopletInstanceEvent;
-import org.apache.cocoon.portal.event.impl.AbstractActionEvent;
 
 /**
  * This event is fired if a new instance is created.
@@ -25,8 +23,7 @@
  * @version $Id$
  */
 public class CopletInstanceDataAddedEvent
-    extends AbstractActionEvent
-    implements CopletInstanceEvent {
+    extends AbstractCopletInstanceEvent {
 
     public CopletInstanceDataAddedEvent(CopletInstanceData target) {
         super(target);

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletInstanceDataRemovedEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletInstanceDataRemovedEvent.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletInstanceDataRemovedEvent.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletInstanceDataRemovedEvent.java Tue Jan 17 10:54:16 2006
@@ -16,8 +16,6 @@
 package org.apache.cocoon.portal.event.coplet;
 
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
-import org.apache.cocoon.portal.event.CopletInstanceEvent;
-import org.apache.cocoon.portal.event.impl.AbstractActionEvent;
 
 /**
  * This event is fired if an instance is removed.
@@ -25,8 +23,7 @@
  * @version $Id$
  */
 public class CopletInstanceDataRemovedEvent
-    extends AbstractActionEvent
-    implements CopletInstanceEvent {
+    extends AbstractCopletInstanceEvent {
 
     public CopletInstanceDataRemovedEvent(CopletInstanceData target) {
         super(target);

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletInstanceSizingEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletInstanceSizingEvent.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletInstanceSizingEvent.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletInstanceSizingEvent.java Tue Jan 17 10:54:16 2006
@@ -18,11 +18,9 @@
 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.
@@ -30,8 +28,8 @@
  * @version $Id$
  */
 public class CopletInstanceSizingEvent
-    extends AbstractActionEvent
-    implements CopletInstanceEvent, ComparableEvent, ConvertableEvent {
+    extends AbstractCopletInstanceEvent
+    implements ComparableEvent, ConvertableEvent {
 
     protected int size;
 
@@ -65,7 +63,7 @@
     public boolean equalsEvent(ComparableEvent event) {
         if ( event instanceof CopletInstanceEvent
              && CopletInstanceDataFeatures.isSizingEvent((CopletInstanceEvent)event) ) {
-            if ( this.getTarget().equals( ((ActionEvent)event).getTarget()) ) {
+            if ( this.getTarget().equals( ((CopletInstanceEvent)event).getTarget()) ) {
                 return true;
             }
         }
@@ -76,6 +74,6 @@
      * @see org.apache.cocoon.portal.event.ConvertableEvent#asString()
      */
     public String asString() {
-        return ((CopletInstanceData)this.getTarget()).getId() + ':' + this.getSize();
+        return this.getTarget().getId() + ':' + this.getSize();
     }
 }

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletJXPathEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletJXPathEvent.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletJXPathEvent.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/coplet/CopletJXPathEvent.java Tue Jan 17 10:54:16 2006
@@ -31,4 +31,12 @@
     public CopletJXPathEvent(CopletInstanceData target, String path, Object value) {
         super( target, path, value );
     }
+
+    /**
+     * @see org.apache.cocoon.portal.event.CopletInstanceEvent#getTarget()
+     */
+    public CopletInstanceData getTarget() {
+        return (CopletInstanceData)this.target;
+    }
+
 }

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/ChangeCopletsJXPathEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/ChangeCopletsJXPathEvent.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/ChangeCopletsJXPathEvent.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/ChangeCopletsJXPathEvent.java Tue Jan 17 10:54:16 2006
@@ -24,11 +24,11 @@
  * @version $Id$
  */
 public class ChangeCopletsJXPathEvent
-extends AbstractActionEvent 
-implements CopletDataEvent {
+    implements CopletDataEvent {
 
     protected String path;
     protected Object value;
+    protected CopletData target;
 
     /**
      * Constructor
@@ -37,9 +37,9 @@
      * @param value  The value to set
      */
     public ChangeCopletsJXPathEvent(CopletData target, String path, Object value) {
-        super( target );
         this.path = path;
         this.value = value;
+        this.target = target;
     }
 
     /**
@@ -54,5 +54,12 @@
      */
     public Object getValue() {
         return this.value;
+    }
+
+    /**
+     * @see org.apache.cocoon.portal.event.CopletDataEvent#getTarget()
+     */
+    public CopletData getTarget() {
+        return this.target;
     }
 }

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/CopletLinkEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/CopletLinkEvent.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/CopletLinkEvent.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/CopletLinkEvent.java Tue Jan 17 10:54:16 2006
@@ -16,7 +16,7 @@
 package org.apache.cocoon.portal.event.impl;
 
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
-import org.apache.cocoon.portal.event.CopletInstanceEvent;
+import org.apache.cocoon.portal.event.coplet.AbstractCopletInstanceEvent;
 
 /**
  * This class realizes a link event created by the EventLinkTransformer.
@@ -24,8 +24,7 @@
  * @version $Id$
  */
 public class CopletLinkEvent
-extends AbstractActionEvent
-implements CopletInstanceEvent {
+    extends AbstractCopletInstanceEvent {
 
     /**
      * The link to be handled by this event.

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/InternalEventReceiver.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/InternalEventReceiver.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/InternalEventReceiver.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/InternalEventReceiver.java Tue Jan 17 10:54:16 2006
@@ -59,14 +59,14 @@
      * @see Receiver
      */
     public void inform(CopletInstanceEvent event, PortalService service) {
-        CopletInstanceDataFeatures.addChangedCopletInstanceData(service, (CopletInstanceData)event.getTarget());
+        CopletInstanceDataFeatures.addChangedCopletInstanceData(service, event.getTarget());
     }
 
     /**
      * @see Receiver
      */
     public void inform(JXPathEvent event, PortalService service) {
-        final Object target = event.getTarget();
+        final Object target = event.getObject();
         if ( target != null && event.getPath() != null && event.getValue() != null) {
             if ( target instanceof CopletInstanceData && event.getPath().equals("size") ) {
                 int newSize = new Integer(event.getValue().toString()).intValue();
@@ -83,7 +83,7 @@
      * @see Receiver
      */
     public void inform(CopletInstanceSizingEvent event, PortalService service) {
-        final CopletInstanceData cid = (CopletInstanceData)event.getTarget();
+        final CopletInstanceData cid = event.getTarget();
         Layout rootLayout = service.getProfileManager().getPortalLayout(null, null);
         if ( cid != null ) {
             final int oldSize = cid.getSize();
@@ -125,7 +125,7 @@
      * @see Receiver
      */
     public void inform(CopletInstanceDataRemovedEvent e, PortalService service) {
-        CopletInstanceData cid = (CopletInstanceData)e.getTarget();
+        CopletInstanceData cid = e.getTarget();
         // full screen?
         if ( cid.getSize() == CopletInstanceData.SIZE_FULLSCREEN ) {
             Layout rootLayout = service.getProfileManager().getPortalLayout(null, null);
@@ -144,7 +144,7 @@
      * @see Receiver
      */
     public void inform(CopletDataEvent e, PortalService service) {
-        CopletData data = (CopletData)e.getTarget();
+        CopletData data = e.getTarget();
         List instances = null;
 
         ProfileManager profileManager = service.getProfileManager();
@@ -168,7 +168,7 @@
      * @see Receiver
      */
     public void inform(LayoutChangeParameterEvent e, PortalService service) {
-        final Layout l = (Layout)e.getTarget();
+        final Layout l = e.getTarget();
         if ( e.isTemporary() ) {
             l.setTemporaryAttribute(e.getParameterName(), e.getValue());
         } else {

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/JXPathEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/JXPathEvent.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/JXPathEvent.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/JXPathEvent.java Tue Jan 17 10:54:16 2006
@@ -15,18 +15,21 @@
  */
 package org.apache.cocoon.portal.event.impl;
 
+import org.apache.cocoon.portal.event.Event;
+
 /**
  * This event changes the value of an instance.
  *
  * @version $Id$
  */
-public abstract class JXPathEvent
-    extends AbstractActionEvent {
+public abstract class JXPathEvent implements Event {
 
     protected String path;
 
     protected Object value;
 
+    protected Object target;
+
     /**
      * @return Returns the path.
      */
@@ -41,8 +44,15 @@
         return value;
     }
 
+    /**
+     * @return Returns the target.
+     */
+    public Object getObject() {
+        return this.target;
+    }
+
     public JXPathEvent(Object target, String path, Object value) {
-        super( target );
+        this.target = target;
         this.path = path;
         this.value = value;
     }

Added: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/AbstractLayoutEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/AbstractLayoutEvent.java?rev=369863&view=auto
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/AbstractLayoutEvent.java (added)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/AbstractLayoutEvent.java Tue Jan 17 10:54:16 2006
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2006 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.layout;
+
+import org.apache.cocoon.portal.event.LayoutEvent;
+import org.apache.cocoon.portal.layout.Layout;
+
+public class AbstractLayoutEvent
+    implements LayoutEvent {
+
+    protected Layout target;
+
+    public AbstractLayoutEvent(Layout target) {
+        this.target = target;
+    }
+
+    /**
+     * @see org.apache.cocoon.portal.event.LayoutEvent#getTarget()
+     */
+    public Layout getTarget() {
+        return this.target;
+    }
+}

Propchange: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/AbstractLayoutEvent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/AbstractLayoutEvent.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/LayoutChangeParameterEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/LayoutChangeParameterEvent.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/LayoutChangeParameterEvent.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/LayoutChangeParameterEvent.java Tue Jan 17 10:54:16 2006
@@ -18,8 +18,6 @@
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.event.ComparableEvent;
 import org.apache.cocoon.portal.event.ConvertableEvent;
-import org.apache.cocoon.portal.event.LayoutEvent;
-import org.apache.cocoon.portal.event.impl.AbstractActionEvent;
 import org.apache.cocoon.portal.layout.Layout;
 import org.apache.commons.lang.ObjectUtils;
 
@@ -28,8 +26,8 @@
  * @version $Id$
  */
 public class LayoutChangeParameterEvent
-    extends AbstractActionEvent
-    implements LayoutEvent, ComparableEvent, ConvertableEvent {
+    extends AbstractLayoutEvent
+    implements ComparableEvent, ConvertableEvent {
 
     protected String parameterName;
     protected String value;
@@ -103,7 +101,7 @@
      * @see org.apache.cocoon.portal.event.ConvertableEvent#asString()
      */
     public String asString() {
-        final Layout l = (Layout)this.getTarget();
+        final Layout l = this.getTarget();
         if ( l.getId() == null ) {
             return null;
         }

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/LayoutJXPathEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/LayoutJXPathEvent.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/LayoutJXPathEvent.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/LayoutJXPathEvent.java Tue Jan 17 10:54:16 2006
@@ -31,4 +31,11 @@
     public LayoutJXPathEvent(Layout target, String path, Object value) {
         super( target, path, value );
     }
+
+    /**
+     * @see org.apache.cocoon.portal.event.LayoutEvent#getTarget()
+     */
+    public Layout getTarget() {
+        return (Layout)this.target;
+    }
 }

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/LayoutRemoveEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/LayoutRemoveEvent.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/LayoutRemoveEvent.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/layout/LayoutRemoveEvent.java Tue Jan 17 10:54:16 2006
@@ -18,8 +18,6 @@
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.coplet.CopletInstanceDataFeatures;
 import org.apache.cocoon.portal.event.ConvertableEvent;
-import org.apache.cocoon.portal.event.LayoutEvent;
-import org.apache.cocoon.portal.event.impl.AbstractActionEvent;
 import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.layout.impl.CopletLayout;
 
@@ -29,8 +27,8 @@
  * @version $Id$
  */
 public class LayoutRemoveEvent
-    extends AbstractActionEvent
-    implements LayoutEvent, ConvertableEvent {
+    extends AbstractLayoutEvent
+    implements ConvertableEvent {
 
     /**
      * Constructor.
@@ -54,7 +52,7 @@
      * @see org.apache.cocoon.portal.event.ConvertableEvent#asString()
      */
     public String asString() {
-        final Layout l = (Layout)this.getTarget();
+        final Layout l = this.getTarget();
         if ( l.getId() == null ) {
             // if this is a coplet layout we can use the coplet instance id
             if ( l instanceof CopletLayout ) {

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/user/UserEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/user/UserEvent.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/user/UserEvent.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/user/UserEvent.java Tue Jan 17 10:54:16 2006
@@ -15,7 +15,7 @@
  */
 package org.apache.cocoon.portal.event.user;
 
-import org.apache.cocoon.portal.event.ActionEvent;
+import org.apache.cocoon.portal.event.Event;
 import org.apache.cocoon.portal.profile.PortalUser;
 
 /**
@@ -24,7 +24,8 @@
  * @version $Id$
  * @since 2.2
  */
-public abstract class UserEvent implements ActionEvent {
+public abstract class UserEvent
+    implements Event {
 
     protected PortalUser portalUser;
 
@@ -35,12 +36,4 @@
     public PortalUser getPortalUser() {
         return this.portalUser;
     }
-
-    /**
-     * @see org.apache.cocoon.portal.event.ActionEvent#getTarget()
-     */
-    public Object getTarget() {
-        return this.getPortalUser();
-    }
-
 }

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/CompositeLayout.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/CompositeLayout.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/CompositeLayout.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/CompositeLayout.java Tue Jan 17 10:54:16 2006
@@ -15,62 +15,131 @@
  */
 package org.apache.cocoon.portal.layout;
 
+import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
+import org.apache.cocoon.portal.layout.impl.CompositeLayoutImpl;
+import org.apache.cocoon.util.ClassUtils;
+
 /**
  * A composite layout is a layout that contains other layouts.
  *
  * @version $Id$
  */
-public interface CompositeLayout 
+public abstract class CompositeLayout 
     extends Layout {
 
-	/**
-	 * Add indexed item to the itemList.
-	 * @param index index for the position inside the list
-	 * @param item item to add
-	 */
-    void addItem(int index, Item item);
-
-	/**
-	 * Add Item to the ItemList.
-	 * @param item item to add
-	 */
-	void addItem(Item item);
-
-    /**
-     * Get the item at the index
-     * @param index
-     * @return The item or null
-     */
-	Item getItem(int index);
-
-	/**
-	 * Get the ItemList.
-	 * @return items
-	 */
-	List getItems();
-
-	/**
-	 * Get size of ItemList.
-	 * @return size
-	 */
-	int getSize();
+    /** The children of this layout object. */
+    protected List items = new ArrayList();
+
+    /**
+     * Create a new composite layout object.
+     * Never create a layout object directly. Use the
+     * {@link LayoutFactory} instead.
+     * @param id The unique identifier of the layout object or null.
+     * @param name The name of the layout.
+     */
+    public CompositeLayout(String id, String name) {
+        super(id, name);
+    }
+
+    /**
+     * Add indexed item to the itemList.
+     * @param index index for the position inside the list
+     * @param item item to add
+     */
+    public final void addItem(int index, Item item) {
+        this.items.add(index, item);
+        item.setParent(this);
+    }
+
+    /**
+     * Add Item to the ItemList.
+     * @param item item to add
+     */
+    public final void addItem(Item item) {
+        this.items.add(item);
+        item.setParent(this);
+    }
 
     /**
-     * Remove an item
-     * @param item
+     * Get Item from the ItemList.
+     * @return Item
      */
-    void removeItem(Item item);
+    public final Item getItem(int index) {
+        return (Item) this.items.get(index);
+    }
+
+    /**
+     * Get the ItemList.
+     * @return items
+     */
+    public final List getItems() {
+        return this.items;
+    }
+
+    /**
+     * Get size of ItemList.
+     * @return size
+     */
+    public final int getSize() {
+        return this.items.size();
+    }
+
+    /**
+     * Remove an item from the item list.
+     */
+    public final void removeItem(Item item) {
+        this.items.remove(item);
+        item.setParent(null);
+    }
 
     /**
      * Create a new item.
      * This item is not added to the composite layout
      */
-    Item createNewItem();
+    public Item createNewItem() {
+        if ( this.description.getItemClassName() == null ) {
+            return new Item();
+        }
+        try {
+            return (Item)ClassUtils.newInstance(this.description.getItemClassName());
+        } catch (Exception ignore) {
+            return new Item();
+        }
+    }
 
     /**
      * @return Returns the item class name.
      */
-    String getItemClassName();
+    public String getItemClassName() {
+        return this.description.getItemClassName();
+    }
+
+    /**
+     * @see java.lang.Object#clone()
+     */
+    protected Object clone() throws CloneNotSupportedException {
+        CompositeLayoutImpl clone = (CompositeLayoutImpl)super.clone();
+
+        // we are not cloning the items
+        clone.items = new ArrayList();
+
+        return clone;
+    }
+
+    /**
+     * @see org.apache.cocoon.portal.layout.Layout#copy()
+     */
+    public Layout copy() {
+        CompositeLayout clone = (CompositeLayout)super.copy();
+        final Iterator i = this.items.iterator();
+        while ( i.hasNext() ) {
+            final Item current = (Item)i.next();
+            final Item clonedItem = current.copy(clone);
+            clone.addItem(clonedItem);
+        }
+        return clone;
+    }
 }

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/Layout.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/Layout.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/Layout.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/Layout.java Tue Jan 17 10:54:16 2006
@@ -17,6 +17,9 @@
 
 import java.util.Map;
 
+import org.apache.cocoon.portal.PortalRuntimeException;
+import org.apache.commons.collections.map.LinkedMap;
+
 /**
  * TODO - Convert this in an abstract class which all implementations
  * have to extend (we can use AbstractLayout for this).
@@ -31,81 +34,112 @@
  * the temporary attributes have only the life-time of a
  * session, but can contain any object.
  *
+ * If you are implementing your own layout object make sure that your
+ * class provides a two string constructor which calls {@link #Layout(String, String)}.
+ *
  * @version $Id$
  */
-public interface Layout {
+public abstract class Layout extends AbstractParameters {
 
-    /**
-     * The name given from the factory.
+    /** The renderer to render this layout if this layout object wants to use a different
+     * render than the default renderer.
      */
-    String getName();
+    protected String rendererName;
 
-    /**
-     * Get the unique id of this object.
-     * @return Unique id of the layout or null if this object does not provide a unique id.
-     */
-    String getId();
+    /** The parent item of this layout or null if this is a layout root. */
+    protected Item parent;
 
-    /**
-     * Set the layout description.
-     */
-    void setDescription(LayoutDescription description);
+    /** The name of the layout. */
+    protected String name;
+
+    /** The unique identifier of this layout object or null. */
+    protected String id;
+
+    /** The corresponding layout descripton. */
+    transient protected LayoutDescription description;
+
+    /** The temporary attributes. */
+    transient protected Map temporaryAttributes = new LinkedMap();
+
+    /** Is this layout object static? */
+    protected Boolean isStatic;
 
     /**
-     * Get parameters map.
-     * This method never returns null.
-     * @return A map with key value pairs.
+     * Create a new layout object.
+     * Never create a layout object directly. Use the
+     * {@link LayoutFactory} instead.
+     * @param id The unique identifier of the layout object or null.
+     * @param name The name of the layout.
      */
-    Map getParameters();
+    public Layout(String id, String name) {
+        // TODO - Check for valid id's
+        this.id = id;
+        this.name = name;
+    }
 
     /**
-     * Return the parameter value for the given key.
-     * @param key The name of the parameter.
-     * @return The value of the parameter or null.
+     * The name given from the factory.
      */
-    String getParameter(String key);
+    public String getName() {
+        return this.name;
+    }
 
     /**
-     * Set the parameter to a value.
-     * @param key The name of the parameter.
-     * @param value The value.
+     * Get the unique id of this object.
+     * @return Unique id of the layout or null if this object does not provide a unique id.
      */
-    void setParameter(String key, String value);
+    public String getId() {
+        return this.id;
+    }
 
     /**
-     * Remove the parameter.
-     * @param key The name of the parameter.
-     * @return The old value for the parameter or null.
+     * Set the layout description.
      */
-    String removeParameter(String key);
-    
+    public void setDescription(LayoutDescription description) {
+        if ( this.description != null ) {
+            throw new PortalRuntimeException("The layout has already a layout description.");
+        }
+        this.description = description;
+        if ( this.isStatic == null ) {
+            this.isStatic = Boolean.valueOf(this.description.defaultIsStatic());
+        }
+    }
+
     /**
      * Get the temporary attributes map.
      * This method never returns null.
      * @return A map with key value pairs.
      */
-    Map getTemporaryAttributes();
+    public Map getTemporaryAttributes() {
+        return this.temporaryAttributes;
+    }
 
     /**
      * Return the temporary attribute value for the given key.
      * @param key The name of the attribute.
      * @return The value of the attribute or null.
      */
-    Object getTemporaryAttribute(String key);
+    public Object getTemporaryAttribute(String key) {
+        return this.temporaryAttributes.get(key);
+    }
 
     /**
      * Set the temporary attribute to a value.
      * @param key The name of the attribute.
      * @param value The value.
      */
-    void setTemporaryAttribute(String key, Object value);
+    public void setTemporaryAttribute(String key, Object value) {
+        this.temporaryAttributes.put(key, value);
+    }
 
     /**
      * Remove the attribute.
      * @param key The name of the attribute.
      * @return The old value for the attribute or null.
      */
-    Object removeTemporaryAttribute(String key);
+    public Object removeTemporaryAttribute(String key) {
+        return this.temporaryAttributes.remove(key);
+    }
 
     /**
      * Get the name of the {@link org.apache.cocoon.portal.layout.renderer.Renderer} to draw this layout.
@@ -113,34 +147,88 @@
      * return this, otherwise the default renderer is returned.
      * @return String The role name
      */
-    String getRendererName();
+    public String getRendererName() {
+        if ( this.rendererName == null ) {
+            return this.description.getDefaultRendererName();
+        }
+        return this.rendererName;        
+    }
 
     /** 
      * Get the name of a custom {@link org.apache.cocoon.portal.layout.renderer.Renderer} for this layout.
      * @return String The role name
      */
-    String getLayoutRendererName();
+    public String getLayoutRendererName() {
+        return this.rendererName;
+    }
 
     /**
      * The parent of this layout object or null.
      */
-    Item getParent();
+    public Item getParent() {
+        return this.getParent();
+    }
 
     /**
      * Set the parent item for this layout.
      */
-    void setParent(Item item);
-
-    /**
-     * Make a copy of this layout object and of all it's children.
-     * This includes copies of items and copletinstancedatas.
-     */
-    Layout copy();
+    public void setParent(Item item) {
+        this.parent = item;
+    }
 
     /**
      * Is this layout static?
      * If a layout is static, it is not removed when another layout
      * is max paged.
      */
-   Boolean isStatic();
+    public Boolean isStatic() {
+        return this.isStatic;
+    }
+
+    public void setLayoutRendererName(String value) {
+        this.rendererName = value;
+    }
+
+    public void setIsStatic(Boolean value) {
+        this.isStatic = value;
+    }
+
+    /**
+     * Make a copy of this layout object and of all it's children.
+     * This includes copies of items and copletinstancedatas.
+     */
+    public Layout copy() {
+        try {
+            return (Layout)this.clone();
+        } catch (CloneNotSupportedException cnse) {
+            // ignore
+        }
+        return null;
+    }
+
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString() {
+        return "Layout (" + this.getClass() + '.' + this.hashCode() +
+               "), name=" + this.name + ", id=" + (this.getId() == null ? "" : this.getId());
+    }
+
+    /**
+     * @see java.lang.Object#clone()
+     */
+    protected Object clone() throws CloneNotSupportedException {
+        Layout clone = (Layout)super.clone();
+
+        // we don't clone the parent; we just set it to null
+        clone.name = this.name;
+        clone.id = this.id;
+        clone.description = this.description;
+        clone.rendererName = this.rendererName;
+        clone.isStatic = this.isStatic;
+        clone.temporaryAttributes = new LinkedMap(this.temporaryAttributes);
+        clone.parent = null;
+
+        return clone;
+    }
 }

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/CompositeLayoutImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/CompositeLayoutImpl.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/CompositeLayoutImpl.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/CompositeLayoutImpl.java Tue Jan 17 10:54:16 2006
@@ -15,16 +15,8 @@
  */
 package org.apache.cocoon.portal.layout.impl;
 
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.cocoon.portal.layout.AbstractLayout;
 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.LayoutFactory;
-import org.apache.cocoon.util.ClassUtils;
 
 
 /**
@@ -33,11 +25,7 @@
  * @version $Id$
  */
 public class CompositeLayoutImpl 
-    extends AbstractLayout
-    implements CompositeLayout {
-
-    /** The children of this layout object. */
-    protected List items = new ArrayList();
+    extends CompositeLayout {
 
     /**
      * Create a new composite layout object.
@@ -48,103 +36,5 @@
      */
     public CompositeLayoutImpl(String id, String name) {
         super(id, name);
-    }
-
-	/**
-	 * Add indexed item to the itemList.
-	 * @param index index for the position inside the list
-	 * @param item item to add
-	 */
-	public final void addItem(int index, Item item) {
-		this.items.add(index, item);
-        item.setParent(this);
-	}
-
-	/**
-	 * Add Item to the ItemList.
-	 * @param item item to add
-	 */
-	public final void addItem(Item item) {
-		this.items.add(item);
-		item.setParent(this);
-	}
-
-	/**
-	 * Get Item from the ItemList.
-	 * @return Item
-	 */
-	public final Item getItem(int index) {
-		return (Item) this.items.get(index);
-	}
-
-	/**
-	 * Get the ItemList.
-	 * @return items
-	 */
-	public final List getItems() {
-		return this.items;
-	}
-
-	/**
-	 * Get size of ItemList.
-	 * @return size
-	 */
-	public final int getSize() {
-		return this.items.size();
-	}
-
-    /**
-     * @see org.apache.cocoon.portal.layout.CompositeLayout#removeItem(org.apache.cocoon.portal.layout.Item)
-     */
-    public final void removeItem(Item item) {
-        this.items.remove(item);
-        item.setParent(null);
-    }
-
-    /**
-     * @see org.apache.cocoon.portal.layout.CompositeLayout#createNewItem()
-     */
-    public Item createNewItem() {
-        if ( this.description.getItemClassName() == null ) {
-            return new Item();
-        }
-        try {
-            return (Item)ClassUtils.newInstance(this.description.getItemClassName());
-        } catch (Exception ignore) {
-            return new Item();
-        }
-    }
-
-    /**
-     * @return Returns the item class name.
-     */
-    public String getItemClassName() {
-        return this.description.getItemClassName();
-    }
-
-    /**
-     * @see java.lang.Object#clone()
-     */
-    protected Object clone() throws CloneNotSupportedException {
-        CompositeLayoutImpl clone = (CompositeLayoutImpl)super.clone();
-
-        // we are not cloning the items
-        clone.items = new ArrayList();
-
-        return clone;
-    }
-
-    /**
-     * @see org.apache.cocoon.portal.layout.Layout#copy()
-     */
-    public Layout copy() {
-        CompositeLayoutImpl clone = (CompositeLayoutImpl)super.copy();
-        final Iterator i = this.items.iterator();
-        while ( i.hasNext() ) {
-            final Item current = (Item)i.next();
-            final Item clonedItem = current.copy(clone);
-            clone.addItem(clonedItem);
-        }
-        return clone;
     }
 }

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/CopletLayout.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/CopletLayout.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/CopletLayout.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/CopletLayout.java Tue Jan 17 10:54:16 2006
@@ -16,7 +16,6 @@
 package org.apache.cocoon.portal.layout.impl;
 
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
-import org.apache.cocoon.portal.layout.AbstractLayout;
 import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.layout.LayoutFactory;
 
@@ -25,7 +24,7 @@
  *
  * @version $Id$
  */
-public final class CopletLayout extends AbstractLayout {
+public final class CopletLayout extends Layout {
 
     /** The coplet instance data. */
     protected CopletInstanceData copletInstanceData;

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/DefaultLayoutFactory.java Tue Jan 17 10:54:16 2006
@@ -260,7 +260,7 @@
      * @see Receiver
      */
     public void inform(LayoutRemoveEvent event, PortalService service) {
-        this.remove( (Layout)event.getTarget() );
+        this.remove( event.getTarget() );
     }
 
     /**

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/FrameLayout.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/FrameLayout.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/FrameLayout.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/FrameLayout.java Tue Jan 17 10:54:16 2006
@@ -15,7 +15,7 @@
  */
 package org.apache.cocoon.portal.layout.impl;
 
-import org.apache.cocoon.portal.layout.AbstractLayout;
+import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.layout.LayoutFactory;
 
 /**
@@ -25,7 +25,7 @@
  *
  * @version $Id$
  */
-public class FrameLayout extends AbstractLayout {
+public class FrameLayout extends Layout {
 
     protected String source;
 

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/LinkLayout.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/LinkLayout.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/LinkLayout.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/impl/LinkLayout.java Tue Jan 17 10:54:16 2006
@@ -15,7 +15,6 @@
  */
 package org.apache.cocoon.portal.layout.impl;
 
-import org.apache.cocoon.portal.layout.AbstractLayout;
 import org.apache.cocoon.portal.layout.Layout;
 import org.apache.cocoon.portal.layout.LayoutFactory;
 
@@ -25,7 +24,7 @@
  *
  * @version $Id$
  */
-public class LinkLayout extends AbstractLayout implements Layout {
+public class LinkLayout extends Layout {
 
     protected String linkedLayoutKey;
     protected String linkedLayoutId;

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/persistence/castor/layout.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/persistence/castor/layout.xml?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/persistence/castor/layout.xml (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/persistence/castor/layout.xml Tue Jan 17 10:54:16 2006
@@ -33,7 +33,7 @@
     </field>
   </class>
 
-  <class name="org.apache.cocoon.portal.layout.AbstractLayout"
+  <class name="org.apache.cocoon.portal.layout.Layout"
          extends="org.apache.cocoon.portal.layout.AbstractParameters"
          verify-constructable="false">
 
@@ -52,7 +52,7 @@
   </class>
 
   <class name="org.apache.cocoon.portal.layout.impl.LinkLayout"
-         extends="org.apache.cocoon.portal.layout.AbstractLayout"
+         extends="org.apache.cocoon.portal.layout.Layout"
          verify-constructable="false">
     <map-to xml="link-layout"/>
 
@@ -73,7 +73,7 @@
   </class>
 
   <class name="org.apache.cocoon.portal.layout.impl.CompositeLayoutImpl"
-         extends="org.apache.cocoon.portal.layout.AbstractLayout"
+         extends="org.apache.cocoon.portal.layout.Layout"
          verify-constructable="false">
     <map-to xml="composite-layout"/>
 
@@ -93,7 +93,7 @@
 
   <class name="org.apache.cocoon.portal.layout.impl.CopletLayout"
          auto-complete="false"
-         extends="org.apache.cocoon.portal.layout.AbstractLayout"
+         extends="org.apache.cocoon.portal.layout.Layout"
          verify-constructable="false">
     <map-to xml="coplet-layout"/>
 
@@ -111,7 +111,7 @@
   </class>
 
   <class name="org.apache.cocoon.portal.layout.impl.FrameLayout"
-         extends="org.apache.cocoon.portal.layout.AbstractLayout"
+         extends="org.apache.cocoon.portal.layout.Layout"
          verify-constructable="false">
     <map-to xml="frame-layout"/>
 

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java Tue Jan 17 10:54:16 2006
@@ -246,9 +246,9 @@
     }
 
     /**
-     * @see org.apache.cocoon.portal.event.ActionEvent#getTarget()
+     * @see org.apache.cocoon.portal.event.CopletInstanceEvent#getTarget()
      */
-    public Object getTarget() {        
+    public CopletInstanceData getTarget() {        
         return ((PortletEntityImpl)this.portletWindow.getPortletEntity()).getCopletInstanceData();
     }
 

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/TestProfileManager.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/TestProfileManager.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/TestProfileManager.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/pluto/TestProfileManager.java Tue Jan 17 10:54:16 2006
@@ -110,9 +110,8 @@
 
             this.storeUserProfile(layoutKey, profile);
             return profile;
-        } else {
-            return super.loadProfile(layoutKey);
         }
+        return super.loadProfile(layoutKey);
     }
 
     /**

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java Tue Jan 17 10:54:16 2006
@@ -240,7 +240,7 @@
      */
     public void inform(CopletInstanceDataAddedEvent event, PortalService service) {
         final ProfileImpl profile = this.getUserProfile(null);
-        profile.add((CopletInstanceData) event.getTarget());
+        profile.add(event.getTarget());
     }
 
     /**
@@ -248,9 +248,9 @@
      * @see Receiver
      */
     public void inform(CopletDataAddedEvent event, PortalService service) {
-        this.deployedCopletDatas.put(((CopletData)event.getTarget()).getId(), event.getTarget());
+        this.deployedCopletDatas.put(event.getTarget().getId(), event.getTarget());
         if ( this.copletDatas.objects != null ) {
-            this.copletDatas.objects.put(((CopletData)event.getTarget()).getId(), event.getTarget());
+            this.copletDatas.objects.put(event.getTarget().getId(), event.getTarget());
         }
     }
 
@@ -260,7 +260,7 @@
      */
     public void inform(CopletInstanceDataRemovedEvent event, PortalService service) {
         final ProfileImpl profile = this.getUserProfile(null);
-        profile.remove((CopletInstanceData) event.getTarget());
+        profile.remove(event.getTarget());
     }
 
     /**

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/wsrp/adapter/WSRPAdapter.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/wsrp/adapter/WSRPAdapter.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/wsrp/adapter/WSRPAdapter.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/wsrp/adapter/WSRPAdapter.java Tue Jan 17 10:54:16 2006
@@ -607,7 +607,7 @@
      * @see Receiver
      */
     public void inform(WSRPEvent event, PortalService service) {
-        final CopletInstanceData coplet = (CopletInstanceData)event.getTarget();
+        final CopletInstanceData coplet = event.getTarget();
         this.setCurrentCopletInstanceData(coplet);
         
         try {

Modified: cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/wsrp/adapter/WSRPEvent.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/wsrp/adapter/WSRPEvent.java?rev=369863&r1=369862&r2=369863&view=diff
==============================================================================
--- cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/wsrp/adapter/WSRPEvent.java (original)
+++ cocoon/trunk/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/wsrp/adapter/WSRPEvent.java Tue Jan 17 10:54:16 2006
@@ -46,9 +46,9 @@
     }
 
     /**
-     * @see org.apache.cocoon.portal.event.ActionEvent#getTarget()
+     * @see org.apache.cocoon.portal.event.CopletInstanceEvent#getTarget()
      */
-    public Object getTarget() {
+    public CopletInstanceData getTarget() {
         return this.coplet;
     }
 



Mime
View raw message