1
votes

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.

2
You are fully familiar with JSR-170? There is a "behave like Windows file server" mode which may be easier to work with.Thorbjørn Ravn Andersen
I am, I'm just checking, because I rather contribute to some open source project that already exists, instead of programing something from scratch. I believe that everybody who is programatically using JackRabbit is writing this abstraction layer...lisak
I just created the basic abstraction for what I need and I must admit that the library would have to be damn fancy to be useful :-)lisak

2 Answers

2
votes

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

0
votes

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.