Brightspot CMS Developer Guide

Developer Guide Primer (HERO)

Brightspot is a content management system for building scaleable content management and asset management applications, as well as a platform for integrating other publishing systems, such as video, social media, and CRM. Brightspot can be used as a publishing platform for websites and native mobile applications, or as an application back end.

Tip
Brightspot can be tailored to the specific business requirements of an organization or industry. It enables the creation, editing, storage, retrieval, and delivery of content items at a fine granular level, down to individual attributes of content objects. Web pages, page components, and content modules are content objects themselves, making all editorial and management capabilities applicable to them as well.

Brightspot streamlines design, development, and editorial processes as follows:

  • Brightspot enables developers to model content types with Java classes. A data model can be altered by modifying the Java classes that define it, without regard to database schema or other configurations.
  • Editors are an integral part of the modeling process, directing developers in the “editorial language” that defines content models. The editorial user interface is automatically derived from the underlying Java classes that describe the content objects.
  • Brightspot ensures a complete separation of content and display. Designers and front-end developers can focus on user interfaces (UIs), without prerequisite knowledge of the back-end content model implementation.

Brightspot’s objective is to minimize the effort and time required to deploy a high-performance, commercial-grade website. To achieve that objective, Brightspot’s architecture highlights the following characteristics:

These three characteristics help to guarantee that with Brightspot you can deploy a commercial-grade website from scratch within weeks.

Content modeling is the process of determining the content types included in your Brightspot project and the members of each content type. For example, if you are building a Brightspot project for a news site, you may have the following content types:

  • Articles
  • Images
  • Authors
Important
Each of these content types is expressed as a special form of a Java class called a model. Each model has its own list of properties and methods. For example, the following table characterizes the properties and methods of a simple article.

Properties and methods for a simple article model

Property/Method
Characteristics
headlineRequired field, no more than 30 characters; visitors can search for articles whose headlines contain specific search terms.
bodyRich-text editor for applying formatting.
authorRequired field, foreign key to existing authors; visitors can search for articles written by a given author.
getHeadlineReturns headline to consuming application in title case.
getBodyReturns body to consuming application.
getAuthorReturns author’s full name (first + last) to consuming application.

Each of the characteristics in the previous table, along with associated annotations, impact Brightspot’s operation as illustrated in the following example.

Implementation of simple article model
package article;

import brightspot.core.person.Author;
import com.psddev.cms.db.Content;
import com.psddev.cms.db.ToolUi;
import com.psddev.dari.util.StringUtils;

public class Article extends Content {

    @Required 
    @ToolUi.SuggestedMaximum(30) 
    @Indexed 
    private String headline;

    @ToolUi.RichText 
    private String body;

    @Required 
    @Indexed 
    private Author author; 

    public String getHeadline() { 
        return StringUtils.toLabel(headline); 
    }

    public String getBody() { 
        return body;
    }

    public String getAuthor() { 
        return author.getFirstName() + " " + author.getLastName();
    }

}
  • @Required Declares the field headline as required in the database and in the content edit form. The interface Recordable contains many annotations for similar constraints.
  • Limits the number of characters to no more than 30. The class ToolUi contains many annotations for customizing a field’s appearance and behavior in the content edit form.
  • Ensures the field is searchable; editors can search for articles whose headlines contain the search terms.
  • @ToolUi.RichText Renders the field body as a rich-text editor in the content edit form.
  • Declares the field author as required in the database and in the content edit form.

See also:

Publishing companies accumulate content by creating original assets (such as articles, blog posts, and images) or by ingesting content from third parties (such as image- or video-hosting services and government publications). These activities require a user interface for the editors performing them.

  • Editors need web forms to write headlines, titles, and body text.
  • Photographers and videographers need web forms to upload media and annotate them with captions.
Note
Brightspot’s class Content renders the web forms for creating content based on each field’s type. For example, the snippet “Implementation of simple article” model describes an article model with three fields: headline, body, and author. Because the model extends from Content, Brightspot generates the content edit form at run time as in the following illustration.

See also:

  • Content modeling (Internal Link)

When a client requests a particular item from the Brightspot server, Brightspot returns the data only, with no markup except for possibly escaped HTML characters. Some publishers already have formatting infrastructure, and prefer to ingest Brightspot’s response as a JSON file in a headless environment. Other publishers prefer to develop their own formatting using a templating language, or to use Brightspot’s provided templates and customize the associated style sheets. Brightspot provides the flexibility that supports both scenarios.

Popular Developer Guide Topics