@Retention(value=RUNTIME) @Target(value=METHOD) public @interface EntityCustomAction
ActionsExecutable,
this should not be placed on any methods defined by a capability but should be placed on methods
which you want to be exposed as custom actionsEntityView.VIEW_SHOW),
you can add in action and viewKey annotation params to change those settingsEntityView : the current entity view for this request (contains extension, url, segments) EntityReference : the current entity reference (prefix and optional id) String : entity prefix Search : the search object based on the incoming params OutputStream : stream to place outbound data (probably binary) into for transmission Map (String => Object) : a map of the actions parameters (params from the action request) ActionReturn (this is a special object used to indicate return states and handle binary data) EntityData (this is a special object used to wrap the object and provide meta data) EntityNotFoundException EntityNotFoundException to indicate the entity request could not find the data that was requested IllegalArgumentException to indicate that the incoming params or the request was invalid FormatUnsupportedException to indicate that the requested format is not supported for this entity request EntityException to indicate a specific entity failure occurred, can include a response code and error message SecurityException to indicate that the the current user is no allowed to perform this action UnsupportedOperationException to indicate that the current action being requested is invalid (typically indicates bad combination of viewKey and action) IllegalStateException to indicate a general failure has occurred CustomAction,
ActionsExecutable| Modifier and Type | Optional Element and Description |
|---|---|
String |
action
(optional) The action key which will be used to trigger the action (e.g. promote)
By default the name of the method is used as the action key if this is not set, trigger this action using a URL like: /direct/{prefix}/{name} |
String |
viewKey
(optional) Must match one of the VIEW constants from
EntityView,
if not set this will default to EntityView.VIEW_SHOW The view type which this action works with (i.e. allowed to trigger the action), this roughly translates to the GET/POST/PUT/DELETE in http e.g. |
public abstract String action
public abstract String viewKey
EntityView,
if not set this will default to EntityView.VIEW_SHOW EntityView.VIEW_LIST
while POST /user/aaronz/action would be EntityView.VIEW_NEW,
can be null or "" (empty string, for annotations you must use this since null is not a constant)
to match all viewkeys (i.e. to allow this action
from any http method type and on collections and entities) EntityViewCopyright © 2023. All rights reserved.