forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <thors...@apache.org>
Subject Re: exists selector in locationmap
Date Sun, 28 Aug 2005 14:24:06 GMT
On Sun, 2005-08-28 at 09:36 -0400, Tim Williams wrote:
> On 8/28/05, Thorsten Scherler <thorsten@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)


Mime
View raw message