Tobias Bocanegra wrote:
either just create the workspace by hand, by copying the default
workspace directory and adjusting it's name in the workspace.xml
I would rather go with progammatic way.
or
programmatically by:
((JackrabbitRepositroy) repository).createWorkspace(name);
Repository or JackrabbitRepository does not have this method.
Another question : Is there not a way to have workspace.xml with my
workspace template in the same folder where repository.xml is
Such as :
repository.xml has :
<Repository>
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
<param name="path" value="${rep.home}/global" />
</FileSystem>
<Security appName="Jackrabbit">
<AccessManager
class="org.apache.jackrabbit.core.security.SimpleAccessManager"/>
<LoginModule
class="org.apache.jackrabbit.core.security.SimpleLoginModule"/>
</Security>
<Workspaces rootPath="${rep.home}/workspaces"
defaultWorkspace="default" />
<Workspace name="${wsp.name}">
<FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
<param name="path" value="${wsp.home}"/>
</FileSystem>
<PersistenceManager
class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" />
<SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="path" value="${wsp.home}/index"/>
</SearchIndex>
</Workspace>
<Versioning rootPath="${rep.home}/versions">
<FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
<param name="path" value="${rep.home}/versions"/>
</FileSystem>
<PersistenceManager
class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" />
</Versioning>
</Repository>
And workspace.xml has :
<Workspace name="portal">
<FileSystem
class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
<param name="path" value="${wsp.home}"/>
</FileSystem>
<PersistenceManager
class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" />
<SearchIndex
class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="path" value="${wsp.home}/index"/>
</SearchIndex>
</Workspace>
Now when I create repository, it should create 2 workspaces : default
and portal . Is my understanding correct ?
Thanks,
Ruchi
regards, toby
On 1/23/07, ruchi goel <[EMAIL PROTECTED]> wrote:
Hi,
I have following code which creates repository with default
workspace :
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.jackrabbit.core.jndi.provider.DummyInitialContextFactory");
env.put(Context.PROVIDER_URL, "localhost");
InitialContext ctx = new InitialContext(env);
RegistryHelper.registerRepository(ctx, REPOSITORY_NAME,
REPOSITORY_CONFIG, REPOSITORY_DIR, true);
Repository repository = (Repository)
ctx.lookup(REPOSITORY_NAME);
Now, I want to create a workspace (other than default). I checked out
earlier mails on this subject which says to check documentation of
WorkspaceImpl @ http://jackrabbit.apache.org/api-1/
WorkspaceImpl.createWorkspace() is protected method, then is it
mandatory to have my class extend from WorkspaceImpl .
What is the correct way to create workspace if I want to go ahead with
the above code ?
Thanks in advance ,
Ruchi