O'Reilly logo

Alfresco CMIS by Martin Bergljung

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Listing available types and subtypes

Getting to know the content model that the CMS server supports is important so that we can classify objects according to the specific domain we are in. The OpenCMIS API provides methods to list types and their subtypes.

Add the following code to the CmisClient class:

public void listTypesAndSubtypes(Session session) {
  boolean includePropertyDefinitions = false;
  List<Tree<ObjectType>> typeTrees = 
    session.getTypeDescendants(
    null, -1, includePropertyDefinitions);
  for (Tree<ObjectType> typeTree : typeTrees) {
    logTypes(typeTree, "");
  }
}

The preceding listTypesAndSubtypes method uses the getTypeDescendants method on the session object to get the type hierarchy that has been deployed to the server. The getTypeDescendants ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required