cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes Lichtenberger <Johannes.Lichtenber...@uni-konstanz.de>
Subject Re: Writing generator / Cocoon3 alpha
Date Wed, 10 Mar 2010 04:31:39 GMT
On Mon, 2010-03-08 at 19:15 +0100, Johannes Lichtenberger wrote:
> On Mon, 2010-03-08 at 08:34 +0100, Reinhard Pötz wrote:
> > Johannes Lichtenberger wrote:
> > > On Sat, 2010-03-06 at 13:19 +0100, Johannes Lichtenberger wrote:
> > >> On Sat, 2010-03-06 at 07:21 +0100, Jos Snellings wrote:
> > >>> Johannes, you need one or two things beside the code of the generator.
> > >>> - first, how is it invoked? Can you send the fragment of your
> > >>> sitemap.xmap that matches an url supposed to invoke this generator?
> > >>> - second, is there a line in sitemap-components that defines this
> > >>> generator?
> > >> Jep, but the invokation isn't the problem, because the class itself is
> > >> going to be invoked like testeted with:
> > >>
> > >> static { System.out.println("HELLO!") }
> > 
> > If you get a 'HELLO' this means that Spring loads the generator and not
> > that the pipeline is invoked.
> > 
> > >>
> > >> Ok, my little sitemap:
> > >>
> > >> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap"
> > >> xmlns:servlet="http://apache.org/cocoon/servlet" 
> > >>   xmlns:controller="http://apache.org/cocoon/controller"> 
> > >>
> > >>   <map:pipelines>
> > >>     <map:pipeline>
> > >>       <map:match pattern="">
> > >>         <map:read src="welcome.html" />
> > >>       </map:match>
> > >>       <map:match pattern="treetank">
> > >>         <map:generate type="sax" src="src/main/resources/test"/>
> > >>         <map:serialize type="xml"/>
> > >>       </map:match>
> > >>     </map:pipeline>    
> > >>   </map:pipelines>
> > >>   
> > >> </map:sitemap>
> > 
> > If you use Cocoon as a web application, the base directory
> > src/main/resources/COB-INF. Put your sitemap there. All releative paths
> > are calculated from there.
> 
> It's already there. I just changed the src-attribute to point to
> "test" (<map:generate type="sax" src="test"/>) and the test file is
> located in COB-INF, but somehow now I'm getting an exception (and once
> more I don't know what's the root, cause it's somehow not logged). My
> last log dates to 3:10 am or something from tonight. I think the logger
> isn't initialized properly, but I'm using the empty archetype of Cocoon
> Alpha 2, so I think everything should be ok (at least the paths -- so
> the sitemap is located in COB-INF already). 
> 
> ...
> 	at
> org.apache.cocoon.tools.rcl.wrapper.servlet.ReloadingListener.invoke(ReloadingListener.java:157)
> 	at
> org.apache.cocoon.tools.rcl.wrapper.servlet.ReloadingListener.contextInitialized(ReloadingListener.java:213)
> 	at
> org.apache.cocoon.tools.rcl.wrapper.servlet.ReloadingListener.invoke(ReloadingListener.java:157)
> 	at
> org.apache.cocoon.tools.rcl.wrapper.servlet.ReloadingListener.contextInitialized(ReloadingListener.java:213)
> 2010-03-08 19:06:11.158::INFO:  Started
> SelectChannelConnector@0.0.0.0:8888
> [INFO] Started Jetty Server
> 
> Another question is if this is the appropriate way to read the
> source-attribute once the pipeline is invoked:
> 
>   /**
>    * {@inheritDoc}
>    *
>    * @see
> org.apache.cocoon.sax.AbstractSAXProducer#setConfiguration(java.util.Map)
>    */
>   @Override
>   public void setConfiguration(Map<String, ? extends Object>
> configuration) {
>      TNK = (String) configuration.get("source");
>   }

Maybe it has something todo that I copied my classes from the archetype
Alpha version 1 to a new archetype alpha version 2? Would be nice if
anyone has some tips at least why my logger isn't initialized
properly :-/

greetings,
Johannes



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


Mime
View raw message