Content Services for Spring

Cloud-Native Content Management Extensions for Spring.

For creating cloud-native, horizontally scaling Content Management Services that manage your unstructured data and rich content such as documents, images and movies.

Features

  • Standardized access to content no matter where it is stored

  • Associate content with Spring Data entities

  • Reactive content access (S3)

  • Full-text search (Solr and Elasticsearch)

  • Content rendition and transformation

  • Pessimistic versioning or auto-versioning

  • REST or CMIS endpoints

Videos

Modules

  • Commons - Core content management concepts underpinning every other module
  • S3 - Store support for Amazon S3, and any other S3-compliant object storage. Also supports reactive access.
  • Filesystem - Store support for the Filesystem storage
  • Mongo - Store support for Mongo's GridFS storage
  • JPA - Store support for JPA BLOB storage
  • Renditions - Extensible rendition service for content transformations
  • Solr - Content indexing and search with Apache Solr
  • Elasticsearch - Content indexing and search with Elasticsearch
  • Versions Commons - Locking and versioning semantics for Entities and associated content
  • Versions JPA - JPA-based implementation of locking and versioning
  • REST - Exports Stores as hypermedia-driven RESTful resources
  • CMIS - Exports Stores through the CMIS browser bindings

Overview

spring-content-arch
Figure 1. understanding how Spring Content fits into the Spring eco-system

Quick Start

<dependency>
    <groupId>com.github.paulcwarren</groupId>
    <artifactId>spring-content-fs-boot-starter</artifactId>
    <version>3.0.13</version>
</dependency>

For a quick taste, look at the following domain object:


@Entity
@Getter
@Setter
@NoArgsConstructor
public class File {

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	private String name;
	private Date created = new Date();
	private String summary;

	@ContentId private String contentId;
	@ContentLength private long contentLength;
	private String contentMimeType = "text/plain";
}

This defines a simple JPA entity with a few structured data fields; title, authors and keywords and two Spring Content-managed data fields; @ContentId and @ContentLength.

The structured data fields are managed in the usual way through a CrudRepository<SopDocument,String> interface.

Content is handled separately with a ContentStore interface:-


public interface FileContentStore extends ContentStore<File, String> {
}

This interface extends Spring Content’s ContentStore and is typed to the entity class File and the id class String. Put this code inside a Spring Boot application with spring-boot-starter-data-jpa and spring-content-fs-boot-starter like this:


@SpringBootApplication
public class SpringContentApplication {

	public static void main(String[] args) {
		SpringApplication.run(SpringContentApplication.class, args);
	}
}

Launch your app and Spring Content (having been autoconfigured by Spring Boot) will automatically craft a concrete set of operations for handling the content associated with this Entity:

  • S setContent(S entity, InputStream content)

  • InputStream getContent(S entity)

  • S unsetContent(S entity)

For more, check out our initial Getting Started Guide, or watch one of our SpringOne talks 2016, 2017 @11mins and 2018.

Reference Documentation

Boot 2.4.x+ Boot 3.0.x+
GA SNAPSHOT GA SNAPSHOT
Storage
Spring Content S3 2.9.0 2.10.0 3.0.13 3.0.14
Spring Content GCS 2.9.0 2.10.0 3.0.13 3.0.14
Spring Content Azure Storage 2.9.0 2.10.0 3.0.13 3.0.14
Spring Content Filesystem 2.9.0 2.10.0 3.0.13 3.0.14
Spring Content Mongo (GridFS) 2.9.0 2.10.0 3.0.13 3.0.14
Spring Content JPA 2.9.0 2.10.0 3.0.13 3.0.14
Renditions
Spring Content Renditions 2.9.0 2.10.0 3.0.13 3.0.14
Versioning
Spring Versions JPA 2.9.0 2.10.0 3.0.13 3.0.14
Fulltext Indexing
Spring Content Solr 2.9.0 2.10.0 3.0.13 3.0.14
Spring Content Elasticsearch 2.9.0 2.10.0 3.0.13 3.0.14
APIs
Spring Content REST 2.9.0 2.10.0 3.0.13 3.0.14
Spring Content CMIS 2.9.0 2.10.0 3.0.13 3.0.14