Search in sources :

Example 1 with ItemTypeDefinitionWrapper

use of org.alfresco.opencmis.dictionary.ItemTypeDefinitionWrapper in project alfresco-repository by Alfresco.

the class CMISConnector method createObjectId.

public String createObjectId(NodeRef nodeRef, boolean dropStoreRef) {
    QName typeQName = nodeService.getType(nodeRef);
    TypeDefinitionWrapper type = getOpenCMISDictionaryService().findNodeType(typeQName);
    if (type instanceof ItemTypeDefinitionWrapper) {
        return constructObjectId(nodeRef, null);
    }
    if (type instanceof FolderTypeDefintionWrapper) {
        return constructObjectId(nodeRef, null, dropStoreRef);
    }
    Serializable versionLabel = getNodeService().getProperty(nodeRef, ContentModel.PROP_VERSION_LABEL);
    if (versionLabel == null) {
        versionLabel = CMISConnector.UNVERSIONED_VERSION_LABEL;
    }
    return constructObjectId(nodeRef, (String) versionLabel, dropStoreRef);
}
Also used : Serializable(java.io.Serializable) QName(org.alfresco.service.namespace.QName) ItemTypeDefinitionWrapper(org.alfresco.opencmis.dictionary.ItemTypeDefinitionWrapper) TypeDefinitionWrapper(org.alfresco.opencmis.dictionary.TypeDefinitionWrapper) DocumentTypeDefinitionWrapper(org.alfresco.opencmis.dictionary.DocumentTypeDefinitionWrapper) FolderTypeDefintionWrapper(org.alfresco.opencmis.dictionary.FolderTypeDefintionWrapper) ItemTypeDefinitionWrapper(org.alfresco.opencmis.dictionary.ItemTypeDefinitionWrapper)

Aggregations

Serializable (java.io.Serializable)1 DocumentTypeDefinitionWrapper (org.alfresco.opencmis.dictionary.DocumentTypeDefinitionWrapper)1 FolderTypeDefintionWrapper (org.alfresco.opencmis.dictionary.FolderTypeDefintionWrapper)1 ItemTypeDefinitionWrapper (org.alfresco.opencmis.dictionary.ItemTypeDefinitionWrapper)1 TypeDefinitionWrapper (org.alfresco.opencmis.dictionary.TypeDefinitionWrapper)1 QName (org.alfresco.service.namespace.QName)1