cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r633260 [1/2] - in /cocoon/trunk/blocks/cocoon-portal: cocoon-portal-converter-castor/src/main/java/org/apache/cocoon/portal/converter/castor/ cocoon-portal-impl/ cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl...
Date Mon, 03 Mar 2008 20:21:17 GMT
Author: cziegeler
Date: Mon Mar  3 12:21:05 2008
New Revision: 633260

URL: http://svn.apache.org/viewvc?rev=633260&view=rev
Log:
Further reduce the dependencies to Cocoon core.

Added:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/util/SaxBuffer.java   (with props)
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/util/XMLUtils.java   (with props)
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/avalon/
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/avalon/AbstractComponent.java
      - copied, changed from r617587, cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/util/AbstractComponent.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/source/
      - copied from r617587, cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/source/
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/source/CopletSource.java
      - copied unchanged from r633232, cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/source/CopletSource.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/source/CopletSourceFactory.java
      - copied, changed from r633232, cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/source/CopletSourceFactory.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/source/LayoutSource.java
      - copied unchanged from r633232, cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/source/LayoutSource.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/src/main/java/org/apache/cocoon/portal/source/LayoutSourceFactory.java
      - copied, changed from r633232, cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/source/LayoutSourceFactory.java
Removed:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/source/
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/util/AbstractComponent.java
Modified:
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-converter-castor/src/main/java/org/apache/cocoon/portal/converter/castor/CastorSourceConverter.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/pom.xml
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/AbstractCopletAdapter.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/DefaultEventConverter.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCIncludeAspect.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CIncludeCopletAspect.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CompositeContentAspect.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/DefaultCopletAspect.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/IncludeCopletAspect.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/ParameterAspect.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/RemovableAspect.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.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/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/XSLTAspect.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LayoutType.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/DefaultLayoutFactory.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/DefaultPortalManager.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/InformationProviderServiceImpl.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletPreferencesProviderImpl.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistryImpl.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/services/factory/FactoryManagerServiceImpl.java
    cocoon/trunk/blocks/cocoon-portal/cocoon-portal-sitemap/pom.xml

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-converter-castor/src/main/java/org/apache/cocoon/portal/converter/castor/CastorSourceConverter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-converter-castor/src/main/java/org/apache/cocoon/portal/converter/castor/CastorSourceConverter.java?rev=633260&r1=633259&r2=633260&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-converter-castor/src/main/java/org/apache/cocoon/portal/converter/castor/CastorSourceConverter.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-converter-castor/src/main/java/org/apache/cocoon/portal/converter/castor/CastorSourceConverter.java Mon Mar  3 12:21:05 2008
@@ -22,6 +22,7 @@
 import java.io.OutputStreamWriter;
 import java.io.UnsupportedEncodingException;
 import java.io.Writer;
+import java.net.URLEncoder;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -34,7 +35,6 @@
 import org.apache.cocoon.portal.profile.ProfileKey;
 import org.apache.cocoon.portal.profile.ProfileStore;
 import org.apache.cocoon.portal.util.AbstractBean;
-import org.apache.cocoon.util.NetUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.excalibur.source.ModifiableSource;
@@ -308,7 +308,7 @@
 
         buffer.append("&content=");
         try {
-            buffer.append(NetUtils.encode(writer.toString(), "utf-8"));
+            buffer.append(URLEncoder.encode(writer.toString(), "utf-8"));
         } catch (UnsupportedEncodingException uee) {
             // ignore this as utf-8 is always supported
         }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/pom.xml?rev=633260&r1=633259&r2=633260&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/pom.xml (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/pom.xml Mon Mar  3 12:21:05 2008
@@ -49,19 +49,27 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.cocoon</groupId>
-      <artifactId>cocoon-core</artifactId>
+      <artifactId>cocoon-portal-api</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.cocoon</groupId>
-      <artifactId>cocoon-portal-api</artifactId>
+      <artifactId>cocoon-spring-configurator</artifactId>
     </dependency>
     <dependency>
       <groupId>org.apache.cocoon</groupId>
-      <artifactId>cocoon-ajax-impl</artifactId>
+      <artifactId>cocoon-thread-api</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.cocoon</groupId>
-      <artifactId>cocoon-forms-impl</artifactId>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-web</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>commons-jxpath</groupId>
+      <artifactId>commons-jxpath</artifactId>
     </dependency>
     <dependency>
       <groupId>commons-collections</groupId>
@@ -81,38 +89,25 @@
       <artifactId>nekodtd</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.apache.cocoon</groupId>
-      <artifactId>cocoon-serializers-charsets</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.cocoon</groupId>
-      <artifactId>cocoon-core</artifactId>
-      <type>test-jar</type>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
       <scope>test</scope>
     </dependency>
-     <!--  
-          Test dependencies
-          TODO remove these when MNG-1378 is fixed, these are inherited from the root pom normally
-     -->
     <dependency>
-      <groupId>xmlunit</groupId>
-      <artifactId>xmlunit</artifactId>
-      <scope>test</scope>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-serializers-charsets</artifactId>
     </dependency>
     <dependency>
-      <groupId>jmock</groupId>
-      <artifactId>jmock</artifactId>
-      <scope>test</scope>
+      <groupId>org.apache.excalibur.components</groupId>
+      <artifactId>excalibur-sourceresolve</artifactId>
     </dependency>
     <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <scope>test</scope>
+      <groupId>org.apache.excalibur.components</groupId>
+      <artifactId>excalibur-xmlutil</artifactId>
     </dependency>
     <dependency>
-      <groupId>easymock</groupId>
-      <artifactId>easymock</artifactId>
-      <scope>test</scope>
+      <groupId>org.apache.cocoon</groupId>
+      <artifactId>cocoon-xml-api</artifactId>
     </dependency>
   </dependencies>
   

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/AbstractCopletAdapter.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/AbstractCopletAdapter.java?rev=633260&r1=633259&r2=633260&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/AbstractCopletAdapter.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/coplet/adapter/impl/AbstractCopletAdapter.java Mon Mar  3 12:21:05 2008
@@ -32,8 +32,8 @@
 import org.apache.cocoon.portal.om.CopletInstance;
 import org.apache.cocoon.portal.om.CopletInstanceFeatures;
 import org.apache.cocoon.portal.util.AbstractBean;
+import org.apache.cocoon.portal.util.SaxBuffer;
 import org.apache.cocoon.thread.RunnableManager;
-import org.apache.cocoon.xml.SaxBuffer;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.AttributesImpl;

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/DefaultEventConverter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/DefaultEventConverter.java?rev=633260&r1=633259&r2=633260&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/DefaultEventConverter.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/event/impl/DefaultEventConverter.java Mon Mar  3 12:21:05 2008
@@ -30,7 +30,6 @@
 import org.apache.cocoon.portal.event.Event;
 import org.apache.cocoon.portal.event.EventConverter;
 import org.apache.cocoon.portal.util.AbstractBean;
-import org.apache.cocoon.util.HashUtil;
 
 /**
  * This implementation stores the events that can't be converted to strings (which don't
@@ -86,7 +85,7 @@
             while ( i.hasNext() ) {
                 final Map.Entry current = (Map.Entry)i.next();
                 final Constructor c = this.getConstructor(current.getValue().toString());
-                final long hash = HashUtil.hash(current.getValue().toString());
+                final long hash = current.getValue().hashCode();
                 final String hashKey = Long.toString(hash);
                 // check for duplicate hash code
                 if ( this.factories.containsKey(hashKey) ) {
@@ -131,7 +130,7 @@
         // check if *this* event is convertable
         if ( data != null ) {
             final String eventClassName = event.getClass().getName();
-            final long hash = HashUtil.hash(eventClassName);
+            final long hash = eventClassName.hashCode();
             final String hashKey = Long.toString(hash);
             Object o = this.factories.get(hashKey);
             if ( o == null ) {
@@ -188,9 +187,9 @@
                     } catch (InstantiationException ie) {
                         // we ignore this
                     } catch (InvocationTargetException ite) {
-                        // we ignore this                    
+                        // we ignore this
                     } catch (IllegalAccessException iae) {
-                        // we ignore this                    
+                        // we ignore this
                     }
                 }
             }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCIncludeAspect.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/AbstractCIncludeAspect.java?rev=633260&r1=633259&r2=633260&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCIncludeAspect.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/AbstractCIncludeAspect.java Mon Mar  3 12:21:05 2008
@@ -16,10 +16,10 @@
  */
 package org.apache.cocoon.portal.layout.renderer.aspect.impl;
 
-import org.apache.cocoon.transformation.CIncludeTransformer;
-import org.apache.cocoon.xml.AttributesImpl;
+import org.apache.cocoon.portal.util.XMLUtils;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
 
 /**
  * Base class for aspect renderers that generate cinclude statements. Provides a single
@@ -27,18 +27,18 @@
  *
  * @version $Id$
  */
-public abstract class AbstractCIncludeAspect 
+public abstract class AbstractCIncludeAspect
     extends AbstractAspect {
 
     protected static final String PREFIX = "cinclude";
-    protected static final String NAMESPACE = CIncludeTransformer.CINCLUDE_NAMESPACE_URI;
-    protected static final String ELEMENT = CIncludeTransformer.CINCLUDE_INCLUDE_ELEMENT;
+    protected static final String NAMESPACE = "http://apache.org/cocoon/include/1.0";
+    protected static final String ELEMENT = "include";
     protected static final String QELEMENT= PREFIX + ":" + ELEMENT;
-    protected static final String ATTRIBUTE = CIncludeTransformer.CINCLUDE_INCLUDE_ELEMENT_SRC_ATTRIBUTE; 
+    protected static final String ATTRIBUTE = "src";
 
     /**
      * Create the cinclude statement.
-     * 
+     *
      * @param source attribute value for the cinclude tag
      * @param handler SAX event handler
      */
@@ -46,7 +46,7 @@
     throws SAXException {
         handler.startPrefixMapping(PREFIX, NAMESPACE);
         final AttributesImpl attributes = new AttributesImpl();
-        attributes.addCDATAAttribute(ATTRIBUTE, source);
+        XMLUtils.addCDATAAttribute(attributes, ATTRIBUTE, source);
         handler.startElement(NAMESPACE, ELEMENT, QELEMENT, attributes);
         handler.endElement(NAMESPACE, ELEMENT, QELEMENT);
         handler.endPrefixMapping(PREFIX);

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CIncludeCopletAspect.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/CIncludeCopletAspect.java?rev=633260&r1=633259&r2=633260&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CIncludeCopletAspect.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CIncludeCopletAspect.java Mon Mar  3 12:21:05 2008
@@ -27,11 +27,11 @@
 import org.apache.cocoon.portal.om.LayoutException;
 import org.apache.cocoon.portal.om.LayoutFeatures;
 import org.apache.cocoon.portal.services.PortalManager;
-import org.apache.cocoon.xml.AttributesImpl;
-import org.apache.cocoon.xml.XMLUtils;
+import org.apache.cocoon.portal.util.XMLUtils;
 import org.apache.commons.lang.BooleanUtils;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
 
 /**
  * This aspect streams a cinclude statement into the stream that
@@ -93,8 +93,10 @@
             buffer.append(cid.getId());
             buffer.append("\");");
             final AttributesImpl a = new AttributesImpl();
-            a.addCDATAAttribute("type", "text/javascript");
-            XMLUtils.createElement(handler, "script", a, buffer.toString());
+            XMLUtils.addCDATAAttribute(a, "type", "text/javascript");
+            XMLUtils.startElement(handler,  "script", a);
+            XMLUtils.data(handler, buffer.toString());
+            XMLUtils.endElement(handler, "script");
         } else {
             this.createCInclude("coplet://" + cid.getId(), handler);
         }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CompositeContentAspect.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/CompositeContentAspect.java?rev=633260&r1=633259&r2=633260&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CompositeContentAspect.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/CompositeContentAspect.java Mon Mar  3 12:21:05 2008
@@ -25,11 +25,11 @@
 import org.apache.cocoon.portal.om.Item;
 import org.apache.cocoon.portal.om.Layout;
 import org.apache.cocoon.portal.om.LayoutException;
-import org.apache.cocoon.xml.AttributesImpl;
-import org.apache.cocoon.xml.XMLUtils;
+import org.apache.cocoon.portal.util.XMLUtils;
 import org.apache.commons.lang.BooleanUtils;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
 
 /**
  * Add several contents.
@@ -81,10 +81,10 @@
         if ( config.rootTag) {
             final AttributesImpl ai = new AttributesImpl();
             if ( config.rootTagClass != null ) {
-                ai.addCDATAAttribute("class", config.rootTagClass);
+                XMLUtils.addCDATAAttribute(ai, "class", config.rootTagClass);
             }
             if ( config.rootTagId != null ) {
-                ai.addCDATAAttribute("id", config.rootTagId);
+                XMLUtils.addCDATAAttribute(ai, "id", config.rootTagId);
             }
             XMLUtils.startElement(handler, config.tagName, ai);
         }
@@ -110,11 +110,11 @@
                 XMLUtils.startElement(handler, config.itemTagName);
             } else {
                 AttributesImpl attributes = new AttributesImpl();
-    
+
     			Map.Entry entry;
     			for (Iterator iter = parameters.entrySet().iterator(); iter.hasNext();) {
     				entry = (Map.Entry) iter.next();
-    				attributes.addCDATAAttribute((String)entry.getKey(), (String)entry.getValue());
+    				XMLUtils.addCDATAAttribute(attributes, (String)entry.getKey(), (String)entry.getValue());
     			}
                 XMLUtils.startElement(handler, config.itemTagName, attributes);
             }
@@ -140,11 +140,11 @@
                 XMLUtils.startElement(handler, config.itemTagName);
             } else {
                 AttributesImpl attributes = new AttributesImpl();
-    
+
     			Map.Entry entry;
     			for (Iterator iter = parameters.entrySet().iterator(); iter.hasNext();) {
     				entry = (Map.Entry) iter.next();
-    				attributes.addCDATAAttribute((String)entry.getKey(), (String)entry.getValue());
+    				XMLUtils.addCDATAAttribute(attributes, (String)entry.getKey(), (String)entry.getValue());
     			}
                 XMLUtils.startElement(handler, config.itemTagName, attributes);
             }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/DefaultCopletAspect.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/DefaultCopletAspect.java?rev=633260&r1=633259&r2=633260&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/DefaultCopletAspect.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/DefaultCopletAspect.java Mon Mar  3 12:21:05 2008
@@ -28,12 +28,11 @@
 import org.apache.cocoon.portal.om.LayoutException;
 import org.apache.cocoon.portal.om.LayoutFeatures;
 import org.apache.cocoon.portal.services.PortalManager;
-import org.apache.cocoon.xml.AttributesImpl;
-import org.apache.cocoon.xml.IncludeXMLConsumer;
-import org.apache.cocoon.xml.XMLUtils;
+import org.apache.cocoon.portal.util.XMLUtils;
 import org.apache.commons.lang.BooleanUtils;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
 
 /**
  * This aspect directly invokes the coplet adapter to stream out the coplet content.
@@ -85,11 +84,13 @@
             buffer.append(cid.getId());
             buffer.append("\");");
             final AttributesImpl a = new AttributesImpl();
-            a.addCDATAAttribute("type", "text/javascript");
-            XMLUtils.createElement(handler, "script", a, buffer.toString());
+            XMLUtils.addCDATAAttribute(a, "type", "text/javascript");
+            XMLUtils.startElement(handler, "script", a);
+            XMLUtils.data(handler, buffer.toString());
+            XMLUtils.endElement(handler, "script");
         } else {
             final CopletAdapter copletAdapter = cid.getCopletDefinition().getCopletType().getCopletAdapter();
-            copletAdapter.toSAX(cid, new IncludeXMLConsumer(handler));
+            copletAdapter.toSAX(cid, handler);
         }
 
         if ( config.rootTag ) {

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/IncludeCopletAspect.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/IncludeCopletAspect.java?rev=633260&r1=633259&r2=633260&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/IncludeCopletAspect.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/IncludeCopletAspect.java Mon Mar  3 12:21:05 2008
@@ -27,11 +27,11 @@
 import org.apache.cocoon.portal.om.LayoutException;
 import org.apache.cocoon.portal.om.LayoutFeatures;
 import org.apache.cocoon.portal.services.PortalManager;
-import org.apache.cocoon.xml.AttributesImpl;
-import org.apache.cocoon.xml.XMLUtils;
+import org.apache.cocoon.portal.util.XMLUtils;
 import org.apache.commons.lang.BooleanUtils;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
 
 /**
  * This aspect streams a cinclude statement into the stream that
@@ -93,8 +93,10 @@
             buffer.append(cid.getId());
             buffer.append("\");");
             final AttributesImpl a = new AttributesImpl();
-            a.addCDATAAttribute("type", "text/javascript");
-            XMLUtils.createElement(handler, "script", a, buffer.toString());
+            XMLUtils.addCDATAAttribute(a, "type", "text/javascript");
+            XMLUtils.startElement(handler, "script", a);
+            XMLUtils.data(handler, buffer.toString());
+            XMLUtils.endElement(handler, "script");
         } else {
             this.createInclude("coplet://" + cid.getId(), handler);
         }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/ParameterAspect.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/ParameterAspect.java?rev=633260&r1=633259&r2=633260&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/ParameterAspect.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/ParameterAspect.java Mon Mar  3 12:21:05 2008
@@ -24,10 +24,10 @@
 import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
 import org.apache.cocoon.portal.om.Layout;
 import org.apache.cocoon.portal.om.LayoutException;
-import org.apache.cocoon.xml.AttributesImpl;
-import org.apache.cocoon.xml.XMLUtils;
+import org.apache.cocoon.portal.util.XMLUtils;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
 
 /**
  * Add layout parameter to resulting XML stream so that they can be picked
@@ -45,13 +45,13 @@
  * <h2>Applicable to:</h2>
  * <ul>
  *  <li>{@link org.apache.cocoon.portal.om.Layout}</li>
- * </ul> 
+ * </ul>
  *
  * <h2>Parameters</h2>
  * <table><tbody>
  * <tr><th>tag-name</th><td>Name of tag holding key-value pairs as attributes.</td>
  *  <td></td><td>String</td><td><code>"parameter"</code></td></tr>
- * </tbody></table> 
+ * </tbody></table>
  *
  * @version $Id$
  */
@@ -72,7 +72,7 @@
             Map.Entry entry;
             for (Iterator iter = parameter.entrySet().iterator(); iter.hasNext();) {
                 entry = (Map.Entry) iter.next();
-                attributes.addCDATAAttribute((String)entry.getKey(), (String)entry.getValue());
+                XMLUtils.addCDATAAttribute(attributes, (String)entry.getKey(), (String)entry.getValue());
             }
             XMLUtils.startElement(contenthandler, config.tagName, attributes);
         } else {

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/RemovableAspect.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/RemovableAspect.java?rev=633260&r1=633259&r2=633260&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/RemovableAspect.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/RemovableAspect.java Mon Mar  3 12:21:05 2008
@@ -5,7 +5,7 @@
  * 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
@@ -23,7 +23,7 @@
 import org.apache.cocoon.portal.om.CopletLayout;
 import org.apache.cocoon.portal.om.Layout;
 import org.apache.cocoon.portal.om.LayoutException;
-import org.apache.cocoon.xml.XMLUtils;
+import org.apache.cocoon.portal.util.XMLUtils;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
 
@@ -45,7 +45,7 @@
  *
  * @version $Id$
  */
-public class RemovableAspect 
+public class RemovableAspect
     extends AbstractAspect {
 
 	/**
@@ -57,17 +57,20 @@
 	throws SAXException, LayoutException {
         if ( layout instanceof CopletLayout ) {
             final CopletInstance cid = this.getCopletInstance(((CopletLayout)layout).getCopletInstanceId());
-    
+
             boolean mandatory = CopletDefinitionFeatures.isMandatory(cid.getCopletDefinition());
             if ( !mandatory ) {
                 RemoveLayoutEvent lre = new RemoveLayoutEvent(layout);
-                XMLUtils.createElement(handler, "remove-uri", rendererContext.getPortalService().getLinkService().getLinkURI(lre));
+                XMLUtils.startElement(handler, "remove-uri");
+                XMLUtils.data(handler, rendererContext.getPortalService().getLinkService().getLinkURI(lre));
+                XMLUtils.endElement(handler, "remove-uri");
             }
         } else {
             // for any other layout just create the event
             RemoveLayoutEvent lre = new RemoveLayoutEvent(layout);
-            XMLUtils.createElement(handler, "remove-uri", 
-                                   rendererContext.getPortalService().getLinkService().getLinkURI(lre));
+            XMLUtils.startElement(handler, "remove-uri");
+            XMLUtils.data(handler, rendererContext.getPortalService().getLinkService().getLinkURI(lre));
+            XMLUtils.endElement(handler, "remove-uri");
         }
         rendererContext.invokeNext(layout, handler);
 	}

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.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/TabContentAspect.java?rev=633260&r1=633259&r2=633260&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/TabContentAspect.java Mon Mar  3 12:21:05 2008
@@ -16,10 +16,10 @@
  */
 package org.apache.cocoon.portal.layout.renderer.aspect.impl;
 
+import java.util.ArrayList;
 import java.util.Iterator;
-import java.util.Map;
 import java.util.List;
-import java.util.ArrayList;
+import java.util.Map;
 import java.util.Properties;
 
 import org.apache.cocoon.portal.PortalException;
@@ -35,11 +35,11 @@
 import org.apache.cocoon.portal.om.LayoutInstance;
 import org.apache.cocoon.portal.om.NamedItem;
 import org.apache.cocoon.portal.om.LayoutFeatures.RenderInfo;
-import org.apache.cocoon.xml.AttributesImpl;
-import org.apache.cocoon.xml.XMLUtils;
+import org.apache.cocoon.portal.util.XMLUtils;
 import org.apache.commons.lang.BooleanUtils;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
 
 /**
  * <h2>Example XML:</h2>
@@ -109,7 +109,7 @@
  *
  * @version $Id$
  */
-public class TabContentAspect 
+public class TabContentAspect
     extends CompositeContentAspect {
 
     /**
@@ -147,7 +147,7 @@
             // open named-item tag
             attributes.clear();
             if ( tab instanceof NamedItem ) {
-                attributes.addCDATAAttribute("name", ((NamedItem)tab).getName());
+                XMLUtils.addCDATAAttribute(attributes, "name", ((NamedItem)tab).getName());
             }
             boolean selected = false;
             if ( config.useNames ) {
@@ -162,17 +162,17 @@
                 selected = (j == selectedTabIndex);
             }
             if ( selected ) {
-                attributes.addCDATAAttribute("selected", "true");
+                XMLUtils.addCDATAAttribute(attributes, "selected", "true");
             }
             final LayoutInstanceChangeAttributeEvent event;
             event = new ChangeTabEvent(layoutInstance, tab, config.useNames);
-            attributes.addCDATAAttribute("parameter", rendererContext.getPortalService().getLinkService().getLinkURI(event)); 
+            XMLUtils.addCDATAAttribute(attributes, "parameter", rendererContext.getPortalService().getLinkService().getLinkURI(event));
 
             // add parameters
             final Iterator iter = tab.getParameters().entrySet().iterator();
             while ( iter.hasNext() ) {
                 final Map.Entry entry = (Map.Entry) iter.next();
-                attributes.addCDATAAttribute((String)entry.getKey(), (String)entry.getValue());
+                XMLUtils.addCDATAAttribute(attributes, (String)entry.getKey(), (String)entry.getValue());
             }
 
             XMLUtils.startElement(handler, "named-item", attributes);
@@ -237,20 +237,20 @@
                     XMLUtils.startElement(handler, config.childTagName);
                     subNav = true;
                 }
-                attributes.addCDATAAttribute("name", ((NamedItem) tab).getName());
+                XMLUtils.addCDATAAttribute(attributes, "name", ((NamedItem) tab).getName());
                 final LayoutInstanceChangeAttributeEvent event;
                 event = new ChangeTabEvent(layoutInstance, tab, config.useNames);
                 List events = new ArrayList(parentEvents);
                 events.add(event);
 
-                attributes.addCDATAAttribute("parameter",
+                XMLUtils.addCDATAAttribute(attributes, "parameter",
                     service.getLinkService().getLinkURI(events));
 
                 // add parameters
                 final Iterator iter = tab.getParameters().entrySet().iterator();
                 while (iter.hasNext()) {
                     final Map.Entry entry = (Map.Entry) iter.next();
-                    attributes.addCDATAAttribute((String) entry.getKey(),
+                    XMLUtils.addCDATAAttribute(attributes, (String) entry.getKey(),
                         (String) entry.getValue());
                 }
 
@@ -287,7 +287,7 @@
      * @see org.apache.cocoon.portal.layout.renderer.aspect.impl.CompositeContentAspect#prepareConfiguration(java.util.Properties)
      */
     public Object prepareConfiguration(Properties configuration)
-    throws PortalException { 
+    throws PortalException {
         TabPreparedConfiguration pc = new TabPreparedConfiguration();
         pc.takeValues((PreparedConfiguration)super.prepareConfiguration(configuration));
         pc.childTagName = configuration.getProperty("child-tag-name", "");

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=633260&r1=633259&r2=633260&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 Mon Mar  3 12:21:05 2008
@@ -36,7 +36,7 @@
 import org.apache.cocoon.portal.om.Layout;
 import org.apache.cocoon.portal.om.LayoutException;
 import org.apache.cocoon.portal.om.LayoutFeatures;
-import org.apache.cocoon.xml.XMLUtils;
+import org.apache.cocoon.portal.util.XMLUtils;
 import org.apache.commons.lang.BooleanUtils;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
@@ -145,7 +145,9 @@
                                                  Layout             layout,
                                                  ContentHandler     contenthandler)
     throws SAXException {
-        XMLUtils.createElement(contenthandler, WindowAspect.INSTANCE_ID_TAG, cid.getId());
+        XMLUtils.startElement(contenthandler, WindowAspect.INSTANCE_ID_TAG);
+        XMLUtils.data(contenthandler, cid.getId());
+        XMLUtils.endElement(contenthandler, WindowAspect.INSTANCE_ID_TAG);
     }
 
     protected void streamTitle(CopletInstance cid,
@@ -160,7 +162,9 @@
         if ( title == null ) {
             title = cid.getTitle();
         }
-        XMLUtils.createElement(contenthandler, WindowAspect.TITLE_TAG, title);
+        XMLUtils.startElement(contenthandler, WindowAspect.TITLE_TAG);
+        XMLUtils.data(contenthandler, title);
+        XMLUtils.endElement(contenthandler, WindowAspect.TITLE_TAG);
     }
 
     protected void streamCopletModes(CopletInstance cid,
@@ -174,7 +178,9 @@
             final Iterator i = windowStates.iterator();
             while ( i.hasNext() ) {
                 final DecorationAction action = (DecorationAction)i.next();
-                XMLUtils.createElement(contenthandler, action.getName(), action.getUrl());
+                XMLUtils.startElement(contenthandler, action.getName());
+                XMLUtils.data(contenthandler, action.getUrl());
+                XMLUtils.endElement(contenthandler, action.getName());
             }
         }
     }
@@ -187,7 +193,9 @@
         boolean mandatory = CopletDefinitionFeatures.isMandatory(cid.getCopletDefinition());
         if ( !mandatory ) {
             RemoveLayoutEvent lre = new RemoveLayoutEvent(layout);
-            XMLUtils.createElement(contenthandler, "remove-uri", this.portalService.getLinkService().getLinkURI(lre));
+            XMLUtils.startElement(contenthandler, "remove-uri");
+            XMLUtils.data(contenthandler, this.portalService.getLinkService().getLinkURI(lre));
+            XMLUtils.endElement(contenthandler, "remove-uri");
         }
     }
 
@@ -203,7 +211,9 @@
             final int size = cid.getSize();
 
             // stream out the current size
-            XMLUtils.createElement(contenthandler, WindowAspect.SIZE_TAG, CopletInstanceFeatures.sizeToString(size));
+            XMLUtils.startElement(contenthandler, WindowAspect.SIZE_TAG);
+            XMLUtils.data(contenthandler, CopletInstanceFeatures.sizeToString(size));
+            XMLUtils.endElement(contenthandler, WindowAspect.SIZE_TAG);
 
             // Does the coplet type provide the window states for us?
             if ( adapter instanceof CopletDecorationProvider ) {
@@ -211,23 +221,31 @@
                 final Iterator i = windowStates.iterator();
                 while ( i.hasNext() ) {
                     final DecorationAction action = (DecorationAction)i.next();
-                    XMLUtils.createElement(contenthandler, action.getName(), action.getUrl());
+                    XMLUtils.startElement(contenthandler, action.getName());
+                    XMLUtils.data(contenthandler, action.getUrl());
+                    XMLUtils.endElement(contenthandler, action.getName());
                 }
             } else {
                 Event event;
 
                 if ( size != CopletInstance.SIZE_MINIMIZED ) {
                     event = new CopletInstanceSizingEvent(cid, CopletInstance.SIZE_MINIMIZED);
-                    XMLUtils.createElement(contenthandler, DecorationAction.WINDOW_STATE_MINIMIZED, this.portalService.getLinkService().getLinkURI(event));
+                    XMLUtils.startElement(contenthandler, DecorationAction.WINDOW_STATE_MINIMIZED);
+                    XMLUtils.data(contenthandler, this.portalService.getLinkService().getLinkURI(event));
+                    XMLUtils.endElement(contenthandler, DecorationAction.WINDOW_STATE_MINIMIZED);
                 }
                 if ( size != CopletInstance.SIZE_NORMAL) {
                     event = new CopletInstanceSizingEvent(cid, CopletInstance.SIZE_NORMAL);
-                    XMLUtils.createElement(contenthandler, DecorationAction.WINDOW_STATE_NORMAL, this.portalService.getLinkService().getLinkURI(event));
+                    XMLUtils.startElement(contenthandler, DecorationAction.WINDOW_STATE_NORMAL);
+                    XMLUtils.data(contenthandler, this.portalService.getLinkService().getLinkURI(event));
+                    XMLUtils.endElement(contenthandler, DecorationAction.WINDOW_STATE_NORMAL);
                 }
                 if ( this.enableMaximized ) {
                     if ( size != CopletInstance.SIZE_MAXIMIZED ) {
                         event = new CopletInstanceSizingEvent(cid, CopletInstance.SIZE_MAXIMIZED);
-                        XMLUtils.createElement(contenthandler, DecorationAction.WINDOW_STATE_MAXIMIZED, this.portalService.getLinkService().getLinkURI(event));
+                        XMLUtils.startElement(contenthandler, DecorationAction.WINDOW_STATE_MAXIMIZED);
+                        XMLUtils.data(contenthandler, this.portalService.getLinkService().getLinkURI(event));
+                        XMLUtils.endElement(contenthandler, DecorationAction.WINDOW_STATE_MAXIMIZED);
                     }
                 }
 
@@ -237,10 +255,14 @@
                         final Layout fullScreenLayout = LayoutFeatures.getFullScreenInfo(this.portalService);
                         if ( fullScreenLayout != null && fullScreenLayout.equals( layout )) {
                             event = new CopletInstanceSizingEvent( cid, CopletInstance.SIZE_NORMAL );
-                            XMLUtils.createElement(contenthandler, DecorationAction.WINDOW_STATE_NORMAL, this.portalService.getLinkService().getLinkURI(event));
+                            XMLUtils.startElement(contenthandler, DecorationAction.WINDOW_STATE_NORMAL);
+                            XMLUtils.data(contenthandler, this.portalService.getLinkService().getLinkURI(event));
+                            XMLUtils.endElement(contenthandler, DecorationAction.WINDOW_STATE_NORMAL);
                         } else {
                             event = new CopletInstanceSizingEvent( cid, CopletInstance.SIZE_FULLSCREEN );
-                            XMLUtils.createElement(contenthandler, DecorationAction.WINDOW_STATE_FULLSCREEN, this.portalService.getLinkService().getLinkURI(event));
+                            XMLUtils.startElement(contenthandler, DecorationAction.WINDOW_STATE_FULLSCREEN);
+                            XMLUtils.data(contenthandler, this.portalService.getLinkService().getLinkURI(event));
+                            XMLUtils.endElement(contenthandler, DecorationAction.WINDOW_STATE_FULLSCREEN);
                         }
                     }
                 }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/XSLTAspect.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/XSLTAspect.java?rev=633260&r1=633259&r2=633260&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/XSLTAspect.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/layout/renderer/aspect/impl/XSLTAspect.java Mon Mar  3 12:21:05 2008
@@ -26,14 +26,11 @@
 import javax.xml.transform.sax.SAXResult;
 import javax.xml.transform.sax.TransformerHandler;
 
-import org.apache.avalon.framework.service.ServiceException;
-import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.cocoon.portal.PortalException;
 import org.apache.cocoon.portal.layout.renderer.aspect.RendererAspectContext;
 import org.apache.cocoon.portal.om.Layout;
 import org.apache.cocoon.portal.om.LayoutException;
 import org.apache.cocoon.portal.services.VariableResolver;
-import org.apache.cocoon.xml.IncludeXMLConsumer;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
 import org.apache.excalibur.xml.xslt.XSLTProcessor;
@@ -87,10 +84,10 @@
     /** Source resolver for resolving the stylesheets. */
     protected SourceResolver resolver;
 
-    protected ServiceManager serviceManager;
+    protected XSLTProcessor xsltProcessor;
 
-    public void setServiceManager(ServiceManager sm) {
-        this.serviceManager = sm;
+    public void setXsltProcessor(XSLTProcessor xsltProcessor) {
+        this.xsltProcessor = xsltProcessor;
     }
 
     public void setSourceResolver(SourceResolver resolver) {
@@ -110,12 +107,10 @@
     throws SAXException, LayoutException {
         PreparedConfiguration config = (PreparedConfiguration)rendererContext.getAspectConfiguration();
 
-        XSLTProcessor processor = null;
         Source stylesheet = null;
         try {
             stylesheet = this.resolver.resolveURI(this.getStylesheetURI(config, layout));
-            processor = (XSLTProcessor) this.serviceManager.lookup(config.xsltRole);
-            TransformerHandler transformer = processor.getTransformerHandler(stylesheet);
+            TransformerHandler transformer = this.xsltProcessor.getTransformerHandler(stylesheet);
             // Pass configured parameters to the stylesheet.
             if (config.parameters.size() > 0) {
                 Transformer theTransformer = transformer.getTransformer();
@@ -135,7 +130,7 @@
                     theTransformer.setParameter((String)entry.getKey(), entry.getValue());
                 }
             }
-            SAXResult result = new SAXResult(new IncludeXMLConsumer((handler)));
+            SAXResult result = new SAXResult(handler);
             if (handler instanceof LexicalHandler) {
                 result.setLexicalHandler((LexicalHandler) handler);
             }
@@ -148,11 +143,8 @@
             throw new SAXException("XSLT Exception.", xpe);
         } catch (IOException io) {
             throw new SAXException("Error in resolving.", io);
-        } catch (ServiceException ce) {
-            throw new SAXException("Unable to lookup component.", ce);
         } finally {
             this.resolver.release(stylesheet);
-            this.serviceManager.release(processor);
         }
 	}
 

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LayoutType.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LayoutType.java?rev=633260&r1=633259&r2=633260&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LayoutType.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/om/LayoutType.java Mon Mar  3 12:21:05 2008
@@ -20,7 +20,6 @@
 import java.util.List;
 
 import org.apache.cocoon.portal.layout.renderer.Renderer;
-import org.apache.cocoon.util.ClassUtils;
 
 
 /**
@@ -142,7 +141,7 @@
             return new Item();
         }
         try {
-            return (Item) ClassUtils.newInstance( this.itemClassName );
+            return (Item) Thread.currentThread().getContextClassLoader().loadClass(this.itemClassName).newInstance();
         } catch (Exception e ) {
             throw new LayoutException("Unable to create new item for layout type " + this + " of class" + this.itemClassName, e);
         }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java?rev=633260&r1=633259&r2=633260&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/profile/impl/GroupBasedProfileManager.java Mon Mar  3 12:21:05 2008
@@ -24,7 +24,6 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.cocoon.ProcessingException;
 import org.apache.cocoon.portal.event.Receiver;
 import org.apache.cocoon.portal.event.coplet.CopletDefinitionAddedEvent;
 import org.apache.cocoon.portal.event.coplet.CopletInstanceAddedEvent;
@@ -307,7 +306,7 @@
             if ( !this.getCopletInstances(profile, user, CATEGORY_USER, profileName) ) {
                 if ( user.getGroups().size() == 0 || !this.getCopletInstances(profile, user, CATEGORY_GROUP, profileName)) {
                     if ( !this.getCopletInstances(profile, user, CATEGORY_GLOBAL, profileName) ) {
-                        throw new ProcessingException("No profile for copletinstancedatas found.");
+                        throw new ProfileException("No profile for copletinstancedatas found.");
                     }
                 }
             }
@@ -315,7 +314,7 @@
             if ( !this.getLayout(profile, user, CATEGORY_USER, profileName) ) {
                 if ( user.getGroups().size() == 0 || !this.getLayout(profile, user, CATEGORY_GROUP, profileName)) {
                     if ( !this.getLayout(profile, user, CATEGORY_GLOBAL, profileName) ) {
-                        throw new ProcessingException("No profile for layout found.");
+                        throw new ProfileException("No profile for layout found.");
                     }
                 }
             }

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/DefaultLayoutFactory.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/DefaultLayoutFactory.java?rev=633260&r1=633259&r2=633260&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/DefaultLayoutFactory.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/DefaultLayoutFactory.java Mon Mar  3 12:21:05 2008
@@ -38,7 +38,6 @@
 import org.apache.cocoon.portal.services.CopletFactory;
 import org.apache.cocoon.portal.services.LayoutFactory;
 import org.apache.cocoon.portal.util.AbstractBean;
-import org.apache.cocoon.util.ClassUtils;
 
 /**
  * Default implementation of the layout factory.
@@ -90,7 +89,7 @@
         }
         Layout layout = null;
         try {
-            Class clazz = ClassUtils.loadClass( layoutType.getLayoutClassName() );
+            Class clazz = Thread.currentThread().getContextClassLoader().loadClass( layoutType.getLayoutClassName() );
             Constructor constructor = clazz.getConstructor(new Class[] {String.class});
             layout = (Layout)constructor.newInstance(new Object[] {layoutId});
             layout.setLayoutType(layoutType);

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/DefaultPortalManager.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/DefaultPortalManager.java?rev=633260&r1=633259&r2=633260&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/DefaultPortalManager.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/services/impl/DefaultPortalManager.java Mon Mar  3 12:21:05 2008
@@ -20,7 +20,6 @@
 import java.util.List;
 import java.util.Properties;
 
-import org.apache.cocoon.ajax.BrowserUpdateTransformer;
 import org.apache.cocoon.portal.PortalException;
 import org.apache.cocoon.portal.PortalRuntimeException;
 import org.apache.cocoon.portal.layout.renderer.Renderer;
@@ -40,11 +39,11 @@
 import org.apache.cocoon.portal.services.aspects.impl.support.ResponseProcessorAspectContextImpl;
 import org.apache.cocoon.portal.services.aspects.support.AspectChainImpl;
 import org.apache.cocoon.portal.util.AbstractBean;
-import org.apache.cocoon.xml.AttributesImpl;
-import org.apache.cocoon.xml.XMLUtils;
+import org.apache.cocoon.portal.util.XMLUtils;
 import org.apache.commons.lang.StringUtils;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
 
 /**
  *
@@ -54,6 +53,8 @@
 	extends AbstractBean
 	implements PortalManager, RequestProcessorAspect, ResponseProcessorAspect {
 
+    public static final String BU_NSURI = "http://apache.org/cocoon/browser-update/1.0";
+
     /** The aspect chain for additional request processing. */
     protected AspectChainImpl requestChain;
 
@@ -161,15 +162,15 @@
         // only render the changed coplets
         if ( portalLayout == null && portalService.getRequestContext().isAjaxRequest() ) {
             Layout rootLayout = profileManager.getLayout(null);
-            ch.startPrefixMapping("bu", BrowserUpdateTransformer.BU_NSURI);
-            ch.startElement(BrowserUpdateTransformer.BU_NSURI, "document", "bu:document", XMLUtils.EMPTY_ATTRIBUTES);
+            ch.startPrefixMapping("bu", BU_NSURI);
+            ch.startElement(BU_NSURI, "document", "bu:document", XMLUtils.EMPTY_ATTRIBUTES);
 
             final List changed = CopletInstanceFeatures.getChangedCopletInstanceDataObjects(this.portalService);
             final Iterator i = changed.iterator();
             while ( i.hasNext() ) {
                 final CopletInstance current = (CopletInstance)i.next();
                 final AttributesImpl a = new AttributesImpl();
-                a.addCDATAAttribute("id", current.getId());
+                XMLUtils.addCDATAAttribute(a, "id", current.getId());
                 XMLUtils.startElement(ch, "coplet", a);
                 final Layout l = LayoutFeatures.searchLayout(this.portalService, current.getId(), rootLayout);
                 Renderer portalLayoutRenderer = l.getRenderer();
@@ -180,22 +181,22 @@
                 }
                 XMLUtils.endElement(ch, "coplet");
             }
-            ch.endElement(BrowserUpdateTransformer.BU_NSURI, "document", "bu:document");
+            ch.endElement(BU_NSURI, "document", "bu:document");
             ch.endPrefixMapping("bu");
         } else {
             if ( StringUtils.isNotEmpty(copletId) ) {
-                ch.startPrefixMapping("bu", BrowserUpdateTransformer.BU_NSURI);
-                ch.startElement(BrowserUpdateTransformer.BU_NSURI, "document", "bu:document", XMLUtils.EMPTY_ATTRIBUTES);
+                ch.startPrefixMapping("bu", BU_NSURI);
+                ch.startElement(BU_NSURI, "document", "bu:document", XMLUtils.EMPTY_ATTRIBUTES);
 
                 final AttributesImpl a = new AttributesImpl();
-                a.addCDATAAttribute("id", copletId);
+                XMLUtils.addCDATAAttribute(a, "id", copletId);
                 XMLUtils.startElement(ch, "coplet", a);
             } else if ( StringUtils.isNotEmpty(layoutId) ) {
-                ch.startPrefixMapping("bu", BrowserUpdateTransformer.BU_NSURI);
-                ch.startElement(BrowserUpdateTransformer.BU_NSURI, "document", "bu:document", XMLUtils.EMPTY_ATTRIBUTES);
+                ch.startPrefixMapping("bu", BU_NSURI);
+                ch.startElement(BU_NSURI, "document", "bu:document", XMLUtils.EMPTY_ATTRIBUTES);
 
                 final AttributesImpl a = new AttributesImpl();
-                a.addCDATAAttribute("id", layoutId);
+                XMLUtils.addCDATAAttribute(a, "id", layoutId);
                 XMLUtils.startElement(ch, "layout", a);
             }
 
@@ -217,11 +218,11 @@
             }
             if ( StringUtils.isNotEmpty(copletId) ) {
                 XMLUtils.endElement(ch, "coplet");
-                ch.endElement(BrowserUpdateTransformer.BU_NSURI, "document", "bu:document");
+                ch.endElement(BU_NSURI, "document", "bu:document");
                 ch.endPrefixMapping("bu");
             } else if ( StringUtils.isNotEmpty(layoutId) ) {
                 XMLUtils.endElement(ch, "layout");
-                ch.endElement(BrowserUpdateTransformer.BU_NSURI, "document", "bu:document");
+                ch.endElement(BU_NSURI, "document", "bu:document");
                 ch.endPrefixMapping("bu");
             }
         }

Added: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/util/SaxBuffer.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/util/SaxBuffer.java?rev=633260&view=auto
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/util/SaxBuffer.java (added)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/util/SaxBuffer.java Mon Mar  3 12:21:05 2008
@@ -0,0 +1,538 @@
+/*
+ * 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.util;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.ext.LexicalHandler;
+
+/**
+ * A class that can record SAX events and replay them later.
+ *
+ * <p>Compared to {@link org.apache.cocoon.components.sax.XMLByteStreamCompiler},
+ * this class is many times faster at sending out the recorded SAX events since
+ * it doesn't need to convert between byte and char representations etc.
+ * On the other hand, its data structure is more complex then a simple byte array,
+ * making XMLByteStreamCompiler better in case the recorded SAX should be stored long-term.
+ *
+ * <p>Use this class if you need to frequently generate smaller amounts of SAX events,
+ * or replay a set of recorded start events immediately.</p>
+ *
+ * <p>Both {@link ContentHandler} and {@link LexicalHandler} are supported, the only
+ * exception is that the setDocumentLocator event is not recorded.</p>
+ *
+ * @version $Id$
+ */
+public class SaxBuffer implements ContentHandler, LexicalHandler {
+
+    /**
+     * Stores list of {@link SaxBit} objects.
+     */
+    protected List saxbits;
+
+    /**
+     * Creates empty SaxBuffer
+     */
+    public SaxBuffer() {
+        this.saxbits = new ArrayList();
+    }
+
+    /**
+     * Creates SaxBuffer based on the provided bits list.
+     */
+    public SaxBuffer(List bits) {
+        this.saxbits = bits;
+    }
+
+    /**
+     * Creates copy of another SaxBuffer
+     */
+    public SaxBuffer(SaxBuffer saxBuffer) {
+        this.saxbits = new ArrayList(saxBuffer.saxbits);
+    }
+
+    //
+    // ContentHandler Interface
+    //
+
+    public void skippedEntity(String name) throws SAXException {
+        saxbits.add(new SkippedEntity(name));
+    }
+
+    public void setDocumentLocator(Locator locator) {
+        // Don't record this event
+    }
+
+    public void ignorableWhitespace(char ch[], int start, int length) throws SAXException {
+        saxbits.add(new IgnorableWhitespace(ch, start, length));
+    }
+
+    public void processingInstruction(String target, String data) throws SAXException {
+        saxbits.add(new PI(target, data));
+    }
+
+    public void startDocument() throws SAXException {
+        saxbits.add(StartDocument.SINGLETON);
+    }
+
+    public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
+        saxbits.add(new StartElement(namespaceURI, localName, qName, atts));
+    }
+
+    public void endPrefixMapping(String prefix) throws SAXException {
+        saxbits.add(new EndPrefixMapping(prefix));
+    }
+
+    public void characters(char ch[], int start, int length) throws SAXException {
+        saxbits.add(new Characters(ch, start, length));
+    }
+
+    public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
+        saxbits.add(new EndElement(namespaceURI, localName, qName));
+    }
+
+    public void endDocument() throws SAXException {
+        saxbits.add(EndDocument.SINGLETON);
+    }
+
+    public void startPrefixMapping(String prefix, String uri) throws SAXException {
+        saxbits.add(new StartPrefixMapping(prefix, uri));
+    }
+
+    //
+    // LexicalHandler Interface
+    //
+
+    public void endCDATA() throws SAXException {
+        saxbits.add(EndCDATA.SINGLETON);
+    }
+
+    public void comment(char ch[], int start, int length) throws SAXException {
+        saxbits.add(new Comment(ch, start, length));
+    }
+
+    public void startEntity(String name) throws SAXException {
+        saxbits.add(new StartEntity(name));
+    }
+
+    public void endDTD() throws SAXException {
+        saxbits.add(EndDTD.SINGLETON);
+    }
+
+    public void startDTD(String name, String publicId, String systemId) throws SAXException {
+        saxbits.add(new StartDTD(name, publicId, systemId));
+    }
+
+    public void startCDATA() throws SAXException {
+        saxbits.add(StartCDATA.SINGLETON);
+    }
+
+    public void endEntity(String name) throws SAXException {
+        saxbits.add(new EndEntity(name));
+    }
+
+    //
+    // Public Methods
+    //
+
+    /**
+     * @return true if buffer is empty
+     */
+    public boolean isEmpty() {
+        return saxbits.isEmpty();
+    }
+
+    /**
+     * @return unmodifiable list of SAX bits
+     */
+    public List getBits() {
+        return Collections.unmodifiableList(saxbits);
+    }
+
+    /**
+     * Stream this buffer into the provided content handler.
+     * If contentHandler object implements LexicalHandler, it will get lexical
+     * events as well.
+     */
+    public void toSAX(ContentHandler contentHandler) throws SAXException {
+        for (Iterator i = saxbits.iterator(); i.hasNext();) {
+            SaxBit saxbit = (SaxBit)i.next();
+            saxbit.send(contentHandler);
+        }
+    }
+
+    /**
+     * @return String value of the buffer
+     */
+    public String toString() {
+        // NOTE: This method is used in i18n XML bundle implementation
+        final StringBuffer value = new StringBuffer();
+        for (Iterator i = saxbits.iterator(); i.hasNext();) {
+            final SaxBit saxbit = (SaxBit) i.next();
+            if (saxbit instanceof Characters) {
+                ((Characters) saxbit).toString(value);
+            }
+        }
+
+        return value.toString();
+    }
+
+    /**
+     * Clear this buffer
+     */
+    public void recycle() {
+        saxbits.clear();
+    }
+
+    /**
+     * Dump buffer contents into the provided writer.
+     */
+    public void dump(Writer writer) throws IOException {
+        Iterator i = saxbits.iterator();
+        while (i.hasNext()) {
+            final SaxBit saxbit = (SaxBit) i.next();
+            saxbit.dump(writer);
+        }
+        writer.flush();
+    }
+
+    //
+    // Implementation Methods
+    //
+
+    /**
+     * Adds a SaxBit to the bits list
+     */
+    protected final void addBit(SaxBit bit) {
+        saxbits.add(bit);
+    }
+
+    /**
+     * Iterates through the bits list
+     */
+    protected final Iterator bits() {
+        return saxbits.iterator();
+    }
+
+    /**
+     * SaxBit is a representation of the SAX event. Every SaxBit is immutable object.
+     */
+    interface SaxBit {
+        public void send(ContentHandler contentHandler) throws SAXException;
+        public void dump(Writer writer) throws IOException;
+    }
+
+    public final static class StartDocument implements SaxBit, Serializable {
+        public static final StartDocument SINGLETON = new StartDocument();
+
+        public void send(ContentHandler contentHandler) throws SAXException {
+            contentHandler.startDocument();
+        }
+
+        public void dump(Writer writer) throws IOException {
+            writer.write("[StartDocument]\n");
+        }
+    }
+
+    public final static class EndDocument implements SaxBit, Serializable {
+        public static final EndDocument SINGLETON = new EndDocument();
+
+        public void send(ContentHandler contentHandler) throws SAXException {
+            contentHandler.endDocument();
+        }
+
+        public void dump(Writer writer) throws IOException {
+            writer.write("[EndDocument]\n");
+        }
+    }
+
+    public final static class PI implements SaxBit, Serializable {
+        public final String target;
+        public final String data;
+
+        public PI(String target, String data) {
+            this.target = target;
+            this.data = data;
+        }
+
+        public void send(ContentHandler contentHandler) throws SAXException {
+            contentHandler.processingInstruction(target, data);
+        }
+
+        public void dump(Writer writer) throws IOException {
+            writer.write("[ProcessingInstruction] target=" + target + ",data=" + data + "\n");
+        }
+    }
+
+    public final static class StartDTD implements SaxBit, Serializable {
+        public final String name;
+        public final String publicId;
+        public final String systemId;
+
+        public StartDTD(String name, String publicId, String systemId) {
+            this.name = name;
+            this.publicId = publicId;
+            this.systemId = systemId;
+        }
+
+        public void send(ContentHandler contentHandler) throws SAXException {
+            if (contentHandler instanceof LexicalHandler)
+                ((LexicalHandler)contentHandler).startDTD(name, publicId, systemId);
+        }
+
+        public void dump(Writer writer) throws IOException {
+            writer.write("[StartDTD] name=" + name + ",publicId=" + publicId + ",systemId=" + systemId + "\n");
+        }
+    }
+
+    public final static class EndDTD implements SaxBit, Serializable {
+        public static final EndDTD SINGLETON = new EndDTD();
+
+        public void send(ContentHandler contentHandler) throws SAXException {
+            if (contentHandler instanceof LexicalHandler)
+                ((LexicalHandler)contentHandler).endDTD();
+        }
+
+        public void dump(Writer writer) throws IOException {
+            writer.write("[EndDTD]\n");
+        }
+    }
+
+    public final static class StartEntity implements SaxBit, Serializable {
+        public final String name;
+
+        public StartEntity(String name) {
+            this.name = name;
+        }
+
+        public void send(ContentHandler contentHandler) throws SAXException {
+            if (contentHandler instanceof LexicalHandler)
+                ((LexicalHandler)contentHandler).startEntity(name);
+        }
+
+        public void dump(Writer writer) throws IOException {
+            writer.write("[StartEntity] name=" + name + "\n");
+        }
+    }
+
+    public final static class EndEntity implements SaxBit, Serializable {
+        public final String name;
+
+        public EndEntity(String name) {
+            this.name = name;
+        }
+
+        public void send(ContentHandler contentHandler) throws SAXException {
+            if (contentHandler instanceof LexicalHandler)
+                ((LexicalHandler)contentHandler).endEntity(name);
+        }
+
+        public void dump(Writer writer) throws IOException {
+            writer.write("[EndEntity] name=" + name + "\n");
+        }
+    }
+
+    public final static class SkippedEntity implements SaxBit, Serializable {
+        public final String name;
+
+        public SkippedEntity(String name) {
+            this.name = name;
+        }
+
+        public void send(ContentHandler contentHandler) throws SAXException {
+            contentHandler.skippedEntity(name);
+        }
+
+        public void dump(Writer writer) throws IOException {
+            writer.write("[SkippedEntity] name=" + name + "\n");
+        }
+    }
+
+    public final static class StartPrefixMapping implements SaxBit, Serializable {
+        public final String prefix;
+        public final String uri;
+
+        public StartPrefixMapping(String prefix, String uri) {
+            this.prefix = prefix;
+            this.uri = uri;
+        }
+
+        public void send(ContentHandler contentHandler) throws SAXException {
+            contentHandler.startPrefixMapping(prefix, uri);
+        }
+
+        public void dump(Writer writer) throws IOException {
+            writer.write("[StartPrefixMapping] prefix=" + prefix + ",uri=" + uri + "\n");
+        }
+    }
+
+    public final static class EndPrefixMapping implements SaxBit, Serializable {
+        public final String prefix;
+
+        public EndPrefixMapping(String prefix) {
+            this.prefix = prefix;
+        }
+
+        public void send(ContentHandler contentHandler) throws SAXException {
+            contentHandler.endPrefixMapping(prefix);
+        }
+
+        public void dump(Writer writer) throws IOException {
+            writer.write("[EndPrefixMapping] prefix=" + prefix + "\n");
+        }
+    }
+
+    public final static class StartElement implements SaxBit, Serializable {
+        public final String namespaceURI;
+        public final String localName;
+        public final String qName;
+        public final Attributes attrs;
+
+        public StartElement(String namespaceURI, String localName, String qName, Attributes attrs) {
+            this.namespaceURI = namespaceURI;
+            this.localName = localName;
+            this.qName = qName;
+            this.attrs = new org.xml.sax.helpers.AttributesImpl(attrs);
+        }
+
+        public void send(ContentHandler contentHandler) throws SAXException {
+            contentHandler.startElement(namespaceURI, localName, qName, attrs);
+        }
+
+        public void dump(Writer writer) throws IOException {
+            writer.write("[StartElement] namespaceURI=" + namespaceURI + ",localName=" + localName + ",qName=" + qName + "\n");
+            for (int i = 0; i < attrs.getLength(); i++) {
+                writer.write("      [Attribute] namespaceURI=" + attrs.getURI(i) + ",localName=" + attrs.getLocalName(i) + ",qName=" + attrs.getQName(i) + ",type=" + attrs.getType(i) + ",value=" + attrs.getValue(i) + "\n");
+            }
+        }
+    }
+
+    public final static class EndElement implements SaxBit, Serializable {
+        public final String namespaceURI;
+        public final String localName;
+        public final String qName;
+
+        public EndElement(String namespaceURI, String localName, String qName) {
+            this.namespaceURI = namespaceURI;
+            this.localName = localName;
+            this.qName = qName;
+        }
+
+        public void send(ContentHandler contentHandler) throws SAXException {
+            contentHandler.endElement(namespaceURI, localName, qName);
+        }
+
+        public void dump(Writer writer) throws IOException {
+            writer.write("[EndElement] namespaceURI=" + namespaceURI + ",localName=" + localName + ",qName=" + qName + "\n");
+        }
+    }
+
+    public final static class Characters implements SaxBit, Serializable {
+        public final char[] ch;
+
+        public Characters(char[] ch, int start, int length) {
+            // make a copy so that we don't hold references to a potentially large array we don't control
+            this.ch = new char[length];
+            System.arraycopy(ch, start, this.ch, 0, length);
+        }
+
+        public void send(ContentHandler contentHandler) throws SAXException {
+            contentHandler.characters(ch, 0, ch.length);
+        }
+
+        public void toString(StringBuffer value) {
+            value.append(ch);
+        }
+
+        public void dump(Writer writer) throws IOException {
+            writer.write("[Characters] ch=" + new String(ch) + "\n");
+        }
+    }
+
+    public final static class Comment implements SaxBit, Serializable {
+        public final char[] ch;
+
+        public Comment(char[] ch, int start, int length) {
+            // make a copy so that we don't hold references to a potentially large array we don't control
+            this.ch = new char[length];
+            System.arraycopy(ch, start, this.ch, 0, length);
+        }
+
+        public void send(ContentHandler contentHandler) throws SAXException {
+            if (contentHandler instanceof LexicalHandler)
+                ((LexicalHandler)contentHandler).comment(ch, 0, ch.length);
+        }
+
+        public void dump(Writer writer) throws IOException {
+            writer.write("[Comment] ch=" + new String(ch) + "\n");
+        }
+    }
+
+    public final static class StartCDATA implements SaxBit, Serializable {
+        public static final StartCDATA SINGLETON = new StartCDATA();
+
+        public void send(ContentHandler contentHandler) throws SAXException {
+            if (contentHandler instanceof LexicalHandler)
+                ((LexicalHandler)contentHandler).startCDATA();
+        }
+
+        public void dump(Writer writer) throws IOException {
+            writer.write("[StartCDATA]\n");
+        }
+    }
+
+    public final static class EndCDATA implements SaxBit, Serializable {
+        public static final EndCDATA SINGLETON = new EndCDATA();
+
+        public void send(ContentHandler contentHandler) throws SAXException {
+            if (contentHandler instanceof LexicalHandler)
+                ((LexicalHandler)contentHandler).endCDATA();
+        }
+
+        public void dump(Writer writer) throws IOException {
+            writer.write("[EndCDATA]\n");
+        }
+    }
+
+    public final static class IgnorableWhitespace implements SaxBit, Serializable {
+        public final char[] ch;
+
+        public IgnorableWhitespace(char[] ch, int start, int length) {
+            // make a copy so that we don't hold references to a potentially large array we don't control
+            this.ch = new char[length];
+            System.arraycopy(ch, start, this.ch, 0, length);
+        }
+
+        public void send(ContentHandler contentHandler) throws SAXException {
+            contentHandler.ignorableWhitespace(ch, 0, ch.length);
+        }
+
+        public void dump(Writer writer) throws IOException {
+            writer.write("[IgnorableWhitespace] ch=" + new String(ch) + "\n");
+        }
+    }
+}

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

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

Added: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/util/XMLUtils.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/util/XMLUtils.java?rev=633260&view=auto
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/util/XMLUtils.java (added)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-impl/src/main/java/org/apache/cocoon/portal/util/XMLUtils.java Mon Mar  3 12:21:05 2008
@@ -0,0 +1,111 @@
+/*
+ * 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.util;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+
+/**
+ * XML utility methods.
+ *
+ * @version $Id$
+ */
+public class XMLUtils {
+
+    /**
+     * Empty attributes.
+     */
+    public static final Attributes EMPTY_ATTRIBUTES = new AttributesImpl();
+
+    /**
+     * Add string data
+     *
+     * @param contentHandler The SAX content handler
+     * @param data The string data
+     */
+    public static void data(ContentHandler contentHandler,
+                            String data)
+    throws SAXException {
+        final char[] c = data.toCharArray();
+        contentHandler.characters(c, 0, c.length);
+    }
+
+    /**
+     * Create endElement with empty Namespace
+     *
+     * <p>For information on the names, see startElement.</p>
+     *
+     * @param localName The local name (without prefix)
+     * @exception org.xml.sax.SAXException Any SAX exception, possibly
+     *            wrapping another exception.
+     */
+    public static void endElement(ContentHandler contentHandler,
+                                  String localName)
+    throws SAXException {
+        contentHandler.endElement("", localName, localName);
+    }
+
+    /**
+     * Create a startElement with a empty Namespace and without Attributes
+     *
+     * @param localName The local name (without prefix)
+     * @exception org.xml.sax.SAXException Any SAX exception, possibly
+     *            wrapping another exception.
+     * @see #endElement(ContentHandler, String)
+     */
+    public static void startElement(ContentHandler contentHandler,
+                                    String localName)
+    throws SAXException {
+        contentHandler.startElement("", localName, localName, EMPTY_ATTRIBUTES);
+    }
+
+    /**
+     * Create a startElement with a empty Namespace
+     *
+     * @param localName The local name (without prefix)
+     * @param atts The attributes attached to the element.  If
+     *        there are no attributes, it shall be an empty
+     *        Attributes object.
+     * @exception org.xml.sax.SAXException Any SAX exception, possibly
+     *            wrapping another exception.
+     * @see #endElement(ContentHandler, String)
+     * @see org.xml.sax.Attributes
+     */
+    public static void startElement(ContentHandler contentHandler,
+                                    String localName,
+                                    Attributes atts)
+    throws SAXException {
+        contentHandler.startElement("", localName, localName, atts);
+    }
+
+    /**
+     * Add an attribute of type CDATA with empty Namespace to the end of the list.
+     *
+     * <p>For the sake of speed, this method does no checking
+     * to see if the attribute is already in the list: that is
+     * the responsibility of the application.</p>
+     *
+     * @param localName The local name.
+     * @param value The attribute value.
+     */
+    public static void addCDATAAttribute(AttributesImpl ai, String localName, String value) {
+        ai.addAttribute("", localName, localName, "CDATA", value);
+    }
+
+}

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

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

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/InformationProviderServiceImpl.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/InformationProviderServiceImpl.java?rev=633260&r1=633259&r2=633260&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/InformationProviderServiceImpl.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/InformationProviderServiceImpl.java Mon Mar  3 12:21:05 2008
@@ -18,8 +18,8 @@
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.apache.cocoon.portal.avalon.AbstractComponent;
 import org.apache.cocoon.portal.pluto.om.PortletDefinitionRegistry;
-import org.apache.cocoon.portal.util.AbstractComponent;
 import org.apache.pluto.services.PortletContainerEnvironment;
 import org.apache.pluto.services.information.DynamicInformationProvider;
 import org.apache.pluto.services.information.InformationProviderService;

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletPreferencesProviderImpl.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletPreferencesProviderImpl.java?rev=633260&r1=633259&r2=633260&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletPreferencesProviderImpl.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/PortletPreferencesProviderImpl.java Mon Mar  3 12:21:05 2008
@@ -21,12 +21,12 @@
 import org.apache.avalon.framework.parameters.Parameters;
 import org.apache.avalon.framework.service.ServiceException;
 import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.cocoon.portal.avalon.AbstractComponent;
 import org.apache.cocoon.portal.om.CopletInstance;
 import org.apache.cocoon.portal.pluto.om.common.PreferenceSetImpl;
 import org.apache.cocoon.portal.profile.PersistenceType;
 import org.apache.cocoon.portal.profile.ProfileKey;
 import org.apache.cocoon.portal.profile.ProfileStore;
-import org.apache.cocoon.portal.util.AbstractComponent;
 import org.apache.pluto.om.common.PreferenceSet;
 
 /**
@@ -60,7 +60,7 @@
     }
 
     /**
-     * @see org.apache.cocoon.portal.util.AbstractComponent#dispose()
+     * @see org.apache.cocoon.portal.avalon.AbstractComponent#dispose()
      */
     public void dispose() {
         if ( this.manager != null ) {
@@ -71,7 +71,7 @@
     }
 
     /**
-     * @see org.apache.cocoon.portal.util.AbstractComponent#service(org.apache.avalon.framework.service.ServiceManager)
+     * @see org.apache.cocoon.portal.avalon.AbstractComponent#service(org.apache.avalon.framework.service.ServiceManager)
      */
     public void service(ServiceManager serviceManager) throws ServiceException {
         super.service(serviceManager);

Modified: cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistryImpl.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistryImpl.java?rev=633260&r1=633259&r2=633260&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistryImpl.java (original)
+++ cocoon/trunk/blocks/cocoon-portal/cocoon-portal-portlet-impl/src/main/java/org/apache/cocoon/portal/pluto/om/PortletDefinitionRegistryImpl.java Mon Mar  3 12:21:05 2008
@@ -39,6 +39,7 @@
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.cocoon.components.source.SourceUtil;
 import org.apache.cocoon.portal.PortalService;
+import org.apache.cocoon.portal.avalon.AbstractComponent;
 import org.apache.cocoon.portal.deployment.DeploymentEvent;
 import org.apache.cocoon.portal.deployment.DeploymentException;
 import org.apache.cocoon.portal.deployment.DeploymentStatus;
@@ -47,7 +48,6 @@
 import org.apache.cocoon.portal.om.CopletType;
 import org.apache.cocoon.portal.pluto.deployment.Deployer;
 import org.apache.cocoon.portal.pluto.deployment.WebApplicationRewriter;
-import org.apache.cocoon.portal.util.AbstractComponent;
 import org.apache.cocoon.thread.RunnableManager;
 import org.apache.commons.lang.StringUtils;
 import org.apache.excalibur.source.Source;



Mime
View raw message