Digital Assets

Creating a digital asset is easy. Simply upload or drag and drop a media file into the assets view, and a digital asset is created automatically.

As mentioned in the section on assets, digital assets in Oracle Content and Experience are really instances of a special out-of-the-box content type called DigitalAsset. They are mostly used for content modeling and publishing—as such, they differ from "regular" documents, which are intended more for content collaboration and syncing.

All digital assets share some common properties, while different types of digital assets also have their own sets of properties. Let’s explore them in the context of the example used in the assets section. To recap, we have two content types, Article and Author, both of which have media files. Let’s focus on the article asset to see how you can access information about the associated image (in the picture field), which is a digital asset.

Accessing the article asset provides access to a link to the digital asset, under fields.picture (picture is a field name in the content type Article):


Description of headless_digital_assets_rest_response.png follows
Description of the illustration headless_digital_assets_rest_response.png

In the links node under fields.picture, you see a reference (href) pointing to the properties of the digital asset.

As mentioned earlier, digital assets are instances of a special out-of-the-box content type called DigitalAsset. As such, the form of the payload for a digital asset is identical to that of any other asset. In fact, addressing the digital asset is done in exactly the same way as for other assets, in that it includes standard fields like id, name, and so on, as well as a fields child node with additional properties. This means that you can access a digital asset resource directly by following the href link under the picture node:

GET
      http://. . ./content/published/api/v1.1/items/CONT337B107EAF904296B382BE08C82A08B8?channelToken=9f817f8edb7f4c38add244cd39bdd18b

This produces a response that looks something like this:


Description of headless_13_digital_assets_rest_response.png follows
Description of the illustration headless_13_digital_assets_rest_response.png

Digital assets have some special fields that are defined for the out-of-the-box DigitalAsset content type.

Property Description
metadata Any metadata associated with the digital asset, such as the width and height of an image.
size Byte size of the file.
native Link to the original (native) file that was uploaded.
renditions Array of renditions of the digital asset. More details on renditions follow.
mimetype MIME type of the file; for example: image/jpeg or video/mp4.
version Version of the file.
fileType Underlying file type of the native file.

Let’s have a closer look at the actual digital asset in the Oracle Content and Experience web interface. If you open the renditions panel on the right side, you’ll see that the digital asset doesn’t just consist of the original file, but also a number of renditions. A rendition is a variant of the file that can be automatically generated by the system or manually added by users. For images, renditions are typically different-sized versions of the same image to accommodate various screen sizes. Each rendition is available in the renditions node of the REST response:


Description of headless_digital_assets_renditions.png follows
Description of the illustration headless_digital_assets_renditions.png

Each rendition for images comes in two formats: jpeg and webp. Each of these formats has its own metadata and other properties, as well as a link to the actual rendition. An expanded rendition looks something like this:


Description of headless_15_digital_assets_rest_response.png follows
Description of the illustration headless_15_digital_assets_rest_response.png

The combination of access to native files as well as renditions (which can be system-generated or user-added) enables you to build highly responsive applications. Metadata included in the formats enables you to create HTML 5 image tags that allow web browsers to access the correct image rendition that’s appropriate for the screen size.