You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by th...@apache.org on 2014/10/29 10:41:55 UTC
svn commit: r1635079 -
/jackrabbit/oak/trunk/oak-doc/src/site/markdown/construct.md
Author: thomasm
Date: Wed Oct 29 09:41:55 2014
New Revision: 1635079
URL: http://svn.apache.org/r1635079
Log:
OAK-301 Document Oak
Modified:
jackrabbit/oak/trunk/oak-doc/src/site/markdown/construct.md
Modified: jackrabbit/oak/trunk/oak-doc/src/site/markdown/construct.md
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-doc/src/site/markdown/construct.md?rev=1635079&r1=1635078&r2=1635079&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-doc/src/site/markdown/construct.md (original)
+++ jackrabbit/oak/trunk/oak-doc/src/site/markdown/construct.md Wed Oct 29 09:41:55 2014
@@ -25,25 +25,22 @@ construction/configuration mechanism of
First, we construct a Repository instance.
Both the `Oak` and the `Jcr` classes support `with()` methods,
so you can easily extend the repository with custom functionality if you like.
-The `OpenSecurityProvider` will cause all login attempts will work.
To construct an in-memory repository, use:
- Repository repo = new Jcr(new Oak())
- .with(new OpenSecurityProvider())
- .createRepository();
+ Repository repo = new Jcr(new Oak()).createRepository();
To use a MongoDB backend, use:
DB db = new MongoClient("127.0.0.1", 27017).getDB("test2");
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();
-To login to the repository and do some work:
-
- Session session = repo.login();
+To login to the repository and do some work.
+The default username/password combination is admin/admin:
+
+ Session session = repo.login(
+ new SimpleCredentials("admin", "admin".toCharArray()));
Node root = session.getRootNode();
if (root.hasNode("hello")) {
Node hello = root.getNode("hello");