Shutterstock
The shutterstock module lets editors search and import licensed images from a linked Shutterstock account through Brightspot's federated search.
Dependencies
Depends on db-http and the Shutterstock API v2 (api.shutterstock.com/v2), authenticated with OAuth2.
Installation
- Maven
- Gradle
- Gradle (Kotlin DSL)
<!-- Requires Brightspot 5.0 or later. -->
<dependency>
<groupId>com.brightspot.dbhttp</groupId>
<artifactId>shutterstock</artifactId>
<version>1.0.0</version>
</dependency>
// Requires Brightspot 5.0 or later.
implementation 'com.brightspot.dbhttp:shutterstock:1.0.0'
// Requires Brightspot 5.0 or later.
implementation("com.brightspot.dbhttp:shutterstock:1.0.0")
API reference
com.psddev.shutterstock.ShutterstockDatabase
Extends HttpDatabase. Searches Shutterstock's image search endpoint on behalf of the editor's linked account, or their enterprise account if one is available.
com.psddev.shutterstock.ShutterstockImage
Extends ExternalItem.
| Field | Type | Description |
|---|---|---|
shutterstockId | String | The Shutterstock image Id. |
previewUrl | String | A watermarked preview image URL. |
dateAdded | Date | When the image was added to Shutterstock. |
categories | Set<String> | Shutterstock categories assigned to the image. |
contributorId | String | The contributor's Shutterstock Id. |
description | String | The image description. |
imageType | String | The Shutterstock image type. |
adult | Boolean | Whether Shutterstock flags the image as adult content. |
illustration | Boolean | Whether the image is an illustration rather than a photograph. |
keywords | Set<String> | Shutterstock keywords assigned to the image. |
Sort order is set through the ShutterstockImageSort enum: POPULAR, NEWEST, RELEVANCE, or RANDOM. Importing a full-resolution image requires the linked account to have an active subscription; otherwise the module falls back to the preview image.
Configuration
The OAuth2 consumer key and secret are stored on com.psddev.shutterstock.ShutterstockApiClient, referenced from ShutterstockSettings, a Modification<SiteSettings> shown under Site Settings > Integrations > Shutterstock. Each editor additionally links their own Shutterstock account before they can search Shutterstock.
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<ShutterstockImage, T> to convert the external item into it on import.