[ 
https://issues.apache.org/jira/browse/SLING-13374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18122037#comment-18122037
 ] 

Konrad Windszus commented on SLING-13374:
-----------------------------------------

What about extracting a new public OSGi service {{ConfigurationConverter}} from 
the existing {{ConfigurationBuilderImpl}} which may be SlingAdapter as well 
from a given resource. This should also have method {{public @NotNull <T> T 
as(@NotNull final Class<T> clazz)}}.

[~sseifert] WDYT?
 

> Context-Aware Configuration: Allow conversion of (low-level) configuration 
> resource to (high-level) configuration object
> ------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-13374
>                 URL: https://issues.apache.org/jira/browse/SLING-13374
>             Project: Sling
>          Issue Type: Improvement
>          Components: Extensions
>            Reporter: Konrad Windszus
>            Priority: Major
>
> Currently high level configuration objects can only be retrieved from the 
> context (i.e. content resources). Some edge cases require deriving it 
> directly from a given configuration resource.
> Currently the whole converter logic is private part of 
> [https://github.com/apache/sling-org-apache-sling-caconfig-impl/blob/master/src/main/java/org/apache/sling/caconfig/impl/ConfigurationBuilderImpl.java]
>  and this always assumes the content resource is passed. 
> My use case is 
> [https://github.com/Adobe-Consulting-Services/acs-aem-commons/blob/214fa0c495b8e60fcfd47537ee4c384adfa77ac6/bundle/src/main/java/com/adobe/acs/commons/redirects/models/Redirects.java#L78]
>  where configuration values should be retrieved based on a given 
> configuration resource.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to