jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1635080 - /jackrabbit/site/live/oak/docs/construct.html
Date Wed, 29 Oct 2014 09:43:38 GMT
Author: thomasm
Date: Wed Oct 29 09:43:38 2014
New Revision: 1635080

URL: http://svn.apache.org/r1635080
Log:
OAK-936: Site checkin for project Oak Documentation-1.1-SNAPSHOT

Modified:
    jackrabbit/site/live/oak/docs/construct.html

Modified: jackrabbit/site/live/oak/docs/construct.html
URL: http://svn.apache.org/viewvc/jackrabbit/site/live/oak/docs/construct.html?rev=1635080&r1=1635079&r2=1635080&view=diff
==============================================================================
--- jackrabbit/site/live/oak/docs/construct.html (original)
+++ jackrabbit/site/live/oak/docs/construct.html Wed Oct 29 09:43:38 2014
@@ -429,12 +429,10 @@
    See the License for the specific language governing permissions and
    limitations under the License. --><h1>Repository Construction</h1>
 <p>Oak comes with a simple and flexible mechanism for constructing content repositories
for use in embedded deployments and test cases. This article describes this mechanism. Deployments
in managed environments like OSGi should use the native construction/configuration mechanism
of the environment.</p>
-<p>First, we construct a Repository instance. Both the <tt>Oak</tt> and
the <tt>Jcr</tt> classes support <tt>with()</tt> methods, so you can
easily extend the repository with custom functionality if you like. The <tt>OpenSecurityProvider</tt>
will cause all login attempts will work. To construct an in-memory repository, use:</p>
+<p>First, we construct a Repository instance. Both the <tt>Oak</tt> and
the <tt>Jcr</tt> classes support <tt>with()</tt> methods, so you can
easily extend the repository with custom functionality if you like. To construct an in-memory
repository, use:</p>
 
 <div class="source">
-<pre>    Repository repo = new Jcr(new Oak())
-            .with(new OpenSecurityProvider())
-            .createRepository();
+<pre>    Repository repo = new Jcr(new Oak()).createRepository();
 </pre></div>
 <p>To use a MongoDB backend, use:</p>
 
@@ -442,14 +440,13 @@
 <pre>    DB db = new MongoClient(&quot;127.0.0.1&quot;, 27017).getDB(&quot;test2&quot;);
     DocumentNodeStore ns = new DocumentMK.Builder().
             setMongoDB(db).getNodeStore();
-    Repository repo = new Jcr(new Oak(ns))
-            .with(new OpenSecurityProvider())
-            .createRepository();
+    Repository repo = new Jcr(new Oak(ns)).createRepository();
 </pre></div>
-<p>To login to the repository and do some work:</p>
+<p>To login to the repository and do some work. The default username/password combination
is admin/admin:</p>
 
 <div class="source">
-<pre>    Session session = repo.login();
+<pre>    Session session = repo.login(
+            new SimpleCredentials(&quot;admin&quot;, &quot;admin&quot;.toCharArray()));
     Node root = session.getRootNode();
     if (root.hasNode(&quot;hello&quot;)) {
         Node hello = root.getNode(&quot;hello&quot;);



Mime
View raw message