<commit_before><?xml version="1.0"?>
<!--
   Copyright 2004-2005 The Apache Software Foundation or its licensors,
                       as applicable.

   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.
  -->
<document>
 <properties>
  <title>First Steps</title>
 </properties>

 <body>
  <section name="Download and Build Jackrabbit">
   <p>Please refer to the <a href="http://svn.apache.org/repos/asf/incubator/jackrabbit/trunk/README.txt">README.txt</a>
      to find details on how to build Jackrabbit using Maven.
   </p>
  </section>
  <section name="Run Jackrabbit">
   <p>
    The following code provides a brief introduction to using Jackrabbit
    in a simple application.  Please note that this example is meant to
    be as short and simple as possible, rather than usable as a real
    application, and should not be interpreted as best practice.
   </p>
   <p>
    JCRTest.java
    <source>
import java.util.Hashtable;

import javax.jcr.*;

import javax.naming.Context;
import javax.naming.InitialContext;

import org.apache.jackrabbit.core.jndi.RegistryHelper;

public class JCRTest {

  public static void main(String[] args) {
    try {
      String configFile = "<b>repotest/repository.xml</b>";
      String repHomeDir = "<b>repotest</b>";
      
      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, "repo", configFile, repHomeDir, true);
      Repository r = (Repository) ctx.lookup("repo");
      Session session = r.login(new SimpleCredentials("userid", "".toCharArray()), null);
      Node rn=session.getRootNode();
      
      System.out.println(rn.getPrimaryNodeType().getName());
      
      
    } catch (Exception e){
      System.err.println(e);
    }
  }
}
    </source>
   </p>
   <p>
    The <code>configFile</code> variable points to a file, named
    <code>repository.xml</code> by convention, that contains
    the repository configuration.  
    An example <code>repository.xml</code> might look like this:
    <source>
&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
&lt;Repository&gt;
    &lt;FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"&gt;
        &lt;param name="path" value="${rep.home}/repository"/&gt;
    &lt;/FileSystem&gt;
    &lt;Security appName="Jackrabbit"&gt;
        &lt;AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager"/&gt;
    &lt;/Security&gt;
    &lt;Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default" /&gt;
    &lt;Workspace name="${wsp.name}"&gt;
        &lt;FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"&gt;
            &lt;param name="path" value="${wsp.home}"/&gt;
        &lt;/FileSystem&gt;
        &lt;PersistenceManager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" /&gt;
        &lt;SearchIndex&gt;
            &lt;FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"&gt;
                &lt;param name="path" value="${wsp.home}/index"/&gt;
            &lt;/FileSystem&gt;
        &lt;/SearchIndex&gt;
    &lt;/Workspace&gt;
    &lt;Versioning rootPath="${rep.home}/versions"&gt;
        &lt;FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"&gt;
            &lt;param name="path" value="${rep.home}/versions"/&gt;
        &lt;/FileSystem&gt;
        &lt;PersistenceManager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" /&gt;
    &lt;/Versioning&gt;
&lt;/Repository&gt;   
    </source>
   </p><commit_msg>Include name of default query handler class name.<commit_after><?xml version="1.0"?>
<!--
   Copyright 2004-2005 The Apache Software Foundation or its licensors,
                       as applicable.

   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.
  -->
<document>
 <properties>
  <title>First Steps</title>
 </properties>

 <body>
  <section name="Download and Build Jackrabbit">
   <p>Please refer to the <a href="http://svn.apache.org/repos/asf/incubator/jackrabbit/trunk/README.txt">README.txt</a>
      to find details on how to build Jackrabbit using Maven.
   </p>
  </section>
  <section name="Run Jackrabbit">
   <p>
    The following code provides a brief introduction to using Jackrabbit
    in a simple application.  Please note that this example is meant to
    be as short and simple as possible, rather than usable as a real
    application, and should not be interpreted as best practice.
   </p>
   <p>
    JCRTest.java
    <source>
import java.util.Hashtable;

import javax.jcr.*;

import javax.naming.Context;
import javax.naming.InitialContext;

import org.apache.jackrabbit.core.jndi.RegistryHelper;

public class JCRTest {

  public static void main(String[] args) {
    try {
      String configFile = "<b>repotest/repository.xml</b>";
      String repHomeDir = "<b>repotest</b>";
      
      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, "repo", configFile, repHomeDir, true);
      Repository r = (Repository) ctx.lookup("repo");
      Session session = r.login(new SimpleCredentials("userid", "".toCharArray()), null);
      Node rn=session.getRootNode();
      
      System.out.println(rn.getPrimaryNodeType().getName());
      
      
    } catch (Exception e){
      System.err.println(e);
    }
  }
}
    </source>
   </p>
   <p>
    The <code>configFile</code> variable points to a file, named
    <code>repository.xml</code> by convention, that contains
    the repository configuration.  
    An example <code>repository.xml</code> might look like this:
    <source>
&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
&lt;Repository&gt;
    &lt;FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"&gt;
        &lt;param name="path" value="${rep.home}/repository"/&gt;
    &lt;/FileSystem&gt;
    &lt;Security appName="Jackrabbit"&gt;
        &lt;AccessManager class="org.apache.jackrabbit.core.security.SimpleAccessManager"/&gt;
    &lt;/Security&gt;
    &lt;Workspaces rootPath="${rep.home}/workspaces" defaultWorkspace="default" /&gt;
    &lt;Workspace name="${wsp.name}"&gt;
        &lt;FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"&gt;
            &lt;param name="path" value="${wsp.home}"/&gt;
        &lt;/FileSystem&gt;
        &lt;PersistenceManager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" /&gt;
        &lt;SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex"&gt;
            &lt;FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"&gt;
                &lt;param name="path" value="${wsp.home}/index"/&gt;
            &lt;/FileSystem&gt;
        &lt;/SearchIndex&gt;
    &lt;/Workspace&gt;
    &lt;Versioning rootPath="${rep.home}/versions"&gt;
        &lt;FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"&gt;
            &lt;param name="path" value="${rep.home}/versions"/&gt;
        &lt;/FileSystem&gt;
        &lt;PersistenceManager class="org.apache.jackrabbit.core.state.xml.XMLPersistenceManager" /&gt;
    &lt;/Versioning&gt;
&lt;/Repository&gt;   
    </source>
   </p>
{'fraction_non_alphanumeric': 0.13220815752461323, 'fraction_numerical': 0.004922644163150493, 'mean_word_length': 3.4166666666666665, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 4, '>': 73, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '879609', 'n_tokens_mistral': 2672, 'n_tokens_neox': 2597, 'n_words': 631}