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.
To generate view interfaces:
- Ensure your project has a complete set of data and corresponding templates.
- Ensure your project has a configuration file
_config.json. - 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/.
See also: