cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giacomo <giac...@apache.org>
Subject Re: AW: cvs commit: xml-cocoon/src/org/apache/cocoon/serialization AbstractSerializer.java LinkSerializer.java SVGSerializer.java Serializer.java
Date Thu, 03 May 2001 21:28:46 GMT


On Thu, 3 May 2001, Davanum Srinivas wrote:

> Carsten,
>
> Am trying to use some third-party software to write a WMLSerializer which can target
various WML
> devices. I need to access the request parameter etc in my serializer. I know other ways
of doing
> it but I see no harm in just letting it be available if people want to use it.

Why in a serializer?? Isn't a transformer good enough? I still think it
is harmfull giving too much environmental information to a serializer.
We have discussed this issue along time ago and came to the conclusion
that a serializer should do only this: Serialize. Can you imagine why we
setup the Serializer interface (SitemapOutputComponent) to a
setOutputStream method only?

I'm still not conviced about the change and thus are -1 until someone
come along with better arguments why a serializer need access to the
environment.

Giacomo

>
> Thanks,
> dims
>
> --- Carsten Ziegeler <cziegeler@sundn.de> wrote:
> > Hi,
> >
> > I am not quiet sure if this was a good idea as there were several
> > discussions about this point in the past. (One link to this:
> > http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=96942815402258&w=2)
> >
> > And I do not see a reason why it is easier to write custom serializers
> > if there is a setup method.
> >
> > Carsten
> >
> > > dims@apache.org wrote:
> > >
> > > dims        01/05/03 07:09:45
> > >
> > >   Modified:    src/org/apache/cocoon/components/pipeline Tag: xml-cocoon2
> > >                         AbstractStreamPipeline.java
> > >                         CachingStreamPipeline.java
> > >                src/org/apache/cocoon/serialization Tag: xml-cocoon2
> > >                         AbstractSerializer.java LinkSerializer.java
> > >                         SVGSerializer.java Serializer.java
> > >   Log:
> > >   Added setup() for serializers also. Need access to the objectModel when
> > >   people start writing custom serializers.
> > >
> > >   Revision  Changes    Path
> > >   No                   revision
> > >
> > >
> > >   No                   revision
> > >
> > >
> > >   1.1.2.8   +7 -1
> > > xml-cocoon/src/org/apache/cocoon/components/pipeline/Attic/Abstrac
> > > tStreamPipeline.java
> > >
> > >   Index: AbstractStreamPipeline.java
> > >   ===================================================================
> > >   RCS file:
> > > /home/cvs/xml-cocoon/src/org/apache/cocoon/components/pipeline/Att
> > > ic/AbstractStreamPipeline.java,v
> > >   retrieving revision 1.1.2.7
> > >   retrieving revision 1.1.2.8
> > >   diff -u -r1.1.2.7 -r1.1.2.8
> > >   --- AbstractStreamPipeline.java	2001/04/30 14:17:12	1.1.2.7
> > >   +++ AbstractStreamPipeline.java	2001/05/03 14:09:16	1.1.2.8
> > >   @@ -35,7 +35,7 @@
> > >     * resource
> > >     * </UL>
> > >     * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
> > >   - * @version CVS $Revision: 1.1.2.7 $ $Date: 2001/04/30 14:17:12 $
> > >   + * @version CVS $Revision: 1.1.2.8 $ $Date: 2001/05/03 14:09:16 $
> > >     */
> > >    public abstract class AbstractStreamPipeline extends
> > > AbstractLoggable implements StreamPipeline, Disposable {
> > >        protected EventPipeline eventPipeline;
> > >   @@ -122,6 +122,12 @@
> > >            } else {
> > >                if ( !checkPipeline() ) {
> > >                    throw new ProcessingException("Attempted to
> > > process incomplete pipeline.");
> > >   +            }
> > >   +
> > >   +            try {
> > >   +                this.serializer.setup((EntityResolver)
> > > environment,environment.getObjectModel(),serializerSource,serializ
> > > erParam);
> > >   +            } catch ( Exception e ) {
> > >   +                throw new ProcessingException("Error in
> > > serializer setup",e);
> > >                }
> > >
> > >                setupPipeline(environment);
> > >
> > >
> > >
> > >   1.1.2.10  +8 -2
> > > xml-cocoon/src/org/apache/cocoon/components/pipeline/Attic/Caching
> > > StreamPipeline.java
> > >
> > >   Index: CachingStreamPipeline.java
> > >   ===================================================================
> > >   RCS file:
> > > /home/cvs/xml-cocoon/src/org/apache/cocoon/components/pipeline/Att
> > > ic/CachingStreamPipeline.java,v
> > >   retrieving revision 1.1.2.9
> > >   retrieving revision 1.1.2.10
> > >   diff -u -r1.1.2.9 -r1.1.2.10
> > >   --- CachingStreamPipeline.java	2001/05/03 11:33:08	1.1.2.9
> > >   +++ CachingStreamPipeline.java	2001/05/03 14:09:19	1.1.2.10
> > >   @@ -44,14 +44,14 @@
> > >     *  </ul>
> > >     *
> > >     * @author <a href="mailto:cziegeler@apache.org">Carsten Ziegeler</a>
> > >   - * @version CVS $Revision: 1.1.2.9 $ $Date: 2001/05/03 11:33:08 $
> > >   + * @version CVS $Revision: 1.1.2.10 $ $Date: 2001/05/03 14:09:19 $
> > >     */
> > >    public final class CachingStreamPipeline extends
> > > AbstractStreamPipeline {
> > >
> > >        /** The role name of the serializer */
> > >        private String serializerRole;
> > >
> > >   -    /** The role name of the serializer */
> > >   +    /** The role name of the reader */
> > >        private String readerRole;
> > >
> > >        /** The cache for the responses */
> > >   @@ -234,6 +234,12 @@
> > >            } else {
> > >                if ( !this.checkPipeline() ) {
> > >                    throw new ProcessingException("Attempted to
> > > process incomplete pipeline.");
> > >   +            }
> > >   +
> > >   +            try {
> > >   +                this.serializer.setup((EntityResolver)
> > > environment,environment.getObjectModel(),serializerSource,serializ
> > > erParam);
> > >   +            } catch ( Exception e ) {
> > >   +                throw new ProcessingException("Error in
> > > serializer setup",e);
> > >                }
> > >
> > >                try {
> > >
> > >
> > >
> > >   No                   revision
> > >
> > >
> > >   No                   revision
> > >
> > >
> > >   1.1.2.16  +15 -2
> > > xml-cocoon/src/org/apache/cocoon/serialization/Attic/AbstractSeria
> > > lizer.java
> > >
> > >   Index: AbstractSerializer.java
> > >   ===================================================================
> > >   RCS file:
> > > /home/cvs/xml-cocoon/src/org/apache/cocoon/serialization/Attic/Abs
> > > tractSerializer.java,v
> > >   retrieving revision 1.1.2.15
> > >   retrieving revision 1.1.2.16
> > >   diff -u -r1.1.2.15 -r1.1.2.16
> > >   --- AbstractSerializer.java	2001/04/30 14:17:37	1.1.2.15
> > >   +++ AbstractSerializer.java	2001/05/03 14:09:28	1.1.2.16
> > >   @@ -9,15 +9,21 @@
> > >    package org.apache.cocoon.serialization;
> > >
> > >    import java.io.BufferedOutputStream;
> > >   +import java.io.IOException;
> > >    import java.io.OutputStream;
> > >   -import org.apache.cocoon.xml.AbstractXMLPipe;
> > >   +import java.util.Map;
> > >    import org.apache.avalon.excalibur.pool.Recyclable;
> > >   +import org.apache.avalon.framework.parameters.Parameters;
> > >   +import org.apache.cocoon.xml.AbstractXMLPipe;
> > >   +import org.apache.cocoon.ProcessingException;
> > >   +import org.xml.sax.EntityResolver;
> > >   +import org.xml.sax.SAXException;
> > >
> > >    /**
> > >     * @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo
> > > Fumagalli</a>
> > >     *         (Apache Software Foundation, Exoffice Technologies)
> > >     * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a>
> > >   - * @version CVS $Revision: 1.1.2.15 $ $Date: 2001/04/30 14:17:37 $
> > >   + * @version CVS $Revision: 1.1.2.16 $ $Date: 2001/05/03 14:09:28 $
> > >     */
> > >
> > >    public abstract class AbstractSerializer extends
> > > AbstractXMLPipe implements Serializer, Recyclable {
> > >   @@ -26,6 +32,13 @@
> > >         * The <code>OutputStream</code> used by this serializer.
> > >         */
> > >        protected OutputStream output;
> > >   +
> > >   +    /**
> > >   +     * Set the <code>EntityResolver</code> the object model
> > > <code>Map</code>,
> > >   +     * the source and sitemap <code>Parameters</code> used to
> > > process the request.
> > >   +     */
> > >   +    public void setup(EntityResolver resolver, Map
> > > objectModel, String src, Parameters par)
> > >   +    throws ProcessingException, SAXException, IOException {}
> > >
> > >        /**
> > >         * Set the <code>OutputStream</code> where the XML should
> > > be serialized.
> > >
> > >
> > >
> > >   1.1.2.11  +12 -1
> > > xml-cocoon/src/org/apache/cocoon/serialization/Attic/LinkSerializer.java
> > >
> > >   Index: LinkSerializer.java
> > >   ===================================================================
> > >   RCS file:
> >
> === message truncated ===
>
>
> =====
> Davanum Srinivas, JNI-FAQ Manager
> http://www.jGuru.com/faq/JNI
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message