Hi Alessandro, Unfortunately, no. BindingsValuesProvider are executed much too late for this. Whatever you do has to be done *before* the script/servlet is resolved.
Justin On Thu, Oct 31, 2013 at 12:56 PM, Alessandro Bologna <[email protected]> wrote: > Justin, > thank you, I may very well go with your approach, which I guess would mean > to override the getResourceType and getResourceSuperType in a > MyAppResourceWrapper based on the current request (to which I have no > access to in the my ResourceDecorator, when using the single > decorate(Resource) method). > Instead of using a ThreadLocal, could I implement a BindingsValuesProvider > and get the request object from the bindings and inject them in the wrapped > resource? Any major problem doing so? > > > Thanks a lot to all. > Alessandro > > > > On Thu, Oct 31, 2013 at 12:05 PM, Justin Edelson > <[email protected]>wrote: > >> Hi Alessandro, >> What you could also do is to have a ResourceDecorator which changes up >> the resource type. HOWEVER, you might be templted to use the >> two-argument method. This doesn't actually work (and now documented as >> such). So you'd need to combine this with some ThreadLocal-based >> filter to store the current request. >> >> HTH, >> Justin >> >> On Thu, Oct 31, 2013 at 11:53 AM, Alessandro Bologna >> <[email protected]> wrote: >> > Thanks Paul and Bertrand, >> > So, if I have two development teams working on two different presentation >> > apps that I want to keep completely separate I would need to partition >> all >> > the selectors space to that for instance >> > >> > /content/shared.team1.html uses /apps/myapp/team1/html.jsp >> > /content/shared.team1.header.html uses /apps/myapp/team1/header/html.jsp >> > and similarly for team2 etc >> > >> > How about the config folder, for logging, rewriters etc, wouldn't that >> have >> > to be necessarily shared between the two teams? >> > >> > Thanks again, >> > Alessandro >> > >> > >> > >> > >> > On Thu, Oct 31, 2013 at 11:15 AM, Bertrand Delacretaz < >> > [email protected]> wrote: >> > >> >> On Thu, Oct 31, 2013 at 4:07 PM, Paul McMahon <[email protected]> wrote: >> >> > ...You'd probably want to perhaps using a selector instead of a header >> >> value (or using a >> >> > rewrite rule to turn the header value into a selector) and then use >> >> selector specific scripts >> >> > to meet your requirements... >> >> >> >> I was going to suggest just that, and instead of an external rewrite >> >> rule you could also use a Sling Filter. >> >> >> >> -Bertrand >> >> >>
