How can I get only the uuid?

cancel
Showing results for 
Search instead for 
Did you mean: 
hmancilla
Member II

How can I get only the uuid?

Hi everyone, this is my first question and I hope that can be resolved.

I have a Maven proyect using cmis, and i need to get a clean uuid, because i need to put it in a DTO Object

and only I get:

 "uuid": "[workspace://SpacesStore/6a8dbd45-26a5-4f66-944f-deb0696cde63;1.0]",

my code to check the uuid is 

docFilter.setUuid(newDoc.getProperty(PropertyIds.OBJECT_ID).getValuesAsString());

Thanks in advice

1 Reply
afaust
Master

Re: How can I get only the uuid?

Which CMIS API / version are you using? With CMIS 1.1 Browser binding you should only get the UUID with the version suffix, not the whole NodeRef + version.

Anyway, it should be quite simple to just split the object ID on the client side to only extract the UUID, i.e. take antyhing between last '/' and first ';', between start and first ',' (if no '/' found), or entire object ID (if no '/' and no ';' found, i.e. in CMIS 1.1 object ID for a folder).