Class NuxeoTypeHelper


  • public class NuxeoTypeHelper
    extends Object
    Nuxeo Type Utilities.

    Maps Nuxeo types to CMIS types using the following rules:

    • Only types containing dublincore are exposed,
    • cmis:document and cmis:folder expose dublincore, and are not creatable,
    • The Document type is not exposed,
    • Types inheriting from Document are exposed as inheriting cmis:document,
    • The Folder type is mapped to a concrete subtype of cmis:folder,
    • Other folderish types directly under Folder are mapped to subtypes of cmis:folder as well.
    • Constructor Detail

      • NuxeoTypeHelper

        protected NuxeoTypeHelper​(String id,
                                  String parentId,
                                  org.apache.chemistry.opencmis.commons.enums.BaseTypeId baseTypeId,
                                  DocumentType documentType,
                                  String nuxeoTypeId,
                                  boolean creatable,
                                  org.apache.chemistry.opencmis.commons.enums.CmisVersion cmisVersion)
        Helper to construct one CMIS type from a DocumentType.
      • NuxeoTypeHelper

        protected NuxeoTypeHelper​(String id,
                                  String nuxeoTypeId,
                                  org.apache.chemistry.opencmis.commons.enums.CmisVersion cmisVersion)
        Helper to construct one CMIS type from a secondary type.
    • Method Detail

      • isComplexPropertiesEnabled

        protected static boolean isComplexPropertiesEnabled()
      • getParentTypeId

        public static String getParentTypeId​(DocumentType documentType)
        Gets the remapped parent type id, or null if the type is to be ignored.
      • constructDocumentType

        public static org.apache.chemistry.opencmis.commons.definitions.TypeDefinition constructDocumentType​(DocumentType documentType,
                                                                                                             String parentId,
                                                                                                             org.apache.chemistry.opencmis.commons.enums.CmisVersion cmisVersion)
      • constructSecondaryType

        public static org.apache.chemistry.opencmis.commons.definitions.TypeDefinition constructSecondaryType​(CompositeType type,
                                                                                                              org.apache.chemistry.opencmis.commons.enums.CmisVersion cmisVersion)
      • constructCmisBase

        public static org.apache.chemistry.opencmis.commons.definitions.TypeDefinition constructCmisBase​(org.apache.chemistry.opencmis.commons.enums.BaseTypeId baseTypeId,
                                                                                                         SchemaManager schemaManager,
                                                                                                         org.apache.chemistry.opencmis.commons.enums.CmisVersion cmisVersion)
        Constructs a base type, not mapped to a Nuxeo type. If not a secondary, it has the dublincore schema.
      • addSchemaPropertyDefinitions

        protected void addSchemaPropertyDefinitions​(Schema schema)
      • constructBaseDocumentType

        protected void constructBaseDocumentType​(String id,
                                                 String parentId,
                                                 org.apache.chemistry.opencmis.commons.enums.BaseTypeId baseTypeId,
                                                 DocumentType documentType,
                                                 String nuxeoTypeId,
                                                 boolean creatable)
        Constructs the base for a DocumentType.
      • constructBaseSecondaryType

        protected void constructBaseSecondaryType​(String id,
                                                  String nuxeoTypeId)
        Constructs the base for a secondary type.
      • addBasePropertyDefinitions

        protected void addBasePropertyDefinitions()
      • addFolderPropertyDefinitions

        protected static void addFolderPropertyDefinitions​(org.apache.chemistry.opencmis.commons.impl.dataobjects.FolderTypeDefinitionImpl t)
      • addRelationshipPropertyDefinitions

        protected static void addRelationshipPropertyDefinitions​(org.apache.chemistry.opencmis.commons.impl.dataobjects.RelationshipTypeDefinitionImpl t)
      • addDocumentPropertyDefinitions

        protected void addDocumentPropertyDefinitions​(org.apache.chemistry.opencmis.commons.impl.dataobjects.DocumentTypeDefinitionImpl t)
      • newPropertyDefinition

        protected static org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<?> newPropertyDefinition​(String id,
                                                                                                                       String displayName,
                                                                                                                       org.apache.chemistry.opencmis.commons.enums.PropertyType propertyType,
                                                                                                                       org.apache.chemistry.opencmis.commons.enums.Cardinality cardinality,
                                                                                                                       org.apache.chemistry.opencmis.commons.enums.Updatability updatability,
                                                                                                                       boolean inherited,
                                                                                                                       boolean required,
                                                                                                                       boolean queryable,
                                                                                                                       boolean orderable)
      • supportsBlobHolder

        protected static boolean supportsBlobHolder​(DocumentType documentType)
      • mappedId

        protected static String mappedId​(String id)
        Turns a Nuxeo type into a CMIS type.
      • getPropertType

        protected static org.apache.chemistry.opencmis.commons.enums.PropertyType getPropertType​(SimpleType type)
      • getBaseTypeId

        public static org.apache.chemistry.opencmis.commons.enums.BaseTypeId getBaseTypeId​(DocumentType type)
      • getBaseTypeId

        public static org.apache.chemistry.opencmis.commons.enums.BaseTypeId getBaseTypeId​(DocumentModel doc)