Apache JackRabbit 存储库有抽象层吗?

发布于 2024-10-25 16:39:08 字数 691 浏览 1 评论 0原文

我想知道是否有一个库可以为开发人员提供某种抽象,以便更轻松地访问 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

没有心的人 2024-11-01 16:39:08

已经有一个项目试图简化事情:Jackrabbit JCR Commons。也许你可以帮助这个项目?

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

失退 2024-11-01 16:39:08

查看 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文