c# - 使用 Dot CMIS 在 Alfresco 中创建具有多值属性的文档

标签 c# alfresco dotcmis

就像上面建议的那样,我尝试使用 DotCMIS 和 Visual Studio 2010 在 Alfresco CMS 中创建具有多值属性的文档

Dictionary<string, object> DocumentProperties = new Dictionary<string, object>();
DocumentProperties[PropertyIds.Name] = "MyPDF.pdf";
DocumentProperties[PropertyIds.ObjectTypeId] = "D:mit:mypdf";
DocumentProperties["mit:author"] = "myPDFAuthor";
DocumentProperties["mit:serialnumber"] = "23A100001";

ContentStream contentStream = new ContentStream();
contentStream.FileName = "MyPDF.pdf";
contentStream.MimeType = "application/pdf";
contentStream.Stream = new MemoryStream(File.ReadAllBytes("C:/mypath/mypdf.pdf"));
IDocument doc = root.CreateDocument(DocumentProperties, contentStream, DotCMIS.Enums.VersioningState.Major);

就好的情况而言,这可以正常工作。

DocumentProperties["mit:gesamtwert"] = ???

问题就从这里开始了。 “mit:gesamtwert”是一个多值属性(数据类型:float),我不知道如何以正确的方式传递值。我尝试了 List、float[] 和其他几个...我错过了什么吗?我看到一些使用 ArrayList 的 java 解决方案,但我无法将其转换为工作集。

如果我尝试传递单个浮点值,当然会出现

System.ArgumentException: Property 'mit:gesamtwert' is not a single value property!

如果我传递数组或列表

System.ArgumentException: Property 'mit:gesamtwert' is a Decimal property!

所以它只是无法识别数组或列表的列表字符并将其解释为单个值,这显然不是 float 。

非常感谢任何帮助!在此先感谢您的帮助! 雷内克

最佳答案

对于多值十进制属性,您必须使用 List<decimal> 。 CMIS 中不存在 float 。请改用小数。

关于c# - 使用 Dot CMIS 在 Alfresco 中创建具有多值属性的文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37347870/

相关文章:

c# - 西门子 OPC UA 和 .NET C# 客户端无法连接到服务器?

c# - Parallel.ForEach 中的竞争条件?

javascript - Alfresco:根据文档的位置添加标签

c# - 错误 "Property ' 厘米 :title' doesn't exsist"while using DotCMIS for Alfresco

c# - 坚持使用 Delphi.NET 和 Delphi 2007

c# - 通过在取消 token 上注册回调来取消多个任务

java - Alfresco 中的方面名称在 'Manage Aspect' 中显示为未定义

java - 使用 Drupal + 内容构建工具包创建灵活的 Web 表单 - 适用于 Java

alfresco - 使用 DotCMIS 从 Alfresco 结帐文档