javax.servlet,
javax.servlet.http,
javax.servlet.resources,
- org.argeo.jackrabbit.webdav,
+ org.argeo.jackrabbit.remote,
org.argeo.jcr,
org.springframework.osgi.web.context.support;version="1.2.1",
org.springframework.security;version="2.0.6.RELEASE",
--- /dev/null
+package org.argeo.jackrabbit.remote;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jcr.Credentials;
+import javax.jcr.LoginException;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.server.SessionProvider;
+
+public class CachingSessionProvider implements SessionProvider {
+ private static final String JCR_SESSIONS_ATTRIBUTE = "jcrSessions";
+
+ private final static Log log = LogFactory
+ .getLog(CachingSessionProvider.class);
+
+ private Credentials credentials = null;
+
+ public CachingSessionProvider() {
+ }
+
+ public CachingSessionProvider(Credentials credentials) {
+ this.credentials = credentials;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Session getSession(HttpServletRequest request, Repository rep,
+ String workspace) throws LoginException, ServletException,
+ RepositoryException {
+ HttpSession httpSession = request.getSession();
+
+ if (httpSession.getAttribute(JCR_SESSIONS_ATTRIBUTE) == null) {
+ httpSession
+ .setAttribute(JCR_SESSIONS_ATTRIBUTE, Collections
+ .synchronizedMap(new HashMap<String, Session>()));
+ }
+ Map<String, Session> sessions = (Map<String, Session>) httpSession
+ .getAttribute(JCR_SESSIONS_ATTRIBUTE);
+ if (!sessions.containsKey(workspace)) {
+ Session session = rep.login(credentials, workspace);
+ sessions.put(workspace, session);
+ return session;
+ } else {
+ Session session = sessions.get(workspace);
+ if (!session.isLive()) {
+ sessions.remove(workspace);
+ session = rep.login(credentials, workspace);
+ sessions.put(workspace, session);
+ }
+ return session;
+ }
+ }
+
+ public void releaseSession(Session session) {
+ if (log.isDebugEnabled())
+ log.debug("Releasing JCR session " + session);
+ // session.logout();
+ // FIXME: find a way to log out when the HTTP session is expired
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.argeo.jackrabbit.remote;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.ArgeoException;
+import org.springframework.web.servlet.DispatcherServlet;
+
+public class ExtendedDispatcherServlet extends DispatcherServlet {
+ private static final long serialVersionUID = -5584673209855752009L;
+
+ private final static Log log = LogFactory
+ .getLog(ExtendedDispatcherServlet.class);
+
+ protected void service(HttpServletRequest request,
+ HttpServletResponse response) throws ServletException,
+ java.io.IOException {
+ // see http://forum.springsource.org/showthread.php?t=53472
+ try {
+ if (log.isTraceEnabled())
+ log.trace("Received request " + request);
+ doService(request, response);
+ } catch (Exception e) {
+ throw new ArgeoException("Cannot process request", e);
+ }
+ }
+
+}
--- /dev/null
+package org.argeo.jackrabbit.remote;
+
+import javax.jcr.Repository;
+import javax.jcr.SimpleCredentials;
+
+import org.apache.jackrabbit.server.SessionProvider;
+
+public class JcrRemotingServlet extends
+ org.apache.jackrabbit.server.remoting.davex.JcrRemotingServlet {
+
+ private static final long serialVersionUID = 3131835511468341309L;
+
+ private final Repository repository;
+
+ public JcrRemotingServlet(Repository repository) {
+ this.repository = repository;
+ }
+
+ @Override
+ protected Repository getRepository() {
+ return repository;
+ }
+
+ @Override
+ protected SessionProvider getSessionProvider() {
+ return new CachingSessionProvider(new SimpleCredentials("demo",
+ "demo".toCharArray()));
+ }
+
+}
--- /dev/null
+package org.argeo.jackrabbit.remote;
+
+import java.util.Enumeration;
+import java.util.Properties;
+
+import javax.jcr.Repository;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.webdav.jcr.JCRWebdavServerServlet;
+import org.argeo.ArgeoException;
+import org.argeo.jcr.RepositoryRegister;
+import org.springframework.beans.BeansException;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.context.ConfigurableApplicationContext;
+import org.springframework.web.context.ServletContextAware;
+import org.springframework.web.servlet.HandlerExecutionChain;
+import org.springframework.web.servlet.HandlerMapping;
+
+public class MultipleRepositoryHandlerMapping implements HandlerMapping,
+ ApplicationContextAware, ServletContextAware {
+ private final static Log log = LogFactory
+ .getLog(MultipleRepositoryHandlerMapping.class);
+
+ private ConfigurableApplicationContext applicationContext;
+ private ServletContext servletContext;
+
+ private RepositoryRegister repositoryRegister;
+
+ public HandlerExecutionChain getHandler(HttpServletRequest request)
+ throws Exception {
+ if (log.isTraceEnabled()) {
+ log.trace("getContextPath=" + request.getContextPath());
+ log.trace("getServletPath=" + request.getServletPath());
+ log.trace("getPathInfo=" + request.getPathInfo());
+ }
+
+ String repositoryName = extractRepositoryName(request);
+ String pathPrefix = request.getServletPath() + '/' + repositoryName;
+ String beanName = pathPrefix;
+
+ if (!applicationContext.containsBean(beanName)) {
+ Repository repository = repositoryRegister.getRepositories().get(
+ repositoryName);
+ HttpServlet servlet = createServlet(repository, pathPrefix);
+ applicationContext.getBeanFactory().registerSingleton(beanName,
+ servlet);
+ // TODO: unregister it as well
+ }
+ HttpServlet remotingServlet = (HttpServlet) applicationContext
+ .getBean(beanName);
+ return new HandlerExecutionChain(remotingServlet);
+ }
+
+ protected HttpServlet createServlet(Repository repository, String pathPrefix)
+ throws ServletException {
+ JcrRemotingServlet jcrRemotingServlet = new JcrRemotingServlet(
+ repository);
+ Properties initParameters = new Properties();
+ initParameters.setProperty(
+ JCRWebdavServerServlet.INIT_PARAM_RESOURCE_PATH_PREFIX,
+ pathPrefix);
+ jcrRemotingServlet.init(new DelegatingServletConfig(pathPrefix.replace(
+ '/', '_'), initParameters));
+ return jcrRemotingServlet;
+ }
+
+ /** The repository name is the first part of the path info */
+ protected String extractRepositoryName(HttpServletRequest request) {
+ String pathInfo = request.getPathInfo();
+ // TODO: optimize by checking character by character
+ String[] tokens = pathInfo.split("/");
+ StringBuffer currName = new StringBuffer("");
+ tokens: for (String token : tokens) {
+ if (token.equals(""))
+ continue tokens;
+ currName.append(token);
+ if (repositoryRegister.getRepositories().containsKey(
+ currName.toString()))
+ return currName.toString();
+ currName.append('/');
+ }
+ throw new ArgeoException("No repository can be found for request "
+ + pathInfo);
+ }
+
+ public void setApplicationContext(ApplicationContext applicationContext)
+ throws BeansException {
+ this.applicationContext = (ConfigurableApplicationContext) applicationContext;
+ }
+
+ public void setServletContext(ServletContext servletContext) {
+ this.servletContext = servletContext;
+ }
+
+ public void setRepositoryRegister(RepositoryRegister repositoryRegister) {
+ this.repositoryRegister = repositoryRegister;
+ }
+
+ private class DelegatingServletConfig implements ServletConfig {
+ private String name;
+ private Properties initParameters;
+
+ public DelegatingServletConfig(String name, Properties initParameters) {
+ super();
+ this.name = name;
+ this.initParameters = initParameters;
+ }
+
+ public String getServletName() {
+ return name;
+ }
+
+ public ServletContext getServletContext() {
+ return servletContext;
+ }
+
+ public String getInitParameter(String paramName) {
+ return initParameters.getProperty(paramName);
+ }
+
+ public Enumeration getInitParameterNames() {
+ return initParameters.keys();
+ }
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.argeo.jackrabbit.remote;
+
+import java.io.IOException;
+
+import javax.jcr.Repository;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jackrabbit.webdav.simple.ResourceConfig;
+import org.apache.jackrabbit.webdav.simple.SimpleWebdavServlet;
+import org.argeo.ArgeoException;
+import org.springframework.core.io.Resource;
+
+public class WebDavServlet extends SimpleWebdavServlet {
+
+ private static final long serialVersionUID = 1L;
+ private final static Log log = LogFactory.getLog(WebDavServlet.class);
+
+ private Repository repository;
+ private Resource resourceConfiguration;
+
+ public WebDavServlet() {
+
+ }
+
+ @Override
+ public void init() throws ServletException {
+ super.init();
+
+ if (resourceConfiguration != null) {
+ ResourceConfig resourceConfig = new ResourceConfig(null);
+ try {
+ resourceConfig.parse(resourceConfiguration.getURL());
+ } catch (IOException e) {
+ throw new ArgeoException("Cannot parse resource configuration "
+ + resourceConfiguration, e);
+ }
+ setResourceConfig(resourceConfig);
+ }
+ }
+
+ @Override
+ protected void service(HttpServletRequest request,
+ HttpServletResponse response) throws ServletException, IOException {
+ if (log.isTraceEnabled())
+ log.trace("Received request " + request);
+ super.service(request, response);
+
+ if (log.isTraceEnabled()) {
+ log.trace("Webdav response: " + response);
+ // response.
+ }
+ }
+
+ public Repository getRepository() {
+ return repository;
+ }
+
+ public void setRepository(Repository repository) {
+ this.repository = repository;
+ }
+
+ public void setResourceConfiguration(Resource resourceConfig) {
+ this.resourceConfiguration = resourceConfig;
+ }
+
+}
+++ /dev/null
-package org.argeo.jackrabbit.webdav;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.jcr.Credentials;
-import javax.jcr.LoginException;
-import javax.jcr.Repository;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.jackrabbit.server.SessionProvider;
-
-public class CachingSessionProvider implements SessionProvider {
- private static final String JCR_SESSIONS_ATTRIBUTE = "jcrSessions";
-
- private final static Log log = LogFactory
- .getLog(CachingSessionProvider.class);
-
- private Credentials credentials = null;
-
- public CachingSessionProvider() {
- }
-
- public CachingSessionProvider(Credentials credentials) {
- this.credentials = credentials;
- }
-
- @SuppressWarnings("unchecked")
- public Session getSession(HttpServletRequest request, Repository rep,
- String workspace) throws LoginException, ServletException,
- RepositoryException {
- HttpSession httpSession = request.getSession();
-
- if (httpSession.getAttribute(JCR_SESSIONS_ATTRIBUTE) == null) {
- httpSession
- .setAttribute(JCR_SESSIONS_ATTRIBUTE, Collections
- .synchronizedMap(new HashMap<String, Session>()));
- }
- Map<String, Session> sessions = (Map<String, Session>) httpSession
- .getAttribute(JCR_SESSIONS_ATTRIBUTE);
- if (!sessions.containsKey(workspace)) {
- Session session = rep.login(credentials, workspace);
- sessions.put(workspace, session);
- return session;
- } else {
- Session session = sessions.get(workspace);
- if (!session.isLive()) {
- sessions.remove(workspace);
- session = rep.login(credentials, workspace);
- sessions.put(workspace, session);
- }
- return session;
- }
- }
-
- public void releaseSession(Session session) {
- if (log.isDebugEnabled())
- log.debug("Releasing JCR session " + session);
- // session.logout();
- // FIXME: find a way to log out when the HTTP session is expired
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.argeo.jackrabbit.webdav;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.ArgeoException;
-import org.springframework.web.servlet.DispatcherServlet;
-
-public class ExtendedDispatcherServlet extends DispatcherServlet {
- private static final long serialVersionUID = -5584673209855752009L;
-
- private final static Log log = LogFactory
- .getLog(ExtendedDispatcherServlet.class);
-
- protected void service(HttpServletRequest request,
- HttpServletResponse response) throws ServletException,
- java.io.IOException {
- // see http://forum.springsource.org/showthread.php?t=53472
- try {
- if (log.isTraceEnabled())
- log.trace("Received request " + request);
- doService(request, response);
- } catch (Exception e) {
- throw new ArgeoException("Cannot process request", e);
- }
- }
-
-}
+++ /dev/null
-package org.argeo.jackrabbit.webdav;
-
-import javax.jcr.Repository;
-import javax.jcr.SimpleCredentials;
-
-import org.apache.jackrabbit.server.SessionProvider;
-
-public class JcrRemotingServlet extends
- org.apache.jackrabbit.server.remoting.davex.JcrRemotingServlet {
-
- private static final long serialVersionUID = 3131835511468341309L;
-
- private final Repository repository;
-
- public JcrRemotingServlet(Repository repository) {
- this.repository = repository;
- }
-
- @Override
- protected Repository getRepository() {
- return repository;
- }
-
- @Override
- protected SessionProvider getSessionProvider() {
- return new CachingSessionProvider(new SimpleCredentials("demo",
- "demo".toCharArray()));
- }
-
-}
+++ /dev/null
-package org.argeo.jackrabbit.webdav;
-
-import java.util.Enumeration;
-import java.util.Properties;
-
-import javax.jcr.Repository;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.jackrabbit.webdav.jcr.JCRWebdavServerServlet;
-import org.argeo.ArgeoException;
-import org.argeo.jcr.RepositoryRegister;
-import org.springframework.beans.BeansException;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-import org.springframework.context.ConfigurableApplicationContext;
-import org.springframework.web.context.ServletContextAware;
-import org.springframework.web.servlet.HandlerExecutionChain;
-import org.springframework.web.servlet.HandlerMapping;
-
-public class MultipleRepositoryHandlerMapping implements HandlerMapping,
- ApplicationContextAware, ServletContextAware {
- private final static Log log = LogFactory
- .getLog(MultipleRepositoryHandlerMapping.class);
-
- private ConfigurableApplicationContext applicationContext;
- private ServletContext servletContext;
-
- private RepositoryRegister repositoryRegister;
-
- public HandlerExecutionChain getHandler(HttpServletRequest request)
- throws Exception {
- if (log.isTraceEnabled()) {
- log.trace("getContextPath=" + request.getContextPath());
- log.trace("getServletPath=" + request.getServletPath());
- log.trace("getPathInfo=" + request.getPathInfo());
- }
-
- String repositoryName = extractRepositoryName(request);
- String pathPrefix = request.getServletPath() + '/' + repositoryName;
- String beanName = pathPrefix;
-
- if (!applicationContext.containsBean(beanName)) {
- Repository repository = repositoryRegister.getRepositories().get(
- repositoryName);
- HttpServlet servlet = createServlet(repository, pathPrefix);
- applicationContext.getBeanFactory().registerSingleton(beanName,
- servlet);
- // TODO: unregister it as well
- }
- HttpServlet remotingServlet = (HttpServlet) applicationContext
- .getBean(beanName);
- return new HandlerExecutionChain(remotingServlet);
- }
-
- protected HttpServlet createServlet(Repository repository, String pathPrefix)
- throws ServletException {
- JcrRemotingServlet jcrRemotingServlet = new JcrRemotingServlet(
- repository);
- Properties initParameters = new Properties();
- initParameters.setProperty(
- JCRWebdavServerServlet.INIT_PARAM_RESOURCE_PATH_PREFIX,
- pathPrefix);
- jcrRemotingServlet.init(new DelegatingServletConfig(pathPrefix.replace(
- '/', '_'), initParameters));
- return jcrRemotingServlet;
- }
-
- /** The repository name is the first part of the path info */
- protected String extractRepositoryName(HttpServletRequest request) {
- String pathInfo = request.getPathInfo();
- // TODO: optimize by checking character by character
- String[] tokens = pathInfo.split("/");
- StringBuffer currName = new StringBuffer("");
- tokens: for (String token : tokens) {
- if (token.equals(""))
- continue tokens;
- currName.append(token);
- if (repositoryRegister.getRepositories().containsKey(
- currName.toString()))
- return currName.toString();
- currName.append('/');
- }
- throw new ArgeoException("No repository can be found for request "
- + pathInfo);
- }
-
- public void setApplicationContext(ApplicationContext applicationContext)
- throws BeansException {
- this.applicationContext = (ConfigurableApplicationContext) applicationContext;
- }
-
- public void setServletContext(ServletContext servletContext) {
- this.servletContext = servletContext;
- }
-
- public void setRepositoryRegister(RepositoryRegister repositoryRegister) {
- this.repositoryRegister = repositoryRegister;
- }
-
- private class DelegatingServletConfig implements ServletConfig {
- private String name;
- private Properties initParameters;
-
- public DelegatingServletConfig(String name, Properties initParameters) {
- super();
- this.name = name;
- this.initParameters = initParameters;
- }
-
- public String getServletName() {
- return name;
- }
-
- public ServletContext getServletContext() {
- return servletContext;
- }
-
- public String getInitParameter(String paramName) {
- return initParameters.getProperty(paramName);
- }
-
- public Enumeration getInitParameterNames() {
- return initParameters.keys();
- }
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.argeo.jackrabbit.webdav;
-
-import java.io.IOException;
-
-import javax.jcr.Repository;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.jackrabbit.webdav.simple.ResourceConfig;
-import org.apache.jackrabbit.webdav.simple.SimpleWebdavServlet;
-import org.argeo.ArgeoException;
-import org.springframework.core.io.Resource;
-
-public class WebDavServlet extends SimpleWebdavServlet {
-
- private static final long serialVersionUID = 1L;
- private final static Log log = LogFactory.getLog(WebDavServlet.class);
-
- private Repository repository;
- private Resource resourceConfiguration;
-
- public WebDavServlet() {
-
- }
-
- @Override
- public void init() throws ServletException {
- super.init();
-
- if (resourceConfiguration != null) {
- ResourceConfig resourceConfig = new ResourceConfig(null);
- try {
- resourceConfig.parse(resourceConfiguration.getURL());
- } catch (IOException e) {
- throw new ArgeoException("Cannot parse resource configuration "
- + resourceConfiguration, e);
- }
- setResourceConfig(resourceConfig);
- }
- }
-
- @Override
- protected void service(HttpServletRequest request,
- HttpServletResponse response) throws ServletException, IOException {
- if (log.isTraceEnabled())
- log.trace("Received request " + request);
- super.service(request, response);
-
- if (log.isTraceEnabled()) {
- log.trace("Webdav response: " + response);
- // response.
- }
- }
-
- public Repository getRepository() {
- return repository;
- }
-
- public void setRepository(Repository repository) {
- this.repository = repository;
- }
-
- public void setResourceConfiguration(Resource resourceConfig) {
- this.resourceConfiguration = resourceConfig;
- }
-
-}
--- /dev/null
+<?xml version="1.0"?>
+<!--
+
+ Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+
+<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.6//EN"
+ "http://jackrabbit.apache.org/dtd/repository-1.6.dtd">
+ <!--
+ Example Repository Configuration File Used by -
+ org.apache.jackrabbit.core.config.RepositoryConfigTest.java -
+ -->
+<Repository>
+ <!--
+ virtual file system where the repository stores global state (e.g.
+ registered namespaces, custom node types, etc.)
+ -->
+ <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+ <param name="path" value="${rep.home}/repository" />
+ </FileSystem>
+
+ <!--
+ security configuration
+ -->
+ <Security appName="Jackrabbit">
+ <!--
+ security manager: class: FQN of class implementing the
+ JackrabbitSecurityManager interface
+ -->
+ <SecurityManager
+ class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager"
+ workspaceName="security">
+ <!--
+ workspace access: class: FQN of class implementing the
+ WorkspaceAccessManager interface
+ -->
+ <!-- <WorkspaceAccessManager class="..."/> -->
+ <!-- <param name="config" value="${rep.home}/security.xml"/> -->
+ </SecurityManager>
+
+ <!--
+ access manager: class: FQN of class implementing the AccessManager
+ interface
+ -->
+ <AccessManager
+ class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager">
+ <!-- <param name="config" value="${rep.home}/access.xml"/> -->
+ </AccessManager>
+
+ <LoginModule
+ class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">
+ <!--
+ anonymous user name ('anonymous' is the default value)
+ -->
+ <param name="anonymousId" value="anonymous" />
+ <!--
+ administrator user id (default value if param is missing is 'admin')
+ -->
+ <param name="adminId" value="admin" />
+ </LoginModule>
+ </Security>
+
+ <!--
+ location of workspaces root directory and name of default workspace
+ -->
+ <Workspaces rootPath="${rep.home}/workspaces"
+ defaultWorkspace="default" />
+ <!--
+ workspace configuration template: used to create the initial workspace
+ if there's no workspace yet
+ -->
+ <Workspace name="${wsp.name}">
+ <!--
+ virtual file system of the workspace: class: FQN of class
+ implementing the FileSystem interface
+ -->
+ <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+ <param name="path" value="${wsp.home}" />
+ </FileSystem>
+ <!--
+ persistence manager of the workspace: class: FQN of class
+ implementing the PersistenceManager interface
+ -->
+ <PersistenceManager
+ class="org.apache.jackrabbit.core.persistence.bundle.DerbyPersistenceManager">
+ <!--
+ <param name="url" value="jdbc:derby:memory:db;create=true" />
+ -->
+ <param name="url" value="jdbc:derby:${wsp.home}/db;create=true" />
+ <param name="driver" value="org.apache.derby.jdbc.EmbeddedDriver" />
+ <param name="schemaObjectPrefix" value="${wsp.name}_" />
+ </PersistenceManager>
+ <!--
+ Search index and the file system it uses. class: FQN of class
+ implementing the QueryHandler interface
+ -->
+ <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+ <param name="path" value="${wsp.home}/index" />
+ <param name="extractorPoolSize" value="2" />
+ <param name="supportHighlighting" value="true" />
+ </SearchIndex>
+ </Workspace>
+
+ <!--
+ Configures the versioning
+ -->
+ <Versioning rootPath="${rep.home}/version">
+ <!--
+ Configures the filesystem to use for versioning for the respective
+ persistence manager
+ -->
+ <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
+ <param name="path" value="${rep.home}/version" />
+ </FileSystem>
+
+ <!--
+ Configures the persistence manager to be used for persisting version
+ state. Please note that the current versioning implementation is
+ based on a 'normal' persistence manager, but this could change in
+ future implementations.
+ -->
+ <PersistenceManager
+ class="org.apache.jackrabbit.core.persistence.bundle.DerbyPersistenceManager">
+ <!--
+ <param name="url" value="jdbc:derby:memory:version;create=true" />
+ -->
+ <param name="url" value="jdbc:derby:${rep.home}/version/db;create=true" />
+ <param name="driver" value="org.apache.derby.jdbc.EmbeddedDriver" />
+ <param name="schemaObjectPrefix" value="version_" />
+ </PersistenceManager>
+ </Versioning>
+
+ <!--
+ Search index for content that is shared repository wide (/jcr:system
+ tree, contains mainly versions)
+ -->
+ <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+ <param name="path" value="${rep.home}/repository/index" />
+ <param name="extractorPoolSize" value="2" />
+ <param name="supportHighlighting" value="true" />
+ </SearchIndex>
+</Repository>
+++ /dev/null
-<?xml version="1.0"?>
-<!--
-
- Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-
-<!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Jackrabbit 1.6//EN"
- "http://jackrabbit.apache.org/dtd/repository-1.6.dtd">
- <!--
- Example Repository Configuration File Used by -
- org.apache.jackrabbit.core.config.RepositoryConfigTest.java -
- -->
-<Repository>
- <!--
- virtual file system where the repository stores global state (e.g.
- registered namespaces, custom node types, etc.)
- -->
- <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
- <param name="path" value="${rep.home}/repository" />
- </FileSystem>
-
- <!--
- security configuration
- -->
- <Security appName="Jackrabbit">
- <!--
- security manager: class: FQN of class implementing the
- JackrabbitSecurityManager interface
- -->
- <SecurityManager
- class="org.apache.jackrabbit.core.security.simple.SimpleSecurityManager"
- workspaceName="security">
- <!--
- workspace access: class: FQN of class implementing the
- WorkspaceAccessManager interface
- -->
- <!-- <WorkspaceAccessManager class="..."/> -->
- <!-- <param name="config" value="${rep.home}/security.xml"/> -->
- </SecurityManager>
-
- <!--
- access manager: class: FQN of class implementing the AccessManager
- interface
- -->
- <AccessManager
- class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager">
- <!-- <param name="config" value="${rep.home}/access.xml"/> -->
- </AccessManager>
-
- <LoginModule
- class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">
- <!--
- anonymous user name ('anonymous' is the default value)
- -->
- <param name="anonymousId" value="anonymous" />
- <!--
- administrator user id (default value if param is missing is 'admin')
- -->
- <param name="adminId" value="admin" />
- </LoginModule>
- </Security>
-
- <!--
- location of workspaces root directory and name of default workspace
- -->
- <Workspaces rootPath="${rep.home}/workspaces"
- defaultWorkspace="default" />
- <!--
- workspace configuration template: used to create the initial workspace
- if there's no workspace yet
- -->
- <Workspace name="${wsp.name}">
- <!--
- virtual file system of the workspace: class: FQN of class
- implementing the FileSystem interface
- -->
- <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
- <param name="path" value="${wsp.home}" />
- </FileSystem>
- <!--
- persistence manager of the workspace: class: FQN of class
- implementing the PersistenceManager interface
- -->
- <PersistenceManager
- class="org.apache.jackrabbit.core.persistence.bundle.DerbyPersistenceManager">
- <!--
- <param name="url" value="jdbc:derby:memory:db;create=true" />
- -->
- <param name="url" value="jdbc:derby:${wsp.home}/db;create=true" />
- <param name="driver" value="org.apache.derby.jdbc.EmbeddedDriver" />
- <param name="schemaObjectPrefix" value="${wsp.name}_" />
- </PersistenceManager>
- <!--
- Search index and the file system it uses. class: FQN of class
- implementing the QueryHandler interface
- -->
- <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
- <param name="path" value="${wsp.home}/index" />
- <param name="extractorPoolSize" value="2" />
- <param name="supportHighlighting" value="true" />
- </SearchIndex>
- </Workspace>
-
- <!--
- Configures the versioning
- -->
- <Versioning rootPath="${rep.home}/version">
- <!--
- Configures the filesystem to use for versioning for the respective
- persistence manager
- -->
- <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
- <param name="path" value="${rep.home}/version" />
- </FileSystem>
-
- <!--
- Configures the persistence manager to be used for persisting version
- state. Please note that the current versioning implementation is
- based on a 'normal' persistence manager, but this could change in
- future implementations.
- -->
- <PersistenceManager
- class="org.apache.jackrabbit.core.persistence.bundle.DerbyPersistenceManager">
- <!--
- <param name="url" value="jdbc:derby:memory:version;create=true" />
- -->
- <param name="url" value="jdbc:derby:${rep.home}/version/db;create=true" />
- <param name="driver" value="org.apache.derby.jdbc.EmbeddedDriver" />
- <param name="schemaObjectPrefix" value="version_" />
- </PersistenceManager>
- </Versioning>
-
- <!--
- Search index for content that is shared repository wide (/jcr:system
- tree, contains mainly versions)
- -->
- <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
- <param name="path" value="${rep.home}/repository/index" />
- <param name="extractorPoolSize" value="2" />
- <param name="supportHighlighting" value="true" />
- </SearchIndex>
-</Repository>