cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r568247 - in /cocoon/trunk/blocks/cocoon-portal: cocoon-portal-api/src/main/java/org/apache/cocoon/portal/ cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/ cocoon-portal-impl/src/main/java/org/apache/cocoo...
Date Tue, 21 Aug 2007 19:55:45 GMT
Author: cziegeler
Date: Tue Aug 21 12:55:43 2007
New Revision: 568247

URL: http://svn.apache.org/viewvc?rev=568247&view=rev
Log:
Move sitemap and cocoon related stuff into sitemap module.

Added:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/CocoonCopletAdapter.java
  (with props)
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/Constants.java
  (with props)
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/AbstractModule.java
      - copied, changed from r567974, cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/AbstractModule.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/CopletModule.java
      - copied, changed from r567974, cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/CopletModule.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/LayoutModule.java
      - copied, changed from r567974, cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/LayoutModule.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/SkinModule.java
      - copied, changed from r567974, cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/SkinModule.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/resources/META-INF/cocoon/
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/resources/META-INF/cocoon/avalon/
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/resources/META-INF/cocoon/avalon/portal-sitemap.roles
Removed:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/AbstractModule.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/CopletModule.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/LayoutModule.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/SkinModule.java
Modified:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-api/src/main/java/org/apache/cocoon/portal/Constants.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/URICopletAdapter.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-sitemap/src/main/java/org/apache/cocoon/portal/acting/CopletSetDataAction.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/ApplicationCopletAdapter.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/generation/AbstractCopletGenerator.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/transformation/AbstractCopletTransformer.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/transformation/ProxyTransformer.java

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-api/src/main/java/org/apache/cocoon/portal/Constants.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-api/src/main/java/org/apache/cocoon/portal/Constants.java?rev=568247&r1=568246&r2=568247&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-api/src/main/java/org/apache/cocoon/portal/Constants.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-api/src/main/java/org/apache/cocoon/portal/Constants.java
Tue Aug 21 12:55:43 2007
@@ -21,13 +21,7 @@
  *
  * @version $Id$
  */
-public class Constants {
-
-    /**
-     * Names used in object model or parent context by CopletModule, CopletTransformer and
CopletAdapter. 
-     */
-    public static final String COPLET_ID_KEY = "cocoon-portal-copletId";
-    public static final String PORTAL_NAME_KEY = "cocoon-portal-portalName";
+public abstract class Constants {
 
     /** Configuration key for full screen enabled (default is true). */
     public static final String CONFIGURATION_FULL_SCREEN_ENABLED = "enable-full-screen";

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/URICopletAdapter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/URICopletAdapter.java?rev=568247&r1=568246&r2=568247&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/URICopletAdapter.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/URICopletAdapter.java
Tue Aug 21 12:55:43 2007
@@ -17,18 +17,10 @@
 package org.apache.cocoon.portal.coplet.adapter.impl;
 
 import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
 
 import org.apache.cocoon.ProcessingException;
-import org.apache.cocoon.components.notification.Notifying;
-import org.apache.cocoon.components.notification.NotifyingBuilder;
 import org.apache.cocoon.components.source.SourceUtil;
-import org.apache.cocoon.environment.ObjectModelHelper;
-import org.apache.cocoon.portal.Constants;
 import org.apache.cocoon.portal.om.CopletInstance;
-import org.apache.cocoon.portal.om.CopletInstanceFeatures;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
 import org.xml.sax.ContentHandler;
@@ -45,16 +37,10 @@
     /** The source resolver */
     protected SourceResolver resolver;
 
-    protected NotifyingBuilder notifyingBuilder;
-
     public void setSourceResolver(SourceResolver resolver) {
         this.resolver = resolver;
     }
 
-    public void setNotifyingBuilder(NotifyingBuilder notifyingBuilder) {
-        this.notifyingBuilder = notifyingBuilder;
-    }
-
     /**
      * @see org.apache.cocoon.portal.coplet.adapter.impl.AbstractCopletAdapter#streamContent(org.apache.cocoon.portal.om.CopletInstance,
org.xml.sax.ContentHandler)
      */
@@ -76,34 +62,7 @@
         }
 		Source copletSource = null;
 		try {
-			if (uri.startsWith("cocoon:")) {
-                Boolean handlePars = (Boolean)this.getConfiguration( coplet, "handleParameters",
Boolean.FALSE);
-
-                String sourceUri = uri;
-
-                if ( handlePars.booleanValue() ) {
-                    List list = CopletInstanceFeatures.getChangedCopletInstanceDataObjects(this.portalService);
-                    if ( list.contains( coplet )) {
-                        // add parameters
-                        if ( uri.startsWith("cocoon:raw:") ) {
-                            sourceUri = "cocoon:" + uri.substring(11);
-                        }
-                    } else {
-                        // remove parameters
-                        if (!uri.startsWith("cocoon:raw:") ) {
-                            sourceUri = "cocoon:raw:" + uri.substring(7);
-                        }
-                    }
-                }
-
-				HashMap par = new HashMap();
-				par.put(Constants.PORTAL_NAME_KEY, this.portalService.getPortalName());
-				par.put(Constants.COPLET_ID_KEY, coplet.getId());
-
-				copletSource = this.resolver.resolveURI(sourceUri, null, par);
-			} else {
-				copletSource = this.resolver.resolveURI(uri);
-			}
+			copletSource = this.resolver.resolveURI(uri);
 			SourceUtil.toSAX(copletSource, contentHandler);
 		} catch (IOException ioe) {
 			throw new SAXException("IOException", ioe);
@@ -131,30 +90,7 @@
             // TODO - if an error occured for this coplet, remember this
             //         and use directly the error-uri from now on
 
-            if ( uri.startsWith("cocoon:") && error != null) {
-                // Create a Notifying object - if builder is set
-                Notifying currentNotifying = null;
-                if ( this.notifyingBuilder != null ) {
-                    currentNotifying = notifyingBuilder.build(this, error);
-                }
-
-                final Map objectModel = this.portalService.getProcessInfoProvider().getObjectModel();
-                // Add it to the object model
-                if ( currentNotifying != null ) {
-                    objectModel.put(org.apache.cocoon.Constants.NOTIFYING_OBJECT, currentNotifying);
-                    objectModel.put(ObjectModelHelper.THROWABLE_OBJECT, error);
-                }
-
-                try {
-                    this.streamContent( coplet, uri, handler);
-                } finally {
-                    objectModel.remove(org.apache.cocoon.Constants.NOTIFYING_OBJECT);
-                    objectModel.remove(ObjectModelHelper.THROWABLE_OBJECT);
-                }
-            } else {
-
-                this.streamContent( coplet, uri, handler);
-            }
+            this.streamContent( coplet, uri, handler);
 
             return true;
         }

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=568247&r1=568246&r2=568247&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
Tue Aug 21 12:55:43 2007
@@ -44,17 +44,6 @@
 
 
   <!--+
-      | Input Modules.
-      |
-      +-->
-    <role name="org.apache.cocoon.components.modules.input.InputModule/coplet"
-          default-class="org.apache.cocoon.portal.components.modules.input.CopletModule"/>
-    <role name="org.apache.cocoon.components.modules.input.InputModule/portal-layout"
-          default-class="org.apache.cocoon.portal.components.modules.input.LayoutModule"/>
-    <role name="org.apache.cocoon.components.modules.input.InputModule/portal-skin"
-          default-class="org.apache.cocoon.portal.components.modules.input.SkinModule"/>
-
-  <!--+
       | Portal Service.
       |
       +-->

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/acting/CopletSetDataAction.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/acting/CopletSetDataAction.java?rev=568247&r1=568246&r2=568247&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/acting/CopletSetDataAction.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/acting/CopletSetDataAction.java
Tue Aug 21 12:55:43 2007
@@ -23,26 +23,26 @@
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.Redirector;
 import org.apache.cocoon.environment.SourceResolver;
-import org.apache.cocoon.portal.Constants;
 import org.apache.cocoon.portal.event.Event;
 import org.apache.cocoon.portal.event.EventManager;
 import org.apache.cocoon.portal.event.coplet.CopletJXPathEvent;
+import org.apache.cocoon.portal.sitemap.Constants;
 
 /**
  * Using this action, you can set values in a coplet.
  *
  * @version $Id$
  */
-public class CopletSetDataAction 
+public class CopletSetDataAction
     extends AbstractPortalAction {
 
 	/**
 	 * @see org.apache.cocoon.acting.Action#act(org.apache.cocoon.environment.Redirector, org.apache.cocoon.environment.SourceResolver,
java.util.Map, java.lang.String, org.apache.avalon.framework.parameters.Parameters)
 	 */
-	public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source,
Parameters parameters) 
+	public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source,
Parameters parameters)
     throws Exception {
         // determine coplet id
-        String copletId = null;            
+        String copletId = null;
         Map context = (Map)objectModel.get(ObjectModelHelper.PARENT_CONTEXT);
         if (context != null) {
             copletId = (String)context.get(Constants.COPLET_ID_KEY);
@@ -71,7 +71,7 @@
                     publisher.send(event);
                 }
             }
-        }        
+        }
         return EMPTY_MAP;
 	}
 }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/ApplicationCopletAdapter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/ApplicationCopletAdapter.java?rev=568247&r1=568246&r2=568247&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/ApplicationCopletAdapter.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/ApplicationCopletAdapter.java
Tue Aug 21 12:55:43 2007
@@ -39,10 +39,10 @@
  * TODO: Decide if we still need this adapter.
  * @version $Id$
  */
-public class ApplicationCopletAdapter extends URICopletAdapter {
+public class ApplicationCopletAdapter extends CocoonCopletAdapter {
 
     /**
-     * @see org.apache.cocoon.portal.coplet.adapter.impl.URICopletAdapter#streamContent(org.apache.cocoon.portal.om.CopletInstance,
java.lang.String, org.xml.sax.ContentHandler)
+     * @see org.apache.cocoon.portal.coplet.adapter.impl.CocoonCopletAdapter#streamContent(org.apache.cocoon.portal.om.CopletInstance,
java.lang.String, org.xml.sax.ContentHandler)
      */
     protected void streamContent(final CopletInstance coplet,
                                  final String uri,

Added: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/CocoonCopletAdapter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/CocoonCopletAdapter.java?rev=568247&view=auto
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/CocoonCopletAdapter.java
(added)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/CocoonCopletAdapter.java
Tue Aug 21 12:55:43 2007
@@ -0,0 +1,155 @@
+/*
+ * 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.coplet.adapter.impl;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.cocoon.ProcessingException;
+import org.apache.cocoon.components.notification.Notifying;
+import org.apache.cocoon.components.notification.NotifyingBuilder;
+import org.apache.cocoon.components.source.SourceUtil;
+import org.apache.cocoon.environment.ObjectModelHelper;
+import org.apache.cocoon.portal.om.CopletInstance;
+import org.apache.cocoon.portal.om.CopletInstanceFeatures;
+import org.apache.cocoon.portal.sitemap.Constants;
+import org.apache.excalibur.source.Source;
+import org.apache.excalibur.source.SourceResolver;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+
+/**
+ * This is the adapter to use pipelines as coplets.
+ *
+ * @version $Id$
+ */
+public class CocoonCopletAdapter
+    extends AbstractCopletAdapter {
+
+    /** The source resolver */
+    protected SourceResolver resolver;
+
+    protected NotifyingBuilder notifyingBuilder;
+
+    public void setSourceResolver(SourceResolver resolver) {
+        this.resolver = resolver;
+    }
+
+    public void setNotifyingBuilder(NotifyingBuilder notifyingBuilder) {
+        this.notifyingBuilder = notifyingBuilder;
+    }
+
+    /**
+     * @see org.apache.cocoon.portal.coplet.adapter.impl.AbstractCopletAdapter#streamContent(org.apache.cocoon.portal.om.CopletInstance,
org.xml.sax.ContentHandler)
+     */
+    protected void streamContent(CopletInstance coplet, ContentHandler contentHandler)
+    throws SAXException {
+        final String uri = (String)coplet.getCopletDefinition().getAttribute("uri");
+        if ( uri == null ) {
+            throw new SAXException("No URI for coplet definition "+coplet.getCopletDefinition().getId()+"
found.");
+        }
+        this.streamContent( coplet, uri, contentHandler);
+    }
+
+    protected void streamContent(final CopletInstance coplet,
+                                 final String uri,
+                                 final ContentHandler contentHandler)
+    throws SAXException {
+        if ( this.getLogger().isDebugEnabled() ) {
+            this.getLogger().debug("Streaming coplet instance + " + coplet + " using uri:
" + uri);
+        }
+		Source copletSource = null;
+		try {
+            Boolean handlePars = (Boolean)this.getConfiguration( coplet, "handleParameters",
Boolean.FALSE);
+
+            String sourceUri = uri;
+
+            if ( handlePars.booleanValue() ) {
+                List list = CopletInstanceFeatures.getChangedCopletInstanceDataObjects(this.portalService);
+                if ( list.contains( coplet )) {
+                    // add parameters
+                    if ( uri.startsWith("cocoon:raw:") ) {
+                        sourceUri = "cocoon:" + uri.substring(11);
+                    }
+                } else {
+                    // remove parameters
+                    if (!uri.startsWith("cocoon:raw:") ) {
+                        sourceUri = "cocoon:raw:" + uri.substring(7);
+                    }
+                }
+            }
+
+			HashMap par = new HashMap();
+			par.put(Constants.PORTAL_NAME_KEY, this.portalService.getPortalName());
+			par.put(Constants.COPLET_ID_KEY, coplet.getId());
+
+			copletSource = this.resolver.resolveURI(sourceUri, null, par);
+
+			SourceUtil.toSAX(copletSource, contentHandler);
+		} catch (IOException ioe) {
+			throw new SAXException("IOException", ioe);
+		} catch (ProcessingException pe) {
+			throw new SAXException("ProcessingException", pe);
+		} finally {
+			this.resolver.release(copletSource);
+		}
+    }
+
+    /**
+     * Render the error content for a coplet
+     * @param coplet  The coplet instance data
+     * @param handler The content handler
+     * @param error   The exception that occured
+     * @return True if the error content has been rendered, otherwise false
+     * @throws SAXException
+     */
+    protected boolean renderErrorContent(CopletInstance coplet,
+                                         ContentHandler     handler,
+                                         Exception          error)
+    throws SAXException {
+        final String uri = (String) this.getConfiguration(coplet, "error-uri");
+        if ( uri != null ) {
+            // TODO - if an error occured for this coplet, remember this
+            //         and use directly the error-uri from now on
+
+            // Create a Notifying object - if builder is set
+            Notifying currentNotifying = null;
+            if ( this.notifyingBuilder != null ) {
+                currentNotifying = notifyingBuilder.build(this, error);
+            }
+
+            final Map objectModel = this.portalService.getProcessInfoProvider().getObjectModel();
+            // Add it to the object model
+            if ( currentNotifying != null ) {
+                objectModel.put(org.apache.cocoon.Constants.NOTIFYING_OBJECT, currentNotifying);
+                objectModel.put(ObjectModelHelper.THROWABLE_OBJECT, error);
+            }
+
+            try {
+                this.streamContent( coplet, uri, handler);
+            } finally {
+                objectModel.remove(org.apache.cocoon.Constants.NOTIFYING_OBJECT);
+                objectModel.remove(ObjectModelHelper.THROWABLE_OBJECT);
+            }
+
+            return true;
+        }
+        return false;
+    }
+}

Propchange: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/CocoonCopletAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/CocoonCopletAdapter.java
------------------------------------------------------------------------------
    svn:keywords = author date id revision url

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/generation/AbstractCopletGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/generation/AbstractCopletGenerator.java?rev=568247&r1=568246&r2=568247&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/generation/AbstractCopletGenerator.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/generation/AbstractCopletGenerator.java
Tue Aug 21 12:55:43 2007
@@ -23,18 +23,18 @@
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.generation.ServiceableGenerator;
-import org.apache.cocoon.portal.Constants;
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.om.CopletInstance;
+import org.apache.cocoon.portal.sitemap.Constants;
 import org.xml.sax.SAXException;
 
 /**
  * Abstract generator implementation that provides a method getCopletInstanceData().
- * There are two possibilities how the generator obtains the information required for 
+ * There are two possibilities how the generator obtains the information required for
  * getting the coplet instance data:<br><br>
  * 1) If it is used within a coplet pipeline and this pipeline is called using the "cocoon:"
protocol,
  * all required information are passed automatically.<br>
- * 2) Otherwise the portal name and the coplet id must be passed to the generator 
+ * 2) Otherwise the portal name and the coplet id must be passed to the generator
  * as paremeters in the following way:
  *
  * <pre>&lt;map:generator type="coplet"&gt;
@@ -44,7 +44,7 @@
  *
  * @version $Id$
  */
-public abstract class AbstractCopletGenerator 
+public abstract class AbstractCopletGenerator
 extends ServiceableGenerator {
 
     /**
@@ -65,7 +65,7 @@
      * @return The coplet instance data
      * @throws SAXException If an errors occurs or the instance data is not available
      */
-    protected CopletInstance getCopletInstanceData() 
+    protected CopletInstance getCopletInstanceData()
     throws SAXException {
         CopletInstance cid = this.getCopletInstanceData(null);
         if ( cid == null ) {
@@ -88,7 +88,7 @@
      * @return The coplet instance data or null
      * @throws SAXException If an error occurs
      */
-    protected CopletInstance getCopletInstanceData(String instanceId) 
+    protected CopletInstance getCopletInstanceData(String instanceId)
     throws SAXException {
         String copletId = instanceId;
         if ( copletId == null ) {
@@ -100,7 +100,7 @@
                 copletId = (String)objectModel.get(Constants.COPLET_ID_KEY);
                 if ( copletId == null ) {
                     try {
-                        copletId = this.parameters.getParameter(COPLET_ID_PARAM);       

+                        copletId = this.parameters.getParameter(COPLET_ID_PARAM);
                     } catch (ParameterException e) {
                         throw new SAXException("copletId must be passed as parameter or in
the object model within the parent context.");
                     }

Added: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/Constants.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/Constants.java?rev=568247&view=auto
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/Constants.java
(added)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/Constants.java
Tue Aug 21 12:55:43 2007
@@ -0,0 +1,31 @@
+/*
+ * 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.sitemap;
+
+/**
+ * Defines constants used within portal classes.
+ *
+ * @version $Id$
+ */
+public abstract class Constants {
+
+    /**
+     * Names used in object model or parent context by CopletModule, CopletTransformer and
CopletAdapter.
+     */
+    public static final String COPLET_ID_KEY = "cocoon-portal-copletId";
+    public static final String PORTAL_NAME_KEY = "cocoon-portal-portalName";
+}

Propchange: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/Constants.java
------------------------------------------------------------------------------
    svn:eol-style = native

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

Copied: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/AbstractModule.java
(from r567974, cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/AbstractModule.java)
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/AbstractModule.java?p2=cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/AbstractModule.java&p1=cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/AbstractModule.java&r1=567974&r2=568247&rev=568247&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/AbstractModule.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/AbstractModule.java
Tue Aug 21 12:55:43 2007
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.cocoon.portal.components.modules.input;
+package org.apache.cocoon.portal.sitemap.modules;
 
 import java.util.Collections;
 import java.util.Iterator;

Copied: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/CopletModule.java
(from r567974, cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/CopletModule.java)
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/CopletModule.java?p2=cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/CopletModule.java&p1=cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/CopletModule.java&r1=567974&r2=568247&rev=568247&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/CopletModule.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/CopletModule.java
Tue Aug 21 12:55:43 2007
@@ -14,14 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.cocoon.portal.components.modules.input;
+package org.apache.cocoon.portal.sitemap.modules;
 
 import java.util.Map;
 
 import org.apache.avalon.framework.configuration.Configuration;
 import org.apache.avalon.framework.configuration.ConfigurationException;
 import org.apache.cocoon.environment.ObjectModelHelper;
-import org.apache.cocoon.portal.Constants;
+import org.apache.cocoon.portal.sitemap.Constants;
 import org.apache.commons.jxpath.JXPathContext;
 
 /**
@@ -33,13 +33,13 @@
  * 	&lt;map:parameter name="maxpageable" value="{coplet:copletData/maxpageable}"/&gt;
  * &lt;/map:action&gt;<br></pre>
  *
- * The module will insert the boolean value specifying whether the coplet is 
- * maxpageable or not as value of attribute "value" in &lt;map:parameter&gt;. 
- * There are two possibilities how the module obtains the information required for 
+ * The module will insert the boolean value specifying whether the coplet is
+ * maxpageable or not as value of attribute "value" in &lt;map:parameter&gt;.
+ * There are two possibilities how the module obtains the information required for
  * getting the coplet instance data:<br><br>
  * 1) If it is used within a coplet pipeline and this pipeline is called using the "cocoon:"
protocol,
  * all required information are passed automatically.<br>
- * 2) Otherwise the portal name and the coplet id must be passed in the object model 
+ * 2) Otherwise the portal name and the coplet id must be passed in the object model
  * which can be done by using the ObjectModelAction:
  *
  * <pre>&lt;map:action type="objectModel"&gt;
@@ -54,23 +54,23 @@
  *
  * @version $Id$
  */
-public class CopletModule 
+public class CopletModule
     extends AbstractModule {
 
     /**
      * @see org.apache.cocoon.components.modules.input.InputModule#getAttribute(java.lang.String,
org.apache.avalon.framework.configuration.Configuration, java.util.Map)
      */
-    public Object getAttribute(String name, Configuration modeConf, Map objectModel) 
+    public Object getAttribute(String name, Configuration modeConf, Map objectModel)
     throws ConfigurationException {
         // determine coplet id
-        String copletId = null;            
+        String copletId = null;
         Map context = (Map)objectModel.get(ObjectModelHelper.PARENT_CONTEXT);
         if (context != null) {
             copletId = (String)context.get(Constants.COPLET_ID_KEY);
         } else {
             copletId = (String)objectModel.get(Constants.COPLET_ID_KEY);
         }
-        
+
         if (copletId == null) {
             return null;
         }

Copied: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/LayoutModule.java
(from r567974, cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/LayoutModule.java)
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/LayoutModule.java?p2=cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/LayoutModule.java&p1=cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/LayoutModule.java&r1=567974&r2=568247&rev=568247&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/LayoutModule.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/LayoutModule.java
Tue Aug 21 12:55:43 2007
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.cocoon.portal.components.modules.input;
+package org.apache.cocoon.portal.sitemap.modules;
 
 import java.util.Map;
 

Copied: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/SkinModule.java
(from r567974, cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/SkinModule.java)
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/SkinModule.java?p2=cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/SkinModule.java&p1=cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/SkinModule.java&r1=567974&r2=568247&rev=568247&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/components/modules/input/SkinModule.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/sitemap/modules/SkinModule.java
Tue Aug 21 12:55:43 2007
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.cocoon.portal.components.modules.input;
+package org.apache.cocoon.portal.sitemap.modules;
 
 import java.util.Iterator;
 import java.util.Map;

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/transformation/AbstractCopletTransformer.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/transformation/AbstractCopletTransformer.java?rev=568247&r1=568246&r2=568247&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/transformation/AbstractCopletTransformer.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/transformation/AbstractCopletTransformer.java
Tue Aug 21 12:55:43 2007
@@ -22,9 +22,9 @@
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.cocoon.environment.ObjectModelHelper;
-import org.apache.cocoon.portal.Constants;
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.om.CopletInstance;
+import org.apache.cocoon.portal.sitemap.Constants;
 import org.apache.cocoon.transformation.AbstractSAXTransformer;
 import org.xml.sax.SAXException;
 
@@ -50,7 +50,7 @@
  *
  * @version $Id$
  */
-public abstract class AbstractCopletTransformer 
+public abstract class AbstractCopletTransformer
 extends AbstractSAXTransformer {
 
     /**
@@ -66,7 +66,7 @@
      * @return The coplet instance data
      * @throws SAXException If an errors occurs or the instance data is not available
      */
-    protected CopletInstance getCopletInstanceData() 
+    protected CopletInstance getCopletInstanceData()
     throws SAXException {
         CopletInstance cid = this.getCopletInstanceData(null);
         if ( cid == null ) {
@@ -82,7 +82,7 @@
      * @return The coplet instance data or null
      * @throws SAXException If an error occurs
      */
-    protected CopletInstance getCopletInstanceData(String instanceId) 
+    protected CopletInstance getCopletInstanceData(String instanceId)
     throws SAXException {
         final Map parentContext = (Map)objectModel.get(ObjectModelHelper.PARENT_CONTEXT);
         String copletId = instanceId;
@@ -95,7 +95,7 @@
                 if ( copletId == null ) {
                     try {
                         copletId = this.parameters.getParameter(COPLET_ID_PARAM);
-                        
+
                     } catch (ParameterException e) {
                         throw new SAXException("copletId must be passed as parameter or in
the object model within the parent context.");
                     }
@@ -116,7 +116,7 @@
      */
     public void service(ServiceManager aManager) throws ServiceException {
         super.service(aManager);
-        this.portalService = (PortalService)this.manager.lookup(PortalService.class.getName());
       
+        this.portalService = (PortalService)this.manager.lookup(PortalService.class.getName());
     }
 
     /**
@@ -125,7 +125,7 @@
     public void dispose() {
         if ( this.portalService != null ) {
             this.manager.release( this.portalService );
-            this.portalService = null;            
+            this.portalService = null;
         }
         super.dispose();
     }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/transformation/ProxyTransformer.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/transformation/ProxyTransformer.java?rev=568247&r1=568246&r2=568247&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/transformation/ProxyTransformer.java
(original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/transformation/ProxyTransformer.java
Tue Aug 21 12:55:43 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.
@@ -36,11 +36,11 @@
 import org.apache.cocoon.environment.ObjectModelHelper;
 import org.apache.cocoon.environment.Request;
 import org.apache.cocoon.environment.SourceResolver;
-import org.apache.cocoon.portal.Constants;
 import org.apache.cocoon.portal.PortalService;
 import org.apache.cocoon.portal.om.CopletDefinition;
 import org.apache.cocoon.portal.om.CopletInstance;
 import org.apache.cocoon.portal.services.LinkService;
+import org.apache.cocoon.portal.sitemap.Constants;
 import org.apache.cocoon.portal.util.HtmlDomParser;
 import org.apache.cocoon.portal.util.InputModuleHelper;
 import org.apache.cocoon.transformation.AbstractTransformer;
@@ -237,7 +237,7 @@
             final StringBuffer query = new StringBuffer();
             if ( pos != -1 ) {
                 if ( !post ) {
-                    query.append('?');                    
+                    query.append('?');
                 }
                 query.append(remoteURI.substring(pos+1));
                 firstparameter = true;
@@ -265,10 +265,10 @@
                     final String value = this.parameters.getParameter(names[i]);
                     if ( value != null && value.trim().length() > 0 ) {
                         final String pName = names[i].substring(4);
-                        firstparameter = this.appendParameter(query, firstparameter, post,
pName, value.trim());                        
+                        firstparameter = this.appendParameter(query, firstparameter, post,
pName, value.trim());
                     }
                 }
-                
+
             }
 
             Document result = null;
@@ -306,10 +306,10 @@
     }
 
     protected boolean appendParameter(StringBuffer buffer,
-                                      boolean firstparameter, 
-                                      boolean post, 
-                                      String name, 
-                                      String value) 
+                                      boolean firstparameter,
+                                      boolean post,
+                                      String name,
+                                      String value)
     throws UnsupportedEncodingException {
         if (firstparameter) {
             if (!post) {
@@ -434,7 +434,7 @@
      * @param connection hte HttpURLConnection to read from
      * @return the result as valid W3C DOM XHTML document
      */
-    protected Document readXML(HttpURLConnection connection) 
+    protected Document readXML(HttpURLConnection connection)
     throws SAXException {
         try {
             String encoding = configuredEncoding;

Added: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/resources/META-INF/cocoon/avalon/portal-sitemap.roles
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/resources/META-INF/cocoon/avalon/portal-sitemap.roles?rev=568247&view=auto
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/resources/META-INF/cocoon/avalon/portal-sitemap.roles
(added)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/resources/META-INF/cocoon/avalon/portal-sitemap.roles
Tue Aug 21 12:55:43 2007
@@ -0,0 +1,32 @@
+<?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.
+-->
+<!-- @version $Id: portal.roles 516084 2007-03-08 15:58:32Z cziegeler $ -->
+<role-list>
+
+  <!--+
+      | Input Modules.
+      |
+      +-->
+    <role name="org.apache.cocoon.components.modules.input.InputModule/coplet"
+          default-class="org.apache.cocoon.portal.sitemap.modules.CopletModule"/>
+    <role name="org.apache.cocoon.components.modules.input.InputModule/portal-layout"
+          default-class="org.apache.cocoon.portal.sitemap.modules.LayoutModule"/>
+    <role name="org.apache.cocoon.components.modules.input.InputModule/portal-skin"
+          default-class="org.apache.cocoon.portal.sitemap.modules.SkinModule"/>
+
+</role-list>
\ No newline at end of file



Mime
View raw message