cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r425807 - in /cocoon/trunk/blocks/cocoon-portal: cocoon-portal-impl/ cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/ cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/ cocoon-portal-impl/src/main/jav...
Date Wed, 26 Jul 2006 19:07:57 GMT
Author: cziegeler
Date: Wed Jul 26 12:07:55 2006
New Revision: 425807

URL: http://svn.apache.org/viewvc?rev=425807&view=rev
Log:
Clean up, finish simplification of window renderer configuration

Added:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/wsrp-config.xml
      - copied unchanged from r425466, cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/profiles/wsrp-config.xml
Removed:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/SizingAspect.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/adapter/PortletWindowAspect.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/profiles/wsrp-config.xml
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/META-INF/
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-wsrp-impl/src/main/java/org/apache/cocoon/portal/wsrp/adapter/WSRPPortletWindowAspect.java
Modified:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/CopletDataFeatures.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/DecorationAction.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/WindowAspect.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/resources/org/apache/cocoon/portal/portal.roles
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/status.xml
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/DynamicInformationProviderImpl.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/DynamicTitleServiceImpl.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/adapter/PortletAdapter.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/resources/org/apache/cocoon/portal/pluto/portal-pluto.roles
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/pom.xml
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/xconf/cocoon-portal-sample.xconf
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/profiles/copletbasedata/portal.xml
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/skins/modern/styles/window.xsl
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-wsrp-impl/src/main/java/org/apache/cocoon/portal/wsrp/adapter/WSRPAdapter.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-wsrp-impl/src/main/resources/org/apache/cocoon/portal/wsrp/portal-wsrp.roles

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/CopletDataFeatures.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/CopletDataFeatures.java?rev=425807&r1=425806&r2=425807&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/CopletDataFeatures.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/CopletDataFeatures.java Wed Jul 26 12:07:55 2006
@@ -46,7 +46,10 @@
     public static Object getAttributeValue(CopletData data, String key, Object defaultValue) {
         Object value = data.getAttribute(key);
         if ( value == null ) {
-            value = defaultValue;
+            value = data.getCopletBaseData().getCopletConfig(key);
+            if ( value == null ) {
+                value = defaultValue;
+            }
         }
         return value;
     }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/DecorationAction.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/DecorationAction.java?rev=425807&r1=425806&r2=425807&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/DecorationAction.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/DecorationAction.java Wed Jul 26 12:07:55 2006
@@ -20,6 +20,11 @@
  */
 public final class DecorationAction {
 
+    public static final String WINDOW_STATE_NORMAL = "normal-uri";
+    public static final String WINDOW_STATE_MINIMIZED = "minimized-uri";
+    public static final String WINDOW_STATE_MAXIMIZED = "maximized-uri";
+    public static final String WINDOW_STATE_FULLSCREEN = "fullscreen-uri";
+
     protected String name;
     protected String url;
 

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/WindowAspect.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/WindowAspect.java?rev=425807&r1=425806&r2=425807&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/WindowAspect.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/WindowAspect.java Wed Jul 26 12:07:55 2006
@@ -15,13 +15,23 @@
  */
 package org.apache.cocoon.portal.layout.renderer.aspect.impl;
 
+import java.util.Iterator;
+import java.util.List;
+
 import org.apache.avalon.framework.parameters.ParameterException;
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.cocoon.portal.PortalService;
+import org.apache.cocoon.portal.coplet.CopletDataFeatures;
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
+import org.apache.cocoon.portal.coplet.CopletInstanceDataFeatures;
 import org.apache.cocoon.portal.coplet.adapter.CopletAdapter;
 import org.apache.cocoon.portal.coplet.adapter.CopletDecorationProvider;
+import org.apache.cocoon.portal.coplet.adapter.DecorationAction;
+import org.apache.cocoon.portal.event.Event;
+import org.apache.cocoon.portal.event.coplet.CopletInstanceSizingEvent;
+import org.apache.cocoon.portal.event.layout.LayoutRemoveEvent;
 import org.apache.cocoon.portal.layout.Layout;
+import org.apache.cocoon.portal.layout.LayoutFeatures;
 import org.apache.cocoon.portal.layout.impl.CopletLayout;
 import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
 import org.apache.cocoon.xml.XMLUtils;
@@ -29,12 +39,16 @@
 import org.xml.sax.SAXException;
 
 /**
- * Create a title tag for a coplet as well as an optional enclosing tag.
+ * Create all relevant tags for generation the coplet window.
+ * This includes the title and the window states.
+ * An optional enclosing tag
  *
  * <h2>Example XML:</h2>
  * <pre>
  *  &lt;window&gt;
- *    &lt;title&gt;title&lt;/title&gt;
+ *    &lt;title&gt;Simply the best&lt;/title&gt;
+ *    &lt;instance-id&gt;my_beautiful_coplet&lt;/instance-id&gt;
+ *    &lt;size&gt;normal&lt;/size&gt;
  *  &lt;/window&gt;
  * </pre>
  *
@@ -45,16 +59,47 @@
  *
  * <h2>Parameters</h2>
  * <table><tbody>
- *   <tr><th>root-tag</th><td>Should a tag enclosing the following output be generated?</td>
- *      <td></td><td>boolean</td><td><code>true</code></td></tr>
- *   <tr><th>tag-name</th><td>Name of tag enclosing follwoing output if requested.</td>
- *      <td></td><td>String</td><td><code>"window"</code></td></tr>
+ *   <tr>
+ *     <th>root-tag</th>
+ *     <td>Should a tag enclosing the following output be generated?</td>
+ *     <td></td>
+ *     <td>boolean</td>
+ *     <td><code>true</code></td>
+ *   </tr>
+ *   <tr>
+ *     <th>tag-name</th>
+ *     <td>Name of tag enclosing follwoing output if requested.</td>
+ *     <td></td>
+ *     <td>String</td>
+ *     <td><code>"window"</code></td>
+ *   </tr>
  * </tbody></table>
  *
  * @version $Id$
  */
 public final class WindowAspect extends AbstractAspect {
 
+    public static final String SIZE_TAG = "size";
+
+    public static final String INSTANCE_ID_TAG = "instance-id";
+
+    public static final String TITLE_TAG = "title";
+
+    /** Is full-screen enabled? */
+    protected boolean enableFullScreen;
+
+    /** Is maximized enabled? */
+    protected boolean enableMaximized;
+
+    /**
+     * @see org.apache.avalon.framework.activity.Initializable#initialize()
+     */
+    public void initialize() throws Exception {
+        super.initialize();
+        this.enableFullScreen = this.portalService.getConfigurationAsBoolean(PortalService.CONFIGURATION_FULL_SCREEN_ENABLED, true);
+        this.enableMaximized = this.portalService.getConfigurationAsBoolean(PortalService.CONFIGURATION_MAXIMIZED_ENABLED, true);
+    }
+
     /**
      * @see org.apache.cocoon.portal.layout.renderer.aspect.RendererAspect#toSAX(org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext, org.apache.cocoon.portal.layout.Layout, org.apache.cocoon.portal.PortalService, org.xml.sax.ContentHandler)
      */
@@ -70,21 +115,143 @@
             XMLUtils.startElement(contenthandler, config.tagName);
         }
         final CopletAdapter adapter = service.getCopletAdapter(copletInstanceData.getCopletData().getCopletBaseData().getCopletAdapterName());
+
+        // stream some general infos about the copet instance data
+        this.streamCopletInstanceDataInfos(copletInstanceData, adapter, layout, contenthandler);
+        
+        // stream the title
+        this.streamTitle(copletInstanceData, adapter, layout, contenthandler);
+
+        // stream portlet modes if the coplet type supports this
+        this.streamCopletModes(copletInstanceData, adapter, layout, contenthandler);
+
+        // stream remove button
+        this.streamRemoveButton(copletInstanceData, adapter, layout, contenthandler);
+
+        // stream the window states and determine if we should invoke the next aspect
+        boolean invokeNext = this.streamWindowStates(copletInstanceData, adapter, layout, contenthandler);
+        if ( invokeNext ) {
+            context.invokeNext( layout, service, contenthandler );
+        }
+
+        if ( config.rootTag ) {
+            XMLUtils.endElement(contenthandler, config.tagName);
+        }
+    }
+
+    protected void streamCopletInstanceDataInfos(CopletInstanceData cid,
+                                                 CopletAdapter      adapter,
+                                                 Layout             layout,
+                                                 ContentHandler     contenthandler)
+    throws SAXException {
+        XMLUtils.createElement(contenthandler, WindowAspect.INSTANCE_ID_TAG, cid.getId());
+    }
+
+    protected void streamTitle(CopletInstanceData cid,
+                               CopletAdapter      adapter,
+                               Layout             layout,
+                               ContentHandler     contenthandler)
+    throws SAXException {
         String title = null;
         if ( adapter instanceof CopletDecorationProvider ) {
-            title = ((CopletDecorationProvider)adapter).getTitle(copletInstanceData);
+            title = ((CopletDecorationProvider)adapter).getTitle(cid);
         }
         if ( title == null ) {
-            title = copletInstanceData.getTitle();
+            title = cid.getTitle();
         }
-        XMLUtils.createElement(contenthandler, "title", title);
-        XMLUtils.createElement(contenthandler, "instance-id", copletInstanceData.getId());
+        XMLUtils.createElement(contenthandler, WindowAspect.TITLE_TAG, title);
+    }
 
-        context.invokeNext( layout, service, contenthandler );
+    protected void streamCopletModes(CopletInstanceData cid,
+                                     CopletAdapter      adapter,
+                                     Layout             layout,
+                                     ContentHandler     contenthandler)
+    throws SAXException {
+        // Does the coplet type provide the window states for us?
+        if ( adapter instanceof CopletDecorationProvider ) {
+            List windowStates = ((CopletDecorationProvider)adapter).getPossibleCopletModes(cid);
+            final Iterator i = windowStates.iterator();
+            while ( i.hasNext() ) {
+                final DecorationAction action = (DecorationAction)i.next();
+                XMLUtils.createElement(contenthandler, action.getName(), action.getUrl());
+            }
+        }
+    }
 
-        if ( config.rootTag ) {
-            XMLUtils.endElement(contenthandler, config.tagName);
+    protected void streamRemoveButton(CopletInstanceData cid,
+                                      CopletAdapter      adapter,
+                                      Layout             layout,
+                                      ContentHandler     contenthandler)
+    throws SAXException {
+        boolean mandatory = CopletDataFeatures.isMandatory(cid.getCopletData());
+        if ( !mandatory ) {
+            LayoutRemoveEvent lre = new LayoutRemoveEvent(layout);
+            XMLUtils.createElement(contenthandler, "remove-uri", this.portalService.getLinkService().getLinkURI(lre));
+        }
+    }
+
+    protected boolean streamWindowStates(CopletInstanceData cid,
+                                         CopletAdapter      adapter,
+                                         Layout             layout,
+                                         ContentHandler     contenthandler)
+    throws SAXException {
+        boolean showContent = true;
+
+        final boolean sizable = CopletDataFeatures.isSizable(cid.getCopletData());
+
+        if ( sizable ) {
+            int size = cid.getSize();
+
+            // stream out the current size
+            XMLUtils.createElement(contenthandler, WindowAspect.SIZE_TAG, CopletInstanceDataFeatures.sizeToString(size));
+
+            // Does the coplet type provide the window states for us?
+            if ( adapter instanceof CopletDecorationProvider ) {
+                List windowStates = ((CopletDecorationProvider)adapter).getPossibleWindowStates(cid);
+                final Iterator i = windowStates.iterator();
+                while ( i.hasNext() ) {
+                    final DecorationAction action = (DecorationAction)i.next();
+                    XMLUtils.createElement(contenthandler, action.getName(), action.getUrl());
+                }
+            } else {
+                Event event;
+
+                if ( size != CopletInstanceData.SIZE_MINIMIZED ) {
+                    event = new CopletInstanceSizingEvent(cid, CopletInstanceData.SIZE_MINIMIZED);
+                    XMLUtils.createElement(contenthandler, DecorationAction.WINDOW_STATE_MINIMIZED, this.portalService.getLinkService().getLinkURI(event));
+                }
+                if ( size != CopletInstanceData.SIZE_NORMAL) {
+                    event = new CopletInstanceSizingEvent(cid, CopletInstanceData.SIZE_NORMAL);
+                    XMLUtils.createElement(contenthandler, DecorationAction.WINDOW_STATE_NORMAL, this.portalService.getLinkService().getLinkURI(event));
+                }
+                if ( this.enableMaximized ) {
+                    if ( size != CopletInstanceData.SIZE_MAXIMIZED ) {
+                        event = new CopletInstanceSizingEvent(cid, CopletInstanceData.SIZE_MAXIMIZED);
+                        XMLUtils.createElement(contenthandler, DecorationAction.WINDOW_STATE_MAXIMIZED, this.portalService.getLinkService().getLinkURI(event));
+                    }
+                }
+
+                if ( this.enableFullScreen ) {
+                    boolean supportsFullScreen = CopletDataFeatures.supportsFullScreenMode(cid.getCopletData());
+                    if ( supportsFullScreen ) {
+                        final Layout rootLayout = this.portalService.getProfileManager().getPortalLayout(null, null);
+                        final Layout fullScreenLayout = LayoutFeatures.getFullScreenInfo(rootLayout);
+                        if ( fullScreenLayout != null && fullScreenLayout.equals( layout )) {
+                            event = new CopletInstanceSizingEvent( cid, CopletInstanceData.SIZE_NORMAL );
+                            XMLUtils.createElement(contenthandler, DecorationAction.WINDOW_STATE_NORMAL, this.portalService.getLinkService().getLinkURI(event));
+                        } else {
+                            event = new CopletInstanceSizingEvent( cid, CopletInstanceData.SIZE_FULLSCREEN );
+                            XMLUtils.createElement(contenthandler, DecorationAction.WINDOW_STATE_FULLSCREEN, this.portalService.getLinkService().getLinkURI(event));
+                        }
+                    }
+                }
+            }
+            if (!CopletDataFeatures.handlesSizing(cid.getCopletData())
+                && size == CopletInstanceData.SIZE_MINIMIZED) {
+                showContent = false;
+            }
         }
+        return showContent;
     }
 
     protected static class PreparedConfiguration {

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/resources/org/apache/cocoon/portal/portal.roles
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/resources/org/apache/cocoon/portal/portal.roles?rev=425807&r1=425806&r2=425807&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/resources/org/apache/cocoon/portal/portal.roles (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/resources/org/apache/cocoon/portal/portal.roles Wed Jul 26 12:07:55 2006
@@ -81,12 +81,6 @@
           default-class="org.apache.cocoon.portal.layout.renderer.aspect.impl.WindowAspect"/>
 
     <!--+
-        | This aspect can be used to render the minimize/maximize buttons.
-        +-->
-    <role name="org.apache.cocoon.portal.layout.renderer.aspect.RendererAspect/coplet-sizing"
-          default-class="org.apache.cocoon.portal.layout.renderer.aspect.impl.SizingAspect"/>
-
-    <!--+
         | This aspect can be used to render the remove button.
         +-->
     <role name="org.apache.cocoon.portal.layout.renderer.aspect.RendererAspect/coplet-removing"

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/status.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/status.xml?rev=425807&r1=425806&r2=425807&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/status.xml (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/status.xml Wed Jul 26 12:07:55 2006
@@ -66,8 +66,13 @@
  <changes>
   <release version="@version@" date="@date@">
     <action dev="CZ" type="add">
+      Add Spring post processor to add all configured components implement the Receiver
+      interface as subscribers to the event manager. This simplifies component development
+      as the component itself does not need to register itself anymore.
+    </action>
+    <action dev="CZ" type="add">
       Add CopletDecorationProvider which provides the information for the
-      title bar of a coplet. A coplet adapter can optinally implement
+      title bar of a coplet. A coplet adapter can optionally implement
       this interface.
     </action>
     <action dev="CZ" type="add">
@@ -92,7 +97,7 @@
       Add AJAX support.
     </action>
     <action dev="CZ" type="add">
-      Make coplet adapters accessible from component manager.
+      Make coplet adapters accessible from portal component manager.
     </action>
     <action dev="CZ" type="add">
       Add layout source to stream complete coplets/layouts.

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/DynamicInformationProviderImpl.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/DynamicInformationProviderImpl.java?rev=425807&r1=425806&r2=425807&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/DynamicInformationProviderImpl.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/DynamicInformationProviderImpl.java Wed Jul 26 12:07:55 2006
@@ -24,6 +24,7 @@
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
+import org.apache.cocoon.portal.pluto.adapter.PortletAdapter;
 import org.apache.cocoon.portal.pluto.om.PortletEntityImpl;
 import org.apache.pluto.om.window.PortletWindow;
 import org.apache.pluto.services.information.DynamicInformationProvider;
@@ -91,7 +92,7 @@
      */
     public PortletMode getPortletMode(PortletWindow portletWindow) {
         final CopletInstanceData cid = ((PortletEntityImpl)portletWindow.getPortletEntity()).getCopletInstanceData();
-        final String pmString = (String)cid.getTemporaryAttribute("portlet-mode");
+        final String pmString = (String)cid.getTemporaryAttribute(PortletAdapter.PORTLET_MODE_ATTRIBUTE_NAME);
         if ( pmString == null ) {
             return PortletMode.VIEW;
         }
@@ -103,7 +104,7 @@
      */
     public WindowState getWindowState(PortletWindow portletWindow) {
         final CopletInstanceData cid = ((PortletEntityImpl)portletWindow.getPortletEntity()).getCopletInstanceData();
-        final String wsString = (String)cid.getTemporaryAttribute("window-state");
+        final String wsString = (String)cid.getTemporaryAttribute(PortletAdapter.WINDOW_STATE_ATTRIBUTE_NAME);
         if ( wsString == null ) {
             return WindowState.NORMAL;
         }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/DynamicTitleServiceImpl.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/DynamicTitleServiceImpl.java?rev=425807&r1=425806&r2=425807&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/DynamicTitleServiceImpl.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/DynamicTitleServiceImpl.java Wed Jul 26 12:07:55 2006
@@ -17,6 +17,7 @@
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.apache.cocoon.portal.pluto.adapter.PortletAdapter;
 import org.apache.cocoon.portal.pluto.om.PortletEntityImpl;
 import org.apache.pluto.om.window.PortletWindow;
 import org.apache.pluto.services.title.DynamicTitleService;
@@ -35,6 +36,6 @@
     public void setDynamicTitle(PortletWindow window,
                                 HttpServletRequest request,
                                 String dynamicTitle) {
-        ((PortletEntityImpl)window.getPortletEntity()).getCopletInstanceData().setTemporaryAttribute("dynamic-title", dynamicTitle);
+        ((PortletEntityImpl)window.getPortletEntity()).getCopletInstanceData().setTemporaryAttribute(PortletAdapter.DYNAMIC_TITLE_ATTRIBUTE_NAME, dynamicTitle);
     }                      
 }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java?rev=425807&r1=425806&r2=425807&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletActionProviderImpl.java Wed Jul 26 12:07:55 2006
@@ -25,6 +25,7 @@
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
 import org.apache.cocoon.portal.event.Event;
 import org.apache.cocoon.portal.event.coplet.CopletInstanceSizingEvent;
+import org.apache.cocoon.portal.pluto.adapter.PortletAdapter;
 import org.apache.cocoon.portal.pluto.om.PortletEntityImpl;
 import org.apache.pluto.om.window.PortletWindow;
 import org.apache.pluto.services.information.PortletActionProvider;
@@ -56,7 +57,7 @@
     public void changePortletMode(PortletMode mode) {
         if ( mode != null ) {
             final CopletInstanceData cid = ((PortletEntityImpl)portletWindow.getPortletEntity()).getCopletInstanceData();
-            cid.setTemporaryAttribute("portlet-mode", mode.toString());
+            cid.setTemporaryAttribute(PortletAdapter.PORTLET_MODE_ATTRIBUTE_NAME, mode.toString());
         }
     }
 
@@ -66,7 +67,7 @@
     public void changePortletWindowState(WindowState state) {
         if ( state != null ) {
             final CopletInstanceData cid = ((PortletEntityImpl)portletWindow.getPortletEntity()).getCopletInstanceData();
-            cid.setTemporaryAttribute("window-state", state.toString());
+            cid.setTemporaryAttribute(PortletAdapter.WINDOW_STATE_ATTRIBUTE_NAME, state.toString());
             int size = CopletInstanceData.SIZE_NORMAL;
             if ( state.equals(WindowState.MAXIMIZED) ) {
                 size = CopletInstanceData.SIZE_MAXIMIZED;

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java?rev=425807&r1=425806&r2=425807&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletURLProviderImpl.java Wed Jul 26 12:07:55 2006
@@ -31,6 +31,7 @@
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
 import org.apache.cocoon.portal.event.CopletInstanceEvent;
 import org.apache.cocoon.portal.event.ConvertableEvent;
+import org.apache.cocoon.portal.pluto.adapter.PortletAdapter;
 import org.apache.cocoon.portal.pluto.om.PortletEntityImpl;
 import org.apache.cocoon.portal.pluto.om.PortletWindowImpl;
 import org.apache.pluto.om.window.PortletWindow;
@@ -97,7 +98,7 @@
         String copletId = urlConverter.getPortletId();
         CopletInstanceData cid = service.getProfileManager()
             .getCopletInstanceData(copletId);
-        this.portletWindow = (PortletWindow)cid.getTemporaryAttribute("window");
+        this.portletWindow = (PortletWindow)cid.getTemporaryAttribute(PortletAdapter.PORTLET_WINDOW_ATTRIBUTE_NAME);
         this.mode = urlConverter.getMode();
         this.state = urlConverter.getState();
         this.action = urlConverter.isAction();

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/adapter/PortletAdapter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/adapter/PortletAdapter.java?rev=425807&r1=425806&r2=425807&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/adapter/PortletAdapter.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/adapter/PortletAdapter.java Wed Jul 26 12:07:55 2006
@@ -37,11 +37,13 @@
 import org.apache.cocoon.portal.PortalManagerAspectPrepareContext;
 import org.apache.cocoon.portal.PortalManagerAspectRenderContext;
 import org.apache.cocoon.portal.PortalService;
+import org.apache.cocoon.portal.coplet.CopletDataFeatures;
 import org.apache.cocoon.portal.coplet.CopletInstanceData;
 import org.apache.cocoon.portal.coplet.adapter.CopletDecorationProvider;
 import org.apache.cocoon.portal.coplet.adapter.DecorationAction;
 import org.apache.cocoon.portal.coplet.adapter.impl.AbstractCopletAdapter;
 import org.apache.cocoon.portal.event.Receiver;
+import org.apache.cocoon.portal.event.coplet.CopletInstanceSizingEvent;
 import org.apache.cocoon.portal.pluto.PortletActionProviderImpl;
 import org.apache.cocoon.portal.pluto.PortletContainerEnvironmentImpl;
 import org.apache.cocoon.portal.pluto.PortletURLProviderImpl;
@@ -81,6 +83,21 @@
     extends AbstractCopletAdapter
     implements PortalManagerAspect, CopletDecorationProvider, Receiver, Parameterizable {
 
+    /** Name of the coplet instance data attribute holding the portlet window. */
+    public static final String PORTLET_WINDOW_ATTRIBUTE_NAME = PortletAdapter.class.getName() + "/window";
+
+    /** Name of the coplet instance data attribute holding the dynamic title (if any). */
+    public static final String DYNAMIC_TITLE_ATTRIBUTE_NAME = PortletAdapter.class.getName() + "/dynamic-title";
+
+    /** Name of the coplet instance data attribute holding the window state. */
+    public static final String WINDOW_STATE_ATTRIBUTE_NAME = PortletAdapter.class.getName() + "/window-state";
+
+    /** Name of the coplet instance data attribute holding the portlet mode. */
+    public static final String PORTLET_MODE_ATTRIBUTE_NAME = PortletAdapter.class.getName() + "/portlet-mode";
+
+    /** Name of the portlet mode for full screen (if supported). */
+    public static final String FULL_SCREEN_WINDOW_STATE_ATTRIBUTE_NAME = "full-screen-mode";
+
     /** The Portlet Container. */
     protected PortletContainer portletContainer;
 
@@ -90,6 +107,12 @@
     /** The configuration. */
     protected Parameters parameters;
 
+    /** Is full-screen enabled? */
+    protected boolean enableFullScreen;
+
+    /** Is maximized enabled? */
+    protected boolean enableMaximized;
+
     /**
      * @see org.apache.avalon.framework.parameters.Parameterizable#parameterize(org.apache.avalon.framework.parameters.Parameters)
      */
@@ -123,7 +146,7 @@
             ((PortletWindowCtrl)portletWindow).setPortletEntity(portletEntity);
             PortletWindowList windowList = portletEntity.getPortletWindowList();        
             ((PortletWindowListCtrl)windowList).add(portletWindow);    
-            coplet.setTemporaryAttribute("window", portletWindow);
+            coplet.setTemporaryAttribute(PORTLET_WINDOW_ATTRIBUTE_NAME, portletWindow);
 
             // load the portlet
             final Map objectModel = ContextHelper.getObjectModel(this.context);
@@ -141,7 +164,7 @@
             } catch (Exception e) {
                 this.getLogger().error("Error loading portlet " + portletEntityId + " for instance " + coplet.getId(), e);
                 // remove portlet entity
-                coplet.removeTemporaryAttribute("window");
+                coplet.removeTemporaryAttribute(PORTLET_WINDOW_ATTRIBUTE_NAME);
                 ((PortletEntityListImpl)pae.getPortletEntityList()).remove(portletEntity);
             }
         } else {
@@ -161,7 +184,7 @@
         try {
             final String portletEntityId = (String) getConfiguration(coplet, "portlet");
             // get the window
-            final PortletWindow window = (PortletWindow)coplet.getTemporaryAttribute("window");
+            final PortletWindow window = (PortletWindow)coplet.getTemporaryAttribute(PORTLET_WINDOW_ATTRIBUTE_NAME);
             if ( window == null ) {
                 throw new SAXException("Portlet couldn't be loaded: " + coplet.getId() + "(" + portletEntityId + ")");
             }
@@ -203,9 +226,9 @@
         if ( this.portletContainer == null ) {
             return;
         }
-        PortletWindow window = (PortletWindow)coplet.getTemporaryAttribute("window");
+        PortletWindow window = (PortletWindow)coplet.getTemporaryAttribute(PORTLET_WINDOW_ATTRIBUTE_NAME);
         if ( window != null ) {
-            coplet.removeTemporaryAttribute("window");
+            coplet.removeTemporaryAttribute(PORTLET_WINDOW_ATTRIBUTE_NAME);
             PortletDefinitionRegistry registry = (PortletDefinitionRegistry) portletContainerEnvironment.getContainerService(PortletDefinitionRegistry.class);
 
             PortletApplicationEntity pae = registry.getPortletApplicationEntityList().get(ObjectIDImpl.createFromString("cocoon"));
@@ -218,12 +241,12 @@
      */
     public void dispose() {
         try {
+            ContainerUtil.dispose(this.portletContainerEnvironment);
+            this.portletContainerEnvironment = null;
             if (this.portletContainer != null ) {
                 this.portletContainer.shutdown();
                 this.portletContainer = null;
             }
-            ContainerUtil.dispose(this.portletContainerEnvironment);
-            this.portletContainerEnvironment = null;
         } catch (Throwable t) {
             this.getLogger().error("Destruction failed!", t);
         }
@@ -236,6 +259,8 @@
     public void initialize() throws Exception {
         super.initialize();
         this.initContainer();
+        this.enableFullScreen = this.portalService.getConfigurationAsBoolean(PortalService.CONFIGURATION_FULL_SCREEN_ENABLED, true);
+        this.enableMaximized = this.portalService.getConfigurationAsBoolean(PortalService.CONFIGURATION_MAXIMIZED_ENABLED, true);
     }
 
     /**
@@ -320,6 +345,23 @@
         }
     }
 
+    public void inform(CopletInstanceSizingEvent event, PortalService service) {
+        WindowState ws = WindowState.NORMAL;
+        if ( event.getSize() == CopletInstanceData.SIZE_NORMAL ) {
+            ws = WindowState.NORMAL;
+        } else if ( event.getSize() == CopletInstanceData.SIZE_MAXIMIZED ) {
+            ws = WindowState.MAXIMIZED;
+        } else if ( event.getSize() == CopletInstanceData.SIZE_MINIMIZED ) {
+            ws = WindowState.MINIMIZED;
+        } else if ( event.getSize() == CopletInstanceData.SIZE_FULLSCREEN ) {
+            ws = new WindowState((String)CopletDataFeatures.getAttributeValue(event.getTarget().getCopletData(), FULL_SCREEN_WINDOW_STATE_ATTRIBUTE_NAME, null));
+        }
+        final String wsString = (String)event.getTarget().getTemporaryAttribute(WINDOW_STATE_ATTRIBUTE_NAME);
+        if ( !wsString.equals(ws.toString()) ) {
+            event.getTarget().setTemporaryAttribute(WINDOW_STATE_ATTRIBUTE_NAME, ws.toString());
+        }
+    }
+
     /**
      * @see org.apache.cocoon.portal.PortalManagerAspect#prepare(org.apache.cocoon.portal.PortalManagerAspectPrepareContext, org.apache.cocoon.portal.PortalService)
      */
@@ -380,13 +422,13 @@
      */
     public List getPossibleCopletModes(CopletInstanceData copletInstanceData) {
         final List modes = new ArrayList();
-        final PortletWindow window = (PortletWindow)copletInstanceData.getTemporaryAttribute("window");
-        if ( window != null && this.portletContainerEnvironment != null) {
+        final PortletWindow window = (PortletWindow)copletInstanceData.getTemporaryAttribute(PORTLET_WINDOW_ATTRIBUTE_NAME);
+        if ( window != null ) {
             InformationProviderService ips = (InformationProviderService) this.portletContainerEnvironment.getContainerService(InformationProviderService.class);
             DynamicInformationProvider dip = ips.getDynamicProvider((HttpServletRequest) ContextHelper.getObjectModel(this.context).get("portlet-request"));
 
             // portlet modes
-            final String pmString = (String)copletInstanceData.getTemporaryAttribute("portlet-mode");
+            final String pmString = (String)copletInstanceData.getTemporaryAttribute(PORTLET_MODE_ATTRIBUTE_NAME);
             final PortletMode pm; 
             if ( pmString == null ) {
                 pm = PortletMode.VIEW;
@@ -397,19 +439,19 @@
                 PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
                 url.clearParameters();
                 url.setPortletMode(PortletMode.EDIT);
-                modes.add(new DecorationAction("edit", url.toString()));
+                modes.add(new DecorationAction("edit-uri", url.toString()));
             }
             if ( !pm.equals(PortletMode.HELP) ) {
                 PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
                 url.clearParameters();
                 url.setPortletMode(PortletMode.HELP);
-                modes.add(new DecorationAction("help", url.toString()));
+                modes.add(new DecorationAction("help-uri", url.toString()));
             }                
             if ( !pm.equals(PortletMode.VIEW) ) {
                 PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
                 url.clearParameters();
                 url.setPortletMode(PortletMode.VIEW);
-                modes.add(new DecorationAction("view", url.toString()));
+                modes.add(new DecorationAction("view-uri", url.toString()));
             }                
         }
 
@@ -421,13 +463,13 @@
      */
     public List getPossibleWindowStates(CopletInstanceData copletInstanceData) {
         final List states = new ArrayList();
-        final PortletWindow window = (PortletWindow)copletInstanceData.getTemporaryAttribute("window");
-        if ( window != null && this.portletContainerEnvironment != null) {
+        final PortletWindow window = (PortletWindow)copletInstanceData.getTemporaryAttribute(PORTLET_WINDOW_ATTRIBUTE_NAME);
+        if ( window != null ) {
             InformationProviderService ips = (InformationProviderService) this.portletContainerEnvironment.getContainerService(InformationProviderService.class);
             DynamicInformationProvider dip = ips.getDynamicProvider((HttpServletRequest) ContextHelper.getObjectModel(this.context).get("portlet-request"));
 
             // Sizing
-            final String wsString = (String)copletInstanceData.getTemporaryAttribute("window-state");
+            final String wsString = (String)copletInstanceData.getTemporaryAttribute(WINDOW_STATE_ATTRIBUTE_NAME);
             final WindowState ws; 
             if ( wsString == null ) {
                 ws = WindowState.NORMAL;
@@ -439,21 +481,27 @@
                 PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
                 url.clearParameters();
                 url.setWindowState(WindowState.MINIMIZED);
-                states.add(new DecorationAction("minimize", url.toString()));
+                states.add(new DecorationAction(DecorationAction.WINDOW_STATE_MINIMIZED, url.toString()));
             }
 
             if ( !ws.equals(WindowState.NORMAL)) {
                 PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
                 url.clearParameters();
                 url.setWindowState(WindowState.NORMAL);
-                states.add(new DecorationAction("normal", url.toString()));
+                states.add(new DecorationAction(DecorationAction.WINDOW_STATE_NORMAL, url.toString()));
             }
 
-            if ( !ws.equals(WindowState.MAXIMIZED)) {
-                PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
-                url.clearParameters();
-                url.setWindowState(WindowState.MAXIMIZED);
-                states.add(new DecorationAction("maximize", url.toString()));
+            if ( this.enableMaximized ) {
+                if ( !ws.equals(WindowState.MAXIMIZED)) {
+                    PortletURLProviderImpl url = (PortletURLProviderImpl)dip.getPortletURLProvider(window);
+                    url.clearParameters();
+                    url.setWindowState(WindowState.MAXIMIZED);
+                    states.add(new DecorationAction(DecorationAction.WINDOW_STATE_MAXIMIZED, url.toString()));
+                }
+            }
+            // TODO - Implement full screen for portlets (= own mode)
+            if ( this.enableFullScreen ) {
+                
             }
         }
 
@@ -465,9 +513,9 @@
      */
     public String getTitle(CopletInstanceData copletInstanceData) {
         String title = null;
-        final PortletWindow window = (PortletWindow)copletInstanceData.getTemporaryAttribute("window");
+        final PortletWindow window = (PortletWindow)copletInstanceData.getTemporaryAttribute(PORTLET_WINDOW_ATTRIBUTE_NAME);
         if ( window != null ) {
-            title = (String) copletInstanceData.getTemporaryAttribute("dynamic-title");
+            title = (String) copletInstanceData.getTemporaryAttribute(DYNAMIC_TITLE_ATTRIBUTE_NAME);
             if ( title == null ) {
                 final PortletDefinition def = window.getPortletEntity().getPortletDefinition();
                 try {

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/resources/org/apache/cocoon/portal/pluto/portal-pluto.roles
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/resources/org/apache/cocoon/portal/pluto/portal-pluto.roles?rev=425807&r1=425806&r2=425807&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/resources/org/apache/cocoon/portal/pluto/portal-pluto.roles (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/resources/org/apache/cocoon/portal/pluto/portal-pluto.roles Wed Jul 26 12:07:55 2006
@@ -17,13 +17,6 @@
 <role-list>
 
   <!--+
-      | Renderer Aspects
-      |
-      +-->
-    <role name="org.apache.cocoon.portal.layout.renderer.aspect.RendererAspect/portlet-window"
-          default-class="org.apache.cocoon.portal.pluto.adapter.PortletWindowAspect"/>
-
-  <!--+
       | Coplet Adapters
       |
       +-->

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/pom.xml?rev=425807&r1=425806&r2=425807&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/pom.xml (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/pom.xml Wed Jul 26 12:07:55 2006
@@ -70,5 +70,15 @@
       <artifactId>cocoon-portal-auth-impl</artifactId>
       <version>1.0.0-SNAPSHOT</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-portal-wsrp-impl</artifactId>
+      <version>1.0.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-portal-portlet-impl</artifactId>
+      <version>1.0.0-SNAPSHOT</version>
+    </dependency>
   </dependencies>
 </project>

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/xconf/cocoon-portal-sample.xconf
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/xconf/cocoon-portal-sample.xconf?rev=425807&r1=425806&r2=425807&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/xconf/cocoon-portal-sample.xconf (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/config/xconf/cocoon-portal-sample.xconf Wed Jul 26 12:07:55 2006
@@ -16,7 +16,7 @@
 -->
 <!--+
     |
-    | SVN $Id: cocoon-portal-samples.xconf 125443 2005-01-17 20:39:52Z cziegeler $
+    | @version $Id: cocoon-portal-samples.xconf 125443 2005-01-17 20:39:52Z cziegeler $
     +-->
 <components>
   <!--+
@@ -35,12 +35,12 @@
 
   <!-- Include portal roles -->
   <include src="resource://org/apache/cocoon/portal/portal.roles"/>
-  <!-- If you don't need JSR 168 support, you can remove the following include: 
+
+  <!-- If you don't need JSR 168 support, you can remove the following include. -->
   <include src="resource://org/apache/cocoon/portal/pluto/portal-pluto.roles"/>
-  -->
-  <!-- If you don't need WSRP support, you can remove the following include: 
+
+  <!-- If you don't need WSRP support, you can remove the following include -->
   <include src="resource://org/apache/cocoon/portal/wsrp/portal-wsrp.roles"/>
-  -->
 
   <!-- We use CAuth for authentication. If you don't use CAuth remove this line: -->
   <include src="auth-cauth.xconf"/>
@@ -93,12 +93,10 @@
   -->
   <portal-manager>
     <aspects>
-      <!-- JSR-168 support: 
+      <!-- JSR-168 support: -->
       <aspect adapter="portlet"/>
-      -->
-      <!-- wsrp support: 
+      <!-- wsrp support: -->
       <aspect adapter="wsrp"/>
-      -->
     </aspects>
   </portal-manager>
 
@@ -111,12 +109,11 @@
         <!-- aspect type="action-counter"/ -->
         <aspect type="frame"/>
         <aspect type="link"/>
-  <!-- Uncomment the following when using PageLabels
+        <!-- Uncomment the following when using PageLabels
         <aspect type="page-label"/>
         -->
-        <!-- Comment the following out if you don't need WSRP: 
+        <!-- Comment the following out if you don't need WSRP: --> 
         <aspect type="wsrp"/>
-        -->
         <aspect type="request-parameter"/>
     </event-aspects>
     <!-- add a new instance of each class as a receiver: -->
@@ -262,8 +259,6 @@
         <aspect type="window">
           <parameter name="root-tag" value="false"/>
         </aspect>
-        <aspect type="coplet-removing"/>
-        <aspect type="coplet-sizing"/>
         <aspect type="history"/>
         <aspect type="basket"/>
         <aspect type="coplet-cinclude"/>
@@ -281,8 +276,6 @@
         <aspect type="window">
           <parameter name="root-tag" value="false"/>
         </aspect>
-        <aspect type="coplet-removing"/>
-        <aspect type="coplet-sizing"/>
         <aspect type="history"/>
         <aspect type="basket"/>
         <aspect type="coplet-cinclude"/>
@@ -305,44 +298,6 @@
         </aspect>
       </aspects>
     </renderer>
-    <!--
-    <renderer name="portlet-window"
-              class="org.apache.cocoon.portal.layout.renderer.impl.AspectRenderer">
-      <aspects>
-        <aspect type="xslt">
-          <parameter name="style" value="{portal-skin:skin.basepath}/styles/window.xsl"/>
-        </aspect>
-        <aspect type="parameter">
-          <parameter name="tag-name" value="window"/>
-        </aspect>
-        <aspect type="portlet-window">
-          <parameter name="root-tag" value="false"/>
-        </aspect>
-        <aspect type="coplet-removing"/>
-        <aspect type="history"/>
-        <aspect type="basket"/>
-        <aspect type="coplet-cinclude"/>
-      </aspects>
-    </renderer>
-    <renderer name="wsrp-window"
-              class="org.apache.cocoon.portal.layout.renderer.impl.AspectRenderer">
-      <aspects>
-        <aspect type="xslt">
-          <parameter name="style" value="{portal-skin:skin.basepath}/styles/window.xsl"/>
-        </aspect>
-        <aspect type="parameter">
-          <parameter name="tag-name" value="window"/>
-        </aspect>
-        <aspect type="wsrp-window">
-          <parameter name="root-tag" value="false"/>
-        </aspect>
-        <aspect type="coplet-removing"/>
-        <aspect type="history"/>
-        <aspect type="basket"/>
-        <aspect type="coplet-cinclude"/>
-      </aspects>
-    </renderer>
-    -->
     <renderer name="link" 
               class="org.apache.cocoon.portal.layout.renderer.impl.DefaultLinkRenderer"/>
     <renderer name="decorated-frame"
@@ -410,7 +365,6 @@
               class="org.apache.cocoon.portal.layout.impl.CopletLayout">
         <renderers default="window">
           <renderer name="window"/>
-          <renderer name="portlet-window"/>
           <renderer name="nowindow"/>
         </renderers>
       </layout>
@@ -438,10 +392,10 @@
   <!-- This is the special basket renderer -->
   <component role="org.apache.cocoon.portal.layout.renderer.aspect.RendererAspect/basket"
              class="org.apache.cocoon.portal.coplets.basket.AddToBasketAspect"/>
-<!--
+
   <wsrp-adapter>
-     This is the WSRP configuration containing the producers etc. 
-     <parameter name="wsrp-config" value="profiles/wsrp-config.xml"/>
+     <!-- This is the WSRP configuration containing the producers etc. -->
+     <parameter name="wsrp-config" value="config/wsrp-config.xml"/>
   </wsrp-adapter>
--->
+
 </components>

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/profiles/copletbasedata/portal.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/profiles/copletbasedata/portal.xml?rev=425807&r1=425806&r2=425807&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/profiles/copletbasedata/portal.xml (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/profiles/copletbasedata/portal.xml Wed Jul 26 12:07:55 2006
@@ -19,9 +19,19 @@
    <coplet-base-data id="URICoplet">
       <coplet-adapter>uri</coplet-adapter>
    </coplet-base-data>
+
    <coplet-base-data id="Portlet">
       <coplet-adapter>portlet</coplet-adapter>
+      <configuration>
+        <name>full-screen</name>
+        <value xsi:type="java:java.lang.Boolean">false</value>
+      </configuration>
+      <configuration>
+        <name>handle-sizing</name>
+        <value xsi:type="java:java.lang.Boolean">true</value>
+      </configuration>
    </coplet-base-data>
+
    <coplet-base-data id="WSRP">
       <coplet-adapter>wsrp</coplet-adapter>
       <configuration>

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/skins/modern/styles/window.xsl
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/skins/modern/styles/window.xsl?rev=425807&r1=425806&r2=425807&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/skins/modern/styles/window.xsl (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sample/src/main/resources/COB-INF/skins/modern/styles/window.xsl Wed Jul 26 12:07:55 2006
@@ -34,7 +34,7 @@
             </xsl:choose> 
           </div>
           <div class="coplet-icons" id="coplet-icons-{$copletId}">
-            <xsl:variable name="copletSize"><xsl:value-of select="coplet-size"/></xsl:variable>
+            <xsl:variable name="copletSize"><xsl:value-of select="size"/></xsl:variable>
             <xsl:if test="basket-add-link">
               <div class="coplet-icon basket-add-link" id="coplet-icon-basket-add-link-{$copletId}">
                 <a href="{basket-add-link}">

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-wsrp-impl/src/main/java/org/apache/cocoon/portal/wsrp/adapter/WSRPAdapter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-wsrp-impl/src/main/java/org/apache/cocoon/portal/wsrp/adapter/WSRPAdapter.java?rev=425807&r1=425806&r2=425807&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-wsrp-impl/src/main/java/org/apache/cocoon/portal/wsrp/adapter/WSRPAdapter.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-wsrp-impl/src/main/java/org/apache/cocoon/portal/wsrp/adapter/WSRPAdapter.java Wed Jul 26 12:07:55 2006
@@ -843,7 +843,7 @@
         final List modes = new ArrayList();
         final PortletKey portletKey = (PortletKey)copletInstanceData.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_PORTLET_KEY);
 
-        if ( portletKey != null && this.consumerEnvironment != null ) {
+        if ( portletKey != null ) {
             final String portletInstanceKey = (String)copletInstanceData.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_PORTLET_INSTANCE_KEY);
             final User user = (User)copletInstanceData.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_USER);
 
@@ -866,7 +866,7 @@
                         p.put(Constants.PORTLET_MODE, Modes._edit);
 
                         final String link = urlGenerator.getRenderURL(p);
-                        modes.add(new DecorationAction("edit", link));
+                        modes.add(new DecorationAction("edit-uri", link));
                     }
                     if ( !pm.equals(Modes._help)
                         && ArrayUtils.contains(supportedModes, Modes._help) ) {
@@ -875,7 +875,7 @@
                         p.put(Constants.PORTLET_MODE, Modes._help);
 
                         final String link = urlGenerator.getRenderURL(p);                        
-                        modes.add(new DecorationAction("help", link));
+                        modes.add(new DecorationAction("help-uri", link));
                     }                
                     if ( !pm.equals(Modes._view)
                         && ArrayUtils.contains(supportedModes, Modes._view) ) {
@@ -884,7 +884,7 @@
                         p.put(Constants.PORTLET_MODE, Modes._view);
 
                         final String link = urlGenerator.getRenderURL(p);                        
-                        modes.add(new DecorationAction("view", link));
+                        modes.add(new DecorationAction("view-uri", link));
                     } 
                 }
             } catch (WSRPException ignore) {
@@ -903,7 +903,7 @@
         final List states = new ArrayList();
         final PortletKey portletKey = (PortletKey)copletInstanceData.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_PORTLET_KEY);
 
-        if ( portletKey != null && this.consumerEnvironment != null ) {
+        if ( portletKey != null ) {
             final String portletInstanceKey = (String)copletInstanceData.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_PORTLET_INSTANCE_KEY);
             final User user = (User)copletInstanceData.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_USER);
 
@@ -927,7 +927,7 @@
                         p.put(Constants.WINDOW_STATE, WindowStates._minimized);
 
                         final String link = urlGenerator.getRenderURL(p);
-                        states.add(new DecorationAction("minimize", link));
+                        states.add(new DecorationAction(DecorationAction.WINDOW_STATE_MINIMIZED, link));
                     }
                     if ( !ws.equals(WindowStates._normal)
                           && ArrayUtils.contains(supportedWindowStates, WindowStates._normal)) {
@@ -936,7 +936,7 @@
                         p.put(Constants.WINDOW_STATE, WindowStates._normal);
 
                         final String link = urlGenerator.getRenderURL(p);
-                        states.add(new DecorationAction("normal", link));
+                        states.add(new DecorationAction(DecorationAction.WINDOW_STATE_NORMAL, link));
                     } 
                     if ( !ws.equals(WindowStates._maximized)
                           && ArrayUtils.contains(supportedWindowStates, WindowStates._maximized)) {
@@ -945,7 +945,7 @@
                         p.put(Constants.WINDOW_STATE, WindowStates._maximized);
 
                         final String link = urlGenerator.getRenderURL(p);                    
-                        states.add(new DecorationAction("maximize", link));
+                        states.add(new DecorationAction(DecorationAction.WINDOW_STATE_MAXIMIZED, link));
                     }
                 }
             } catch (WSRPException ignore) {

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-wsrp-impl/src/main/resources/org/apache/cocoon/portal/wsrp/portal-wsrp.roles
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-wsrp-impl/src/main/resources/org/apache/cocoon/portal/wsrp/portal-wsrp.roles?rev=425807&r1=425806&r2=425807&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-wsrp-impl/src/main/resources/org/apache/cocoon/portal/wsrp/portal-wsrp.roles (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-wsrp-impl/src/main/resources/org/apache/cocoon/portal/wsrp/portal-wsrp.roles Wed Jul 26 12:07:55 2006
@@ -28,13 +28,6 @@
 
 
   <!--+
-      | Renderer Aspects
-      |
-      +-->
-    <role name="org.apache.cocoon.portal.layout.renderer.aspect.RendererAspect/wsrp-window"
-          default-class="org.apache.cocoon.portal.wsrp.adapter.WSRPPortletWindowAspect"/>
-
-  <!--+
       | Default User Context Provider for WSRP.
       +-->
   <role name="org.apache.cocoon.portal.wsrp.consumer.UserContextProvider"



Mime
View raw message