diff --git a/course-mw/course-actors-common/src/main/java/org/sunbird/learner/actors/qrcodedownload/QRCodeDownloadManagementActor.java b/course-mw/course-actors-common/src/main/java/org/sunbird/learner/actors/qrcodedownload/QRCodeDownloadManagementActor.java index 8d21258cff26bf2f09cca5d9b976092282a9fba0..bef4d34208da4a805d4448fded8d082da843a462 100644 --- a/course-mw/course-actors-common/src/main/java/org/sunbird/learner/actors/qrcodedownload/QRCodeDownloadManagementActor.java +++ b/course-mw/course-actors-common/src/main/java/org/sunbird/learner/actors/qrcodedownload/QRCodeDownloadManagementActor.java @@ -233,10 +233,15 @@ public class QRCodeDownloadManagementActor extends BaseActor { List<Map<String, Object>> listOfMap = (List<Map<String, Object>>) obj; if (CollectionUtils.isNotEmpty(listOfMap)) { //TODO Resolve it and store. Assuming dial code db will have the template url with data migration script + + //check if template url contains dail storage base path,if yes then append it with cnameurl and dial bucket name String templateUrl = (String) listOfMap.get(0).get("url"); - //replace template url with the actual cloud url - if (templateUrl.contains(getConfigValue(CLOUD_STORE_BASE_PATH_PLACEHOLDER))) - templateUrl = templateUrl.replace(getConfigValue(CLOUD_STORE_BASE_PATH_PLACEHOLDER), getConfigValue(CLOUD_STORE_BASE_PATH)); + String dailStorageBasePath = getConfigValue(DIAL_STORAGE_BASE_PATH_PLACEHOLDER); + String cnameUrl = getConfigValue(CLOUD_STORAGE_CNAME_URL); + if (templateUrl.contains(dailStorageBasePath)) + templateUrl = templateUrl.replace(dailStorageBasePath, + cnameUrl.isEmpty() ? getConfigValue(CLOUD_STORE_BASE_PATH) :cnameUrl + + "/" + getConfigValue(CLOUD_STORAGE_DIAL_BUCKET_NAME)); return templateUrl; } } diff --git a/course-mw/sunbird-util/sunbird-platform-core/common-util/src/main/java/org/sunbird/common/models/util/JsonKey.java b/course-mw/sunbird-util/sunbird-platform-core/common-util/src/main/java/org/sunbird/common/models/util/JsonKey.java index 61c8186bbfab486c07e741e8e5a55a7b3244e659..bcc9ea43a0c44f70812e671f930a864e812ac6e2 100644 --- a/course-mw/sunbird-util/sunbird-platform-core/common-util/src/main/java/org/sunbird/common/models/util/JsonKey.java +++ b/course-mw/sunbird-util/sunbird-platform-core/common-util/src/main/java/org/sunbird/common/models/util/JsonKey.java @@ -789,6 +789,9 @@ public final class JsonKey { public static final String CLOUD_FOLDER_CONTENT = "sunbird_cloud_content_folder"; public static final String CLOUD_STORE_BASE_PATH = "cloud_storage_base_url"; + public static final String CLOUD_STORAGE_CNAME_URL= "cloud_storage_cname_url"; + public static final String CLOUD_STORAGE_DIAL_BUCKET_NAME = "cloud_storage_dial_bucketname"; + public static final String DIAL_STORAGE_BASE_PATH_PLACEHOLDER="DIAL_STORAGE_BASE_PATH"; public static final String CLOUD_STORE_BASE_PATH_PLACEHOLDER = "cloud_store_base_path_placeholder"; public static final String TO_URL = "toUrl"; public static final String TTL = "ttl"; diff --git a/course-mw/sunbird-util/sunbird-platform-core/common-util/src/main/resources/externalresource.properties b/course-mw/sunbird-util/sunbird-platform-core/common-util/src/main/resources/externalresource.properties index f5f217265434c0e46a291d008bcc67fff2fc4601..ccaf02aa00f05d32e4db06307205d17190e51426 100644 --- a/course-mw/sunbird-util/sunbird-platform-core/common-util/src/main/resources/externalresource.properties +++ b/course-mw/sunbird-util/sunbird-platform-core/common-util/src/main/resources/externalresource.properties @@ -207,4 +207,6 @@ sunbird_msg_91_auth= sunbird_api_mgr_base_url=https://dev.sunbirded.org/api enrollment_list_size=1000 cloud_storage_base_url=https://sunbirddev.blob.core.windows.net +cloud_storage_cname_url=https://obj.stage.sunbirded.org +cloud_storage_dial_bucketname=dial cloud_store_base_path_placeholder=$CLOUD_BASE_PATH \ No newline at end of file