cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <>
Subject Re: Pipeline model generalization
Date Tue, 12 Jul 2005 06:11:12 GMT
Not a bad idea, but the pipeline is really a bunch of chained 
org.xml.sax.ContentHandler objects.  Whatever custom events you have 
would have to extend that. If you look at the methods they are very XML 
centric.  In practice, what you are suggesting has been implemented by 
using tools like Betwixt or Castor to convert the JavaBeans into SAX 
events, achieving the same effect.  To do this with betwixt simply requires:

 * Generates an XML representation of a bean using Betwixt.
 * The object to be serialized is retrieved from a request attribute
 * @version $Revision: 1.2 $
 * @created August 2003
public class BeanGenerator extends AbstractGenerator
    protected ServiceManager manager;
    private Object           bean;
     * Sets up the BeanGenerator. Parameters will be read and the bean 
will be
     * generated by calling the get method of the configured class.
     * @param resolver the source resolver
     * @param objectModel the Cocoon object model
     * @param src ignored by the BeanGenerator
     * @param par parameters to the get method
     * @throws ProcessingException
     * @throws SAXException
     * @throws IOException
    public final void setup(SourceResolver resolver, Map objectModel, 
String src,
                      Parameters par)
        throws ProcessingException, SAXException, IOException
        super.setup(resolver, objectModel, src, par);
        Request request = 
        this.bean = 
        if (this.bean == null)
            throw new ProcessingException("No object was provided to 
     * Generate XML data.
     * @throws SAXException
    public final void generate()
        throws SAXException
            SAXBeanWriter beanWriter = new 
        catch (Exception e)
            getLogger().error("Cannot generate XML for " + bean, e);
            SAXException saxException = new SAXException(e.getMessage());
            throw saxException;


Alexander Berezhnoy wrote:

> Hi!
> Recently I've realized, that the main feature of the Cocoon is the 
> pipelines, not XML.
> In Cocoon components generate and process events, and those are SAX 
> events.
> Why not to try generalize this model in order to support any custom 
> event? That could be Java Beans, for example.
> In my opinion, that would be a great powering for Cocoon.
> Alexander.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message