-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # metadata/cloudinary-metadata.zip
- Loading branch information
Showing
6 changed files
with
102 additions
and
3 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
cartridges/int_cloudinary/cartridge/scripts/jobs/steps/cldStructuredMetadata.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
'use strict'; | ||
|
||
// API includes | ||
var jobLogger = require('dw/system').Logger.getLogger('Cloudinary', 'CREATE'); | ||
var Status = require('dw/system/Status'); | ||
|
||
module.exports.Start = function (args) { | ||
var cloudinaryConstants = require('*/cartridge/scripts/util/cloudinaryConstants'); | ||
var cloudinaryMetadataSvc = require('*/cartridge/scripts/service/cldMetadata'); | ||
var jobStepHelpers = require('*/cartridge/scripts/helpers/jobStepHelpers'); | ||
|
||
if (!cloudinaryConstants.CLD_ENABLED) { | ||
return new Status(Status.ERROR, 'ERROR', 'The Cloudinary cartridge is disabled'); | ||
} | ||
|
||
if (jobStepHelpers.isStepDisabled(args)) { | ||
return new Status(Status.OK, 'OK', 'Step disabled, skip it...'); | ||
} | ||
|
||
const schema = [ | ||
{ "label": "sfcc-product-name", "external_id": "sfcc-product-name", "type": "string" }, | ||
{ "label": "sfcc-view-type", "external_id": "sfcc-view-type", "type": "string" }, | ||
{ "label": "sfcc-product-brand", "external_id": "sfcc-product-brand", "type": "string" }, | ||
{ "label": "sfcc-product-identifier", "external_id": "sfcc-product-identifier", "type": "string" }, | ||
{ "label": "sfcc-is-main", "external_id": "sfcc-is-main", "type": "enum", "datasource": { "values": [{ "external_id": "True", "value": "True" }, { "external_id": "False", "value": "False" }] } }, | ||
{ "label": "sfcc-gallery-position", "external_id": "sfcc-gallery-position", "type": "integer" }, | ||
{ "label": "sfcc-alt-text", "external_id": "sfcc-alt-text", "type": "string" } | ||
]; | ||
|
||
try { | ||
cloudinaryMetadataSvc.createMetadataSchemeCld(schema); | ||
} catch (e) { | ||
jobLogger.error('Error occurred while creating metadata, message : {0}', e.message); | ||
} | ||
|
||
return new Status(Status.OK); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+42.3 KB
(140%)
documentation/Cloudinary SFRA LINK Documentation 1.0.0.docx
Binary file not shown.
Binary file modified
BIN
+3.06 KB
(100%)
documentation/Cloudinary SiteGenesis LINK Documentation 1.0.0.docx
Binary file not shown.
Binary file not shown.