You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Felix Meschberger <fm...@gmail.com> on 2008/02/19 08:47:45 UTC

Re: Should we use null instead of "default" for the default workspace name?

Hi all,

Am Montag, den 18.02.2008, 17:45 +0100 schrieb Bertrand Delacretaz:
> Hi,
> 
> Currently Sling uses the String "default" for the default workspace
> name, in several places.
> 
> According to [1] however, "if workspaceName is null, a default
> workspace is automatically selected by the repository implementation".
> 
> This might make Sling more interoperable with various JCR
> repositories, where the default workspace is not necessarily named
> "default".
> 
> My suggestion:
> 
> 1) Use null for the workspace name in Repository.login() calls, if the
> configured workspace name is an empty string.

I would take a slightly different approach: If the configuration value
is an empty string, assume the default workspace to be "null". Such that
SlingRepository.getDefaultWorkspace() returns the actual name - null
that is - if none is configured.

We would also have to quickly verify any uses (in Sling) of the
getDefaultWorkspace() method for potential NPE.

> 
> 2) Set the default workspace name to that empty string
> 
> 3) Change the "workspace" configuration variable description to
> indicate that an empty string means "use default workspace supplied by
> the JCR Repository".
> 
> WDYT?

Though I am generally a fan of defined default values, I agree, that
there are benefits of using "whatever is the default provided by the
system". So I agree with this approach.

Regards
Felix


Re: Should we use null instead of "default" for the default workspace name?

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi,

On Feb 19, 2008 8:47 AM, Felix Meschberger <fm...@gmail.com> wrote:

> ...I would take a slightly different approach: If the configuration value
> is an empty string, assume the default workspace to be "null". Such that
> SlingRepository.getDefaultWorkspace() returns the actual name - null
> that is - if none is configured....

Ok, thanks for the input, I have created
https://issues.apache.org/jira/browse/SLING-256 accordingly.

-Bertrand