Carsten Ziegeler wrote:
Hi,

Markus Pallo wrote:
Hi,

i am posting this message again, because first posting was included in
another thread and not a new one .... And i am still waiting for answer :-)


As described we are using sling with an object mapper.

------------------------------------------------
wall (sling:resourceType = "wall")
|
|--> brickgroup1 (sling:resourceType = "brickgroup")
|         |
|         |--> brick11 (sling:resourceType = "statichtmlbrick")
|         |--> brick12 (sling:resourceType = "contentbrick")
|         |--> brick13 (sling:resourceType = "contentbrick")
|
|--> brickgroup2 (sling:resourceType = "brickgroup")
        |
        |--> brick21 (sling:resourceType = "contentbrick")
        |--> brick22 (sling:resourceType = "contentbrick")
        |--> brick23 (sling:resourceType = "statichtmlbrick")
------------------------------------------------

If we include other scripts to a script, we always use
----
sling.include(brickgroup.getPath());
----

inside the script, we adapt resource to our class with an AdapterFactory.


This means, the node has always to be retrieved and mapped again by the
OR mapper.
So, if I understand you correctly, you request the wall resource and
inside the script for the wall resource you already have the brickgroup
object.
Then you do an include with the path of the brickgroup object which
finally invokes a script for the brickgroup. But this script only gets
the Resource object which you have to adapt to Brickgroup again.
And you want to avoid the second adaption as this already happend in the
wall script? (or has been part of some action in that script)

I'm not 100% sure, but maybe the
SlingHttpServletRequest#getRequestDispatch(Resource,
RequestDispatcherOptions) does already what you need?


yes it does already what i need, i am using for now

scriptHelper.getRequest().getRequestDispatcher(new PojoSyntheticResource(cmsSlingRequest.getResource().getResourceResolver(),brickgroup), new RequestDispatcherOptions("brick")).include(request, response) ;


It could be more short by using a helper method in scriptHelper ..... that was the idea.... What do you think ? Probably we are the only in the world using pojos in sling, so you prefer not to have it ? :-)




Thanks for your reply



Markus



Reply via email to