@StableMinor(version="10.1", sinceVersion="8.0") public class TableDeleteDataProcessActionHandler extends BaseTableDataProcessActionHandler implements IDocumentation
Modifier and Type | Field and Description |
---|---|
protected QueryBuilder |
queryBuilder |
douiContext, id, localizationManager, parameters, processActionContainer, processActionNode, RESPONSE_TYPE_CLOSE_WINDOW, RESPONSE_TYPE_HYPERLINK, RESPONSE_TYPE_MESSAGE, RESPONSE_TYPE_POPUP_INTERFACE, RESPONSE_TYPE_PREVIEW, RESPONSE_TYPE_REFRESH_PARENT, RESPONSE_TYPE_REQUEST_PROCESS_ACTION_CONFIRMATION_MESSAGE, RESPONSE_TYPE_REQUEST_PROCESS_ACTION_CONFIRMATION_PROCESS_ACTION_ID, RESPONSE_TYPE_RUN_JAVASCRIPT, RESPONSE_TYPE_SET_REQUEST_ATTRIBUTES, RESPONSE_TYPE_SET_REQUEST_PARAMETERS, RESPONSE_TYPE_SET_RESPONSE_PARAMETERS, RESPONSE_TYPE_STANDARD_COMMIT, RESPONSE_TYPE_STANDARD_EMBEDDED, RESPONSE_TYPE_STANDARD_POPUP, RESPONSE_TYPE_VALIDATE_PROCESS_ACTION_ON_RENDER, sessionConfig, source, sourceContainer, transaction
Constructor and Description |
---|
TableDeleteDataProcessActionHandler() |
Modifier and Type | Method and Description |
---|---|
protected QueryBase |
buildQuery()
Builds a delete statement.
|
protected IPortalEvent |
createRenderDataChangedEvent(Object itemId)
Creates a render data changed event.
|
protected TableSource |
createTableSource(Node sourceDefinitionNode,
ISourceContext sourceContext)
Creates a table source object.
|
protected void |
deleteRelatedData(Collection<String> itemIdsTemp,
Node currentSourceDefinitionNode,
String foreignPrimaryKeyFieldId,
ITransaction transaction)
Deletes all data related to the given primary key ids.
|
protected void |
deleteRelatedFiles(Collection<String> itemIdsTemp,
Node currentSourceDefinitionNode,
String primaryKeyFieldId,
ITransaction transaction)
Deletes all the files that are related to the current item.
|
protected void |
execute(QueryBase queryBase)
Executes the delete statement.
|
String |
getDescription()
Returns an HTML description.
|
String |
getName()
Returns the name of the current object that will be displayed for documentation.
|
protected void |
postDelete()
Hook for inheriting classes to be able to perform actions after deletion.
|
protected void |
preDelete(QueryBase queryBase)
Hook placed in that does not perform any action.
|
void |
processAction()
Executes the process action.
|
protected void |
processActionWithoutResponse()
Sends pre-notifications, executes the process action followed by post-notifications.
|
protected void |
sendPostNotifications()
Sends post notifications to registered observers.
|
protected void |
sendPreNotifications()
Sends notifications before the delete operation execution.
|
protected void |
sendRenderDataChangedNotification()
Identifies all the interfaces that may need to be updated and sends a notification.
|
void |
setParameter(String name,
Object value)
Detects if the given parameter is a primary key.
|
createQueryBuilder, getIndexConfig, indexData, isSearchEnabled, readSelectedData, sendRenderDataChangedNotification, shouldSendRenderDataChangedNotification
addDefaultResponse, addResponseParameter, checkServiceInstancePermission, checkServiceInstancePermission, getId, getParameter, getParameter, getResource, getServiceInterfaceHyperLink, getUrl, init, localize, processHyperLinkResponse, processPopupInterfaceResponse, resolveFieldValueNode
protected QueryBuilder queryBuilder
public void processAction() throws PortalException
IProcessActionHandler
This method may execute the process action based on the parameters and node specifications passed to it earlier.
processAction
in interface IProcessActionHandler
PortalException
public void setParameter(String name, Object value)
setParameter
in interface IProcessActionHandler
setParameter
in interface IParameters
setParameter
in class ProcessActionHandler<TableSource>
protected void processActionWithoutResponse() throws PortalException
PortalException
protected QueryBase buildQuery() throws PortalException
PortalException
protected void preDelete(QueryBase queryBase) throws PortalException
This method exists for classes that extend this class to be able to perform actions before the deletion occurs.
queryBase
- PortalException
protected void deleteRelatedData(Collection<String> itemIdsTemp, Node currentSourceDefinitionNode, String foreignPrimaryKeyFieldId, ITransaction transaction) throws PortalException
This method looks up all the relations of the data being deleted. If any of them have the attribute cascadeOnDelete set to true, the related source data is automatically deleted.
itemIdsTemp
- currentSourceDefinitionNode
- foreignPrimaryKeyFieldId
- transaction
- PortalException
protected void deleteRelatedFiles(Collection<String> itemIdsTemp, Node currentSourceDefinitionNode, String primaryKeyFieldId, ITransaction transaction) throws PortalException
Detects if the douidefinition has any file data types. If so, this method retrieves the file id and calls the FileManager to delete the appropriate file.
itemIdsTemp
- currentSourceDefinitionNode
- primaryKeyFieldId
- transaction
- PortalException
protected TableSource createTableSource(Node sourceDefinitionNode, ISourceContext sourceContext) throws PortalException
sourceDefinitionNode
- sourceContext
- PortalException
protected void sendPreNotifications() throws PortalException
PortalException
protected void execute(QueryBase queryBase) throws PortalException
queryBase
- PortalException
protected void postDelete() throws PortalException
PortalException
protected void sendPostNotifications() throws PortalException
PortalException
protected IPortalEvent createRenderDataChangedEvent(Object itemId) throws PortalException
BaseTableDataProcessActionHandler
BaseTableDataProcessActionHandler.sendRenderDataChangedNotification(Object)
.createRenderDataChangedEvent
in class BaseTableDataProcessActionHandler
itemId
- the itemId parameter value for the event.PortalException
protected void sendRenderDataChangedNotification() throws PortalException
PortalException
public String getName()
IDocumentation
getName
in interface IDocumentation
public String getDescription()
IDocumentation
getDescription
in interface IDocumentation
Lumisportal 10.1.2.170428 - Copyright © 2006–2017 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.