Java Doc for TreeStorage.java in  » J2EE » fleXive » com » flexive » core » storage » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » fleXive » com.flexive.core.storage 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.flexive.core.storage.TreeStorage

All known Subclasses:   com.flexive.core.storage.genericSQL.GenericTreeStorage,
TreeStorage
public interface TreeStorage (Code)
Tree storage interface. The tree used is an enhanced nested set model tree based on the article found at http://dev.mysql.com/tech-resources/articles/hierarchical-data.html enhanced by using spacing for performance, and adds the parent and depth columns to even more simplify queries. Nested Set Models are optimized for read/query operations, but slow on update/move/create operations. This implementation uses "spacing" between nodes to minimize slow operations - only when a level runs out of "space" a reorganization on a part of the tree is performed (this can take quite a few seconds, dependong on the amount of affected nodes), otherwise the update operation will be almost as fast as when using a standard Adjacency List Model (pure id<->parent based) tree. Since count(*) can be very slow the total childcount of every node is stored within its row.
author:
   Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
author:
   Gregor Schober (gregor.schober@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)


Field Summary
final public static  longROOT_NODE
    


Method Summary
 voidactivateAll(Connection con, FxTreeMode mode)
    
 voidactivateNode(Connection con, SequencerEngine seq, ContentEngine ce, FxTreeMode mode, long nodeId)
    
 voidactivateSubtree(Connection con, SequencerEngine seq, ContentEngine ce, FxTreeMode mode, long nodeId)
    
 voidcheckTreeIfEnabled(Connection con, FxTreeMode mode)
    
 voidclearTree(Connection con, ContentEngine ce, FxTreeMode mode)
    
 voidcontentRemoved(Connection con, long contentId, boolean liveVersionRemovedOnly)
    
 longcopy(Connection con, SequencerEngine seq, FxTreeMode mode, long srcNodeId, long dstParentNodeId, int dstPosition, boolean deepReferenceCopy, String copyOfPrefix)
    
 longcreateNode(Connection con, SequencerEngine seq, ContentEngine ce, FxTreeMode mode, long nodeId, long parentNodeId, String name, FxString label, int position, FxPK reference, String template)
    
 long[]createNodes(Connection con, SequencerEngine seq, ContentEngine ce, FxTreeMode mode, long parentNodeId, String path, int position)
    
 booleanexists(Connection con, FxTreeMode mode, long id)
    
 longgetIdByFQNPath(Connection con, FxTreeMode mode, long startNode, String path)
    
 longgetIdByLabelPath(Connection con, FxTreeMode mode, long startNode, String path)
    
 long[]getIdChain(Connection con, FxTreeMode mode, long nodeId)
     Returns all ids from the given node up to the root.
 List<String>getLabels(Connection con, FxTreeMode mode, long labelPropertyId, FxLanguage language, boolean stripNodeInfos, long... nodeIds)
     Returns a list of paths made up of Caption's for the given id's.
 FxTreeNodegetNode(Connection con, FxTreeMode mode, long nodeId)
    
 List<FxTreeNode>getNodesWithReference(Connection con, FxTreeMode mode, long referenceId)
    
 StringgetPathById(Connection con, FxTreeMode mode, long id)
     Returns the path for a specified id.
 FxTreeNodegetTree(Connection con, ContentEngine ce, FxTreeMode mode, long nodeId, int depth, boolean loadPartial, FxLanguage partialLoadLanguage)
     Load a (sub)tree.
 FxTreeNodeInfogetTreeNodeInfo(Connection con, FxTreeMode mode, long nodeId)
    
 voidmove(Connection con, SequencerEngine seq, FxTreeMode mode, long nodeId, long newParentId, int newPosition)
     Moves a node to the specified parent and the specified position.
 voidpopulate(Connection con, SequencerEngine seq, ContentEngine ce, FxTreeMode mode)
     Populate the tree with test data.
 voidremoveNode(Connection con, FxTreeMode mode, ContentEngine ce, long nodeId, boolean removeChildren)
    
 voidsetTemplate(Connection con, FxTreeMode mode, long nodeId, String template)
     Sets the template of the node.
 voidsyncFQNName(Connection con, long referenceId, boolean maxVersion, boolean liveVersion, String name)
    
 voidupdateName(Connection con, FxTreeMode mode, ContentEngine ce, long nodeId, String name)
     Update the name of a tree node.

Field Detail
ROOT_NODE
final public static long ROOT_NODE(Code)





Method Detail
activateAll
void activateAll(Connection con, FxTreeMode mode) throws FxTreeException(Code)
Activate all nodes in a tree
Parameters:
  con - an open and valid connection
Parameters:
  mode - tree mode
throws:
  com.flexive.shared.exceptions.FxTreeException - on errors



activateNode
void activateNode(Connection con, SequencerEngine seq, ContentEngine ce, FxTreeMode mode, long nodeId) throws FxApplicationException(Code)
Activate a single node (and all its parents if necessary)
Parameters:
  con - an open and valid connections
Parameters:
  seq - reference to the sequencer
Parameters:
  ce - reference to the content engine
Parameters:
  mode - tree mode
Parameters:
  nodeId - id of the node to activate
throws:
  FxApplicationException - on errors



activateSubtree
void activateSubtree(Connection con, SequencerEngine seq, ContentEngine ce, FxTreeMode mode, long nodeId) throws FxApplicationException(Code)
Activate a node, its subtree and its parents up to the root node
Parameters:
  con - an open and valid connection
Parameters:
  seq - reference to the sequencer
Parameters:
  ce - reference to the content engine
Parameters:
  mode - tree mode
Parameters:
  nodeId - node id
throws:
  FxApplicationException - on errors



checkTreeIfEnabled
void checkTreeIfEnabled(Connection con, FxTreeMode mode) throws FxApplicationException(Code)
Perform a complete check on the given tree if checks are enabled
Parameters:
  con - an open and valid connection
Parameters:
  mode - the tree to check
throws:
  com.flexive.shared.exceptions.FxApplicationException - on errors



clearTree
void clearTree(Connection con, ContentEngine ce, FxTreeMode mode) throws FxApplicationException(Code)
Removes all tree entries and creates new root nodes
Parameters:
  con - an open and valid Connection
Parameters:
  ce - ContentEngine reference to create a new folder
Parameters:
  mode - the tree to operate on
throws:
  FxApplicationException - on errors



contentRemoved
void contentRemoved(Connection con, long contentId, boolean liveVersionRemovedOnly) throws FxApplicationException(Code)
Callback when a content is removed to replace it with a folder or remove the node(s)
Parameters:
  con - an open and valid connection
Parameters:
  contentId - referenced content id
Parameters:
  liveVersionRemovedOnly - if just the live version was removed (other versions have no impact) @throws FxApplicationException on errors
throws:
  FxApplicationException - on errors



copy
long copy(Connection con, SequencerEngine seq, FxTreeMode mode, long srcNodeId, long dstParentNodeId, int dstPosition, boolean deepReferenceCopy, String copyOfPrefix) throws FxApplicationException(Code)
Copy a node and all its children to a new parent node
Parameters:
  con - an open and valid connection
Parameters:
  seq - reference to the sequencer
Parameters:
  mode - tree mode
Parameters:
  srcNodeId - source node id
Parameters:
  dstParentNodeId - destination parent node id
Parameters:
  dstPosition - destination position
Parameters:
  deepReferenceCopy - perform a deep reference copy, cloning all references
Parameters:
  copyOfPrefix - prefix to set for FQN if deep reference copy is performed id of the copied (new) tree node
throws:
  com.flexive.shared.exceptions.FxApplicationException - on errors



createNode
long createNode(Connection con, SequencerEngine seq, ContentEngine ce, FxTreeMode mode, long nodeId, long parentNodeId, String name, FxString label, int position, FxPK reference, String template) throws FxApplicationException(Code)
Create a new node
Parameters:
  con - an open and valid Connection
Parameters:
  seq - reference to the sequencer
Parameters:
  ce - reference to the content engine
Parameters:
  mode - tree mode
Parameters:
  nodeId - use this id unless it is < 0 then generate a new one
Parameters:
  parentNodeId - id of the parent node
Parameters:
  name - name (will only be used if no FQN property is available in the reference)
Parameters:
  label - label for Caption property (only used if new reference is created)
Parameters:
  position - position
Parameters:
  reference - referenced content id
Parameters:
  template - optional template to assign @return id of the created node id of the node created
throws:
  FxApplicationException - on errors



createNodes
long[] createNodes(Connection con, SequencerEngine seq, ContentEngine ce, FxTreeMode mode, long parentNodeId, String path, int position) throws FxApplicationException(Code)
Create a set of nodes and attach new Folder instances to them
Parameters:
  con - an open and valid connection
Parameters:
  seq - reference to the sequencer
Parameters:
  ce - reference to the content engine
Parameters:
  mode - tree mode
Parameters:
  parentNodeId - id of the parent node
Parameters:
  path - the path to create (separated by "/")
Parameters:
  position - position within each fqn array of the id's
throws:
  FxApplicationException - on errors



exists
boolean exists(Connection con, FxTreeMode mode, long id) throws FxApplicationException(Code)
Check if a node with the requested id exists
Parameters:
  con - an open and valid Connection
Parameters:
  mode - tree mode
Parameters:
  id - node id to check if a node with the requested id exists
throws:
  FxApplicationException - on errors



getIdByFQNPath
long getIdByFQNPath(Connection con, FxTreeMode mode, long startNode, String path) throws FxApplicationException(Code)
Get the id of rightmost node in a path described by the nodes FQNs
Parameters:
  con - an open and valid connection
Parameters:
  mode - tree mode
Parameters:
  startNode - the start node id
Parameters:
  path - requested path consisting of FQNs id of the rightmost node in the path
throws:
  FxApplicationException - on errors



getIdByLabelPath
long getIdByLabelPath(Connection con, FxTreeMode mode, long startNode, String path) throws FxApplicationException(Code)
Get the id of rightmost node in a path described by the nodes Labels/Captions
Parameters:
  con - an open and valid connection
Parameters:
  mode - tree mode
Parameters:
  startNode - the start node id
Parameters:
  path - requested path consisting of Labels/Captions id of the rightmost node in the path
throws:
  FxApplicationException - on errors



getIdChain
long[] getIdChain(Connection con, FxTreeMode mode, long nodeId) throws FxApplicationException(Code)
Returns all ids from the given node up to the root.
Parameters:
  con - an open and valid connection
Parameters:
  mode - tree mode
Parameters:
  nodeId - the node id to start with all ids from the given node up to the root or null if the node was not found
throws:
  FxApplicationException - on errors



getLabels
List<String> getLabels(Connection con, FxTreeMode mode, long labelPropertyId, FxLanguage language, boolean stripNodeInfos, long... nodeIds) 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:
  con - an open and valid connection
Parameters:
  mode - tree mode to use (Live or Edit tree)
Parameters:
  labelPropertyId - propertyId of the label
Parameters:
  language - desired result language
Parameters:
  stripNodeInfos - remove node specific meta information in result
Parameters:
  nodeIds - 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




getNode
FxTreeNode getNode(Connection con, FxTreeMode mode, long nodeId) throws FxApplicationException(Code)
Load a single node (without and childnodes!)
Parameters:
  con - an open and valid connection
Parameters:
  mode - tree mode
Parameters:
  nodeId - node id node without any preloaded or chained children
throws:
  FxApplicationException - on errors



getNodesWithReference
List<FxTreeNode> getNodesWithReference(Connection con, FxTreeMode mode, long referenceId) throws FxApplicationException(Code)
Get a list of all nodes that are referencing a requested content id
Parameters:
  con - an open and valid connection
Parameters:
  mode - tree mode
Parameters:
  referenceId - the referenced content id list of all nodes that are referencing a requested content id
throws:
  com.flexive.shared.exceptions.FxApplicationException - on errors



getPathById
String getPathById(Connection con, FxTreeMode mode, long id) throws FxApplicationException(Code)
Returns the path for a specified id.
Parameters:
  con - an open and valid connection
Parameters:
  mode - tree mode
Parameters:
  id - the id to get the path for the path for the requested id
throws:
  FxApplicationException - on errors



getTree
FxTreeNode getTree(Connection con, ContentEngine ce, FxTreeMode mode, long nodeId, int depth, boolean loadPartial, FxLanguage partialLoadLanguage) throws FxApplicationException(Code)
Load a (sub)tree. Loading a tree with all data takes a lot of time! If loadPartial is set to true the position and path of the nodes is not initialized and the labels are only loaded in the language requested with partialLoadLanguage. Incase the position, path or (detailed) label is needed the node can be reloaded using getNode()
Parameters:
  con - an open and valid connection
Parameters:
  ce - reference to ContentEngine
Parameters:
  mode - tree mode
Parameters:
  nodeId - start node id
Parameters:
  depth - depth to load
Parameters:
  loadPartial - load all data?
Parameters:
  partialLoadLanguage - language to load for labels if not loading fully start node with preloaded and chained children
throws:
  FxApplicationException - on errors



getTreeNodeInfo
FxTreeNodeInfo getTreeNodeInfo(Connection con, FxTreeMode mode, long nodeId) throws FxApplicationException(Code)
Get various information about a tree node
Parameters:
  con - an open and valid connection
Parameters:
  mode - Live or Edit mode
Parameters:
  nodeId - id of the node to examine FxTreeNodeInfo
throws:
  FxApplicationException - on errors



move
void move(Connection con, SequencerEngine seq, FxTreeMode mode, long nodeId, long newParentId, int newPosition) throws FxApplicationException(Code)
Moves a node to the specified parent and the specified position.
Parameters:
  con - an open and valid connection
Parameters:
  seq - reference to the sequencer
Parameters:
  mode - tree mode
Parameters:
  nodeId - the node to move
Parameters:
  newParentId - the new parent
Parameters:
  newPosition - the new position in the new parents children, 0 based
throws:
  FxApplicationException - on errors



populate
void populate(Connection con, SequencerEngine seq, ContentEngine ce, FxTreeMode mode) throws FxApplicationException(Code)
Populate the tree with test data. This function takes quite some time to complete
Parameters:
  con - an open and valid connection
Parameters:
  seq - reference to the sequencer
Parameters:
  ce - reference to the content engine
Parameters:
  mode - tree mode
throws:
  FxApplicationException - on errors



removeNode
void removeNode(Connection con, FxTreeMode mode, ContentEngine ce, long nodeId, boolean removeChildren) throws FxApplicationException(Code)
Remove a node
Parameters:
  con - an open and valid connection
Parameters:
  mode - tree mode
Parameters:
  ce - reference to the content engine
Parameters:
  nodeId - the node to remove
Parameters:
  removeChildren - if true all nodes that are inside the subtree of the given node aredeleted as well, if false the subtree is moved one level up (to the parent of the specifiednode)
throws:
  FxApplicationException - on errors



setTemplate
void setTemplate(Connection con, FxTreeMode mode, long nodeId, String template) throws FxApplicationException(Code)
Sets the template of the node.
Parameters:
  con - an open and valid connection
Parameters:
  mode - tree mode
Parameters:
  nodeId - the node id
Parameters:
  template - the tamplate, or null for no template
throws:
  FxApplicationException - on errors



syncFQNName
void syncFQNName(Connection con, long referenceId, boolean maxVersion, boolean liveVersion, String name) throws FxApplicationException(Code)
Callback from the ContentEngine (actually the HierarchicalStorage implementation) if aFQN property has changed to reflect changes back into the tree
Parameters:
  con - an open and valid connection
Parameters:
  referenceId - id of the referenced content
Parameters:
  maxVersion - change affects the max version?
Parameters:
  liveVersion - change affects the live version
Parameters:
  name - the new name
throws:
  FxApplicationException - on errors



updateName
void updateName(Connection con, FxTreeMode mode, ContentEngine ce, long nodeId, String name) throws FxApplicationException(Code)
Update the name of a tree node. Will update the FQN of the referenced content as well if assigned.
Parameters:
  con - an open and valid connection
Parameters:
  mode - tree mode
Parameters:
  ce - reference to the content engine
Parameters:
  nodeId - node id to update
Parameters:
  name - new name
throws:
  FxApplicationException - on errors



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.