On Fri, 2005-08-26 at 08:41 -0400, Tim Williams wrote:
> > > Here's what I think I understand of the problem. His fallbacks work
> > > like this in order:
> > >
> > > 1. File-based
> > > 2. Directory-based
> > > 3. Parent-directory based (recursively)
> > > 4. Theme based
> > > 5. Application Default
> > >
> >
> > Yes, that is right. I will add a doctype specific fallback as well the
> > next days which I am right now developing.
> >
That is blocked by the select issue with the locationmap right now.
> > > Ok, maybe not exactly, but it gives the general idea. Anyway,
> > > locationmaps can solve all of those except, I think, #3. We have no
> > > ability to do a "..\" up the directory tree until we find it. We can't
> > > dissect the "matcher" result enough to do it either if that makes any
> > > sense. I think either way we're probably going to need some java code
> > > to do this stuff.
> >
> > exactly!!! Thanks for writing this down so spot on, Tim. :)
> >
> > > One might argue that it should be a new selector I
> > > suppose -- in which case, I'd say that it should only handle the
> > > generic directory traversing part and not forrest-specific defaults.
> > > In other words, implement the recursive directory traversal with a new
> > > selector and use the built-in capability of the lm to do the rest --
> > > that'd give us a more generic directory traversing selector.
> >
I wrote an action for that and enabled actions in the lm. I have
problems right now to make the select work but here is the lm snippet
which will replace the fallback resolver.
<match pattern="views/**">
<select type="exists">
<!-- File-based -->
<location src="{1}{project:theme-ext}" />
<act type="sourcetype" src="{1}.xml">
<!-- Sourcetype-based -->
<location
src="{project:theme-sourcetypeDir}{sourcetype}{project:theme-ext}" />
</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: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}" />
</select>
<!-- Application Default -->
<location
src="{defaults:view-themes}/{defaults:theme}{defaults:theme-ext}" />
</match>
Thanks to you and Ross for pointing out and finding this solution and
especially for clarifying the problematic. :)
As soon as the select in lm is working I can apply it.
salu2
--
thorsten
"Together we stand, divided we fall!"
Hey you (Pink Floyd)