From bd90e8aff4359d7ac54312b99155dc286ae06346 Mon Sep 17 00:00:00 2001 From: Shubhanshu Singh Date: Mon, 13 Dec 2021 21:46:52 +0530 Subject: [PATCH] Updated dmServerUrl creation logic to remove dependency on 'imageServerUrl' (#1913) * Updated dmServerUrl creation logic to remove dependency on 'imageServerUrl' property (#1904) Issue : https://github.com/adobe/aem-core-wcm-components/issues/1884 * [DMAssetPostProcessor] Property 'imageServerUrl' is created on every resource where a property 'fileReference' is saved - fix failing unit test - remove DMAssetPostProcessor fixes #1884 * 'dam:scene7Domain' property is saved with a trailing '/' in metadata. 'dam:scene7Domain' property is saved with a trailing '/' in metadata. Co-authored-by: Burkhard Pauli --- .../cq/wcm/core/components/internal/models/v2/ImageImpl.java | 2 +- bundles/core/src/test/resources/image/test-content-dam.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/models/v2/ImageImpl.java b/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/models/v2/ImageImpl.java index d074746576..fed0ff5394 100644 --- a/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/models/v2/ImageImpl.java +++ b/bundles/core/src/main/java/com/adobe/cq/wcm/core/components/internal/models/v2/ImageImpl.java @@ -198,7 +198,7 @@ protected void initModel() { dmServerUrl = dmServerPath; } else { // for Publish - dmServerUrl = asset.getMetadataValue(Scene7Constants.PN_S7_DOMAIN) + dmServerPath; + dmServerUrl = asset.getMetadataValue(Scene7Constants.PN_S7_DOMAIN) + dmServerPath.substring(1); } dmImageUrl = dmServerUrl + dmAssetName; } diff --git a/bundles/core/src/test/resources/image/test-content-dam.json b/bundles/core/src/test/resources/image/test-content-dam.json index d6f2fc20a1..0c14aac302 100644 --- a/bundles/core/src/test/resources/image/test-content-dam.json +++ b/bundles/core/src/test/resources/image/test-content-dam.json @@ -928,7 +928,7 @@ "dam:Physicalheightindpi" : 72, "dam:Numberofimages" : 1, "dam:Numberoftextualcomments": 0, - "dam:scene7Domain" : "https://s7d9.scene7.com", + "dam:scene7Domain" : "https://s7d9.scene7.com/", "dam:scene7File" : "dmtestcompany/Adobe_Systems_logo_and_wordmark_DM", "tiff:ImageWidth" : 2000, "dam:sha1" : "bb3aa5c9b452b04808006037911705d3592bfd71", @@ -1002,7 +1002,7 @@ "dam:Physicalheightindpi" : 72, "dam:Numberofimages" : 1, "dam:Numberoftextualcomments": 0, - "dam:scene7Domain" : "https://s7d9.scene7.com", + "dam:scene7Domain" : "https://s7d9.scene7.com/", "dam:scene7File" : "dmtestcompany/Adobe_Systems_logo_and_wordmark_DM", "dam:scene7Type" : "AnimatedGif", "tiff:ImageWidth" : 2000,