同名上传并更新到Alfresco

编程入门 行业动态 更新时间:2024-10-23 13:26:23
本文介绍了同名上传并更新到Alfresco的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想将文件更新到Alfresco.我上传了它,当我想更新(具有相同的名称)时,出现重复的子名称"错误.我想在Alfresco上保留两个相同名称的文件,并且只更改文件版本"(Alfresco的名称将是一个,但文件版本为1.0,1.1,1.2). 以下是我遇到问题的Java代码.

i want to update files to Alfresco. i upload it and when i want to update (with same name) i have errors "duplicate child name". i want to keep both of files with the same name on Alfresco and to change only the "file versions" (the name to Alfresco will be one but have file versions 1.0 , 1.1, 1.2). Below is my java code that i have the problem.

protected void executeFunction(AlfrescoRestClient alfrescoClient, AlfrescoSOAPClient alfrescoSOAPClient) throws Exception { String lastFileId = ""; for (int i=0; i < files.size(); i++) { String filename = files.get(i).substring(files.get(i).lastIndexOf("name=")+5); String contentType = files.get(i).substring(0, files.get(i).indexOf(";")); lastFileId = alfrescoSOAPClient.uploadFileWithProperties(this.sourcePath + filename, filename, this.destinationFolder, contentType, "utf8", false, null, null, null, null, null, false, null, null, null, null, null, false, null, null, null); AlfrescoResponse resp = alfrescoClient.updateCheckedOutFile(this.sourcePath + filename, this.description, contentType, checkOutId); Document<Element> doc = resp.getDocument(); Entry responseEntry = (Entry)doc.getRoot(); LOGGER.severe("ID: " + responseEntry.getId().toString()); lastFileId = responseEntry.getId().toString(); this.fileId = lastFileId; } }

推荐答案

您无法在露天场所更新具有相同名称的文档,但可以更改内容并更新文档的版本.

You can not Update the document with same name in alfresco but you can change the content and update the version of Document.

更多推荐

同名上传并更新到Alfresco

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

发布评论

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

>www.elefans.com

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