Bertrand Delacretaz wrote:
Hi,
Currently, working with selectors requires you to put scripts in
subfolders, for example
/apps/foo/html.esp
/apps/foo/someselector/html.esp
and worse, all GET scripts which produce html are named html.esp,
which can be confusing when editing them.
I totally agree.
We talked about this with David and Felix, here's a proposal for
simplifying those names in the "happy case", while keeping the current
conventions to resolve potential name conflicts where needed. Comments
welcome.
= Proposal =
The following variants should be accepted for script names, examples:
a) sling:resourceType=foo, request = bar.html
Sling searches for the following scripts and uses the first one found:
/apps/foo/html.esp
/apps/foo/foo.esp
The only change is that the script used for html rendering can
optionally be named foo.esp, to avoid having many scripts called
"html.esp" which is not practical when opening many of them in an
editor or IDE.
a) sling:resourceType=foo, request = bar.selector.html
The following scripts can be used to process this request, the first
one found being used:
/apps/foo/selector/html.esp
/apps/foo/selector.html.esp (same but with dots instead a subfolder)
/apps/foo/selector.esp
/apps/foo/html.esp (not specific to the selector)
/apps/foo/foo.esp (not specific either)
In the "happy case" people would then just have those two scripts to
handle the above cases:
/apps/foo/foo.esp
/apps/foo/selector.esp
Hmm, isn't there a better way? This solves the problem only partially -
I ran
into the same trouble if I want to support a different format like pdf;
still all my scripts would be named "pdf.esp".
Without further thinking if this creates other problems, would about
using a simple rule like "replacing the last slash with a dot"?
So instead of looking it /apps/foo/html.esp Sling would look at
/apps/foo.html.esp.
With selectors this becomes /apps/foo.selector.html.esp".
Carsten
--
Carsten Ziegeler
[EMAIL PROTECTED]