Skip to content

Class JSX

hxs edited this page Dec 1, 2019 · 19 revisions

JSX

Package jsx
File JSX.java

JSX is the principal class to manage the XML file.


Constructs

JSX()

This is a simple construct.

Example:

JSX jsx = new JSX();

JSX(String filePath)

throws JSXLockException

This construct set the file path of XML document to be load.

Parameters:

  • filePath, path to XML file

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");

JSX(Document document)

This construct set the XML document to work on.

Parameters:

  • document, XML document. Class org.w3c.dom.Document

Example:

Document doc = JSX.createDocument("path/to/file.xml");
JSX jsx = new JSX(doc);

Methods

Static

Document createDocument(String pathFile)

throws XMLException

This method write a log.

Return:
Return an object org.w3c.dom.Document that rapresents the XML file.

Parameters:

  • pathFile, path to XML file

Exceptions:

  • XMLException, exception thrown the document creation return a error.

Example:

Document doc = JSX.createDocument("path/to/file.xml");

Document createDocument(String pathFile, boolean validating, boolean namespaceAware, boolean featValidation, boolean featNamespaces, boolean featLoadDTDGramm, boolean featLoadExtDTD)

throws XMLException

This method write a log.

Return:
Return an object org.w3c.dom.Document that rapresents the XML file.

Parameters:

  • pathFile, path to XML file
  • validating, activate validating
  • namespaceAware, activate namespace aware
  • featValidation, activate feature validation
  • featNamespaces, activate feature namespaces
  • featLoadDTDGramm, activate feature load DTD gramm
  • featLoadExtDTD, activate feature load ext DTD

Exceptions:

  • XMLException, exception thrown the document creation return a error.

Example:

Document doc = JSX.createDocument("path/to/file.xml", false, false, false, false, false, false);

int getGreatId(Set<String> idSet)

throws XMLException

This method get the great Integer id.

Return:
Return the great Integer id

Parameters:

  • idSet, set of id

Example:

JSX jsx = new JSX("path/to/file.xml");
HashMap<String, Node> mapElement = jsx.getMapIdElement("my-element");
Set<String> idSet = mapElement.keySet();
int greatId = Jogger.getGreatId(idSet);

void removeBlankLines(Document document)

throws JSXException

This method remove the blank lines on XML document.

Parameters:

  • document, XML document. Class org.w3c.dom.Document

Exceptions:

  • JSXException, exception thrown if the operation return a error.

Example:

Document doc = JSX.createDocument("path/to/file.xml");
JSX.removeBlankLines(doc);

Get and Set

String getFilePath()

This method get the path of XML file.

Default null

Return:
Return the path of XML file.

Example:

JSX jsx = new JSX("path/to/file.xml");
String path = jsx.getFilePath();

void setFilePath(String filePath)

This method set the path of XML file.

Parameters:

  • filePath, path of XML file

Example:

JSX jsx = new JSX();
jsx.setFilePath("path/to/file.xml");

Document getDocument()

This method get the XML document.

Default null

Return:
Return the XML document. Class org.w3c.dom.Document

Example:

JSX jsx = new JSX("path/to/file.xml");
String path = jsx.getFilePath();

void setDocument(Document document)

This method set the the XML document.

Parameters:

  • document, XML document. Class org.w3c.dom.Document

Example:

JSX jsx = new JSX();
Document doc = JSX.getDocument("path/to/file.xml");
jsx.setDocument(doc);

boolean isLock()

This method check if the JSX-Lock is active. Read JSX-Lock.

Default false

Return:
Return true if JSX-Lock is active, false otherwise.

Example:

JSX jsx = new JSX("path/to/file.xml");
if (jsx.isLock()) {
  //your code
}

void setLock(boolean lock)

This method can enable or disable JSX-Lock.
Read JSX-Lock.

Parameters:

  • lock, true for active it, false otherwise

Example:

JSX jsx = new JSX("path/to/file.xml");
jsx.setLock(true);

int getIndentAmount()

This method get the number of sapces for the indent.

Default 4

Return:
Return the number of sapces for the indent.

Example:

JSX jogger = new JSX("path/to/file.xml");
int indAmnt = jsx.getIndentAmount();

void setIndentAmount(int indentAmount)

This method set the number of sapces for the indent.

Parameters:

  • indentAmount, number of sapces for the indent

Example:

JSX jsx = new JSX("path/to/file.xml");
jsx.setIndentAmount(8);

boolean isAutoFlush()

This method check if the autoflush is active.

Default false

Return:
Return true if autoflush is active, false otherwise.

Example:

JSX jsx = new JSX("path/to/file.xml");
if (jsx.isAutoFlush()) {
  //your code
}

void setAutoFlush(boolean autoFlush)

This method can enable or disable autoflush.

Parameters:

  • autoFlush, true for active it, false otherwise

Example:

JSX jsx = new JSX("path/to/file.xml");
jsx.setAutoFlush(true);

boolean isValidating()

This method check if the validating is active. For javax.xml.parsers.DocumentBuilderFactory object.

Default false

Return:
Return true if the validating is active, false otherwise.

Example:

JSX jogger = new JSX("path/to/file.xml");
if (jsx.isValidating()) {
  //your code
}

void setValidating(boolean validating)

This method can enable or disable the validation of XML file.
It passed at setValidating(validating) method of javax.xml.parsers.DocumentBuilderFactory object.

Parameters:

  • validating, true for active it, false otherwise

Example:

JSX jsx = new JSX("path/to/file.xml");
jsx.setValidating(true);

boolean isNamespaceAware()

This method check if the namespace aware is active. For javax.xml.parsers.DocumentBuilderFactory object.

Default false

Return:
Return true if namespace aware is active, false otherwise.

Example:

JSX jogger = new JSX("path/to/file.xml");
if (jsx.isNamespaceAware()) {
  //your code
}

void setNamespaceAware(boolean namespaceAware)

This method can enable or disable the namespace aware.
It passed at setNamespaceAware(namespaceAware) method of javax.xml.parsers.DocumentBuilderFactory object.

Parameters:

  • namespaceAware, true for active it, false otherwise

Example:

JSX jsx = new JSX("path/to/file.xml");
jsx.setNamespaceAware(true);

boolean isFeatValidation()

This method check if the feature validation is active. For javax.xml.parsers.DocumentBuilderFactory object.

Default false

Return:
Return true if the feature validation is active, false otherwise.

Example:

JSX jsx = new JSX("path/to/file.xml");
if (jsx.isFeatValidation()) {
  //your code
}

void setFeatValidation(boolean featValidation)

This method can enable or disable the feature validation.
Feature http://xml.org/sax/features/validation used for javax.xml.parsers.DocumentBuilderFactory object.

Parameters:

  • featValidation, true for active it, false otherwise

Example:

JSX jsx = new JSX("path/to/file.xml");
jsx.setFeatValidation(true);

boolean isFeatNamespaces()

This method check if the feature namespaces is active.

Default false

Return:
Return true if feature namespaces is active, false otherwise.

Example:

JSX jogger = new JSX("path/to/file.xml");
if (jsx.isFeatNamespaces()) {
  //your code
}

void setFeatNamespaces(boolean featNamespaces)

This method can enable or disable the feature namespaces.
Feature http://xml.org/sax/features/namespaces used for javax.xml.parsers.DocumentBuilderFactory object.

Parameters:

  • featNamespaces, true for active it, false otherwise

Example:

JSX jsx = new JSX("path/to/file.xml");
jsx.setFeatNamespaces(true);

boolean isFeatLoadDTDGramm()

This method check if the feature load DTD gramm is active.

Default false

Return:
Return true if the feature load DTD gramm is active, false otherwise.

Example:

JSX jsx = new JSX("path/to/file.xml");
if (jsx.isFeatLoadDTDGramm()) {
  //your code
}

void setFeatLoadDTDGramm(boolean featLoadDTDGramm)

This method can enable or disable the feature load DTD gramm.
Feature http://apache.org/xml/features/nonvalidating/load-dtd-grammar used for javax.xml.parsers.DocumentBuilderFactory object.

Parameters:

  • featLoadDTDGramm, true for active it, false otherwise

Example:

JSX jsx = new JSX("path/to/file.xml");
jsx.setFeatLoadDTDGramm(true);

boolean isFeatLoadExtDTD()

This method check if the feature load ext DTD is active.

Default false

Return:
Return true if the feature load ext DTD is active, false otherwise.

Example:

JSX jsx = new JSX("path/to/file.xml");
if (jsx.isFeatLoadExtDTD()) {
  //your code
}

void setFeatLoadExtDTD(boolean featLoadExtDTD)

This method can enable or disable the feature load ext DTD.
Feature http://apache.org/xml/features/nonvalidating/load-external-dtd used for javax.xml.parsers.DocumentBuilderFactory object.

Parameters:

  • validating, true for active it, false otherwise

Example:

JSX jsx = new JSX("path/to/file.xml");
jsx.setFeatLoadExtDTD(true);

boolean isPrettyOutput()

This method check if the prettyOutput is active.

Default true

Return:
Return true if the pretty output is active, false otherwise.

Example:

JSX jsx = new JSX("path/to/file.xml");
if (jsx.isPrettyOutput()) {
  //your code
}

void setPrettyOutput(boolean prettyOutput)

This method can enable or disable the prettyOutput.

Parameters:

  • prettyOutput, true for active it, false otherwise

Example:

JSX jsx = new JSX("path/to/file.xml");
jsx.setPrettyOutput(false);

ReentrantLock getReentrantLock()

This method get the reentrant lock used for XML file.

Return:
Return the java.util.concurrent.locks.ReentrantLock object used for the lock.

Example:

JSX jsx = new JSX("path/to/file.xml");
if (jsx.getReentrantLock().tryLock()) {
  // your code
}

Writer

void addElement(String nameElement)

throws JSXLockException

This method add a element on document. When the operation is finished, the autoflush is performed.
Implement JSX-Lock. For more info JSX-Lock.

Parameters:

  • nameElement, name of element to be added

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
jsx.addElement("new-element");

void addElement(String nameElement, String textContent)

throws JSXLockException

This method add a element with text on document. When the operation is finished, the autoflush is performed.
Implement JSX-Lock. For more info JSX-Lock.

Parameters:

  • nameElement, name of element to be added
  • textContent, text body of the the new element

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
jsx.addElement("jsx", "Awesome!!!");

void addElement(String nameElement, Map<String, String> attributesMap)

throws JSXLockException

This method add a element with attributes on document. When the operation is finished, the autoflush is performed.
Implement JSX-Lock. For more info JSX-Lock.

Parameters:

  • nameElement, name of element to be added
  • attributesMap, map of attributes

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
HashMap<String, String> attrMap = new HashMap<String, String>();
attrMap.put("attribute", "value");
jsx.addElement("new-element", attrMap);

void addElementWithId(String nameElement, String idElement)

throws JSXLockException

This method add a element with the id attribute on document. When the operation is finished, the autoflush is performed.
Implement JSX-Lock. For more info JSX-Lock.

Parameters:

  • nameElement, name of element to be added
  • idElement, id for element

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
jsx.addElementWithId("new-element", "jsx-element");

void addElementWithChild(String nameElement, String idElement, Map<String, String> mapChildNode)

throws JSXLockException

This method add a element with the id attribute and child elements on document. When the operation is finished, the autoflush is performed.
Implement JSX-Lock. For more info JSX-Lock.

Parameters:

  • nameElement, name of element to be added
  • idElement, id for element
  • mapChildNode, map of child node for new element. The key is the name of child element, the value is the text body

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
HashMap<String, String> childs = new HashMap<String, String>();
childs.put("jsx", "cool");
jsx.addElementWithChild("new-element", "jsx-element", childs);

void addElementWithChild(String nameElement, Map<String, String> attributesMap, Map<String, String> mapChildNode)

throws JSXLockException

This method add a element with attributes and child elements on document. When the operation is finished, the autoflush is performed.
Implement JSX-Lock. For more info JSX-Lock.

Parameters:

  • nameElement, name of element to be added
  • attributesMap, map of attributes
  • mapChildNode, map of child node for new element. The key is the name of child element, the value is the text body

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
HashMap<String, String> attrMap = new HashMap<String, String>();
HashMap<String, String> childs = new HashMap<String, String>();
attrMap.put("attr", "val");
childs.put("jsx", "cool");
jsx.addElementWithChild("new-element", attrMap, childs);

void addElementWithChild(String nameElement, String idElement, Map<String, String> mapChildNode, Map<String, String> mapIdChild)

throws JSXLockException

This method add a element with the id attribute and child elements with id on document. When the operation is finished, the autoflush is performed.
Implement JSX-Lock. For more info JSX-Lock.

Parameters:

  • nameElement, name of element to be added
  • idElement, id for element
  • mapChildNode, map of child node for new element. The key is name of child element, the value is the text body
  • mapIdChild, map of id for child. The key is the name of child element, the value is the id

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
HashMap<String, String> childs = new HashMap<String, String>();
HashMap<String, String> idChilds = new HashMap<String, String>();
childs.put("jsx", "cool");
idChilds.put("jsx", "jsx-id");
jsx.addElementWithChild("new-element", "jsx-element", childs, idChilds);

void addElementWithChild(String nameElement, Map<String, String> attributesMap, Map<String, String> mapChildNode, Map<String, Map<String, String>> attributesMapChild)

throws JSXLockException

This method add a element and child elements, with attributes, on document. When the operation is finished, the autoflush is performed.
Implement JSX-Lock. For more info JSX-Lock.

Parameters:

  • nameElement, name of element to be added
  • attributesMap, map of attributes
  • mapChildNode, map of child node for new element. The key is name of child element, the value is the text body
  • attributesMapChild, bidimensional map for attributes of childs. The key is name of child element, the value is the map with the attributes

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
HashMap<String, String> attrMap = new HashMap<String, String>();
HashMap<String, String> childs = new HashMap<String, String>();
HashMap<String, HashMap<String, String>> attrChildsMap = new HashMap<String, HashMap<String, String>>();
HashMap<String, String> attr = new HashMap<String, String>();
attrMap.put("attr-element", "val");
childs.put("jsx", "cool");
attr.put("attr-child", "val");
attrChildsMap.put("jsx", attr);
jsx.addElementWithChild("new-element", attrMap, childs, attrChildsMap);

void appendElement(Node parentNode, String nameElement, String textContext)

throws JSXLockException

This method append new element on parent node. When the operation is finished, the autoflush is performed.
Implement JSX-Lock. For more info JSX-Lock.

Parameters:

  • parentNode, parent to node to be append the new element. Class org.w3c.dom.Node
  • nameElement, name of element to be added
  • textContent, text body of the the new element

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
Node node = jsx.getElementById("element", "jsx");
jsx.appendElement(node, "time", "420");

void appendElement(Node parentNode, String nameElement, String idElement, String textContext)

throws JSXLockException

This method append new element on parent node. When the operation is finished, the autoflush is performed.
Implement JSX-Lock. For more info JSX-Lock.

Parameters:

  • parentNode, parent to node to be append the new element. Class org.w3c.dom.Node
  • nameElement, name of element to be added
  • idElement, id for element
  • textContent, text body of the the new element

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
Node node = jsx.getElementById("element", "jsx");
jsx.appendElement(node, "time", "time-element", "420");

void appendElement(Node parentNode, String nameElement, Map<String, String> attributesMap, String textContext)

throws JSXLockException

This method append new element on parent node. When the operation is finished, the autoflush is performed.
Implement JSX-Lock. For more info JSX-Lock.

Parameters:

  • parentNode, parent to node to be append the new element. Class org.w3c.dom.Node
  • nameElement, name of element to be added
  • attributesMap, map of attributes
  • textContent, text body of the the new element

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
HashMap<String, String> attrMap = new HashMap<String, String>();
Node node = jsx.getElementById("element", "jsx");
attrMap.put("need", "beer");
jsx.appendElement(node, "new-element", attrMap, "YEEEEEAAAAAHHHH!!!");

void appendElementWithChild(Node parentNode, String nameElement, Map<String, String> mapChildNode)

throws JSXLockException

This method append new element on parent node. When the operation is finished, the autoflush is performed.
Implement JSX-Lock. For more info JSX-Lock.

Parameters:

  • parentNode, parent to node to be append the new element. Class org.w3c.dom.Node
  • nameElement, name of element to be added
  • mapChildNode, map of child node for new element. The key is name of child element, the value is the text body

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
HashMap<String, String> childs = new HashMap<String, String>();
Node node = jsx.getElementById("element", "jsx");
childs.put("time", "hacking");
jsx.appendElement(node, "new-element", childs);

void deleteNode(String nameElement, String id)

throws JSXLockException

This method delete an element with name and id specified. When the operation is finished, the autoflush is performed.
Implement JSX-Lock. For more info JSX-Lock.

Parameters:

  • nameElement, name of element to be delete
  • id, id of element to be delete

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
jsx.deleteNode("element", "id-element");

void deleteNode(Node node)

throws JSXLockException

This method delete the node passed. When the operation is finished, the autoflush is performed.
Implement JSX-Lock. For more info JSX-Lock.

Parameters:

  • node, node to be delete. Class org.w3c.dom.Node

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
Node node = jsx.getElementById("element", "id-element");
jsx.deleteNode(node);

void removeBlankLines()

throws JSXLockException

This method remove the blankLines from XML document.
Implement JSX-Lock. For more info JSX-Lock.

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
jsx.removeBlankLines();

Reader

List<Node> getNodeList(String nameElements)

throws JSXLockException

This method get a list of node elements.

Return:
Return a list of node elements with the name specified.

Parameters:

  • nameElements, name of elements to be get

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
ArrayList<Node> nodeList = jsx.getNodeList("cool");

Map<String, Node> getIdNodeMap(String nameElements)

throws JSXLockException

This method get a map of node elements.

Return:
Return a map of node elements with the name specified. The map key is the id of element.

Parameters:

  • nameElements, name of elements to be get

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
HashMap<String, Node> nodeMap = jsx.getIdNodeMap("cool");

Node getNodeById(String nameElement, String idElement)

throws JSXLockException

This method get a node.

Return:
Return a node with the name and id specified.

Parameters:

  • nameElements, name of elements to be get
  • idElement, id of element to be get

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
Node node = jsx.getNodeById("cool", "jsx");

List<Node> getChildNodeList(Node parentNode)

throws JSXLockException

This method get a list of child nodes.

Return:
Return a child node list of the node specified

Parameters:

  • parentNode, parent node to be get the childs. Class org.w3c.dom.Node

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
Node node = jsx.getNodeById("cool", "jsx");
ArrayList<Node> nodeList = jsx.getChildNodeList(node);

List<Node> getChildNodeList(Node parentNode, String nameElements)

throws JSXLockException

This method get a list of child nodes with the name specified.

Return:
Return a child node list with the name specified,

Parameters:

  • parentNode, parent node to be get the childs. Class org.w3c.dom.Node
  • nameElements, name of child elements to be get

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
Node node = jsx.getNodeById("cool", "jsx");
ArrayList<Node> nodeList = jsx.getChildNodeList(node, "child");

Node getChildNodeById(Node parentNode, String nameElements, String idElement)

throws JSXLockException

This method get a child node.

Return:
Return a child node with the name and id specified.

Parameters:

  • parentNode, parent node to be get the childs. Class org.w3c.dom.Node
  • nameElements, name of child elements to be get
  • idElement, id of element to be get

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
Node node = jsx.getNodeById("cool", "jsx");
Node childNode = jsx.getChildNodeById(node, "child", "id-child");

Map<String, Node> getIdChildNodeMap(Node parentNode, String nameElement)

throws JSXLockException

This method get a map of child nodes.

Return:
Return a map of child node elements with the name specified. The map key is the id of element.

Parameters:

  • parentNode, parent node to be get the childs. Class org.w3c.dom.Node
  • nameElements, name of child elements to be get

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
Node node = jsx.getNodeById("cool", "jsx");
HashMap<String, Node> nodeMap = jsx.getIdNodeMap(node, "child");

Lock

boolean tryLock()

throws JSXLockException

This method is used to implement JSX-Lock.
It check if JSX-Lock is enable, then in this case try to lock the document using the class java.util.concurrent.locks.ReentrantLock. For more info JSX-Lock.

Return:
Return true if JSX-Lock is disable or successfully locked, false otherwise.

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
if (jsx.tryLock()) {
  //your code
  jsx.tryUnlock();
}

void tryUnlock()

This method is used to implement JSX-Lock.
It check if JSX-Lock is enable, then in this case unlock the document using the class java.util.concurrent.locks.ReentrantLock. For more info JSX-Lock.

Example:

JSX jsx = new JSX("path/to/file.xml");
if (jsx.tryLock()) {
  //your code
  jsx.tryUnlock();
}

Others

void flush()

throws JSXLockException

This method save the XML document on the filePath setted, and reload it. If prettyOutput is active, then it remove blank lines and indent the XML code. The indentation is performed only if the indentAmount is greater than 0.
Implement JSX-Lock. For more info JSX-Lock.

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
jsx.flush();

void autoflush()

throws JSXLockException

This method check if autoflush is active, then if it is enable call flush() method.
Implement JSX-Lock. For more info JSX-Lock.

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
jsx.autoflush();

void loadDocument()

throws JSXLockException

This method load the XML document from filePath setted.
Implement JSX-Lock. For more info JSX-Lock.

Exceptions:

  • JSXLockException, exception thrown if JSX-Lock failed

Example:

JSX jsx = new JSX("path/to/file.xml");
jsx.loadDocument();

Clone this wiki locally