WebSphere Commerce Version 8.0.4.0

Adding external content types to Watson Content Hub

You can add external content types to Watson Content Hub, which determine the types of WebSphere Commerce content that can be managed in Watson Content Hub.

About this task

You can either load WebSphere Commerce sample content types into Watson Content Hub using wchtools, or create custom content types in Watson Content Hub.

When you load the sample, the following content types are available by default:
  • CatalogEntryImages
  • CatalogEntryImagesWithProfiles
  • CatalogGroupImages
  • CatalogGroupImagesWithProfiles
  • Attachments
When you package and upload content to , the expected file structure is as follows:
  • Managed assets: Assets such as catalog images and attachments, that are managed in and to be referenced and used in Management Center.
    The file structure for manaed assets is expected to be within the assets/dxdam directories, and ordered in a way that suits your business needs. For example, for a shirt and hero image in the catalog, the file structure could be:
    • assets/dxdam/catalog/shirts/shirt1.jpg
    • assets/dxdam/catalog/hero/category1Hero.jpg

    When you create a data load file for addressing any of these types of assets, specify the path relative to assets/dxdam, such as catalog/shirts/shirt1.jpg or catalog/hero/category1Hero.jpg to reference the preceding examples.

  • Static web assets or developer assets: Assets such as JavaScript and CSS files, that are stored in and addressed directly.
    The file structure for static assets is expected to be anywhere outside the assets/dxdam directories, and ordered in a way that suits your business needs. For example, for a JavaScript file used in your custom store, the file structure could be:
    • assets/CustomStore/home/custom.js

Procedure

  • Loading WebSphere Commerce sample content types into Watson Content Hub using wchtools:
    1. Download and install wchtools from GitHub. For more information, see GitHub: IBM Watson Content Hub Developer Tools CLI.
    2. Download and extract the following sample file to a working directory: WCH-Commerce-Types.zip.
    3. Initialize wchtools with a user in Watson Content Hub that has manager or administration authority to the tenant:
      
      wchtools init
      
    4. Push the WCH-Commerce-Types assets to the content hub:
      
      wchtools push -A --dir WCH-Commerce-Type_location --password WCH_user_password
      
    5. Go to Watson Content Hub and ensure that the sample content types are available.
  • Creating custom content types in Watson Content Hub:
    Ensure that you conform to the following guide when creating and working with custom content types:
    • You can create custom content types for product images, category images or attachments. They are then recognized in the Management Center and the storefront.
    • Product and category images types can be customized to add more images, change descriptive labels or additional files with unique keys. Additional files with unique keys will be put in the WebSphere Commerce data model and search index as additional images or attachments.
    • The following ContentType tags are recognized by WebSphere Commerce:
      Type:CatEntryExternalContent
      Content that is set with this tag is included in Management Center search for Catalog Entry External Content.
      Type:CatGroupExternalContent
      Content that is set with this tag is included in Management Center search for Catalog Group External Content.
      Usage:images
      Content that is set with this tag is used as images in the storefront. Only one content of type Usage:images is assignable to a catalog group or catalog entry. Content is indexed into the attachment search index and each asset is accessible by its rule name. The rule name is in the form of usage_name_field_identifier. For example, a custom field name could have a rule name of images_rearimage.
      Usage:attachments
      Content that is set with this tag is used as attachments to one or more catalog objects. A catalog group or catalog entry can have multiple attachment types. Content is indexed into the attachment search index and each asset is accessible by its rule name. The rule name is in the form of usage_name_field_identifier.
      Custom tag names or usages
      Custom tag names or usages that you create, depending on your requirements. For example, Usage:userManual or Usage:instructionVideo.
    • The storefront recognizes two size profiles for catalog entries and catalog groups, which can scale to other sizes: fullimage and thumbnail. Additional profiles require changes to widgets and store JSP files.
    • The following naming convention must be used for image field key identifiers for full and thumbnail images to be recognized by WebSphere Commerce and the Aurora starter store:
      Explicitly managed images:
      • main_fullimage, main_thumbnail
      • angleN_fullimage, angleN_thumbnail, where N is the ascending digit associated with the image.
      Type using image profiles:
      • main
      • angleN
    • If additional fields with different keys are added to the content type, they will be added to the attachment search index and addressable in the storefront with rule name usage_fieldname_key.
    • Custom types will not be recognized in the Management Center (save fails) until the ScheduledExternalContentRefreshCmd scheduled command is run or the server is restarted.

What to do next

After you create WebSphere Commerce content types to manage in Watson Content Hub, you can work with them. For more information, see Managing your content in Watson Content Hub.