CMIS custom metadata
Hi all, i wanted to know how could someone instantiate a custom datamodel through cmis. i created a type named Book, with
book.xsd
and all that stuff. but i can't figure what is the
Object_type_id
i have to put in order that nuxeo recognizes that type. Could you help, please ?
my code :
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(PropertyIds.OBJECT_TYPE_ID, "Book");
properties.put(PropertyIds.NAME, filename);
Document doc =theFolder.createDocument(properties, null, null);
Hi,
I don't have the exact answer but here are some directions:
first : having a schema (book.xsd) is not enough to make a document type. Unless your description was incomplete, you should probably start here: http://doc.nuxeo.com/x/D4AO
Second : some example are available here to create and update a document through CMIS: http://chemistry.apache.org/java/examples/example-create-update.html
Thank you, Actually i created a Document type, called issue through nuxeo Studio.
It is working on my Nuxeo 5.6.
What i want to do is to create instances of that type through cmis. when i do that throug Java,
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(PropertyIds.OBJECT_TYPE_ID, "issue");
properties.put(PropertyIds.NAME, filename);
Document doc =theFolder.createDocument(properties, null, null);
i got this exception :
Exception in thread "main" org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: No such type: issue
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:423)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.read(AbstractAtomPubService.java:554)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getTypeDefinitionInternal(AbstractAtomPubService.java:821)
at org.apache.chemistry.opencmis.client.bindings.spi.atompub.RepositoryServiceImpl.getTypeDefinition(RepositoryServiceImpl.java:88)
at org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getTypeDefinition(RepositoryServiceImpl.java:137)
at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getTypeDefinition(SessionImpl.java:518)
at org.apache.chemistry.opencmis.client.runtime.repository.ObjectFactoryImpl.convertProperties(ObjectFactoryImpl.java:294)
at org.apache.chemistry.opencmis.client.runtime.SessionImpl.createDocument(SessionImpl.java:726)
at org.apache.chemistry.opencmis.client.runtime.FolderImpl.createDocument(FolderImpl.java:88)
at org.apache.chemistry.opencmis.client.runtime.FolderImpl.createDocument(FolderImpl.java:443)
at com.alfresco.cmis.CmisService.createModelNuxeo(CmisService.java:114)
at com.alfresco.cmis.CmisService.main(CmisService.java:52)