public class CustomAction extends Object
| Modifier and Type | Field and Description |
|---|---|
String |
action
The action key which will be used to trigger the action (e.g. promote),
will be triggered by a URL like so: /user/aaronz/promote
|
Class<?>[] |
methodArgTypes
These are the argument types found in the custom action method in order,
this should not be populated manually as any value in this will be overwritten
|
String |
methodName
This will be non-null if there is a custom action method which was found or identified
by the annotation
EntityCustomAction or if the developer has defined this
explicitly |
String |
viewKey
(optional) Must match one of the VIEW constants from
EntityViewThe view type which this action goes with, this roughly translates to the GET/POST/PUT/DELETE in http e.g. |
| Constructor and Description |
|---|
CustomAction(String action,
String viewKey)
Construct a custom action for entities
|
CustomAction(String action,
String viewKey,
String methodName)
Adds the methodName arg,
use this version when using this with
ActionsDefineable |
| Modifier and Type | Method and Description |
|---|---|
CustomAction |
copy() |
static CustomAction |
copy(CustomAction ca) |
Method |
getMethod()
INTERNAL USE ONLY
|
void |
setMethod(Method m)
INTERNAL USE ONLY
|
String |
toString() |
public final String action
public final String viewKey
EntityViewEntityView.VIEW_LIST
while POST /user/aaronz/action would be EntityView.VIEW_NEW,
can be null to match all viewkeys (i.e. to allow this action
from any http method type and on collections and entities)public final String methodName
EntityCustomAction or if the developer has defined this
explicitlypublic Class<?>[] methodArgTypes
public CustomAction(String action, String viewKey)
action - key which will be used to trigger the action (e.g. promote),
will be triggered by a URL like so: /user/aaronz/promote, viewKey - (optional) this is the view type which this action goes with, this
roughly translates to the GET/POST/PUT/DELETE in httpEntityView.VIEW_LIST
while POST /user/aaronz/action would be EntityView.VIEW_SHOWEntityView,
null indicates that this action can be run on entities and collections
using any http method (POST, GET)for details about what the method should return, what arguments are allowed, and what exceptions meanpublic CustomAction(String action, String viewKey, String methodName)
ActionsDefineableaction - the action keyviewKey - the view key OR nullmethodName - the name of the method in your entity provider to
execute when the custom action is requestedfor details about what the method should return, what arguments are allowed, and what exceptions mean,
for more detailspublic Method getMethod()
public void setMethod(Method m)
public CustomAction copy()
public static CustomAction copy(CustomAction ca)
ca - Copyright © 2003–2022 Sakai Project. All rights reserved.