Question

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.

Was it helpful?

Solution

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top