You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by EMMEL Thomas <th...@3ds.com> on 2009/02/19 10:37:48 UTC

question to FOR-1136 and locationmap.xml not found

Hi,

I have (maybe) small problem, which I cannot resolve following the docs
and the mailing lists:

I use my own DTD which enhances the default one by adding
an element for figures with a caption and an automatic counter
and another element with a reference to this first element which could
be used
like this

<sfigure id="somepic" src="imgaes/some.png" alt="some explanation"
 caption="This is a picture"/>

See <sref ref="somepic" label="Figure"/> ...

This works very good as long as I need output to html and I implemented
my changes in my skins 'document-to-html.xsl' mainly.

Now I like to add these elements to 'document-to-fo.xsl' to get it in
PDF too.
However, following FOR-1136 my local file isn't used anymore (/-#).
Now, I follow the path and like to understand how I could use the
locationmap.xml
to add my changes again.

The problem seems that my project locationmap.xml isn't recognized.
I cannot find any reference to it in the locationmap.log-file, the same
happens
for locationmap-project.xml...

I use 0.9dev (not fully up to date) and my locationmap.xml is in
PROJECT_HOME/src/content/locationmap.xml
(Note: I removed the 'documentation' directory for my project)

I added this to it to try to use my old document-to-fo.xsl again:

    <match pattern="pdf.transform.*.*">
      <select>
        <location
src="{properties:skins-dir}/abaqus/xslt/fo/{1}-to-{2}.xsl"/>
      </select>
    </match>

and I added this to my document-to-fo.xsl:

<xsl:import
href="{forrest:forrest.plugins}/org.apache.forrest.plugin.output.pdf/resources/stylesheets/document-to-fo.xsl"/>

hoping it will work...

Thanks in advance

Thomas

Re: question to FOR-1136 and locationmap.xml not found

Posted by EMMEL Thomas <th...@3ds.com>.
Tim Williams schrieb:
>
> On Thu, Feb 26, 2009 at 4:07 AM, EMMEL Thomas <th...@3ds.com>
> wrote:
> > David,
> >
> > finally I solved my problem with the location of the locationmap.
> > I had something like this in my locationmap.xml:
> >
> >     <match pattern="pdf.transform.*.*">
> >       <select>
> >       <location
> src="{properties:skins-dir}/myskin/xslt/fo/{1}-to-{2}.xsl"/>
> >       </select>
> >     </match>
> >
> > but had to remove the <select> to get it working since otherwise
> > I get a java exception in my locationmap.log which is not very helpful
> > to find the problem...
>
> I would think a 'select' is fine there, can you post the stack trace?
> Thanks,
> --tim
>
Here it is:
...
DEBUG   (2009-02-26) 12:51.51:484   [core.modules.mapper.lm.ctx]
(/howto/ac-like.fo):
Current Sitemap Parameters:
LEVEL 1
PARAM: 'hint' VALUE: 'plugin.xmap.output'

DEBUG   (2009-02-26) 12:51.51:497   [core.modules.mapper.lm]
(/howto/ac-like.fo): loading mounted location map at
cocoon://locationmap-project.xml
ERROR   (2009-02-26) 12:51.51:515   [core.modules.mapper.lm]
(/howto/ac-like.fo): Failure processing LocationMap.
java.lang.NullPointerException
        at
org.apache.avalon.framework.service.DefaultServiceSelector.select(DefaultServiceSelector.java:77)
        at
org.apache.forrest.locationmap.lm.SelectNode.build(SelectNode.java:78)
        at
org.apache.forrest.locationmap.lm.MatchNode.build(MatchNode.java:114)
        at
org.apache.forrest.locationmap.lm.LocatorNode.build(LocatorNode.java:98)
        at
org.apache.forrest.locationmap.lm.LocationMap.build(LocationMap.java:204)
        at
org.apache.forrest.locationmap.lm.MountNode.getLocationMap(MountNode.java:92)
        at
org.apache.forrest.locationmap.lm.MountNode.locate(MountNode.java:162)
        at
org.apache.forrest.locationmap.lm.SelectNode.locate(SelectNode.java:124)
        at
org.apache.forrest.locationmap.lm.LocatorNode.locate(LocatorNode.java:122)
        at
org.apache.forrest.locationmap.lm.LocationMap.locate(LocationMap.java:275)
        at
org.apache.forrest.locationmap.LocationMapModule.getFreshResult(LocationMapModule.java:254)
        at
org.apache.forrest.locationmap.LocationMapModule.getAttribute(LocationMapModule.java:217)
        at
org.apache.cocoon.components.treeprocessor.variables.PreparedVariableResolver.processModule(PreparedVariableResolver.java:258)
        at
org.apache.cocoon.components.treeprocessor.variables.PreparedVariableResolver.resolve(PreparedVariableResolver.java:209)
        at
org.apache.cocoon.components.treeprocessor.sitemap.SelectNode.invoke(SelectNode.java:94)
        at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
        at
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
        at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
        at
org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
        at
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:235)
        at
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:177)
        at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:254)
        at org.apache.cocoon.Cocoon.process(Cocoon.java:699)
        at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1154)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:354)
        at
org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
        at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:567)
        at org.mortbay.http.HttpContext.handle(HttpContext.java:1808)
        at
org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:525)
        at org.mortbay.http.HttpContext.handle(HttpContext.java:1758)
        at org.mortbay.http.HttpServer.service(HttpServer.java:879)
        at org.mortbay.http.HttpConnection.service(HttpConnection.java:790)
        at
org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:952)
        at org.mortbay.http.HttpConnection.handle(HttpConnection.java:807)
        at
org.mortbay.http.SocketListener.handleConnection(SocketListener.java:197)
        at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
        at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:501)
DEBUG   (2009-02-26) 12:51.51:531   [core.modules.mapper.lm]
(/howto/ac-like.fo): Not selected: null
...

Re: question to FOR-1136 and locationmap.xml not found

Posted by Tim Williams <wi...@gmail.com>.
On Thu, Feb 26, 2009 at 4:07 AM, EMMEL Thomas <th...@3ds.com> wrote:
> David,
>
> finally I solved my problem with the location of the locationmap.
> I had something like this in my locationmap.xml:
>
>     <match pattern="pdf.transform.*.*">
>       <select>
>       <location src="{properties:skins-dir}/myskin/xslt/fo/{1}-to-{2}.xsl"/>
>       </select>
>     </match>
>
> but had to remove the <select> to get it working since otherwise
> I get a java exception in my locationmap.log which is not very helpful
> to find the problem...

I would think a 'select' is fine there, can you post the stack trace?
Thanks,
--tim

Re: question to FOR-1136 and locationmap.xml not found

Posted by EMMEL Thomas <th...@3ds.com>.
David,

finally I solved my problem with the location of the locationmap.
I had something like this in my locationmap.xml:

    <match pattern="pdf.transform.*.*">
      <select>
      <location src="{properties:skins-dir}/myskin/xslt/fo/{1}-to-{2}.xsl"/>
      </select>
    </match>

but had to remove the <select> to get it working since otherwise
I get a java exception in my locationmap.log which is not very helpful
to find the problem...

Thank you very much since you pushed me in the right direction.

Thomas

David Crossley schrieb:
>
> EMMEL Thomas wrote:
> >
> > so what now ???
>
> Sorry, i had to snip all of the above. No time.
> Hopefully someone else can help.
>
> To over-ride such stuff, as you indicate, you need to
> concentrate on getting your project's locationmap
> to function.
>
> > In addition I realy like to understand how the locationmap-thing works
> > but I cannot find enough input
> > to understand the complete work-flow and debugging is very hard...
> > For example there is a locationmap.xml and maybe a
> > locationmap-project.xml but I don't know when they are used
> > and where they should be stored, due to my problems above that no local
> > locationmap after all will be read.
>
> I suspect that your problem is with the
> filename "locationmap-project.xml".
> Have a look at Forrest's core sitemaps:
> ]$ cd $FORREST_HOME/main/webapp/
> ]$ grep locationmap *.xmap
>
> The sitemap.xmap responds to the *internal* pattern
> "locationmap-project.xml" and looks for a project
> locationmap at {properties:content}locationmap.xml
> Note the expected final filename "locationmap.xml".
>
> See the example for our project website
> at $FORREST_HOME/site-author/
>
> Our location map is at
> site-author/content/locationmap.xml
>
> The docs should help:
> http://forrest.apache.org/docs/dev/locationmap.html
>
> -David
>



Re: question to FOR-1136 and locationmap.xml not found

Posted by David Crossley <cr...@apache.org>.
EMMEL Thomas wrote:
> 
> so what now ???

Sorry, i had to snip all of the above. No time.
Hopefully someone else can help.

To over-ride such stuff, as you indicate, you need to
concentrate on getting your project's locationmap
to function.

> In addition I realy like to understand how the locationmap-thing works
> but I cannot find enough input
> to understand the complete work-flow and debugging is very hard...
> For example there is a locationmap.xml and maybe a
> locationmap-project.xml but I don't know when they are used
> and where they should be stored, due to my problems above that no local
> locationmap after all will be read.

I suspect that your problem is with the
filename "locationmap-project.xml".
Have a look at Forrest's core sitemaps:
]$ cd $FORREST_HOME/main/webapp/
]$ grep locationmap *.xmap

The sitemap.xmap responds to the *internal* pattern
"locationmap-project.xml" and looks for a project
locationmap at {properties:content}locationmap.xml
Note the expected final filename "locationmap.xml".

See the example for our project website
at $FORREST_HOME/site-author/

Our location map is at
site-author/content/locationmap.xml

The docs should help:
http://forrest.apache.org/docs/dev/locationmap.html

-David

Re: question to FOR-1136 and locationmap.xml not found

Posted by David Crossley <cr...@apache.org>.
Ross Gardler wrote:
> EMMEL Thomas wrote:
> 
> > In addition I realy like to understand how the locationmap-thing works but I
> > cannot find enough input
> > to understand the complete work-flow and debugging is very hard...
> 
> I'm going to paste links to sections of the docs that are supposed to
> answer your questions. Of course, it's easy for me to understand these
> as I already understand the locaitonmap. Please read the docs and come
> back to us with more specific questions. We'll try and answer in more
> detail but note that we will expect you to repay our time by providing
> patches for the docs so that others can benefit.
> 
> Start here:
> 
> http://forrest.apache.org/docs_0_80/locationmap.html
> 
> > For example there is a locationmap.xml and maybe a locationmap-project.xml
> > but I don't know when they are used
> 
> http://forrest.apache.org/docs_0_80/locationmap.html#process
> 
> > and where they should be stored, due to my problems above that no local
> > locationmap after all will be read.
> 
> http://forrest.apache.org/docs_0_80/locationmap.html#overview

Thanks for the links. Because Thomas is asking on the dev
list we can direct him to the dev version of docs.
URLs like http://forrest.apache.org/docs/dev/locationmap.html
....................................^^^^^^^^
automatically re-direct to the latest dev version.

-David

Re: question to FOR-1136 and locationmap.xml not found

Posted by Ross Gardler <rg...@apache.org>.
2009/2/25 EMMEL Thomas <th...@3ds.com>:

> In addition I realy like to understand how the locationmap-thing works but I
> cannot find enough input
> to understand the complete work-flow and debugging is very hard...

I'm going to paste links to sections of the docs that are supposed to
answer your questions. Of course, it's easy for me to understand these
as I already understand the locaitonmap. Please read the docs and come
back to us with more specific questions. We'll try and answer in more
detail but note that we will expect you to repay our time by providing
patches for the docs so that others can benefit.

Start here:

http://forrest.apache.org/docs_0_80/locationmap.html

> For example there is a locationmap.xml and maybe a locationmap-project.xml
> but I don't know when they are used

http://forrest.apache.org/docs_0_80/locationmap.html#process

> and where they should be stored, due to my problems above that no local
> locationmap after all will be read.

http://forrest.apache.org/docs_0_80/locationmap.html#overview

-- 
--
Ross Gardler

OSS Watch - awareness and understanding of open source software
development and use in education
http://www.oss-watch.ac.uk

Re: question to FOR-1136 and locationmap.xml not found

Posted by EMMEL Thomas <th...@3ds.com>.
David Crossley schrieb:
>
> EMMEL Thomas wrote:
> >
> > I have (maybe) small problem, which I cannot resolve following the docs
> > and the mailing lists:
> >
> > I use my own DTD which enhances the default one by adding
> > an element for figures with a caption and an automatic counter
> > and another element with a reference to this first element which could
> > be used
> > like this
> >
> > <sfigure id="somepic" src="imgaes/some.png" alt="some explanation"
> >  caption="This is a picture"/>
> >
> > See <sref ref="somepic" label="Figure"/> ...
> >
> > This works very good as long as I need output to html and I implemented
> > my changes in my skins 'document-to-html.xsl' mainly.
> >
> > Now I like to add these elements to 'document-to-fo.xsl' to get it in
> > PDF too.
> > However, following FOR-1136 my local file isn't used anymore (/-#).
> > Now, I follow the path and like to understand how I could use the
> > locationmap.xml
> > to add my changes again.
> >
> > The problem seems that my project locationmap.xml isn't recognized.
> > I cannot find any reference to it in the locationmap.log-file, the same
> > happens
> > for locationmap-project.xml...
> >
> > I use 0.9dev (not fully up to date) and my locationmap.xml is in
> > PROJECT_HOME/src/content/locationmap.xml
> > (Note: I removed the 'documentation' directory for my project)
> >
> > I added this to it to try to use my old document-to-fo.xsl again:
> >
> >     <match pattern="pdf.transform.*.*">
> >       <select>
> >         <location
> > src="{properties:skins-dir}/abaqus/xslt/fo/{1}-to-{2}.xsl"/>
> >       </select>
> >     </match>
> >
> > and I added this to my document-to-fo.xsl:
> >
> > <xsl:import
> >
> href="{forrest:forrest.plugins}/org.apache.forrest.plugin.output.pdf/resources/stylesheets/document-to-fo.xsl"/>
>
> >
> > hoping it will work...
>
> Better to understand how the locationmaps work ;-)
>
> I just use the default skin, so i don't what you really
> need to do. Ditto for the Forrest project website.
>
> When i look at Forrest's core locationmaps, it seems
> that it already tries in your project first. So you
> should not need to do any locationmap nor import.
>
> Look at $FORREST_HOME/main/webapp/locationmap-transforms.xml
> and search in file for "skin transforms".
>
>  32 <!-- ================================== -->
>  33 <!-- skin transforms                    -->
>  34 <!-- ================================== -->
>  35     <match pattern="transform.*.fo">
>  36       <select>
>  37         <location
> src="{properties:skins-dir}{forrest:forrest.skin}/xslt/fo/{1}-to-fo.xsl"
> />
>  38         <location
> src="{forrest:forrest.context}/skins/{forrest:forrest.skin}/xslt/fo/{1}-to-fo.xsl"/>
>
>  39         <location
> src="{forrest:forrest.context}/skins/common/xslt/fo/{1}-to-fo.xsl"/>
>  40       </select>
>  41     </match>
>
> So first in your project's relevant skin dirrectory,
> then in forrest core relevant skin dirrectory,
> then in forrest core common skin dirrectory.
>
> Hope that helps.
>
> -David
>
David,

thanks, this gives some more light into the scene but, sorry, it doesn't
help me after all.
First, following your advice:
<location
src="{properties:skins-dir}{forrest:forrest.skin}/xslt/fo/{1}-to-fo.xsl" />
should point me e.g. to:
myproject/src/skins/myskin/xslt/fo/document-to-fo.xsl

However, this file is never recognized, the same happens with a fresh
forrest seeded site!
An this is completely in line with your following statement:
"""

[
https://issues.apache.org/jira/browse/FOR-1135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12655085#action_12655085
<https://issues.apache.org/jira/browse/FOR-1135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12655085#action_12655085>
]

David Crossley commented on FOR-1135:

-------------------------------------

See my comment in *FOR-1136* - the FO processing moved to the PDF output
plugin.
So yes, the document-to-fo.xsl from skins is not used anymore.

"""

so what now ???

In addition I realy like to understand how the locationmap-thing works
but I cannot find enough input
to understand the complete work-flow and debugging is very hard...
For example there is a locationmap.xml and maybe a
locationmap-project.xml but I don't know when they are used
and where they should be stored, due to my problems above that no local
locationmap after all will be read.

Thanks

Thomas


Re: question to FOR-1136 and locationmap.xml not found

Posted by David Crossley <cr...@apache.org>.
EMMEL Thomas wrote:
> 
> I have (maybe) small problem, which I cannot resolve following the docs
> and the mailing lists:
> 
> I use my own DTD which enhances the default one by adding
> an element for figures with a caption and an automatic counter
> and another element with a reference to this first element which could
> be used
> like this
> 
> <sfigure id="somepic" src="imgaes/some.png" alt="some explanation"
>  caption="This is a picture"/>
> 
> See <sref ref="somepic" label="Figure"/> ...
> 
> This works very good as long as I need output to html and I implemented
> my changes in my skins 'document-to-html.xsl' mainly.
> 
> Now I like to add these elements to 'document-to-fo.xsl' to get it in
> PDF too.
> However, following FOR-1136 my local file isn't used anymore (/-#).
> Now, I follow the path and like to understand how I could use the
> locationmap.xml
> to add my changes again.
> 
> The problem seems that my project locationmap.xml isn't recognized.
> I cannot find any reference to it in the locationmap.log-file, the same
> happens
> for locationmap-project.xml...
> 
> I use 0.9dev (not fully up to date) and my locationmap.xml is in
> PROJECT_HOME/src/content/locationmap.xml
> (Note: I removed the 'documentation' directory for my project)
> 
> I added this to it to try to use my old document-to-fo.xsl again:
> 
>     <match pattern="pdf.transform.*.*">
>       <select>
>         <location
> src="{properties:skins-dir}/abaqus/xslt/fo/{1}-to-{2}.xsl"/>
>       </select>
>     </match>
> 
> and I added this to my document-to-fo.xsl:
> 
> <xsl:import
> href="{forrest:forrest.plugins}/org.apache.forrest.plugin.output.pdf/resources/stylesheets/document-to-fo.xsl"/>
> 
> hoping it will work...

Better to understand how the locationmaps work ;-)

I just use the default skin, so i don't what you really
need to do. Ditto for the Forrest project website.

When i look at Forrest's core locationmaps, it seems
that it already tries in your project first. So you
should not need to do any locationmap nor import.

Look at $FORREST_HOME/main/webapp/locationmap-transforms.xml
and search in file for "skin transforms".

 32 <!-- ================================== -->
 33 <!-- skin transforms                    -->
 34 <!-- ================================== -->
 35     <match pattern="transform.*.fo">
 36       <select>
 37         <location src="{properties:skins-dir}{forrest:forrest.skin}/xslt/fo/{1}-to-fo.xsl" />
 38         <location src="{forrest:forrest.context}/skins/{forrest:forrest.skin}/xslt/fo/{1}-to-fo.xsl"/>
 39         <location src="{forrest:forrest.context}/skins/common/xslt/fo/{1}-to-fo.xsl"/>
 40       </select>
 41     </match>

So first in your project's relevant skin dirrectory,
then in forrest core relevant skin dirrectory,
then in forrest core common skin dirrectory.

Hope that helps.

-David