如何通过 RESTful API 在 Alfresco 中创建文件夹 [英] How to create folder in Alfresco by RESTful API

查看:32
本文介绍了如何通过 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,它采用类似 /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 中创建文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆