[
https://issues.apache.org/jira/browse/SLING-5?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Felix Meschberger closed SLING-5.
---------------------------------
Resolution: Won't Fix
Issue pertains to former Component API and has no correspondence with the new
Sling API. Closing.
In fact the requirement has been sort-of implement by the
RequestDispatcherOptions of the Sling API.
> More flexible Component selection mechanism
> -------------------------------------------
>
> Key: SLING-5
> URL: https://issues.apache.org/jira/browse/SLING-5
> Project: Sling
> Issue Type: Improvement
> Components: Core
> Reporter: Bertrand Delacretaz
>
> In many cases, the rendering of a Content object depends on the "context" of
> the rendering, for example:
> -Printable version
> -Customized rendering for a specific client (mobile terminal, broken browser,
> etc)
> -Contextual navigation: render a Content node using a query to find its
> neighboring nodes
> From the taglib user's point of view, this could be done like:
> <sling:include content="some/path" selectors="navigation" />
> or
> <sling:include content="some/path" selectors="navigation.print" />
> where the selectors influence the choice of a suitable Component (the
> sling:include tag already exists, only the selectors attribute is new).
> Allowing additional OSGi plugins to participate in the Component selection
> would enable this, and enable custom Component selection mechanisms.
> A workaround is to use a wrapper class to force the rendering of a Content
> with a specific Component, but there must be a better way:
> class ContentWrapper implements Content {
> private final Content content;
> private final String componentId;
>
> ContentWrapper(Content c,String componentId) {
> this.content = c;
> this.componentId = componentId;
> }
>
> public String getComponentId() {
> return componentId;
> }
> public String getPath() {
> return content.getPath();
> }
>
> Content getWrappedContent() {
> return content;
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.