Examples

For example, a todo app could use @HomePage on a dashboard of todo items to complete:

HomePage

The corresponding code is:

@HomePage
@DomainObject(nature = Nature.VIEW_MODEL)
public class TodoAppDashboard {
    public String title() { return "Dashboard"; }

    public List<ToDoItem> getNotYetComplete() { /* ... */ }
    public List<ToDoItem> getComplete() { /* ... */ }

    public Blob exportToWordDoc() { /* ... */ }  (1)
}
1 associated using file-based layout with the notYetComplete collection.

The other two actions shown in the above screenshot — exportAsXml and downloadLayout — are actually contributed to the TodoAppDashboard through various domain services, as is the downloadLayout action.