0

我有一个自定义方面,我正在尝试通过带有 CmisExtensionElement 的 OpenCMIS 更新它的属性。

目前,我可以使用以下代码更新具有 String 类型的自定义属性:

CmisExtensionElement extension = new CmisExtensionElementImpl(namespace, "value", null, String-value);

问题是,我将如何更新具有日期时间类型的属性的自定义方面,因为除了字符串之外我无法传递?(如果我将日期对象转换为字符串并将其传递,则会引发错误......)

4

2 回答 2

1

由此判断:https ://chemistry.apache.org/docs/cmis-samples/samples/properties/

您可能应该使用类似的东西:

Map<String, Object> properties = new HashMap<String, Object>();

properties.put("my:dateVar1", new GregorianCalendar());
// OR
properties.put("my:dateVar2", new Date());
// update
cmisObject.updateProperties(properties);
于 2017-03-20T12:46:25.190 回答
0

这是 Jeff Potts 提供的代码示例,展示了如何执行此操作:https ://gist.github.com/jpotts/6136702

于 2017-03-20T12:39:36.940 回答