You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Michael Homeijer <M....@devote.nl> on 2002/07/24 10:29:18 UTC
Best way to start developing an application based on C2.1
Hi,
Can anybody give me some pointers on what is currently the best way to start
developing a new Cocoon application based on Cocoon 2.1 from CVS?
I plan to start to develop my application as an application that is easily
mounted in new versions of Cocoon (like the new samples).
Should I be developing in a deployed Cocoon instance? In the new structure,
is it possible to place the altered Cocoon directory structure from
development back into the Cocoon download and build a new war file? Were/how
do people develop the jars containing their own generators, classes etc? Is
there a paper anywhere that describes a standard development process and
environment using Cocoon?
I read about Chello, but I'd like to use the latest Cocoon version because I
need the XMLForms stuff. Even when Cocoon Blocks are supported, Cocoon needs
integrated support for a good development/build mechanism for new web
applications (or is it allready?).
TIA,
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Best way to start developing an application based on C2.1
Posted by Justin Fagnani-Bell <ju...@paraliansoftware.com>.
I haven't put too much thought into my process, but it works pretty
well. I use ant (which came with tomcat), with very little modifications
to the build.xml file that came with it. I did have to change some of it
to get non java files (resources) to end up in the right spot to access
via the resource:// pseudo-protocol.
In my server.xml file for tomcat I set the reloadable attribute of
<Context> to true. This way I don't need to restart Tomcat when I
recompile, just hit reload. Performance might take a hit but it's nice
for development.
My only complaint is that when I compile, it compiles all the sources,
not just the ones that have changed, anyway around this? I don't have
ant setup to jar the class files.
Justin
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
RE: Best way to start developing an application based on C2.1
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Diana Shannon [mailto:shannon@apache.org]
>
> On Wednesday, July 24, 2002, at 05:42 AM, Nicola Ken Barozzi wrote:
>
> > Just a tip: if you install Cocoon jars in the WEB-INF/lib, you can
add
> > your classes in WEB-INF/classes, and just restart Tomcat to use the
new
> > classes. I do it also when developing Cocoon itself, since classes
come
> > before of the libs in the classpath. ;-)
>
>
> I received this helpful tip from Ivelin some time ago.
>
> Use a build target of webapp-local to generate classes
I found that it might be slower then webapp target without jarring:
<!--
<jar jarfile="${build.dir}/${name}.war" basedir="${build.war}"
includes="**" manifest="${build.war}/WEB-INF/Manifest.mf"/>
-->
Because webapp-local copies lots of classes, it is faster to zip'em into
cocoon.jar.
> (faster than a
> war build). Instead of restarting Cocoon, however, use Tomcat's
manager
> to install a path to the updated webapp, e.g.:
Instead of using Tomcat, I use Resin for development work:
1. Add to resin.conf:
<web-app id='/cocoon' app-dir='/apache/cocoon/build/cocoon/webapp'/>
2. Copy Java sources and classes you are working on to
.../cocoon/webapp/WEB-INF/classes
3. Start resin
4. Start your favorite IDE, point it to WEB-INF/classes (it has java
sources too, see 2)
5. Edit Java file in IDE, save it, switch to browser, refresh, and ....
*magic*! Resin will recompile (!) Java code and restart Cocoon (!!)
automatically (!!!).
That's how I achieved the fastest edit/compile/deploy cycle.
PS I use IDEA so compilation errors are very rare. Also, you can compile
single class by using "Ctrl + Shift + F9" (IIRC).
:)
Vadim
>
>
http://localhost:8080/manager/install?path=/cocoon&war=file:/cvs/c2-HEAD
/
> xml-cocoon2/build/cocoon/webapp
>
> When you make a change that requires another webapp build, remove the
> webapp:
> http://localhost:8080/manager/remove?path=/cocoon
>
> Then perform another webapp-local build and use the manager (as above)
> to install webapp again.
>
> A few other notes:
> - I typically disable all caching so I'm not sure if this works with
> caching enabled (i.e. without a clean work directory each time).
> - To get manager working, you need to make sure you have a manager
> context specified in server.xml
> - You need to add a <user name="manager" password="ZZZ" roles="ZZZ"
/>
> to <tomcat-users/> in tomcat-users.xml
>
> Does anyone else use this?
>
> -- Diana
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Best way to start developing an application based on C2.1
Posted by Diana Shannon <sh...@apache.org>.
On Wednesday, July 24, 2002, at 05:42 AM, Nicola Ken Barozzi wrote:
> Just a tip: if you install Cocoon jars in the WEB-INF/lib, you can add
> your classes in WEB-INF/classes, and just restart Tomcat to use the new
> classes. I do it also when developing Cocoon itself, since classes come
> before of the libs in the classpath. ;-)
I received this helpful tip from Ivelin some time ago.
Use a build target of webapp-local to generate classes (faster than a
war build). Instead of restarting Cocoon, however, use Tomcat's manager
to install a path to the updated webapp, e.g.:
http://localhost:8080/manager/install?path=/cocoon&war=file:/cvs/c2-HEAD/xml-cocoon2/
build/cocoon/webapp
When you make a change that requires another webapp build, remove the
webapp:
http://localhost:8080/manager/remove?path=/cocoon
Then perform another webapp-local build and use the manager (as above)
to install webapp again.
A few other notes:
- I typically disable all caching so I'm not sure if this works with
caching enabled (i.e. without a clean work directory each time).
- To get manager working, you need to make sure you have a manager
context specified in server.xml
- You need to add a <user name="manager" password="ZZZ" roles="ZZZ" />
to <tomcat-users/> in tomcat-users.xml
Does anyone else use this?
-- Diana
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org
Re: Best way to start developing an application based on C2.1
Posted by Nicola Ken Barozzi <ni...@apache.org>.
Michael Homeijer wrote:
> Hi,
>
> Can anybody give me some pointers on what is currently the best way to start
> developing a new Cocoon application based on Cocoon 2.1 from CVS?
>
> I plan to start to develop my application as an application that is easily
> mounted in new versions of Cocoon (like the new samples).
Good.
> Should I be developing in a deployed Cocoon instance?
? From a working Cocoon. Yes.
> In the new structure,
> is it possible to place the altered Cocoon directory structure from
> development back into the Cocoon download and build a new war file?
Work on a running Cocoon, don't redeploywars all the time.
> Were/how
> do people develop the jars containing their own generators, classes etc?
As with any Java classes. Some use javac, others JBuilder, others Eclipse...
Just a tip: if you install Cocoon jars in the WEB-INF/lib, you can add
your classes in WEB-INF/classes, and just restart Tomcat to use the new
classes. I do it also when developing Cocoon itself, since classes come
before of the libs in the classpath. ;-)
> Is
> there a paper anywhere that describes a standard development process and
> environment using Cocoon?
>
> I read about Chello, but I'd like to use the latest Cocoon version because I
> need the XMLForms stuff.
Yup.
>Even when Cocoon Blocks are supported, Cocoon needs
> integrated support for a good development/build mechanism for new web
> applications (or is it allready?).
There is one in the works IIRC, in Eclipse.
See the mailing list archives for a link.
--
Nicola Ken Barozzi nicolaken@apache.org
- verba volant, scripta manent -
(discussions get forgotten, just code remains)
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org