Apache JackRabbit 存储库有抽象层吗?
我想知道是否有一个库可以为开发人员提供某种抽象,以便更轻松地访问 JackRabbit。
我知道有一些 CMS 使用 jackRabbit 并且具有这样的抽象。
涵盖所有这些的东西:
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);
示例:
JCRUtils.addFile(File file, String Title, String description, Map<String, String> properties, MixinType mixinType)
我将自己实现这一层,但我想确定,我不会“实现已实现的轮子”。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
已经有一个项目试图简化事情:Jackrabbit JCR Commons。也许你可以帮助这个项目?
There is already a project that tries to simplify things: Jackrabbit JCR Commons. Maybe you could help in this project?
查看 GitHub 上的 FS2 项目。它在 URI 级别进行抽象,并且使用起来非常简单。您可以使用模板模式非常简单地创建自定义存储库。这是对 JSR 170 的轻量级答案。框架中内置了一个测试工具...只需查看内存中和文件实现的示例即可。
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.