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.
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:
- Rapid content modeling (Internal Link)
- Automatic generation of user interface
- Distribute platform-independent content to consuming applications
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
Properties and methods for a simple article model
Property/Method | Characteristics |
---|---|
headline | Required field, no more than 30 characters; visitors can search for articles whose headlines contain specific search terms. |
body | Rich-text editor for applying formatting. |
author | Required field, foreign key to existing authors; visitors can search for articles written by a given author. |
getHeadline | Returns headline to consuming application in title case. |
getBody | Returns body to consuming application. |
getAuthor | Returns 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.
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:
- Field types (Internal Link)
- Content modeling annotations
- Data modeling annotations
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.
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.