hi guys,

> We could have a "magic" repository location for scripts that would be
> > automatically bound to repository events, based on the touched node's
> > resource type.
> > For example, a script named
> >   /sling/events/nt/file/event.js
> > would be called for any events on nt:file nodes, or
> >   /sling/events/myblog/comment/node_added.js
> > would be called when a node is added with slingResourceType=myblog/comment
> > How does that sound? I think that would be a cool way of exposing the
> > rich JCR events functionality, and it is fairly easy to implement.
sounds good to me.

How about making it a magic-subdirectory of the ResourceType location.

Something like a myresourcetype/.events/add_node.esp

This somehow brings up a related topic.
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.
This is opposed to splitting things up "by type" (events, scripts, ...).

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


in my example my resourcetypes "homepage" and "contentpage" live in
the "components" folder.

this would allow me to package up my entire "myapp" or just bits and
pieces of it with a simple
content package or export, would inidicate that it is good practice to
sort of "namespace" your
app.

Thoughts?

regards,
david

Reply via email to