• openkm CE rest api not changing metadata values on a node

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #50844  by jvezinat
 
Using restful API, testing via below and command line:

http://<internal>/OpenKM/services/rest/api-docs?url=/OpenKM/services/rest/swagger.json#/gropertyGroup-service/setPropertiesSimple

You can use the swagger page to test out different curls etc. Everything on the page works except for changing/editing the metadata value for a node.

IE// I can the metadata group to the node (file). Would I not just use setPropertiesSimple on that node and use the okp.<groupname>.<field> and input the new value?

I can query the node and get all the metadata properties and their values, just can't seem to change? Any tips?
Code: Select all
curl -u <user>:<pass> -X POST "http://<internal>/OpenKM/services/rest/propertyGroup/setPropertiesSimple?nodeId=9934c690-ce23-4fd6-b397-4afcb917ed10&grpName=okg%3AIandT" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"list\": [ { \"name\": \"okp.IandT.issue\", \"value\": \"testing\" } ]}"
Like i said, i can accomplish everything else but this one thing, editing a files metadata values. Thanks in advance.
Attachments
web page
web page
Capture.PNG (36 KiB) Viewed 661 times
 #53039  by vngrshakan
 
I got where was my fault. If someone else facing this issue wanna explain here;

In the code base there is a comment in setProperties-setPropertiesSimple API and it says:
The "properties" parameter comes in the POST request body (encoded as XML or JSON).

Its working with xml same as Jilort's answer above;
Code: Select all
curl -u okmAdmin:admin -H "Accept: application/json" \
  -X PUT -H "Content-Type: application/xml" \
  -d '<simplePropertiesGroup><simplePropertyGroup><name>okp:technology.comment</name><value>RESTful rulez!</value></simplePropertyGroup></simplePropertiesGroup>' \
  http://localhost:8080/OpenKM/services/rest/propertyGroup/setPropertiesSimple?nodeId=3492d662-b58e-417c-85b6-930ad0c6c3cf\&grpName=okg:technology
But NOT working when i try with json.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.