cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject svn commit: r330017 - in /cocoon/blocks/jcr/trunk: java/org/apache/cocoon/jcr/AbstractRepository.java test/org/apache/cocoon/jcr/repository.xml
Date Tue, 01 Nov 2005 10:28:31 GMT
Author: sylvain
Date: Tue Nov  1 02:28:25 2005
New Revision: 330017

URL: http://svn.apache.org/viewcvs?rev=330017&view=rev
Log:
Fix #COCOON-1669

Modified:
    cocoon/blocks/jcr/trunk/java/org/apache/cocoon/jcr/AbstractRepository.java
    cocoon/blocks/jcr/trunk/test/org/apache/cocoon/jcr/repository.xml

Modified: cocoon/blocks/jcr/trunk/java/org/apache/cocoon/jcr/AbstractRepository.java
URL: http://svn.apache.org/viewcvs/cocoon/blocks/jcr/trunk/java/org/apache/cocoon/jcr/AbstractRepository.java?rev=330017&r1=330016&r2=330017&view=diff
==============================================================================
--- cocoon/blocks/jcr/trunk/java/org/apache/cocoon/jcr/AbstractRepository.java (original)
+++ cocoon/blocks/jcr/trunk/java/org/apache/cocoon/jcr/AbstractRepository.java Tue Nov  1
02:28:25 2005
@@ -264,6 +264,8 @@
                 JCR_SESSION_REQUEST_ATTRIBUTE : JCR_SESSION_REQUEST_ATTRIBUTE + "/" + workspace;
 
         Request request = ObjectModelHelper.getRequest(objectModel);
+        //FIXME: request is null when running in a testcase
+        if (request == null) return null;
         Session session = (Session) request.getAttribute(attributeName);
 
         return (session != null && session.isLive()) ? session : null;
@@ -282,6 +284,8 @@
                 JCR_SESSION_REQUEST_ATTRIBUTE : JCR_SESSION_REQUEST_ATTRIBUTE + "/" + workspace;
 
         Request request = ObjectModelHelper.getRequest(objectModel);
+        //FIXME: request is null when running in a testcase
+        if (request == null) return;
         request.setAttribute(attributeName, session);
     }
 

Modified: cocoon/blocks/jcr/trunk/test/org/apache/cocoon/jcr/repository.xml
URL: http://svn.apache.org/viewcvs/cocoon/blocks/jcr/trunk/test/org/apache/cocoon/jcr/repository.xml?rev=330017&r1=330016&r2=330017&view=diff
==============================================================================
--- cocoon/blocks/jcr/trunk/test/org/apache/cocoon/jcr/repository.xml (original)
+++ cocoon/blocks/jcr/trunk/test/org/apache/cocoon/jcr/repository.xml Tue Nov  1 02:28:25
2005
@@ -1,5 +1,4 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!-- <!DOCTYPE Repository PUBLIC "-//The Apache Software Foundation//DTD Repository//EN"
"file://config.dtd"> -->
 <!DOCTYPE Repository [
     <!--
         the Repository element configures a repository instance;
@@ -14,6 +13,9 @@
             used by the repository to persist global state such as
             registered namespaces, custom node types, etc..
 
+            a Security element that specifies the name of the app-entry
+            in the JAAS config and the access manager
+
             a Workspaces element that specifies to the location of
             workspaces root directory and the name of default workspace
 
@@ -25,10 +27,10 @@
             a SearchIndex element that is used for configuring per workspace
             Indexing-related settings
 
-            a Versioning element that is used for configuring 
+            a Versioning element that is used for configuring
             versioning-related settings
     -->
-    <!ELEMENT Repository (FileSystem,Security,Workspaces,Workspace)>
+    <!ELEMENT Repository (FileSystem,Security,Workspaces,Workspace,Versioning)>
 
     <!--
         a virtual file system
@@ -38,14 +40,6 @@
       class CDATA #REQUIRED>
 
     <!--
-        generic parameter (name/value pair)
-    -->
-    <!ELEMENT param EMPTY>
-    <!ATTLIST param
-      name CDATA #REQUIRED
-      value CDATA #REQUIRED>
-
-     <!--
         the Security element specifies the name (appName attribute)
         of the JAAS configuration app-entry for this repository. 
 
@@ -64,6 +58,14 @@
     <!ATTLIST AccessManager
       class CDATA #REQUIRED>
 
+    <!--
+        generic parameter (name/value pair)
+    -->
+    <!ELEMENT param EMPTY>
+    <!ATTLIST param
+      name CDATA #REQUIRED
+      value CDATA #REQUIRED>
+
      <!--
         the LoginModule element optionally specifies a JAAS login module to
         authenticate users. This feature allows the use of Jackrabbit in a
@@ -98,7 +100,7 @@
     <!--
         the PersistenceManager element configures the persistence manager
         to be used for the workspace; the class attribute specifies the
-        FQN of the class implementing PersistenceManager interface
+        FQN of the class implementing the PersistenceManager interface
     -->
     <!ELEMENT PersistenceManager (param*)>
     <!ATTLIST PersistenceManager
@@ -109,7 +111,7 @@
         (used by the QueryHandler); the class attribute specifies the
         FQN of the class implementing the QueryHandler interface.
     -->
-    <!ELEMENT SearchIndex (param*,FileSystem)>
+    <!ELEMENT SearchIndex (param*,FileSystem?)>
     <!ATTLIST SearchIndex
       class CDATA #REQUIRED>
 
@@ -161,46 +163,59 @@
     <Workspace name="${wsp.name}">
         <!--
             virtual file system of the workspace:
-            class: FQN of class implementing FileSystem interface
-        -->
-        <!--
-        <FileSystem class="com.day.jackrabbit.fs.cq.CQFileSystem">
-            <param name="path" value="${wsp.home}/wspStore.dat"/>
-            <param name="autoRepair" value="false"/>
-            <param name="blockSize" value="128"/>
-            <param name="autoSync" value="false"/>
-        </FileSystem>
+            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 PersistenceManager interface
-        -->
-        <!--
-        <PersistenceManager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager"/>
-        -->
-        <!--
-        <PersistenceManager class="org.apache.jackrabbit.core.state.mem.InMemPersistenceManager">
-            <param name="initialCapacity" value="100000"/>
-            <param name="loadFactor" value="0.3"/>
-            <param name="persistent" value="true"/>
-        </PersistenceManager>
+            class: FQN of class implementing the PersistenceManager interface
         -->
         <PersistenceManager class="org.apache.jackrabbit.core.state.obj.ObjectPersistenceManager"/>
+        <!--PersistenceManager class="org.apache.jackrabbit.core.state.db.DerbyPersistenceManager">
+            <param name="url" value="jdbc:derby:${wsp.home}/db;create=true"/>
+            <param name="schemaObjectPrefix" value="${wsp.name}_"/>
+        </PersistenceManager-->
         <!--
             Search index and the file system it uses.
+            class: FQN of class implementing the QueryHandler interface
+
+            If required by the QueryHandler implementation, one may configure
+            a FileSystem that the handler may use.
+
+            Supported parameters for lucene search index:
+            - path: location of the index. This parameter is mandatory!
+            - useCompoundFile: advises lucene to use compound files for the index files
+            - minMergeDocs: minimum number of nodes in an index until segments are merged
+            - volatileIdleTime: idle time in seconds until the volatile index is
+              moved to persistent index even though minMergeDocs is not reached.
+            - maxMergeDocs: maximum number of nodes in segments that will be merged
+            - mergeFactor: determines how often segment indices are merged
+            - bufferSize: maximum number of documents that are held in a pending
+              queue until added to the index
+            - cacheSize: size of the document number cache. This cache maps
+              uuids to lucene document numbers
+            - forceConsistencyCheck: runs a consistency check on every startup. If
+              false, a consistency check is only performed when the search index
+              detects a prior forced shutdown.
+            - autoRepair: errors detected by a consistency check are automatically
+              repaired. If false, errors are only written to the log.
+
+            Note: all parameters (except path) in this SearchIndex config are default
+            values and can be omitted.
         -->
         <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
+            <param name="path" value="${wsp.home}/index"/>
             <param name="useCompoundFile" value="true"/>
-            <param name="minMergeDocs" value="1000"/>
-            <param name="maxMergeDocs" value="10000"/>
+            <param name="minMergeDocs" value="100"/>
+            <param name="volatileIdleTime" value="3"/>
+            <param name="maxMergeDocs" value="100000"/>
             <param name="mergeFactor" value="10"/>
-
-            <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
-                <param name="path" value="${wsp.home}/index"/>
-            </FileSystem>
+            <param name="bufferSize" value="10"/>
+            <param name="cacheSize" value="1000"/>
+            <param name="forceConsistencyCheck" value="false"/>
+            <param name="autoRepair" value="true"/>
         </SearchIndex>
     </Workspace>
 
@@ -212,15 +227,6 @@
             Configures the filesystem to use for versioning for the respective
             persistence manager
         -->
-        <!--
-        <FileSystem class="com.day.jackrabbit.fs.cq.CQFileSystem">
-            <param name="path" value="${rep.home}/version/version.dat"/>
-            <param name="autoRepair" value="false"/>
-            <param name="blockSize" value="128"/>
-            <param name="autoSync" value="false"/>
-        </FileSystem>
-        -->
-    
         <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
             <param name="path" value="${rep.home}/version"/>
         </FileSystem>
@@ -232,6 +238,10 @@
             implementations.
         -->
         <PersistenceManager class="org.apache.jackrabbit.core.state.obj.ObjectPersistenceManager"/>
+        <!--PersistenceManager class="org.apache.jackrabbit.core.state.db.DerbyPersistenceManager">
+            <param name="url" value="jdbc:derby:${rep.home}/version/db;create=true"/>
+            <param name="schemaObjectPrefix" value="version_"/>
+        </PersistenceManager-->
 
     </Versioning>
 </Repository>



Mime
View raw message