cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julian Klein <>
Subject Re: Cocoon is complex, but worth it! Some Answers to your dilemma
Date Sat, 25 Jan 2003 18:58:51 GMT
First off I made some suggestions to your
questions/problems below...skip ahead if you don't
want my commentary on Cocoon.

Well it seems to me that when I started with Cocoon, I
was hoping to jump right on in.  Unfortunately, it was
not that easy, but not b/c of Cocoon, rather my
limited knowledge of xpath and xsl functions.  Anyway,
I tackled these problems by studying the applications
samples packaged with cocoon and reading the
documentation.  It may be discouraging, but anything
worthwhile can't be done overnight, right?  Anyway, as
I work more and more with Cocoon, I am amazed by the
genius of it's architecture.  Cocoon is certainly a
tribute to Open Source and the greatness of those out
there working on and contributing to it.  Stick to it
and you will be repaid.

It seems if you have a servlet working, you must be
looking to upgrade.  So you should not be looking for
an overnight solution, which is easy with all the
options out there.  Overall, the advice I can give is
you must consider:

1)Are you going to use Cocoon for more than just a
replacement for your servlet?

2)What technologies do you want to use: XSP,XSLT,etc.

3)You do not need to build from the CVS source, you
can just download a pre-built version from the site
(nightly or major release)

4)You may not need to create a new transformer, but
perhaps just make an action.

5)You prob need a minimal sitemap(see below) to match
your url requests to your data.  No need to worry
about the endless options now.  The beauty is you will
learn them as you go and find that Cocoon has almost
everything you could ever need.

6)Look over the user's guide and study some of the
sitemaps packages with Cocoon.

I hope this makes some sense. If not, I 'm sorry, but
I feel as if Cocoon is a great way to go if you want
to do more than just replace your serlvlet.  With all
the users, developers, wiki, documentation, and
mailing will almost always get an answer. 
Whether or not it makes sense ;-) !  I attached a
basic sitemap to get you going...


<?xml version="1.0"?>

<!-- =========================== Components
=================================== -->

  <map:generators default="file"/>

  <map:transformers default="xslt"/>

  <map:readers default="resource"/>

  <map:serializers default="html">
   <map:serializer logger="sitemap.serializer.xml"
mime-type="text/xml" name="xml"

   <map:serializer logger="sitemap.serializer.html"
mime-type="text/html" name="html" 
                   pool-grow="4" pool-max="32"

  <map:matchers default="wildcard"/>

  <map:selectors default="browser"/>


<!-- =========================== Pipelines
================================= -->
   <map:match pattern="**">
   <!-- ========================= Dynamic Content
   <map:match pattern="viewHTML/**">
            <map:generate src="myXMLDataSource"/>
            <map:transform src="myXSLSheet"/>
            <map:serialize type="html"/>
   <map:match pattern="viewXML/**">
            <map:generate src="myXMLDataSource"/>
            <map:transform src="myXSLSheet"/>
            <map:serialize type="xml"/>
   <!-- ========================= Static Content
   <map:match pattern="viewStaticHTML">
     <map:read src="static.html"/>

   <map:match pattern="**images/*.png">
    <map:read src="images/{2}.png"

   <map:match pattern="**images/*.jpg">
    <map:read src="images/{2}.jpg"

    <map:serialize status-code="500"/>

Live simply so others may simply live.
Pluralitas non est ponenda sine neccesitate.
"Entities should not be multiplied unneccesarily"
-William of Occam

Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.

Please check that your question  has not already been answered in the
FAQ before posting.     <>

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

View raw message