You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by Richard Osbaldeston <ri...@wordmap.com> on 2005/07/06 19:53:35 UTC

How do I create more workspaces

Apologies if this is a really dumb question but how can I create 
multiple workspaces with jackrabbit? Passing a named workspace into the 
login returns a "javax.jcr.NoSuchWorkspaceException", but will create a 
new default workspace if it dosnt already exist and trawling over the 
API hasn't helped. The repository.xml file seems to define a workspace 
template rather than a list of workspaces (at least that's how I read it).

Ah, as I'm typing I can see createWorkspace() on SessionImpl -- I guess 
I'm supposed to cast an active session object to the jackrabbit 
SessionImpl and call that?

- Richard

Re: How do I create more workspaces

Posted by Marcel Reutegger <ma...@gmx.net>.
Hi Richard,

Richard Osbaldeston wrote:
> Apologies if this is a really dumb question but how can I create 
> multiple workspaces with jackrabbit? Passing a named workspace into the 
> login returns a "javax.jcr.NoSuchWorkspaceException", but will create a 
> new default workspace if it dosnt already exist and trawling over the 
> API hasn't helped. The repository.xml file seems to define a workspace 
> template rather than a list of workspaces (at least that's how I read it).

that's correct.

> Ah, as I'm typing I can see createWorkspace() on SessionImpl -- I guess 
> I'm supposed to cast an active session object to the jackrabbit 
> SessionImpl and call that?

Creating workspaces is not covered by jsr-170. It is considered an 
administrative task and therefore implementation specific.

Jackrabbit allows you to programmatically create a new workspace by 
calling WorkspaceImpl.createWorkspace()

You may also create a new workspace by creating a new workspace folder 
and placing a new workspace.xml configuration in that folder.
As a quick start you can simply copy the workspace.xml from the default 
workspace and change the workspace name:
<Workspace name="secondWorkspace">

Jackrabbit will pick up all workspace.xml files it can find in 
subdirectories of <repository.home>/workspaces and instantiate them on 
startup.

regards
  marcel

Re: How do I create more workspaces

Posted by Nicolas Belisle <Ni...@bibl.ulaval.ca>.
Hi Richard,

I would suggest WorkspaceImpl#createWorkspace(), since this method is 
public rather than protected (SessionImpl#createWorkspace()).

Hope it helps,

Nicolas


Le 13:53 2005-07-06, vous avez écrit:
>Apologies if this is a really dumb question but how can I create multiple 
>workspaces with jackrabbit? Passing a named workspace into the login 
>returns a "javax.jcr.NoSuchWorkspaceException", but will create a new 
>default workspace if it dosnt already exist and trawling over the API 
>hasn't helped. The repository.xml file seems to define a workspace 
>template rather than a list of workspaces (at least that's how I read it).
>
>Ah, as I'm typing I can see createWorkspace() on SessionImpl -- I guess 
>I'm supposed to cast an active session object to the jackrabbit 
>SessionImpl and call that?
>
>- Richard