cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r599229 - in /cocoon/trunk/blocks/cocoon-portal: cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/ cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/ cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/ren...
Date Thu, 29 Nov 2007 00:51:51 GMT
Author: cziegeler
Date: Wed Nov 28 16:51:48 2007
New Revision: 599229

URL: http://svn.apache.org/viewvc?rev=599229&view=rev
Log:
Fix typo in layout factory method name; correct spring configuration for layout types and start using bean references for OM instead of weak key based references (using strings) (WiP)

Added:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/NewDefaultLayoutFactory.java   (with props)
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/coplet-types.xml   (with props)
Modified:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/PortalService.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCompositeAspect.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/impl/DefaultLinkRenderer.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/CompositeLayout.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/CopletLayout.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/FrameLayout.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/Layout.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LayoutFeatures.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LayoutType.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LinkLayout.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/LayoutFactory.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/DefaultLayoutFactory.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/DefaultPortalManager.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/source/LayoutSource.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/TestProfileManager.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/layout-types.xml
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/profiles/coplettype/portal.xml

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/PortalService.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/PortalService.java?rev=599229&r1=599228&r2=599229&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/PortalService.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/PortalService.java Wed Nov 28 16:51:48 2007
@@ -21,7 +21,6 @@
 import org.apache.cocoon.portal.coplet.adapter.CopletAdapter;
 import org.apache.cocoon.portal.event.EventConverter;
 import org.apache.cocoon.portal.event.EventManager;
-import org.apache.cocoon.portal.layout.renderer.Renderer;
 import org.apache.cocoon.portal.profile.ProfileManager;
 import org.apache.cocoon.portal.services.CopletFactory;
 import org.apache.cocoon.portal.services.LayoutFactory;
@@ -89,11 +88,6 @@
      * Get the current profile manager.
      */
     ProfileManager getProfileManager();
-
-    /**
-     * Get the renderer.
-     */
-    Renderer getRenderer(String name);
 
     /**
      * Get the coplet adapter.

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java?rev=599229&r1=599228&r2=599229&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/impl/PortalServiceImpl.java Wed Nov 28 16:51:48 2007
@@ -39,7 +39,6 @@
 import org.apache.cocoon.portal.coplet.adapter.CopletAdapter;
 import org.apache.cocoon.portal.event.EventConverter;
 import org.apache.cocoon.portal.event.EventManager;
-import org.apache.cocoon.portal.layout.renderer.Renderer;
 import org.apache.cocoon.portal.om.SkinDescription;
 import org.apache.cocoon.portal.profile.ProfileManager;
 import org.apache.cocoon.portal.services.CopletFactory;
@@ -95,9 +94,6 @@
     /** The link service. */
     protected LinkService linkService;
 
-    /** The used renderers. */
-    protected Map renderers = Collections.EMPTY_MAP;
-
     /** The used coplet adapters. */
     protected Map copletAdapters = Collections.EMPTY_MAP;
 
@@ -124,7 +120,6 @@
      */
     public void service(ServiceManager serviceManager) throws ServiceException {
         this.manager = serviceManager;
-        this.renderers = (Map)this.manager.lookup(Renderer.class.getName()+"Map");
         this.copletAdapters = (Map)this.manager.lookup(CopletAdapter.class.getName()+"Map");
         this.requestContextProvider = (RequestContextProvider)this.manager.lookup(RequestContextProvider.class.getName());
     }
@@ -310,17 +305,6 @@
             }
         }
         return this.eventManager;
-    }
-
-    /**
-     * @see org.apache.cocoon.portal.PortalService#getRenderer(java.lang.String)
-     */
-    public Renderer getRenderer(String name) {
-        final Renderer o = (Renderer) this.renderers.get( name );
-        if ( o == null ) {
-            throw new PortalRuntimeException("Unable to lookup renderer with name " + name);
-        }
-        return o;
     }
 
     /**

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCompositeAspect.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCompositeAspect.java?rev=599229&r1=599228&r2=599229&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCompositeAspect.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCompositeAspect.java Wed Nov 28 16:51:48 2007
@@ -64,9 +64,9 @@
                 if ( item.equals(maximizedInfo.item) ) {
                     this.processMaximizedItem(rendererContext, item, maximizedInfo.layout, handler);
                 } else if ( item.getLayout().isStatic() ) {
-                    this.processItem(rendererContext, item, handler);	                	
+                    this.processItem(rendererContext, item, handler);
                 }
-            }            	
+            }
         } else {
         	// loop over all rows
             for (Iterator iter = compositeLayout.getItems().iterator(); iter.hasNext();) {
@@ -108,8 +108,7 @@
     protected void processLayout(Layout layout, PortalService service, ContentHandler handler)
     throws SAXException, LayoutException {
         if ( layout != null ) {
-            final String rendererName = service.getLayoutFactory().getRendererName(layout);
-            final Renderer renderer = service.getRenderer(rendererName);
+            final Renderer renderer = layout.getRenderer();
             renderer.toSAX(layout, service, handler);
         }
     }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/impl/DefaultLinkRenderer.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/impl/DefaultLinkRenderer.java?rev=599229&r1=599228&r2=599229&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/impl/DefaultLinkRenderer.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/impl/DefaultLinkRenderer.java Wed Nov 28 16:51:48 2007
@@ -50,14 +50,13 @@
         String layoutId = null;
         final LayoutInstance instance = LayoutFeatures.getLayoutInstance(service, layout, false);
         if ( instance != null ) {
-            layoutId = (String)instance.getTemporaryAttribute(LinkLayout.ATTRIBUTE_LAYOUT_ID);                
+            layoutId = (String)instance.getTemporaryAttribute(LinkLayout.ATTRIBUTE_LAYOUT_ID);
         }
         if ( layoutId == null){
             // get default values
             layoutId = ((LinkLayout)layout).getLayoutId();
         }
         final Layout linkedLayout = service.getProfileManager().getLayout(layoutId);
-        final String rendererName = service.getLayoutFactory().getRendererName(linkedLayout);
-        service.getRenderer(rendererName).toSAX(linkedLayout, service, handler);
+        linkedLayout.getRenderer().toSAX(linkedLayout, service, handler);
     }
 }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/CompositeLayout.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/CompositeLayout.java?rev=599229&r1=599228&r2=599229&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/CompositeLayout.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/CompositeLayout.java Wed Nov 28 16:51:48 2007
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You 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.
@@ -25,7 +25,7 @@
  *
  * @version $Id$
  */
-public class CompositeLayout 
+public class CompositeLayout
     extends Layout {
 
     /** The children of this layout object. */
@@ -36,10 +36,10 @@
      * Never create a layout object directly. Use the
      * {@link org.apache.cocoon.portal.services.LayoutFactory} instead.
      * @param id The unique identifier of the layout object or null.
-     * @param name The name of the layout.
+     * @param type The layout type.
      */
-    public CompositeLayout(String id, String name) {
-        super(id, name);
+    public CompositeLayout(String id, LayoutType type) {
+        super(id, type);
     }
 
     /**

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/CopletLayout.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/CopletLayout.java?rev=599229&r1=599228&r2=599229&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/CopletLayout.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/CopletLayout.java Wed Nov 28 16:51:48 2007
@@ -31,10 +31,10 @@
      * Never create a layout object directly. Use the
      * {@link org.apache.cocoon.portal.services.LayoutFactory} instead.
      * @param id The unique identifier of the layout object or null.
-     * @param name The name of the layout.
+     * @param type The layout type.
      */
-    public CopletLayout(String id, String name) {
-        super(id, name);
+    public CopletLayout(String id, LayoutType type) {
+        super(id, type);
     }
 
     public void setCopletInstanceId(String cid) {

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/FrameLayout.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/FrameLayout.java?rev=599229&r1=599228&r2=599229&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/FrameLayout.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/FrameLayout.java Wed Nov 28 16:51:48 2007
@@ -18,7 +18,7 @@
 
 /**
  * A frame layout holds a source URI. The URI can be changed dynamically through
- * events. The URI may contain any URI that can be resolved by the Cocoon 
+ * events. The URI may contain any URI that can be resolved by the Cocoon
  * {@link org.apache.cocoon.environment.SourceResolver}.
  *
  * @version $Id$
@@ -35,10 +35,10 @@
      * Never create a layout object directly. Use the
      * {@link org.apache.cocoon.portal.services.LayoutFactory} instead.
      * @param id The unique identifier of the layout object or null.
-     * @param name The name of the layout.
+     * @param type The layout type.
      */
-    public FrameLayout(String id, String name) {
-        super(id, name);
+    public FrameLayout(String id, LayoutType type) {
+        super(id, type);
     }
 
     /**

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/Layout.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/Layout.java?rev=599229&r1=599228&r2=599229&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/Layout.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/Layout.java Wed Nov 28 16:51:48 2007
@@ -20,6 +20,7 @@
 import java.lang.reflect.InvocationTargetException;
 import java.util.HashMap;
 
+import org.apache.cocoon.portal.layout.renderer.Renderer;
 import org.apache.cocoon.portal.services.LayoutFactory;
 import org.apache.cocoon.portal.util.PortalUtils;
 import org.apache.commons.collections.map.LinkedMap;
@@ -38,30 +39,30 @@
  * in the session, it is advisable to use serializable objects only.
  *
  * If you are implementing your own layout object make sure that your
- * class provides a two string constructor which calls {@link #Layout(String, String)}.
+ * class provides a two string constructor which calls {@link #Layout(String, LayoutType)}.
  *
  * @version $Id$
  */
 public abstract class Layout extends AbstractParameters {
 
-    /**
-     * The renderer to render this layout if this layout object wants to
-     * use a different render than the default renderer.
-     */
-    protected String rendererName;
-
     /** The parent item of this layout or null if this is a layout root. */
     protected Item parent;
 
-    /** The type of the layout. */
-    protected final String type;
-
     /** The unique identifier of this layout object or null. */
     protected final String id;
 
     /** Is this layout object static? */
     protected boolean isStatic;
 
+    /** The corresponding layout type. */
+    protected final LayoutType layoutType;
+
+    /** The optional renderer to render this layout. If this layout should use
+     * a different renderer than the default renderer, this property will point
+     * to the renderer.
+     */
+    protected Renderer customRenderer;
+
     /**
      * Create a new layout object.
      * Never create a layout object directly. Use the
@@ -70,7 +71,7 @@
      * @param type The type of the layout.
      * @see PortalUtils#testId(String)
      */
-    public Layout(String id, String type) {
+    public Layout(String id, LayoutType type) {
         // check id, null for id is allowed!
         if ( id != null ) {
             final String idErrorMsg = PortalUtils.testId(id);
@@ -79,14 +80,7 @@
             }
         }
         this.id = id;
-        this.type = type;
-    }
-
-    /**
-     * The type given from the factory.
-     */
-    public String getType() {
-        return this.type;
+        this.layoutType = type;
     }
 
     /**
@@ -98,11 +92,11 @@
     }
 
     /**
-     * Get the name of a custom {@link org.apache.cocoon.portal.layout.renderer.Renderer} for this layout.
-     * @return String The role name
+     * Get the custom {@link org.apache.cocoon.portal.layout.renderer.Renderer} for this layout.
+     * @return The custom renderer or null.
      */
-    public String getRendererName() {
-        return this.rendererName;
+    public Renderer getCustomRenderer() {
+        return this.customRenderer;
     }
 
     /**
@@ -128,8 +122,9 @@
         return this.isStatic;
     }
 
-    public void setRendererName(String value) {
-        this.rendererName = value;
+    public void setCustomRenderer(Renderer value) {
+        // TODO - we have to check if this renderer is allowed
+        this.customRenderer = value;
     }
 
     public void setIsStatic(boolean value) {
@@ -154,7 +149,7 @@
      */
     public String toString() {
         return "Layout (" + this.getClass() + '.' + this.hashCode() +
-               "), type=" + this.type + ", id=" + (this.getId() == null ? "" : this.getId());
+               "), type=" + this.layoutType + ", id=" + (this.getId() == null ? "" : this.getId());
     }
 
     /**
@@ -164,7 +159,7 @@
         Constructor c;
         try {
             c = this.getClass().getConstructor(new Class[] {String.class, String.class});
-            final Layout clone = (Layout)c.newInstance(new Object[] {this.id, this.type});
+            final Layout clone = (Layout)c.newInstance(new Object[] {this.id, this.layoutType});
 
             // clone fields from AbstractParameters
             if ( this.parameters.size() > 0 ) {
@@ -177,7 +172,7 @@
 
             // we don't clone the parent; we just set it to null
             clone.parent = null;
-            clone.rendererName = this.rendererName;
+            clone.customRenderer = this.customRenderer;
             clone.isStatic = this.isStatic;
 
             return clone;
@@ -192,5 +187,19 @@
         } catch (IllegalAccessException e) {
             throw new CloneNotSupportedException("Unable to invoke constructor for new layout object.");
         }
+    }
+
+    public LayoutType getLayoutType() {
+        return this.layoutType;
+    }
+
+    /**
+     * Get the renderer to render this layout.
+     */
+    public Renderer getRenderer() {
+        if ( this.customRenderer != null ) {
+            return this.customRenderer;
+        }
+        return this.layoutType.getDefaultRenderer();
     }
 }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LayoutFeatures.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LayoutFeatures.java?rev=599229&r1=599228&r2=599229&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LayoutFeatures.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LayoutFeatures.java Wed Nov 28 16:51:48 2007
@@ -69,7 +69,7 @@
         if ( fullScreenLayout == null ) {
             layoutInstance.removeTemporaryAttribute(ATTRIBUTE_FULLSCREENINFO);
         } else {
-            layoutInstance.setTemporaryAttribute(ATTRIBUTE_FULLSCREENINFO, fullScreenLayout);            
+            layoutInstance.setTemporaryAttribute(ATTRIBUTE_FULLSCREENINFO, fullScreenLayout);
         }
     }
 
@@ -89,7 +89,7 @@
         if ( info == null ) {
             layoutInstance.removeTemporaryAttribute(ATTRIBUTE_MAXMIZEDINFO);
         } else {
-            layoutInstance.setTemporaryAttribute(ATTRIBUTE_MAXMIZEDINFO, info);            
+            layoutInstance.setTemporaryAttribute(ATTRIBUTE_MAXMIZEDINFO, info);
         }
     }
 
@@ -105,7 +105,7 @@
 		return item;
 	}
 
-    /** 
+    /**
      * The layout traverser gets notified by each layout object in the tree when
      * the layout is traversed using {@link LayoutFeatures#traverseLayout(PortalService, Layout, LayoutTraverser)}
      * and {@link LayoutFeatures#traverseLayout(PortalService, Layout, LayoutTraverser, boolean)}.
@@ -133,7 +133,7 @@
                                         LayoutTraverser traverser) {
         return traverseLayout(service, rootLayout, traverser, true);
     }
-    
+
     /**
      * Traverse the whole layout tree. Depending on the parameters, link layouts are
      * either followed or not.
@@ -210,7 +210,7 @@
     public static LayoutInstance getLayoutInstance(PortalService service, Layout layout, boolean create) {
         LayoutInstance instance = service.getProfileManager().getLayoutInstance(layout);
         if ( instance == null && create ) {
-            instance = service.getLayoutFactory().newInstace(layout);
+            instance = service.getLayoutFactory().newInstance(layout);
         }
         return instance;
     }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LayoutType.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LayoutType.java?rev=599229&r1=599228&r2=599229&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LayoutType.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LayoutType.java Wed Nov 28 16:51:48 2007
@@ -16,62 +16,53 @@
  */
 package org.apache.cocoon.portal.om;
 
-import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.List;
 
-import org.apache.cocoon.portal.services.LayoutFactory;
+import org.apache.cocoon.portal.layout.renderer.Renderer;
 
 
 /**
- * A configured layout.
- * This description is used to instantiate new layout objects by the {@link LayoutFactory}.
- * A layout has an associated class and an associated type. The type is used to differentiate
- * layout objects having the same class but providing different features. For example
- * a composite layout can either be a row or a column - both use the same implementation class
- * but have different types.
+ * A configured layout type.
+ * Layout types a per portal configurations and define the possible layout objects for
+ * creating the portal pages. Ususally a portal has layout types for structuring like
+ * columns or rows and layout types for content like coplets.
+ * A layout type requires a class name which has to be of type {@link Layout}.
  *
  * @version $Id$
  */
 public class LayoutType {
 
+    /** The class name of the layout object. */
     protected String className;
 
+    /** Should an ID be generated for this layout object. */
     protected boolean createId = false;
 
-    protected String defaultRendererName;
-
-    protected List rendererNames = new ArrayList(2);
-
+    /** The class name of the item (if a special class is used) for composite layouts. */
     protected String itemClassName;
 
-    protected boolean defaultIsStatic = false;
+    /** The renderers for this layout object. */
+    protected List renderers = Collections.EMPTY_LIST;
 
-    /**
-     * This is the name of the renderer used by default to render this layout object.
-     * @return the default renderer name
-     */
-    public String getDefaultRendererName() {
-        return defaultRendererName;
-    }
+    /** TODO */
+    protected boolean defaultIsStatic = false;
 
-    /**
-     * @param string
-     */
-    public void setDefaultRendererName(String string) {
-        defaultRendererName = string;
+    public Renderer getDefaultRenderer() {
+        return (Renderer) renderers.get(0);
     }
 
     /**
      * Each layout can have several associated renderers.
      * @return the names of all allowed renderers.
      */
-    public Collection getRendererNames() {
-        return this.rendererNames;
+    public Collection getRenderers() {
+        return this.renderers;
     }
 
-    public void setRendererNames(List names) {
-        this.rendererNames = names;
+    public void setRenderers(List r) {
+        this.renderers = r;
     }
 
     /**

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LinkLayout.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LinkLayout.java?rev=599229&r1=599228&r2=599229&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LinkLayout.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LinkLayout.java Wed Nov 28 16:51:48 2007
@@ -35,10 +35,10 @@
      * Never create a layout object directly. Use the
      * {@link org.apache.cocoon.portal.services.LayoutFactory} instead.
      * @param id The unique identifier of the layout object or null.
-     * @param name The name of the profile.
+     * @param type The layout type.
      */
-    public LinkLayout(String id, String name) {
-        super(id, name);
+    public LinkLayout(String id, LayoutType type) {
+        super(id, type);
     }
 
     public String getLayoutId() {

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/LayoutFactory.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/LayoutFactory.java?rev=599229&r1=599228&r2=599229&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/LayoutFactory.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/LayoutFactory.java Wed Nov 28 16:51:48 2007
@@ -32,20 +32,11 @@
 
     /**
      * Return all available types.
+     * TODO - Do we need this?
      */
     Collection getLayoutTypes();
 
     /**
-     * Return all available renderer names for a type.
-     */
-    Collection getRendererNames(String type);
-
-    /**
-     * Return the renderer name for the layout.
-     */
-    String getRendererName(Layout layout);
-
-    /**
      * Create a new layout instance.
      * The instance is also registered at the profile manager.
      */
@@ -65,7 +56,7 @@
      * @param layout
      * @return A new layout instance.
      */
-    LayoutInstance newInstace(Layout layout);
+    LayoutInstance newInstance(Layout layout);
 
     /**
      * Remove the layout instance.
@@ -77,6 +68,7 @@
     /**
      * Create a new item for the layout.
      * This item is *not* added to the layout.
+     * TODO - We could move this to the layout
      */
     Item createItem(Layout layout) throws LayoutException;
 }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/DefaultLayoutFactory.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/DefaultLayoutFactory.java?rev=599229&r1=599228&r2=599229&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/DefaultLayoutFactory.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/DefaultLayoutFactory.java Wed Nov 28 16:51:48 2007
@@ -257,20 +257,6 @@
     }
 
     /**
-     * @see org.apache.cocoon.portal.services.LayoutFactory#getRendererName(org.apache.cocoon.portal.om.Layout)
-     */
-    public String getRendererName(Layout layout) {
-        if ( layout != null ) {
-            if ( layout.getRendererName() != null ) {
-                return layout.getRendererName();
-            }
-            LayoutDescription description = (LayoutDescription) this.layouts.get(layout.getType());
-            return description.getDefaultRendererName();
-        }
-        return null;
-    }
-
-    /**
      * @see org.apache.cocoon.portal.services.LayoutFactory#getLayoutTypes()
      */
     public Collection getLayoutTypes() {
@@ -293,24 +279,20 @@
      */
     public Item createItem(Layout layout)
     throws LayoutException {
-        LayoutDescription desc = (LayoutDescription) this.layouts.get(layout.getType());
-        if ( desc == null ) {
-            throw new LayoutException("Description not found for layout " + layout);
-        }
-        if ( desc.getItemClassName() == null ) {
+        if ( layout.getLayoutType().getItemClassName() == null ) {
             return new Item();
         }
         try {
-            return (Item) ClassUtils.newInstance(desc.getItemClassName());
+            return (Item) ClassUtils.newInstance(layout.getLayoutType().getItemClassName());
         } catch (Exception e ) {
             throw new LayoutException("Unable to create new item for layout " + layout, e);
         }
     }
 
     /**
-     * @see org.apache.cocoon.portal.services.LayoutFactory#newInstace(org.apache.cocoon.portal.om.Layout)
+     * @see org.apache.cocoon.portal.services.LayoutFactory#newInstance(org.apache.cocoon.portal.om.Layout)
      */
-    public LayoutInstance newInstace(Layout layout) {
+    public LayoutInstance newInstance(Layout layout) {
         final LayoutInstance instance = new LayoutInstance(layout);
         this.portalService.getEventManager().send(new LayoutInstanceAddedEvent(instance));
         return instance;

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/DefaultPortalManager.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/DefaultPortalManager.java?rev=599229&r1=599228&r2=599229&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/DefaultPortalManager.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/DefaultPortalManager.java Wed Nov 28 16:51:48 2007
@@ -172,7 +172,7 @@
                 a.addCDATAAttribute("id", current.getId());
                 XMLUtils.startElement(ch, "coplet", a);
                 final Layout l = LayoutFeatures.searchLayout(this.portalService, current.getId(), rootLayout);
-                Renderer portalLayoutRenderer = this.portalService.getRenderer( this.portalService.getLayoutFactory().getRendererName(l));
+                Renderer portalLayoutRenderer = l.getRenderer();
                 try {
                     portalLayoutRenderer.toSAX(l, this.portalService, ch);
                 } catch (LayoutException e) {
@@ -209,7 +209,7 @@
             }
 
             try {
-                final Renderer portalLayoutRenderer = this.portalService.getRenderer( this.portalService.getLayoutFactory().getRendererName(portalLayout));
+                final Renderer portalLayoutRenderer = portalLayout.getRenderer();
 
                 portalLayoutRenderer.toSAX(portalLayout, this.portalService, ch);
             } catch (LayoutException e) {

Added: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/NewDefaultLayoutFactory.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/NewDefaultLayoutFactory.java?rev=599229&view=auto
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/NewDefaultLayoutFactory.java (added)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/NewDefaultLayoutFactory.java Wed Nov 28 16:51:48 2007
@@ -0,0 +1,179 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.services.impl;
+
+import java.lang.reflect.Constructor;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+
+import org.apache.cocoon.portal.event.Receiver;
+import org.apache.cocoon.portal.event.layout.LayoutAddedEvent;
+import org.apache.cocoon.portal.event.layout.LayoutInstanceAddedEvent;
+import org.apache.cocoon.portal.event.layout.LayoutRemovedEvent;
+import org.apache.cocoon.portal.event.layout.RemoveLayoutEvent;
+import org.apache.cocoon.portal.om.CompositeLayout;
+import org.apache.cocoon.portal.om.CopletInstance;
+import org.apache.cocoon.portal.om.CopletLayout;
+import org.apache.cocoon.portal.om.Item;
+import org.apache.cocoon.portal.om.Layout;
+import org.apache.cocoon.portal.om.LayoutException;
+import org.apache.cocoon.portal.om.LayoutInstance;
+import org.apache.cocoon.portal.om.LayoutType;
+import org.apache.cocoon.portal.profile.ProfileManager;
+import org.apache.cocoon.portal.services.CopletFactory;
+import org.apache.cocoon.portal.services.LayoutFactory;
+import org.apache.cocoon.portal.util.AbstractBean;
+import org.apache.cocoon.util.ClassUtils;
+
+/**
+ * Default implementation of the layout factory.
+ *
+ * @version $Id$
+ */
+public class NewDefaultLayoutFactory
+	extends AbstractBean
+    implements LayoutFactory, Receiver {
+
+    /** All configured layout types. */
+    protected Map layoutTypes = Collections.EMPTY_MAP;
+
+    protected static long idCounter = System.currentTimeMillis();
+
+    public void setLayoutTypesMap(final Map typesMap) {
+        if ( typesMap != null ) {
+            this.layoutTypes = typesMap;
+        } else {
+            this.layoutTypes = Collections.EMPTY_MAP;
+        }
+    }
+
+    /**
+     * @see org.apache.cocoon.portal.services.LayoutFactory#newInstance(java.lang.String)
+     */
+    public Layout newInstance(String layoutTypeName)
+    throws LayoutException {
+        return this.newInstance(layoutTypeName, null);
+    }
+
+    /**
+     * @see org.apache.cocoon.portal.services.LayoutFactory#newInstance(java.lang.String, java.lang.String)
+     */
+    public Layout newInstance(String layoutTypeName, String id)
+    throws LayoutException {
+        final LayoutType layoutType = (LayoutType)this.layoutTypes.get( layoutTypeName );
+
+        if ( layoutType == null ) {
+            throw new LayoutException("Layout type '" + layoutTypeName + "' not found.");
+        }
+
+        String layoutId = id;
+        if ( layoutType.createId() && layoutId == null ) {
+            synchronized (this) {
+                layoutId = layoutTypeName + '_' + idCounter;
+                idCounter += 1;
+            }
+        }
+        Layout layout = null;
+        try {
+            Class clazz = ClassUtils.loadClass( layoutType.getClassName() );
+            Constructor constructor = clazz.getConstructor(new Class[] {String.class, String.class});
+            layout = (Layout)constructor.newInstance(new Object[] {layoutId, layoutType});
+        } catch (Exception e) {
+            throw new LayoutException("Unable to create new layout instance for: " + layoutType , e );
+        }
+
+        layout.setIsStatic( layoutType.defaultIsStatic() );
+
+        this.portalService.getEventManager().send(new LayoutAddedEvent(layout));
+
+        return layout;
+    }
+
+    /**
+     * Inform this bean about a remove layout event.
+     * @param event The remove layout event
+     * @see Receiver
+     */
+    public void inform(RemoveLayoutEvent event) {
+        this.remove( event.getTarget() );
+    }
+
+    /**
+     * @see org.apache.cocoon.portal.services.LayoutFactory#remove(org.apache.cocoon.portal.om.Layout)
+     */
+    public void remove(Layout layout) {
+        if ( layout != null ) {
+            if ( layout instanceof CompositeLayout ) {
+                final CompositeLayout cl = (CompositeLayout)layout;
+                while ( cl.getItems().size() > 0 ) {
+                    final Item i = cl.getItem(0);
+                    this.remove( i.getLayout() );
+                }
+            }
+            final ProfileManager profileManager = this.portalService.getProfileManager();
+
+            if ( layout instanceof CopletLayout ) {
+                final CopletFactory copletFactory = this.portalService.getCopletFactory();
+                final String copletId = ((CopletLayout)layout).getCopletInstanceId();
+                if ( copletId != null ) {
+                    final CopletInstance instance = profileManager.getCopletInstance(copletId);
+                    copletFactory.remove( instance );
+                }
+            }
+
+            Item parent = layout.getParent();
+            if ( parent != null && parent.getParent() != null) {
+                parent.getParent().removeItem( parent );
+            }
+
+            this.portalService.getEventManager().send(new LayoutRemovedEvent(layout));
+        }
+    }
+
+    /**
+     * @see org.apache.cocoon.portal.services.LayoutFactory#getLayoutTypes()
+     */
+    public Collection getLayoutTypes() {
+        return this.layoutTypes.keySet();
+    }
+
+    /**
+     * @see org.apache.cocoon.portal.services.LayoutFactory#createItem(org.apache.cocoon.portal.om.Layout)
+     */
+    public Item createItem(Layout layout)
+    throws LayoutException {
+        if ( layout.getLayoutType().getItemClassName() == null ) {
+            return new Item();
+        }
+        try {
+            return (Item) ClassUtils.newInstance( layout.getLayoutType().getItemClassName());
+        } catch (Exception e ) {
+            throw new LayoutException("Unable to create new item for layout " + layout, e);
+        }
+    }
+
+    /**
+     * @see org.apache.cocoon.portal.services.LayoutFactory#newInstance(org.apache.cocoon.portal.om.Layout)
+     */
+    public LayoutInstance newInstance(Layout layout) {
+        final LayoutInstance instance = new LayoutInstance(layout);
+        this.portalService.getEventManager().send(new LayoutInstanceAddedEvent(instance));
+        return instance;
+    }
+
+}

Propchange: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/NewDefaultLayoutFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/NewDefaultLayoutFactory.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/source/LayoutSource.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/source/LayoutSource.java?rev=599229&r1=599228&r2=599229&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/source/LayoutSource.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/source/LayoutSource.java Wed Nov 28 16:51:48 2007
@@ -41,7 +41,7 @@
  *
  * @version $Id$
  */
-public class LayoutSource 
+public class LayoutSource
     implements Source, XMLizable {
 
     protected final ServiceManager manager;
@@ -103,7 +103,7 @@
 	 * @see org.apache.excalibur.source.Source#refresh()
 	 */
 	public void refresh() {
-        // nothing to do 
+        // nothing to do
 	}
 
 	/**
@@ -130,9 +130,9 @@
 	/**
 	 * @see org.apache.excalibur.xml.sax.XMLizable#toSAX(ContentHandler)
 	 */
-	public void toSAX(ContentHandler handler) 
+	public void toSAX(ContentHandler handler)
     throws SAXException {
-        Renderer portalLayoutRenderer = this.portalService.getRenderer( this.portalService.getLayoutFactory().getRendererName(this.layout));
+        Renderer portalLayoutRenderer = this.layout.getRenderer();
 
         handler.startDocument();
         try {

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/TestProfileManager.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/TestProfileManager.java?rev=599229&r1=599228&r2=599229&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/TestProfileManager.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/TestProfileManager.java Wed Nov 28 16:51:48 2007
@@ -79,7 +79,7 @@
                 profile.setCopletDefinitions( this.getGlobalCopletDefinitions( user, profile ) );
 
                 // create root layout
-                CompositeLayout rootLayout = new CompositeLayout("root", "row");
+                CompositeLayout rootLayout = (CompositeLayout) this.portalService.getLayoutFactory().newInstance("row", "root");
 
                 // create coplet instances and layouts
                 final List instances = new ArrayList();
@@ -93,7 +93,7 @@
                         cid.setCopletDefinition(cd);
                         instances.add(cid);
                         if ( portletNames.size() == 0 || portletNames.contains(cd.getId())) {
-                            final CopletLayout copletLayout = new CopletLayout(null, "coplet");
+                            final CopletLayout copletLayout = (CopletLayout) this.portalService.getLayoutFactory().newInstance("coplet");
                             copletLayout.setCopletInstanceId(cid.getId());
                             final Item item = new Item();
                             item.setLayout(copletLayout);
@@ -142,13 +142,13 @@
                     while ( i.hasNext() ) {
                         final CopletInstance cid = (CopletInstance)i.next();
                         if ( portletNames.contains(cid.getCopletDefinition().getId())) {
-                            final CopletLayout copletLayout = new CopletLayout(null, "coplet");
-                            copletLayout.setCopletInstanceId(cid.getId());
-                            final Item item = new Item();
-                            item.setLayout(copletLayout);
-                            rootLayout.addItem(item);
                             try {
-                                 this.prepareObject(this.getUserProfile(), copletLayout);
+                                final CopletLayout copletLayout = (CopletLayout) this.portalService.getLayoutFactory().newInstance("coplet");
+                                copletLayout.setCopletInstanceId(cid.getId());
+                                final Item item = new Item();
+                                item.setLayout(copletLayout);
+                                rootLayout.addItem(item);
+                                this.prepareObject(this.getUserProfile(), copletLayout);
                             } catch (LayoutException le) {
                                 // ignore this
                             }

Added: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/coplet-types.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/coplet-types.xml?rev=599229&view=auto
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/coplet-types.xml (added)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/coplet-types.xml Wed Nov 28 16:51:48 2007
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You 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.
+-->
+<!--+
+    | This is a sample configuration for layout types.
+    |
+    | @version $Id$
+    +-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:portal="http://cocoon.apache.org/schema/portal"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+                           http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
+                           http://cocoon.apache.org/schema/portal http://cocoon.apache.org/schema/portal/cocoon-portal-1.0.xsd">
+
+    <bean name="org.apache.cocoon.portal.om.CopletType/URICoplet"
+          class="org.apache.cocoon.portal.om.CopletType">
+      <constructor-arg value="URICoplet"/>
+      <property name="copletAdapterName" value="cocoon"/>
+    </bean>
+
+    <bean name="org.apache.cocoon.portal.om.CopletType/Portlet"
+          class="org.apache.cocoon.portal.om.CopletType">
+      <constructor-arg value="Portlet"/>
+      <property name="copletAdapterName" value="portlet"/>
+<!-- TODO Configuration
+      <property name="configuration">
+        <map>
+          <entry key="buffer" value="true"/>
+          <entry key="full-screen" value="false"/>
+          <entry key="handle-sizing" value="true"/>
+        </map>
+      </property>
+ -->
+    </bean>
+<!-- 
+    <bean name="org.apache.cocoon.portal.om.CopletType/WSRP"
+          class="org.apache.cocoon.portal.om.CopletType">
+      <constructor-arg value="WSRP"/>
+      <property name="copletAdapterName" value="wsrp"/>
+      <property name="configuration">
+        <map>
+          <entry key="buffer" value="true"/>
+        </map>
+      </property>
+    </bean>
+ -->
+</beans>
\ No newline at end of file

Propchange: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/coplet-types.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/coplet-types.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/layout-types.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/layout-types.xml?rev=599229&r1=599228&r2=599229&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/layout-types.xml (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/spring/layout-types.xml Wed Nov 28 16:51:48 2007
@@ -27,99 +27,91 @@
                            http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
                            http://cocoon.apache.org/schema/portal http://cocoon.apache.org/schema/portal/cocoon-portal-1.0.xsd">
 
-    <bean name="org.apache.cocoon.portal.om.LayoutType/column"
+    <bean name="org.apache.cocoon.portal.om.LayoutType.column"
           class="org.apache.cocoon.portal.om.LayoutType">
       <property name="className" value="org.apache.cocoon.portal.om.CompositeLayout"/>
-      <property name="defaultRendererName" value="column"/>
-      <property name="rendererNames">
+      <property name="renderers">
         <list>
-          <value>column</value>
+          <ref bean="org.apache.cocoon.portal.layout.renderer.Renderer.column"/>
         </list>
       </property>
     </bean>
 
-    <bean name="org.apache.cocoon.portal.om.LayoutType/row"
+    <bean name="org.apache.cocoon.portal.om.LayoutType.row"
           class="org.apache.cocoon.portal.om.LayoutType">
       <property name="className" value="org.apache.cocoon.portal.om.CompositeLayout"/>
-      <property name="defaultRendererName" value="row"/>
-      <property name="rendererNames">
+      <property name="renderers">
         <list>
-          <value>row</value>
+          <ref bean="org.apache.cocoon.portal.layout.renderer.Renderer.row"/>
         </list>
       </property>
     </bean>
 
-    <bean name="org.apache.cocoon.portal.om.LayoutType/tab"
+    <bean name="org.apache.cocoon.portal.om.LayoutType.tab"
           class="org.apache.cocoon.portal.om.LayoutType">
       <property name="className" value="org.apache.cocoon.portal.om.CompositeLayout"/>
       <property name="itemClassName" value="org.apache.cocoon.portal.om.NamedItem"/>
-      <property name="defaultRendererName" value="tab"/>
       <property name="defaultIsStatic" value="true"/>
-      <property name="rendererNames">
+      <property name="renderers">
         <list>
-          <value>tab</value>
+          <ref bean="org.apache.cocoon.portal.layout.renderer.Renderer.tab"/>
         </list>
       </property>
     </bean>
 
-    <bean name="org.apache.cocoon.portal.om.LayoutType/rawtab"
+    <bean name="org.apache.cocoon.portal.om.LayoutType.rawtab"
           class="org.apache.cocoon.portal.om.LayoutType">
       <property name="className" value="org.apache.cocoon.portal.om.CompositeLayout"/>
       <property name="itemClassName" value="org.apache.cocoon.portal.om.NamedItem"/>
-      <property name="defaultRendererName" value="rawtab"/>
-      <property name="rendererNames">
+      <property name="renderers">
         <list>
-          <value>rawtab</value>
+          <ref bean="org.apache.cocoon.portal.layout.renderer.Renderer.rawtab"/>
         </list>
       </property>
     </bean>
 
-    <bean name="org.apache.cocoon.portal.om.LayoutType/linktab"
+    <bean name="org.apache.cocoon.portal.om.LayoutType.linktab"
           class="org.apache.cocoon.portal.om.LayoutType">
       <property name="className" value="org.apache.cocoon.portal.om.CompositeLayout"/>
       <property name="itemClassName" value="org.apache.cocoon.portal.om.NamedItem"/>
-      <property name="defaultRendererName" value="linktab"/>
       <property name="defaultIsStatic" value="true"/>
-      <property name="rendererNames">
+      <property name="renderers">
         <list>
-          <value>linktab</value>
+          <ref bean="org.apache.cocoon.portal.layout.renderer.Renderer.linktab"/>
         </list>
       </property>
     </bean>
 
-    <bean name="org.apache.cocoon.portal.om.LayoutType/frame"
+    <bean name="org.apache.cocoon.portal.om.LayoutType.frame"
           class="org.apache.cocoon.portal.om.LayoutType">
       <property name="className" value="org.apache.cocoon.portal.om.FrameLayout"/>
-      <property name="defaultRendererName" value="frame"/>
       <property name="createId" value="true"/>
-      <property name="rendererNames">
+      <property name="renderers">
         <list>
-          <value>frame</value>
+          <ref bean="org.apache.cocoon.portal.layout.renderer.Renderer.frame"/>
         </list>
       </property>
     </bean>
 
-    <bean name="org.apache.cocoon.portal.om.LayoutType/coplet"
+    <bean name="org.apache.cocoon.portal.om.LayoutType.coplet"
           class="org.apache.cocoon.portal.om.LayoutType">
       <property name="className" value="org.apache.cocoon.portal.om.CopletLayout"/>
-      <property name="defaultRendererName" value="window"/>
-      <property name="rendererNames">
+      <property name="renderers">
         <list>
-          <value>window</value>
-          <value>nowindow</value>
-          <value>borderless-window</value>
+          <ref bean="org.apache.cocoon.portal.layout.renderer.Renderer.window"/>
+          <ref bean="org.apache.cocoon.portal.layout.renderer.Renderer.nowindow"/>
+          <ref bean="org.apache.cocoon.portal.layout.renderer.Renderer.borderless-window"/>
         </list>
       </property>
     </bean>
 
-    <bean name="org.apache.cocoon.portal.om.LayoutType/link"
+    <bean name="org.apache.cocoon.portal.om.LayoutType.link"
           class="org.apache.cocoon.portal.om.LayoutType">
       <property name="className" value="org.apache.cocoon.portal.om.LinkLayout"/>
-      <property name="defaultRendererName" value="link"/>
       <property name="createId" value="true"/>
-      <property name="rendererNames">
+      <property name="renderers">
         <list>
-          <value>link</value>
+          <ref bean="org.apache.cocoon.portal.layout.renderer.Renderer.link"/>
         </list>
       </property>
     </bean>

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/profiles/coplettype/portal.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/profiles/coplettype/portal.xml?rev=599229&r1=599228&r2=599229&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/profiles/coplettype/portal.xml (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/profiles/coplettype/portal.xml Wed Nov 28 16:51:48 2007
@@ -21,7 +21,7 @@
    <coplet-type id="URICoplet">
       <coplet-adapter>cocoon</coplet-adapter>
    </coplet-type>
-<!-- 
+
    <coplet-type id="Portlet">
       <coplet-adapter>portlet</coplet-adapter>
       <configuration>
@@ -37,7 +37,7 @@
         <value xsi:type="java:java.lang.Boolean">true</value>
       </configuration>
    </coplet-type>
-
+<!-- 
    <coplet-type id="WSRP">
       <coplet-adapter>wsrp</coplet-adapter>
       <configuration>



Mime
View raw message