Class CustomAction
- java.lang.Object
-
- org.sakaiproject.entitybroker.entityprovider.extension.CustomAction
-
public class CustomAction extends Object
This defines a custom entity action, this will be used to define which custom actions are allowed to be performed on entities or collections of entities- Author:
- Aaron Zeckoski (azeckoski @ gmail.com)
-
-
Field Summary
Fields Modifier and Type Field Description StringactionThe action key which will be used to trigger the action (e.g. promote), will be triggered by a URL like so: /user/aaronz/promoteClass<?>[]methodArgTypesThese 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 overwrittenStringmethodNameThis will be non-null if there is a custom action method which was found or identified by the annotationEntityCustomActionor if the developer has defined this explicitlyStringviewKey(optional) Must match one of the VIEW constants fromEntityView
The view type which this action goes with, this roughly translates to the GET/POST/PUT/DELETE in http
e.g.
-
Constructor Summary
Constructors Constructor Description CustomAction(String action, String viewKey)Construct a custom action for entitiesCustomAction(String action, String viewKey, String methodName)Adds the methodName arg, use this version when using this withActionsDefineable
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CustomActioncopy()static CustomActioncopy(CustomAction ca)MethodgetMethod()INTERNAL USE ONLYvoidsetMethod(Method m)INTERNAL USE ONLYStringtoString()
-
-
-
Field Detail
-
action
public final 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
-
viewKey
public final String viewKey
(optional) Must match one of the VIEW constants fromEntityView
The view type which this action goes with, this roughly translates to the GET/POST/PUT/DELETE in http
e.g. GET /user/action would beEntityView.VIEW_LISTwhile POST /user/aaronz/action would beEntityView.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)
-
methodName
public final String methodName
This will be non-null if there is a custom action method which was found or identified by the annotationEntityCustomActionor if the developer has defined this explicitly
-
methodArgTypes
public 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
-
-
Constructor Detail
-
CustomAction
public CustomAction(String action, String viewKey)
Construct a custom action for entities- Parameters:
action- key which will be used to trigger the action (e.g. promote), will be triggered by a URL like so: /user/aaronz/promote,
this cannot be null or empty stringviewKey- (optional) this is the view type which this action goes with, this roughly translates to the GET/POST/PUT/DELETE in http
e.g. GET /user/action would beEntityView.VIEW_LISTwhile POST /user/aaronz/action would beEntityView.VIEW_SHOW
this must match one of the VIEW constants fromEntityView, null indicates that this action can be run on entities and collections using any http method (POST, GET)- See Also:
for details about what the method should return, what arguments are allowed, and what exceptions mean
-
CustomAction
public CustomAction(String action, String viewKey, String methodName)
Adds the methodName arg, use this version when using this withActionsDefineable- Parameters:
action- the action keyviewKey- the view key OR nullmethodName- the name of the method in your entity provider to execute when the custom action is requested- See Also:
for details about what the method should return, what arguments are allowed, and what exceptions mean,for more details
-
-
Method Detail
-
getMethod
public Method getMethod()
INTERNAL USE ONLY
-
setMethod
public void setMethod(Method m)
INTERNAL USE ONLY
-
copy
public CustomAction copy()
- Returns:
- a copy of this object
-
copy
public static CustomAction copy(CustomAction ca)
- Parameters:
ca-- Returns:
- a copy of the supplied object
-
-