cancel
Showing results for 
Search instead for 
Did you mean: 

Clearing/Unsetting the value of a date property via REST API

hfmeza
Champ in-the-making
Champ in-the-making
Hi.

I'm developing a Java application that connects to Alfresco Community 4.2.

One of the functionalities involves setting and modifying a document's properties through /alfresco/service/api/metadata/

I create a JSONObject and set the value of each property, which works perfectly for all cases, except when trying to clear or unset the value of a Date property.

I tried sending "" (empty string) or null as the property's value, but when I check the metadata, the property has the same data as before.


Basically what I'm trying to do is replicate via REST API the behavior of the "None" button in the faces interface: <a href="http://picpaste.com/pics/alfresco-v00w774f.1454698295.png">ScreenShot</a>

Is there a way to do that via WebScripts?

Thank you.
3 REPLIES 3

mitpatoliya
Star Collaborator
Star Collaborator
This service(/alfresco/service/api/metadata/) is node metadata retrieval service as far as I know and as per description of that webscript.

So, it will just return metadata of existing node. It can not be used to reset metadata.

hfmeza
Champ in-the-making
Champ in-the-making
Thanks for answering. That service also permits using POST to change the metadata values, only not to what I would call "empty Date".

"Node Metadata Storage Service

POST /alfresco/service/api/metadata/node/{store_type}/{store_id}/{id}

"

mitpatoliya
Star Collaborator
Star Collaborator
I think there will be issue with Date Format. Normally Alfresco stores date in UTC format. Try few options.