/** * Creates an exporter instance. * * @param session current session * @param handler SAX event handler * @param recurse whether the export should be recursive * @param binary whether the export should include binary values */ protected Exporter( Session session, ContentHandler handler, boolean recurse, boolean binary) { this.session = session; this.helper = new NamespaceHelper(session); this.handler = handler; this.recurse = recurse; this.binary = binary; stack.add(new HashMap()); }
/** * Creates an exporter instance. * * @param session current session * @param handler SAX event handler * @param recurse whether the export should be recursive * @param binary whether the export should include binary values */ protected Exporter( Session session, ContentHandler handler, boolean recurse, boolean binary) { this.session = session; this.helper = new NamespaceHelper(session); this.handler = handler; this.recurse = recurse; this.binary = binary; stack.add(new HashMap()); }
/** * Creates an exporter instance. * * @param session current session * @param handler SAX event handler * @param recurse whether the export should be recursive * @param binary whether the export should include binary values */ protected Exporter( Session session, ContentHandler handler, boolean recurse, boolean binary) { this.session = session; this.helper = new NamespaceHelper(session); this.handler = handler; this.recurse = recurse; this.binary = binary; stack.add(new HashMap()); }
/** * Returns the prefixed JCR name for the namespace URI and local name * using the current namespace mappings. * * @param uri namespace URI * @param name namespace-local name * @return prefixed JCR name * @throws RepositoryException if an error occurs */ private String getName(String name) throws RepositoryException { return new NamespaceHelper(getSession()).getJcrName(name); }
public ImportHandler(Importer importer, Session session) throws RepositoryException { this.importer = importer; this.helper = new NamespaceHelper(session); this.localNamespaceMappings = helper.getNamespaces(); this.valueFactory = session.getValueFactory(); }
/** * Returns the prefixed JCR name for the namespace URI and local name * using the current namespace mappings. * * @param uri namespace URI * @param name namespace-local name * @return prefixed JCR name * @throws RepositoryException if an error occurs */ private String getName(String name) throws RepositoryException { return new NamespaceHelper(getSession()).getJcrName(name); }
public ImportHandler(Importer importer, Session session) throws RepositoryException { this.importer = importer; this.helper = new NamespaceHelper(session); this.localNamespaceMappings = helper.getNamespaces(); this.valueFactory = session.getValueFactory(); }
/** * Returns the prefixed JCR name for the namespace URI and local name * using the current namespace mappings. * * @param uri namespace URI * @param name namespace-local name * @return prefixed JCR name * @throws RepositoryException if an error occurs */ private String getName(String name) throws RepositoryException { return new NamespaceHelper(getSession()).getJcrName(name); }
/** * Records the given namespace mapping to be included in the local * namespace context. The local namespace context is instantiated * in {@link #startElement(String, String, String, Attributes)} using * all the the namespace mappings recorded for the current XML element. * <p> * The namespace is also recorded in the persistent namespace registry * unless it is already known. * * @param prefix namespace prefix * @param uri namespace URI */ @Override public void startPrefixMapping(String prefix, String uri) throws SAXException { try { new NamespaceHelper(sessionContext.getSession()).registerNamespace( prefix, uri); if (targetHandler != null) { targetHandler.startPrefixMapping(prefix, uri); } else { tempPrefixMap.put(prefix, uri); } } catch (RepositoryException re) { throw new SAXException(re); } }
/** * Records the given namespace mapping to be included in the local * namespace context. The local namespace context is instantiated * in {@link #startElement(String, String, String, Attributes)} using * all the the namespace mappings recorded for the current XML element. * <p> * The namespace is also recorded in the persistent namespace registry * unless it is already known. * * @param prefix namespace prefix * @param uri namespace URI */ @Override public void startPrefixMapping(String prefix, String uri) throws SAXException { try { new NamespaceHelper(sessionContext.getSession()).registerNamespace( prefix, uri); if (targetHandler != null) { targetHandler.startPrefixMapping(prefix, uri); } else { tempPrefixMap.put(prefix, uri); } } catch (RepositoryException re) { throw new SAXException(re); } }
/** * Records the given namespace mapping to be included in the local * namespace context. The local namespace context is instantiated * in {@link #startElement(String, String, String, Attributes)} using * all the the namespace mappings recorded for the current XML element. * <p> * The namespace is also recorded in the persistent namespace registry * unless it is already known. * * @param prefix namespace prefix * @param uri namespace URI */ @Override public void startPrefixMapping(String prefix, String uri) throws SAXException { try { new NamespaceHelper(sessionContext.getSession()).registerNamespace( prefix, uri); if (targetHandler != null) { targetHandler.startPrefixMapping(prefix, uri); } else { tempPrefixMap.put(prefix, uri); } } catch (RepositoryException re) { throw new SAXException(re); } }
new NamespaceHelper(context.getSessionImpl()).registerNamespaces(namespaceMap);
new NamespaceHelper(context.getSessionImpl()).registerNamespaces(namespaceMap);
/** * Build jcr property name from dav property name. If the property name * defines a namespace uri, that has not been registered yet, an attempt * is made to register the uri with the prefix defined. * * @param propName name of the dav property * @param session repository session * @return jcr name * @throws RepositoryException if an error during repository access occurs. */ private String getJcrName(DavPropertyName propName, Session session) throws RepositoryException { // remove any encoding necessary for xml compliance String pName = ISO9075.decode(propName.getName()); Namespace propNamespace = propName.getNamespace(); if (!Namespace.EMPTY_NAMESPACE.equals(propNamespace)) { NamespaceHelper helper = new NamespaceHelper(session); String prefix = helper.registerNamespace( propNamespace.getPrefix(), propNamespace.getURI()); pName = prefix + ":" + pName; } return pName; }