cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Ratcliffe" <a...@mrigitech.com>
Subject RE: Using Cocoon's build system for my webapp
Date Fri, 14 Jan 2005 03:05:24 GMT
Hi Justin

The Cocoon wiki has some good resources on tailoring the Cocoon webapp and
developing your project
against it, see http://wiki.apache.org/cocoon/YourCocoonBasedProjectAnt16
and http://wiki.apache.org/cocoon/ProjectBuilding

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(Packages.com.example.MyComponent.ROLE);

HTH
Adam





-----Original Message-----
From: Justin Fagnani [mailto:justin3@fagnani.com]
Sent: Friday, 8 July 2005 1:33 a.m.
To: users@cocoon.apache.org
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
local.blocks.properties 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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org




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


Mime
View raw message