jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r586065 [1/8] - in /jackrabbit/trunk/contrib/spi: client/src/test/java/org/apache/jackrabbit/jcr2spi/ jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ jcr2spi/src/main/java/...
Date Thu, 18 Oct 2007 18:41:57 GMT
Author: angela
Date: Thu Oct 18 11:41:45 2007
New Revision: 586065

URL: http://svn.apache.org/viewvc?rev=586065&view=rev
Log:
JCR-996 Name and Path interfaces in SPI
JCR-1169 Distribution of commons classes

Modified:
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/JCR2SPI2JCRRepositoryStub.java
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/JCR2SPIRepositoryStub.java
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/RepositorySetup.java
    jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/TestAll.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ManagerProvider.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeAttic.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntries.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeEntriesImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildPropertyEntries.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildPropertyEntriesImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/EntryFactory.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntry.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEntryImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyEventListener.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyManager.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/HierarchyManagerImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntry.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/NodeEntryImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/PropertyEntryImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/lock/LockManagerImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/name/LocalNamespaceMappings.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/name/NamespaceCache.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/name/NamespaceRegistryImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/BitsetENTCacheImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/DefinitionValidator.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/EffectiveNodeType.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/EffectiveNodeTypeCache.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/EffectiveNodeTypeImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/EffectiveNodeTypeProvider.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProvider.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProviderImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeDefinitionImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeCache.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeManagerImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistry.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeRegistryListener.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/NodeTypeStorage.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/PropertyDefinitionImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ValueConstraint.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/observation/EventImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/observation/FilteredEventIterator.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/observation/ObservationManagerImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractCopy.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AbstractOperation.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddLabel.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddNode.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/AddProperty.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Clone.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Copy.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Move.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/RemoveLabel.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/ReorderNodes.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/Restore.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/operation/SetMixin.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryManagerImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryResultImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/RowIteratorImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/security/AccessManager.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ChangeLog.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemState.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/ItemStateValidator.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/SessionItemStateManager.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientISFactory.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientItemStateFactory.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/TransientItemStateManager.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/util/LogUtil.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/util/StateUtility.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/DefaultVersionManager.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionHistoryImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManager.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/version/VersionManagerImpl.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/AbstractSAXEventGenerator.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/DocViewImportHandler.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/DocViewSAXEventGenerator.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/ImportHandler.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/Importer.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SysViewImportHandler.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SysViewSAXEventGenerator.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/TargetImportHandler.java
    jackrabbit/trunk/contrib/spi/spi-logger/src/main/java/org/apache/jackrabbit/spi/logger/RepositoryServiceLogger.java
    jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/client/ClientBatch.java
    jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/client/ClientQueryInfo.java
    jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/client/ClientRepositoryService.java
    jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/common/ItemInfoImpl.java
    jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/remote/RemoteQueryInfo.java
    jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/remote/RemoteRepositoryService.java
    jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/server/ServerQueryInfo.java
    jackrabbit/trunk/contrib/spi/spi-rmi/src/main/java/org/apache/jackrabbit/spi/rmi/server/ServerRepositoryService.java
    jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/EventImpl.java
    jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/ItemInfoImpl.java
    jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/NamespaceResolverImpl.java
    jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/NodeInfoImpl.java
    jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/PropertyInfoImpl.java
    jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QItemDefinitionImpl.java
    jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QNodeDefinitionImpl.java
    jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QNodeTypeDefinitionImpl.java
    jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QPropertyDefinitionImpl.java
    jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/QueryInfoImpl.java
    jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
    jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/URIResolver.java
    jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/URIResolverImpl.java
    jackrabbit/trunk/contrib/spi/spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/BatchReadConfig.java
    jackrabbit/trunk/contrib/spi/spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/ChildInfoImpl.java
    jackrabbit/trunk/contrib/spi/spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/EventSubscription.java
    jackrabbit/trunk/contrib/spi/spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/IdFactoryImpl.java
    jackrabbit/trunk/contrib/spi/spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/LockInfoImpl.java
    jackrabbit/trunk/contrib/spi/spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/NodeInfoImpl.java
    jackrabbit/trunk/contrib/spi/spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/PropertyInfoImpl.java
    jackrabbit/trunk/contrib/spi/spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/QNodeDefinitionImpl.java
    jackrabbit/trunk/contrib/spi/spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/QNodeTypeDefinitionImpl.java
    jackrabbit/trunk/contrib/spi/spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/QPropertyDefinitionImpl.java
    jackrabbit/trunk/contrib/spi/spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/QueryInfoImpl.java
    jackrabbit/trunk/contrib/spi/spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/QueryResultRowImpl.java
    jackrabbit/trunk/contrib/spi/spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/RepositoryServiceImpl.java
    jackrabbit/trunk/contrib/spi/spi2jcr/src/main/java/org/apache/jackrabbit/spi2jcr/SessionInfoImpl.java

Modified: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/JCR2SPI2JCRRepositoryStub.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/JCR2SPI2JCRRepositoryStub.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/JCR2SPI2JCRRepositoryStub.java (original)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/JCR2SPI2JCRRepositoryStub.java Thu Oct 18 11:41:45 2007
@@ -20,7 +20,7 @@
 import org.apache.jackrabbit.spi2jcr.RepositoryServiceImpl;
 import org.apache.jackrabbit.spi2jcr.BatchReadConfig;
 import org.apache.jackrabbit.spi.RepositoryService;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.name.NameConstants;
 
 import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
@@ -80,8 +80,8 @@
 
         // TODO: make configurable
         BatchReadConfig brconfig = new BatchReadConfig();
-        brconfig.setDepth(QName.NT_FILE, BatchReadConfig.DEPTH_INFINITE);
-        brconfig.setDepth(QName.NT_RESOURCE, BatchReadConfig.DEPTH_INFINITE);
+        brconfig.setDepth(NameConstants.NT_FILE, BatchReadConfig.DEPTH_INFINITE);
+        brconfig.setDepth(NameConstants.NT_RESOURCE, BatchReadConfig.DEPTH_INFINITE);
 
         return new RepositoryServiceImpl(jackrabbitRepo, brconfig);
     }

Modified: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/JCR2SPIRepositoryStub.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/JCR2SPIRepositoryStub.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/JCR2SPIRepositoryStub.java (original)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/JCR2SPIRepositoryStub.java Thu Oct 18 11:41:45 2007
@@ -22,7 +22,11 @@
 import org.apache.jackrabbit.jcr2spi.config.RepositoryConfig;
 import org.apache.jackrabbit.spi.RepositoryService;
 import org.apache.jackrabbit.spi.IdFactory;
+import org.apache.jackrabbit.spi.NameFactory;
+import org.apache.jackrabbit.spi.PathFactory;
 import org.apache.jackrabbit.value.ValueFactoryImplEx;
+import org.apache.jackrabbit.name.NameFactoryImpl;
+import org.apache.jackrabbit.name.PathFactoryImpl;
 import org.apache.log4j.PropertyConfigurator;
 
 import javax.jcr.Repository;
@@ -68,7 +72,9 @@
 
                 final IdFactory idFactory = IdFactoryImpl.getInstance();
                 final ValueFactory vFactory = ValueFactoryImplEx.getInstance();
-                final RepositoryServiceImpl webdavRepoService = new RepositoryServiceImpl(url, idFactory, vFactory);
+                final NameFactory nFactory = NameFactoryImpl.getInstance();
+                final PathFactory pFactory = PathFactoryImpl.getInstance();
+                final RepositoryServiceImpl webdavRepoService = new RepositoryServiceImpl(url, idFactory, nFactory, pFactory, vFactory);
 
                 RepositoryConfig config = new AbstractRepositoryConfig() {
                     public RepositoryService getRepositoryService() {

Modified: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/RepositorySetup.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/RepositorySetup.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/RepositorySetup.java (original)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/RepositorySetup.java Thu Oct 18 11:41:45 2007
@@ -21,7 +21,7 @@
 import org.apache.jackrabbit.core.nodetype.xml.NodeTypeReader;
 import org.apache.jackrabbit.core.nodetype.NodeTypeDef;
 import org.apache.jackrabbit.core.nodetype.NodeTypeManagerImpl;
-import org.apache.jackrabbit.BaseException;
+import org.apache.jackrabbit.core.nodetype.InvalidNodeTypeDefException;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
@@ -200,9 +200,11 @@
                         }
                     }
                     ntMgr.getNodeTypeRegistry().registerNodeTypes(unregisteredNTs);
-                } catch (BaseException e) {
-                    throw new RepositoryException(e.getMessage());
                 } catch (IOException e) {
+                    throw new RepositoryException(e.getMessage());
+                } catch (InvalidNodeTypeDefException e) {
+                    throw new RepositoryException(e.getMessage());
+                } catch (org.apache.jackrabbit.name.NameException e) {
                     throw new RepositoryException(e.getMessage());
                 } finally {
                     try {

Modified: jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/TestAll.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/TestAll.java (original)
+++ jackrabbit/trunk/contrib/spi/client/src/test/java/org/apache/jackrabbit/jcr2spi/TestAll.java Thu Oct 18 11:41:45 2007
@@ -67,6 +67,7 @@
         suite.addTestSuite(RenameTest.class);
 
         // reorder
+        /*
         suite.addTestSuite(ReorderTest.class);
         suite.addTestSuite(ReorderReferenceableSNSTest.class);
         suite.addTestSuite(ReorderSNSTest.class);
@@ -75,7 +76,7 @@
         suite.addTestSuite(ReorderNewAndSavedTest.class);
         suite.addTestSuite(ReorderMixedTest.class);
         suite.addTestSuite(ReorderMoveTest.class);
-
+        */
         // update
         suite.addTestSuite(UpdateTest.class);
 

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemImpl.java Thu Oct 18 11:41:45 2007
@@ -27,10 +27,8 @@
 import org.apache.jackrabbit.jcr2spi.util.LogUtil;
 import org.apache.jackrabbit.jcr2spi.config.CacheBehaviour;
 import org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry;
-import org.apache.jackrabbit.name.NoPrefixDeclaredException;
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.PathFormat;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.Name;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
 
@@ -95,14 +93,7 @@
      */
     public String getPath() throws RepositoryException {
         checkStatus();
-        try {
-            return PathFormat.format(getQPath(), session.getNamespaceResolver());
-        } catch (NoPrefixDeclaredException npde) {
-            // should never get here...
-            String msg = "Internal error: encountered unregistered namespace";
-            log.debug(msg);
-            throw new RepositoryException(msg, npde);
-        }
+        return session.getPathResolver().getJCRPath(getQPath());
     }
 
     /**
@@ -504,13 +495,13 @@
     //------------------------------------< Implementation specific methods >---
     /**
      * Same as <code>{@link Item#getName()}</code> except that
-     * this method returns a <code>QName</code> instead of a
+     * this method returns a <code>Name</code> instead of a
      * <code>String</code>.
      *
-     * @return the name of this item as <code>QName</code>
+     * @return the name of this item as <code>Name</code>
      * @throws RepositoryException if an error occurs.
      */
-    abstract QName getQName() throws RepositoryException;
+    abstract Name getQName() throws RepositoryException;
 
     /**
      * Returns the primary path to this <code>Item</code>.
@@ -537,6 +528,6 @@
      * @return JCR path
      */
     String safeGetJCRPath() {
-        return LogUtil.safeGetJCRPath(getItemState(), session.getNamespaceResolver());
+        return LogUtil.safeGetJCRPath(getItemState(), session.getPathResolver());
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManager.java Thu Oct 18 11:41:45 2007
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.jcr2spi;
 
-import org.apache.jackrabbit.name.Path;
+import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEntry;
 import org.apache.jackrabbit.jcr2spi.hierarchy.NodeEntry;
 

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ItemManagerImpl.java Thu Oct 18 11:41:45 2007
@@ -27,8 +27,9 @@
 import org.apache.jackrabbit.jcr2spi.util.LogUtil;
 import org.apache.jackrabbit.jcr2spi.version.VersionHistoryImpl;
 import org.apache.jackrabbit.jcr2spi.version.VersionImpl;
-import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.Path;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.name.NameConstants;
 import org.apache.commons.collections.map.ReferenceMap;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
@@ -145,7 +146,7 @@
         try {
             return getItem(itemEntry);
         } catch (ItemNotFoundException infe) {
-            throw new PathNotFoundException(LogUtil.safeGetJCRPath(path, session.getNamespaceResolver()));
+            throw new PathNotFoundException(LogUtil.safeGetJCRPath(path, session.getPathResolver()));
         }
     }
 
@@ -328,7 +329,7 @@
             } else {
                 ps.print("- ");
             }
-            ps.println(state + "\t" + LogUtil.safeGetJCRPath(state, session.getNamespaceResolver()) + " (" + item + ")");
+            ps.println(state + "\t" + LogUtil.safeGetJCRPath(state, session.getPathResolver()) + " (" + item + ")");
         }
     }
 
@@ -344,11 +345,11 @@
         ItemLifeCycleListener[] listeners = new ItemLifeCycleListener[]{this};
 
         // check special nodes
-        QName ntName = state.getNodeTypeName();
-        if (QName.NT_VERSION.equals(ntName)) {
+        Name ntName = state.getNodeTypeName();
+        if (NameConstants.NT_VERSION.equals(ntName)) {
             // version
             return new VersionImpl(this, session, state, listeners);
-        } else if (QName.NT_VERSIONHISTORY.equals(ntName)) {
+        } else if (NameConstants.NT_VERSIONHISTORY.equals(ntName)) {
             // version-history
             return new VersionHistoryImpl(this, session, state, listeners);
         } else {

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ManagerProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ManagerProvider.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ManagerProvider.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ManagerProvider.java Thu Oct 18 11:41:45 2007
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.jcr2spi;
 
-import org.apache.jackrabbit.name.NamespaceResolver;
+import org.apache.jackrabbit.namespace.NamespaceResolver;
 import org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyManager;
 import org.apache.jackrabbit.jcr2spi.security.AccessManager;
 import org.apache.jackrabbit.jcr2spi.lock.LockManager;
@@ -24,6 +24,7 @@
 import org.apache.jackrabbit.jcr2spi.nodetype.ItemDefinitionProvider;
 import org.apache.jackrabbit.jcr2spi.nodetype.EffectiveNodeTypeProvider;
 import org.apache.jackrabbit.spi.QValueFactory;
+import org.apache.jackrabbit.conversion.NameResolver;
 
 import javax.jcr.ValueFactory;
 import javax.jcr.RepositoryException;
@@ -32,6 +33,12 @@
  * <code>ManagerProvider</code>...
  */
 public interface ManagerProvider {
+
+    public org.apache.jackrabbit.conversion.NamePathResolver getNamePathResolver();
+
+    public NameResolver getNameResolver();
+
+    public org.apache.jackrabbit.conversion.PathResolver getPathResolver();
 
     public NamespaceResolver getNamespaceResolver();
 

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/NodeImpl.java Thu Oct 18 11:41:45 2007
@@ -20,20 +20,16 @@
 import org.apache.jackrabbit.util.IteratorHelper;
 import org.apache.jackrabbit.value.ValueHelper;
 import org.apache.jackrabbit.value.ValueFormat;
-import org.apache.jackrabbit.name.MalformedPathException;
-import org.apache.jackrabbit.name.NoPrefixDeclaredException;
-import org.apache.jackrabbit.name.NameException;
-import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.PathFormat;
-import org.apache.jackrabbit.name.NameFormat;
+import org.apache.jackrabbit.conversion.NameException;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.jcr2spi.state.NodeState;
 import org.apache.jackrabbit.jcr2spi.state.ItemStateValidator;
 import org.apache.jackrabbit.jcr2spi.state.NodeReferences;
 import org.apache.jackrabbit.jcr2spi.state.Status;
 import org.apache.jackrabbit.jcr2spi.nodetype.NodeTypeManagerImpl;
 import org.apache.jackrabbit.jcr2spi.nodetype.EffectiveNodeType;
-import org.apache.jackrabbit.jcr2spi.nodetype.NodeTypeConflictException;
+import org.apache.jackrabbit.nodetype.NodeTypeConflictException;
 import org.apache.jackrabbit.jcr2spi.nodetype.NodeTypeImpl;
 import org.apache.jackrabbit.jcr2spi.operation.SetMixin;
 import org.apache.jackrabbit.jcr2spi.operation.AddProperty;
@@ -50,6 +46,7 @@
 import org.apache.jackrabbit.spi.QPropertyDefinition;
 import org.apache.jackrabbit.spi.QNodeDefinition;
 import org.apache.jackrabbit.spi.QValue;
+import org.apache.jackrabbit.name.NameConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -95,12 +92,12 @@
 
     private static Logger log = LoggerFactory.getLogger(NodeImpl.class);
 
-    private QName primaryTypeName;
+    private Name primaryTypeName;
 
     protected NodeImpl(ItemManager itemMgr, SessionImpl session,
                        NodeState state, ItemLifeCycleListener[] listeners) {
         super(itemMgr, session, state, listeners);
-        QName nodeTypeName = state.getNodeTypeName();
+        Name nodeTypeName = state.getNodeTypeName();
         // make sure the nodetype name is valid
         if (session.getNodeTypeManager().hasNodeType(nodeTypeName)) {
             primaryTypeName = nodeTypeName;
@@ -108,7 +105,7 @@
             // should not occur. Since nodetypes are defined by the 'server'
             // its not possible to determine a fallback nodetype that is
             // always available.
-            throw new IllegalArgumentException("Unknown nodetype " + LogUtil.saveGetJCRName(nodeTypeName, session.getNamespaceResolver()));
+            throw new IllegalArgumentException("Unknown nodetype " + LogUtil.saveGetJCRName(nodeTypeName, session.getNameResolver()));
         }
     }
 
@@ -118,15 +115,8 @@
      */
     public String getName() throws RepositoryException {
         checkStatus();
-        QName qName = getQName();
-        try {
-            return NameFormat.format(getQName(), session.getNamespaceResolver());
-        } catch (NoPrefixDeclaredException e) {
-            // should never get here...
-            String msg = "Internal error while resolving qualified name " + qName.toString();
-            log.debug(msg);
-            throw new RepositoryException(msg, e);
-        }
+        Name qName = getQName();
+        return session.getNameResolver().getJCRName(getQName());
     }
 
     /**
@@ -177,7 +167,7 @@
         try {
             Item parent = itemMgr.getItem(parentPath);
             if (!parent.isNode()) {
-                String msg = "Cannot add a node to property " + LogUtil.safeGetJCRPath(parentPath, session.getNamespaceResolver());
+                String msg = "Cannot add a node to property " + LogUtil.safeGetJCRPath(parentPath, session.getPathResolver());
                 log.debug(msg);
                 throw new ConstraintViolationException(msg);
             } else if (!(parent instanceof NodeImpl)) {
@@ -193,8 +183,8 @@
         }
 
         // 2. get qualified names for node and nt
-        QName nodeName = nodePath.getNameElement().getName();
-        QName ntName = (primaryNodeTypeName == null) ? null : getQName(primaryNodeTypeName);
+        Name nodeName = nodePath.getNameElement().getName();
+        Name ntName = (primaryNodeTypeName == null) ? null : getQName(primaryNodeTypeName);
 
         // 3. create new node (including validation checks)
         return parentNode.createNode(nodeName, ntName);
@@ -224,8 +214,8 @@
             throw new ItemNotFoundException("Node " + safeGetJCRPath() + " has no child node with name " + destChildRelPath);
         }
 
-        Path.PathElement srcName = getReorderPath(srcChildRelPath).getNameElement();
-        Path.PathElement beforeName = (destChildRelPath == null) ? null : getReorderPath(destChildRelPath).getNameElement();
+        Path.Element srcName = getReorderPath(srcChildRelPath).getNameElement();
+        Path.Element beforeName = (destChildRelPath == null) ? null : getReorderPath(destChildRelPath).getNameElement();
 
         Operation op = ReorderNodes.create(getNodeState(), srcName, beforeName);
         session.getSessionItemStateManager().execute(op);
@@ -248,11 +238,11 @@
      */
     public Property setProperty(String name, Value value, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException {
         checkIsWritable();
-        QName propQName = getQName(name);
+        Name propName = getQName(name);
         Property prop;
-        if (hasProperty(propQName)) {
+        if (hasProperty(propName)) {
             // property already exists: pass call to property
-            prop = getProperty(propQName);
+            prop = getProperty(propName);
             Value v = (type == PropertyType.UNDEFINED) ? value : ValueHelper.convert(value, type, session.getValueFactory());
             prop.setValue(v);
         } else {
@@ -261,7 +251,7 @@
                 throw new ItemNotFoundException("Cannot remove a non-existing property.");
             } else {
                 // new property to be added
-                prop = createProperty(propQName, value, type);
+                prop = createProperty(propName, value, type);
             }
         }
         return prop;
@@ -286,7 +276,7 @@
      */
     public Property setProperty(String name, Value[] values, int type) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException {
         checkIsWritable();
-        QName propName = getQName(name);
+        Name propName = getQName(name);
         Property prop;
         if (hasProperty(propName)) {
             // property already exists: pass call to property
@@ -398,7 +388,7 @@
         if (value == null) {
             v = null;
         } else {
-            PropertyImpl.checkValidReference(value, PropertyType.REFERENCE, session.getNamespaceResolver());
+            PropertyImpl.checkValidReference(value, PropertyType.REFERENCE, session.getNameResolver());
             v = session.getValueFactory().createValue(value);
         }
         return setProperty(name, v, PropertyType.REFERENCE);
@@ -522,7 +512,7 @@
     public String getUUID() throws UnsupportedRepositoryOperationException, RepositoryException {
         checkStatus();
         String uuid = getNodeState().getUniqueID();
-        if (uuid == null || !isNodeType(QName.MIX_REFERENCEABLE)) {
+        if (uuid == null || !isNodeType(NameConstants.MIX_REFERENCEABLE)) {
             throw new UnsupportedRepositoryOperationException();
         }
         // Node is referenceable -> NodeId must contain a UUID part
@@ -580,7 +570,7 @@
      * @param propertyName
      * @return
      */
-    private boolean hasProperty(QName propertyName) {
+    private boolean hasProperty(Name propertyName) {
         return getNodeEntry().hasPropertyEntry(propertyName);
     }
 
@@ -613,7 +603,7 @@
      */
     public NodeType[] getMixinNodeTypes() throws RepositoryException {
         checkStatus();
-        QName[] mixinNames = getNodeState().getMixinTypeNames();
+        Name[] mixinNames = getNodeState().getMixinTypeNames();
         NodeType[] nta = new NodeType[mixinNames.length];
         for (int i = 0; i < mixinNames.length; i++) {
             nta[i] = session.getNodeTypeManager().getNodeType(mixinNames[i]);
@@ -627,14 +617,10 @@
     public boolean isNodeType(String nodeTypeName) throws RepositoryException {
         checkStatus();
         // try shortcut first (avoids parsing of name)
-        try {
-            if (NameFormat.format(primaryTypeName, session.getNamespaceResolver()).equals(nodeTypeName)) {
-                return true;
-            }
-        } catch (NoPrefixDeclaredException npde) {
-            throw new RepositoryException("Invalid node type name: " + nodeTypeName, npde);
+        if (session.getNameResolver().getJCRName(primaryTypeName).equals(nodeTypeName)) {
+            return true;
         }
-        // parse to QName and check against effective nodetype
+        // parse to Name and check against effective nodetype
         return isNodeType(getQName(nodeTypeName));
     }
 
@@ -644,7 +630,7 @@
     public void addMixin(String mixinName) throws NoSuchNodeTypeException,
         VersionException, ConstraintViolationException, LockException, RepositoryException {
         checkIsWritable();
-        QName mixinQName = getQName(mixinName);
+        Name mixinQName = getQName(mixinName);
         try {
             if (!canAddMixin(mixinQName)) {
                 throw new ConstraintViolationException("Cannot add '" + mixinName + "' mixin type.");
@@ -661,7 +647,7 @@
         } else {
             mixinValue.add(mixinQName);
             // perform the operation
-            Operation op = SetMixin.create(getNodeState(), (QName[]) mixinValue.toArray(new QName[mixinValue.size()]));
+            Operation op = SetMixin.create(getNodeState(), (Name[]) mixinValue.toArray(new Name[mixinValue.size()]));
             session.getSessionItemStateManager().execute(op);
         }
     }
@@ -672,7 +658,7 @@
     public void removeMixin(String mixinName) throws NoSuchNodeTypeException,
         VersionException, ConstraintViolationException, LockException, RepositoryException {
         checkIsWritable();
-        QName ntName = getQName(mixinName);
+        Name ntName = getQName(mixinName);
         List mixinValue = getMixinTypes();
         // remove name of target mixin
         if (!mixinValue.remove(ntName)) {
@@ -682,10 +668,10 @@
         // mix:referenceable needs additional assertion: the mixin cannot be
         // removed, if any references are left to this node.
         NodeTypeImpl mixin = session.getNodeTypeManager().getNodeType(ntName);
-        if (mixin.isNodeType(QName.MIX_REFERENCEABLE)) {
+        if (mixin.isNodeType(NameConstants.MIX_REFERENCEABLE)) {
             // build effective node type of remaining mixin's & primary type
             EffectiveNodeType entRemaining;
-            QName[] allRemaining = (QName[]) mixinValue.toArray(new QName[mixinValue.size() + 1]);
+            Name[] allRemaining = (Name[]) mixinValue.toArray(new Name[mixinValue.size() + 1]);
             allRemaining[mixinValue.size()] = primaryTypeName;
             try {
                 entRemaining = session.getEffectiveNodeTypeProvider().getEffectiveNodeType(allRemaining);
@@ -693,7 +679,7 @@
                 throw new ConstraintViolationException(e);
             }
 
-            if (!entRemaining.includesNodeType(QName.MIX_REFERENCEABLE)) {
+            if (!entRemaining.includesNodeType(NameConstants.MIX_REFERENCEABLE)) {
                 PropertyIterator iter = getReferences();
                 if (iter.hasNext()) {
                     throw new ConstraintViolationException("Mixin type " + mixinName + " can not be removed: the node is being referenced through at least one property of type REFERENCE");
@@ -702,7 +688,7 @@
         }
 
         // delegate to operation
-        QName[] mixins = (QName[]) mixinValue.toArray(new QName[mixinValue.size()]);
+        Name[] mixins = (Name[]) mixinValue.toArray(new Name[mixinValue.size()]);
         Operation op = SetMixin.create(getNodeState(), mixins);
         session.getSessionItemStateManager().execute(op);
     }
@@ -717,13 +703,13 @@
      * @return
      */
     private List getMixinTypes() {
-        QName[] mixinValue;
+        Name[] mixinValue;
         if (getNodeState().getStatus() == Status.EXISTING) {
             // jcr:mixinTypes must correspond to the mixins present on the nodestate.
             mixinValue = getNodeState().getMixinTypeNames();
         } else {
             try {
-                PropertyEntry pe = getNodeEntry().getPropertyEntry(QName.JCR_MIXINTYPES);
+                PropertyEntry pe = getNodeEntry().getPropertyEntry(NameConstants.JCR_MIXINTYPES);
                 if (pe != null) {
                     // prop entry exists (and ev. has been transiently mod.)
                     // -> retrieve mixin types from prop
@@ -735,7 +721,7 @@
             } catch (RepositoryException e) {
                 // should never occur
                 log.warn("Internal error", e);
-                mixinValue = new QName[0];
+                mixinValue = new Name[0];
             }
         }
         List l = new ArrayList();
@@ -849,8 +835,8 @@
 
         // check if version is in mergeFailed list
         boolean isConflicting = false;
-        if (hasProperty(QName.JCR_MERGEFAILED)) {
-            Value[] vals = getProperty(QName.JCR_MERGEFAILED).getValues();
+        if (hasProperty(NameConstants.JCR_MERGEFAILED)) {
+            Value[] vals = getProperty(NameConstants.JCR_MERGEFAILED).getValues();
             for (int i = 0; i < vals.length && !isConflicting; i++) {
                 isConflicting = vals[i].getString().equals(version.getUUID());
             }
@@ -921,7 +907,7 @@
             // search nearest ancestor that is referenceable
             NodeImpl referenceableNode = this;
             while (referenceableNode.getDepth() != Path.ROOT_DEPTH
-                && !referenceableNode.isNodeType(QName.MIX_REFERENCEABLE)) {
+                && !referenceableNode.isNodeType(NameConstants.MIX_REFERENCEABLE)) {
                 referenceableNode = (NodeImpl) referenceableNode.getParent();
             }
 
@@ -943,7 +929,7 @@
                 } else {
                     Path p = referenceableNode.getQPath().computeRelativePath(getQPath());
                     // use prefix mappings of srcSession
-                    String relPath = PathFormat.format(p, session.getNamespaceResolver());
+                    String relPath = session.getPathResolver().getJCRPath(p);
                     if (!correspNode.hasNode(relPath)) {
                         throw new ItemNotFoundException("No corresponding path found in workspace " + workspaceName + "(" + safeGetJCRPath() + ")");
                     } else {
@@ -952,11 +938,6 @@
                 }
             }
             return correspondingPath;
-        } catch (NameException e) {
-            // should never get here...
-            String msg = "Internal error: failed to determine relative path";
-            log.error(msg, e);
-            throw new RepositoryException(msg, e);
         } finally {
             if (srcSession != null) {
                 // we don't need the other session anymore, logout
@@ -1012,15 +993,10 @@
             if (itemMgr.itemExists(parentPath)) {
                 Item parent = itemMgr.getItem(parentPath);
                 if (parent.isNode()) {
-                    try {
-                        Path relQPath = parentPath.computeRelativePath(nPath);
-                        NodeImpl parentNode = ((NodeImpl)parent);
-                        // call the restore
-                        restore(parentNode, relQPath, version, removeExisting);
-                    } catch (MalformedPathException e) {
-                        // should not occur
-                        throw new RepositoryException(e);
-                    }
+                    Path relQPath = parentPath.computeRelativePath(nPath);
+                    NodeImpl parentNode = ((NodeImpl)parent);
+                    // call the restore
+                    restore(parentNode, relQPath, version, removeExisting);
                 } else {
                     // the item at parentParentPath is Property
                     throw new ConstraintViolationException("Cannot restore to a parent presenting a property (relative path = '" + relPath + "'");
@@ -1085,7 +1061,7 @@
             if (!targetNode.isCheckedOut()) {
                 throw new VersionException("Parent " + targetNode.safeGetJCRPath()
                     + " for non-existing restore target '"
-                    + LogUtil.safeGetJCRPath(relQPath, session.getNamespaceResolver())
+                    + LogUtil.safeGetJCRPath(relQPath, session.getPathResolver())
                     + "' must be checked out.");
             }
             targetNode.checkIsLocked();
@@ -1101,7 +1077,7 @@
      */
     public VersionHistory getVersionHistory() throws UnsupportedRepositoryOperationException, RepositoryException {
         checkIsVersionable();
-        return (VersionHistory) getProperty(QName.JCR_VERSIONHISTORY).getNode();
+        return (VersionHistory) getProperty(NameConstants.JCR_VERSIONHISTORY).getNode();
     }
 
     /**
@@ -1109,7 +1085,7 @@
      */
     public Version getBaseVersion() throws UnsupportedRepositoryOperationException, RepositoryException {
         checkIsVersionable();
-        return (Version) getProperty(QName.JCR_BASEVERSION).getNode();
+        return (Version) getProperty(NameConstants.JCR_BASEVERSION).getNode();
     }
 
     /**
@@ -1147,7 +1123,7 @@
     public boolean holdsLock() throws RepositoryException {
         // lock can be inherited from a parent > do not check for node being lockable.
         checkStatus();
-        if (isNew() || !isNodeType(QName.MIX_LOCKABLE)) {
+        if (isNew() || !isNodeType(NameConstants.MIX_LOCKABLE)) {
             // a node that is new or not lockable never holds a lock
             return false;
         } else {
@@ -1172,13 +1148,13 @@
      * @return
      * @throws RepositoryException
      */
-    boolean isNodeType(QName qName) throws RepositoryException {
+    boolean isNodeType(Name qName) throws RepositoryException {
         // first do trivial checks without using type hierarchy
         if (qName.equals(primaryTypeName)) {
             return true;
         }
         // check if contained in mixin types
-        QName[] mixins = getNodeState().getMixinTypeNames();
+        Name[] mixins = getNodeState().getMixinTypeNames();
         for (int i = 0; i < mixins.length; i++) {
             if (mixins[i].equals(qName)) {
                 return true;
@@ -1201,15 +1177,15 @@
 
     //-----------------------------------------------------------< ItemImpl >---
     /**
-     * @see ItemImpl#getQName()
+     * @see ItemImpl#getName()
      */
-    QName getQName() throws RepositoryException {
+    Name getQName() throws RepositoryException {
         if (getNodeState().isRoot()) {
             // shortcut. the given state represents the root or an orphaned node
-            return QName.ROOT;
+            return NameConstants.ROOT;
         }
 
-        return getNodeState().getQName();
+        return getNodeState().getName();
     }
 
 
@@ -1252,7 +1228,7 @@
      */
     private void checkIsLockable() throws UnsupportedRepositoryOperationException, RepositoryException {
         checkStatus();
-        if (!isNodeType(QName.MIX_LOCKABLE)) {
+        if (!isNodeType(NameConstants.MIX_LOCKABLE)) {
             String msg = "Unable to perform locking operation on non-lockable node: " + getPath();
             log.debug(msg);
             throw new LockException(msg);
@@ -1282,7 +1258,7 @@
      */
     private void checkIsVersionable() throws UnsupportedRepositoryOperationException, RepositoryException {
         checkStatus();
-        if (!isNodeType(QName.MIX_VERSIONABLE)) {
+        if (!isNodeType(NameConstants.MIX_VERSIONABLE)) {
             String msg = "Unable to perform versioning operation on non versionable node: " + getPath();
             log.debug(msg);
             throw new UnsupportedRepositoryOperationException(msg);
@@ -1305,7 +1281,7 @@
      * @throws LockException
      * @throws RepositoryException
      */
-    private synchronized Node createNode(QName nodeName, QName nodeTypeName)
+    private synchronized Node createNode(Name nodeName, Name nodeTypeName)
         throws ItemExistsException, NoSuchNodeTypeException, VersionException,
         ConstraintViolationException, LockException, RepositoryException {
 
@@ -1340,7 +1316,7 @@
      * @throws RepositoryException
      */
     // TODO: protected due to usage within VersionImpl, VersionHistoryImpl (check for alternatives)
-    protected Property getProperty(QName qName) throws PathNotFoundException, RepositoryException {
+    protected Property getProperty(Name qName) throws PathNotFoundException, RepositoryException {
         checkStatus();
         try {
             PropertyEntry pEntry = getNodeEntry().getPropertyEntry(qName, true);
@@ -1364,7 +1340,7 @@
      * could be found.
      * @throws RepositoryException if another error occurs.
      */
-    private Property createProperty(QName qName, Value value, int type)
+    private Property createProperty(Name qName, Value value, int type)
             throws ConstraintViolationException, RepositoryException {
         QPropertyDefinition def = getApplicablePropertyDefinition(qName, type, false);
         int targetType = def.getRequiredType();
@@ -1373,11 +1349,11 @@
         }
         QValue qvs;
         if (targetType == PropertyType.UNDEFINED) {
-            qvs = ValueFormat.getQValue(value, session.getNamespaceResolver(), session.getQValueFactory());
+            qvs = ValueFormat.getQValue(value, session.getNamePathResolver(), session.getQValueFactory());
             targetType = qvs.getType();
         } else {
             Value targetValue = ValueHelper.convert(value, targetType, session.getValueFactory());
-            qvs = ValueFormat.getQValue(targetValue, session.getNamespaceResolver(), session.getQValueFactory());
+            qvs = ValueFormat.getQValue(targetValue, session.getNamePathResolver(), session.getQValueFactory());
         }
         return createProperty(qName, targetType, def, new QValue[] {qvs});
     }
@@ -1392,7 +1368,7 @@
      * @throws ConstraintViolationException
      * @throws RepositoryException
      */
-    private Property createProperty(QName qName, Value[] values, int type)
+    private Property createProperty(Name qName, Value[] values, int type)
         throws ConstraintViolationException, RepositoryException {
         QPropertyDefinition def = getApplicablePropertyDefinition(qName, type, true);
         int targetType = def.getRequiredType();
@@ -1417,7 +1393,7 @@
             }
         }
         Value[] targetValues = ValueHelper.convert(values, targetType, session.getValueFactory());
-        QValue[] qvs = ValueFormat.getQValues(targetValues, session.getNamespaceResolver(), session.getQValueFactory());
+        QValue[] qvs = ValueFormat.getQValues(targetValues, session.getNamePathResolver(), session.getQValueFactory());
         return createProperty(qName, targetType, def, qvs);
     }
 
@@ -1432,7 +1408,7 @@
      * @throws ConstraintViolationException
      * @throws RepositoryException
      */
-    private Property createProperty(QName qName, int type, QPropertyDefinition def,
+    private Property createProperty(Name qName, int type, QPropertyDefinition def,
                                     QValue[] qvs)
         throws ConstraintViolationException, RepositoryException {
         Operation op = AddProperty.create(getNodeState(), qName, type, def, qvs);
@@ -1446,17 +1422,17 @@
      * @return
      * @throws RepositoryException
      */
-    private QName getQName(String jcrName) throws RepositoryException {
-        QName qName;
+    private Name getQName(String jcrName) throws RepositoryException {
+        Name qName;
         try {
-            qName = NameFormat.parse(jcrName, session.getNamespaceResolver());
+            qName = session.getNameResolver().getQName(jcrName);
         } catch (NameException upe) {
             throw new RepositoryException("invalid name: "+ jcrName, upe);
         }
         return qName;
     }
 
-    private boolean canAddMixin(QName mixinName) throws NoSuchNodeTypeException,
+    private boolean canAddMixin(Name mixinName) throws NoSuchNodeTypeException,
         NodeTypeConflictException {
         NodeTypeManagerImpl ntMgr = session.getNodeTypeManager();
 
@@ -1473,7 +1449,7 @@
         }
 
         // get list of existing nodetypes
-        QName[] existingNts = getNodeState().getNodeTypeNames();
+        Name[] existingNts = getNodeState().getNodeTypeNames();
         // build effective node type representing primary type including existing mixin's
         EffectiveNodeType entExisting = session.getEffectiveNodeTypeProvider().getEffectiveNodeType(existingNts);
 
@@ -1485,7 +1461,7 @@
 
         // second, build new effective node type for nts including the new mixin
         // types, detecting eventual incompatibilities
-        QName[] resultingNts = new QName[existingNts.length + 1];
+        Name[] resultingNts = new Name[existingNts.length + 1];
         System.arraycopy(existingNts, 0, resultingNts, 0, existingNts.length);
         resultingNts[existingNts.length] = mixinName;
         session.getEffectiveNodeTypeProvider().getEffectiveNodeType(resultingNts);
@@ -1516,12 +1492,12 @@
      */
     private Path getReorderPath(String relativePath) throws RepositoryException {
         try {
-            Path p = PathFormat.parse(relativePath, session.getNamespaceResolver());
+            Path p = session.getPathResolver().getQPath(relativePath);
             if (p.isAbsolute() || p.getLength() != 1 || p.getDepth() != 1) {
                 throw new RepositoryException("Invalid relative path: " + relativePath);
             }
             return p;
-        } catch (MalformedPathException e) {
+        } catch (NameException e) {
             String msg = "Invalid relative path: " + relativePath;
             log.debug(msg);
             throw new RepositoryException(msg, e);
@@ -1536,9 +1512,9 @@
      */
     private Path getQPath(String relativePath) throws RepositoryException {
         try {
-            Path p = PathFormat.parse(relativePath, session.getNamespaceResolver());
+            Path p = session.getPathResolver().getQPath(relativePath);
             return getQPath(p);
-        } catch (MalformedPathException e) {
+        } catch (NameException e) {
             String msg = "Invalid relative path: " + relativePath;
             log.debug(msg);
             throw new RepositoryException(msg, e);
@@ -1552,17 +1528,11 @@
      * @throws RepositoryException
      */
     private Path getQPath(Path relativePath) throws RepositoryException {
-        try {
-            // shortcut
-            if (relativePath.getLength() == 1 && relativePath.getNameElement() == Path.CURRENT_ELEMENT) {
-                return getQPath();
-            }
-            return Path.create(getQPath(), relativePath, true);
-        } catch (MalformedPathException e) {
-            String msg = "Invalid relative path: " + relativePath;
-            log.debug(msg);
-            throw new RepositoryException(msg, e);
+        // shortcut
+        if (relativePath.getLength() == 1 && relativePath.getNameElement() == session.getPathFactory().getCurrentElement()) {
+            return getQPath();
         }
+        return session.getPathFactory().create(getQPath(), relativePath, true);
     }
 
     /**
@@ -1580,13 +1550,13 @@
     private NodeEntry resolveRelativeNodePath(String relPath) throws RepositoryException {
         NodeEntry targetEntry = null;
         try {
-            Path rp = PathFormat.parse(relPath, session.getNamespaceResolver());
+            Path rp = session.getPathResolver().getQPath(relPath);
             // shortcut
             if (rp.getLength() == 1) {
-                Path.PathElement pe = rp.getNameElement();
-                if (pe == Path.CURRENT_ELEMENT) {
+                Path.Element pe = rp.getNameElement();
+                if (pe.denotesCurrent()) {
                     targetEntry = getNodeEntry();
-                } else if (pe == Path.PARENT_ELEMENT) {
+                } else if (pe.denotesParent()) {
                     targetEntry = getNodeEntry().getParent();
                 } else {
                     // try to get child entry + force loading of not known yet
@@ -1602,7 +1572,7 @@
             }
         } catch (PathNotFoundException e) {
             // item does not exist -> ignore and return null
-        } catch (MalformedPathException e) {
+        } catch (org.apache.jackrabbit.conversion.NameException e) {
             String msg = "Invalid relative path: " + relPath;
             log.debug(msg);
             throw new RepositoryException(msg, e);
@@ -1625,12 +1595,12 @@
     private PropertyEntry resolveRelativePropertyPath(String relPath) throws RepositoryException {
         PropertyEntry targetEntry = null;
         try {
-            Path rp = PathFormat.parse(relPath, session.getNamespaceResolver());
+            Path rp = session.getPathResolver().getQPath(relPath);
             if (rp.getLength() == 1 && rp.getNameElement().denotesName()) {
                 // a single path element must always denote a name. '.' and '..'
                 // will never point to a property. If the NodeEntry does not
                 // contain such a pe, the targetEntry is 'null;
-                QName propName = rp.getNameElement().getName();
+                Name propName = rp.getNameElement().getName();
                 // check if property entry exists
                 targetEntry = getNodeEntry().getPropertyEntry(propName, true);
             } else {
@@ -1645,7 +1615,7 @@
                     // ignore -> return null;
                 }
             }
-        } catch (MalformedPathException e) {
+        } catch (org.apache.jackrabbit.conversion.NameException e) {
             String msg = "failed to resolve property path " + relPath + " relative to " + safeGetJCRPath();
             log.debug(msg);
             throw new RepositoryException(msg, e);
@@ -1665,7 +1635,7 @@
      *                                      could be found
      * @throws RepositoryException          if another error occurs
      */
-    private QPropertyDefinition getApplicablePropertyDefinition(QName propertyName,
+    private QPropertyDefinition getApplicablePropertyDefinition(Name propertyName,
                                                                 int type,
                                                                 boolean multiValued)
             throws ConstraintViolationException, RepositoryException {

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/PropertyImpl.java Thu Oct 18 11:41:45 2007
@@ -19,14 +19,13 @@
 import org.apache.jackrabbit.jcr2spi.state.PropertyState;
 import org.apache.jackrabbit.jcr2spi.operation.SetPropertyValue;
 import org.apache.jackrabbit.jcr2spi.operation.Operation;
-import org.apache.jackrabbit.name.NoPrefixDeclaredException;
-import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.NameFormat;
-import org.apache.jackrabbit.name.NamespaceResolver;
+import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.name.NameConstants;
 import org.apache.jackrabbit.spi.QValue;
 import org.apache.jackrabbit.spi.QPropertyDefinition;
 import org.apache.jackrabbit.value.ValueFormat;
 import org.apache.jackrabbit.value.ValueHelper;
+import org.apache.jackrabbit.conversion.NameResolver;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
 
@@ -66,15 +65,8 @@
      */
     public String getName() throws RepositoryException {
         checkStatus();
-        QName name = getQName();
-        try {
-            return NameFormat.format(name, session.getNamespaceResolver());
-        } catch (NoPrefixDeclaredException npde) {
-            // should never get here...
-            String msg = "Internal error: encountered unregistered namespace " + name.getNamespaceURI();
-            log.debug(msg);
-            throw new RepositoryException(msg, npde);
-        }
+        Name name = getQName();
+        return session.getNameResolver().getJCRName(name);
     }
 
     /**
@@ -140,7 +132,7 @@
         QValue[] qValues = null;
         if (values != null) {
             Value[] vs = ValueHelper.convert(values, targetType, session.getValueFactory());
-            qValues = ValueFormat.getQValues(vs, session.getNamespaceResolver(), session.getQValueFactory());
+            qValues = ValueFormat.getQValues(vs, session.getNamePathResolver(), session.getQValueFactory());
         }
         setInternalValues(qValues, targetType);
     }
@@ -176,7 +168,7 @@
                     if (reqType != PropertyType.STRING) {
                         // type conversion required
                         Value v = ValueHelper.convert(string, reqType, session.getValueFactory());
-                        qValue = ValueFormat.getQValue(v, session.getNamespaceResolver(), session.getQValueFactory());
+                        qValue = ValueFormat.getQValue(v, session.getNamePathResolver(), session.getQValueFactory());
                     } else {
                         // no type conversion required
                         qValue = session.getQValueFactory().create(string, PropertyType.STRING);
@@ -250,7 +242,7 @@
         if (value == null) {
             setInternalValues(null, reqType);
         } else {
-            checkValidReference(value, reqType, session.getNamespaceResolver());
+            checkValidReference(value, reqType, session.getNameResolver());
             QValue qValue = session.getQValueFactory().create(value.getUUID(), PropertyType.REFERENCE);
             setInternalValues(new QValue[]{qValue}, reqType);
         }
@@ -261,7 +253,7 @@
      */
     public Value getValue() throws ValueFormatException, RepositoryException {
         QValue value = getQValue();
-        return ValueFormat.getJCRValue(value, session.getNamespaceResolver(), session.getJcrValueFactory());
+        return ValueFormat.getJCRValue(value, session.getNamePathResolver(), session.getJcrValueFactory());
     }
 
     /**
@@ -271,7 +263,7 @@
         QValue[] qValues = getQValues();
         Value[] values = new Value[qValues.length];
         for (int i = 0; i < qValues.length; i++) {
-            values[i] = ValueFormat.getJCRValue(qValues[i], session.getNamespaceResolver(), session.getJcrValueFactory());
+            values[i] = ValueFormat.getJCRValue(qValues[i], session.getNamePathResolver(), session.getJcrValueFactory());
         }
         return values;
     }
@@ -360,7 +352,7 @@
         switch (value.getType()) {
             case PropertyType.NAME:
             case PropertyType.PATH:
-                Value jcrValue = ValueFormat.getJCRValue(value, session.getNamespaceResolver(), session.getJcrValueFactory());
+                Value jcrValue = ValueFormat.getJCRValue(value, session.getNamePathResolver(), session.getJcrValueFactory());
                 length = jcrValue.getString().length();
                 break;
             default:
@@ -389,14 +381,14 @@
 
     //-----------------------------------------------------------< ItemImpl >---
     /**
-     * Returns the QName defined with this <code>PropertyState</code>
+     * Returns the Name defined with this <code>PropertyState</code>
      *
      * @return
-     * @see PropertyState#getQName()
-     * @see ItemImpl#getQName()
+     * @see PropertyState#getName()
+     * @see ItemImpl#getName()
      */
-    QName getQName() {
-        return getPropertyState().getQName();
+    Name getQName() {
+        return getPropertyState().getName();
     }
 
     //------------------------------------------------------< check methods >---
@@ -492,10 +484,10 @@
         if (requiredType != value.getType()) {
             // type conversion required
             Value v = ValueHelper.convert(value, requiredType, session.getValueFactory());
-            qValue = ValueFormat.getQValue(v, session.getNamespaceResolver(), session.getQValueFactory());
+            qValue = ValueFormat.getQValue(v, session.getNamePathResolver(), session.getQValueFactory());
         } else {
             // no type conversion required
-            qValue = ValueFormat.getQValue(value, session.getNamespaceResolver(), session.getQValueFactory());
+            qValue = ValueFormat.getQValue(value, session.getNamePathResolver(), session.getQValueFactory());
         }
         setInternalValues(new QValue[]{qValue}, requiredType);
     }
@@ -535,15 +527,11 @@
      * @throws ValueFormatException
      * @throws RepositoryException
      */
-    static void checkValidReference(Node value, int propertyType, NamespaceResolver nsResolver) throws ValueFormatException, RepositoryException {
+    static void checkValidReference(Node value, int propertyType, NameResolver resolver) throws ValueFormatException, RepositoryException {
         if (propertyType == PropertyType.REFERENCE) {
-            try {
-                String jcrName = NameFormat.format(QName.MIX_REFERENCEABLE, nsResolver);
-                if (!value.isNodeType(jcrName)) {
-                    throw new ValueFormatException("Target node must be of node type mix:referenceable");
-                }
-            } catch (NoPrefixDeclaredException e) {
-                throw new RepositoryException(e);
+            String jcrName = resolver.getJCRName(NameConstants.MIX_REFERENCEABLE);
+            if (!value.isNodeType(jcrName)) {
+                throw new ValueFormatException("Target node must be of node type mix:referenceable");
             }
         } else {
             throw new ValueFormatException("Property must be of type REFERENCE.");

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/SessionImpl.java Thu Oct 18 11:41:45 2007
@@ -41,18 +41,21 @@
 import org.apache.jackrabbit.jcr2spi.name.LocalNamespaceMappings;
 import org.apache.jackrabbit.jcr2spi.config.RepositoryConfig;
 import org.apache.jackrabbit.jcr2spi.config.CacheBehaviour;
-import org.apache.jackrabbit.name.MalformedPathException;
-import org.apache.jackrabbit.name.NamespaceResolver;
-import org.apache.jackrabbit.name.QName;
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.PathFormat;
-import org.apache.jackrabbit.name.NameFormat;
-import org.apache.jackrabbit.name.NoPrefixDeclaredException;
+import org.apache.jackrabbit.namespace.NamespaceResolver;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.name.NameConstants;
 import org.apache.jackrabbit.spi.SessionInfo;
 import org.apache.jackrabbit.spi.NodeId;
 import org.apache.jackrabbit.spi.IdFactory;
 import org.apache.jackrabbit.spi.XASessionInfo;
 import org.apache.jackrabbit.spi.QValueFactory;
+import org.apache.jackrabbit.spi.NameFactory;
+import org.apache.jackrabbit.spi.PathFactory;
+import org.apache.jackrabbit.conversion.NamePathResolver;
+import org.apache.jackrabbit.conversion.NameException;
+import org.apache.jackrabbit.conversion.PathResolver;
+import org.apache.jackrabbit.conversion.NameResolver;
+import org.apache.jackrabbit.conversion.DefaultNamePathResolver;
 import org.apache.commons.collections.map.ReferenceMap;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
@@ -118,6 +121,7 @@
     private final SessionInfo sessionInfo;
 
     private final LocalNamespaceMappings nsMappings;
+    private final NamePathResolver npResolver;
     private final NodeTypeManagerImpl ntManager;
 
     private final SessionItemStateManager itemStateManager;
@@ -136,10 +140,11 @@
 
         // build local name-mapping
         nsMappings = new LocalNamespaceMappings(workspace.getNamespaceRegistryImpl());
+        npResolver = new DefaultNamePathResolver(nsMappings, true);
 
         // build nodetype manager
         ntManager = new NodeTypeManagerImpl(workspace.getNodeTypeRegistry(), this, getJcrValueFactory());
-        validator = new ItemStateValidator(this);
+        validator = new ItemStateValidator(this, getPathFactory());
 
         itemStateManager = createSessionItemStateManager(workspace.getUpdatableItemStateManager(), workspace.getItemStateFactory());
         itemManager = createItemManager(getHierarchyManager());
@@ -220,18 +225,13 @@
     public Node getNodeByUUID(String uuid) throws ItemNotFoundException, RepositoryException {
         // sanity check performed by getNodeById
         Node node = getNodeById(getIdFactory().createNodeId(uuid));
-        if (node instanceof NodeImpl && ((NodeImpl)node).isNodeType(QName.MIX_REFERENCEABLE)) {
+        if (node instanceof NodeImpl && ((NodeImpl)node).isNodeType(NameConstants.MIX_REFERENCEABLE)) {
             return node;
         } else {
             // fall back
-            try {
-                String mixReferenceable = NameFormat.format(QName.MIX_REFERENCEABLE, getNamespaceResolver());
-                if (node.isNodeType(mixReferenceable)) {
-                    return node;
-                }
-            } catch (NoPrefixDeclaredException e) {
-                // should not occur.
-                throw new RepositoryException(e);
+            String mixReferenceable = getNameResolver().getJCRName(NameConstants.MIX_REFERENCEABLE);
+            if (node.isNodeType(mixReferenceable)) {
+                return node;
             }
             // there is a node with that uuid but the node does not expose it
             throw new ItemNotFoundException(uuid);
@@ -274,8 +274,6 @@
             return getItemManager().getItem(qPath.getNormalizedPath());
         } catch (AccessDeniedException ade) {
             throw new PathNotFoundException(absPath);
-        } catch (MalformedPathException e) {
-            throw new RepositoryException(e);
         }
     }
 
@@ -284,12 +282,8 @@
      */
     public boolean itemExists(String absPath) throws RepositoryException {
         checkIsAlive();
-        try {
-            Path qPath = getQPath(absPath);
-            return getItemManager().itemExists(qPath.getNormalizedPath());
-        } catch (MalformedPathException e) {
-            throw new RepositoryException(e);
-        }
+        Path qPath = getQPath(absPath);
+        return getItemManager().itemExists(qPath.getNormalizedPath());
     }
 
     /**
@@ -304,7 +298,7 @@
         Path destPath = getQPath(destAbsPath);
 
         // all validation is performed by Move Operation and state-manager
-        Operation op = Move.create(srcPath, destPath, getHierarchyManager(), getNamespaceResolver(), true);
+        Operation op = Move.create(srcPath, destPath, getHierarchyManager(), getPathResolver(), true);
         itemStateManager.execute(op);
     }
 
@@ -371,13 +365,8 @@
                 }
             }
             // parentState is the nearest existing nodeState or the root state.
-            try {
-                Path relPath = parentPath.computeRelativePath(targetPath);
-                isGranted = getAccessManager().isGranted(parentState, relPath, actionsArr);
-            } catch (MalformedPathException e) {
-                // should not occurs
-                throw new RepositoryException(e);
-            }
+            Path relPath = parentPath.computeRelativePath(targetPath);
+            isGranted = getAccessManager().isGranted(parentState, relPath, actionsArr);
         }
 
         if (!isGranted) {
@@ -396,7 +385,7 @@
         // NOTE: check if path corresponds to Node and is writable is performed
         // within the SessionImporter.
         Importer importer = new SessionImporter(parentPath, this, itemStateManager, uuidBehavior);
-        return new ImportHandler(importer, getNamespaceResolver(), workspace.getNamespaceRegistry());
+        return new ImportHandler(importer, getNamespaceResolver(), workspace.getNamespaceRegistry(), getNameFactory());
     }
 
     /**
@@ -650,6 +639,25 @@
     }
 
     //---------------------------------------------------< ManagerProvider > ---
+
+    public NamePathResolver getNamePathResolver() {
+        return npResolver;
+    }
+
+    /**
+     * @see ManagerProvider#getNameResolver()
+     */
+    public NameResolver getNameResolver() {
+        return npResolver;
+    }
+
+    /**
+     * @see ManagerProvider#getPathResolver()
+     */
+    public PathResolver getPathResolver() {
+        return npResolver;
+    }
+
     /**
      * @see ManagerProvider#getNamespaceResolver()
      */
@@ -729,10 +737,18 @@
     }
 
     // TODO public for SessionImport only. review
-    public IdFactory getIdFactory() {
+    public IdFactory getIdFactory() throws RepositoryException {
         return workspace.getIdFactory();
     }
 
+    public NameFactory getNameFactory() throws RepositoryException {
+        return workspace.getNameFactory();
+    }
+
+    PathFactory getPathFactory() throws RepositoryException {
+        return workspace.getPathFactory();
+    }
+
     /**
      * Returns the <code>ItemStateManager</code> associated with this session.
      *
@@ -773,12 +789,12 @@
      */
     Path getQPath(String absPath) throws RepositoryException {
         try {
-            Path p = PathFormat.parse(absPath, getNamespaceResolver());
+            Path p = getPathResolver().getQPath(absPath);
             if (!p.isAbsolute()) {
                 throw new RepositoryException("Not an absolute path: " + absPath);
             }
             return p;
-        } catch (MalformedPathException mpe) {
+        } catch (NameException mpe) {
             String msg = "Invalid path: " + absPath;
             log.debug(msg);
             throw new RepositoryException(msg, mpe);
@@ -791,7 +807,7 @@
      * was obtained from a different session, the 'corresponding' version
      * state for this session is retrieved.
      *
-     * @param node
+     * @param version
      * @return
      */
     NodeState getVersionState(Version version) throws RepositoryException {

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceImpl.java Thu Oct 18 11:41:45 2007
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.jcr2spi;
 
-import org.apache.jackrabbit.name.NamespaceResolver;
 import org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyManager;
 import org.apache.jackrabbit.jcr2spi.state.UpdatableItemStateManager;
 import org.apache.jackrabbit.jcr2spi.state.ItemState;
@@ -46,7 +45,13 @@
 import org.apache.jackrabbit.spi.RepositoryService;
 import org.apache.jackrabbit.spi.SessionInfo;
 import org.apache.jackrabbit.spi.QValueFactory;
-import org.apache.jackrabbit.name.Path;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.NameFactory;
+import org.apache.jackrabbit.spi.PathFactory;
+import org.apache.jackrabbit.conversion.NameResolver;
+import org.apache.jackrabbit.conversion.PathResolver;
+import org.apache.jackrabbit.conversion.NamePathResolver;
+import org.apache.jackrabbit.namespace.NamespaceResolver;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
 import org.xml.sax.ContentHandler;
@@ -233,7 +238,7 @@
         Path srcPath = session.getQPath(srcAbsPath);
         Path destPath = session.getQPath(destAbsPath);
 
-        Operation op = Move.create(srcPath, destPath, getHierarchyManager(), getNamespaceResolver(), false);
+        Operation op = Move.create(srcPath, destPath, getHierarchyManager(), getPathResolver(), false);
         getUpdatableItemStateManager().execute(op);
     }
 
@@ -257,7 +262,8 @@
         session.checkIsAlive();
         if (qManager == null) {
             qManager = new QueryManagerImpl(session, session.getLocalNamespaceMappings(),
-                session.getItemManager(), session.getHierarchyManager(), wspManager);
+                    session.getNamePathResolver(), session.getItemManager(),
+                    session.getHierarchyManager(), wspManager);
         }
         return qManager;
     }
@@ -286,7 +292,7 @@
         session.checkIsAlive();
 
         if (obsManager == null) {
-            obsManager = createObservationManager(getNamespaceResolver(), getNodeTypeRegistry());
+            obsManager = createObservationManager(getNamePathResolver(), getNodeTypeRegistry());
         }
         return obsManager;
     }
@@ -351,6 +357,27 @@
 
     //----------------------------------------------------< ManagerProvider >---
     /**
+     * @see ManagerProvider#getNamePathResolver()
+     */
+    public org.apache.jackrabbit.conversion.NamePathResolver getNamePathResolver() {
+        return session.getNamePathResolver();
+    }
+
+    /**
+     * @see ManagerProvider#getNameResolver()
+     */
+    public NameResolver getNameResolver() {
+        return session.getNameResolver();
+    }
+
+    /**
+     * @see ManagerProvider#getPathResolver()
+     */
+    public PathResolver getPathResolver() {
+        return session.getPathResolver();
+    }
+
+    /**
      * @see ManagerProvider#getNamespaceResolver()
      */
     public NamespaceResolver getNamespaceResolver() {
@@ -415,7 +442,15 @@
         // NOTE: wspManager has already been disposed upon SessionItemStateManager.dispose()
     }
 
-    IdFactory getIdFactory() {
+    NameFactory getNameFactory() throws RepositoryException {
+        return wspManager.getNameFactory();
+    }
+
+    PathFactory getPathFactory() throws RepositoryException {
+        return wspManager.getPathFactory();
+    }
+
+    IdFactory getIdFactory() throws RepositoryException {
         return wspManager.getIdFactory();
     }
 
@@ -493,7 +528,7 @@
      *
      * @return a new <code>ObservationManager</code> instance
      */
-    protected ObservationManager createObservationManager(NamespaceResolver nsResolver, NodeTypeRegistry ntRegistry) {
-        return new ObservationManagerImpl(wspManager, nsResolver, ntRegistry);
+    protected ObservationManager createObservationManager(NamePathResolver resolver, NodeTypeRegistry ntRegistry) {
+        return new ObservationManagerImpl(wspManager, resolver, ntRegistry);
     }
 }

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/WorkspaceManager.java Thu Oct 18 11:41:45 2007
@@ -65,8 +65,8 @@
 import org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyEventListener;
 import org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyManager;
 import org.apache.jackrabbit.jcr2spi.hierarchy.HierarchyManagerImpl;
-import org.apache.jackrabbit.name.Path;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Path;
+import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.RepositoryService;
 import org.apache.jackrabbit.spi.SessionInfo;
 import org.apache.jackrabbit.spi.NodeId;
@@ -81,6 +81,8 @@
 import org.apache.jackrabbit.spi.QNodeTypeDefinition;
 import org.apache.jackrabbit.spi.QValue;
 import org.apache.jackrabbit.spi.Event;
+import org.apache.jackrabbit.spi.NameFactory;
+import org.apache.jackrabbit.spi.PathFactory;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
 
@@ -195,10 +197,18 @@
         return service.getWorkspaceNames(sessionInfo);
     }
 
-    public IdFactory getIdFactory() {
+    public IdFactory getIdFactory() throws RepositoryException {
         return idFactory;
     }
 
+    public NameFactory getNameFactory() throws RepositoryException {
+        return service.getNameFactory();
+    }
+
+    public PathFactory getPathFactory() throws RepositoryException {
+        return service.getPathFactory();
+    }
+
     public ItemStateFactory getItemStateFactory() {
         return isf;
     }
@@ -336,7 +346,7 @@
      *          if this implementation does not support observation.
      */
     public EventFilter createEventFilter(int eventTypes, Path path, boolean isDeep,
-                                         String[] uuids, QName[] nodeTypes,
+                                         String[] uuids, Name[] nodeTypes,
                                          boolean noLocal)
         throws UnsupportedRepositoryOperationException, RepositoryException {
         return service.createEventFilter(sessionInfo, eventTypes, path, isDeep, uuids, nodeTypes, noLocal);
@@ -356,8 +366,8 @@
      *
      * @return
      */
-    private HierarchyManager createHierarchyManager(TransientItemStateFactory tisf, IdFactory idFactory) {
-        return new HierarchyManagerImpl(tisf, idFactory);
+    private HierarchyManager createHierarchyManager(TransientItemStateFactory tisf, IdFactory idFactory) throws RepositoryException {
+        return new HierarchyManagerImpl(tisf, idFactory, getPathFactory());
     }
 
     /**
@@ -374,8 +384,8 @@
      * @param nsCache the namespace cache.
      * @return
      */
-    private NamespaceRegistryImpl createNamespaceRegistry(NamespaceCache nsCache) {
-        return new NamespaceRegistryImpl(this, nsCache);
+    private NamespaceRegistryImpl createNamespaceRegistry(NamespaceCache nsCache) throws RepositoryException {
+        return new NamespaceRegistryImpl(this, nsCache, getNameFactory(), getPathFactory());
     }
 
     /**
@@ -388,7 +398,7 @@
             public Iterator getAllDefinitions() throws RepositoryException {
                 return service.getQNodeTypeDefinitions(sessionInfo);
             }
-            public Iterator getDefinitions(QName[] nodeTypeNames) throws NoSuchNodeTypeException, RepositoryException {
+            public Iterator getDefinitions(Name[] nodeTypeNames) throws NoSuchNodeTypeException, RepositoryException {
                 return service.getQNodeTypeDefinitions(sessionInfo, nodeTypeNames);
             }
             public void registerNodeTypes(QNodeTypeDefinition[] nodeTypeDefs) throws NoSuchNodeTypeException, RepositoryException {
@@ -397,7 +407,7 @@
             public void reregisterNodeTypes(QNodeTypeDefinition[] nodeTypeDefs) throws NoSuchNodeTypeException, RepositoryException {
                 throw new UnsupportedOperationException("NodeType registration not yet defined by the SPI");
             }
-            public void unregisterNodeTypes(QName[] nodeTypeNames) throws NoSuchNodeTypeException, RepositoryException {
+            public void unregisterNodeTypes(Name[] nodeTypeNames) throws NoSuchNodeTypeException, RepositoryException {
                 throw new UnsupportedOperationException("NodeType registration not yet defined by the SPI");
             }
         };
@@ -640,7 +650,7 @@
                         default:
                             type = "Unknown";
                     }
-                    log.debug("  {}; {}", e.getQPath(), type);
+                    log.debug("  {}; {}", e.getPath(), type);
                 }
             }
         }
@@ -722,7 +732,7 @@
          */
         public void visit(AddProperty operation) throws RepositoryException {
             NodeId parentId = operation.getParentId();
-            QName propertyName = operation.getPropertyName();
+            Name propertyName = operation.getPropertyName();
             if (operation.isMultiValued()) {
                 batch.addProperty(parentId, propertyName, operation.getValues());
             } else {

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeAttic.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeAttic.java?rev=586065&r1=586064&r2=586065&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeAttic.java (original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/hierarchy/ChildNodeAttic.java Thu Oct 18 11:41:45 2007
@@ -18,7 +18,7 @@
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.jackrabbit.name.QName;
+import org.apache.jackrabbit.spi.Name;
 
 import java.util.Set;
 import java.util.HashSet;
@@ -38,7 +38,7 @@
     ChildNodeAttic() {
     }
 
-    boolean contains(QName name, int index) {
+    boolean contains(Name name, int index) {
         for (Iterator it = attic.iterator(); it.hasNext();) {
             NodeEntryImpl ne = (NodeEntryImpl) it.next();
             if (ne.matches(name, index)) {
@@ -48,7 +48,7 @@
         return false;
     }
 
-    List get(QName name) {
+    List get(Name name) {
         List l = new ArrayList();
         for (Iterator it = attic.iterator(); it.hasNext();) {
             NodeEntryImpl ne = (NodeEntryImpl) it.next();
@@ -65,7 +65,7 @@
      * @param index The original index of the NodeEntry before it has been moved.
      * @return
      */
-    NodeEntry get(QName name, int index) {
+    NodeEntry get(Name name, int index) {
         for (Iterator it = attic.iterator(); it.hasNext();) {
             NodeEntryImpl ne = (NodeEntryImpl) it.next();
             if (ne.matches(name, index)) {



Mime
View raw message