You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by Dan Haywood <da...@haywood-associates.co.uk> on 2013/10/10 23:59:00 UTC
ISIS-554: reworking dashboard into a @HomePage annotation
Folks,
Further to last week's work on this ticket, have developed it a little
further.
Instead of a @Dashboard service, we indicate that precisely (at most) one
domain service action is the @HomePage action. This can return any object,
eg a view model representing a dashboard, or a simple list, or may even
accept arguments (in which case an action prompt will be automatically
displayed).
For example, in the todo quickstart app, we still see a dashboard; except
it's now a view model:
@Hidden
public class ToDoAppDashboardService extends AbstractService {
...
@ActionSemantics(Of.SAFE)
@HomePage
public ToDoAppDashboard lookup() {
return newViewModelInstance(ToDoAppDashboard.class, ID);
}
}
public class ToDoAppDashboard extends AbstractViewModel {
@Named("By Category")
@Render(Type.EAGERLY)
public List<ToDoItemsByCategoryViewModel> getAnalysisByCategory() { ...
}
@Named("By Date Range")
@Render(Type.EAGERLY)
public List<ToDoItemsByDateRangeViewModel> getAnalysisByDateRange() {
... }
}
Cheers
Dan