lisak
lisak

Reputation: 21961

Is there any abstraction layer for Apache JackRabbit repository?

I was wondering if there is a library that provides developers with some sort of abstraction for accessing JackRabbit more easily.

I'm aware of the fact that there are a few CMS that utilizes jackRabbit and that have such an abstraction.

Something that would cover all this :

InputStream stream = new BufferedInputStream(new FileInputStream(file));

Node folder = session.getNode("/absolute/path/to/folder/node");
Node file = folder.addNode("Article.pdf","nt:file");
Node content = file.addNode("jcr:content","nt:resource");
Binary binary = session.getValueFactory().createBinary(stream);
content.setProperty("jcr:data",binary);

Example :

JCRUtils.addFile(File file, String Title, String description, Map<String, String> properties, MixinType mixinType)

I'm going to implement this layer myself, but I wanted to be sure, that I won't "implement a wheel" that has been implemented.

Upvotes: 1

Views: 432

Answers (2)

Robert Christian
Robert Christian

Reputation: 18300

Check out the FS2 project on GitHub. It abstracts at the URI level and is very simple to use. You can create a custom repository very simply using a template pattern. It's a lightweight answer to JSR 170. There's a test harness built into the framework... just check out the example in-memory and file implementations.

Upvotes: 0

Thomas Mueller
Thomas Mueller

Reputation: 50087

There is already a project that tries to simplify things: Jackrabbit JCR Commons. Maybe you could help in this project?

Upvotes: 2

Related Questions