@DomainServiceLayout
Layout hints for domain services.
Also indicates the name, and menu ordering UI hints.
API
DomainServiceLayout.java
@interface DomainServiceLayout {
MenuBar menuBar() default MenuBar.NOT_SPECIFIED; (1)
String named() default ""; (2)
}
Usage Notes
Menu bars
The menuBar() element is a hint to specify where on the application menu a domain service’s actions should be rendered.
For example:
@DomainService
@DomainServiceLayout(menuBar=MenuBar.PRIMARY)
public class ToDoItems {
...
}
In the Web UI (Wicket viewer), domain services placed:
-
on the
PRIMARY
menu bar appears to the left. -
on the
SECONDARY
menu bar appear to the right: -
on the
TERTIARY
appear in the menu bar associated with the user’s name (far top-right)
The grouping of multiple domain services actions within a single drop-down is managed by the @javax.annotation.Priority
annotation.
The RestfulObjects viewer does not support this attribute. |
Names
The named() element explicitly specifies the domain service’s name, overriding the name that would normally be inferred from the Java source code.
For example:
@DomainService
@DomainServiceLayout(
named="Customers"
)
public class CustomerRepository {
...
}