gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 20:36:02 25 4
gpt4 key购买 nike

如上建议,我尝试使用 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[] 和其他几个……我错过了什么吗?我看到一些 java 解决方案与 ArrayList 一起工作,但我无法将其转换为工作集。

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

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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com