On Nov 21, 2007 11:03 AM, David Nuescheler <[EMAIL PROTECTED]> wrote:

> > We could have a "magic" repository location for scripts that would be
> > > automatically bound to repository events...

> How about making it a magic-subdirectory of the ResourceType location.
>
> Something like a myresourcetype/.events/add_node.esp

Sounds good, but could we use "jcr.events" instead of ".events"?
An initial dot can be easy to miss, and in unixish filesystems it
means "hidden file"

Also, how would you hook scripted events to a node type?

With the current conventions that would be
/sling/events/nt/file/add_node.js, but with your suggestion below
(that I like), how would you define the nodetype to which the event
listener applies?

> ...In our experience it turned out to be helpful to put things
> in the "same location" that you would like to move or install
> from one repository to another....

Ok, that makes sense. Also resonates with someone recently asking for
multiple applications hosted in the same repository, having to put all
scripts under /sling is not optimal.

> ...So my goal would be that if I develop a microsling app
> every thing that i need in my app could be organized as follows:
>
> /apps/myapp
> /apps/myapp/docroot/my.gif
> /apps/myapp/docroot/my.css
> /apps/myapp/components/homepage/html.esp
> /apps/myapp/components/homepage/edit/html.esp
> /apps/myapp/components/homepage/.events/modify.js
> /apps/myapp/components/homepage/.events/all.js
> /apps/myapp/components/contentpage/html.esp
> /apps/myapp/components/contentpage/edit/html.esp

So the resource types would be like
"/apps/myapp/components/contentpage", is that what you mean?

I like the idea, and we can consider the /apps/myapp prefix as being
the "namespace" of this application.

But that also raises the question of nodetype-based mappings...if you
want to map all nt:file nodes to a specific scripts, currently the
script is found at /sling/scripts/nt/file (assuming those nodes do not
have a "slingResourceType" property). Which path would you use for
script lookups in that case?

-Bertrand

Reply via email to