2

就像上面建议的那样,我尝试使用 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!

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

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

4

1 回答 1

4

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

于 2016-05-21T10:19:33.800 回答