如何通过RESTful API在Alfresco中创建文件夹

编程入门 行业动态 更新时间:2024-10-13 10:27:14
本文介绍了如何通过RESTful API在Alfresco中创建文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在为Android使用 Freshdocs

I am using Freshdocs for Android

我可以使用以下API调用登录Alfresco服务器:

I can login to the Alfresco server using this API call:

GET /alfresco/service/api/login?u={username}&pw={password?}

但是如何在Alfresco中创建新文件夹?

But how do I create a new folder in Alfresco?

推荐答案

有两个主要选项,但这取决于您要执行的操作以及您使用的Alfresco版本

There are two main options, but it'll depend on what else you want to do, and what version of Alfresco you're running.

假设您要使事情保持简单,并且只想创建一个文件夹,并且使用的是Alfresco 4.1或更高版本,则可以使用 org.alfresco.repository.node.folder.post 网页脚本。为此,只需发布​​JSON之类的

Assuming you want to keep things very simple, and you just want to create one folder, and you're using Alfresco 4.1 or later, then you can use the org.alfresco.repository.node.folder.post webscript. For this, simply post JSON like either

{ "name": "NewNodeName" }

{ "name": "NewNodeName", "title": "New Node Title", "description": "A shiny new node", "type": "cm:folder" }

到API,该URL采用 / api / site / folder / {site} / {container} / {path}

To the API, which takes a URL like /api/site/folder/{site}/{container}/{path}

或者,如果您想做很多不同的事情文件和文件夹操作(例如,浏览文件夹结构,创建文件夹,将文件上传到其中等),那么您应该改用 CMIS 。 Apache Chemistry 是用于CMIS的出色库,它甚至具有Android客户端!仍在编写android客户端文档的想法(只是刚刚添加了Android端口),因此您可能需要在邮件列表,如果您没有时间等待文档。

Alternately, if you want to do a number of different file and folder operations (eg navigate the folder structure, create a folder, upload a file to it etc), then you should instead use CMIS. Apache Chemistry is a great library to use for CMIS, and it even has an Android client! The docs for the android client are still being written thought (the Android port was only just added), so you might need to ask on the mailing list if you don't have time to wait for the docs.

更多推荐

如何通过RESTful API在Alfresco中创建文件夹

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

发布评论

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

>www.elefans.com

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