Re: Reading Selectors Inside of adaptTo

2011-09-19 Thread Dan Check
Thanks Justin -- Adapting the resource itself was the best solution. We're resolving resources to concrete types that implement well-known interfaces that allow us some polymorphism and abstraction from the properties as they exist directly in the repo. Best, Dan On Sep 8, 2011, at 10:12 P

Re: Reading Selectors Inside of adaptTo

2011-09-09 Thread sam ”
What's wrong with: <% final Resource res = YourUtil.getPageResourceFrom(slingRequest);//resource might be sufficient for you from final Metadata metadata = YourUtil.getMetadataOf(slingRequest.getRequestPathInfo().getSelectors(), res); %> I am not sure why you are trying to implement your own Adap

Re: Reading Selectors Inside of adaptTo

2011-09-08 Thread Justin Edelson
Yeah, you're best bet in this case is to treat the request as the adaptable. If this was a real edge case and adapting the request was going to mess up your code too much, you could also stick the request in a ThreadLocal (I'd put that in a separate filter). But I think this has the tendency to ma

Reading Selectors Inside of adaptTo

2011-09-08 Thread Dan Check
Hi all, I have a situation where I¹d like to vary the object returned by an resource.adaptTo call based on selectors in the request. Is it possible to get access to the selectors inside of an adaptTo call? If not, should I be treating the request object as adaptable, rather than the resource? T