Support and Documentation

Generating Java view interfaces from data files

At run time, Brightspot runs a view model that retrieves all the required items and injects them into a template. The following snippet is a simplified declaration for a view model.

public class ArticleViewModel extends ViewModel<Article> implements PageEntryView, ArticleView {

}

You generate the interface ArticleView from your theme project.

Procedure. To generate view interfaces:
  1. Ensure your project has a complete set of data and corresponding templates.

  2. Ensure your project has a configuration file _config.json.

  3. In your project's installation directory (the directory above theme/), run ./gradlew build.

The generated interface files are in the directory frontend/build/generated-sources/styleguide/com/psddev/styleguide/.