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

  • 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
  • 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>1.2.5</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 mimeType = "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:

  • setContent(S property, InputStream content)

  • InputStream getContent(S property)

  • unsetContent(S property)

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.1.x Boot 2.2.x Boot 2.3.x Boot 2.4.x
GA GA SNAPSHOT GA SNAPSHOT GA SNAPSHOT
Storage
Spring Content S3 0.12.0 1.0.0.M10 1.0.0.M11 1.1.0.M5 1.1.0.M6 1.2.5 1.2.6
Spring Content GCS n/a n/a n/a n/a n/a 1.2.5 1.2.6
Spring Content Azure Storage n/a n/a n/a n/a n/a 1.2.5 1.2.6
Spring Content Filesystem 0.12.0 1.0.0.M10 1.0.0.M11 1.1.0.M5 1.1.0.M6 1.2.5 1.2.6
Spring Content Mongo (GridFS) 0.12.0 1.0.0.M10 1.0.0.M11 1.1.0.M5 1.1.0.M6 1.2.5 1.2.6
Spring Content JPA 0.12.0 1.0.0.M10 1.0.0.M11 1.1.0.M5 1.1.0.M6 1.2.5 1.2.6
Renditions
Spring Content Renditions - - - 1.1.0.M5 1.1.0.M6 1.2.5 1.2.6
Versioning
Spring Versions JPA 0.12.0 1.0.0.M10 1.0.0.M11 1.1.0.M5 1.1.0.M6 1.2.5 1.2.6
Fulltext Indexing
Spring Content Solr 0.12.0 1.0.0.M10 1.0.0.M11 1.1.0.M5 1.1.0.M6 1.2.5 1.2.6
Spring Content Elasticsearch 0.12.0 1.0.0.M10 1.0.0.M11 1.1.0.M5 1.1.0.M6 1.2.5 1.2.6
APIs
Spring Content REST 0.12.0 1.0.0.M10 1.0.0.M11 1.1.0.M5 1.1.0.M6 1.2.5 1.2.6
Spring Content CMIS 0.12.0 1.0.0.M10 1.0.0.M11 1.1.0.M5 1.1.0.M6 1.2.5 1.2.6