forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <thorsten.scherler....@juntadeandalucia.es>
Subject Re: FOPNGSerializer, user-config and locationmaps
Date Fri, 22 Aug 2008 06:54:48 GMT
On Fri, 2008-08-22 at 08:30 +0300, Sjur Moshagen wrote:
> I think I will leave it as it is then, at least for the moment.  
> Eclipse has turned out to be a steep learning thing for me (I have  
> tried a couple of times, but I don't grasp the idea of the interface -  
> it is just confusing to me), and setting this up would take more time  
> than I have at the moment.

Actually a similar problem that you are trying to solve has been solved
by David a while back. I remember because while updating I stumble over
the solution again. 

Have a look in the main sitemap or the internal.xmap of the dispatcher.
There we use entities to make the serializer configurable. First we
define the entities file:
<!DOCTYPE map:sitemap [
<!ENTITY % symbols-project
  PUBLIC "-//Apache Forrest//ENTITIES Symbols Project v1.0//EN"
  "symbols-project-v10.ent">
  %symbols-project;
<!ENTITY % symbols-core
  PUBLIC "-//Apache Forrest//ENTITIES Symbols Core v1.0//EN"
  "symbols-core-v10.ent">
  %symbols-core;
]>
and later on we use it:
<map:serializer logger="sitemap.serializer.xhtml" mime-type="text/html" 
        name="xhtml" pool-grow="2" pool-max="64" pool-min="2" 
        src="org.apache.cocoon.serialization.XMLSerializer">

<doctype-public>&serializer-xhtml-doctype-public;</doctype-public>

<doctype-system>&serializer-xhtml-doctype-system;</doctype-system>
        <encoding>&serializer-xhtml-encoding;</encoding>
        <indent>yes</indent>
        <omit-xml-declaration>yes</omit-xml-declaration>
      </map:serializer>

As you can see each project can provide a symbols-project-v10.ent which
can override the configuration. 

By default we have e.g. for the dispatcher:
<!ENTITY serializer-xhtml-encoding "UTF-8">

I think that is a quite elegant solution to our problem without the need
for an extended debugging session.

salu2

> 
> I'll see if I can get someone else in my team to have a look at the  
> code.
> 
> Best regards,
> Sjur
> 
> Den 20. aug. 2008 kl. 11.37 skrev Thorsten Scherler:
> 
> > On Wed, 2008-08-20 at 11:05 +0300, Sjur Moshagen wrote:
> >> Den 20. aug. 2008 kl. 09.33 skrev Thorsten Scherler:
> > ...
> >>> If the link rewriter is screwing things up you could debug
> >>> LinkRewriterTransformer. Anyway this transformer normally never  
> >>> should
> >>> rewrite anything in the sitemap.xmap.
> >>
> >> Whatever the problem, I'm on unknown territory here (I'm not really
> >> into Java). Any suggestions for how to debug this?
> >
> > Using Eclipse that is not that hard but you would need some basic
> > knowledge of eclipse.
> >
> > First add the following to your forrest.properties:
> > forrest.jvmargs=-Xdebug
> > -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
> >
> > That will force forrest to start in debug mode.
> >
> > Now you need both cocoon and forrest in your eclipse workspace (I  
> > think
> > cocoon 2.1.x should be fine). Add a breakpoint to
> > LinkRewriterTransformer in the linkrewrite block. I recommend  
> > somewhere
> > in configure(Configuration conf). Another in public void
> > startTransformingElement(String uri,...)
> >
> >
> > HTH
> >
> > salu2
> > -- 
> > Thorsten Scherler                                  
> > thorsten.at.apache.org
> > Open Source Java                      consulting, training and  
> > solutions
> >
> 
-- 
Thorsten Scherler                                 thorsten.at.apache.org
Open Source Java                      consulting, training and solutions


Mime
View raw message