Hi,
Bertrand Delacretaz schrieb:
> Hi,
>
> On Sat, Nov 22, 2008 at 1:11 AM, Roy T. Fielding <[EMAIL PROTECTED]> wrote:
>> ...I think that Sling should use a content tree to establish the
>> root mappings; e.g.,
>>
>> /etc/map/{scheme}/{host.port}/{uri_path}...
>
> Agreed, much better to have this info in one place.
>
> Some comments below on the /etc/map details.
>
>> /etc/map/http/example.com.80/
>> +-- sling:redirect = "http://www.example.com/"
>
> I like "redirect" as the property name, better than "target" suggested
> by someone in this thread, which is less precise.
>
>> www.example.com.80/
>> +-- sling:alias = "/example/"
>
> I think we need variables here, for multi-host setups - and I'd call
> the property a "content prefix" as it is really what it's doing:
> prepend a path to the one supplied by the URL to find content.
In fact both strings (internal or external) are replacement prefixes to
the actual URL. Thus:
www.example.com.80/nested
+-- sling:alias = "/deep/nesting/"
www.example.com.80/
+-- sling:alias = "/example/"
would convert:
/nested/path.html ==> /deep/nesting/path.html
/another/path.html ==> /example/another/path.html
Therefore, we might name them similarly -- just indicating whether the
"prefix" is an internal or external redirect.
We could also go with sling:redirect and sling:internalRedirect instead
of sling:target and sling:internalTarget or even sling:redirectPrefix
and sling:internalRedirectPrefix (though I consider this too much ;-) ).
>
> Vidar also suggested (IIRC) falling back to a different path if the
> resource is not found, for common css style sheets for example, so my
> proposal here is:
>
> /etc/map/http/www.*.com.80/
> +-- sling:contentPrefix = "/content/sites/{1}/
> +-- sling:fallbackContent = "/content/default/
IIRC Vidar's suggestion was about shared content, which could be solved
like this:
/etc/map/http/www.*.com.80/shared/
+-- sling:contentPrefix = "/content/shared/
/etc/map/http/www.*.com.80/
+-- sling:contentPrefix = "/content/sites/{1}/
>
> Where {1} maps to the first wildcard defined by the parent node.
Better yet, we might do regular expression matching and referencing:
/etc/map/http/www.(.)*.com.80/
+-- sling:contentPrefix = "/content/sites/$1/
Question, though, is how to get these strings into the repository: We
would probably need some encoding because interesting regexp characters
like [, ], * and | are not valid characters for JCR item names.
Regards
Felix
>
> and that would also require variables in redirects, so:
>
> /etc/map/http/*.com.80/
> +-- sling:redirect = "http://www.{1}.com"
>
> Or, to force https:
>
> /etc/map/http/*.com.80/
> +-- sling:redirect = "https://www.{1}.com"
>
>
> -Bertrand
>