@StableMinor(version="12.5", sinceVersion="4.0") public abstract class ProcessActionHandler<S extends Source> extends Object implements IProcessActionHandler, IParameters
Constructor and Description |
---|
ProcessActionHandler() |
Modifier and Type | Method and Description |
---|---|
protected void |
addDefaultResponse()
Sets the default response parameters based on the node specifications.
|
void |
addResponseParameter(String name,
String value)
Adds the given name and value to the response parameters.
|
protected boolean |
checkServiceInstancePermission(String permissionId)
Returns true if the current user has the given permission.
|
protected boolean |
checkServiceInstancePermission(String userId,
String permissionId)
Returns true if the given user has the given permission.
|
boolean |
containsParameter(String name)
Returns whether a parameter is set in this parameters.
|
String |
getId()
Returns the identifier for the process action handler.
|
Object |
getParameter(String name)
Returns the parameter value.
|
<T> T |
getParameter(String name,
Class<T> expectedClass)
Returns the parameter value converted to the expected class.
|
protected IResource |
getResource()
Returns the interface resource.
|
protected IServiceInterfaceUrl |
getServiceInterfaceHyperLink(String destInterfaceId) |
protected IServiceInterfaceUrl |
getUrl(Node actionResponseNode,
String destInterfaceId) |
void |
init(Node processActionNode,
ProcessActionContainer processActionContainer)
Called by the process action container to initialize the process action.
|
protected String |
localize(String stringToLocalize)
Localizes the string based on the interface resource.
|
protected void |
processHyperLinkResponse(Node actionResponseNode,
String destInterfaceId) |
protected void |
processPopupInterfaceResponse(Node actionResponseNode,
String destInterfaceId) |
protected Object |
resolveFieldValueNode(Node fieldValueNode)
Resolves the value for a
fieldValue node. |
void |
setParameter(String name,
Object value)
All controls pass their values to a process action object via this method.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
processAction
asParameters, emptyParameters
public static final String RESPONSE_TYPE_MESSAGE
public static final String RESPONSE_TYPE_REFRESH_PARENT
public static final String RESPONSE_TYPE_CLOSE_WINDOW
public static final String RESPONSE_TYPE_RUN_JAVASCRIPT
public static final String RESPONSE_TYPE_SET_REQUEST_PARAMETERS
public static final String RESPONSE_TYPE_SET_RESPONSE_PARAMETERS
public static final String RESPONSE_TYPE_SET_REQUEST_ATTRIBUTES
public static final String RESPONSE_TYPE_REQUEST_PROCESS_ACTION_CONFIRMATION_MESSAGE
public static final String RESPONSE_TYPE_REQUEST_PROCESS_ACTION_CONFIRMATION_PROCESS_ACTION_ID
public static final String RESPONSE_TYPE_VALIDATE_PROCESS_ACTION_ON_RENDER
public static final String RESPONSE_TYPE_STANDARD_POPUP
public static final String RESPONSE_TYPE_STANDARD_EMBEDDED
public static final String RESPONSE_TYPE_STANDARD_COMMIT
public static final String RESPONSE_TYPE_HYPERLINK
public static final String RESPONSE_TYPE_POPUP_INTERFACE
public static final String RESPONSE_TYPE_PREVIEW
protected ProcessActionContainer processActionContainer
protected DouiContext douiContext
protected ITransaction transaction
protected SourceContainer sourceContainer
protected Node processActionNode
protected SessionConfig sessionConfig
protected ILocalizationManager localizationManager
protected String id
public void init(Node processActionNode, ProcessActionContainer processActionContainer) throws PortalException
IProcessActionHandler
The process action node is a copy of the node specified in the doui definition.
init
in interface IProcessActionHandler
PortalException
public void setParameter(String name, Object value)
IProcessActionHandler
The controls call this method before the processAction() method is called.
setParameter
in interface IProcessActionHandler
public String getId() throws PortalException
IProcessActionHandler
getId
in interface IProcessActionHandler
PortalException
public Object getParameter(String name)
IProcessActionHandler
getParameter
in interface IProcessActionHandler
getParameter
in interface IParameters
public boolean containsParameter(String name)
IParameters
This is useful to differ a null
value parameter from a non-existing parameter.
containsParameter
in interface IParameters
name
- the parameter name.true
if the parameter is set, false
otherwise.protected Object resolveFieldValueNode(Node fieldValueNode) throws PortalException
fieldValue
node.id
- the id of the fieldValue
node.null
if none
was found.PortalException
public <T> T getParameter(String name, Class<T> expectedClass)
IProcessActionHandler
getParameter
in interface IProcessActionHandler
T
- the expected class.name
- the parameter name.expectedClass
- the expected class.protected void addDefaultResponse() throws PortalException
Possible response types.
doui_closeWindow, RESPONSE_TYPE_CLOSE_WINDOW
: closes the current window.
doui_hyperLink, RESPONSE_TYPE_HYPERLINK
: Used to redirect the browser to another page / url after the process action. In addition parameters may be passed to the destination page.
doui_message, RESPONSE_TYPE_MESSAGE
: displays a message to the end user. This type requires a message attribute to be specified. This message will be translated to the users current language.
doui_refreshParen, RESPONSE_TYPE_REFRESH_PARENT
t: refreshes the parent window.
doui_runJavascript, RESPONSE_TYPE_RUN_JAVASCRIPT
: runs the javascript specified in the script node within the reponse.
doui_setRequestParameters, RESPONSE_TYPE_SET_REQUEST_PARAMETERS
: sets all the current parameters values to the following render request to the current interface.
doui_standardPopup, RESPONSE_TYPE_STANDARD_POPUP
: Used interfaces that are within popup windows. This internally is converted to two responses. One doui_refreshParent response followed by one doui_closeWindow response.
doui_standardEmbedded, RESPONSE_TYPE_STANDARD_EMBEDDED
: Used in interfaces that are embedded within portal pages. This is equivalent to a doui_setRequestParameters response.
doui_standardCommit, RESPONSE_TYPE_STANDARD_COMMIT
: Used in standard add and edit administration interfaces. This response detects whether the current interface is a popup or an embedded interface. If popup, this response is equivalent to a doui_refreshParent response followed by a doui_closeWindow response. If embedded, this response detects where the administration list interface is located and redirects the portal to the page that contains that interface.
doui_setResponseParameters, RESPONSE_TYPE_SET_RESPONSE_PARAMETERS
: Sets the specified parameters to the following render request to the current interface.
doui_setRequestAttributes, RESPONSE_TYPE_SET_REQUEST_ATTRIBUTES
: Used primarily to share data between different process actions. Sets parameter values in the request attributes. These attributes may be read by subsequent process actions with the same id.
PortalException
protected void processPopupInterfaceResponse(Node actionResponseNode, String destInterfaceId) throws PortalException
PortalException
protected void processHyperLinkResponse(Node actionResponseNode, String destInterfaceId) throws PortalException
PortalException
protected IServiceInterfaceUrl getUrl(Node actionResponseNode, String destInterfaceId) throws PortalException
PortalException
protected IServiceInterfaceUrl getServiceInterfaceHyperLink(String destInterfaceId) throws PortalException
PortalException
public void addResponseParameter(String name, String value) throws PortalException
name
- value
- PortalException
protected String localize(String stringToLocalize) throws PortalException
stringToLocalize
- PortalException
protected IResource getResource() throws PortalException
PortalException
protected boolean checkServiceInstancePermission(String permissionId) throws PortalException
permissionId
- PortalException
protected boolean checkServiceInstancePermission(String userId, String permissionId) throws PortalException
userId
- permissionId
- PortalException
LumisXP 12.5.0.200928 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.