jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r718207 - in /jackrabbit/branches/1.5: ./ jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/ jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/ jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/c...
Date Mon, 17 Nov 2008 09:13:37 GMT
Author: jukka
Date: Mon Nov 17 01:13:36 2008
New Revision: 718207

URL: http://svn.apache.org/viewvc?rev=718207&view=rev
Log:
1.5: Merged revisions 711566 and 711567 (JCR-1842)

Added:
    jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/LoginTest.java
      - copied unchanged from r711566, jackrabbit/trunk/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/LoginTest.java
Modified:
    jackrabbit/branches/1.5/   (props changed)
    jackrabbit/branches/1.5/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java
    jackrabbit/branches/1.5/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java
    jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java
    jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/config/RepositoryConfig.java
    jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AbstractRepositoryConfig.java
    jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/TestAll.java
    jackrabbit/branches/1.5/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java
    jackrabbit/branches/1.5/jackrabbit-spi2jcr/src/test/resources/repositoryStubImpl.properties

Propchange: jackrabbit/branches/1.5/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov 17 01:13:36 2008
@@ -1,2 +1,2 @@
 /jackrabbit/branches/1.3:631261
-/jackrabbit/trunk:703899-704158,704165,704167,704324,704358,704361,704864,704933,704939,705010,705033,705243,705496,705522,705579,705925,705932,705934,705937-705938,705961,706242,706273,706285-706286,706562,706606,706649,706655,706660,706697,706918,707303-707304,707307,707310,707630,708206,708598,708609,708613,708619,708634,708840,708863,708909,708929,708943,709115,709142,709207,709211,710047,711238
+/jackrabbit/trunk:703899-704158,704165,704167,704324,704358,704361,704864,704933,704939,705010,705033,705243,705496,705522,705579,705925,705932,705934,705937-705938,705961,706242,706273,706285-706286,706562,706606,706649,706655,706660,706697,706918,707303-707304,707307,707310,707630,708206,708598,708609,708613,708619,708634,708840,708863,708909,708929,708943,709115,709142,709207,709211,710047,711238,711566-711567

Modified: jackrabbit/branches/1.5/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java?rev=718207&r1=718206&r2=718207&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java
(original)
+++ jackrabbit/branches/1.5/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/AbstractResource.java
Mon Nov 17 01:13:36 2008
@@ -85,23 +85,23 @@
  * resources.
  */
 abstract class AbstractResource implements DavResource, TransactionResource,
-    DeltaVResource, SearchResource {
+        DeltaVResource, SearchResource {
 
     private static Logger log = LoggerFactory.getLogger(AbstractResource.class);
 
     private static final String COMPLIANCE_CLASSES =
-        DavCompliance.concatComplianceClasses(new String[] {
-        DavCompliance._1_,
-        DavCompliance._2_,
-        DavCompliance._3_,
-        DavCompliance.VERSION_CONTROL,
-        DavCompliance.VERSION_HISTORY,
-        DavCompliance.CHECKOUT_IN_PLACE,
-        DavCompliance.LABEL,
-        DavCompliance.MERGE,
-        DavCompliance.UPDATE,
-        DavCompliance.WORKSPACE
-    });
+            DavCompliance.concatComplianceClasses(new String[] {
+                    DavCompliance._1_,
+                    DavCompliance._2_,
+                    DavCompliance._3_,
+                    DavCompliance.VERSION_CONTROL,
+                    DavCompliance.VERSION_HISTORY,
+                    DavCompliance.CHECKOUT_IN_PLACE,
+                    DavCompliance.LABEL,
+                    DavCompliance.MERGE,
+                    DavCompliance.UPDATE,
+                    DavCompliance.WORKSPACE
+            });
 
     private final DavResourceLocator locator;
     private final JcrDavSession session;
@@ -229,8 +229,8 @@
      * @see DavResource#alterProperties(org.apache.jackrabbit.webdav.property.DavPropertySet,
org.apache.jackrabbit.webdav.property.DavPropertyNameSet)
      */
     public MultiStatusResponse alterProperties(DavPropertySet setProperties,
-                                DavPropertyNameSet removePropertyNames)
-        throws DavException {
+                                               DavPropertyNameSet removePropertyNames)
+            throws DavException {
         List changeList = new ArrayList();
         if (removePropertyNames != null) {
             DavPropertyNameIterator it = removePropertyNames.iterator();
@@ -442,7 +442,7 @@
             // DAV:workspace-collection-set is supported.
             if (optionsInfo.containsElement(DeltaVConstants.XML_VH_COLLECTION_SET, DeltaVConstants.NAMESPACE))
{
                 String[] hrefs = new String[] {
-                    getLocatorFromItemPath(ItemResourceConstants.VERSIONSTORAGE_PATH).getHref(true)
+                        getLocatorFromItemPath(ItemResourceConstants.VERSIONSTORAGE_PATH).getHref(true)
                 };
                 oR.addEntry(DeltaVConstants.XML_VH_COLLECTION_SET, DeltaVConstants.NAMESPACE,
hrefs);
             }
@@ -595,18 +595,22 @@
 
         properties.add(new SupportedMethodSetProperty(getSupportedMethods().split(",\\s")));
 
-	// DeltaV properties
-	properties.add(supportedReports);
-	// creator-displayname, comment: not value available from jcr
-	properties.add(new DefaultDavProperty(DeltaVConstants.CREATOR_DISPLAYNAME, null, true));
-	properties.add(new DefaultDavProperty(DeltaVConstants.COMMENT, null, true));
-
-	// 'workspace' property as defined by RFC 3253
-	String workspaceHref = getWorkspaceHref();
-	if (workspaceHref != null) {
-	    properties.add(new HrefProperty(DeltaVConstants.WORKSPACE, workspaceHref, true));
-	}
-	// TODO: required supported-live-property-set
+        // DeltaV properties
+        properties.add(supportedReports);
+        // creator-displayname, comment: not value available from jcr
+        properties.add(new DefaultDavProperty(DeltaVConstants.CREATOR_DISPLAYNAME, null,
true));
+        properties.add(new DefaultDavProperty(DeltaVConstants.COMMENT, null, true));
+
+        // 'workspace' property as defined by RFC 3253
+        String workspaceHref = getWorkspaceHref();
+        if (workspaceHref != null) {
+            properties.add(new HrefProperty(DeltaVConstants.WORKSPACE, workspaceHref, true));
+        }
+        // name of the jcr workspace
+        properties.add(new DefaultDavProperty(ItemResourceConstants.JCR_WORKSPACE_NAME,
+                getRepositorySession().getWorkspace().getName()));
+
+        // TODO: required supported-live-property-set
     }
 
     /**
@@ -685,11 +689,11 @@
     protected void initSupportedReports() {
         if (exists()) {
             supportedReports = new SupportedReportSetProperty(new ReportType[] {
-                ReportType.EXPAND_PROPERTY,
-                NodeTypesReport.NODETYPES_REPORT,
-                LocateByUuidReport.LOCATE_BY_UUID_REPORT,
-                RegisteredNamespacesReport.REGISTERED_NAMESPACES_REPORT,
-                RepositoryDescriptorsReport.REPOSITORY_DESCRIPTORS_REPORT
+                    ReportType.EXPAND_PROPERTY,
+                    NodeTypesReport.NODETYPES_REPORT,
+                    LocateByUuidReport.LOCATE_BY_UUID_REPORT,
+                    RegisteredNamespacesReport.REGISTERED_NAMESPACES_REPORT,
+                    RepositoryDescriptorsReport.REPOSITORY_DESCRIPTORS_REPORT
             });
         }
     }

Modified: jackrabbit/branches/1.5/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java?rev=718207&r1=718206&r2=718207&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java
(original)
+++ jackrabbit/branches/1.5/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java
Mon Nov 17 01:13:36 2008
@@ -111,6 +111,9 @@
      */
     public static final String XML_RELPATH = "relpath";
 
+    // name of the workspace for which the repository session has been created.
+    public static final DavPropertyName JCR_WORKSPACE_NAME = DavPropertyName.create("workspaceName",
NAMESPACE);
+
     // general property names
     public static final DavPropertyName JCR_NAME = DavPropertyName.create("name", NAMESPACE);
     public static final DavPropertyName JCR_PATH = DavPropertyName.create("path", NAMESPACE);
@@ -120,7 +123,6 @@
     public static final DavPropertyName JCR_ISMODIFIED = DavPropertyName.create("ismodified",
NAMESPACE);
     public static final DavPropertyName JCR_DEFINITION = DavPropertyName.create("definition",
NAMESPACE);
 
-
     // property names used for resources representing jcr-nodes
     public static final DavPropertyName JCR_PRIMARYNODETYPE = DavPropertyName.create(XML_PRIMARYNODETYPE,
NAMESPACE);
     public static final DavPropertyName JCR_MIXINNODETYPES = DavPropertyName.create("mixinnodetypes",
NAMESPACE);

Modified: jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java?rev=718207&r1=718206&r2=718207&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java
(original)
+++ jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/RepositoryImpl.java
Mon Nov 17 01:13:36 2008
@@ -79,8 +79,7 @@
      * @see Repository#login(javax.jcr.Credentials, String)
      */
     public Session login(Credentials credentials, String workspaceName) throws LoginException,
NoSuchWorkspaceException, RepositoryException {
-        String wspName = (workspaceName == null) ? config.getDefaultWorkspaceName() : workspaceName;
-        SessionInfo info = config.getRepositoryService().obtain(credentials, wspName);
+        SessionInfo info = config.getRepositoryService().obtain(credentials, workspaceName);
         try {
             if (info instanceof XASessionInfo) {
                 return new XASessionImpl((XASessionInfo) info, this, config);

Modified: jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/config/RepositoryConfig.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/config/RepositoryConfig.java?rev=718207&r1=718206&r2=718207&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/config/RepositoryConfig.java
(original)
+++ jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/config/RepositoryConfig.java
Mon Nov 17 01:13:36 2008
@@ -32,8 +32,6 @@
 
     public RepositoryService getRepositoryService() throws RepositoryException;
 
-    public String getDefaultWorkspaceName();
-
     public CacheBehaviour getCacheBehaviour();
 
     public int getItemCacheSize();

Modified: jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AbstractRepositoryConfig.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AbstractRepositoryConfig.java?rev=718207&r1=718206&r2=718207&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AbstractRepositoryConfig.java
(original)
+++ jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/AbstractRepositoryConfig.java
Mon Nov 17 01:13:36 2008
@@ -30,10 +30,6 @@
 
     private static final int DEFAULT_ITEM_CACHE_SIZE = 5000;
 
-    public String getDefaultWorkspaceName() {
-        return null;
-    }
-
     public CacheBehaviour getCacheBehaviour() {
         return CacheBehaviour.INVALIDATE;
     }

Modified: jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/TestAll.java?rev=718207&r1=718206&r2=718207&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/TestAll.java
(original)
+++ jackrabbit/branches/1.5/jackrabbit-jcr2spi/src/test/java/org/apache/jackrabbit/jcr2spi/TestAll.java
Mon Nov 17 01:13:36 2008
@@ -96,6 +96,9 @@
         suite.addTestSuite(ExternalModificationTest.class);
         suite.addTestSuite(IsSameTest.class);
 
+        // repository
+        suite.addTestSuite(LoginTest.class);
+        
         return suite;
     }
 }
\ No newline at end of file

Modified: jackrabbit/branches/1.5/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java?rev=718207&r1=718206&r2=718207&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java
(original)
+++ jackrabbit/branches/1.5/jackrabbit-spi/src/main/java/org/apache/jackrabbit/spi/RepositoryService.java
Mon Nov 17 01:13:36 2008
@@ -130,7 +130,8 @@
      *
      * @param credentials the credentials of the user.
      * @param workspaceName the name of the workspace the <code>SessionInfo</code>
-     * should be built for.
+     * should be built for. If the specified workspaceName is <code>null</code>
+     * the implementation should select a default workspace.
      * @return a <code>SessionInfo</code> if authentication was successful.
      * @throws LoginException           if authentication of the user fails.
      * @throws NoSuchWorkspaceException if the specified <code>workspaceName</code>
@@ -146,7 +147,8 @@
      *
      * @param sessionInfo for another workspace
      * @param workspaceName the name of the workspace the new <code>SessionInfo</code>
-     * should be built for.
+     * should be built for. If the specified workspaceName is <code>null</code>
+     * the implementation should select a default workspace.
      * @return a <code>SessionInfo</code> if authentication was successful.
      * @throws LoginException           if authentication of the user fails.
      * @throws NoSuchWorkspaceException if the specified <code>workspaceName</code>

Modified: jackrabbit/branches/1.5/jackrabbit-spi2jcr/src/test/resources/repositoryStubImpl.properties
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.5/jackrabbit-spi2jcr/src/test/resources/repositoryStubImpl.properties?rev=718207&r1=718206&r2=718207&view=diff
==============================================================================
--- jackrabbit/branches/1.5/jackrabbit-spi2jcr/src/test/resources/repositoryStubImpl.properties
(original)
+++ jackrabbit/branches/1.5/jackrabbit-spi2jcr/src/test/resources/repositoryStubImpl.properties
Mon Nov 17 01:13:36 2008
@@ -26,8 +26,6 @@
 # Use this stub implementation for testing Jackrabbit-Core over JNDI without intermediate
SPI
 # javax.jcr.tck.repository_stub_impl=org.apache.jackrabbit.spi2jcr.DefaultRepositoryStub
 
-# name of the default workspace
-org.apache.jackrabbit.jcr2spi.workspace.name=default
 # alternative workspace used for update tests etc.
 org.apache.jackrabbit.jcr2spi.workspace2.name=test
 



Mime
View raw message