You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Thorsten Scherler <th...@apache.org> on 2006/07/18 19:03:05 UTC

Re: [jira] Commented: (FOR-893) wildcard matcher such as **.xml when used in lm actions like {1} are not rewritten

El mar, 18-07-2006 a las 17:17 +0200, Cyriaque Dupoirieux escribió:
> le 17/07/2006 16:10 Thorsten Scherler a écrit :
> > El lun, 17-07-2006 a las 11:28 +0200, Cyriaque Dupoirieux escribió:
> >   
> >> le 17/07/2006 10:46 Thorsten Scherler a écrit :
> >>     
> >>> El lun, 17-07-2006 a las 01:18 -0700, Cyriaque Dupoirieux (JIRA)
> >>> escribió:
> >>>       
> > [SNIP...]
> >   
> 
> > I am not sure. This is not a dispatcher problem but more a locationmap
> > one. The dispatcher transformer is coming into place later. However you
> > can do something like:
> > Index:
> > src/java/org/apache/forrest/dispatcher/acting/RecursiveDirectoryTraversalAction.java
> > ===================================================================
> > ---
> > src/java/org/apache/forrest/dispatcher/acting/RecursiveDirectoryTraversalAction.java        (revisión: 422657)
> > +++
> > src/java/org/apache/forrest/dispatcher/acting/RecursiveDirectoryTraversalAction.java        (copia de trabajo)
> > @@ -96,6 +96,7 @@
> >          this.prepare(parameters, source);
> >          String uri = this.getProjectDir() + this.getRequest()
> >                  + this.getProjectExtension();
> > +        getLogger().warn("RecursiveDirectoryTraversalAction trying to
> > use uri: "+uri);
> >          Map returnMap = act(uri);
> >          return returnMap;
> >      }
> > @@ -116,6 +117,7 @@
> >              this.computeResponseURI(uri, src);
> >              //src = resolver.resolveURI(uri);
> >              if (this.map.containsKey("uri")) {
> > +               getLogger().warn("RecursiveDirectoryTraversalAction
> > found at location: "+uri);
> >                  return this.map;
> >              } else {
> >                  return null;
> >
> > For debug e.g the RecursiveDirectoryTraversalAction and see what the uri
> > is.
> >
> > You can see it with
> > tail -f build/webapp/WEB-INF/logs/*.log|grep
> > RecursiveDirectoryTraversalAction
> >
> > which should return something like:
> > WARN    (2006-07-17) 16:08.49:702   [core.modules.mapper.lm]
> > (/search.html) PoolThread-4/RecursiveDirectoryTraversalAction:
> > RecursiveDirectoryTraversalAction trying to use
> > uri: /home/thorsten/src/x/blog/src/documentation/resources/structurer/url/search.fv
> > WARN    (2006-07-17) 16:08.49:705   [core.modules.mapper.lm]
> > (/search.html) PoolThread-4/RecursiveDirectoryTraversalAction:
> > RecursiveDirectoryTraversalAction trying to use
> > uri: /home/thorsten/src/x/blog/src/documentation/content/xdocs/search.fv
> > WARN    (2006-07-17) 16:08.49:705   [core.modules.mapper.lm]
> > (/search.html) PoolThread-4/RecursiveDirectoryTraversalAction:
> > RecursiveDirectoryTraversalAction found at
> > location: /home/thorsten/src/x/blog/src/documentation/content/xdocs/search.fv
> >
> > In any case please do 
> > thorsten@cartman:~/src/apache/forrest/trunk/main$ ./build.sh clean
> > thorsten@cartman:~/src/apache/forrest/trunk/main$ ./build.sh
> > before you test.
> >   
> Done,
> > Make sure that
> > forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher$ svn diff locationmap.xml 
> > returns nothing.
> >   
> Done,
> 
> Now the results :
> ============
> Example of my structure :
> 
> xdocs/
>     |-- jeux
>         |-- ultima2.xml
>         `-- ultima2/
>             `-- mondes/
>                 |-- mapx21.xml
> 
> 
> structurer/url/
>            |-- jeux/
>            |   `-- ultima2/
>            |       `-- mondes/
>            |           |-- pelt.fv
>            `-- pelt.fv
> 
> The correct behaviour should be :
> - jeux/ultima2.xml uses structurer/url/pelt.fv

To clarify, requesting "jeux/ultima2.html" should use
"structurer/url/pelt.fv"

> - jeux/ultima2/mondes/mapx21 uses structure/url/jeux/ultima2/mondes/pelt.fv
> 
> 
> dispatcherErrorStack:
>  org.xml.sax.SAXParseException: The markup in the document following the 
> root element must be well-formed.

What is the whole error?

> 
> WARN    (2006-07-18) 15:53.33:656   [cocoon.manager] (Unknown-URI) 
> Unknown-Thread/SourceExistsSelector: Error reading from source 
> 'lm://dispatcher.structurer.resourceType.document-v20': Could not 
> resolve locationmap location.

This is the sourceType action.

> 
> WARN    (2006-07-18) 15:53.33:656   [cocoon.manager] (Unknown-URI) 
> Unknown-Thread/RecursiveDirectoryTraversalAction: trying to use uri: 
> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2.fv
> 

Ok, we are requesting jeux/ultima2.html. Right?

> WARN    (2006-07-18) 15:53.33:656   [cocoon.manager] (Unknown-URI) 
> Unknown-Thread/RecursiveDirectoryTraversalAction: found at location: 
> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/pelt.fv 
> for 
> [D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2.fv]

The primary structurer for the request would have been
"jeux/ultima2.fv". This file does not exist and the calculation of the
"RecursiveDirectoryTraversalAction" found D:\duc
\viewSitePerso/src/documentation/resources/structurer/url/pelt.fv as
responsible structurer. 

Looks good.

> WARN    (2006-07-18) 15:53.35:453   [cocoon.manager] (Unknown-URI) 
> Unknown-Thread/RecursiveDirectoryTraversalAction: trying to use uri: 
> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv

This is the where the request <parameter value="{1} or {../1}"
name="request"/> does not get resolved.

Why is this request made anyway. We already found the right location. Or
is it a different one?

> WARN    (2006-07-18) 15:53.35:453   [cocoon.manager] (Unknown-URI) 
> Unknown-Thread/RecursiveDirectoryTraversalAction: found at location: 
> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/pelt.fv 
> for [D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv]
> 

fallback

> ERROR   (2006-07-18) 15:53.37:000   [cocoon.manager] (Unknown-URI) 
> Unknown-Thread/DispatcherTransformer: dispatcherError: 500 - Internal 
> server error
> The contract "content-title" has thrown thrown an exception by resolving 
> raw data from "cocoon://jeux/ultima2/mondes/mapx21.title.xml".
> 

hmm, what does
http://localhost:8888/jeux/ultima2/mondes/mapx21.title.xml return?

> So here, we can see that there is a problem with the uri of the second 
> file which is jeux/ultima2/mondes/mapx21.xml

The main question that is raising in my head is: do you use
jeux/ultima2/mondes/mapx21.xml from within jeux/ultima2.fv? If so can I
see the definition?

> 
> Now, I replace the {../1} by {1} in the request - just to see :
> dispatcherErrorStack:
>  org.xml.sax.SAXParseException: The markup in the document following the 
> root element must be well-formed.
> 
> WARN    (2006-07-18) 16:48.36:312   [cocoon.manager] (Unknown-URI) 
> Unknown-Thread/SourceExistsSelector: Error reading from source 
> 'lm://dispatcher.structurer.resourceType.document-v20': Could not 
> resolve locationmap location.
> 
> WARN    (2006-07-18) 16:48.36:312   [cocoon.manager] (Unknown-URI) 
> Unknown-Thread/RecursiveDirectoryTraversalAction: trying to use uri: 
> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv

This is the where the request <parameter value="{1}" name="request"/>
does not get resolved.

> WARN    (2006-07-18) 16:48.36:312   [cocoon.manager] (Unknown-URI) 
> Unknown-Thread/RecursiveDirectoryTraversalAction: found at location: 
> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/pelt.fv 
> for [D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv]

Fallback.

> WARN    (2006-07-18) 16:48.38:109   [cocoon.manager] (Unknown-URI) 
> Unknown-Thread/RecursiveDirectoryTraversalAction: trying to use uri: 
> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2/mondes/mapx21.fv
> 
> WARN    (2006-07-18) 16:48.38:109   [cocoon.manager] (Unknown-URI) 
> Unknown-Thread/RecursiveDirectoryTraversalAction: found at location: 
> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2/mondes/pelt.fv 
> for 
> [D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2/mondes/mapx21.fv]
> 

The primary structurer for the request would have been
"jeux/ultima2/mondes/mapx21.fv". This file does not exist and the
calculation of the "RecursiveDirectoryTraversalAction" found D:\duc
\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2/mondes/pelt.fv as responsible structurer. 

Looks good.

> And now there is a problem with the uri of the first file which is 
> jeux/ultima2.xml

Yeah, I see. Is this one and the same request? Can you specify what you
are requesting for each log?

> I think you are going to understand :-)  since my logs are not identical 
> to yours :
>     I have [cocoon.manager] instead of [core.modules.mapper.lm]
>     and (Unknown-URI) Unknown-Thread instead of (/search.html) PoolThread-4
> 

That is not the problem but I do not understand the requests. Why
(Unknown-URI)? Can you change it to the request like (/search.html)? It
looks like there is difference in dispatching the files. 

Very weird.

We need to find the difference.

salu2
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


Re: [jira] Commented: (FOR-893) wildcard matcher such as **.xml when used in lm actions like {1} are not rewritten

Posted by Cyriaque Dupoirieux <Cy...@pcotech.fr>.
le 18/07/2006 19:03 Thorsten Scherler a écrit :
> El mar, 18-07-2006 a las 17:17 +0200, Cyriaque Dupoirieux escribió:
>   
>> le 17/07/2006 16:10 Thorsten Scherler a écrit :
>>     
>>> El lun, 17-07-2006 a las 11:28 +0200, Cyriaque Dupoirieux escribió:
>>>   
>>>       
>>>> le 17/07/2006 10:46 Thorsten Scherler a écrit :
>>>>     
>>>>         
>>>>> El lun, 17-07-2006 a las 01:18 -0700, Cyriaque Dupoirieux (JIRA)
>>>>> escribió:
>>>>>       
[SNIP...]

>>>>>
>>>>> Now the results :
>>>>> ============
>>>>> Example of my structure :
>>>>>
>>>>> xdocs/
>>>>>     |-- jeux
>>>>>         |-- ultima2.xml
>>>>>         `-- ultima2/
>>>>>             `-- mondes/
>>>>>                 |-- mapx21.xml
>>>>>
>>>>>
>>>>> structurer/url/
>>>>>            |-- jeux/
>>>>>            |   `-- ultima2/
>>>>>            |       `-- mondes/
>>>>>            |           |-- pelt.fv
>>>>>            `-- pelt.fv
>>>>>
>>>>> The correct behaviour should be :
>>>>> - jeux/ultima2.xml uses structurer/url/pelt.fv
>>>>>           
>
> To clarify, requesting "jeux/ultima2.html" should use
> "structurer/url/pelt.fv"
>
>   
>> - jeux/ultima2/mondes/mapx21 uses structure/url/jeux/ultima2/mondes/pelt.fv
>>
>>
>> dispatcherErrorStack:
>>  org.xml.sax.SAXParseException: The markup in the document following the 
>> root element must be well-formed.
>>     
>
> What is the whole error?
>   
I don't know...
>   
>> WARN    (2006-07-18) 15:53.33:656   [cocoon.manager] (Unknown-URI) 
>> Unknown-Thread/SourceExistsSelector: Error reading from source 
>> 'lm://dispatcher.structurer.resourceType.document-v20': Could not 
>> resolve locationmap location.
>>     
>
> This is the sourceType action.
>   
Ok,
>   
>> WARN    (2006-07-18) 15:53.33:656   [cocoon.manager] (Unknown-URI) 
>> Unknown-Thread/RecursiveDirectoryTraversalAction: trying to use uri: 
>> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2.fv
>>
>>     
>
> Ok, we are requesting jeux/ultima2.html. Right?
>   
Yes,
>   
>> WARN    (2006-07-18) 15:53.33:656   [cocoon.manager] (Unknown-URI) 
>> Unknown-Thread/RecursiveDirectoryTraversalAction: found at location: 
>> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/pelt.fv 
>> for 
>> [D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2.fv]
>>     
>
> The primary structurer for the request would have been
> "jeux/ultima2.fv". This file does not exist and the calculation of the
> "RecursiveDirectoryTraversalAction" found D:\duc
> \viewSitePerso/src/documentation/resources/structurer/url/pelt.fv as
> responsible structurer. 
>
> Looks good.
>   
Yes,
>   
>> WARN    (2006-07-18) 15:53.35:453   [cocoon.manager] (Unknown-URI) 
>> Unknown-Thread/RecursiveDirectoryTraversalAction: trying to use uri: 
>> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv
>>     
>
> This is the where the request <parameter value="{1} or {../1}"
> name="request"/> does not get resolved.
>   
In that test, it is {../1}
> Why is this request made anyway. We already found the right location. Or
> is it a different one?
>   
This request is made inside ultima2.html :
   
    <a class="fork" href="ultima2/mondes/mapx21.php" title="Le 
Jester">Le Jester</a>
(I realise that it's a php page, but I have no problem with the php plugin.)
>   
>> WARN    (2006-07-18) 15:53.35:453   [cocoon.manager] (Unknown-URI) 
>> Unknown-Thread/RecursiveDirectoryTraversalAction: found at location: 
>> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/pelt.fv 
>> for [D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv]
>>
>>     
>
> fallback
>
>   
>> ERROR   (2006-07-18) 15:53.37:000   [cocoon.manager] (Unknown-URI) 
>> Unknown-Thread/DispatcherTransformer: dispatcherError: 500 - Internal 
>> server error
>> The contract "content-title" has thrown thrown an exception by resolving 
>> raw data from "cocoon://jeux/ultima2/mondes/mapx21.title.xml".
>>
>>     
>
> hmm, what does
> http://localhost:8888/jeux/ultima2/mondes/mapx21.title.xml return?
>   
The mapx21.xml must use a very specific fv file. Here it uses the 
default pelt.fv and tries to calculate the mapx21.title.xml but there is 
none...
>   
>> So here, we can see that there is a problem with the uri of the second 
>> file which is jeux/ultima2/mondes/mapx21.xml
>>     
>
> The main question that is raising in my head is: do you use
> jeux/ultima2/mondes/mapx21.xml from within jeux/ultima2.fv? If so can I
> see the definition?
>   
Yes that's very interesting, see above for the definition...
>   
>> Now, I replace the {../1} by {1} in the request - just to see :
>> dispatcherErrorStack:
>>  org.xml.sax.SAXParseException: The markup in the document following the 
>> root element must be well-formed.
>>
>> WARN    (2006-07-18) 16:48.36:312   [cocoon.manager] (Unknown-URI) 
>> Unknown-Thread/SourceExistsSelector: Error reading from source 
>> 'lm://dispatcher.structurer.resourceType.document-v20': Could not 
>> resolve locationmap location.
>>
>> WARN    (2006-07-18) 16:48.36:312   [cocoon.manager] (Unknown-URI) 
>> Unknown-Thread/RecursiveDirectoryTraversalAction: trying to use uri: 
>> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv
>>     
>
> This is the where the request <parameter value="{1}" name="request"/>
> does not get resolved.
>   
Yes,
>   
>> WARN    (2006-07-18) 16:48.36:312   [cocoon.manager] (Unknown-URI) 
>> Unknown-Thread/RecursiveDirectoryTraversalAction: found at location: 
>> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/pelt.fv 
>> for [D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv]
>>     
>
> Fallback.
>
>   
>> WARN    (2006-07-18) 16:48.38:109   [cocoon.manager] (Unknown-URI) 
>> Unknown-Thread/RecursiveDirectoryTraversalAction: trying to use uri: 
>> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2/mondes/mapx21.fv
>>
>> WARN    (2006-07-18) 16:48.38:109   [cocoon.manager] (Unknown-URI) 
>> Unknown-Thread/RecursiveDirectoryTraversalAction: found at location: 
>> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2/mondes/pelt.fv 
>> for 
>> [D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2/mondes/mapx21.fv]
>>
>>     
>
> The primary structurer for the request would have been
> "jeux/ultima2/mondes/mapx21.fv". This file does not exist and the
> calculation of the "RecursiveDirectoryTraversalAction" found D:\duc
> \viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2/mondes/pelt.fv as responsible structurer. 
>
> Looks good.
>   
Yes, the fallback mecanism works if {1}. It did not worked with {../1} - 
previous test.
>   
>> And now there is a problem with the uri of the first file which is 
>> jeux/ultima2.xml
>>     
>
> Yeah, I see. Is this one and the same request? Can you specify what you
> are requesting for each log?
>   
Actually, I am making a forrest site.
The request seems to be /jeux/ultima2.html which contains an href to 
/jeux/ultima2/mondes/mapx21.php.

I can try with forrest run to see what happens.
>   
>> I think you are going to understand :-)  since my logs are not identical 
>> to yours :
>>     I have [cocoon.manager] instead of [core.modules.mapper.lm]
>>     and (Unknown-URI) Unknown-Thread instead of (/search.html) PoolThread-4
>>
>>     
>
> That is not the problem but I do not understand the requests. Why
> (Unknown-URI)? Can you change it to the request like (/search.html)? It
> looks like there is difference in dispatching the files. 
>   
Maybe the difference comes from the fact I am making a static site ?
> Very weird.
>   
Indeed !
> We need to find the difference.
>   
We are on the good way.
> salu2
>   
Salutations,
Cyriaque,

Re: [jira] Commented: (FOR-893) wildcard matcher such as **.xml when used in lm actions like {1} are not rewritten

Posted by Cyriaque Dupoirieux <Cy...@pcotech.fr>.
le 19/07/2006 12:59 Thorsten Scherler a écrit :
> El mié, 19-07-2006 a las 12:47 +0200, Cyriaque Dupoirieux escribió:
>   
>> le 19/07/2006 10:46 Cyriaque Dupoirieux a écrit :
>>     
>>> le 18/07/2006 19:03 Thorsten Scherler a écrit :
>>>       
>>>>>>>>                 
>>>>>>>>                 
>>>>>> [SNIP...]
>>> I have made the test with forrest run :
>>> here are the logs generated with the standard plugin (the HEAD)
>>> Call to jeux/ultima2.html :
>>> WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): Error reading 
>>> from source 'lm://dispatcher.structurer.resourceType.document-v20': 
>>> Could not resolve locationmap location.
>>> WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): trying to use 
>>> uri: 
>>> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2.fv 
>>>
>>> WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): found at 
>>> location: 
>>> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/pelt.fv 
>>> for 
>>> [D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2.fv] 
>>>
>>>
>>> Call to jeux/ultima2/mondes/mapx21.php :
>>> WARN    [core.modules.mapper.lm] (/jeux/ultima2/mondes/mapx21.php): 
>>> trying to use uri: 
>>> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv
>>> WARN    [core.modules.mapper.lm] (/jeux/ultima2/mondes/mapx21.php): 
>>> found at location: 
>>> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/pelt.fv 
>>> for [D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv]
>>>
>>>       
>
> Ok, I think we getting closer.
>
> Have a look in the output.xmap of the php plugin:
>     <map:match type="regexp" pattern="^(.*?)([^/]*).php$">
>       <map:generate src="cocoon://{1}{2}.html"/>
>       <map:transform src="resources/stylesheets/php/document2php.xsl"/>
>       <map:serialize type="html"/>
>     </map:match>
>
> It is requesting a html file.
Yes, it is a simple plugin which take in entry a file following the 
document-v20.dtd + the <php> CDATA </php>.
First, it asks to generate the html (skinned layout of the page with the 
<php> tags left)
Then it applies the document2php.xsl which just converts the <php> tags 
into <?php and ?>
It's really simple but it works wery well.
Example :

    <section id="samples">
      <title>Samples</title>
      <p>The call to phpinfo function is made just after this sentence.</p>
*      <php><![CDATA[phpinfo()]]></php>*
      <p>The call to phpinfo finishes just before this sentence.</p>
  </section>
>  The stylesheet name is rather missleading
> because it is not document-to-php but rather html-to-php.
Yes you are right, I am going to rename it
>  Further why is
> this not <map:match pattern="**.php"> and <map:generate
> src="cocoon://{1}.html"/>? Maybe that is influencing.
>
> That explains why you have a dispatcher request, because normally *.php
> is not handled by the dispatcher.
Why, it is just intended to generate php file but the layout must but 
done either with skins or dispatcher as user likes.
>  The difference lies now in the
> internal processing of "cocoon://{1}{2}.html" in the lm.
>   
Ok, I don't remember why I had to use the regexp - Should have written a 
comment on this, too bad...
But the fact is that I certainly had problems with the pattern="**.php".
(Maybe it was the same problem we have with the dispatcher !)

Salutations,
Cyriaque,
>
>   
>> Salutations,
>> Cyriaque,
>>     
>
>   

Re: [jira] Commented: (FOR-893) wildcard matcher such as **.xml when used in lm actions like {1} are not rewritten

Posted by Thorsten Scherler <th...@wyona.com>.
El mié, 19-07-2006 a las 12:47 +0200, Cyriaque Dupoirieux escribió:
> le 19/07/2006 10:46 Cyriaque Dupoirieux a écrit :
> > le 18/07/2006 19:03 Thorsten Scherler a écrit :
> >>>>>>                 
> >>>> [SNIP...]
> >>>>         You can see it with
> >>>> tail -f build/webapp/WEB-INF/logs/*.log|grep
> >>>> RecursiveDirectoryTraversalAction
> >>>>
> >>>> which should return something like:
> >>>> WARN    (2006-07-17) 16:08.49:702   [core.modules.mapper.lm]
> >>>> (/search.html) PoolThread-4/RecursiveDirectoryTraversalAction:
> >>>> RecursiveDirectoryTraversalAction trying to use
> >>>> uri: 
> >>>> /home/thorsten/src/x/blog/src/documentation/resources/structurer/url/search.fv 
> >>>>
> >>>> WARN    (2006-07-17) 16:08.49:705   [core.modules.mapper.lm]
> >>>> (/search.html) PoolThread-4/RecursiveDirectoryTraversalAction:
> >>>> RecursiveDirectoryTraversalAction trying to use
> >>>> uri: 
> >>>> /home/thorsten/src/x/blog/src/documentation/content/xdocs/search.fv
> >>>> WARN    (2006-07-17) 16:08.49:705   [core.modules.mapper.lm]
> >>>> (/search.html) PoolThread-4/RecursiveDirectoryTraversalAction:
> >>>> RecursiveDirectoryTraversalAction found at
> >>>> location: 
> >>>> /home/thorsten/src/x/blog/src/documentation/content/xdocs/search.fv
> >>>>
> >>>>       
> >>
> > I have made the test with forrest run :
> > here are the logs generated with the standard plugin (the HEAD)
> > Call to jeux/ultima2.html :
> > WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): Error reading 
> > from source 'lm://dispatcher.structurer.resourceType.document-v20': 
> > Could not resolve locationmap location.
> > WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): trying to use 
> > uri: 
> > D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2.fv 
> >
> > WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): found at 
> > location: 
> > D:\duc\viewSitePerso/src/documentation/resources/structurer/url/pelt.fv 
> > for 
> > [D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2.fv] 
> >
> >
> > Call to jeux/ultima2/mondes/mapx21.php :
> > WARN    [core.modules.mapper.lm] (/jeux/ultima2/mondes/mapx21.php): 
> > trying to use uri: 
> > D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv
> > WARN    [core.modules.mapper.lm] (/jeux/ultima2/mondes/mapx21.php): 
> > found at location: 
> > D:\duc\viewSitePerso/src/documentation/resources/structurer/url/pelt.fv 
> > for [D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv]
> >

Ok, I think we getting closer.

Have a look in the output.xmap of the php plugin:
    <map:match type="regexp" pattern="^(.*?)([^/]*).php$">
      <map:generate src="cocoon://{1}{2}.html"/>
      <map:transform src="resources/stylesheets/php/document2php.xsl"/>
      <map:serialize type="html"/>
    </map:match>

It is requesting a html file. The stylesheet name is rather missleading
because it is not document-to-php but rather html-to-php. Further why is
this not <map:match pattern="**.php"> and <map:generate
src="cocoon://{1}.html"/>? Maybe that is influencing.

That explains why you have a dispatcher request, because normally *.php
is not handled by the dispatcher. The difference lies now in the
internal processing of "cocoon://{1}{2}.html" in the lm.

Now in the dispatcher we match:
<map:match pattern="**.html">
        <map:generate src="cocoon:/resolve.structurer.{1}" type="jx">
          <map:parameter name="lenient-xpath" value="true" />
          <map:parameter name="getRequest" value="{1}" />
          <map:parameter name="getRequestExtension" value="html" />
        </map:generate>
        <map:transform type="dispatcher">
          <map:parameter name="request" value="{1}" />
          <map:parameter name="type" value="html" />
          <map:parameter name="hooksTransformer"
value="lm://hooks-to-html.xsl" 
            />
        </map:transform>
        <map:transform 
          src="lm://transform.xml.xml-namespace-stripped" 
          />
        <map:transform 

src="resources/stylesheets/helper/strip-dispatcher-remains.xsl" 
          />
        <map:serialize type="xhtml" />
      </map:match>

and

<map:match pattern="resolve.structurer.**">
        <map:generate src="lm://resolve.structurer.{1}" />
        <map:serialize />
      </map:match>

So we should treat both calls the same. However for the lm this seems to
makes a difference which we need to find out where it is coming from.
Maybe it has something to do with the mounting of the lm in plugins, but
that is a shot in the dark.


> >
> > And here are the logs with {1} in the request :
> > WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): Error reading 
> > from source 'lm://dispatcher.structurer.resourceType.document-v20': 
> > Could not resolve locationmap location.
> > WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): trying to use 
> > uri: D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv
> > WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): found at 
> > location: 
> > D:\duc\viewSitePerso/src/documentation/resources/structurer/url/pelt.fv 
> > for [D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv]
> > WARN    [core.modules.mapper.lm] (/jeux/ultima2/mondes/mapx21.php): 
> > trying to use uri: 
> > D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2/mondes/mapx21.fv 
> >
> > WARN    [core.modules.mapper.lm] (/jeux/ultima2/mondes/mapx21.php): 
> > found at location: 
> > D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2/mondes/pelt.fv 
> > for 
> > [D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2/mondes/mapx21.fv] 
> >
> >
> > Cyriaque,
> >
> >
> I have tried something completly crazy :
> If I use {../1} the request of some files are empty
> If I use {1} the request of other files is empty
> But I never have {../1} AND {1} is empty or fullfilled at the same time...
> 
> So I use {../1}{1} and it works in every time.

The exact thing I was thinking about as a workaround.

> 
> It is a work around untill we understand some dispatcher strange 
> behaviours :

The above issue is not dispatcher specific. It occurs in the dispatcher
lm but it is a locationmap (in combination of select/act/parameter)
issue.

> - Sometimes, the dispatcher generates two files 
> (http://issues.apache.org/jira/browse/FOR-821)
> Which may be linked...

Hmm, I am not sure whether they are linked.


> 
> If you agree, - because this is the first time since several monthes 
> that I succeed to generate my whole site - I apply my modification in 
> the vault.

I am not happy but yeah apply it and add a note that it is a workaround.
We need to understand better what is going on with the lm and why it
treats this stuff different.

salu2

> 
> 
> Salutations,
> Cyriaque,

-- 
Thorsten Scherler
COO Spain
Wyona Inc.  -  Open Source Content Management  -  Apache Lenya
http://www.wyona.com                   http://lenya.apache.org
thorsten.scherler@wyona.com                thorsten@apache.org


Re: [jira] Commented: (FOR-893) wildcard matcher such as **.xml when used in lm actions like {1} are not rewritten

Posted by Cyriaque Dupoirieux <Cy...@pcotech.fr>.
le 19/07/2006 10:46 Cyriaque Dupoirieux a écrit :
> le 18/07/2006 19:03 Thorsten Scherler a écrit :
>>>>>>                 
>>>> [SNIP...]
>>>>         You can see it with
>>>> tail -f build/webapp/WEB-INF/logs/*.log|grep
>>>> RecursiveDirectoryTraversalAction
>>>>
>>>> which should return something like:
>>>> WARN    (2006-07-17) 16:08.49:702   [core.modules.mapper.lm]
>>>> (/search.html) PoolThread-4/RecursiveDirectoryTraversalAction:
>>>> RecursiveDirectoryTraversalAction trying to use
>>>> uri: 
>>>> /home/thorsten/src/x/blog/src/documentation/resources/structurer/url/search.fv 
>>>>
>>>> WARN    (2006-07-17) 16:08.49:705   [core.modules.mapper.lm]
>>>> (/search.html) PoolThread-4/RecursiveDirectoryTraversalAction:
>>>> RecursiveDirectoryTraversalAction trying to use
>>>> uri: 
>>>> /home/thorsten/src/x/blog/src/documentation/content/xdocs/search.fv
>>>> WARN    (2006-07-17) 16:08.49:705   [core.modules.mapper.lm]
>>>> (/search.html) PoolThread-4/RecursiveDirectoryTraversalAction:
>>>> RecursiveDirectoryTraversalAction found at
>>>> location: 
>>>> /home/thorsten/src/x/blog/src/documentation/content/xdocs/search.fv
>>>>
>>>>       
>>
> I have made the test with forrest run :
> here are the logs generated with the standard plugin (the HEAD)
> Call to jeux/ultima2.html :
> WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): Error reading 
> from source 'lm://dispatcher.structurer.resourceType.document-v20': 
> Could not resolve locationmap location.
> WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): trying to use 
> uri: 
> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2.fv 
>
> WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): found at 
> location: 
> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/pelt.fv 
> for 
> [D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2.fv] 
>
>
> Call to jeux/ultima2/mondes/mapx21.php :
> WARN    [core.modules.mapper.lm] (/jeux/ultima2/mondes/mapx21.php): 
> trying to use uri: 
> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv
> WARN    [core.modules.mapper.lm] (/jeux/ultima2/mondes/mapx21.php): 
> found at location: 
> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/pelt.fv 
> for [D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv]
>
>
> And here are the logs with {1} in the request :
> WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): Error reading 
> from source 'lm://dispatcher.structurer.resourceType.document-v20': 
> Could not resolve locationmap location.
> WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): trying to use 
> uri: D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv
> WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): found at 
> location: 
> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/pelt.fv 
> for [D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv]
> WARN    [core.modules.mapper.lm] (/jeux/ultima2/mondes/mapx21.php): 
> trying to use uri: 
> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2/mondes/mapx21.fv 
>
> WARN    [core.modules.mapper.lm] (/jeux/ultima2/mondes/mapx21.php): 
> found at location: 
> D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2/mondes/pelt.fv 
> for 
> [D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2/mondes/mapx21.fv] 
>
>
> Cyriaque,
>
>
I have tried something completly crazy :
If I use {../1} the request of some files are empty
If I use {1} the request of other files is empty
But I never have {../1} AND {1} is empty or fullfilled at the same time...

So I use {../1}{1} and it works in every time.

It is a work around untill we understand some dispatcher strange 
behaviours :
- Sometimes, the dispatcher generates two files 
(http://issues.apache.org/jira/browse/FOR-821)
Which may be linked...


If you agree, - because this is the first time since several monthes 
that I succeed to generate my whole site - I apply my modification in 
the vault.


Salutations,
Cyriaque,


Re: [jira] Commented: (FOR-893) wildcard matcher such as **.xml when used in lm actions like {1} are not rewritten

Posted by Cyriaque Dupoirieux <Cy...@pcotech.fr>.
le 18/07/2006 19:03 Thorsten Scherler a écrit :
>>>>>       
>>>>>           
>>> [SNIP...]
>>>   
>>>       
>>> You can see it with
>>> tail -f build/webapp/WEB-INF/logs/*.log|grep
>>> RecursiveDirectoryTraversalAction
>>>
>>> which should return something like:
>>> WARN    (2006-07-17) 16:08.49:702   [core.modules.mapper.lm]
>>> (/search.html) PoolThread-4/RecursiveDirectoryTraversalAction:
>>> RecursiveDirectoryTraversalAction trying to use
>>> uri: /home/thorsten/src/x/blog/src/documentation/resources/structurer/url/search.fv
>>> WARN    (2006-07-17) 16:08.49:705   [core.modules.mapper.lm]
>>> (/search.html) PoolThread-4/RecursiveDirectoryTraversalAction:
>>> RecursiveDirectoryTraversalAction trying to use
>>> uri: /home/thorsten/src/x/blog/src/documentation/content/xdocs/search.fv
>>> WARN    (2006-07-17) 16:08.49:705   [core.modules.mapper.lm]
>>> (/search.html) PoolThread-4/RecursiveDirectoryTraversalAction:
>>> RecursiveDirectoryTraversalAction found at
>>> location: /home/thorsten/src/x/blog/src/documentation/content/xdocs/search.fv
>>>
>>>       
>
I have made the test with forrest run :
here are the logs generated with the standard plugin (the HEAD)
Call to jeux/ultima2.html :
WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): Error reading 
from source 'lm://dispatcher.structurer.resourceType.document-v20': 
Could not resolve locationmap location.
WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): trying to use 
uri: 
D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2.fv
WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): found at 
location: 
D:\duc\viewSitePerso/src/documentation/resources/structurer/url/pelt.fv 
for 
[D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2.fv]

Call to jeux/ultima2/mondes/mapx21.php :
WARN    [core.modules.mapper.lm] (/jeux/ultima2/mondes/mapx21.php): 
trying to use uri: 
D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv
WARN    [core.modules.mapper.lm] (/jeux/ultima2/mondes/mapx21.php): 
found at location: 
D:\duc\viewSitePerso/src/documentation/resources/structurer/url/pelt.fv 
for [D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv]


And here are the logs with {1} in the request :
WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): Error reading 
from source 'lm://dispatcher.structurer.resourceType.document-v20': 
Could not resolve locationmap location.
WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): trying to use 
uri: D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv
WARN    [core.modules.mapper.lm] (/jeux/ultima2.html): found at 
location: 
D:\duc\viewSitePerso/src/documentation/resources/structurer/url/pelt.fv 
for [D:\duc\viewSitePerso/src/documentation/resources/structurer/url/.fv]
WARN    [core.modules.mapper.lm] (/jeux/ultima2/mondes/mapx21.php): 
trying to use uri: 
D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2/mondes/mapx21.fv
WARN    [core.modules.mapper.lm] (/jeux/ultima2/mondes/mapx21.php): 
found at location: 
D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2/mondes/pelt.fv 
for 
[D:\duc\viewSitePerso/src/documentation/resources/structurer/url/jeux/ultima2/mondes/mapx21.fv]

Cyriaque,