Package org.openbravo.service.datasource
Class CheckTreeOperationManager
- java.lang.Object
-
- org.openbravo.service.datasource.CheckTreeOperationManager
-
- Direct Known Subclasses:
AssetsTreeOperationManager
,MenuTreeOperationManager
,OrganizationTreeOperationManager
public abstract class CheckTreeOperationManager extends Object
Abstract class used to restrict the movements of nodes for a particular tree To check if a node movement is valid for a particular tree, this class has to be subclassed and the checkNodeMovement method must be implemented to determine whether a node movement is valid. Also this annotations must be added for the class to be used using dependency injection:@ApplicationScoped
@Qualifier("entityName"), entityName being the name of the DAL entity associated with the tree
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
CheckTreeOperationManager.ActionResponse
-
Constructor Summary
Constructors Constructor Description CheckTreeOperationManager()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract CheckTreeOperationManager.ActionResponse
checkNodeMovement(Map<String,String> parameters, String nodeId, String newParentId, String prevNodeId, String nextNodeId)
Checks if a node movement is valid
-
-
-
Method Detail
-
checkNodeMovement
public abstract CheckTreeOperationManager.ActionResponse checkNodeMovement(Map<String,String> parameters, String nodeId, String newParentId, String prevNodeId, String nextNodeId)
Checks if a node movement is valid- Parameters:
parameters
- Map of the parameters sent to the client to the datasourcenodeId
- id of the node being movednewParentId
- id of the new parent of the node (ROOT_NODE_CLIENT if the node is being moved to the root)prevNodeId
- id of the sibling node that would be placed just before the node being moved. Can be null if the node is being placed in the first position of its siblings. Irrelevant if the tree is not orderednextNodeId
- id of the sibling node that would be placed just after the node being moved. Can be null if the node is being placed in the last position of its siblings. Irrelevant if the tree is not ordered- Returns:
- an ActionResponse object. If the movement is valid, the success attribute must be true, false otherwise. The message and messageType attributes can be used to show a message in the client message bar
-
-