org.alfresco.repo.cmis.ws.utils
Class PropertyUtil

java.lang.Object
  extended by org.alfresco.repo.cmis.ws.utils.PropertyUtil

public class PropertyUtil
extends java.lang.Object

Class for managing access control to CMIS properties


Constructor Summary
PropertyUtil()
           
 
Method Summary
 javax.xml.datatype.XMLGregorianCalendar convert(java.util.Date date)
          Converts Date object to XMLGregorianCalendar object
 org.alfresco.repo.cmis.ws.CmisProperty createProperty(java.lang.String pdid, org.alfresco.cmis.CMISDataTypeEnum dataType, java.io.Serializable value)
          Creates and initializes appropriate CmisProperty instance by name and data type
 java.lang.Object getCmisPropertyValue(org.alfresco.repo.cmis.ws.CmisPropertiesType cmisProperties, java.lang.String property, java.lang.Object defaultValue)
          Extracts from CmisPropertiesType instance property by its name and returns casted to appropriate type value of the extracted property
 org.alfresco.repo.cmis.ws.CmisPropertiesType getProperties(java.lang.Object object, org.alfresco.cmis.PropertyFilter filter)
          Get CMIS properties for object
 java.util.Map getPropertiesMap(org.alfresco.repo.cmis.ws.CmisPropertiesType cmisProperties)
          Converts CmisPropertiesType properties representation to rapidly accessible form
 java.lang.Object getProperty(org.alfresco.service.cmr.repository.NodeRef objectNodeRef, java.lang.String propertyName, java.lang.Object defaultValue)
          Gets property value by its name from Node Reference object
 java.lang.String getPropertyName(org.alfresco.repo.cmis.ws.CmisProperty property)
           
 void setCmisDictionaryService(org.alfresco.cmis.CMISDictionaryService cmisDictionaryService)
           
 void setCmisService(org.alfresco.cmis.CMISServices cmisService)
           
 void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
           
 void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
           
 void setProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.repo.cmis.ws.CmisPropertiesType properties, org.alfresco.cmis.PropertyFilter ignoringPropertiesFilter)
          Sets and checks all properties' fields for specified node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyUtil

public PropertyUtil()
Method Detail

setDictionaryService

public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)

setNamespaceService

public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)

setCmisService

public void setCmisService(org.alfresco.cmis.CMISServices cmisService)

setCmisDictionaryService

public void setCmisDictionaryService(org.alfresco.cmis.CMISDictionaryService cmisDictionaryService)

getProperty

public java.lang.Object getProperty(org.alfresco.service.cmr.repository.NodeRef objectNodeRef,
                                    java.lang.String propertyName,
                                    java.lang.Object defaultValue)
                             throws org.alfresco.cmis.CMISInvalidArgumentException
Gets property value by its name from Node Reference object

Parameters:
objectNodeRef - - NodeRef instance that represents Id of the source object
propertyName - - String instance that represents property name
defaultValue - - some value of the appropriate for conversion type. Also null may be accepted by this parameter
Returns:
value instance of the appropriate type if specified object has such property and defaultValue if requested property value or objectNodeRef or propertyName are null or if some exception occurred during property receiving
Throws:
org.alfresco.cmis.CMISInvalidArgumentException

getCmisPropertyValue

public java.lang.Object getCmisPropertyValue(org.alfresco.repo.cmis.ws.CmisPropertiesType cmisProperties,
                                             java.lang.String property,
                                             java.lang.Object defaultValue)
                                      throws org.alfresco.repo.cmis.ws.CmisException
Extracts from CmisPropertiesType instance property by its name and returns casted to appropriate type value of the extracted property

Parameters:
cmisProperties - - CmisPropertiesType properties instance
property - - String instance that represents property name
defaultValue - - some value of the appropriate for conversion type. Also null may be accepted by this parameter
Returns:
value instance of the appropriate type if specified cmisProperties contains specified properties and defaultValue if requested property value or cmisProperties or property are null or if some exception occurred during property searching and receiving
Throws:
org.alfresco.repo.cmis.ws.CmisException

getPropertiesMap

public java.util.Map getPropertiesMap(org.alfresco.repo.cmis.ws.CmisPropertiesType cmisProperties)
                               throws org.alfresco.repo.cmis.ws.CmisException
Converts CmisPropertiesType properties representation to rapidly accessible form

Parameters:
cmisProperties - - CmisPropertiesType properties representation
Returns:
Map<String, Serializable> properties representation
Throws:
CmisException
org.alfresco.repo.cmis.ws.CmisException

setProperties

public void setProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                          org.alfresco.repo.cmis.ws.CmisPropertiesType properties,
                          org.alfresco.cmis.PropertyFilter ignoringPropertiesFilter)
                   throws org.alfresco.repo.cmis.ws.CmisException
Sets and checks all properties' fields for specified node

Parameters:
nodeRef - - NodeRef for node for those properties must be setted
properties - - CmisPropertiesType instance that contains all the necessary properties' fields
ignoringPropertiesFilter - - PropertyFilter instance. This filter determines which properties should be ignored and not setted without exception. If this parameter is null all properties will be processed in common flow
Throws:
org.alfresco.repo.cmis.ws.CmisException

getPropertyName

public java.lang.String getPropertyName(org.alfresco.repo.cmis.ws.CmisProperty property)

getProperties

public org.alfresco.repo.cmis.ws.CmisPropertiesType getProperties(java.lang.Object object,
                                                                  org.alfresco.cmis.PropertyFilter filter)
                                                           throws org.alfresco.repo.cmis.ws.CmisException
Get CMIS properties for object

Parameters:
nodeRef - node reference
filter - property filter
Returns:
properties
Throws:
org.alfresco.repo.cmis.ws.CmisException

createProperty

public org.alfresco.repo.cmis.ws.CmisProperty createProperty(java.lang.String pdid,
                                                             org.alfresco.cmis.CMISDataTypeEnum dataType,
                                                             java.io.Serializable value)
Creates and initializes appropriate CmisProperty instance by name and data type

Parameters:
pdid - - String value that represents CMIS property name
dataType - - CMISDataTypeEnum value that specifies real type of the property
value - - some instance of appropriate type or some Collection that contains several values of the type
Returns:
appropriate CmisProperty instance

convert

public javax.xml.datatype.XMLGregorianCalendar convert(java.util.Date date)
Converts Date object to XMLGregorianCalendar object

Parameters:
date - Date object
Returns:
XMLGregorianCalendar object


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