Java Doc for ContextDepthDataWriter.java in  » Database-ORM » MMBase » org » mmbase » util » xml » applicationdata » 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 » Database ORM » MMBase » org.mmbase.util.xml.applicationdata 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.mmbase.util.xml.applicationdata.ContextDepthDataWriter

ContextDepthDataWriter
public class ContextDepthDataWriter (Code)
This class is used to write (export) a selection of nodes to xml format. The nodes to export are read from a XML context file, which specifies the startnode and depth to which to parse. The current version of this class combines a number of methods which we want to split - or at least share - with a seperate class for handling contexts. Note that because of it's static nature, no object instance need be made (in fact, none CAN be made) of this class.

since:
   MMBase-1.8
author:
   Daniel Ockeloen
author:
   Jacco de Groot
author:
   Pierre van Rooden
version:
   $Id: ContextDepthDataWriter.java,v 1.5 2007/02/25 17:56:58 nklasens Exp $




Method Summary
static  HashSet<Integer>getFilterBuilders(List<Map<String, String>> filter, TypeDef bul)
    
static  intgetRelatedNode(int nodeNumber, MMObjectNode relationNode)
     Determines the number of the node referenced by another node.
static  intgetStartNode(XMLContextDepthReader capp, MMBase mmb)
     Retrieves the number of the startnode referenced by the context configuration file..
static  voidgetSubNodes(int startnodenr, int maxdepth, HashSet<Integer> fb, HashSet<Integer> nodesdoneSet, HashSet<Integer> relationnodesSet, MMBase mmb)
     Searches the MMBase cloud, colelcting all nodes (and corresponmding relation nodes) that belong to a specific type, and which can be traced up to a certain depth of nodes to a starting node.
Parameters:
  startnodenr - the number of the node to start with
Parameters:
  maxdeoth - the maximum depth a tree is traversed.
static  booleansaveFile(String filename, String value)
     Saves a string value to a file.
static  booleansaveFile(String filename, byte[] value)
     Saves an array of byte to a file.
public static  booleanwriteContext(ApplicationReader app, XMLContextDepthReader capp, String targetpath, MMBase mmb, Logger logger)
     Writes an application's nodes, according to that application's contexts, to a path. The files written are stored in a subdirectory (named after the application), and contain the datasource (xml) files for both datanodes and relation nodes.
Parameters:
  app - A ApplicationReader initialised to read the application's description (xml) fileThis object is used to retrieve what builder and relations are needed, and in which files data should be stored.
Parameters:
  capp - A XMLContextDepthReader initialised to read the application's context fileThis object is used to retrieve information regarding search depth and starting nodes forthe search tree whoch determines what nodes are part of this application.
Parameters:
  targetpath - The path where to save the application
Parameters:
  mmb - Reference to the MMbase processormodule.
public static  booleanwriteContextXML(XMLContextDepthReader capp, String filename)
     Writes the context file, based on what was supplied by the application
Parameters:
  capp - XMLContextDepthReader providing original context data
Parameters:
  filename - Name of the xml file to save.
static  voidwriteDataSources(ApplicationReader app, HashSet<Integer> nodes, String targetpath, MMBase mmb, Logger logger)
     Writes the required datasources to their corresponding xml files by calling writeNodes()
Parameters:
  app - The ApplicationReader object, which is used to retrieve what datasources to write (and to what file).
Parameters:
  nodes - The nodes that are part of the application.
static  voidwriteNodes(ApplicationReader app, HashSet<Integer> nodes, String targetpath, MMBase mmb, Logger logger, boolean isRelation)
     Writes the nodes to their corresponding xml files
Parameters:
  app - The ApplicationReader object, which is used to retrieve what sources to write (and to what file).
Parameters:
  nodes - The nodes that are part of the application.
static  voidwriteRelationSources(ApplicationReader app, HashSet<Integer> nodes, String targetpath, MMBase mmb, Logger logger)
     Writes the required relation sources to their corresponding xml files by calling writeNodes()
Parameters:
  app - The ApplicationReader object, which is used to retrieve what relationsources to write (and to what file).
Parameters:
  nodes - The relation nodes that are part of the application.



Method Detail
getFilterBuilders
static HashSet<Integer> getFilterBuilders(List<Map<String, String>> filter, TypeDef bul)(Code)
Retrieves the builders used for filtering the nodes for this application
Parameters:
  filter - Vector containign all the buildernames that are part of this applicationNote that being part of an application does not mean that they are exported!
Parameters:
  bul - reference to the TypeDef builder, used for rertrieving builder types a HashSet, containing the types (Integer) of all builders part of this application.



getRelatedNode
static int getRelatedNode(int nodeNumber, MMObjectNode relationNode)(Code)
Determines the number of the node referenced by another node.
Parameters:
  nodeNumber - number of the referencing node
Parameters:
  relationNode - node from the relationtable containing the relation data



getStartNode
static int getStartNode(XMLContextDepthReader capp, MMBase mmb)(Code)
Retrieves the number of the startnode referenced by the context configuration file.. Returns always only one node (should be changed?)
Parameters:
  capp - XMLContextDepthReader object for retrieving data from the context
Parameters:
  mmb - reference to the MMBase object, used for retrieving aliases and builders An integer, the number of the startnode if succesful, -1 otherwise.



getSubNodes
static void getSubNodes(int startnodenr, int maxdepth, HashSet<Integer> fb, HashSet<Integer> nodesdoneSet, HashSet<Integer> relationnodesSet, MMBase mmb)(Code)
Searches the MMBase cloud, colelcting all nodes (and corresponmding relation nodes) that belong to a specific type, and which can be traced up to a certain depth of nodes to a starting node.
Parameters:
  startnodenr - the number of the node to start with
Parameters:
  maxdeoth - the maximum depth a tree is traversed. A depth of 0 or less means only the sdtartnode is added.A depth of one includes all teh nodes refernced by the startnode, etc.Relation nodes are not counted when determining 'depth'.
Parameters:
  fb - a HashSet containing the set of types that are allowed for export
Parameters:
  nodesdoneSet - A HashSet which holds all nodes that are already 'done' or 'almost done'. this set is expanded in the methodnodes already in this set are skipped (optimization). After return, the set has been expandedwith all nodes found while traversing the cloud
Parameters:
  mmb - MMBase object used to retrieve builder information



saveFile
static boolean saveFile(String filename, String value)(Code)
Saves a string value to a file.
Parameters:
  filename - Name of the file to save.
Parameters:
  value - string to store in the file True if succesfull, false if an error occurred.



saveFile
static boolean saveFile(String filename, byte[] value)(Code)
Saves an array of byte to a file.
Parameters:
  filename - Name of the file to save.
Parameters:
  value - array to stiore in the file True if succesfull, false if an error occurred.



writeContext
public static boolean writeContext(ApplicationReader app, XMLContextDepthReader capp, String targetpath, MMBase mmb, Logger logger)(Code)
Writes an application's nodes, according to that application's contexts, to a path. The files written are stored in a subdirectory (named after the application), and contain the datasource (xml) files for both datanodes and relation nodes.
Parameters:
  app - A ApplicationReader initialised to read the application's description (xml) fileThis object is used to retrieve what builder and relations are needed, and in which files data should be stored.
Parameters:
  capp - A XMLContextDepthReader initialised to read the application's context fileThis object is used to retrieve information regarding search depth and starting nodes forthe search tree whoch determines what nodes are part of this application.
Parameters:
  targetpath - The path where to save the application
Parameters:
  mmb - Reference to the MMbase processormodule. Used to retrieve the nodes to write.
Parameters:
  logger - Storage for messages which can be displayed to the user. Returns true if succesful, false if no valid depth or startnode could be foundFailure of the export itself is not detected, though may be visible in the messages returned.
throws:
  IOException - if one or more files could not be written



writeContextXML
public static boolean writeContextXML(XMLContextDepthReader capp, String filename)(Code)
Writes the context file, based on what was supplied by the application
Parameters:
  capp - XMLContextDepthReader providing original context data
Parameters:
  filename - Name of the xml file to save. always true



writeDataSources
static void writeDataSources(ApplicationReader app, HashSet<Integer> nodes, String targetpath, MMBase mmb, Logger logger)(Code)
Writes the required datasources to their corresponding xml files by calling writeNodes()
Parameters:
  app - The ApplicationReader object, which is used to retrieve what datasources to write (and to what file).
Parameters:
  nodes - The nodes that are part of the application. Those that are of a type compatible with the datasources are exported.
Parameters:
  targetpath - Path where the xml files are written
Parameters:
  mmb - MMBase object used to retrieve builder information
Parameters:
  logger - Used to store messages that can be showmn to the user



writeNodes
static void writeNodes(ApplicationReader app, HashSet<Integer> nodes, String targetpath, MMBase mmb, Logger logger, boolean isRelation)(Code)
Writes the nodes to their corresponding xml files
Parameters:
  app - The ApplicationReader object, which is used to retrieve what sources to write (and to what file).
Parameters:
  nodes - The nodes that are part of the application. Those that are of a type compatible with the sources are exported.
Parameters:
  targetpath - Path where the xml files are written
Parameters:
  mmb - MMBase object used to retrieve builder information
Parameters:
  logger - Used to store messages that can be showmn to the user
Parameters:
  isRelation - Indicates whether the nodes to write are data (false) or relation (true) nodes



writeRelationSources
static void writeRelationSources(ApplicationReader app, HashSet<Integer> nodes, String targetpath, MMBase mmb, Logger logger)(Code)
Writes the required relation sources to their corresponding xml files by calling writeNodes()
Parameters:
  app - The ApplicationReader object, which is used to retrieve what relationsources to write (and to what file).
Parameters:
  nodes - The relation nodes that are part of the application. Those that are of a type compatible with the relationsources are exported.
Parameters:
  targetpath - Path where the xml files are written
Parameters:
  mmb - MMBase object used to retrieve builder information
Parameters:
  logger - Used to store messages that can be showmn to the user



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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