| com.flexive.shared.interfaces.TreeEngine
All known Subclasses: com.flexive.ejb.beans.TreeEngineBean,
TreeEngine | public interface TreeEngine (Code) | | Tree Interface
author: Gregor Schober (gregor.schober@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at) |
Method Summary | |
void | activate(FxTreeMode mode, long nodeId, boolean includeChildren) | void | clear(FxTreeMode mode) | long | copy(FxTreeMode mode, long source, long destination, int destinationPosition) Copies a node to the specified parent and the specified position. | long[] | createNodes(FxTreeMode mode, long parentNodeId, int position, String path) Create a tree folders of the given path relative to the parent node, creating all folders
stored in path if they dont exist (similar to
java.io.File.mkdirs ).
Parameters: mode - operate on live or edit tree? Parameters: parentNodeId - the parent node to create the path from Parameters: position - desired position (will be applied to all "folders" hence in most cases only min or max valuesmake sense) Parameters: path - the path to be created, e.g. | boolean | exist(FxTreeMode mode, long id) Returns true if a node with the specified id exists. | FxTreeNode | findChild(FxTreeMode mode, long nodeId, String name) Find a (direct) child with the given name under the node nodeId .
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: nodeId - the parent node ID Parameters: name - name of the requested node @return the tree node the selected node. | FxTreeNode | findChild(FxTreeMode mode, long nodeId, long referenceId) Find a (direct) child with the given reference ID under the node nodeId .
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: nodeId - the parent node ID Parameters: referenceId - the reference ID the selected node. | FxTreeNode | findChild(FxTreeMode mode, long nodeId, FxPK pk) Find a (direct) child with the given PK under the node nodeId .
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: nodeId - the parent node ID Parameters: pk - the reference the selected node. | FxTreeNode | findChild(FxTreeMode mode, long nodeId, FxReference reference) Find a (direct) child with the given reference under the node nodeId .
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: nodeId - the parent node ID Parameters: reference - the reference the selected node. | long | getIdByFQNPath(FxTreeMode mode, long startNode, String path) Returns the node id specified by a FQN path thats starts from the given node.
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: startNode - the root node. Parameters: path - the path - eg '/nodeA/nodeB', the virtual root '/Root' node must not be included,and the path has to start with a '/'. | long | getIdByLabelPath(FxTreeMode mode, long startNode, String path) Returns the node id specified by a label path thats starts from the given node.
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: startNode - the root node. Parameters: path - the path - eg '/nodeA/nodeB', the virtual root '/Root' node must not be included,and the path has to start with a '/'. | long | getIdByPath(FxTreeMode mode, String path) Returns the node id specified by a path.
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: path - the path - eg '/nodeA/nodeB', the virtual root '/Root' node must not be included,and the path has to start with a '/'. | long[] | getIdChain(FxTreeMode mode, long nodeId) Returns all ids from the given node up to the root. | List<String> | getLabels(FxTreeMode mode, long... ids) Returns a list of paths made up of Caption's for the given id's.
If there is no caption propery found in the instance, the FQN will be used.
The root node will be excluded. | List<String> | getLabels(FxTreeMode mode, FxLanguage lang, long... ids) Returns a list of paths made up of Caption's for the given id's. | FxTreeNode | getNode(FxTreeMode mode, long id) | List<FxTreeNode> | getNodesWithReference(FxTreeMode mode, long reference) Returns all nodes that match the given reference. | String | getPathById(FxTreeMode mode, long nodeId) Returns the path for a specified id. | List<String> | getPaths(FxTreeMode mode, long... ids) Returns a list of paths made up of FQN's for the given id's
The root node will be excluded. | long[] | getReverseIdChain(FxTreeMode mode, long id) Returns all ids from the root up to the given node. | String[] | getTemplates(FxTreeMode mode, long id) Returns all the templates to use for this node ordered by relevance. | FxTreeNode | getTree(FxTreeMode mode, long nodeId, int depth) Retrieves a (sub)tree, starting from the given node. | void | move(FxTreeMode mode, long nodeId, long destinationId, int newPosition) Moves a node to the specified parent and the specified position. | void | populate(FxTreeMode mode) | void | remove(FxTreeNode node, boolean removeReferencedContent, boolean removeChildren) Remove a node and optionally its children. | long | save(FxTreeNodeEdit node) | void | setTemplate(FxTreeMode mode, long nodeId, String template) Sets the template of the node. |
activate | void activate(FxTreeMode mode, long nodeId, boolean includeChildren) throws FxApplicationException(Code) | | Activates a node - copying it from the "Edit" to the "Live" tree
Parameters: mode - tree mode (currently onld Edit supported) Parameters: nodeId - the node to activate Parameters: includeChildren - if true all children of the node are activated as well throws: FxApplicationException - on errors |
copy | long copy(FxTreeMode mode, long source, long destination, int destinationPosition) throws FxApplicationException(Code) | | Copies a node to the specified parent and the specified position.
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: source - the parent id of the structure to copy Parameters: destination - the destination node Parameters: destinationPosition - the position in the destination node's children @return the (root-)id the copy the id of the new node (the "copy") throws: FxApplicationException - on errors |
createNodes | long[] createNodes(FxTreeMode mode, long parentNodeId, int position, String path) throws FxApplicationException(Code) | | Create a tree folders of the given path relative to the parent node, creating all folders
stored in path if they dont exist (similar to
java.io.File.mkdirs ).
Parameters: mode - operate on live or edit tree? Parameters: parentNodeId - the parent node to create the path from Parameters: position - desired position (will be applied to all "folders" hence in most cases only min or max valuesmake sense) Parameters: path - the path to be created, e.g. "/my/virtual/folder" the node id's of the created path throws: FxApplicationException - on errors |
findChild | FxTreeNode findChild(FxTreeMode mode, long nodeId, String name) throws FxApplicationException(Code) | | Find a (direct) child with the given name under the node nodeId .
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: nodeId - the parent node ID Parameters: name - name of the requested node @return the tree node the selected node. If no node was found, a runtime exception is thrown. throws: FxApplicationException - on errors |
findChild | FxTreeNode findChild(FxTreeMode mode, long nodeId, long referenceId) throws FxApplicationException(Code) | | Find a (direct) child with the given reference ID under the node nodeId .
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: nodeId - the parent node ID Parameters: referenceId - the reference ID the selected node. If no node was found, a runtime exception is thrown. throws: FxApplicationException - on errors |
findChild | FxTreeNode findChild(FxTreeMode mode, long nodeId, FxPK pk) throws FxApplicationException(Code) | | Find a (direct) child with the given PK under the node nodeId .
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: nodeId - the parent node ID Parameters: pk - the reference the selected node. If no node was found, a runtime exception is thrown. throws: FxApplicationException - on errors |
findChild | FxTreeNode findChild(FxTreeMode mode, long nodeId, FxReference reference) throws FxApplicationException(Code) | | Find a (direct) child with the given reference under the node nodeId .
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: nodeId - the parent node ID Parameters: reference - the reference the selected node. If no node was found, a runtime exception is thrown. throws: FxApplicationException - on errors |
getIdByFQNPath | long getIdByFQNPath(FxTreeMode mode, long startNode, String path) throws FxApplicationException(Code) | | Returns the node id specified by a FQN path thats starts from the given node.
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: startNode - the root node. Parameters: path - the path - eg '/nodeA/nodeB', the virtual root '/Root' node must not be included,and the path has to start with a '/'. the node id, or -1 if the path does not exist throws: FxApplicationException - on errors |
getIdByLabelPath | long getIdByLabelPath(FxTreeMode mode, long startNode, String path) throws FxApplicationException(Code) | | Returns the node id specified by a label path thats starts from the given node.
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: startNode - the root node. Parameters: path - the path - eg '/nodeA/nodeB', the virtual root '/Root' node must not be included,and the path has to start with a '/'. the node id, or -1 if the path does not exist throws: FxApplicationException - on errors |
getIdByPath | long getIdByPath(FxTreeMode mode, String path) throws FxApplicationException(Code) | | Returns the node id specified by a path.
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: path - the path - eg '/nodeA/nodeB', the virtual root '/Root' node must not be included,and the path has to start with a '/'. the node id, or -1 if the path does not exist throws: FxApplicationException - on errors |
getIdChain | long[] getIdChain(FxTreeMode mode, long nodeId) throws FxApplicationException(Code) | | Returns all ids from the given node up to the root.
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: nodeId - the id to start with the id chain, or null if the node does not exist throws: FxApplicationException - on errors |
getLabels | List<String> getLabels(FxTreeMode mode, long... ids) throws FxApplicationException(Code) | | Returns a list of paths made up of Caption's for the given id's.
If there is no caption propery found in the instance, the FQN will be used.
The root node will be excluded. The language is the calling users preferred language.
Example: input ids = [12,4]
Result: ["/DescriptionForNode1/DescriptionForNode12","/DescriptionForNode1/DescriptionForNode4"]
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: ids - the id's of the nodes to get the path to the root node for a list with all paths made up of Caption's throws: FxApplicationException - on errors |
getLabels | List<String> getLabels(FxTreeMode mode, FxLanguage lang, long... ids) throws FxApplicationException(Code) | | Returns a list of paths made up of Caption's for the given id's.
If there is no caption propery found in the instance, the FQN will be used.
The root node will be excluded.
Example: input ids = [12,4]
Result: ["/DescriptionForNode1/DescriptionForNode12","/DescriptionForNode1/DescriptionForNode4"]
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: lang - desired result language Parameters: ids - the id's of the nodes to get the path to the root node for a list with all paths made up of Caption's throws: FxApplicationException - on errors |
getPaths | List<String> getPaths(FxTreeMode mode, long... ids) throws FxApplicationException(Code) | | Returns a list of paths made up of FQN's for the given id's
The root node will be excluded.
Example: input id's = [12,4]
Result: ["/Node1/Node12","/Node1/Node4"]
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: ids - the id's of the nodes to get the path to the root node for a list with all paths made up of FQN's throws: FxApplicationException - on errors |
getReverseIdChain | long[] getReverseIdChain(FxTreeMode mode, long id)(Code) | | Returns all ids from the root up to the given node.
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: id - the id to start with the id chain, or null if the node does not exist |
getTemplates | String[] getTemplates(FxTreeMode mode, long id)(Code) | | Returns all the templates to use for this node ordered by relevance.
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: id - the id to get the templates for the templates, or null if the node does not exist |
getTree | FxTreeNode getTree(FxTreeMode mode, long nodeId, int depth) throws FxApplicationException(Code) | | Retrieves a (sub)tree, starting from the given node.
Loading a tree with all data takes a lot of time hence the position of the nodes is not initialized and
the labels are only loaded in the language set as default for the calling user.
Incase the position or (detailed) label is needed the node can be reloaded using getNode()
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: nodeId - the nod to start from Parameters: depth - the maximum depth to read the (sub)tree throws: FxApplicationException - on errors |
move | void move(FxTreeMode mode, long nodeId, long destinationId, int newPosition) throws FxApplicationException(Code) | | Moves a node to the specified parent and the specified position.
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: nodeId - the node to move Parameters: destinationId - the new parent Parameters: newPosition - the new position in the new parents children throws: FxApplicationException - on errors |
remove | void remove(FxTreeNode node, boolean removeReferencedContent, boolean removeChildren) throws FxApplicationException(Code) | | Remove a node and optionally its children.
Referenced content content will only be removed if removedReferencedContent is set to true and the referenced
content is not referenced elsewhere.
The only exception is if the referenced content is of type FOLDER, then the folder is removed if it is not referenced
from anywhere else.
Parameters: node - the node to removed Parameters: removeReferencedContent - remove referenced content Parameters: removeChildren - remove children as well? throws: FxApplicationException - on errors |
setTemplate | void setTemplate(FxTreeMode mode, long nodeId, String template)(Code) | | Sets the template of the node.
Parameters: mode - tree mode to use (Live or Edit tree) Parameters: nodeId - the node id Parameters: template - the tamplate, or null for no template |
|
|