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 2005/08/28 04:28:43 UTC

Re: exists selector in locationmap

On Fri, 2005-07-15 at 09:04 -0400, Tim Williams wrote:
> Does any actually have the select exists working with locationmap? 
> I'm trying based on the syntax difference that Unico described in a
> previous mail but it looks like the SourceResolver used in
> SourceExistsSelector is null when it gets there.  I'd like to be able
> to confirm whether this is a simple syntax goof on my part or
> something else.  If anyone does have it working can you post a copy of
> the relevant bits of your locationmap?
> 
> Here's what I was using just to play around with it:
> 
>      <match pattern="tabs.xml">
>       <select type="exists">      
>         <location src="{project:content.xdocs}tabs1.xml"/>
>         <location src="{project:content.xdocs}tabs2.xml"/>
>       </select>   
>      </match>
> 
> Thanks,
> --tim

Is that working for you right now?

I see the same error. I debugged the classes and found out that 
try {
            final ServiceSelector selectors = (ServiceSelector)
super.m_manager.lookup(Selector.ROLE + "Selector");
            m_selector = (Selector) selectors.select(m_type);
        } catch (ServiceException e) {
            final String message = "Unable to get Selector of type " +
m_type;
            throw new ConfigurationException(message,e);
        }
in SelectNode.java is the throwing source. 

Caused by:
org.apache.avalon.framework.configuration.ConfigurationException: Unable
to get Selector of type exists
        at
org.apache.forrest.locationmap.lm.SelectNode.build(SelectNode.java:67)
        at
org.apache.forrest.locationmap.lm.MatchNode.build(MatchNode.java:114)
        at
org.apache.forrest.locationmap.lm.LocatorNode.build(LocatorNode.java:95)
        at
org.apache.forrest.locationmap.lm.LocationMap.build(LocationMap.java:204)
        at
org.apache.forrest.locationmap.LocationMapModule.getLocationMap(LocationMapModule.java:104)
        at
org.apache.forrest.locationmap.LocationMapModule.getAttribute(LocationMapModule.java:158)
        at
org.apache.cocoon.components.treeprocessor.variables.PreparedVariableResolver.processModule(PreparedVariableResolver.java:246)
        ... 37 more
Caused by: org.apache.avalon.framework.service.ServiceException: Unable
to provide implementation (Key='/exists')
        at
org.apache.avalon.framework.service.DefaultServiceSelector.select(DefaultServiceSelector.java:116)
        at
org.apache.forrest.locationmap.lm.SelectNode.build(SelectNode.java:64)
        ... 43 more

I am looking into it. Any hints or tips?

salu2
-- 
thorsten

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


Re: exists selector in locationmap

Posted by Thorsten Scherler <th...@apache.org>.
On Sun, 2005-08-28 at 09:36 -0400, Tim Williams wrote:
> On 8/28/05, Thorsten Scherler <th...@apache.org> wrote:
> > Before I go to sleep.
> > 
> > One thing is handy if you use an IDE like Eclipse and want to debug
> > java:
> > # Any other arguments to pass to the JVM. For example, to run on an
> > X-less
> > # server, set to -Djava.awt.headless=true
> > forrest.jvmargs=-Xdebug
> > -Xrunjdwp:transport=dt_socket,address=8000,server=y,susp end=n
> > 
> > That starts your project in debugging mode with Port 8000. The default
> > debug port from e.g. Eclipse. Then you can set breakpoints to debug.
> > That is pretty sweet. ;-)
> > 
> > Good night.
> > 
> > salu2
> > 
> > On Sun, 2005-08-28 at 06:19 +0200, Thorsten Scherler wrote:
> > > On Sat, 2005-08-27 at 23:41 -0400, Tim Williams wrote:
> > >
> > > > > I forgot:
> > > > > <locationmap xmlns="http://apache.org/forrest/locationmap/1.0">
> > > > >   <components>
> > > > >     <matchers default="lm">
> > > > >       <matcher name="lm"
> > > > > src="org.apache.forrest.locationmap.WildcardLocationMapHintMatcher"/>
> > > > >     </matchers>
> > > > >     <actions default="RecursiveDirectoryTraversalAction">
> > > > >       <action name="RecursiveDirectoryTraversalAction"
> > > > > src="org.apache.forrest.plugin.internal.view.acting.RecursiveDirectoryTraversalAction"/>
> > > > >     </actions>
> > > > >     <selectors default="exists">
> > > > >             <selector name="exists"
> > > > > src="org.apache.forrest.sourceexists.SourceExistsSelector" />
> > > > >           </selectors>
> > > > >   </components>
> > > > >   <locator>
> > > > >     <match pattern="views/**">
> > > > >       <select type="exists">
> > > > >         <!-- File-based -->
> > > > >         <location src="{1}{project:theme-ext}" />
> > > > >               <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"/>
> > > > >           <!-- Directory-based / Parent-directory based (recursively)
> > > > > -->
> > > > >                 <location src="{uri}" />
> > > > >               </act>
> > > > >         <!-- Theme based -->
> > > > >         <location
> > > > > src="{defaults:view-themes}/{project:theme}{project:theme-ext}" />
> > > > >         <!-- Application Default -->
> > > > >         <location
> > > > > src="{defaults:view-themes}/{defaults:theme}{defaults:theme-ext}" />
> > > > >       </select>
> > > > >     </match>
> > > > >   </locator>
> > > > > </locationmap>
> > > >
> > > > Out of quick curiousity, have you taken the 'act' out of this and seen
> > > > if the "exists" selector will work against the "location"'s alone?
> > >
> > > Yes, i did this but no success. Then I reduced till:
> > > <locationmap xmlns="http://apache.org/forrest/locationmap/1.0">
> > >   <components>
> > >     <matchers default="lm">
> > >       <matcher name="lm"
> > >
> > > src="org.apache.forrest.locationmap.WildcardLocationMapHintMatcher"/>
> > >     </matchers>
> > >     <selectors default="exists">
> > >           <selector name="exists"
> > >             src="org.apache.forrest.sourceexists.SourceExistsSelector" />
> > >         </selectors>
> > >   </components>
> > >   <locator>
> > >     <match pattern="views/**">
> > >       <select type="exists">
> > >         <location
> > >
> > > src="{defaults:view-themes}/{defaults:theme}{defaults:theme-ext}" />
> > >       </select>
> > >     </match>
> > >   </locator>
> > > </locationmap>
> > >
> > > and it worked. That made me think about my changes. I switched the order
> > > how I defined in the lm. From:
> > > -actions
> > > -selectors
> > > to:
> > > -selectors
> > > -actions
> > >
> > > But I got the old error. I think it is in the ActNode.java that I just
> > > checked in.
> > >
> > > > That might allow us to narrow it down.  I'm going to have to read up
> > > > on actions as I think they're subtley different than other sitemap
> > > > components.
> > > >
> > >
> > > It seems to me that the ActNode is overriding the .m_manager instead of
> > > extending it. Another thing could be the LocationMap.
> > >
> > > The action is working like I described in the other thread. They send
> > > back a map or null.
> > >
> > > If an action returns null then the inner children will be ignored (not
> > > executed). If they return a Map the values of the map can be directly
> > > accessed in the sitemap by {key}.
> > >
> > > Have a quick look into the RecursiveDirectoryTraversalAction then you
> > > know how action work. You will understand directly.
> > >
> > > > I've admitted before but perhaps not to you -- I'm not a 'Cocooner' so
> > > > it takes me some time to study up on each aspect of cocoon-related
> > > > things.
> > >
> > > jeje, me too, but you know somethings about the lm. ;-) I reckon I made
> > > some mistakes in the Actnode that you may spot right on. :)
> > >
> > > >  This gives me reason to go deep on Actions but I'm just
> > > > warning that you may well find it before me.
> > > > --tim
> > >
> > > :)
> > >
> > > Cheers again for your help. :)
> > >
> > > salu2
> > --
> > thorsten
> > 
> > "Together we stand, divided we fall!"
> > Hey you (Pink Floyd)
> 
> I've got a little time this morning and hopefully more time this
> evening but not much in between.  Can you describe the environment I
> need to begin testing this?  Here's what I've done:
> Created a seed-sample.
> Built and "local-deployed" all three view-plugins

you can use etc/views.sh for that. ;-)

> Enabled views on my seeded sample
> Overwrote the seeded locationmap with yours
> ...

... and add to sitemap.xmap of your project:
<map:match pattern="getView-**">
        <map:generate src="{lm:views/{1}}" />
        <map:serialize type="xml"/>
      </map:match>

> Now, what is it that I would actually put in a directory to test this?
>  An .fv file named the same as another xml file minus extension?
> Thanks,
> --tim

If you use the default then you will be able to define all this in 
# codename: views
# uncomment the following skin if you are using views
project.skin=leather-dev
# views is using a fallback mechanism for theming.
# You can configure the theme name and its extension here
project.theme-extension=.fv
project.theme=pelt

Now if you place pelt.fv (or more general
{project.theme}{project.theme-extension}) in your root xdocs dir that
should be matched. Sure you can place it in different dirs like
(samples/pelt.fv).

To test you can request:
localhost:8888/getView-samples/subdir/index

If you just using the action then you should see the pelt.fv you just
place in the xdocs dir (either samples/pelt.fc or pelt.fv). 

Cheers

salu2
-- 
thorsten

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


Re: exists selector in locationmap

Posted by Tim Williams <wi...@gmail.com>.
On 8/28/05, Thorsten Scherler <th...@apache.org> wrote:
> Before I go to sleep.
> 
> One thing is handy if you use an IDE like Eclipse and want to debug
> java:
> # Any other arguments to pass to the JVM. For example, to run on an
> X-less
> # server, set to -Djava.awt.headless=true
> forrest.jvmargs=-Xdebug
> -Xrunjdwp:transport=dt_socket,address=8000,server=y,susp end=n
> 
> That starts your project in debugging mode with Port 8000. The default
> debug port from e.g. Eclipse. Then you can set breakpoints to debug.
> That is pretty sweet. ;-)
> 
> Good night.
> 
> salu2
> 
> On Sun, 2005-08-28 at 06:19 +0200, Thorsten Scherler wrote:
> > On Sat, 2005-08-27 at 23:41 -0400, Tim Williams wrote:
> >
> > > > I forgot:
> > > > <locationmap xmlns="http://apache.org/forrest/locationmap/1.0">
> > > >   <components>
> > > >     <matchers default="lm">
> > > >       <matcher name="lm"
> > > > src="org.apache.forrest.locationmap.WildcardLocationMapHintMatcher"/>
> > > >     </matchers>
> > > >     <actions default="RecursiveDirectoryTraversalAction">
> > > >       <action name="RecursiveDirectoryTraversalAction"
> > > > src="org.apache.forrest.plugin.internal.view.acting.RecursiveDirectoryTraversalAction"/>
> > > >     </actions>
> > > >     <selectors default="exists">
> > > >             <selector name="exists"
> > > > src="org.apache.forrest.sourceexists.SourceExistsSelector" />
> > > >           </selectors>
> > > >   </components>
> > > >   <locator>
> > > >     <match pattern="views/**">
> > > >       <select type="exists">
> > > >         <!-- File-based -->
> > > >         <location src="{1}{project:theme-ext}" />
> > > >               <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"/>
> > > >           <!-- Directory-based / Parent-directory based (recursively)
> > > > -->
> > > >                 <location src="{uri}" />
> > > >               </act>
> > > >         <!-- Theme based -->
> > > >         <location
> > > > src="{defaults:view-themes}/{project:theme}{project:theme-ext}" />
> > > >         <!-- Application Default -->
> > > >         <location
> > > > src="{defaults:view-themes}/{defaults:theme}{defaults:theme-ext}" />
> > > >       </select>
> > > >     </match>
> > > >   </locator>
> > > > </locationmap>
> > >
> > > Out of quick curiousity, have you taken the 'act' out of this and seen
> > > if the "exists" selector will work against the "location"'s alone?
> >
> > Yes, i did this but no success. Then I reduced till:
> > <locationmap xmlns="http://apache.org/forrest/locationmap/1.0">
> >   <components>
> >     <matchers default="lm">
> >       <matcher name="lm"
> >
> > src="org.apache.forrest.locationmap.WildcardLocationMapHintMatcher"/>
> >     </matchers>
> >     <selectors default="exists">
> >           <selector name="exists"
> >             src="org.apache.forrest.sourceexists.SourceExistsSelector" />
> >         </selectors>
> >   </components>
> >   <locator>
> >     <match pattern="views/**">
> >       <select type="exists">
> >         <location
> >
> > src="{defaults:view-themes}/{defaults:theme}{defaults:theme-ext}" />
> >       </select>
> >     </match>
> >   </locator>
> > </locationmap>
> >
> > and it worked. That made me think about my changes. I switched the order
> > how I defined in the lm. From:
> > -actions
> > -selectors
> > to:
> > -selectors
> > -actions
> >
> > But I got the old error. I think it is in the ActNode.java that I just
> > checked in.
> >
> > > That might allow us to narrow it down.  I'm going to have to read up
> > > on actions as I think they're subtley different than other sitemap
> > > components.
> > >
> >
> > It seems to me that the ActNode is overriding the .m_manager instead of
> > extending it. Another thing could be the LocationMap.
> >
> > The action is working like I described in the other thread. They send
> > back a map or null.
> >
> > If an action returns null then the inner children will be ignored (not
> > executed). If they return a Map the values of the map can be directly
> > accessed in the sitemap by {key}.
> >
> > Have a quick look into the RecursiveDirectoryTraversalAction then you
> > know how action work. You will understand directly.
> >
> > > I've admitted before but perhaps not to you -- I'm not a 'Cocooner' so
> > > it takes me some time to study up on each aspect of cocoon-related
> > > things.
> >
> > jeje, me too, but you know somethings about the lm. ;-) I reckon I made
> > some mistakes in the Actnode that you may spot right on. :)
> >
> > >  This gives me reason to go deep on Actions but I'm just
> > > warning that you may well find it before me.
> > > --tim
> >
> > :)
> >
> > Cheers again for your help. :)
> >
> > salu2
> --
> thorsten
> 
> "Together we stand, divided we fall!"
> Hey you (Pink Floyd)

I've got a little time this morning and hopefully more time this
evening but not much in between.  Can you describe the environment I
need to begin testing this?  Here's what I've done:
Created a seed-sample.
Built and "local-deployed" all three view-plugins
Enabled views on my seeded sample
Overwrote the seeded locationmap with yours
...
Now, what is it that I would actually put in a directory to test this?
 An .fv file named the same as another xml file minus extension?
Thanks,
--tim

Re: exists selector in locationmap

Posted by Thorsten Scherler <th...@apache.org>.
Before I go to sleep. 

One thing is handy if you use an IDE like Eclipse and want to debug
java:
# Any other arguments to pass to the JVM. For example, to run on an
X-less
# server, set to -Djava.awt.headless=true
forrest.jvmargs=-Xdebug
-Xrunjdwp:transport=dt_socket,address=8000,server=y,susp end=n

That starts your project in debugging mode with Port 8000. The default
debug port from e.g. Eclipse. Then you can set breakpoints to debug.
That is pretty sweet. ;-)

Good night.

salu2

On Sun, 2005-08-28 at 06:19 +0200, Thorsten Scherler wrote:
> On Sat, 2005-08-27 at 23:41 -0400, Tim Williams wrote:
> 
> > > I forgot:
> > > <locationmap xmlns="http://apache.org/forrest/locationmap/1.0">
> > >   <components>
> > >     <matchers default="lm">
> > >       <matcher name="lm"
> > > src="org.apache.forrest.locationmap.WildcardLocationMapHintMatcher"/>
> > >     </matchers>
> > >     <actions default="RecursiveDirectoryTraversalAction">
> > >       <action name="RecursiveDirectoryTraversalAction"
> > > src="org.apache.forrest.plugin.internal.view.acting.RecursiveDirectoryTraversalAction"/>
> > >     </actions>
> > >     <selectors default="exists">
> > >             <selector name="exists"
> > > src="org.apache.forrest.sourceexists.SourceExistsSelector" />
> > >           </selectors>
> > >   </components>
> > >   <locator>
> > >     <match pattern="views/**">
> > >       <select type="exists">
> > >         <!-- File-based -->
> > >         <location src="{1}{project:theme-ext}" />
> > >               <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"/>
> > >           <!-- Directory-based / Parent-directory based (recursively)
> > > -->
> > >                 <location src="{uri}" />
> > >               </act>
> > >         <!-- Theme based -->
> > >         <location
> > > src="{defaults:view-themes}/{project:theme}{project:theme-ext}" />
> > >         <!-- Application Default -->
> > >         <location
> > > src="{defaults:view-themes}/{defaults:theme}{defaults:theme-ext}" />
> > >       </select>
> > >     </match>
> > >   </locator>
> > > </locationmap>
> > 
> > Out of quick curiousity, have you taken the 'act' out of this and seen
> > if the "exists" selector will work against the "location"'s alone? 
> 
> Yes, i did this but no success. Then I reduced till:
> <locationmap xmlns="http://apache.org/forrest/locationmap/1.0">
>   <components>
>     <matchers default="lm">
>       <matcher name="lm" 
> 
> src="org.apache.forrest.locationmap.WildcardLocationMapHintMatcher"/>
>     </matchers>
>     <selectors default="exists">
> 	    <selector name="exists" 
> 	      src="org.apache.forrest.sourceexists.SourceExistsSelector" />
> 	  </selectors>
>   </components>
>   <locator>
>     <match pattern="views/**">
>       <select type="exists">
>         <location 
> 
> src="{defaults:view-themes}/{defaults:theme}{defaults:theme-ext}" />
>       </select>
>     </match>
>   </locator>
> </locationmap>
> 
> and it worked. That made me think about my changes. I switched the order
> how I defined in the lm. From:
> -actions
> -selectors
> to:
> -selectors
> -actions
> 
> But I got the old error. I think it is in the ActNode.java that I just
> checked in. 
> 
> > That might allow us to narrow it down.  I'm going to have to read up
> > on actions as I think they're subtley different than other sitemap
> > components.
> > 
> 
> It seems to me that the ActNode is overriding the .m_manager instead of
> extending it. Another thing could be the LocationMap.
> 
> The action is working like I described in the other thread. They send
> back a map or null.
> 
> If an action returns null then the inner children will be ignored (not
> executed). If they return a Map the values of the map can be directly
> accessed in the sitemap by {key}.
> 
> Have a quick look into the RecursiveDirectoryTraversalAction then you
> know how action work. You will understand directly.
> 
> > I've admitted before but perhaps not to you -- I'm not a 'Cocooner' so
> > it takes me some time to study up on each aspect of cocoon-related
> > things. 
> 
> jeje, me too, but you know somethings about the lm. ;-) I reckon I made
> some mistakes in the Actnode that you may spot right on. :) 
> 
> >  This gives me reason to go deep on Actions but I'm just
> > warning that you may well find it before me.
> > --tim
> 
> :) 
> 
> Cheers again for your help. :)
> 
> salu2
-- 
thorsten

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


Re: exists selector in locationmap

Posted by Thorsten Scherler <th...@apache.org>.
On Sun, 2005-08-28 at 11:55 -0400, Tim Williams wrote:
> Now it doesn't give an error but when I request a page, it gives me
> the pelt.fv file instead of an html page.  Any idea what I'm doing
> wrong?

jeje

Yes, that is what it does. ;-) That is only one component. The resolver,
that gives you the fallback view as xml. Now we have to further use it. 

Telling me that it does gives you a view that is all I needed to her. :)
Good news. ;)

I need to rewrite now the matches in the internal view plugin sitemap.
Watch my next committs. ;-)

salu2 and muchas gracias por todo
-- 
thorsten

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


Re: exists selector in locationmap

Posted by Tim Williams <wi...@gmail.com>.
Now it doesn't give an error but when I request a page, it gives me
the pelt.fv file instead of an html page.  Any idea what I'm doing
wrong?
--tim

On 8/28/05, Thorsten Scherler <th...@apache.org> wrote:
> It is working now. :)
> 
> I was a typical copy and paste error. :/
> 
> On Sun, 2005-08-28 at 06:19 +0200, Thorsten Scherler wrote:
> ....
> > It seems to me that the ActNode is overriding the .m_manager instead of
> > extending it. Another thing could be the LocationMap.
> >
> 
> Yes, I needed to change in LocationMap:
> m_manager.put(Action.ROLE+"Selector",actionSelector);
> 
> where I had:
> m_manager.put(Selector.ROLE+"Selector",selectorSelector);
> 
> In the ActNode as well:
> final ServiceSelector selectors = (ServiceSelector)
> super.m_manager.lookup(Selector.ROLE + "Selector");
> 
> to
> final ServiceSelector selectors = (ServiceSelector)
> super.m_manager.lookup(Action.ROLE + "Selector");
> 
> now it is working. :)
> 
> Thx for giving me input Tim, that helped a lot to find this bug.
> 
> salu2
> --
> thorsten
> 
> "Together we stand, divided we fall!"
> Hey you (Pink Floyd)
> 
>

Re: exists selector in locationmap

Posted by Thorsten Scherler <th...@apache.org>.
It is working now. :)

I was a typical copy and paste error. :/

On Sun, 2005-08-28 at 06:19 +0200, Thorsten Scherler wrote:
....
> It seems to me that the ActNode is overriding the .m_manager instead of
> extending it. Another thing could be the LocationMap.
> 

Yes, I needed to change in LocationMap:
m_manager.put(Action.ROLE+"Selector",actionSelector);

where I had:
m_manager.put(Selector.ROLE+"Selector",selectorSelector);

In the ActNode as well:
final ServiceSelector selectors = (ServiceSelector)
super.m_manager.lookup(Selector.ROLE + "Selector");

to
final ServiceSelector selectors = (ServiceSelector)
super.m_manager.lookup(Action.ROLE + "Selector");

now it is working. :)

Thx for giving me input Tim, that helped a lot to find this bug.

salu2
-- 
thorsten

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


Re: exists selector in locationmap

Posted by Thorsten Scherler <th...@apache.org>.
On Sat, 2005-08-27 at 23:41 -0400, Tim Williams wrote:

> > I forgot:
> > <locationmap xmlns="http://apache.org/forrest/locationmap/1.0">
> >   <components>
> >     <matchers default="lm">
> >       <matcher name="lm"
> > src="org.apache.forrest.locationmap.WildcardLocationMapHintMatcher"/>
> >     </matchers>
> >     <actions default="RecursiveDirectoryTraversalAction">
> >       <action name="RecursiveDirectoryTraversalAction"
> > src="org.apache.forrest.plugin.internal.view.acting.RecursiveDirectoryTraversalAction"/>
> >     </actions>
> >     <selectors default="exists">
> >             <selector name="exists"
> > src="org.apache.forrest.sourceexists.SourceExistsSelector" />
> >           </selectors>
> >   </components>
> >   <locator>
> >     <match pattern="views/**">
> >       <select type="exists">
> >         <!-- File-based -->
> >         <location src="{1}{project:theme-ext}" />
> >               <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"/>
> >           <!-- Directory-based / Parent-directory based (recursively)
> > -->
> >                 <location src="{uri}" />
> >               </act>
> >         <!-- Theme based -->
> >         <location
> > src="{defaults:view-themes}/{project:theme}{project:theme-ext}" />
> >         <!-- Application Default -->
> >         <location
> > src="{defaults:view-themes}/{defaults:theme}{defaults:theme-ext}" />
> >       </select>
> >     </match>
> >   </locator>
> > </locationmap>
> 
> Out of quick curiousity, have you taken the 'act' out of this and seen
> if the "exists" selector will work against the "location"'s alone? 

Yes, i did this but no success. Then I reduced till:
<locationmap xmlns="http://apache.org/forrest/locationmap/1.0">
  <components>
    <matchers default="lm">
      <matcher name="lm" 

src="org.apache.forrest.locationmap.WildcardLocationMapHintMatcher"/>
    </matchers>
    <selectors default="exists">
	    <selector name="exists" 
	      src="org.apache.forrest.sourceexists.SourceExistsSelector" />
	  </selectors>
  </components>
  <locator>
    <match pattern="views/**">
      <select type="exists">
        <location 

src="{defaults:view-themes}/{defaults:theme}{defaults:theme-ext}" />
      </select>
    </match>
  </locator>
</locationmap>

and it worked. That made me think about my changes. I switched the order
how I defined in the lm. From:
-actions
-selectors
to:
-selectors
-actions

But I got the old error. I think it is in the ActNode.java that I just
checked in. 

> That might allow us to narrow it down.  I'm going to have to read up
> on actions as I think they're subtley different than other sitemap
> components.
> 

It seems to me that the ActNode is overriding the .m_manager instead of
extending it. Another thing could be the LocationMap.

The action is working like I described in the other thread. They send
back a map or null.

If an action returns null then the inner children will be ignored (not
executed). If they return a Map the values of the map can be directly
accessed in the sitemap by {key}.

Have a quick look into the RecursiveDirectoryTraversalAction then you
know how action work. You will understand directly.

> I've admitted before but perhaps not to you -- I'm not a 'Cocooner' so
> it takes me some time to study up on each aspect of cocoon-related
> things. 

jeje, me too, but you know somethings about the lm. ;-) I reckon I made
some mistakes in the Actnode that you may spot right on. :) 

>  This gives me reason to go deep on Actions but I'm just
> warning that you may well find it before me.
> --tim

:) 

Cheers again for your help. :)

salu2
-- 
thorsten

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


Re: exists selector in locationmap

Posted by Tim Williams <wi...@gmail.com>.
On 8/27/05, Thorsten Scherler <th...@apache.org> wrote:
> On Sun, 2005-08-28 at 05:25 +0200, Thorsten Scherler wrote:
> > On Sat, 2005-08-27 at 23:13 -0400, Tim Williams wrote:
> > > On 8/27/05, Thorsten Scherler <th...@apache.org> wrote:
> > > > On Fri, 2005-07-15 at 09:04 -0400, Tim Williams wrote:
> > > > > Does any actually have the select exists working with locationmap?
> > > > > I'm trying based on the syntax difference that Unico described in a
> > > > > previous mail but it looks like the SourceResolver used in
> > > > > SourceExistsSelector is null when it gets there.  I'd like to be able
> > > > > to confirm whether this is a simple syntax goof on my part or
> > > > > something else.  If anyone does have it working can you post a copy of
> > >
> > > Yeah, I've got the selector working properly.  The components weren't
> > > being "serviced" after creation.  This was resolved with:
> > > http://issues.apache.org/jira/browse/FOR-576
> > >
> >
> > Then I have another problem I guess.
> >
> 
> Hmm, I have read it again and actually it sound actually like the same
> problem. Weired.
> 
> > > If you post your locationmap maybe I could help out.  I tried it
> > > multiple ways as I recall and can hopefully help get this working for
> > > you...
> >
> > Cheers, that is awesome.
> >
> 
> I forgot:
> <locationmap xmlns="http://apache.org/forrest/locationmap/1.0">
>   <components>
>     <matchers default="lm">
>       <matcher name="lm"
> src="org.apache.forrest.locationmap.WildcardLocationMapHintMatcher"/>
>     </matchers>
>     <actions default="RecursiveDirectoryTraversalAction">
>       <action name="RecursiveDirectoryTraversalAction"
> src="org.apache.forrest.plugin.internal.view.acting.RecursiveDirectoryTraversalAction"/>
>     </actions>
>     <selectors default="exists">
>             <selector name="exists"
> src="org.apache.forrest.sourceexists.SourceExistsSelector" />
>           </selectors>
>   </components>
>   <locator>
>     <match pattern="views/**">
>       <select type="exists">
>         <!-- File-based -->
>         <location src="{1}{project:theme-ext}" />
>               <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"/>
>           <!-- Directory-based / Parent-directory based (recursively)
> -->
>                 <location src="{uri}" />
>               </act>
>         <!-- Theme based -->
>         <location
> src="{defaults:view-themes}/{project:theme}{project:theme-ext}" />
>         <!-- Application Default -->
>         <location
> src="{defaults:view-themes}/{defaults:theme}{defaults:theme-ext}" />
>       </select>
>     </match>
>   </locator>
> </locationmap>

Out of quick curiousity, have you taken the 'act' out of this and seen
if the "exists" selector will work against the "location"'s alone? 
That might allow us to narrow it down.  I'm going to have to read up
on actions as I think they're subtley different than other sitemap
components.

I've admitted before but perhaps not to you -- I'm not a 'Cocooner' so
it takes me some time to study up on each aspect of cocoon-related
things.  This gives me reason to go deep on Actions but I'm just
warning that you may well find it before me.
--tim

Re: exists selector in locationmap

Posted by Thorsten Scherler <th...@apache.org>.
On Sun, 2005-08-28 at 05:25 +0200, Thorsten Scherler wrote:
> On Sat, 2005-08-27 at 23:13 -0400, Tim Williams wrote:
> > On 8/27/05, Thorsten Scherler <th...@apache.org> wrote:
> > > On Fri, 2005-07-15 at 09:04 -0400, Tim Williams wrote:
> > > > Does any actually have the select exists working with locationmap?
> > > > I'm trying based on the syntax difference that Unico described in a
> > > > previous mail but it looks like the SourceResolver used in
> > > > SourceExistsSelector is null when it gets there.  I'd like to be able
> > > > to confirm whether this is a simple syntax goof on my part or
> > > > something else.  If anyone does have it working can you post a copy of
> > 
> > Yeah, I've got the selector working properly.  The components weren't
> > being "serviced" after creation.  This was resolved with:
> > http://issues.apache.org/jira/browse/FOR-576
> > 
> 
> Then I have another problem I guess.
> 

Hmm, I have read it again and actually it sound actually like the same
problem. Weired.

> > If you post your locationmap maybe I could help out.  I tried it
> > multiple ways as I recall and can hopefully help get this working for
> > you...
> 
> Cheers, that is awesome.
> 

I forgot:
<locationmap xmlns="http://apache.org/forrest/locationmap/1.0">
  <components>
    <matchers default="lm">
      <matcher name="lm"
src="org.apache.forrest.locationmap.WildcardLocationMapHintMatcher"/>
    </matchers>
    <actions default="RecursiveDirectoryTraversalAction">
      <action name="RecursiveDirectoryTraversalAction"
src="org.apache.forrest.plugin.internal.view.acting.RecursiveDirectoryTraversalAction"/>
    </actions>
    <selectors default="exists">
	    <selector name="exists"
src="org.apache.forrest.sourceexists.SourceExistsSelector" />
	  </selectors>
  </components>
  <locator>
    <match pattern="views/**">
      <select type="exists">
        <!-- File-based -->
        <location src="{1}{project:theme-ext}" />
	      <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"/>
          <!-- Directory-based / Parent-directory based (recursively)
-->
	        <location src="{uri}" />
	      </act>
        <!-- Theme based -->
        <location
src="{defaults:view-themes}/{project:theme}{project:theme-ext}" />
        <!-- Application Default -->
        <location
src="{defaults:view-themes}/{defaults:theme}{defaults:theme-ext}" />
      </select>
    </match>
  </locator>
</locationmap>

Cheers :)

salu2
-- 
thorsten

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


Re: exists selector in locationmap

Posted by Thorsten Scherler <th...@apache.org>.
On Sat, 2005-08-27 at 23:13 -0400, Tim Williams wrote:
> On 8/27/05, Thorsten Scherler <th...@apache.org> wrote:
> > On Fri, 2005-07-15 at 09:04 -0400, Tim Williams wrote:
> > > Does any actually have the select exists working with locationmap?
> > > I'm trying based on the syntax difference that Unico described in a
> > > previous mail but it looks like the SourceResolver used in
> > > SourceExistsSelector is null when it gets there.  I'd like to be able
> > > to confirm whether this is a simple syntax goof on my part or
> > > something else.  If anyone does have it working can you post a copy of
> 
> Yeah, I've got the selector working properly.  The components weren't
> being "serviced" after creation.  This was resolved with:
> http://issues.apache.org/jira/browse/FOR-576
> 

Then I have another problem I guess.

> If you post your locationmap maybe I could help out.  I tried it
> multiple ways as I recall and can hopefully help get this working for
> you...

Cheers, that is awesome.


> --tim
-- 
thorsten

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


Re: exists selector in locationmap

Posted by Tim Williams <wi...@gmail.com>.
On 8/27/05, Thorsten Scherler <th...@apache.org> wrote:
> On Fri, 2005-07-15 at 09:04 -0400, Tim Williams wrote:
> > Does any actually have the select exists working with locationmap?
> > I'm trying based on the syntax difference that Unico described in a
> > previous mail but it looks like the SourceResolver used in
> > SourceExistsSelector is null when it gets there.  I'd like to be able
> > to confirm whether this is a simple syntax goof on my part or
> > something else.  If anyone does have it working can you post a copy of

Yeah, I've got the selector working properly.  The components weren't
being "serviced" after creation.  This was resolved with:
http://issues.apache.org/jira/browse/FOR-576

If you post your locationmap maybe I could help out.  I tried it
multiple ways as I recall and can hopefully help get this working for
you...
--tim