cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Fagnani <>
Subject Re: Using Cocoon's build system for my webappThanks Ada,
Date Thu, 07 Jul 2005 14:36:20 GMT
Thanks Adam,

You answered most of my questions. 

The only thing left (assuming I understand the wiki docs) is that the 
component I'm setting up need to be a singleton instantiated when Cocoon 

I remember using a ComponentManager to get my components. I didn't use XSP 
much though, so I'm wondering if this:

> var myComp = cocoon.getComponent(;

Is how I would do it inside a Generator, or if that's maybe XSP specific. Is 
the cocoon object now passed to pipeline components through the objectModel?

Also, I need to make sure that the instance I get is the same that was created 
at launch time. This is setup in the sitemap, right?

Ahh, knockin the rust off.

Thanks again,

On Thursday 13 January 2005 19:05, Adam Ratcliffe wrote:
> Hi Justin
> The Cocoon wiki has some good resources on tailoring the Cocoon webapp and
> developing your project
> against it, see
> and
> The first doc has a link to an Ant build script that will help with setting
> up a directory structure
> that decouples your project's resources from the cocoon source tree, and
> targets for patching the
> cocoon configuration files with your project's specific configuration.
> I've successfully used this approach to upgrade a webapp from the 2.1.5 to
> 2.1.6 release.
> If you're already familiar with developing Avalon components for Cocoon
> deploying them is
> not too difficult.  Briefly:
> - Create your component roles file e.g.
> <role-list>
>   <role name="com.example.MyComponent"
> 	shorthand="myComp"
> 	default-class="com.example.MyComponent"/>
> ...
> </role-list>
> - Register these with Cocoon by adding a 'user-roles' attribute to the root
> element in cocoon.xconf
> <cocoon user-roles="my.roles">
> - The component's lifecycle methods will be invoked when you lookup/release
> the component, for example
> in flowscript:
> var myComp = cocoon.getComponent(;
> Adam
> -----Original Message-----
> From: Justin Fagnani []
> Sent: Friday, 8 July 2005 1:33 a.m.
> To:
> Subject: Using Cocoon's build system for my webapp
> Hello Cocoon'ers,
> It's been a long while since I've done any Cocoon work. I've been playing
> with
> the new (to me) build system and so far I like it. I've been able to easily
> pair down the build with the local blocks and build properties.
> Now I want to start setting up the sitemap and writing some custom
> components.
> I'd like to use the current build system but I'm getting some errors. Maybe
> it's not the right way to do it, but so far I haven't seen any
> documentation on what the suggested build setup is.
> First I figured I'd edit the sitemap in src/webapp. I removed some unneeded
> matchers and quickly got errors with confpatch, specifically mount-table. I
> added back the api section to the sitemap just to get going, but I wonder
> what the correct solution is.
> Should I create my own target xml file? Should I remove mount-table.xmap
> from
> src/confpatch ?
> My second issue has to do with components. I want to wrap an object as an
> Avalon component and have it instantiated when Cocoon is launched. Before I
> did this with a user.roles file and editing cocoon.xconf. I went to the
> documentation to make sure I remembered how to do it, but I couldn't find
> much, just one reference to creating a my.roles file. To use the build
> system
> would I just put my.roles in the src/webapp/WEB-INF directory?
> My big concern is that it'll be difficult to upgrade when a new version of
> Cocoon comes out. On the other hand I've created a nice minimal Cocoon
> setup,
> but I might need more blocks later. I like the idea of being able to edit
> and get the blocks I need, and then rebuild my
> whole webapp.
> Any suggestions or advice would be greatly appreciated.
> Thanks,
>   Justin
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

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

View raw message