cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: cocoon-2.1/src/java/org/apache/cocoon/components/source SourceUtil.java
Date Fri, 14 Mar 2003 08:24:13 GMT
cziegeler    2003/03/14 00:24:12

  Modified:    src/java/org/apache/cocoon/xml AbstractDOMFragment.java
               src/java/org/apache/cocoon/components/source SourceUtil.java
  Log:
  Fixing some NPE with the new DOMStreamer
  Portal sample works again
  
  Revision  Changes    Path
  1.2       +3 -1      cocoon-2.1/src/java/org/apache/cocoon/xml/AbstractDOMFragment.java
  
  Index: AbstractDOMFragment.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/xml/AbstractDOMFragment.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractDOMFragment.java	9 Mar 2003 00:09:45 -0000	1.1
  +++ AbstractDOMFragment.java	14 Mar 2003 08:24:12 -0000	1.2
  @@ -103,7 +103,9 @@
           }
   
           // Stream the document fragment
  +        handler.startDocument();
           DOMStreamer streamer = new DOMStreamer(handler);
           streamer.stream(df);
  +        handler.endDocument();
       }
   }
  
  
  
  1.2       +5 -10     cocoon-2.1/src/java/org/apache/cocoon/components/source/SourceUtil.java
  
  Index: SourceUtil.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/source/SourceUtil.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SourceUtil.java	9 Mar 2003 00:09:12 -0000	1.1
  +++ SourceUtil.java	14 Mar 2003 08:24:12 -0000	1.2
  @@ -412,10 +412,6 @@
                   frag.normalize();
   
                   if ( null != serializerName) {
  -                    // Lookup the Serializer
  -	                // FIXME (CZ) : Due to the CM hierarchy we don't get the
  -	                // correct serializer selector...
  -	                // we now use the getSitemapComponentManager()
   					ComponentManager manager = CocoonComponentManager.getSitemapComponentManager();
   
   	                ComponentSelector selector = null;
  @@ -426,8 +422,10 @@
   	                     serializer = (Serializer)selector.select(serializerName);
   	                     oStream = ws.getOutputStream();
   	                     serializer.setOutputStream(oStream);
  +                         serializer.startDocument();
   	                     DOMStreamer streamer = new DOMStreamer(serializer);
   	                     streamer.stream(frag);
  +                         serializer.endDocument();
   	                } catch (ComponentException e) {
   	                	throw new ProcessingException("Unable to lookup serializer.", e);
   					} finally {
  @@ -455,11 +453,6 @@
               } else {
               	String content;
   				if ( null != serializerName) {
  -	                // and now serializing...
  -	                // Lookup the Serializer
  -	                // FIXME (CZ) : Due to the CM hierarchy we don't get the
  -	                // correct serializer selector...
  -					// we now use the getSitemapComponentManager()
   					ComponentManager  manager = CocoonComponentManager.getSitemapComponentManager();
                       
                       ComponentSelector selector = null;
  @@ -469,8 +462,10 @@
                           selector = (ComponentSelector)manager.lookup(Serializer.ROLE +
"Selector");
                           serializer = (Serializer)selector.select(serializerName);
                           serializer.setOutputStream(oStream);
  +                        serializer.startDocument();
                           DOMStreamer streamer = new DOMStreamer(serializer);
                           streamer.stream(frag);
  +                        serializer.endDocument();
   					} catch (ComponentException e) {
   						throw new ProcessingException("Unable to lookup serializer.", e);
                       } finally {
  
  
  

Mime
View raw message