Package org.alfresco.opencmis.mapping
Class CMISMapping
- java.lang.Object
-
- org.alfresco.opencmis.mapping.CMISMapping
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
public class CMISMapping extends Object implements org.springframework.beans.factory.InitializingBean
CMIS <-> Alfresco mappings. It additionally excludes a list of QNames based on a user defined list- Author:
- andyh
-
-
Field Summary
Fields Modifier and Type Field Description static QName
ASPECTS_QNAME
static String
CMIS_ALL
static QName
CMIS_DATATYPE_HTML
static QName
CMIS_DATATYPE_ID
static QName
CMIS_DATATYPE_URI
static QName
CMIS_DATATYPE_XML
static String
CMIS_EXT_NS
static String
CMIS_EXT_URI
static String
CMIS_MODEL_NAME
The Alfresco CMIS Model name.static String
CMIS_MODEL_NS
The Alfresco CMIS Namespacestatic QName
CMIS_MODEL_QNAME
The QName for the Alfresco CMIS Model.static String
CMIS_MODEL_URI
static String
CMIS_READ
Basic permissions.static String
CMIS_WRITE
protected DictionaryService
dictionaryService
static QName
DOCUMENT_QNAME
static QName
FOLDER_QNAME
static QName
ITEM_QNAME
protected NamespaceService
namespaceService
static QName
OBJECT_QNAME
static String
OBJECT_TYPE_ID
static QName
POLICY_QNAME
static QName
RELATIONSHIP_QNAME
static QName
SECONDARY_TYPES_QNAME
-
Constructor Summary
Constructors Constructor Description CMISMapping()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
String
buildPrefixEncodedString(QName qname)
QName
getAlfrescoClass(QName cmisTypeQName)
Given a CMIS model type map it to the appropriate Alfresco type.QName
getAlfrescoDataType(org.apache.chemistry.opencmis.commons.enums.PropertyType propertyType)
QName
getAlfrescoName(String typeId)
String
getCmisPropertyId(QName propertyQName)
QName
getCmisType(QName typeQName)
Given an Alfresco model type map it to the appropriate type.String
getCmisTypeId(QName classQName)
String
getCmisTypeId(org.apache.chemistry.opencmis.commons.enums.BaseTypeId scope, QName typeQName)
Gets the CMIS Type Id given the Alfresco QName for the type in any Alfresco modelorg.apache.chemistry.opencmis.commons.enums.CmisVersion
getCmisVersion()
org.apache.chemistry.opencmis.commons.enums.PropertyType
getDataType(DataTypeDefinition datatype)
Get the CMIS property type for a propertyorg.apache.chemistry.opencmis.commons.enums.PropertyType
getDataType(QName dataType)
DictionaryService
getDictionaryService()
NamespaceService
getNamespaceService()
Collection<Pair<String,Boolean>>
getReportedPermissions(String permission, Set<String> permissions, boolean hasFull, boolean isDirect, CMISAccessControlFormatEnum format)
String
getSetPermission(String permission)
boolean
isExcluded(QName typeQName)
boolean
isRemappedType(QName typeQName)
Is Alfresco Type mapped to an alternative CMIS Type?boolean
isValidCmisDocument(QName typeQName)
Is this a valid CMIS document type?boolean
isValidCmisFolder(QName typeQName)
Is this a valid CMIS folder type?boolean
isValidCmisItem(QName typeQName)
Is this a valid CMIS item type?boolean
isValidCmisObject(org.apache.chemistry.opencmis.commons.enums.BaseTypeId scope, QName qname)
boolean
isValidCmisPolicy(QName typeQName)
Is this a valid CMIS policy type?boolean
isValidCmisRelationship(QName associationQName)
Is an association valid in CMIS? It must be a non-child relationship and the source and target must both be valid CMIS types.boolean
isValidCmisRelationshipEndPoint(QName typeQName)
boolean
isValidCmisSecondaryType(QName typeQName)
Is this a valid CMIS secondary type?void
setCmisVersion(org.apache.chemistry.opencmis.commons.enums.CmisVersion cmisVersion)
void
setDictionaryService(DictionaryService dictionaryService)
void
setFilter(QNameFilter filter)
void
setNamespaceService(NamespaceService namespaceService)
-
-
-
Field Detail
-
CMIS_MODEL_NS
public static String CMIS_MODEL_NS
The Alfresco CMIS Namespace
-
CMIS_MODEL_URI
public static String CMIS_MODEL_URI
-
CMIS_EXT_NS
public static String CMIS_EXT_NS
-
CMIS_EXT_URI
public static String CMIS_EXT_URI
-
CMIS_MODEL_NAME
public static String CMIS_MODEL_NAME
The Alfresco CMIS Model name.
-
CMIS_MODEL_QNAME
public static QName CMIS_MODEL_QNAME
The QName for the Alfresco CMIS Model.
-
CMIS_DATATYPE_ID
public static QName CMIS_DATATYPE_ID
-
CMIS_DATATYPE_URI
public static QName CMIS_DATATYPE_URI
-
CMIS_DATATYPE_XML
public static QName CMIS_DATATYPE_XML
-
CMIS_DATATYPE_HTML
public static QName CMIS_DATATYPE_HTML
-
OBJECT_QNAME
public static QName OBJECT_QNAME
-
DOCUMENT_QNAME
public static QName DOCUMENT_QNAME
-
FOLDER_QNAME
public static QName FOLDER_QNAME
-
RELATIONSHIP_QNAME
public static QName RELATIONSHIP_QNAME
-
POLICY_QNAME
public static QName POLICY_QNAME
-
SECONDARY_TYPES_QNAME
public static QName SECONDARY_TYPES_QNAME
-
ASPECTS_QNAME
public static QName ASPECTS_QNAME
-
ITEM_QNAME
public static QName ITEM_QNAME
-
OBJECT_TYPE_ID
public static String OBJECT_TYPE_ID
-
CMIS_READ
public static final String CMIS_READ
Basic permissions.- See Also:
- Constant Field Values
-
CMIS_WRITE
public static final String CMIS_WRITE
- See Also:
- Constant Field Values
-
CMIS_ALL
public static final String CMIS_ALL
- See Also:
- Constant Field Values
-
dictionaryService
protected DictionaryService dictionaryService
-
namespaceService
protected NamespaceService namespaceService
-
-
Method Detail
-
setCmisVersion
public void setCmisVersion(org.apache.chemistry.opencmis.commons.enums.CmisVersion cmisVersion)
-
getCmisVersion
public org.apache.chemistry.opencmis.commons.enums.CmisVersion getCmisVersion()
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
setFilter
public void setFilter(QNameFilter filter)
-
setDictionaryService
public void setDictionaryService(DictionaryService dictionaryService)
- Parameters:
dictionaryService
- dictionaryService
-
setNamespaceService
public void setNamespaceService(NamespaceService namespaceService)
- Parameters:
namespaceService
- service
-
getNamespaceService
public NamespaceService getNamespaceService()
- Returns:
- namespaceService
-
getDictionaryService
public DictionaryService getDictionaryService()
- Returns:
- dictionaryService
-
isExcluded
public boolean isExcluded(QName typeQName)
-
getCmisTypeId
public String getCmisTypeId(org.apache.chemistry.opencmis.commons.enums.BaseTypeId scope, QName typeQName)
Gets the CMIS Type Id given the Alfresco QName for the type in any Alfresco model- Parameters:
scope
- BaseTypeIdtypeQName
- QName- Returns:
- String
-
isValidCmisObject
public boolean isValidCmisObject(org.apache.chemistry.opencmis.commons.enums.BaseTypeId scope, QName qname)
-
isValidCmisFolder
public boolean isValidCmisFolder(QName typeQName)
Is this a valid CMIS folder type?- Parameters:
typeQName
- QName- Returns:
- boolean
-
isValidCmisDocument
public boolean isValidCmisDocument(QName typeQName)
Is this a valid CMIS document type?- Parameters:
typeQName
- QName- Returns:
- boolean
-
isValidCmisSecondaryType
public boolean isValidCmisSecondaryType(QName typeQName)
Is this a valid CMIS secondary type?- Parameters:
typeQName
- QName- Returns:
- boolean
-
isValidCmisPolicy
public boolean isValidCmisPolicy(QName typeQName)
Is this a valid CMIS policy type?- Parameters:
typeQName
- QName- Returns:
- boolean
-
isValidCmisRelationship
public boolean isValidCmisRelationship(QName associationQName)
Is an association valid in CMIS? It must be a non-child relationship and the source and target must both be valid CMIS types.- Parameters:
associationQName
- QName- Returns:
- boolean
-
isValidCmisRelationshipEndPoint
public boolean isValidCmisRelationshipEndPoint(QName typeQName)
-
isValidCmisItem
public boolean isValidCmisItem(QName typeQName)
Is this a valid CMIS item type?- Parameters:
typeQName
- QName- Returns:
- boolean
-
getCmisType
public QName getCmisType(QName typeQName)
Given an Alfresco model type map it to the appropriate type. Maps cm:folder and cm:content to the CMIS definitions
-
isRemappedType
public boolean isRemappedType(QName typeQName)
Is Alfresco Type mapped to an alternative CMIS Type?
-
getAlfrescoClass
public QName getAlfrescoClass(QName cmisTypeQName)
Given a CMIS model type map it to the appropriate Alfresco type.- Parameters:
cmisTypeQName
- QName- Returns:
- QName
-
getDataType
public org.apache.chemistry.opencmis.commons.enums.PropertyType getDataType(DataTypeDefinition datatype)
Get the CMIS property type for a property- Parameters:
datatype
- DataTypeDefinition- Returns:
- PropertyType
-
getDataType
public org.apache.chemistry.opencmis.commons.enums.PropertyType getDataType(QName dataType)
-
getAlfrescoDataType
public QName getAlfrescoDataType(org.apache.chemistry.opencmis.commons.enums.PropertyType propertyType)
-
getCmisPropertyId
public String getCmisPropertyId(QName propertyQName)
- Parameters:
propertyQName
- QName- Returns:
- String
-
getReportedPermissions
public Collection<Pair<String,Boolean>> getReportedPermissions(String permission, Set<String> permissions, boolean hasFull, boolean isDirect, CMISAccessControlFormatEnum format)
-
-