close

Filter

loading table of contents...

Studio Developer Manual / Version 2406.0

Table Of Contents

9.25.3 Default Pictures

For numerous RemoteBean entities of the CoreMedia Studio, default pictures can be resolved in terms of their picture blob, their picture URL or both.

Default pictures are calculated on the CoreMedia Studio server and replace the existing ThumbnailResolver implementation of the client. This section describes how the resolving can be customized and accessed by the client.

Default Picture Resolving

To support a thumbnail for a Studio RemoteBean entity, the server has to provide an implementation of DefaultPictureResolver for it. The product already supports these resolvers for most entities of the Studio, including a default implementation for content items.

The interface comes with the additional default method default int getOrder(). This allows to re-implement an existing resolver and prefer it over the default implementation.

While DefaultPictureResolver is the interface to implement for any kind of entity, you can also implement the more specialized interface ContentDefaultPictureResolver to resolve default pictures for content items. The interface includes the methods getContentType() and includeSubTypes to specify for which content items of which type the resolver applies.

Both DefaultPictureResolver and ContentDefaultPictureResolver also come in a flavour where a DefaultPictureService is passed into their resolve() method. The service can be used to resolve further pictures along the way to finally obtain the picture in question. For example, while resolving the default picture for a Process, one of its content items is chosen and the process picture is then resolved as the default picture of this content item.

The thumbnail resolving for the content type model can be customized in the application.properties of the Studio server. Additional entries can be added there, using the format studio.defaultPicture.content.paths.<DOCTYPE_NAME>=<VALUE>, where DOCTYPE_NAME matches the name of the content type and VALUE the name of the mapped content property that contains the picture blob or references another content item which contains the blob (or again another content item).

studio.default-picture.content.paths.CMVideo=pictures
studio.defaultPicture.content.paths.CMPicture=data
      

Example 9.101. Example content thumbnail resolver configuration


In this example the thumbnail for a CMVideo is looked up in the pictures link list. The list itself contains CMPicture content items which have their blob stored in the property data. Note that this path notation may also point to Struct properties, e.g. localSettings.thumbnail.

Access Thumbnails on the Studio Client

Thumbnails for the Studio client RemoteBeans are resolved through the thumbnailService. The service provides the following methods for this:

  • getThumbnailUri(model: any, operations: string = null): string This is the common service method to resolve a thumbnail URL with optional additional image operations for the given model. The method returns the default picture URL if the entity implements WithDefaultPicture and the server logic is able to resolve a picture for it.
  • getThumbnail(model: any, operations: string = null): Thumbnail | string If available, this method returns the calculated Thumbnail object. In some cases, the client wants to know details about the image data, like the mime type or the blob size. If only the URL information is available, the URL string is returned instead.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.