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

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

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