How Brightspot Works

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.

See also:

Rapid Content Modeling

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

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
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 places constraints on the CMS’s operation, and Brightspot provides powerful annotations that implement those constraints (and many others common in electronic publishing).

Implementation of simple article model
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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();
    }

}

In the previous snippet—

  • For the field headline in line 13:
    • Line 10 ensures the field is required. Brightspot’s interface Recordable contains many annotations for constraining a field’s behavior at the database level.
    • Line 11 helps to ensure the field has no more than 30 characters. Brightspot’s class ToolUi contains many annotations for customizing a field’s appearance and behavior in the content edit form.
    • Line 12 ensures the field is searchable; visitors can search for articles whose headlines contain the search terms.
  • For the field body in line 16:
    • Line 15 ensures the field appears as a rich-text editor in the content edit form.
  • For the field author in line 20:
    • Line 18 ensures the field is required.
    • Line 19 ensures the field is searchable; visitors can search for articles whose author’s name contains the search terms.
    • Line 20 specifies an instance of type Author, implicitly requiring that the field’s value already exist as an Author object in the database.
  • Lines 22–24 return a headline in title case to a consuming application. Brightspot’s class StringUtils contains several methods for manipulating strings.
  • Lines 26–28 return the rich-text body.
  • Lines 30–32 return a concatenation of the author’s first and last names. (Implementation of the methods getFirstName and getLastName are in the author Model.)

See also:

Automatic Generation of User Interface

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.

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.

../../../_images/form-example.png

See also:

Distribute Platform-Independent Content to Consuming Applications

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.