如何使用 CMIS REST API 访问 Alfresco 中的文件?

编程入门 行业动态 更新时间:2024-10-25 10:33:08
本文介绍了如何使用 CMIS REST API 访问 Alfresco 中的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我安装了 Alfresco Community v4.1 以在我的应用程序中使用.我想使用 CMIS REST API 访问其内容(列表文件、添加、删除等).我没有找到我需要使用的端点的任何示例.我实现了一个小的 CMIS 客户端 (您可以在此处获取相关信息) 使用 Apache Chemistry 并列出我用户空间的内容,然后我获得了以下结果:

I installed Alfresco Community v4.1 for use in my application. I want to access its contents (list files, add, delete etc.) using CMIS REST API. I don't find any example for the endpoint I need to use. I implemented a small CMIS client (you can get information on it here) using Apache Chemistry and listing the contents of my user's space and I obtain this result:

[Folder] workspace://SpacesStore/624914c7-3ca2-4937-a612-96f1df928cc1 - Dictionnaire de données [Folder] workspace://SpacesStore/846c69d4-4ec2-44c8-972d-f975d9b98d41 - Modèles d'espace [Folder] workspace://SpacesStore/09fe45df-9cba-4843-a1cb-944807e44267 - Projet de conception logicielle .... [Folder] workspace://SpacesStore/ab5cab42-2b47-4042-a8f5-57bb06007cc3 - Espaces Utilisateurs [Folder] workspace://SpacesStore/86f1c760-905e-4920-98a8-a6bdd10aa732 - ombinte [Folder] workspace://SpacesStore/2dbc6156-fdfa-4ddc-9187-481992570369 - MonProjet [Folder] workspace://SpacesStore/fb3bb96f-3eb0-40a5-a890-3d06d6e781cf - Carnet 200 [Folder] workspace://SpacesStore/b9acaf70-d5d5-4dba-a354-bae63ba96072 - Carnet 100 [Docment] workspace://SpacesStore/9c3c6e63-e217-47a8-8216-298d2419cffa;1.0 - file.pdf

当我尝试列出节点的内容时,我总是收到 404 错误.

When I try to list the contents of a node I always get a 404 error.

127.0.0.1:8080/alfresco/service/api/node/content/workspace/SpacesStore/ab5cab42-2b47-4042-a8f5-57bb06007cc3

在哪里可以找到有关如何为 Alfresco 实施 CMIS REST API 的文档?

Where can I find documentation on how to implement CMIS REST API for Alfresco?

推荐答案

您可以使用此方法访问您的仓库

You can use this method to access to your repository

试试这个对我来说很好

private static Session getSession(String serverUrl, String username, String password) { SessionFactory sessionFactory = SessionFactoryImpl.newInstance(); Map<String, String> params = new HashMap<String, String>(); params.put(SessionParameter.USER, username); params.put(SessionParameter.PASSWORD, password); params.put(SessionParameter.ATOMPUB_URL, serverUrl); params.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value()); List<Repository> repos = sessionFactory.getRepositories(params); if (repos.isEmpty()) { throw new RuntimeException("Server has no repositories!"); } return repos.get(0).createSession(); }

此方法使用您自己的信息从您的存储库中获取会话

This method get the session from your repository with your own informations

serverUrl : " + ipAlfresco + "/alfresco/api/-default-/public/cmis/versions/1.0/atom username : admin password : admin

希望对你有帮助.

更多推荐

如何使用 CMIS REST API 访问 Alfresco 中的文件?

本文发布于:2023-11-28 09:30:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1641856.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   文件   CMIS   REST   API

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!