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

Konrad Windszus edited comment on SLING-11773 at 2/13/23 2:54 PM:
------------------------------------------------------------------

I was assuming the {{@Designate}} annotation clearly connects them metatype 
with the DS component 
([https://github.com/apache/sling-org-apache-sling-resourcemerger/blob/186043d052c4a25553cde99d3b55e630bc6bc062/src/main/java/org/apache/sling/resourcemerger/impl/picker/ResourceTypeHierarchyBasedResourcePicker.java#L39).]
 But you are right, according to 
[https://docs.osgi.org/specification/osgi.cmpn/8.0.0/service.component.html#service.component-ordering.generated.properties:]

Only
{quote}Properties defined through component property types used as the type of 
an activation object.
{quote}
or
{quote}Properties defined through component property types annotating the 
component implementation class.
{quote}
end up as component properties.


was (Author: kwin):
I was assuming the {{@Designate}} annotation clearly connects them metatype 
with the DS component 
([https://github.com/apache/sling-org-apache-sling-resourcemerger/blob/186043d052c4a25553cde99d3b55e630bc6bc062/src/main/java/org/apache/sling/resourcemerger/impl/picker/ResourceTypeHierarchyBasedResourcePicker.java#L39).]
 But you are right, according to 
[https://docs.osgi.org/specification/osgi.cmpn/8.0.0/service.component.html#service.component-ordering.generated.properties:]

Only
{quote}Properties defined through component property types used as the type of 
an activation object.
{quote}
or
{quote}Properties defined through component property types annotating the 
component implementation class.
{quote}
end up as component properties.

I would prefer the latter in this case instead of introducing the empty 
activate method.

> ResourceTypeHierarchyBasedResourcePicker not working anymore
> ------------------------------------------------------------
>
>                 Key: SLING-11773
>                 URL: https://issues.apache.org/jira/browse/SLING-11773
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Resource Merger 1.4.0
>            Reporter: Sagar Miglani
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> In SLING-10168, SCR annotations were replaced by OSGi and configurations of 
> {{ResourceTypeHierarchyBasedResourcePicker}} have been designated to an inner 
> Configuration class, which are not getting bind properly without 
> {{@Activate}} Method.
> And hence {{ResourceTypeHierarchyBasedResourcePicker}} does not seem to be 
> registered by
> {{MergedResourcePickerWhiteboard}} [0].
> Compared generated XMLs:
> *With {{Activate}} Method injection:*
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.3.0"; 
> name="org.apache.sling.resourcemerger.picker.overriding" 
> configuration-policy="require" activate="activate">
>   <property name="merge.root" type="String" value="/mnt/override"/>
>   <property name="merge.readOnly" type="Boolean" value="true"/>
>   <property name="merge.traverseParent" type="Boolean" value="true"/>
>   <service>
>     <provide 
> interface="org.apache.sling.resourcemerger.spi.MergedResourcePicker2"/>
>   </service>
>   <implementation 
> class="org.apache.sling.resourcemerger.impl.picker.ResourceTypeHierarchyBasedResourcePicker"/>
> </scr:component>
> {code}
> *Without {{@Activate}} method injection:*
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.3.0"; 
> name="org.apache.sling.resourcemerger.picker.overriding" 
> configuration-policy="require">
>   <property name="merge.traverseParent" type="Boolean" value="true"/>
>   <service>
>     <provide 
> interface="org.apache.sling.resourcemerger.spi.MergedResourcePicker2"/>
>   </service>
>   <implementation 
> class="org.apache.sling.resourcemerger.impl.picker.ResourceTypeHierarchyBasedResourcePicker"/>
> </scr:component>
> {code}
> [0]: 
> https://github.com/apache/sling-org-apache-sling-resourcemerger/blob/master/src/main/java/org/apache/sling/resourcemerger/impl/MergedResourcePickerWhiteboard.java#L87



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

Reply via email to