forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cyriaque Dupoirieux <Cyriaque.Dupoiri...@pcotech.fr>
Subject Re: [jira] Commented: (FOR-893) wildcard matcher such as **.xml when used in lm actions like {1} are not rewritten
Date Tue, 18 Jul 2006 15:17:14 GMT
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
- 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.

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.

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

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]

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

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]

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".

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

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

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]

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]

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

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

Salutations,
Cyriaque,
> salu2
>
>   
>> Salutations,
>> Cyriaque,
>>     
>>>> If I replace the {../1} by the previous {1} :
>>>>         <act type="RecursiveDirectoryTraversalAction">
>>>>           <parameter value="{1}" name="request"/>
>>>>           <parameter value="{project:theme}" name="projectFallback"/>
>>>>           <parameter value="{project:theme-ext}" name="projectExtension"/>
>>>>           <parameter value="{project:content.xdocs}" name="projectDir"/>
>>>>           <!--  xdocs  [depreciated]
>>>>             project-based theme-based = directory-based / parent-directory
based (recursively) -->
>>>>           <location src="{uri}" />
>>>>         </act>
>>>>         <act type="RecursiveDirectoryTraversalAction">
>>>>           <parameter value="{../1}" name="request"/>
>>>>           <parameter value="{project:theme}" name="projectFallback"/>
>>>>           <parameter value="{project:theme-ext}" name="projectExtension"/>
>>>>           <parameter value="{project:resources}structurer/url/" name="projectDir"/>
>>>>           <!--  url
>>>>             project-based theme-based = directory-based / parent-directory
based (recursively) -->
>>>>           <location src="{uri}" />
>>>>         </act>
>>>> It works again.
>>>>
>>>> I reopen the FOR...
>>>>     
>>>>         
>>> Hmm, it is hard to assist on this since it is working fine for me.
>>>
>>> Did you change the locationmap.xml or have implemented own matches in
>>> your project lm?
>>>
>>> Can somebody else test the current changes?
>>>
>>> salu2
>>>
>>>   
>>>       
>>>>> wildcard matcher such as **.xml when used in lm actions like {1} are
not rewritten
>>>>> ----------------------------------------------------------------------------------
>>>>>
>>>>>                 Key: FOR-893
>>>>>                 URL: http://issues.apache.org/jira/browse/FOR-893
>>>>>             Project: Forrest
>>>>>          Issue Type: Bug
>>>>>          Components: Locationmap, Dispatcher (aka views)
>>>>>            Reporter: Thorsten Scherler
>>>>>         Attachments: lm.log.xml
>>>>>
>>>>>
>>>>> In the thread http://marc.theaimsgroup.com/?t=114682704400003&r=1&w=2
I found out the following.
>>>>> I did a debug session with the RecursiveDirectoryTraversalAction and
I
>>>>> figured out that the {1} in the lm is not probably resolved (it is
>>>>> always "").
>>>>> <match pattern="resolve.structurer.**">
>>>>> ...
>>>>>  <act type="RecursiveDirectoryTraversalAction">
>>>>>   <parameter value="{1}" name="request"/>
>>>>> It seems to happen in all lm actions, I debugged the resourceTypeAction
>>>>> and the same problem can be seen.
>>>>> I attached the result of 
>>>>> svn log . -v --xml >~/src/apache/forrest/trunk/lm.log.xml
>>>>>       
>>>>>           
>>>   
>>>       

Mime
View raw message