I'm using it inside of a spring boot project (in development). The 3 steps are

1.  Add the maven dependencies, as needed, for javax.jcr, oak-*, and
jackrabbit-*

2. Create a @Configuration class that will configure Oak.
--------------

FileBlobStore fileBlobStore = new FileBlobStore(repoDir.getAbsolutePath());
FileStore source = new FileStore(fileBlobStore, repoDir, 100, true);
NodeStore segmentNodeStore = new SegmentNodeStore(source);

Oak oak = new Oak(segmentNodeStore)
        .with("AppName")
        .with(new InitialDAMContent(segmentNodeStore))       // add
initial content and folder structure
                //.with(new SecurityProviderImpl())  // use the default security
                //.with(new DefaultTypeEditor())     // automatically
set default types
                //.with(new NameValidatorProvider()) // allow only
valid JCR names
                //.with(new OpenSecurityProvider())
                //.with(new PropertyIndexHook())     // simple indexing support
                //.with(new PropertyIndexProvider()) // search support
for the indexes
        .with(new CommitDAMHook())
        .withAsyncIndexing();

return oak;

-------------

And configure a Repository Bean that you can use throughout your application.

------------
// create JCR object
Jcr jcr = new Jcr(getOak())
        .withAsyncIndexing();

// Create repository
Repository repository = jcr.createRepository();
return repository;
-----------


3. From here you just need to call repository.login to get a valid
session (repository.login(...)) and then you can start interacting
with the OAK apis.  In my case I'm using Basic Auth with my Spring MVC
REST services to expose the JCR.


Hope this helps,
--mike




On Thu, Jan 29, 2015 at 12:34 AM, Jie Chen <[email protected]> wrote:
>
> Hi,
>
> Currently I am working in a Spring boot application, but I also want to
> check out Oak to be the content management layer. I know Sling could be a
> good choice to work with Oak. But my project requires me to use Spring
> boot. Can you help guide me to go through this problem?
>
>
> Best,
> Jie

Reply via email to