lumis.doui.table
Class TableDeleteDataProcessActionHandler

Package class diagram package TableDeleteDataProcessActionHandler
java.lang.Object
  extended by lumis.doui.processaction.ProcessActionHandler<TableSource>
      extended by lumis.doui.table.BaseTableDataProcessActionHandler
          extended by lumis.doui.table.TableDeleteDataProcessActionHandler
All Implemented Interfaces:
IProcessActionHandler, IParameters
Direct Known Subclasses:
ContentTableDeleteDataProcessActionHandler, TableDeleteMultiRowDataProcessActionHandler

@StableMinor(version="6.2",
             sinceVersion="4.0")
public class TableDeleteDataProcessActionHandler
extends BaseTableDataProcessActionHandler

Handles deletion of data

Since:
4.0.0

Field Summary
protected  QueryBuilder queryBuilder
           
 
Fields inherited from class lumis.doui.processaction.ProcessActionHandler
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 Summary
TableDeleteDataProcessActionHandler()
           
 
Method Summary
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.
protected  void indexData()
          Updates search index information for modified content.
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.
 
Methods inherited from class lumis.doui.table.BaseTableDataProcessActionHandler
addToIndex, createQueryBuilder, getIndexConfig, isSearchEnabled, readSelectedData, removeFromIndex, sendRenderDataChangedNotification, shouldSendRenderDataChangedNotification
 
Methods inherited from class lumis.doui.processaction.ProcessActionHandler
addDefaultResponse, addResponseParameter, checkServiceInstancePermission, checkServiceInstancePermission, getId, getParameter, getParameter, getResource, getServiceInterfaceHyperLink, getUrl, init, localize, processHyperLinkResponse, processPopupInterfaceResponse, resolveFieldValueNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queryBuilder

protected QueryBuilder queryBuilder
Constructor Detail

TableDeleteDataProcessActionHandler

public TableDeleteDataProcessActionHandler()
Method Detail

processAction

public void processAction()
                   throws PortalException
Description copied from interface: IProcessActionHandler
Executes the process action.

This method may execute the process action based on the parameters and node specifications passed to it earlier.

Throws:
PortalException

setParameter

public void setParameter(String name,
                         Object value)
Detects if the given parameter is a primary key. If so, makes sure that the value set is an array.

Specified by:
setParameter in interface IProcessActionHandler
Specified by:
setParameter in interface IParameters
Overrides:
setParameter in class ProcessActionHandler<TableSource>

processActionWithoutResponse

protected void processActionWithoutResponse()
                                     throws PortalException
Sends pre-notifications, executes the process action followed by post-notifications.

Throws:
PortalException
Since:
4.0.11

buildQuery

protected QueryBase buildQuery()
                        throws PortalException
Builds a delete statement.

Returns:
Throws:
PortalException
Since:
4.0.11

preDelete

protected void preDelete(QueryBase queryBase)
                  throws PortalException
Hook placed in that does not perform any action.

This method exists for classes that extend this class to be able to perform actions before the deletion occurs.

Parameters:
queryBase -
Throws:
PortalException
Since:
4.0.11

deleteRelatedData

protected void deleteRelatedData(Collection<String> itemIdsTemp,
                                 Node currentSourceDefinitionNode,
                                 String foreignPrimaryKeyFieldId,
                                 ITransaction transaction)
                          throws PortalException
Deletes all data related to the given primary key ids.

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.

Parameters:
itemIdsTemp -
currentSourceDefinitionNode -
foreignPrimaryKeyFieldId -
transaction -
Throws:
PortalException
Since:
4.0.11

deleteRelatedFiles

protected void deleteRelatedFiles(Collection<String> itemIdsTemp,
                                  Node currentSourceDefinitionNode,
                                  String primaryKeyFieldId,
                                  ITransaction transaction)
                           throws PortalException
Deletes all the files that are related to the current item.

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.

Parameters:
itemIdsTemp -
currentSourceDefinitionNode -
primaryKeyFieldId -
transaction -
Throws:
PortalException
Since:
4.0.11

createTableSource

protected TableSource createTableSource(Node sourceDefinitionNode,
                                        ISourceContext sourceContext)
                                 throws PortalException
Creates a table source object.

Parameters:
sourceDefinitionNode -
sourceContext -
Returns:
Throws:
PortalException
Since:
4.0.11

sendPreNotifications

protected void sendPreNotifications()
                             throws PortalException
Sends notifications before the delete operation execution.

Throws:
PortalException
Since:
4.0.11

execute

protected void execute(QueryBase queryBase)
                throws PortalException
Executes the delete statement.

Parameters:
queryBase -
Throws:
PortalException
Since:
4.0.11

postDelete

protected void postDelete()
                   throws PortalException
Hook for inheriting classes to be able to perform actions after deletion.

Throws:
PortalException
Since:
4.0.11

indexData

protected void indexData()
                  throws PortalException
Updates search index information for modified content.

Overrides:
indexData in class BaseTableDataProcessActionHandler
Throws:
PortalException

sendPostNotifications

protected void sendPostNotifications()
                              throws PortalException
Sends post notifications to registered observers.

Throws:
PortalException
Since:
4.0.11

createRenderDataChangedEvent

protected IPortalEvent createRenderDataChangedEvent(Object itemId)
                                             throws PortalException
Description copied from class: BaseTableDataProcessActionHandler
Creates a render data changed event. Called by BaseTableDataProcessActionHandler.sendRenderDataChangedNotification(Object).

Overrides:
createRenderDataChangedEvent in class BaseTableDataProcessActionHandler
Parameters:
itemId - the itemId parameter value for the event.
Returns:
the event.
Throws:
PortalException

sendRenderDataChangedNotification

protected void sendRenderDataChangedNotification()
                                          throws PortalException
Identifies all the interfaces that may need to be updated and sends a notification.

Throws:
PortalException
Since:
4.0.11


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.