/** * Safely registers all namespaces in the given map from * prefixes to namespace URIs. * * @param namespaces namespace mappings * @throws RepositoryException if the namespaces could not be registered */ public void registerNamespaces(Map<String,String> namespaces) throws RepositoryException { for (Map.Entry<String, String> stringStringEntry : namespaces.entrySet()) { Map.Entry<String, String> entry = stringStringEntry; registerNamespace(entry.getKey(), entry.getValue()); } }
/** * Safely registers all namespaces in the given map from * prefixes to namespace URIs. * * @param namespaces namespace mappings * @throws RepositoryException if the namespaces could not be registered */ public void registerNamespaces(Map<String,String> namespaces) throws RepositoryException { for (Map.Entry<String, String> stringStringEntry : namespaces.entrySet()) { Map.Entry<String, String> entry = stringStringEntry; registerNamespace(entry.getKey(), entry.getValue()); } }
/** * Safely registers all namespaces in the given map from * prefixes to namespace URIs. * * @param namespaces namespace mappings * @throws RepositoryException if the namespaces could not be registered */ public void registerNamespaces(Map<String,String> namespaces) throws RepositoryException { for (Map.Entry<String, String> stringStringEntry : namespaces.entrySet()) { Map.Entry<String, String> entry = stringStringEntry; registerNamespace(entry.getKey(), entry.getValue()); } }
/** * 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 { localNamespaceMappings.put(prefix, uri); try { helper.registerNamespace(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 { localNamespaceMappings.put(prefix, uri); try { helper.registerNamespace(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); } }
/** * 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); } }
/** * 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; }