Search code examples
cmisopencmisdotcmis

Check whether cmis:contentStreamFilename is Orderable


The CMIS 1.1 standard says at 2.1.4.3.3 that cmis:contentStreamFileName has a Orderable property which CMIS repositories can choose to set to true or false.

As a CMIS client having a session on a particular repository, how to tell whether this repository has an Orderable of true or false for cmis:contentStreamFileName.

Preferably using DotCMIS or PortCMIS or OpenCMIS.

The Chemistry samples website has samples showing how to get repository capabilities, but not of this kind.


Solution

  • You can get the definition of types and then for the type you are interested in, check the property you are interested in, like this Java example using OpenCMIS:

    ObjectType typeDef = getSession().getTypeDefinition("cmis:document");
    Map<String, PropertyDefinition<?>> propDefs = typeDef.getPropertyDefinitions();
    PropertyDefinition<?> propDef = propDefs.get("cmis:contentStreamFileName");
    System.out.println(String.format("Is %s orderable? %s", propDef.getId(), propDef.isOrderable()));
    

    Running this against Alfresco 5.2 CE and against Chemistry 0.11 returns false in both cases:

    Is cmis:contentStreamFileName orderable? false