You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:58:51 UTC

[sling-org-apache-sling-resourcemerger] 11/24: SLING-2986 : Use sling:resourceType property to define the resource type

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.resourcemerger-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-resourcemerger.git

commit 7abf60c26d70f26e9936b46a99b26c81400a56fe
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Jan 30 07:55:05 2014 +0000

    SLING-2986 : Use sling:resourceType property to define the resource type
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/resourcemerger@1562709 13f79535-47bb-0310-9956-ffa450edef68
---
 .../java/org/apache/sling/resourcemerger/impl/MergedResource.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/resourcemerger/impl/MergedResource.java b/src/main/java/org/apache/sling/resourcemerger/impl/MergedResource.java
index 7ecf71a..4fc8d7a 100644
--- a/src/main/java/org/apache/sling/resourcemerger/impl/MergedResource.java
+++ b/src/main/java/org/apache/sling/resourcemerger/impl/MergedResource.java
@@ -39,6 +39,8 @@ public class MergedResource extends AbstractResource {
 
     private final ResourceMetadata metadata = new ResourceMetadata();
 
+    private final String resourceType;
+
     /** Cache value map. */
     private ValueMap properties;
 
@@ -73,6 +75,7 @@ public class MergedResource extends AbstractResource {
         if ( mappedResources != null ) {
             this.mappedResources.addAll(mappedResources);
         }
+        this.resourceType = this.adaptTo(ValueMap.class).get(ResourceResolver.PROPERTY_RESOURCE_TYPE, this.relativePath);
         metadata.put("sling.mergedResource", true);
         metadata.put("sling.mappedResources", mappedResources.toArray(new String[mappedResources.size()]));
     }
@@ -112,7 +115,7 @@ public class MergedResource extends AbstractResource {
      * {@inheritDoc}
      */
     public String getResourceType() {
-        return this.relativePath;
+        return this.resourceType;
     }
 
     /**

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.