Adobe Stock
The adobe module lets editors search and import licensed images from Adobe Stock through Brightspot's federated search.
Dependencies
Depends on db-http and Adobe's stock REST API over HTTP. Importing a full-resolution image requires an OAuth2 access token in addition to the API key/secret pair, obtained through an in-CMS authentication flow.
Installation
- Maven
- Gradle
- Gradle (Kotlin DSL)
<!-- Requires Brightspot 5.0 or later. -->
<dependency>
<groupId>com.brightspot.dbhttp</groupId>
<artifactId>adobe</artifactId>
<version>1.0.0</version>
</dependency>
// Requires Brightspot 5.0 or later.
implementation 'com.brightspot.dbhttp:adobe:1.0.0'
// Requires Brightspot 5.0 or later.
implementation("com.brightspot.dbhttp:adobe:1.0.0")
API reference
com.psddev.adobe.stock.AdobeStockDatabase
Extends HttpDatabase. Searches Adobe Stock's Media/1/Search/Files endpoint and requests licensed downloads through Libraries/1/Content/License.
com.psddev.adobe.stock.AdobeStockImage
Extends ExternalItem.
| Field | Type | Description |
|---|---|---|
title | String | The image's title. |
adobeStockId | String | The Adobe Stock media Id. |
isLicensed | String | Whether the current account has licensed this image. |
previewUrl | String | A watermarked preview image URL. |
downloadUrl | String | The full-resolution download URL once licensed. |
creatorName | String | The contributor's name. |
width | Long | The image width in pixels. |
height | Long | The image height in pixels. |
category | String | The Adobe Stock category. |
Sort order is set through the AdobeStockImageSort enum: UNDISCOVERABLE, POPULARITY, NB_DOWNLOADS, or CREATION.
Configuration
Credentials are stored on com.psddev.adobe.stock.AdobeStockApiClient (integrationName, apiKey, clientSecret), referenced from AdobeStockSettings, a Modification<SiteSettings> shown under Site Settings > Integrations > Adobe Stock. AdobeStockDatabaseProvider resolves the per-site client and constructs the database.
Editors must additionally authenticate the site to Adobe (AdobeAuthPage, an OAuth2 callback page) before full-resolution downloads succeed; the resulting access token is stored as an AdobeAccessToken record and refreshed automatically until it expires.
Extending the plugin
The module doesn't ship a content type for imported images. To let editors create one from search results, define a content type and extend ExternalItemConverter<AdobeStockImage, T> to convert the external item into it on import, downloading the full image with AdobeStockImage#generateStorageItemFromUrl.