cancel
Showing results for 
Search instead for 
Did you mean: 

CMIS TypeChildren usage

gclaussn
Champ in-the-making
Champ in-the-making
Hi all,
I am trying to handle subtypes of document with OpenCMIS, because I'm planing to create an own data model for specific use cases.
When I'm asking for children of cmis:document, I get the result like you can see under the source code.


PagingList<ObjectType> types = session.getTypeChildren("cmis:document", true, 10);

for(List<ObjectType> list : types) {
   for(ObjectType type : list) {
      System.out.println(type.getQueryName());
   }
}

ia:calendarEvent
wcm:avmcontent
lnk:link
cmiscustom:document
imap:imapBody
wca:deploymentreport
wcm:avmlayeredcontent
bpm:task
cm:thumbnail
bpm:workflowDefinition
imap:imapAttach
cm:dictionaryModel
fmSmiley Tongueost
cm:savedquery

When creating a document with a specific subtype as objectTypeId, an error occurs:
>Web Script Status 400 - Bad Request
>Request sent by the client was syntactically incorrect.
>CMIS object type customcmis:document not understood

Can anyone help? Is it a problem with the CMIS implementation? Or my wrong understanding?

thanks in advance, gclaussn
6 REPLIES 6

janv
Employee
Employee
I haven't tried it but "customcmis:document" looks suspicious (rather than "cmiscustom:document) ? Do you have the code snippet for creating the document ?

Thanks,
Jan

gclaussn
Champ in-the-making
Champ in-the-making
Sorry it returns: "CMIS object type cmiscustom:document not understood", the other was my attemp before.

I'm creating a document like normal, just with "cmiscustom:document" as objectTypeId, with "cmis:document" it succeeds.

gclaussn
Champ in-the-making
Champ in-the-making
Solved my problem, I'm using "D:cmiscustom:document" as objectTypeId to create a document with this custom type.

alcibiade
Champ in-the-making
Champ in-the-making
Thanks for this great information !

Where did you find this "D:" / "F:" prefix information ?

gclaussn
Champ in-the-making
Champ in-the-making
I found it within the CMIS tutorial from Jeff Potts. (http://ecmarchitect.com/archives/2009/11/23/1094)

fmui
Champ in-the-making
Champ in-the-making
You have listed the query names but you need a type id to create a document. The type ids are prefixed.

Try
type.getId()
instead of
type.getQueryName()