chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexandru Deliu <>
Subject RE: Get the list of metadata properties for a CMIS repository
Date Mon, 11 Jun 2012 20:00:40 GMT

The code bellow I use to get the properties for cmis:document type. If in Sharepoint 2010
I create a new content type (document type) it is not detected as new type by the code bellow.
Using OpenCMIS can we see more than one cmis:document type ? Also is there a way to determine
if the repository allows using the content type ? 

	ItemIterable<ObjectType> types = session.getTypeChildren(null, true);

    for (ObjectType type : types)
        String docType = type.getId().toString();        
        System.out.println("type display name: " + type.getDisplayName());

        if ("cmis:document".equalsIgnoreCase(docType)){
	        Map<String, PropertyDefinition<?>> props = type.getPropertyDefinitions();
	        for (PropertyDefinition<?> prop : props.values())
	            System.out.println("  id  : " + prop.getId());
	            System.out.println("  display name: " + prop.getDisplayName());


Thank you clarifying me on that.


-----Message d'origine-----
De : Florian Müller [] 
Envoyé : 7 juin 2012 16:33
À :; Alexandru Deliu
Objet : Re: Get the list of metadata properties for a CMIS repository

Hi Alex,

The following line of code returns all property definitions of a type:

Map<String, PropertyDefinition<?>> propDefs = session.getTypeDefinition("your:type").getPropertyDefinitions()
(Replace "your:type" with the object type id you want to use.)

You can discover which object types are available by calling session.getTypeChildren(...)
and getTypeDescendants(...).


> Hello,
> We are currently developing connectors to enable publishing documents to CMIS compliant
systems along with document properties. I would like to know how to retrieve the list of this
properties before uploading a document, not after the document is uploaded.
> Another question is how can we handle with OpenCMIS the properties that are set by an
Content Type like in SharePoint.
> Thanks for any info on that.
> Alex.

View raw message