jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r293034 [1/2] - in /incubator/jackrabbit/trunk/src: java/org/apache/jackrabbit/ java/org/apache/jackrabbit/core/ java/org/apache/jackrabbit/core/lock/ java/org/apache/jackrabbit/core/nodetype/ java/org/apache/jackrabbit/core/nodetype/virtua...
Date Sat, 01 Oct 2005 22:20:39 GMT
Author: jukka
Date: Sat Oct  1 15:18:50 2005
New Revision: 293034

URL: http://svn.apache.org/viewcvs?rev=293034&view=rev
Log:
Removed o.a.j.Constants and moved all name constants to o.a.j.name.QName in order to simplify package dependencies. Also added two new constants: QName.EMPTY and QName.WILDCARD.

Removed:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/Constants.java
Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/BatchedItemOperations.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/HierarchyManagerImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemManager.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/LocalNamespaceMappings.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NamespaceRegistryImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/PropertyImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/WorkspaceImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/LockManagerImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDef.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDefImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefinitionImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateProvider.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/NodeTypeQueryNode.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/PropertyTypeRegistry.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/QueryImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/QueryImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/RowIteratorImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/sql/QueryFormat.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/xpath/QueryFormat.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/xpath/XPathQueryBuilder.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/InternalFrozenNodeImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/InternalFrozenVHImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/InternalVersionHistoryImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/InternalVersionImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/NodeStateEx.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/virtual/VirtualNodeState.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/AbstractSAXEventGenerator.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/DocViewImportHandler.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/ImportHandler.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SessionImporter.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SysViewSAXEventGenerator.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/TargetImportHandler.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/WorkspaceImporter.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/name/Path.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/name/QName.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/nodetype/xml/SimpleNamespaceRegistry.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/core/nodetype/xml/TestAll.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/BatchedItemOperations.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/BatchedItemOperations.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/BatchedItemOperations.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/BatchedItemOperations.java Sat Oct  1 15:18:50 2005
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.core;
 
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.core.lock.LockManager;
 import org.apache.jackrabbit.core.nodetype.EffectiveNodeType;
 import org.apache.jackrabbit.core.nodetype.NodeDef;
@@ -64,7 +63,7 @@
  * provides both high- and low-level operations directly on the
  * <code>ItemState</code> level.
  */
-public class BatchedItemOperations extends ItemValidator implements Constants {
+public class BatchedItemOperations extends ItemValidator {
 
     private static Logger log = Logger.getLogger(BatchedItemOperations.class);
 
@@ -761,7 +760,7 @@
 
         if ((options & CHECK_REFERENCES) == CHECK_REFERENCES) {
             EffectiveNodeType ent = getEffectiveNodeType(targetState);
-            if (ent.includesNodeType(MIX_REFERENCEABLE)) {
+            if (ent.includesNodeType(QName.MIX_REFERENCEABLE)) {
                 NodeReferencesId refsId = new NodeReferencesId(targetState.getUUID());
                 if (stateMgr.hasNodeReferences(refsId)) {
                     try {
@@ -1046,7 +1045,7 @@
 
         if (!node.getMixinTypeNames().isEmpty()) {
             // create jcr:mixinTypes property
-            PropDef pd = ent.getApplicablePropertyDef(JCR_MIXINTYPES,
+            PropDef pd = ent.getApplicablePropertyDef(QName.JCR_MIXINTYPES,
                     PropertyType.NAME, true);
             createPropertyState(node, pd.getName(), pd.getRequiredType(), pd);
         }
@@ -1305,7 +1304,7 @@
          * this would have a negative impact on performance though...
          */
         NodeState nodeState = getNodeState(nodePath);
-        while (!nodeState.hasPropertyName(JCR_ISCHECKEDOUT)) {
+        while (!nodeState.hasPropertyName(QName.JCR_ISCHECKEDOUT)) {
             if (nodePath.denotesRoot()) {
                 return;
             }
@@ -1313,7 +1312,7 @@
             nodeState = getNodeState(nodePath);
         }
         PropertyId propId =
-                new PropertyId(nodeState.getUUID(), JCR_ISCHECKEDOUT);
+                new PropertyId(nodeState.getUUID(), QName.JCR_ISCHECKEDOUT);
         PropertyState propState;
         try {
             propState = (PropertyState) stateMgr.getItemState(propId);
@@ -1439,18 +1438,18 @@
         // compute system generated values
         QName declaringNT = def.getDeclaringNodeType();
         QName name = def.getName();
-        if (MIX_REFERENCEABLE.equals(declaringNT)) {
+        if (QName.MIX_REFERENCEABLE.equals(declaringNT)) {
             // mix:referenceable node type
-            if (JCR_UUID.equals(name)) {
+            if (QName.JCR_UUID.equals(name)) {
                 // jcr:uuid property
                 genValues = new InternalValue[]{InternalValue.create(parent.getUUID())};
             }
-        } else if (NT_BASE.equals(declaringNT)) {
+        } else if (QName.NT_BASE.equals(declaringNT)) {
             // nt:base node type
-            if (JCR_PRIMARYTYPE.equals(name)) {
+            if (QName.JCR_PRIMARYTYPE.equals(name)) {
                 // jcr:primaryType property
                 genValues = new InternalValue[]{InternalValue.create(parent.getNodeTypeName())};
-            } else if (JCR_MIXINTYPES.equals(name)) {
+            } else if (QName.JCR_MIXINTYPES.equals(name)) {
                 // jcr:mixinTypes property
                 Set mixins = parent.getMixinTypeNames();
                 ArrayList values = new ArrayList(mixins.size());
@@ -1460,21 +1459,21 @@
                 }
                 genValues = (InternalValue[]) values.toArray(new InternalValue[values.size()]);
             }
-        } else if (NT_HIERARCHYNODE.equals(declaringNT)) {
+        } else if (QName.NT_HIERARCHYNODE.equals(declaringNT)) {
             // nt:hierarchyNode node type
-            if (JCR_CREATED.equals(name)) {
+            if (QName.JCR_CREATED.equals(name)) {
                 // jcr:created property
                 genValues = new InternalValue[]{InternalValue.create(Calendar.getInstance())};
             }
-        } else if (NT_RESOURCE.equals(declaringNT)) {
+        } else if (QName.NT_RESOURCE.equals(declaringNT)) {
             // nt:resource node type
-            if (JCR_LASTMODIFIED.equals(name)) {
+            if (QName.JCR_LASTMODIFIED.equals(name)) {
                 // jcr:lastModified property
                 genValues = new InternalValue[]{InternalValue.create(Calendar.getInstance())};
             }
-        } else if (NT_VERSION.equals(declaringNT)) {
+        } else if (QName.NT_VERSION.equals(declaringNT)) {
             // nt:version node type
-            if (JCR_CREATED.equals(name)) {
+            if (QName.JCR_CREATED.equals(name)) {
                 // jcr:created property
                 genValues = new InternalValue[]{InternalValue.create(Calendar.getInstance())};
             }
@@ -1592,7 +1591,7 @@
             String uuid;
             NodeId id;
             EffectiveNodeType ent = getEffectiveNodeType(srcState);
-            boolean referenceable = ent.includesNodeType(MIX_REFERENCEABLE);
+            boolean referenceable = ent.includesNodeType(QName.MIX_REFERENCEABLE);
             switch (flag) {
                 case COPY:
                     // always create new uuid
@@ -1709,7 +1708,7 @@
                  */
                 PropDefId defId = srcChildState.getDefinitionId();
                 PropDef def = ntReg.getPropDef(defId);
-                if (def.getDeclaringNodeType().equals(MIX_LOCKABLE)) {
+                if (def.getDeclaringNodeType().equals(QName.MIX_LOCKABLE)) {
                     // skip properties defined by mix:lockable
                     continue;
                 }
@@ -1763,8 +1762,8 @@
              *
              * todo FIXME delegate to 'node type instance handler'
              */
-            if (def.getDeclaringNodeType().equals(MIX_REFERENCEABLE)
-                    && propName.equals(JCR_UUID)) {
+            if (def.getDeclaringNodeType().equals(QName.MIX_REFERENCEABLE)
+                    && propName.equals(QName.JCR_UUID)) {
                 // set correct value of jcr:uuid property
                 newState.setValues(new InternalValue[]{InternalValue.create(parentUUID)});
             } else {

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/HierarchyManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/HierarchyManagerImpl.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/HierarchyManagerImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/HierarchyManagerImpl.java Sat Oct  1 15:18:50 2005
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.core;
 
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.core.state.ItemState;
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.ItemStateManager;
@@ -379,7 +378,7 @@
                 if (parentUUID == null) {
                     // this is the root or an orphaned node
                     // FIXME
-                    return new QName(Constants.NS_DEFAULT_URI, "");
+                    return QName.EMPTY;
                 }
                 parentState = (NodeState) getItemState(new NodeId(parentUUID));
             } catch (NoSuchItemStateException nsis) {

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemImpl.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemImpl.java Sat Oct  1 15:18:50 2005
@@ -18,7 +18,6 @@
 
 import org.apache.commons.collections.iterators.IteratorChain;
 import org.apache.commons.collections.map.ReferenceMap;
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.core.nodetype.EffectiveNodeType;
 import org.apache.jackrabbit.core.nodetype.NodeDef;
 import org.apache.jackrabbit.core.nodetype.NodeTypeImpl;
@@ -75,7 +74,7 @@
 /**
  * <code>ItemImpl</code> implements the <code>Item</code> interface.
  */
-public abstract class ItemImpl implements Item, ItemStateListener, Constants {
+public abstract class ItemImpl implements Item, ItemStateListener {
 
     private static Logger log = Logger.getLogger(ItemImpl.class);
 
@@ -534,7 +533,7 @@
                 PropDef[] pda = ent.getMandatoryPropDefs();
                 for (int i = 0; i < pda.length; i++) {
                     PropDef pd = pda[i];
-                    if (pd.getDeclaringNodeType().equals(MIX_VERSIONABLE)) {
+                    if (pd.getDeclaringNodeType().equals(QName.MIX_VERSIONABLE)) {
                         /**
                          * todo FIXME workaround for mix:versionable:
                          * the mandatory properties are initialized at a
@@ -898,8 +897,8 @@
             ItemState itemState = (ItemState) iter.next();
             if (itemState.isNode()) {
                 NodeImpl node = (NodeImpl) itemMgr.getItem(itemState.getId());
-                if (node.isNodeType(MIX_VERSIONABLE)) {
-                    if (!node.hasProperty(JCR_VERSIONHISTORY)) {
+                if (node.isNodeType(QName.MIX_VERSIONABLE)) {
+                    if (!node.hasProperty(QName.JCR_VERSIONHISTORY)) {
                         VersionManager vMgr = session.getVersionManager();
                         NodeState nodeState = (NodeState) itemState;
                         /**
@@ -914,10 +913,10 @@
                         if (vh == null) {
                             vh = vMgr.createVersionHistory(session, nodeState);
                         }
-                        node.internalSetProperty(JCR_VERSIONHISTORY, InternalValue.create(new UUID(vh.getUUID())));
-                        node.internalSetProperty(JCR_BASEVERSION, InternalValue.create(new UUID(vh.getRootVersion().getUUID())));
-                        node.internalSetProperty(JCR_ISCHECKEDOUT, InternalValue.create(true));
-                        node.internalSetProperty(JCR_PREDECESSORS,
+                        node.internalSetProperty(QName.JCR_VERSIONHISTORY, InternalValue.create(new UUID(vh.getUUID())));
+                        node.internalSetProperty(QName.JCR_BASEVERSION, InternalValue.create(new UUID(vh.getRootVersion().getUUID())));
+                        node.internalSetProperty(QName.JCR_ISCHECKEDOUT, InternalValue.create(true));
+                        node.internalSetProperty(QName.JCR_PREDECESSORS,
                                 new InternalValue[]{InternalValue.create(new UUID(vh.getRootVersion().getUUID()))});
                         createdTransientState = true;
                     }

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemManager.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemManager.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemManager.java Sat Oct  1 15:18:50 2005
@@ -17,7 +17,6 @@
 package org.apache.jackrabbit.core;
 
 import org.apache.commons.collections.map.ReferenceMap;
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.core.nodetype.NodeDefId;
 import org.apache.jackrabbit.core.nodetype.NodeDefinitionImpl;
 import org.apache.jackrabbit.core.nodetype.PropDefId;
@@ -75,7 +74,7 @@
  * If the parent <code>Session</code> is an <code>XASession</code>, there is
  * one <code>ItemManager</code> instance per started global transaction.
  */
-public class ItemManager implements ItemLifeCycleListener, Dumpable, Constants {
+public class ItemManager implements ItemLifeCycleListener, Dumpable {
 
     private static Logger log = Logger.getLogger(ItemManager.class);
 
@@ -518,12 +517,12 @@
         ItemLifeCycleListener[] listeners = new ItemLifeCycleListener[]{this};
 
         // check special nodes
-        if (state.getNodeTypeName().equals(NT_VERSION)) {
+        if (state.getNodeTypeName().equals(QName.NT_VERSION)) {
             InternalVersion version =
                     session.getVersionManager().getVersion(state.getUUID());
             return new VersionImpl(this, session, id, state, def, listeners, version);
 
-        } else if (state.getNodeTypeName().equals(NT_VERSIONHISTORY)) {
+        } else if (state.getNodeTypeName().equals(QName.NT_VERSIONHISTORY)) {
             InternalVersionHistory history =
                     session.getVersionManager().getVersionHistory(state.getUUID());
             return new VersionHistoryImpl(this, session, id, state, def, listeners, history);

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/LocalNamespaceMappings.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/LocalNamespaceMappings.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/LocalNamespaceMappings.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/LocalNamespaceMappings.java Sat Oct  1 15:18:50 2005
@@ -16,8 +16,8 @@
  */
 package org.apache.jackrabbit.core;
 
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.name.NamespaceResolver;
+import org.apache.jackrabbit.name.QName;
 import org.apache.xerces.util.XMLChar;
 
 import javax.jcr.NamespaceException;
@@ -77,12 +77,12 @@
         if (prefix == null || uri == null) {
             throw new IllegalArgumentException("prefix/uri can not be null");
         }
-        if (Constants.NS_EMPTY_PREFIX.equals(prefix)
-                || Constants.NS_DEFAULT_URI.equals(uri)) {
+        if (QName.NS_EMPTY_PREFIX.equals(prefix)
+                || QName.NS_DEFAULT_URI.equals(uri)) {
             throw new NamespaceException("default namespace is reserved and can not be changed");
         }
         // special case: prefixes xml*
-        if (prefix.toLowerCase().startsWith(Constants.NS_XML_PREFIX)) {
+        if (prefix.toLowerCase().startsWith(QName.NS_XML_PREFIX)) {
             throw new NamespaceException("reserved prefix: " + prefix);
         }
         // check if the prefix is a valid XML prefix

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NamespaceRegistryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NamespaceRegistryImpl.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NamespaceRegistryImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NamespaceRegistryImpl.java Sat Oct  1 15:18:50 2005
@@ -16,10 +16,10 @@
  */
 package org.apache.jackrabbit.core;
 
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.core.fs.FileSystem;
 import org.apache.jackrabbit.core.fs.FileSystemResource;
 import org.apache.jackrabbit.name.NamespaceResolver;
+import org.apache.jackrabbit.name.QName;
 import org.apache.log4j.Logger;
 import org.apache.xerces.util.XMLChar;
 
@@ -39,7 +39,7 @@
  * A <code>NamespaceRegistryImpl</code> ...
  */
 public class NamespaceRegistryImpl implements NamespaceRegistry,
-        NamespaceResolver, Constants {
+        NamespaceResolver {
 
     private static Logger log = Logger.getLogger(NamespaceRegistryImpl.class);
 
@@ -50,23 +50,23 @@
 
     static {
         // reserved prefixes
-        reservedPrefixes.add(NS_XML_PREFIX);
-        reservedPrefixes.add(NS_XMLNS_PREFIX);
+        reservedPrefixes.add(QName.NS_XML_PREFIX);
+        reservedPrefixes.add(QName.NS_XMLNS_PREFIX);
         // predefined (e.g. built-in) prefixes
-        reservedPrefixes.add(NS_REP_PREFIX);
-        reservedPrefixes.add(NS_JCR_PREFIX);
-        reservedPrefixes.add(NS_NT_PREFIX);
-        reservedPrefixes.add(NS_MIX_PREFIX);
-        reservedPrefixes.add(NS_SV_PREFIX);
+        reservedPrefixes.add(QName.NS_REP_PREFIX);
+        reservedPrefixes.add(QName.NS_JCR_PREFIX);
+        reservedPrefixes.add(QName.NS_NT_PREFIX);
+        reservedPrefixes.add(QName.NS_MIX_PREFIX);
+        reservedPrefixes.add(QName.NS_SV_PREFIX);
         // reserved namespace URI's
-        reservedURIs.add(NS_XML_URI);
-        reservedURIs.add(NS_XMLNS_URI);
+        reservedURIs.add(QName.NS_XML_URI);
+        reservedURIs.add(QName.NS_XMLNS_URI);
         // predefined (e.g. built-in) namespace URI's
-        reservedURIs.add(NS_REP_URI);
-        reservedURIs.add(NS_JCR_URI);
-        reservedURIs.add(NS_NT_URI);
-        reservedURIs.add(NS_MIX_URI);
-        reservedURIs.add(NS_SV_URI);
+        reservedURIs.add(QName.NS_REP_URI);
+        reservedURIs.add(QName.NS_JCR_URI);
+        reservedURIs.add(QName.NS_NT_URI);
+        reservedURIs.add(QName.NS_MIX_URI);
+        reservedURIs.add(QName.NS_SV_URI);
     }
 
     private HashMap prefixToURI = new HashMap();
@@ -94,27 +94,27 @@
                 uriToPrefix.clear();
 
                 // default namespace (if no prefix is specified)
-                prefixToURI.put(NS_EMPTY_PREFIX, NS_DEFAULT_URI);
-                uriToPrefix.put(NS_DEFAULT_URI, NS_EMPTY_PREFIX);
+                prefixToURI.put(QName.NS_EMPTY_PREFIX, QName.NS_DEFAULT_URI);
+                uriToPrefix.put(QName.NS_DEFAULT_URI, QName.NS_EMPTY_PREFIX);
                 // declare the predefined mappings
                 // rep:
-                prefixToURI.put(NS_REP_PREFIX, NS_REP_URI);
-                uriToPrefix.put(NS_REP_URI, NS_REP_PREFIX);
+                prefixToURI.put(QName.NS_REP_PREFIX, QName.NS_REP_URI);
+                uriToPrefix.put(QName.NS_REP_URI, QName.NS_REP_PREFIX);
                 // jcr:
-                prefixToURI.put(NS_JCR_PREFIX, NS_JCR_URI);
-                uriToPrefix.put(NS_JCR_URI, NS_JCR_PREFIX);
+                prefixToURI.put(QName.NS_JCR_PREFIX, QName.NS_JCR_URI);
+                uriToPrefix.put(QName.NS_JCR_URI, QName.NS_JCR_PREFIX);
                 // nt:
-                prefixToURI.put(NS_NT_PREFIX, NS_NT_URI);
-                uriToPrefix.put(NS_NT_URI, NS_NT_PREFIX);
+                prefixToURI.put(QName.NS_NT_PREFIX, QName.NS_NT_URI);
+                uriToPrefix.put(QName.NS_NT_URI, QName.NS_NT_PREFIX);
                 // mix:
-                prefixToURI.put(NS_MIX_PREFIX, NS_MIX_URI);
-                uriToPrefix.put(NS_MIX_URI, NS_MIX_PREFIX);
+                prefixToURI.put(QName.NS_MIX_PREFIX, QName.NS_MIX_URI);
+                uriToPrefix.put(QName.NS_MIX_URI, QName.NS_MIX_PREFIX);
                 // sv:
-                prefixToURI.put(NS_SV_PREFIX, NS_SV_URI);
-                uriToPrefix.put(NS_SV_URI, NS_SV_PREFIX);
+                prefixToURI.put(QName.NS_SV_PREFIX, QName.NS_SV_URI);
+                uriToPrefix.put(QName.NS_SV_URI, QName.NS_SV_PREFIX);
                 // xml:
-                prefixToURI.put(NS_XML_PREFIX, NS_XML_URI);
-                uriToPrefix.put(NS_XML_URI, NS_XML_PREFIX);
+                prefixToURI.put(QName.NS_XML_PREFIX, QName.NS_XML_URI);
+                uriToPrefix.put(QName.NS_XML_URI, QName.NS_XML_PREFIX);
 
                 // persist mappings
                 store();
@@ -207,7 +207,7 @@
         if (prefix == null || uri == null) {
             throw new IllegalArgumentException("prefix/uri can not be null");
         }
-        if (NS_EMPTY_PREFIX.equals(prefix) || NS_DEFAULT_URI.equals(uri)) {
+        if (QName.NS_EMPTY_PREFIX.equals(prefix) || QName.NS_DEFAULT_URI.equals(uri)) {
             throw new NamespaceException("default namespace is reserved and can not be changed");
         }
         if (reservedURIs.contains(uri)) {
@@ -219,7 +219,7 @@
                     + prefix + " -> " + uri + ": reserved prefix");
         }
         // special case: prefixes xml*
-        if (prefix.toLowerCase().startsWith(NS_XML_PREFIX)) {
+        if (prefix.toLowerCase().startsWith(QName.NS_XML_PREFIX)) {
             throw new NamespaceException("failed to register namespace "
                     + prefix + " -> " + uri + ": reserved prefix");
         }

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java Sat Oct  1 15:18:50 2005
@@ -136,7 +136,7 @@
              */
             log.warn("Fallback to nt:unstructured due to unknown node type '"
                     + state.getNodeTypeName() + "' of node " + safeGetJCRPath());
-            primaryTypeName = NT_UNSTRUCTURED;
+            primaryTypeName = QName.NT_UNSTRUCTURED;
         }
     }
 
@@ -323,9 +323,9 @@
 
         // compute system generated values
         NodeTypeImpl nt = (NodeTypeImpl) def.getDeclaringNodeType();
-        if (nt.getQName().equals(MIX_REFERENCEABLE)) {
+        if (nt.getQName().equals(QName.MIX_REFERENCEABLE)) {
             // mix:referenceable node type
-            if (name.equals(JCR_UUID)) {
+            if (name.equals(QName.JCR_UUID)) {
                 // jcr:uuid property
                 genValues = new InternalValue[]{InternalValue.create(thisState.getUUID())};
             }
@@ -348,30 +348,30 @@
                genValues = new InternalValue[]{InternalValue.create(new UUID(hist.getRootVersion().getUUID()))};
            }
 */
-        } else if (nt.getQName().equals(NT_HIERARCHYNODE)) {
+        } else if (nt.getQName().equals(QName.NT_HIERARCHYNODE)) {
             // nt:hierarchyNode node type
-            if (name.equals(JCR_CREATED)) {
+            if (name.equals(QName.JCR_CREATED)) {
                 // jcr:created property
                 genValues = new InternalValue[]{InternalValue.create(Calendar.getInstance())};
             }
-        } else if (nt.getQName().equals(NT_RESOURCE)) {
+        } else if (nt.getQName().equals(QName.NT_RESOURCE)) {
             // nt:resource node type
-            if (name.equals(JCR_LASTMODIFIED)) {
+            if (name.equals(QName.JCR_LASTMODIFIED)) {
                 // jcr:lastModified property
                 genValues = new InternalValue[]{InternalValue.create(Calendar.getInstance())};
             }
-        } else if (nt.getQName().equals(NT_VERSION)) {
+        } else if (nt.getQName().equals(QName.NT_VERSION)) {
             // nt:version node type
-            if (name.equals(JCR_CREATED)) {
+            if (name.equals(QName.JCR_CREATED)) {
                 // jcr:created property
                 genValues = new InternalValue[]{InternalValue.create(Calendar.getInstance())};
             }
-        } else if (nt.getQName().equals(NT_BASE)) {
+        } else if (nt.getQName().equals(QName.NT_BASE)) {
             // nt:base node type
-            if (name.equals(JCR_PRIMARYTYPE)) {
+            if (name.equals(QName.JCR_PRIMARYTYPE)) {
                 // jcr:primaryType property
                 genValues = new InternalValue[]{InternalValue.create(primaryTypeName)};
-            } else if (name.equals(JCR_MIXINTYPES)) {
+            } else if (name.equals(QName.JCR_MIXINTYPES)) {
                 // jcr:mixinTypes property
                 Set mixins = thisState.getMixinTypeNames();
                 ArrayList values = new ArrayList(mixins.size());
@@ -798,17 +798,17 @@
         NodeState thisState = (NodeState) state;
         // get or create jcr:mixinTypes property
         PropertyImpl prop;
-        if (thisState.hasPropertyName(JCR_MIXINTYPES)) {
-            prop = (PropertyImpl) itemMgr.getItem(new PropertyId(thisState.getUUID(), JCR_MIXINTYPES));
+        if (thisState.hasPropertyName(QName.JCR_MIXINTYPES)) {
+            prop = (PropertyImpl) itemMgr.getItem(new PropertyId(thisState.getUUID(), QName.JCR_MIXINTYPES));
         } else {
             // find definition for the jcr:mixinTypes property and create property
-            PropertyDefinitionImpl def = getApplicablePropertyDefinition(JCR_MIXINTYPES, PropertyType.NAME, true);
-            prop = createChildProperty(JCR_MIXINTYPES, PropertyType.NAME, def);
+            PropertyDefinitionImpl def = getApplicablePropertyDefinition(QName.JCR_MIXINTYPES, PropertyType.NAME, true);
+            prop = createChildProperty(QName.JCR_MIXINTYPES, PropertyType.NAME, def);
         }
 
         if (mixinNames.isEmpty()) {
             // purge empty jcr:mixinTypes property
-            removeChildProperty(JCR_MIXINTYPES);
+            removeChildProperty(QName.JCR_MIXINTYPES);
             return;
         }
 
@@ -1102,9 +1102,9 @@
          * it can only be removed if there no more references to this node
          */
         NodeTypeImpl mixin = ntMgr.getNodeType(mixinName);
-        if ((MIX_REFERENCEABLE.equals(mixinName)
-                || mixin.isDerivedFrom(MIX_REFERENCEABLE))
-                && !entRemaining.includesNodeType(MIX_REFERENCEABLE)) {
+        if ((QName.MIX_REFERENCEABLE.equals(mixinName)
+                || mixin.isDerivedFrom(QName.MIX_REFERENCEABLE))
+                && !entRemaining.includesNodeType(QName.MIX_REFERENCEABLE)) {
             // removing this mixin would effectively remove mix:referenceable:
             // make sure no references exist
             PropertyIterator iter = getReferences();
@@ -2608,7 +2608,7 @@
         // check state of this instance
         sanityCheck();
 
-        if (!isNodeType(MIX_REFERENCEABLE)) {
+        if (!isNodeType(QName.MIX_REFERENCEABLE)) {
             throw new UnsupportedRepositoryOperationException();
         }
 
@@ -2632,7 +2632,7 @@
 
             // search nearest ancestor that is referenceable
             NodeImpl m1 = this;
-            while (m1.getDepth() != 0 && !m1.isNodeType(MIX_REFERENCEABLE)) {
+            while (m1.getDepth() != 0 && !m1.isNodeType(QName.MIX_REFERENCEABLE)) {
                 m1 = (NodeImpl) m1.getParent();
             }
 
@@ -2737,11 +2737,11 @@
         checkLock();
 
         Version v = session.getVersionManager().checkin(this);
-        Property prop = internalSetProperty(JCR_ISCHECKEDOUT, InternalValue.create(false));
+        Property prop = internalSetProperty(QName.JCR_ISCHECKEDOUT, InternalValue.create(false));
         prop.save();
-        prop = internalSetProperty(JCR_BASEVERSION, InternalValue.create(new UUID(v.getUUID())));
+        prop = internalSetProperty(QName.JCR_BASEVERSION, InternalValue.create(new UUID(v.getUUID())));
         prop.save();
-        prop = internalSetProperty(JCR_PREDECESSORS, InternalValue.EMPTY_ARRAY, PropertyType.REFERENCE);
+        prop = internalSetProperty(QName.JCR_PREDECESSORS, InternalValue.EMPTY_ARRAY, PropertyType.REFERENCE);
         prop.save();
         return v;
     }
@@ -2768,9 +2768,9 @@
         // check lock status
         checkLock();
 
-        Property prop = internalSetProperty(JCR_ISCHECKEDOUT, InternalValue.create(true));
+        Property prop = internalSetProperty(QName.JCR_ISCHECKEDOUT, InternalValue.create(true));
         prop.save();
-        prop = internalSetProperty(JCR_PREDECESSORS,
+        prop = internalSetProperty(QName.JCR_PREDECESSORS,
                 new InternalValue[]{
                     InternalValue.create(new UUID(getBaseVersion().getUUID()))
                 });
@@ -2945,7 +2945,7 @@
         sanityCheck();
 
         checkVersionable();
-        return (VersionHistory) getProperty(JCR_VERSIONHISTORY).getNode();
+        return (VersionHistory) getProperty(QName.JCR_VERSIONHISTORY).getNode();
     }
 
     /**
@@ -2957,7 +2957,7 @@
         sanityCheck();
 
         checkVersionable();
-        return (Version) getProperty(JCR_BASEVERSION).getNode();
+        return (Version) getProperty(QName.JCR_BASEVERSION).getNode();
     }
 
     //-----------------------------------< versioning support: implementation >
@@ -2969,7 +2969,7 @@
      */
     private void checkVersionable()
             throws UnsupportedRepositoryOperationException, RepositoryException {
-        if (!isNodeType(MIX_VERSIONABLE)) {
+        if (!isNodeType(QName.MIX_VERSIONABLE)) {
             String msg = "Unable to perform versioning operation on non versionable node: " + safeGetJCRPath();
             log.debug(msg);
             throw new UnsupportedRepositoryOperationException(msg);
@@ -3020,7 +3020,7 @@
 
         // search nearest ancestor that is referenceable
         NodeImpl m1 = this;
-        while (!m1.isNodeType(MIX_REFERENCEABLE)) {
+        while (!m1.isNodeType(QName.MIX_REFERENCEABLE)) {
             if (m1.getDepth() == 0) {
                 // root node
                 try {
@@ -3085,11 +3085,11 @@
         }
 
         // if not versionable, update
-        if (!isNodeType(MIX_VERSIONABLE) || failedIds == null) {
+        if (!isNodeType(QName.MIX_VERSIONABLE) || failedIds == null) {
             return srcNode;
         }
         // if source node is not versionable, leave
-        if (!srcNode.isNodeType(MIX_VERSIONABLE)) {
+        if (!srcNode.isNodeType(QName.MIX_VERSIONABLE)) {
             return null;
         }
         // test versions
@@ -3168,13 +3168,13 @@
 
         if (!cancel) {
             // add version to jcr:predecessors list
-            Value[] vals = getProperty(JCR_PREDECESSORS).getValues();
+            Value[] vals = getProperty(QName.JCR_PREDECESSORS).getValues();
             InternalValue[] v = new InternalValue[vals.length + 1];
             for (int i = 0; i < vals.length; i++) {
                 v[i] = InternalValue.create(UUID.fromString(vals[i].getString()));
             }
             v[vals.length] = InternalValue.create(UUID.fromString(version.getUUID()));
-            internalSetProperty(JCR_PREDECESSORS, v);
+            internalSetProperty(QName.JCR_PREDECESSORS, v);
         }
 
         // save
@@ -3187,8 +3187,8 @@
      */
     private Set internalGetMergeFailed() throws RepositoryException {
         HashSet set = new HashSet();
-        if (hasProperty(JCR_MERGEFAILED)) {
-            Value[] vals = getProperty(JCR_MERGEFAILED).getValues();
+        if (hasProperty(QName.JCR_MERGEFAILED)) {
+            Value[] vals = getProperty(QName.JCR_MERGEFAILED).getValues();
             for (int i = 0; i < vals.length; i++) {
                 set.add(vals[i].getString());
             }
@@ -3202,7 +3202,7 @@
      */
     private void internalSetMergeFailed(Set set) throws RepositoryException {
         if (set.isEmpty()) {
-            internalSetProperty(JCR_MERGEFAILED, (InternalValue[]) null);
+            internalSetProperty(QName.JCR_MERGEFAILED, (InternalValue[]) null);
         } else {
             InternalValue[] vals = new InternalValue[set.size()];
             Iterator iter = set.iterator();
@@ -3211,7 +3211,7 @@
                 String uuid = (String) iter.next();
                 vals[i++] = InternalValue.create(UUID.fromString(uuid));
             }
-            internalSetProperty(JCR_MERGEFAILED, vals);
+            internalSetProperty(QName.JCR_MERGEFAILED, vals);
         }
     }
 
@@ -3244,13 +3244,13 @@
          * this would have a negative impact on performance though...
          */
         NodeImpl node = this;
-        while (!node.hasProperty(JCR_ISCHECKEDOUT)) {
+        while (!node.hasProperty(QName.JCR_ISCHECKEDOUT)) {
             if (node.getDepth() == 0) {
                 return true;
             }
             node = (NodeImpl) node.getParent();
         }
-        return node.getProperty(JCR_ISCHECKEDOUT).getBoolean();
+        return node.getProperty(QName.JCR_ISCHECKEDOUT).getBoolean();
     }
 
     /**
@@ -3427,9 +3427,9 @@
         while (iter.hasNext()) {
             PropertyImpl p = (PropertyImpl) iter.nextProperty();
             // ignore system types
-            if (p.getQName().equals(JCR_PRIMARYTYPE)
-                    || p.getQName().equals(JCR_MIXINTYPES)
-                    || p.getQName().equals(JCR_UUID)) {
+            if (p.getQName().equals(QName.JCR_PRIMARYTYPE)
+                    || p.getQName().equals(QName.JCR_MIXINTYPES)
+                    || p.getQName().equals(QName.JCR_UUID)) {
                 continue;
             }
             if (p.getDefinition().isMultiple()) {
@@ -3459,7 +3459,7 @@
             if (hasNode(child.getQName())) {
                 // todo: does not work properly for samename siblings
                 dstNode = getNode(child.getQName());
-            } else if (child.isNodeType(MIX_REFERENCEABLE)) {
+            } else if (child.isNodeType(QName.MIX_REFERENCEABLE)) {
                 // if child is referenceable, check if correspondance exist in this workspace
                 try {
                     dstNode = (NodeImpl) session.getNodeByUUID(uuid);
@@ -3539,7 +3539,7 @@
         }
 
         // set jcr:isCheckedOut property to true, in order to avoid any conflicts
-        internalSetProperty(JCR_ISCHECKEDOUT, InternalValue.create(true));
+        internalSetProperty(QName.JCR_ISCHECKEDOUT, InternalValue.create(true));
 
         // 1. The child node and properties of N will be changed, removed or
         //    added to, depending on their corresponding copies in V and their
@@ -3549,16 +3549,16 @@
         restored.add(version);
 
         // 2. N's jcr:baseVersion property will be changed to point to V.
-        internalSetProperty(JCR_BASEVERSION, InternalValue.create(new UUID(version.getId())));
+        internalSetProperty(QName.JCR_BASEVERSION, InternalValue.create(new UUID(version.getId())));
 
         // 4. N's jcr:predecessor property is set to null
-        internalSetProperty(JCR_PREDECESSORS, InternalValue.EMPTY_ARRAY, PropertyType.REFERENCE);
+        internalSetProperty(QName.JCR_PREDECESSORS, InternalValue.EMPTY_ARRAY, PropertyType.REFERENCE);
 
         // also clear mergeFailed
-        internalSetProperty(JCR_MERGEFAILED, (InternalValue[]) null);
+        internalSetProperty(QName.JCR_MERGEFAILED, (InternalValue[]) null);
 
         // 3. N's jcr:isCheckedOut property is set to false.
-        internalSetProperty(JCR_ISCHECKEDOUT, InternalValue.create(false));
+        internalSetProperty(QName.JCR_ISCHECKEDOUT, InternalValue.create(false));
 
         return (InternalVersion[]) restored.toArray(new InternalVersion[restored.size()]);
     }
@@ -3575,7 +3575,7 @@
             throws RepositoryException {
 
         // check uuid
-        if (isNodeType(MIX_REFERENCEABLE)) {
+        if (isNodeType(QName.MIX_REFERENCEABLE)) {
             String uuid = freeze.getFrozenUUID();
             if (uuid != null && !uuid.equals(getUUID())) {
                 throw new ItemExistsException("Unable to restore version of " + safeGetJCRPath() + ". UUID changed.");
@@ -3609,9 +3609,9 @@
         while (piter.hasNext()) {
             PropertyImpl prop = (PropertyImpl) piter.nextProperty();
             // ignore some props that are not well guarded by the OPV
-            if (prop.getQName().equals(JCR_VERSIONHISTORY)) {
+            if (prop.getQName().equals(QName.JCR_VERSIONHISTORY)) {
                 continue;
-            } else if (prop.getQName().equals(JCR_PREDECESSORS)) {
+            } else if (prop.getQName().equals(QName.JCR_PREDECESSORS)) {
                 continue;
             }
             if (prop.getDefinition().getOnParentVersion() == OnParentVersionAction.COPY
@@ -3792,7 +3792,7 @@
         // check state of this instance
         sanityCheck();
 
-        if (!isNodeType(MIX_LOCKABLE) || isNew()) {
+        if (!isNodeType(QName.MIX_LOCKABLE) || isNew()) {
             // a node that is new or not lockable never holds a lock
             return false;
         }
@@ -3823,7 +3823,7 @@
      * @throws RepositoryException if another error occurs
      */
     private void checkLockable() throws LockException, RepositoryException {
-        if (!isNodeType(MIX_LOCKABLE)) {
+        if (!isNodeType(QName.MIX_LOCKABLE)) {
             String msg = "Unable to perform locking operation on non-lockable node: "
                     + safeGetJCRPath();
             log.debug(msg);

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/PropertyImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/PropertyImpl.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/PropertyImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/PropertyImpl.java Sat Oct  1 15:18:50 2005
@@ -889,7 +889,7 @@
         if (reqType == PropertyType.REFERENCE) {
             if (target instanceof NodeImpl) {
                 NodeImpl targetNode = (NodeImpl) target;
-                if (targetNode.isNodeType(MIX_REFERENCEABLE)) {
+                if (targetNode.isNodeType(QName.MIX_REFERENCEABLE)) {
                     InternalValue value = InternalValue.create(new UUID(targetNode.getUUID()));
                     internalSetValue(new InternalValue[]{value}, reqType);
                 } else {

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java Sat Oct  1 15:18:50 2005
@@ -17,7 +17,6 @@
 package org.apache.jackrabbit.core;
 
 import org.apache.commons.collections.map.ReferenceMap;
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.core.config.LoginModuleConfig;
 import org.apache.jackrabbit.core.config.PersistenceManagerConfig;
 import org.apache.jackrabbit.core.config.RepositoryConfig;
@@ -41,6 +40,7 @@
 import org.apache.jackrabbit.core.state.SharedItemStateManager;
 import org.apache.jackrabbit.core.version.VersionManager;
 import org.apache.jackrabbit.core.version.VersionManagerImpl;
+import org.apache.jackrabbit.name.QName;
 import org.apache.jackrabbit.uuid.UUID;
 import org.apache.log4j.Logger;
 
@@ -73,7 +73,7 @@
  * A <code>RepositoryImpl</code> ...
  */
 public class RepositoryImpl implements Repository, SessionListener,
-        EventListener, Constants {
+        EventListener {
 
     private static Logger log = Logger.getLogger(RepositoryImpl.class);
 
@@ -429,15 +429,15 @@
          * for now, we just create a /jcr:system node in every workspace
          */
         NodeImpl rootNode = (NodeImpl) sysSession.getRootNode();
-        if (!rootNode.hasNode(JCR_SYSTEM)) {
-            NodeTypeImpl nt = sysSession.getNodeTypeManager().getNodeType(REP_SYSTEM);
-            NodeImpl sysRoot = rootNode.internalAddChildNode(JCR_SYSTEM, nt, SYSTEM_ROOT_NODE_UUID);
+        if (!rootNode.hasNode(QName.JCR_SYSTEM)) {
+            NodeTypeImpl nt = sysSession.getNodeTypeManager().getNodeType(QName.REP_SYSTEM);
+            NodeImpl sysRoot = rootNode.internalAddChildNode(QName.JCR_SYSTEM, nt, SYSTEM_ROOT_NODE_UUID);
             // add version storage
-            nt = sysSession.getNodeTypeManager().getNodeType(REP_VERSIONSTORAGE);
-            sysRoot.internalAddChildNode(JCR_VERSIONSTORAGE, nt, VERSION_STORAGE_NODE_UUID);
+            nt = sysSession.getNodeTypeManager().getNodeType(QName.REP_VERSIONSTORAGE);
+            sysRoot.internalAddChildNode(QName.JCR_VERSIONSTORAGE, nt, VERSION_STORAGE_NODE_UUID);
             // add nodetypes
-            nt = sysSession.getNodeTypeManager().getNodeType(REP_NODETYPES);
-            sysRoot.internalAddChildNode(JCR_NODETYPES, nt, NODETYPES_NODE_UUID);
+            nt = sysSession.getNodeTypeManager().getNodeType(QName.REP_NODETYPES);
+            sysRoot.internalAddChildNode(QName.JCR_NODETYPES, nt, NODETYPES_NODE_UUID);
             rootNode.save();
         }
 

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java Sat Oct  1 15:18:50 2005
@@ -17,7 +17,6 @@
 package org.apache.jackrabbit.core;
 
 import org.apache.commons.collections.map.ReferenceMap;
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.core.config.AccessManagerConfig;
 import org.apache.jackrabbit.core.config.WorkspaceConfig;
 import org.apache.jackrabbit.core.nodetype.NodeDefinitionImpl;
@@ -42,6 +41,7 @@
 import org.apache.jackrabbit.name.MalformedPathException;
 import org.apache.jackrabbit.name.NamespaceResolver;
 import org.apache.jackrabbit.name.Path;
+import org.apache.jackrabbit.name.QName;
 import org.apache.log4j.Logger;
 import org.apache.xml.serialize.OutputFormat;
 import org.apache.xml.serialize.XMLSerializer;
@@ -706,7 +706,7 @@
 
         try {
             NodeImpl node = (NodeImpl) getItemManager().getItem(new NodeId(uuid));
-            if (node.isNodeType(Constants.MIX_REFERENCEABLE)) {
+            if (node.isNodeType(QName.MIX_REFERENCEABLE)) {
                 return node;
             } else {
                 // there is a node with that uuid but the node does not expose it

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/WorkspaceImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/WorkspaceImpl.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/WorkspaceImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/WorkspaceImpl.java Sat Oct  1 15:18:50 2005
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.core;
 
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.core.config.WorkspaceConfig;
 import org.apache.jackrabbit.core.lock.LockManager;
 import org.apache.jackrabbit.core.observation.ObservationManagerFactory;
@@ -68,7 +67,7 @@
 /**
  * A <code>WorkspaceImpl</code> ...
  */
-public class WorkspaceImpl implements Workspace, Constants {
+public class WorkspaceImpl implements Workspace {
 
     private static Logger log = Logger.getLogger(WorkspaceImpl.class);
 

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/LockManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/LockManagerImpl.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/LockManagerImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/lock/LockManagerImpl.java Sat Oct  1 15:18:50 2005
@@ -17,7 +17,6 @@
 package org.apache.jackrabbit.core.lock;
 
 import org.apache.commons.collections.map.LinkedMap;
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.core.NodeId;
 import org.apache.jackrabbit.core.NodeImpl;
 import org.apache.jackrabbit.core.PathMap;
@@ -29,6 +28,7 @@
 import org.apache.jackrabbit.name.MalformedPathException;
 import org.apache.jackrabbit.name.NamespaceResolver;
 import org.apache.jackrabbit.name.Path;
+import org.apache.jackrabbit.name.QName;
 import org.apache.log4j.Logger;
 
 import javax.jcr.Node;
@@ -166,8 +166,8 @@
             Path path = getPath(node.getId());
 
             LockInfo info = new LockInfo(this, lockToken, false,
-                    node.getProperty(Constants.JCR_LOCKISDEEP).getBoolean(),
-                    node.getProperty(Constants.JCR_LOCKOWNER).getString());
+                    node.getProperty(QName.JCR_LOCKISDEEP).getBoolean(),
+                    node.getProperty(QName.JCR_LOCKOWNER).getString());
             info.setLive(true);
             lockMap.put(path, info);
         } catch (RepositoryException e) {
@@ -260,9 +260,9 @@
             }
 
             // add properties to content
-            node.internalSetProperty(Constants.JCR_LOCKOWNER,
+            node.internalSetProperty(QName.JCR_LOCKOWNER,
                     InternalValue.create(node.getSession().getUserID()));
-            node.internalSetProperty(Constants.JCR_LOCKISDEEP,
+            node.internalSetProperty(QName.JCR_LOCKISDEEP,
                     InternalValue.create(info.deep));
             node.save();
 
@@ -303,8 +303,8 @@
                 }
 
                 // remove properties in content
-                node.internalSetProperty(Constants.JCR_LOCKOWNER, (InternalValue) null);
-                node.internalSetProperty(Constants.JCR_LOCKISDEEP, (InternalValue) null);
+                node.internalSetProperty(QName.JCR_LOCKOWNER, (InternalValue) null);
+                node.internalSetProperty(QName.JCR_LOCKISDEEP, (InternalValue) null);
                 node.save();
             }
 
@@ -387,8 +387,8 @@
             }
 
             // remove properties in content
-            node.internalSetProperty(Constants.JCR_LOCKOWNER, (InternalValue) null);
-            node.internalSetProperty(Constants.JCR_LOCKISDEEP, (InternalValue) null);
+            node.internalSetProperty(QName.JCR_LOCKOWNER, (InternalValue) null);
+            node.internalSetProperty(QName.JCR_LOCKISDEEP, (InternalValue) null);
             node.save();
         }
     }

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDef.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDef.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDef.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDef.java Sat Oct  1 15:18:50 2005
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.core.nodetype;
 
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.name.QName;
 
 /**
@@ -29,11 +28,6 @@
 public interface ItemDef {
 
     public static final ItemDef[] EMPTY_ARRAY = new ItemDef[0];
-
-    /**
-     * '*' denoting residual child item definition
-     */
-    QName ANY_NAME = new QName(Constants.NS_DEFAULT_URI, "*");
 
     /**
      * Gets the name of the child item.

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDefImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDefImpl.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDefImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/ItemDefImpl.java Sat Oct  1 15:18:50 2005
@@ -30,7 +30,7 @@
     /**
      * The name of the child item.
      */
-    private QName name = ANY_NAME;
+    private QName name = QName.WILDCARD;
 
     /**
      * The name of the declaring node type.
@@ -179,7 +179,7 @@
      * {@inheritDoc}
      */
     public boolean definesResidual() {
-        return name.equals(ANY_NAME);
+        return name.equals(QName.WILDCARD);
     }
 
     //-------------------------------------------< java.lang.Object overrides >

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefImpl.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefImpl.java Sat Oct  1 15:18:50 2005
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.core.nodetype;
 
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.name.QName;
 
 import java.util.Arrays;
@@ -35,7 +34,7 @@
     /**
      * The names of the required primary types.
      */
-    private QName[] requiredPrimaryTypes = new QName[]{Constants.NT_BASE};
+    private QName[] requiredPrimaryTypes = new QName[] { QName.NT_BASE };
 
     /**
      * The 'allowsSameNameSiblings' flag.

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefinitionImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefinitionImpl.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefinitionImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeDefinitionImpl.java Sat Oct  1 15:18:50 2005
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.core.nodetype;
 
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.name.NamespaceResolver;
 import org.apache.jackrabbit.name.QName;
 import org.apache.log4j.Logger;
@@ -85,7 +84,7 @@
         try {
             if (ntNames == null || ntNames.length == 0) {
                 // return "nt:base"
-                return new NodeType[]{ntMgr.getNodeType(Constants.NT_BASE)};
+                return new NodeType[] { ntMgr.getNodeType(QName.NT_BASE) };
             } else {
                 NodeType[] nodeTypes = new NodeType[ntNames.length];
                 for (int i = 0; i < ntNames.length; i++) {

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/NodeTypeRegistry.java Sat Oct  1 15:18:50 2005
@@ -17,7 +17,6 @@
 package org.apache.jackrabbit.core.nodetype;
 
 import org.apache.commons.collections.map.ReferenceMap;
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.core.fs.FileSystem;
 import org.apache.jackrabbit.core.fs.FileSystemException;
 import org.apache.jackrabbit.core.fs.FileSystemResource;
@@ -50,7 +49,7 @@
 /**
  * A <code>NodeTypeRegistry</code> ...
  */
-public class NodeTypeRegistry implements Dumpable, Constants {
+public class NodeTypeRegistry implements Dumpable {
 
     private static Logger log = Logger.getLogger(NodeTypeRegistry.class);
 
@@ -205,9 +204,9 @@
         NodeDefImpl def = new NodeDefImpl();
 
         // FIXME need a fake declaring node type
-        def.setDeclaringNodeType(new QName(NS_DEFAULT_URI, ""));
-        def.setRequiredPrimaryTypes(new QName[]{REP_ROOT});
-        def.setDefaultPrimaryType(REP_ROOT);
+        def.setDeclaringNodeType(QName.EMPTY);
+        def.setRequiredPrimaryTypes(new QName[] { QName.REP_ROOT });
+        def.setDefaultPrimaryType(QName.REP_ROOT);
         def.setMandatory(true);
         def.setProtected(false);
         def.setOnParentVersion(OnParentVersionAction.VERSION);
@@ -488,8 +487,8 @@
             try {
                 EffectiveNodeType est = getEffectiveNodeType(supertypes);
                 // make sure that all primary types except nt:base extend from nt:base
-                if (!ntd.isMixin() && !NT_BASE.equals(ntd.getName())
-                        && !est.includesNodeType(NT_BASE)) {
+                if (!ntd.isMixin() && !QName.NT_BASE.equals(ntd.getName())
+                        && !est.includesNodeType(QName.NT_BASE)) {
                     String msg = "[" + name + "] all primary node types except"
                         + " nt:base itself must be (directly or indirectly) derived from nt:base";
                     log.debug(msg);
@@ -506,7 +505,7 @@
             }
         } else {
             // no supertypes specified: has to be either a mixin type or nt:base
-            if (!ntd.isMixin() && !NT_BASE.equals(ntd.getName())) {
+            if (!ntd.isMixin() && !QName.NT_BASE.equals(ntd.getName())) {
                 String msg = "[" + name
                         + "] all primary node types except nt:base itself must be (directly or indirectly) derived from nt:base";
                 log.debug(msg);

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateProvider.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateProvider.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateProvider.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/virtual/VirtualNodeTypeStateProvider.java Sat Oct  1 15:18:50 2005
@@ -71,8 +71,8 @@
      * currently we have no dynamic ones, we just recreate the entire nodetypes tree
      */
     protected VirtualNodeState createRootNodeState() throws RepositoryException {
-        VirtualNodeState root = new VirtualNodeState(this, parentId, rootNodeId.getUUID(), REP_NODETYPES, null);
-        NodeDefId id = ntReg.getEffectiveNodeType(REP_SYSTEM).getApplicableChildNodeDef(JCR_NODETYPES, REP_NODETYPES).getId();
+        VirtualNodeState root = new VirtualNodeState(this, parentId, rootNodeId.getUUID(), QName.REP_NODETYPES, null);
+        NodeDefId id = ntReg.getEffectiveNodeType(QName.REP_SYSTEM).getApplicableChildNodeDef(QName.JCR_NODETYPES, QName.REP_NODETYPES).getId();
         root.setDefinitionId(id);
         QName[] ntNames = ntReg.getRegisteredNodeTypes();
         for (int i = 0; i < ntNames.length; i++) {
@@ -151,22 +151,22 @@
      */
     private VirtualNodeState createNodeTypeState(VirtualNodeState parent, NodeTypeDef ntDef) throws RepositoryException {
         String uuid = calculateStableUUID(ntDef.getName().toString());
-        VirtualNodeState ntState = createNodeState(parent, ntDef.getName(), uuid, NT_NODETYPE);
+        VirtualNodeState ntState = createNodeState(parent, ntDef.getName(), uuid, QName.NT_NODETYPE);
 
         // add properties
-        ntState.setPropertyValue(JCR_NODETYPENAME, InternalValue.create(ntDef.getName()));
-        ntState.setPropertyValues(JCR_SUPERTYPES, PropertyType.NAME, InternalValue.create(ntDef.getSupertypes()));
-        ntState.setPropertyValue(JCR_ISMIXIN, InternalValue.create(ntDef.isMixin()));
-        ntState.setPropertyValue(JCR_HASORDERABLECHILDNODES, InternalValue.create(ntDef.hasOrderableChildNodes()));
+        ntState.setPropertyValue(QName.JCR_NODETYPENAME, InternalValue.create(ntDef.getName()));
+        ntState.setPropertyValues(QName.JCR_SUPERTYPES, PropertyType.NAME, InternalValue.create(ntDef.getSupertypes()));
+        ntState.setPropertyValue(QName.JCR_ISMIXIN, InternalValue.create(ntDef.isMixin()));
+        ntState.setPropertyValue(QName.JCR_HASORDERABLECHILDNODES, InternalValue.create(ntDef.hasOrderableChildNodes()));
         if (ntDef.getPrimaryItemName() != null) {
-            ntState.setPropertyValue(JCR_PRIMARYITEMNAME, InternalValue.create(ntDef.getPrimaryItemName()));
+            ntState.setPropertyValue(QName.JCR_PRIMARYITEMNAME, InternalValue.create(ntDef.getPrimaryItemName()));
         }
 
         // add property defs
         PropDef[] propDefs = ntDef.getPropertyDefs();
         for (int i = 0; i < propDefs.length; i++) {
             VirtualNodeState pdState = createPropertyDefState(ntState, propDefs[i], ntDef, i);
-            ntState.addChildNodeEntry(JCR_PROPERTYDEFINITION, pdState.getUUID());
+            ntState.addChildNodeEntry(QName.JCR_PROPERTYDEFINITION, pdState.getUUID());
             // add as hard reference
             ntState.addStateReference(pdState);
         }
@@ -175,7 +175,7 @@
         NodeDef[] cnDefs = ntDef.getChildNodeDefs();
         for (int i = 0; i < cnDefs.length; i++) {
             VirtualNodeState cnState = createChildNodeDefState(ntState, cnDefs[i], ntDef, i);
-            ntState.addChildNodeEntry(JCR_CHILDNODEDEFINITION, cnState.getUUID());
+            ntState.addChildNodeEntry(QName.JCR_CHILDNODEDEFINITION, cnState.getUUID());
             // add as hard reference
             ntState.addStateReference(cnState);
         }
@@ -195,26 +195,26 @@
                                                     PropDef propDef,
                                                     NodeTypeDef ntDef, int n)
             throws RepositoryException {
-        String uuid = calculateStableUUID(ntDef.getName().toString() + "/" + JCR_PROPERTYDEFINITION.toString() + "/" + n);
-        VirtualNodeState pState = createNodeState(parent, JCR_PROPERTYDEFINITION, uuid, NT_PROPERTYDEFINITION);
+        String uuid = calculateStableUUID(ntDef.getName().toString() + "/" + QName.JCR_PROPERTYDEFINITION.toString() + "/" + n);
+        VirtualNodeState pState = createNodeState(parent, QName.JCR_PROPERTYDEFINITION, uuid, QName.NT_PROPERTYDEFINITION);
         // add properties
-        if (!propDef.getName().equals(ItemDef.ANY_NAME)) {
-            pState.setPropertyValue(JCR_NAME, InternalValue.create(propDef.getName()));
+        if (!propDef.getName().equals(QName.WILDCARD)) {
+            pState.setPropertyValue(QName.JCR_NAME, InternalValue.create(propDef.getName()));
         }
-        pState.setPropertyValue(JCR_AUTOCREATED, InternalValue.create(propDef.isAutoCreated()));
-        pState.setPropertyValue(JCR_MANDATORY, InternalValue.create(propDef.isMandatory()));
-        pState.setPropertyValue(JCR_ONPARENTVERSION,
+        pState.setPropertyValue(QName.JCR_AUTOCREATED, InternalValue.create(propDef.isAutoCreated()));
+        pState.setPropertyValue(QName.JCR_MANDATORY, InternalValue.create(propDef.isMandatory()));
+        pState.setPropertyValue(QName.JCR_ONPARENTVERSION,
                 InternalValue.create(OnParentVersionAction.nameFromValue(propDef.getOnParentVersion())));
-        pState.setPropertyValue(JCR_PROTECTED, InternalValue.create(propDef.isProtected()));
-        pState.setPropertyValue(JCR_MULTIPLE, InternalValue.create(propDef.isMultiple()));
-        pState.setPropertyValue(JCR_REQUIREDTYPE, InternalValue.create(PropertyType.nameFromValue(propDef.getRequiredType()).toUpperCase()));
-        pState.setPropertyValues(JCR_DEFAULTVALUES, PropertyType.STRING, propDef.getDefaultValues());
+        pState.setPropertyValue(QName.JCR_PROTECTED, InternalValue.create(propDef.isProtected()));
+        pState.setPropertyValue(QName.JCR_MULTIPLE, InternalValue.create(propDef.isMultiple()));
+        pState.setPropertyValue(QName.JCR_REQUIREDTYPE, InternalValue.create(PropertyType.nameFromValue(propDef.getRequiredType()).toUpperCase()));
+        pState.setPropertyValues(QName.JCR_DEFAULTVALUES, PropertyType.STRING, propDef.getDefaultValues());
         ValueConstraint[] vc = propDef.getValueConstraints();
         InternalValue[] vals = new InternalValue[vc.length];
         for (int i = 0; i < vc.length; i++) {
             vals[i] = InternalValue.create(vc[i].getDefinition());
         }
-        pState.setPropertyValues(JCR_VALUECONSTRAINTS, PropertyType.STRING, vals);
+        pState.setPropertyValues(QName.JCR_VALUECONSTRAINTS, PropertyType.STRING, vals);
         return pState;
     }
 
@@ -230,23 +230,23 @@
                                                      NodeDef cnDef,
                                                      NodeTypeDef ntDef, int n)
             throws RepositoryException {
-        String uuid = calculateStableUUID(ntDef.getName().toString() + "/" + JCR_CHILDNODEDEFINITION.toString() + "/" + n);
-        VirtualNodeState pState = createNodeState(parent, JCR_CHILDNODEDEFINITION, uuid, NT_CHILDNODEDEFINITION);
+        String uuid = calculateStableUUID(ntDef.getName().toString() + "/" + QName.JCR_CHILDNODEDEFINITION.toString() + "/" + n);
+        VirtualNodeState pState = createNodeState(parent, QName.JCR_CHILDNODEDEFINITION, uuid, QName.NT_CHILDNODEDEFINITION);
         // add properties
-        if (!cnDef.getName().equals(ItemDef.ANY_NAME)) {
-            pState.setPropertyValue(JCR_NAME, InternalValue.create(cnDef.getName()));
+        if (!cnDef.getName().equals(QName.WILDCARD)) {
+            pState.setPropertyValue(QName.JCR_NAME, InternalValue.create(cnDef.getName()));
         }
-        pState.setPropertyValue(JCR_AUTOCREATED, InternalValue.create(cnDef.isAutoCreated()));
-        pState.setPropertyValue(JCR_MANDATORY, InternalValue.create(cnDef.isMandatory()));
-        pState.setPropertyValue(JCR_ONPARENTVERSION,
+        pState.setPropertyValue(QName.JCR_AUTOCREATED, InternalValue.create(cnDef.isAutoCreated()));
+        pState.setPropertyValue(QName.JCR_MANDATORY, InternalValue.create(cnDef.isMandatory()));
+        pState.setPropertyValue(QName.JCR_ONPARENTVERSION,
                 InternalValue.create(OnParentVersionAction.nameFromValue(cnDef.getOnParentVersion())));
-        pState.setPropertyValue(JCR_PROTECTED, InternalValue.create(cnDef.isProtected()));
-        pState.setPropertyValues(JCR_REQUIREDPRIMARYTYPES,
+        pState.setPropertyValue(QName.JCR_PROTECTED, InternalValue.create(cnDef.isProtected()));
+        pState.setPropertyValues(QName.JCR_REQUIREDPRIMARYTYPES,
                 PropertyType.NAME, InternalValue.create(cnDef.getRequiredPrimaryTypes()));
         if (cnDef.getDefaultPrimaryType() != null) {
-            pState.setPropertyValue(JCR_DEFAULTPRIMARYTYPE, InternalValue.create(cnDef.getDefaultPrimaryType()));
+            pState.setPropertyValue(QName.JCR_DEFAULTPRIMARYTYPE, InternalValue.create(cnDef.getDefaultPrimaryType()));
         }
-        pState.setPropertyValue(JCR_SAMENAMESIBLINGS, InternalValue.create(cnDef.allowsSameNameSiblings()));
+        pState.setPropertyValue(QName.JCR_SAMENAMESIBLINGS, InternalValue.create(cnDef.allowsSameNameSiblings()));
         return pState;
     }
 

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/NodeTypeQueryNode.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/NodeTypeQueryNode.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/NodeTypeQueryNode.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/NodeTypeQueryNode.java Sat Oct  1 15:18:50 2005
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.core.query;
 
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.name.QName;
 
 /**
@@ -34,7 +33,7 @@
         // we only use the jcr primary type as a dummy value
         // the property name is actually replaced in the query builder
         // when the runtime query is created to search the index.
-        super(parent, Constants.JCR_PRIMARYTYPE, nodeType);
+        super(parent, QName.JCR_PRIMARYTYPE, nodeType);
     }
 
     /**

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/PropertyTypeRegistry.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/PropertyTypeRegistry.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/PropertyTypeRegistry.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/PropertyTypeRegistry.java Sat Oct  1 15:18:50 2005
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.core.query;
 
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.core.nodetype.NodeTypeDef;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistryListener;
@@ -43,9 +42,6 @@
     /** The logger instance for this class */
     private static final Logger log = Logger.getLogger(PropertyTypeRegistry.class);
 
-    /** '*' denoting residual child item definition */
-    protected static final QName ANY_NAME = new QName(Constants.NS_DEFAULT_URI, "*");
-
     /**
      * Empty <code>TypeMapping</code> array as return value if no type is
      * found
@@ -95,7 +91,7 @@
                 for (int i = 0; i < propDefs.length; i++) {
                     QName name = propDefs[i].getName();
                     int type = propDefs[i].getRequiredType();
-                    if (!ANY_NAME.equals(name) && type != PropertyType.UNDEFINED) {
+                    if (!QName.WILDCARD.equals(name) && type != PropertyType.UNDEFINED) {
                         // only remember defined property types
                         TypeMapping[] types = (TypeMapping[]) typeMapping.get(name);
                         if (types == null) {

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/QueryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/QueryImpl.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/QueryImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/QueryImpl.java Sat Oct  1 15:18:50 2005
@@ -16,13 +16,13 @@
  */
 package org.apache.jackrabbit.core.query;
 
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.core.ItemManager;
 import org.apache.jackrabbit.core.SessionImpl;
 import org.apache.jackrabbit.name.MalformedPathException;
 import org.apache.jackrabbit.name.NamespaceResolver;
 import org.apache.jackrabbit.name.NoPrefixDeclaredException;
 import org.apache.jackrabbit.name.Path;
+import org.apache.jackrabbit.name.QName;
 
 import javax.jcr.ItemExistsException;
 import javax.jcr.ItemNotFoundException;
@@ -111,11 +111,11 @@
         this.node = node;
 
         try {
-            if (!node.isNodeType(Constants.NT_QUERY.toJCRName(session.getNamespaceResolver()))) {
+            if (!node.isNodeType(QName.NT_QUERY.toJCRName(session.getNamespaceResolver()))) {
                 throw new InvalidQueryException("node is not of type nt:query");
             }
-            statement = node.getProperty(Constants.JCR_STATEMENT.toJCRName(session.getNamespaceResolver())).getString();
-            language = node.getProperty(Constants.JCR_LANGUAGE.toJCRName(session.getNamespaceResolver())).getString();
+            statement = node.getProperty(QName.JCR_STATEMENT.toJCRName(session.getNamespaceResolver())).getString();
+            language = node.getProperty(QName.JCR_LANGUAGE.toJCRName(session.getNamespaceResolver())).getString();
             query = handler.createExecutableQuery(session, itemMgr, statement, language);
         } catch (NoPrefixDeclaredException e) {
             throw new RepositoryException(e.getMessage(), e);
@@ -182,10 +182,10 @@
             }
             String relPath = p.toJCRPath(resolver).substring(1);
             Node queryNode = session.getRootNode().addNode(relPath,
-                    Constants.NT_QUERY.toJCRName(resolver));
+                    QName.NT_QUERY.toJCRName(resolver));
             // set properties
-            queryNode.setProperty(Constants.JCR_LANGUAGE.toJCRName(resolver), language);
-            queryNode.setProperty(Constants.JCR_STATEMENT.toJCRName(resolver), statement);
+            queryNode.setProperty(QName.JCR_LANGUAGE.toJCRName(resolver), language);
+            queryNode.setProperty(QName.JCR_STATEMENT.toJCRName(resolver), statement);
             node = queryNode;
             return node;
         } catch (MalformedPathException e) {

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/LuceneQueryBuilder.java Sat Oct  1 15:18:50 2005
@@ -79,12 +79,12 @@
     /**
      * QName for jcr:primaryType
      */
-    private static QName primaryType = org.apache.jackrabbit.Constants.JCR_PRIMARYTYPE;
+    private static QName primaryType = QName.JCR_PRIMARYTYPE;
 
     /**
      * QName for jcr:mixinTypes
      */
-    private static QName mixinTypes = org.apache.jackrabbit.Constants.JCR_MIXINTYPES;
+    private static QName mixinTypes = QName.JCR_MIXINTYPES;
 
     /**
      * Root node of the abstract query tree

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/NodeIndexer.java Sat Oct  1 15:18:50 2005
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.core.query.lucene;
 
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.core.NodeId;
 import org.apache.jackrabbit.core.PropertyId;
 import org.apache.jackrabbit.core.query.TextFilterService;
@@ -53,21 +52,6 @@
     private static final Logger log = Logger.getLogger(NodeIndexer.class);
 
     /**
-     * QName for jcr:encoding
-     */
-    private static final QName JCR_ENCODING = new QName(Constants.NS_JCR_URI, "encoding");
-
-    /**
-     * QName for jcr:mimeType
-     */
-    private static final QName JCR_MIMETYPE = new QName(Constants.NS_JCR_URI, "mimeType");
-
-    /**
-     * QName for jcr:data
-     */
-    private static final QName JCR_DATA = new QName(Constants.NS_JCR_URI, "data");
-
-    /**
      * The <code>NodeState</code> of the node to index
      */
     protected final NodeState node;
@@ -266,21 +250,21 @@
     protected void addBinaryValue(Document doc, String fieldName, Object internalValue) {
         // 'check' if node is of type nt:resource
         try {
-            String jcrData = mappings.getPrefix(Constants.NS_JCR_URI) + ":data";
+            String jcrData = mappings.getPrefix(QName.NS_JCR_URI) + ":data";
             if (!jcrData.equals(fieldName)) {
                 // don't know how to index
                 return;
             }
-            if (node.hasPropertyName(JCR_MIMETYPE)) {
-                PropertyState dataProp = (PropertyState) stateProvider.getItemState(new PropertyId(node.getUUID(), JCR_DATA));
+            if (node.hasPropertyName(QName.JCR_MIMETYPE)) {
+                PropertyState dataProp = (PropertyState) stateProvider.getItemState(new PropertyId(node.getUUID(), QName.JCR_DATA));
                 PropertyState mimeTypeProp =
-                        (PropertyState) stateProvider.getItemState(new PropertyId(node.getUUID(), JCR_MIMETYPE));
+                        (PropertyState) stateProvider.getItemState(new PropertyId(node.getUUID(), QName.JCR_MIMETYPE));
 
                 // jcr:encoding is not mandatory
                 String encoding = null;
-                if (node.hasPropertyName(JCR_ENCODING)) {
+                if (node.hasPropertyName(QName.JCR_ENCODING)) {
                     PropertyState encodingProp =
-                            (PropertyState) stateProvider.getItemState(new PropertyId(node.getUUID(), JCR_ENCODING));
+                            (PropertyState) stateProvider.getItemState(new PropertyId(node.getUUID(), QName.JCR_ENCODING));
                     encodingProp.getValues()[0].internalValue().toString();
                 }
 

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/QueryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/QueryImpl.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/QueryImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/QueryImpl.java Sat Oct  1 15:18:50 2005
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.core.query.lucene;
 
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.core.ItemManager;
 import org.apache.jackrabbit.core.NodeId;
 import org.apache.jackrabbit.core.SessionImpl;
@@ -140,7 +139,7 @@
         // check for special query
         if (ALL_NODES.equals(root)) {
             return new WorkspaceTraversalResult(session,
-                    new QName[]{Constants.JCR_PATH},
+                    new QName[] { QName.JCR_PATH },
                     session.getNamespaceResolver());
         }
 
@@ -212,7 +211,7 @@
                 }
             }, null);
             if (ntName[0] == null) {
-                ntName[0] = Constants.NT_BASE;
+                ntName[0] = QName.NT_BASE;
             }
             NodeTypeImpl nt = session.getNodeTypeManager().getNodeType(ntName[0]);
             PropertyDefinition[] propDefs = nt.getPropertyDefinitions();
@@ -224,11 +223,11 @@
         }
 
         // add jcr:path and jcr:score if not selected already
-        if (!selectProps.contains(Constants.JCR_PATH)) {
-            selectProps.add(Constants.JCR_PATH);
+        if (!selectProps.contains(QName.JCR_PATH)) {
+            selectProps.add(QName.JCR_PATH);
         }
-        if (!selectProps.contains(Constants.JCR_SCORE)) {
-            selectProps.add(Constants.JCR_SCORE);
+        if (!selectProps.contains(QName.JCR_SCORE)) {
+            selectProps.add(QName.JCR_SCORE);
         }
 
         // return QueryResult

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/RowIteratorImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/RowIteratorImpl.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/RowIteratorImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/RowIteratorImpl.java Sat Oct  1 15:18:50 2005
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.core.query.lucene;
 
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.core.NodeImpl;
 import org.apache.jackrabbit.core.PropertyImpl;
 import org.apache.jackrabbit.name.IllegalNameException;
@@ -215,9 +214,9 @@
                         }
                     } else {
                         // property not set or jcr:path / jcr:score
-                        if (Constants.JCR_PATH.equals(properties[i])) {
+                        if (QName.JCR_PATH.equals(properties[i])) {
                             tmp[i] = PathValue.valueOf(node.getPath());
-                        } else if (Constants.JCR_SCORE.equals(properties[i])) {
+                        } else if (QName.JCR_SCORE.equals(properties[i])) {
                             tmp[i] = new LongValue((int) (score * 1000f));
                         } else {
                             tmp[i] = null;
@@ -265,9 +264,9 @@
                     }
                 } else {
                     // either jcr:score, jcr:path or not set
-                    if (Constants.JCR_PATH.equals(prop)) {
+                    if (QName.JCR_PATH.equals(prop)) {
                         return PathValue.valueOf(node.getPath());
-                    } else if (Constants.JCR_SCORE.equals(prop)) {
+                    } else if (QName.JCR_SCORE.equals(prop)) {
                         return new LongValue((int) (score * 1000f));
                     } else {
                         return null;

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java Sat Oct  1 15:18:50 2005
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.core.query.lucene;
 
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.core.ItemManager;
 import org.apache.jackrabbit.core.SessionImpl;
 import org.apache.jackrabbit.core.query.AbstractQueryHandler;
@@ -298,7 +297,7 @@
         SortField[] sortFields = new SortField[orderProps.length];
         for (int i = 0; i < orderProps.length; i++) {
             String prop = null;
-            if (Constants.JCR_SCORE.equals(orderProps[i])) {
+            if (QName.JCR_SCORE.equals(orderProps[i])) {
                 // order on jcr:score does not use the natural order as
                 // implemented in lucene. score ascending in lucene means that
                 // higher scores are first. JCR specs that lower score values

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java?rev=293034&r1=293033&r2=293034&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/sql/JCRSQLQueryBuilder.java Sat Oct  1 15:18:50 2005
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.core.query.sql;
 
-import org.apache.jackrabbit.Constants;
 import org.apache.jackrabbit.core.query.AndQueryNode;
 import org.apache.jackrabbit.core.query.LocationStepQueryNode;
 import org.apache.jackrabbit.core.query.NAryQueryNode;
@@ -256,7 +255,7 @@
 
         return node.childrenAccept(new DefaultParserVisitor() {
             public Object visit(ASTIdentifier node, Object data) {
-                if (!node.getName().equals(Constants.NT_BASE)) {
+                if (!node.getName().equals(QName.NT_BASE)) {
                     // node is either primary or mixin node type
                     NodeTypeQueryNode nodeType
                             = new NodeTypeQueryNode(constraintNode, node.getName());
@@ -297,7 +296,7 @@
             }, data);
             QName identifier = tmp[0];
 
-            if (identifier.equals(Constants.JCR_PATH)) {
+            if (identifier.equals(QName.JCR_PATH)) {
                 if (tmp[1] != null) {
                     // simply ignore, this is a join of a mixin node type
                 } else {



Mime
View raw message