jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: rev 56755 - in incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core: . config
Date Sat, 06 Nov 2004 11:23:37 GMT
Author: tripod
Date: Sat Nov  6 03:23:36 2004
New Revision: 56755

Modified:
   incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java
   incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java
   incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java
Log:
- adding temporary version of future Session.getWorkspaceNames()
- empty workspace name in config now defaults to directory name

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java	(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/RepositoryImpl.java	Sat
Nov  6 03:23:36 2004
@@ -394,6 +394,14 @@
         return rootNodeUUID;
     }
 
+    /**
+     * Returns the names of all workspaces of this repository.
+     * @return the names of all workspaces of this repository.
+     */
+    protected String[] getWorkspaceNames() {
+        return (String[] ) wspConfigs.keySet().toArray(new String[wspConfigs.keySet().size()]);
+    }
+    
     synchronized PersistentItemStateProvider getWorkspaceStateManager(String workspaceName)
             throws NoSuchWorkspaceException, RepositoryException {
         // check state

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java	(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java	Sat Nov
 6 03:23:36 2004
@@ -447,6 +447,16 @@
     }
 
     /**
+     * Returns the names of all workspaces of this repository with respect of the
+     * access rights of this session.
+     *
+     * @return the names of all workspaces of this repository.
+     */
+    public String[] getWorkspaceNames() {
+        return rep.getWorkspaceNames();
+    }
+
+    /**
      * @see Session#impersonate(Credentials)
      */
     public Session impersonate(Credentials otherCredentials)

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/config/WorkspaceConfig.java
Sat Nov  6 03:23:36 2004
@@ -112,7 +112,14 @@
     protected void init(Document config) throws RepositoryException {
         Element wspElem = config.getRootElement();
         // name
-        wspName = replaceVars(wspElem.getAttributeValue(NAME_ATTRIB), vars);
+        wspName = wspElem.getAttributeValue(NAME_ATTRIB);
+        if (wspName==null) {
+            // init with wsp home dirname
+            wspName = new File(wspHomeDir).getName();
+        } else {
+            wspName = replaceVars(wspName, vars);
+        }
+        
         // set name variable
         vars.put(WORKSPACE_NAME_VARIABLE, wspName);
 

Mime
View raw message