Package com.simplicite.util
Class TreeViewModule
- java.lang.Object
-
- com.simplicite.util.TreeViewModule
-
public class TreeViewModule extends java.lang.Object
TreeView of module
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MODULE_TREE_NAME
-
Constructor Summary
Constructors Constructor Description TreeViewModule()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.json.JSONObject
exportModule(Grant g, java.lang.String module)
Full module tree with inlined documentsstatic org.json.JSONObject
exportModule(Grant g, java.lang.String module, java.io.File cfgDir, java.io.File docDir, boolean verbose, boolean withIds, boolean exploded)
Full module treestatic TreeView
getModuleTreeView()
Get the module tree definitionstatic org.json.JSONObject
mergeModule(Grant g, java.lang.String module, org.json.JSONObject remote, boolean onlyDiff)
Compare with a module tree scanstatic org.json.JSONObject
mergeModule(Grant g, org.json.JSONObject local, org.json.JSONObject remote, boolean onlyDiff)
Compare with a module tree scanstatic void
sortRepository(FlowXML xml)
Reorder objects to respect Repository dependencies and to group data per objectstatic void
sortRepository(org.json.JSONArray list)
Reorder objects list to respect Repository dependenciesstatic org.json.JSONObject
toJSONObject(java.lang.String module, java.io.File zip, boolean inline)
Convert ZIP .json to JSON objectstatic FlowXML
toXML(java.lang.String module, java.io.File dir)
Convert exploded .json to ordered XML flowstatic FlowXML
toXML(org.json.JSONObject module)
Convert the tree to XML to importstatic FlowXML
toXML(org.json.JSONObject module, FlowXML xml)
Convert the tree to XML to importstatic void
toXML(org.json.JSONObject module, java.io.OutputStream out)
Convert the tree to XML to importstatic boolean
useFullTree()
-
-
-
Field Detail
-
MODULE_TREE_NAME
public static final java.lang.String MODULE_TREE_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
useFullTree
public static boolean useFullTree()
-
getModuleTreeView
public static TreeView getModuleTreeView()
Get the module tree definition- Returns:
- Tree
-
exportModule
public static org.json.JSONObject exportModule(Grant g, java.lang.String module) throws java.io.IOException
Full module tree with inlined documents- Parameters:
g
- Grant adminmodule
- module name- Returns:
- JSON repository without local Ids
- Throws:
java.io.IOException
-
exportModule
public static org.json.JSONObject exportModule(Grant g, java.lang.String module, java.io.File cfgDir, java.io.File docDir, boolean verbose, boolean withIds, boolean exploded) throws java.io.IOException
Full module tree- Parameters:
g
- Grant adminmodule
- module namecfgDir
- Optional directory to serialize the hierarchydocDir
- Optional directory to serialize the attached documents (default todocDir
)verbose
- with node Ids and count?withIds
- with item Ids?exploded
- Exploded JSON in dir?- Returns:
- JSON repository
- Throws:
java.io.IOException
-
mergeModule
public static org.json.JSONObject mergeModule(Grant g, java.lang.String module, org.json.JSONObject remote, boolean onlyDiff) throws java.io.IOException
Compare with a module tree scan- Parameters:
g
- Grant adminmodule
- Module nameremote
- Optional JSON to compareonlyDiff
- do not return equals data/branches- Returns:
- JSON difference with the json content
- Throws:
java.io.IOException
-
mergeModule
public static org.json.JSONObject mergeModule(Grant g, org.json.JSONObject local, org.json.JSONObject remote, boolean onlyDiff) throws java.io.IOException
Compare with a module tree scan- Parameters:
g
- Grant adminlocal
- Json Moduleremote
- Optional JSON to compareonlyDiff
- do not return equals data/branches- Returns:
- JSON difference with the json content
- Throws:
java.io.IOException
-
toXML
public static FlowXML toXML(org.json.JSONObject module) throws java.io.IOException
Convert the tree to XML to import- Parameters:
module
- Tree- Returns:
- XML
- Throws:
java.io.IOException
-
toXML
public static void toXML(org.json.JSONObject module, java.io.OutputStream out) throws java.io.IOException
Convert the tree to XML to import- Parameters:
module
- Treeout
- Output stream- Throws:
java.io.IOException
-
toXML
public static FlowXML toXML(org.json.JSONObject module, FlowXML xml) throws java.io.IOException
Convert the tree to XML to import- Parameters:
module
-xml
- optional flow to use- Returns:
- XML
- Throws:
java.io.IOException
-
toXML
public static FlowXML toXML(java.lang.String module, java.io.File dir)
Convert exploded .json to ordered XML flow- Parameters:
module
- Module namedir
- exploded directory- Returns:
- XML flow
-
toJSONObject
public static org.json.JSONObject toJSONObject(java.lang.String module, java.io.File zip, boolean inline) throws org.json.JSONException, java.io.IOException
Convert ZIP .json to JSON object- Parameters:
module
- Module namezip
- Directory of filesinline
- inline documents or keep the relative paths?- Returns:
- JSON object with root module
- Throws:
org.json.JSONException
java.io.IOException
-
sortRepository
public static void sortRepository(org.json.JSONArray list)
Reorder objects list to respect Repository dependencies- Parameters:
list
- List of objects
-
sortRepository
public static void sortRepository(FlowXML xml)
Reorder objects to respect Repository dependencies and to group data per object- Parameters:
xml
- Unordered XML flow to sort
-
-