Class NuxeoTypeHelper
- java.lang.Object
-
- org.nuxeo.ecm.core.opencmis.impl.server.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.
-
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description 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 aDocumentType
.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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addBasePropertyDefinitions()
protected void
addDocumentPropertyDefinitions(org.apache.chemistry.opencmis.commons.impl.dataobjects.DocumentTypeDefinitionImpl t)
protected static void
addFolderPropertyDefinitions(org.apache.chemistry.opencmis.commons.impl.dataobjects.FolderTypeDefinitionImpl t)
protected static void
addRelationshipPropertyDefinitions(org.apache.chemistry.opencmis.commons.impl.dataobjects.RelationshipTypeDefinitionImpl t)
protected void
addSchemaPropertyDefinitions(Schema schema)
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 aDocumentType
.protected void
constructBaseSecondaryType(String id, String nuxeoTypeId)
Constructs the base for a secondary type.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.static org.apache.chemistry.opencmis.commons.definitions.TypeDefinition
constructDocumentType(DocumentType documentType, String parentId, org.apache.chemistry.opencmis.commons.enums.CmisVersion cmisVersion)
static org.apache.chemistry.opencmis.commons.definitions.TypeDefinition
constructSecondaryType(CompositeType type, org.apache.chemistry.opencmis.commons.enums.CmisVersion cmisVersion)
static org.apache.chemistry.opencmis.commons.enums.BaseTypeId
getBaseTypeId(DocumentModel doc)
static org.apache.chemistry.opencmis.commons.enums.BaseTypeId
getBaseTypeId(DocumentType type)
static String
getParentTypeId(DocumentType documentType)
Gets the remapped parent type id, ornull
if the type is to be ignored.protected static org.apache.chemistry.opencmis.commons.enums.PropertyType
getPropertType(SimpleType type)
protected static boolean
isComplexPropertiesEnabled()
protected static String
mappedId(String id)
Turns a Nuxeo type into a CMIS type.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)
protected static boolean
supportsBlobHolder(DocumentType documentType)
-
-
-
Field Detail
-
NUXEO_DOCUMENT
public static final String NUXEO_DOCUMENT
- See Also:
- Constant Field Values
-
NUXEO_FOLDER
public static final String NUXEO_FOLDER
- See Also:
- Constant Field Values
-
NUXEO_RELATION
public static final String NUXEO_RELATION
- See Also:
- Constant Field Values
-
NUXEO_RELATION_DEFAULT
public static final String NUXEO_RELATION_DEFAULT
- See Also:
- Constant Field Values
-
NUXEO_FILE
public static final String NUXEO_FILE
- See Also:
- Constant Field Values
-
NUXEO_ORDERED_FOLDER
public static final String NUXEO_ORDERED_FOLDER
- See Also:
- Constant Field Values
-
FACET_TYPE_PREFIX
public static final String FACET_TYPE_PREFIX
- See Also:
- Constant Field Values
-
NX_DUBLINCORE
public static final String NX_DUBLINCORE
- See Also:
- Constant Field Values
-
NX_DC_TITLE
public static final String NX_DC_TITLE
- See Also:
- Constant Field Values
-
NX_DC_DESCRIPTION
public static final String NX_DC_DESCRIPTION
- See Also:
- Constant Field Values
-
NX_DC_CREATED
public static final String NX_DC_CREATED
- See Also:
- Constant Field Values
-
NX_DC_CREATOR
public static final String NX_DC_CREATOR
- See Also:
- Constant Field Values
-
NX_DC_MODIFIED
public static final String NX_DC_MODIFIED
- See Also:
- Constant Field Values
-
NX_DC_LAST_CONTRIBUTOR
public static final String NX_DC_LAST_CONTRIBUTOR
- See Also:
- Constant Field Values
-
NX_ICON
public static final String NX_ICON
- See Also:
- Constant Field Values
-
NX_REL_SOURCE
public static final String NX_REL_SOURCE
- See Also:
- Constant Field Values
-
NX_REL_TARGET
public static final String NX_REL_TARGET
- See Also:
- Constant Field Values
-
NX_DIGEST
public static final String NX_DIGEST
- See Also:
- Constant Field Values
-
NX_ISVERSION
public static final String NX_ISVERSION
- See Also:
- Constant Field Values
-
NX_ISCHECKEDIN
public static final String NX_ISCHECKEDIN
- See Also:
- Constant Field Values
-
NX_ISTRASHED
public static final String NX_ISTRASHED
- Since:
- 10.2
- See Also:
- Constant Field Values
-
NX_FACETS
public static final String NX_FACETS
- See Also:
- Constant Field Values
-
NX_LIFECYCLE_STATE
public static final String NX_LIFECYCLE_STATE
- See Also:
- Constant Field Values
-
NX_PARENT_ID
public static final String NX_PARENT_ID
- See Also:
- Constant Field Values
-
NX_PATH_SEGMENT
public static final String NX_PATH_SEGMENT
- See Also:
- Constant Field Values
-
ENABLE_COMPLEX_PROPERTIES
public static final String ENABLE_COMPLEX_PROPERTIES
- See Also:
- Constant Field Values
-
NX_POS
public static final String NX_POS
- Since:
- 6.0
- See Also:
- Constant Field Values
-
t
protected org.apache.chemistry.opencmis.commons.impl.dataobjects.AbstractTypeDefinition t
-
cmisVersion
protected org.apache.chemistry.opencmis.commons.enums.CmisVersion cmisVersion
-
-
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 aDocumentType
.
-
-
Method Detail
-
isComplexPropertiesEnabled
protected static boolean isComplexPropertiesEnabled()
-
getParentTypeId
public static String getParentTypeId(DocumentType documentType)
Gets the remapped parent type id, ornull
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 aDocumentType
.
-
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)
-
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)
-
-