My requirement is need to create document along with existing Category Metadata in single method call.
I am using OTCS 16.2.11 ( with Rest API as well as CWS SOAP Web services) for applying the existing Category while creating document from Java code.
Application log with Rest API,
17:36:28,958 INFO [STDOUT] ----------------------------------Payload passed for document creation----------------------------------{"advanced_versioning":false,"file":"D:\\CWSTest.txt","mime_type":"text/x-setext","parent_id":2000,"roles":{"categories":{"112705":{"112705_4":30,"112705_10":"D:\\CWSTest.txt"}}},"name":"CWSTest.txt","type":144}
17:36:28,959 INFO [STDOUT] Executing EndPoint: http://X.X.X.X/otcs/cs.exe/api/v1/nodes
I have used the above endpoint for document creation. Here, document is getting created but, existing category is not applied for the created document. Not getting any issue in my application log for this rest api endpoint. Not sure what is missing in Payload.
So, I started with CWS SOAP web service using Apache Tomcat.
Here, I have used createDocument method from DocumentManagement Service
document = docManClient.createDocument(2000, "CWSTest.txt", null, false, metadata, attachment);
It is not creating document and I was getting some error if I pass metadata.
Same method is working fine without metadata. we have another method called setMetadata, which is not helpful for me because, after creating document without Metadata, it will be moved immediately from that parent folder with some trigger. Setting metadata in second method call will not be useful in my case.
So, tried with docManClient.createDocumentContext method which is also not working with Category Metadata. It is also required setMetadata call to update Category metadata. So, this method is not helpful for my scenario.
In CWS Web service approach also it is not working with single method call for creating document with metadata.
It is not working with both approaches such as CWS SOAP Web service as well as Rest API.
Any approach is fine but it needs to set the Category Metadata in a single shot while creating document.
Any suggestion please?