/** * Called by {@link #exportNode(String, String, Node)} to recursively * call {@link #exportNode(String, String, Node)} for each child node. * Does nothing if this exporter is not recursive. * * @param node parent node * @throws RepositoryException if a repository error occurs * @throws SAXException if a SAX error occurs */ protected void exportNodes(Node node) throws RepositoryException, SAXException { if (recurse && !share) { NodeIterator iterator = node.getNodes(); while (iterator.hasNext()) { Node child = iterator.nextNode(); exportNode(child); } } }
/** * Called by {@link #exportNode(String, String, Node)} to recursively * call {@link #exportNode(String, String, Node)} for each child node. * Does nothing if this exporter is not recursive. * * @param node parent node * @throws RepositoryException if a repository error occurs * @throws SAXException if a SAX error occurs */ protected void exportNodes(Node node) throws RepositoryException, SAXException { if (recurse && !share) { NodeIterator iterator = node.getNodes(); while (iterator.hasNext()) { Node child = iterator.nextNode(); exportNode(child); } } }
/** * Called by {@link #exportNode(String, String, Node)} to recursively * call {@link #exportNode(String, String, Node)} for each child node. * Does nothing if this exporter is not recursive. * * @param node parent node * @throws RepositoryException if a repository error occurs * @throws SAXException if a SAX error occurs */ protected void exportNodes(Node node) throws RepositoryException, SAXException { if (recurse && !share) { NodeIterator iterator = node.getNodes(); while (iterator.hasNext()) { Node child = iterator.nextNode(); exportNode(child); } } }
/** * Utility method for exporting the given node. Parses the node name * (or <code>jcr:root</code> if given the root node) and calls * {@link #exportNode(String, String, Node)} with the resolved namespace * URI and the local part of the name. * * @param node node * @throws RepositoryException if a repository error occurs * @throws SAXException if a SAX error occurs */ private void exportNode(Node node) throws RepositoryException, SAXException { share = node.isNodeType(helper.getJcrName("mix:shareable")) && !shareables.add(node.getUUID()); if (node.getDepth() == 0) { exportNode(NamespaceHelper.JCR, "root", node); } else { String name = node.getName(); int colon = name.indexOf(':'); if (colon == -1) { exportNode("", name, node); } else { String uri = session.getNamespaceURI(name.substring(0, colon)); exportNode(uri, name.substring(colon + 1), node); } } }
/** * Utility method for exporting the given node. Parses the node name * (or <code>jcr:root</code> if given the root node) and calls * {@link #exportNode(String, String, Node)} with the resolved namespace * URI and the local part of the name. * * @param node node * @throws RepositoryException if a repository error occurs * @throws SAXException if a SAX error occurs */ private void exportNode(Node node) throws RepositoryException, SAXException { share = node.isNodeType(helper.getJcrName("mix:shareable")) && !shareables.add(node.getUUID()); if (node.getDepth() == 0) { exportNode(NamespaceHelper.JCR, "root", node); } else { String name = node.getName(); int colon = name.indexOf(':'); if (colon == -1) { exportNode("", name, node); } else { String uri = session.getNamespaceURI(name.substring(0, colon)); exportNode(uri, name.substring(colon + 1), node); } } }
/** * Exports the given node by preparing the export and calling the * abstract {@link #exportNode(String, String, Node)} method to give * control of the export format to a subclass. * <p> * This method should be called only once for an exporter instance. * * @param node node to be exported * @throws SAXException if a SAX error occurs * @throws RepositoryException if a repository error occurs */ public void export(Node node) throws RepositoryException, SAXException { handler.startDocument(); String[] prefixes = session.getNamespacePrefixes(); for (int i = 0; i < prefixes.length; i++) { if (prefixes[i].length() > 0 && !prefixes[i].equals("xml") ) { addNamespace(prefixes[i], session.getNamespaceURI(prefixes[i])); } } exportNode(node); handler.endDocument(); }
/** * Exports the given node by preparing the export and calling the * abstract {@link #exportNode(String, String, Node)} method to give * control of the export format to a subclass. * <p> * This method should be called only once for an exporter instance. * * @param node node to be exported * @throws SAXException if a SAX error occurs * @throws RepositoryException if a repository error occurs */ public void export(Node node) throws RepositoryException, SAXException { handler.startDocument(); String[] prefixes = session.getNamespacePrefixes(); for (int i = 0; i < prefixes.length; i++) { if (prefixes[i].length() > 0 && !prefixes[i].equals("xml") ) { addNamespace(prefixes[i], session.getNamespaceURI(prefixes[i])); } } exportNode(node); handler.endDocument(); }
/** * Utility method for exporting the given node. Parses the node name * (or <code>jcr:root</code> if given the root node) and calls * {@link #exportNode(String, String, Node)} with the resolved namespace * URI and the local part of the name. * * @param node node * @throws RepositoryException if a repository error occurs * @throws SAXException if a SAX error occurs */ private void exportNode(Node node) throws RepositoryException, SAXException { share = node.isNodeType(helper.getJcrName("mix:shareable")) && !shareables.add(node.getUUID()); if (node.getDepth() == 0) { exportNode(NamespaceHelper.JCR, "root", node); } else { String name = node.getName(); int colon = name.indexOf(':'); if (colon == -1) { exportNode("", name, node); } else { String uri = session.getNamespaceURI(name.substring(0, colon)); exportNode(uri, name.substring(colon + 1), node); } } }
/** * Exports the given node by preparing the export and calling the * abstract {@link #exportNode(String, String, Node)} method to give * control of the export format to a subclass. * <p> * This method should be called only once for an exporter instance. * * @param node node to be exported * @throws SAXException if a SAX error occurs * @throws RepositoryException if a repository error occurs */ public void export(Node node) throws RepositoryException, SAXException { handler.startDocument(); String[] prefixes = session.getNamespacePrefixes(); for (int i = 0; i < prefixes.length; i++) { if (prefixes[i].length() > 0 && !prefixes[i].equals("xml") ) { addNamespace(prefixes[i], session.getNamespaceURI(prefixes[i])); } } exportNode(node); handler.endDocument(); }