org.alfresco.opencmis.mapping
Class CMISMapping

java.lang.Object
  extended by org.alfresco.opencmis.mapping.CMISMapping
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean

public class CMISMapping
extends java.lang.Object
implements org.springframework.beans.factory.InitializingBean

CMIS <-> Alfresco mappings


Field Summary
static QName ASPECTS_QNAME
           
static java.lang.String CMIS_ALL
           
static QName CMIS_DATATYPE_HTML
           
static QName CMIS_DATATYPE_ID
           
static QName CMIS_DATATYPE_URI
           
static QName CMIS_DATATYPE_XML
           
static java.lang.String CMIS_EXT_NS
           
static java.lang.String CMIS_EXT_URI
           
static java.lang.String CMIS_MODEL_NAME
          The Alfresco CMIS Model name.
static java.lang.String CMIS_MODEL_NS
          The Alfresco CMIS Namespace
static QName CMIS_MODEL_QNAME
          The QName for the Alfresco CMIS Model.
static java.lang.String CMIS_MODEL_URI
           
static java.lang.String CMIS_READ
          Basic permissions.
static java.lang.String CMIS_WRITE
           
static QName DOCUMENT_QNAME
           
static QName FOLDER_QNAME
           
static QName OBJECT_QNAME
           
static java.lang.String OBJECT_TYPE_ID
           
static QName POLICY_QNAME
           
static QName RELATIONSHIP_QNAME
           
 
Constructor Summary
CMISMapping()
           
 
Method Summary
 void afterPropertiesSet()
           
 java.lang.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(java.lang.String typeId)
           
 java.lang.String getCmisPropertyId(QName propertyQName)
           
 QName getCmisType(QName typeQName)
          Given an Alfresco model type map it to the appropriate type.
 java.lang.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
 java.lang.String getCmisTypeId(QName classQName)
           
 org.apache.chemistry.opencmis.commons.enums.PropertyType getDataType(DataTypeDefinition datatype)
          Get the CMIS property type for a property
 org.apache.chemistry.opencmis.commons.enums.PropertyType getDataType(QName dataType)
           
 DictionaryService getDictionaryService()
           
 NamespaceService getNamespaceService()
           
 java.util.Collection getReportedPermissions(java.lang.String permission, java.util.Set permissions, boolean hasFull, boolean isDirect, CMISAccessControlFormatEnum format)
           
 java.lang.String getSetPermission(java.lang.String permission)
           
 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 isValidCmisDocumentOrFolder(QName typeQName)
          Is this a valid cmis document or folder type (not a relationship)
 boolean isValidCmisFolder(QName typeQName)
          Is this a valid CMIS folder 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.
 void setDictionaryService(DictionaryService dictionaryService)
           
 void setNamespaceService(NamespaceService namespaceService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CMIS_MODEL_NS

public static java.lang.String CMIS_MODEL_NS
The Alfresco CMIS Namespace


CMIS_MODEL_URI

public static java.lang.String CMIS_MODEL_URI

CMIS_EXT_NS

public static java.lang.String CMIS_EXT_NS

CMIS_EXT_URI

public static java.lang.String CMIS_EXT_URI

CMIS_MODEL_NAME

public static java.lang.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

ASPECTS_QNAME

public static QName ASPECTS_QNAME

OBJECT_TYPE_ID

public static java.lang.String OBJECT_TYPE_ID

CMIS_READ

public static final java.lang.String CMIS_READ
Basic permissions.

See Also:
Constant Field Values

CMIS_WRITE

public static final java.lang.String CMIS_WRITE
See Also:
Constant Field Values

CMIS_ALL

public static final java.lang.String CMIS_ALL
See Also:
Constant Field Values
Constructor Detail

CMISMapping

public CMISMapping()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean

setDictionaryService

public void setDictionaryService(DictionaryService dictionaryService)
Parameters:
dictionary - service

setNamespaceService

public void setNamespaceService(NamespaceService namespaceService)
Parameters:
namespace - service

getNamespaceService

public NamespaceService getNamespaceService()
Returns:
namespaceService

getDictionaryService

public DictionaryService getDictionaryService()
Returns:
dictionaryService

getCmisTypeId

public java.lang.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:
typeQName -
Returns:

getCmisTypeId

public java.lang.String getCmisTypeId(QName classQName)

buildPrefixEncodedString

public java.lang.String buildPrefixEncodedString(QName qname)

getAlfrescoName

public QName getAlfrescoName(java.lang.String typeId)

isValidCmisDocumentOrFolder

public boolean isValidCmisDocumentOrFolder(QName typeQName)
Is this a valid cmis document or folder type (not a relationship)

Parameters:
dictionaryService -
typeQName -
Returns:

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:
dictionaryService -
typeQName -
Returns:

isValidCmisDocument

public boolean isValidCmisDocument(QName typeQName)
Is this a valid CMIS document type?

Parameters:
dictionaryService -
typeQName -
Returns:

isValidCmisPolicy

public boolean isValidCmisPolicy(QName typeQName)
Is this a valid CMIS policy type?

Parameters:
dictionaryService -
typeQName -
Returns:

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:
dictionaryService -
associationQName -
Returns:

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 -
Returns:

getDataType

public org.apache.chemistry.opencmis.commons.enums.PropertyType getDataType(DataTypeDefinition datatype)
Get the CMIS property type for a property

Parameters:
dictionaryService -
propertyQName -
Returns:

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 java.lang.String getCmisPropertyId(QName propertyQName)
Parameters:
namespaceService -
propertyQName -
Returns:

getReportedPermissions

public java.util.Collection getReportedPermissions(java.lang.String permission,
                                                   java.util.Set permissions,
                                                   boolean hasFull,
                                                   boolean isDirect,
                                                   CMISAccessControlFormatEnum format)

getSetPermission

public java.lang.String getSetPermission(java.lang.String permission)
Parameters:
permission -
Returns:
permission to set


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.