You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by re...@apache.org on 2012/06/11 14:57:46 UTC
svn commit: r1348827 - in
/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name:
NamespaceRegistryImpl.java Namespaces.java
Author: reschke
Date: Mon Jun 11 12:57:46 2012
New Revision: 1348827
URL: http://svn.apache.org/viewvc?rev=1348827&view=rev
Log:
add a TODO wrt naming jcr:namespaces
Modified:
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NamespaceRegistryImpl.java
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/Namespaces.java
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NamespaceRegistryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NamespaceRegistryImpl.java?rev=1348827&r1=1348826&r2=1348827&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NamespaceRegistryImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/NamespaceRegistryImpl.java Mon Jun 11 12:57:46 2012
@@ -47,7 +47,7 @@ public class NamespaceRegistryImpl imple
throws RepositoryException {
try {
Root root = session.getCurrentRoot();
- Tree namespaces = getOrCreate(root, "jcr:system", "jcr:namespaces");
+ Tree namespaces = getOrCreate(root, "jcr:system", Namespaces.NSMAPNODENAME);
namespaces.setProperty(
prefix, session.getCoreValueFactory().createValue(uri));
root.commit();
@@ -64,7 +64,7 @@ public class NamespaceRegistryImpl imple
public void unregisterNamespace(String prefix) throws RepositoryException {
try {
Root root = session.getCurrentRoot();
- Tree namespaces = getOrCreate(root, "jcr:system", "jcr:namespaces");
+ Tree namespaces = getOrCreate(root, "jcr:system", Namespaces.NSMAPNODENAME);
if (namespaces.hasProperty(prefix)) {
namespaces.removeProperty(prefix);
} else {
Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/Namespaces.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/Namespaces.java?rev=1348827&r1=1348826&r2=1348827&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/Namespaces.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/name/Namespaces.java Mon Jun 11 12:57:46 2012
@@ -33,6 +33,9 @@ class Namespaces {
private static final Map<String, String> defaults =
new HashMap<String, String>();
+ // TODO: this should not use the "jcr" prefix
+ public final static String NSMAPNODENAME = "jcr:namespaces";
+
static {
// Standard namespace specified by JCR (default one not included)
defaults.put("", "");
@@ -53,7 +56,7 @@ class Namespaces {
Tree system = root.getChild("jcr:system");
if (system != null) {
- Tree namespaces = system.getChild("jcr:namespaces");
+ Tree namespaces = system.getChild(NSMAPNODENAME);
if (namespaces != null) {
for (PropertyState property : namespaces.getProperties()) {
String prefix = property.getName();