[ https://issues.apache.org/jira/browse/SLING-12781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17950996#comment-17950996 ]
Konrad Windszus commented on SLING-12781: ----------------------------------------- Problem is that the [AbstractResource|https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/AbstractResource.java] implements the {{getValueMap}} but currently does neither implement {{getResourceType}} nor {{getResourceSuperType}}. If management of types should be built into {{AbstractResource}} it must either 1. Manage all properties (probably cannot be achieved in a non-backwards compatible way) or 2. Separates somehow the primary properties (type and super type) from the other ones, however the {{MergingValueMap}} is currently always immutable. Should there be another implementation of ValueMap which separates those primary types from the others? WDYT [~cziegeler]? > Expose resource type and resource type always also via getValueMap() > -------------------------------------------------------------------- > > Key: SLING-12781 > URL: https://issues.apache.org/jira/browse/SLING-12781 > Project: Sling > Issue Type: Bug > Components: API > Reporter: Konrad Windszus > Priority: Major > > As discussed in > https://lists.apache.org/thread/qfj6m7tkvkyz1zvx0fc93385yp1ho04j the resource > type and the optional super type should always be exposed as regular > properties {{sling:resourceType}} and {{sling:resourceSuperType}} via the > resource's valuemap. > Also setting those properties via > [ModifiableResourceType|https://sling.apache.org/apidocs/sling13/org/apache/sling/api/resource/ModifiableValueMap.html] > should modify the return value of {{Resource.getResourceType()}} an > {{Resource.getResourceSuperType()}}. > This allows to also set the type/super type in the > {{ResourceResolver.create(...)}} method via the properties arguments (no > matter which resource provider is serving the new resource) -- This message was sent by Atlassian Jira (v8.20.10#820010)