Images

To make use of images with Ucommerce, you will need to implement your image service based on the IImageService interface.

Prerequisites

Before implementing your custom Image Service with Ucommerce, ensure the following:

  • External Data Source: You need access and necessary permissions to fetch and format data from an external source and into Ucommerce. If you are using a CMS, you could consider using any asset management system implemented in that.

A Digital Asset Management (DAM) system is highly recommended for efficient asset management and reliable functionality.

IImageService

The Image Service interface provides three distinct methods for retrieving content. These methods cater to various use cases within the system.

  1. Get Method

    This method is commonly used by the backoffice media picker and is designed to retrieve a list of content.

    • Parameters:

      • parentId (optional): Filter the content based on the parent ID.

      • startAt (default: 0): Define the starting point for the retrieval.

      • limit (default: 30): Set a limit on the number of content items to retrieve.

      • token (default): Cancellation token for task management.

    • Usage:

      • The media picker relies on this method to:

        • Retrieve all images.

        • Initially obtain the first image in the list and then invoke the method again with this image's ID as the parent ID.

    • Note:

      • As a result, the first elements in the list should typically represent some form of root object.

  2. GetById Method

    This method is designed to fetch image content by a specific ID.

  3. GetByIds Method

    This method is intended to retrieve all content items associated with a list of specified IDs.

All of these methods should fetch and filter your data, based on your external data source.

pageMedia

Last updated