On 1/24/06, Andreas Hartmann <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
> > On 1/24/06, Andreas Hartmann <[EMAIL PROTECTED]> wrote:
> >> <map:match pattern="modules/*/**">
> >>    <map:select type="resource-exists">
> >>      <!-- resource exists - serve statically -->
> >>      <map:when test="lenya/modules/{1}/resources/{2}">
> >>        <map:mount src="module-resources.xmap"/>
> >>      </map:when>
> >>      <!-- resource doesn't exist - delegate to module -->
> >>      <map:otherwise>
> >>        <map:mount src="modules/{1}/sitemap.xmap"/>
> >>      </map:otherwise>
> >>    </map:select>
> >> </map:match>
> >
> > I thought that was the purpose of fallback.  Any resource (or any
> > other type of file) uses the local (Module-specific) resource if it
> > exists, otherwise Lenya automatically searches the parent modules,
> > then global resources until it finds it.
>
> No, the snippet above just simplifies serving static resources.

Tell me if I understand.  Using a silly example:
Company logo is usually a statis resource.  A "logo" Module can decide
which graphic to serve based on the company name:
/mypub/logo/companyName
(or /mypub/live/assets/logo.gif?lenya.module=logo&name=companyName)

The code should check the module to see if it this is decided
dynamically, but defaults to the static resource if nothing is
returned?

> If the resource doesn't exist on the file system, it is assumed
> that the module generates it dynamically.

I would expect the module to be checked first, because it could
dynamically override the static resource.  The module should also
handle the fallback to the static resource, so handling it in the core
should be useless.  Am I understanding correctly?

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to