[
https://issues.apache.org/jira/browse/SLING-4327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14282027#comment-14282027
]
Kamil Ciecierski commented on SLING-4327:
-----------------------------------------
[~asanso],[~jsedding] and [~cziegeler] thank you for your interest in this
topic. I will try to clarify the use case by the example.
Suppose we have two instances running in different run modes, i.e. author and
publish. Both of them have mapping configurations for author and publish
installed. Every instance has mapping root path configured to the proper
configuration - {{etc/maps/author}} and {{/etc/maps/publish}}.
Now let us assume that we need to implement OSGI service responsible for
sending emails on the author instance with links to the corresponding resources
on the publish instance. We are not able to change programatically
configuration of {{JcrResourceResolverFactoryImpl}} to make it use proper
mapping root path, publish in this case.
This is the first example coming to my mind, another one may be related to
multiple domains use case, when we need to provide paths for the resources of
each of them. The general idea is to make it possible to create
{{ResourceResolver}} reflecting behaviour from another instance and/or with
another mapping.
[~cziegeler] I was also thinking about passing this data through
{{authenticationInfo}} map, but as you wrote, it would be misleading. Generally
I considered three options of achieving this goal:
* Implement {{ResourceResolverFactoryActivator}} as {{configurationFactory}}
and setting proper {{rootPath}} in OSGI, but because of the scope of this
change it is practically not possible to be done
* add the argument with rootPath to the {{ResourceResolver.map()}} method,
drawback of this solution is requirement to give this argument every time of
method usage
* the solution described in this ticket which is actually PoC so far and I am
opened for another suggestions
Hope I clarified this idea to you and I look forward to your feedback.
Best regards,
Kamil Ciecierski
> ResourceResolver aware of any mappings
> --------------------------------------
>
> Key: SLING-4327
> URL: https://issues.apache.org/jira/browse/SLING-4327
> Project: Sling
> Issue Type: Wish
> Components: API
> Reporter: Kamil Ciecierski
>
> Provide ability to create a ResourceResolver which is aware of any mappings,
> for example by providing proper argument mappingPath. In case of AEM it would
> be possible to use publish instance mapping present under etc/publish.map to
> on author instance.
> To achieve that the CommonResourceResolverFactoryImpl could be implementing
> methods getResourceResolver() and getAdministrativeResourceResolver() with
> additional argument defining the mapping location. The advantage of this
> solution is that the created ResourceResolver can be used many times with the
> same mappings. The drawback is that the mappings configuration will be found
> and cached when they resourceresolver will be used for the first time - there
> is no possibility to define the list of working mappings before.
> The proposal of API extension:
> {code}
> ResourceResolver getResourceResolver(Map<String, Object> authenticationInfo,
> String customRootMap) throws LoginException;
>
> ResourceResolver getAdministrativeResourceResolver(Map<String, Object>
> authenticationInfo, String customRootMap) throws LoginException;
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)