Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
follow-up from discussion in SLING-5356
B) reusing resourcebuilder instances
example 2:
resourceBuilder = getService(ResourceBuilder.class).forResolver(resourceResolver); resourceBuilder.resource("content/page1"); resourceBuilder.resource("content/page2");
this produces not the expected result - it produces
/content/page1
/content/page1/content/page2
instead of
/content/page1
/content/page2
it would be useful if the resourcebuilder returned by a resource method has a new parent set, but not the builder instance initially applyed the resource method on.
currently the only way to get the expected result is something like:
example 3:
resourceBuilder = getService(ResourceBuilder.class).forResolver(resourceResolver); resourceBuilder.resource("content/page1") .atParent() resource("content/page2");
but if creating bigger content structures it makes sense to not use one gigantic fluent line, but split if up in smaller parts.
Attachments
Issue Links
- relates to
-
SLING-5356 New ResourceBuilder module - fluent API to create content structures
- Closed