Return-Path: Delivered-To: apmail-incubator-jackrabbit-commits-archive@www.apache.org Received: (qmail 21592 invoked from network); 6 Nov 2004 11:23:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 6 Nov 2004 11:23:41 -0000 Received: (qmail 44821 invoked by uid 500); 6 Nov 2004 11:23:40 -0000 Mailing-List: contact jackrabbit-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jackrabbit-dev@incubator.apache.org Delivered-To: mailing list jackrabbit-commits@incubator.apache.org Received: (qmail 44807 invoked by uid 500); 6 Nov 2004 11:23:40 -0000 Delivered-To: apmail-incubator-jackrabbit-cvs@incubator.apache.org Received: (qmail 44802 invoked by uid 99); 6 Nov 2004 11:23:40 -0000 X-ASF-Spam-Status: No, hits=-10.0 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Sat, 06 Nov 2004 03:23:38 -0800 Received: (qmail 21585 invoked by uid 65534); 6 Nov 2004 11:23:37 -0000 Date: 6 Nov 2004 11:23:37 -0000 Message-ID: <20041106112337.21580.qmail@minotaur.apache.org> From: tripod@apache.org To: jackrabbit-cvs@incubator.apache.org Subject: svn commit: rev 56755 - in incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core: . config X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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);