Is there way to pass in object into CmisExtensionElement?

61 Views Asked by At

I have a custom aspect, and I'm trying to update it's property through OpenCMIS with CmisExtensionElement.

Currently, I'm able to update custom properties having type String with following codes:

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

Question is, how will I able to update custom aspect having property with type datetime, as I'm not able to pass in other than string? (If I convert date object into a string, and pass it on, it throws an error...)

2

There are 2 best solutions below

2
Ben Chevallereau On

Here is an example of code provided by Jeff Potts that shows how to do it: https://gist.github.com/jpotts/6136702

3
Younes Regaieg On

Judging by this : https://chemistry.apache.org/docs/cmis-samples/samples/properties/

You should probably use something like :

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);