com.wewebu.ow.server.ecmimpl.cmis.alfresco
Class OwCMISALObjectClass

java.lang.Object
  extended by com.wewebu.ow.server.ecmimpl.cmis.alfresco.OwCMISALObjectClass
All Implemented Interfaces:
com.wewebu.ow.server.ecm.OwObjectClass, OwCMISObjectClass
Direct Known Subclasses:
OwCMISAlfrescoObjectClass

public class OwCMISALObjectClass
extends Object
implements OwCMISObjectClass

Base Alfresco specific object class for Aspects handling. Will do a pre- and post-processing during createNewObject(...) to handle Aspect values correct.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com

Since:
3.2.0.0

Field Summary
 
Fields inherited from interface com.wewebu.ow.server.ecmimpl.cmis.objectclasses.OwCMISObjectClass
MIME_TYPE_PREFIX_OW_POLICY, MIME_TYPE_PREFIX_OW_RELATIONSHIP
 
Fields inherited from interface com.wewebu.ow.server.ecm.OwObjectClass
OPERATION_TYPE_CHECKIN, OPERATION_TYPE_CHECKOUT, OPERATION_TYPE_CREATE_NEW_OBJECT, OPERATION_TYPE_SET_PROPERTIES, OPERATION_TYPE_UNDEF
 
Constructor Summary
OwCMISALObjectClass(OwCMISObjectClass primaryClass, OwCMISNetwork network)
           
 
Method Summary
 boolean canCreateNewObject()
           
 OwCMISObject createCMISObject(OwCMISNetwork network_p, org.oasis_open.docs.ns.cmis.core._200908.CmisObjectType object_p, boolean preserveVersion_p)
          Creates an OwCMISObject for the given native CmisObjectType
 String createNewObject(OwCMISNetwork network_p, boolean promote_p, Object mode_p, com.wewebu.ow.server.ecm.OwResource resource_p, com.wewebu.ow.server.ecm.OwPropertyCollection properties_p, com.wewebu.ow.server.ecm.OwPermissionCollection permissions_p, com.wewebu.ow.server.ecm.OwContentCollection content_p, com.wewebu.ow.server.ecm.OwObject parent_p, String strMimeType_p, String strMimeParameter_p, boolean keepCheckedOut_p)
           
protected  Map<String,OwCMISPropertyClass> getAllAspectProperties()
          Helper used to iterate over the getAppliedAspectTypes() calling the getAspectProperties(String).
 List<String> getAppliedAspectTypes()
          Return a list of Id's representing the Aspects applied to this type.
protected  Map<String,OwCMISPropertyClass> getAspectProperties(String aspectClassId_p)
          Helper method to filter out only editable Aspect properties.
 Map getChildNames(com.wewebu.ow.server.ecm.OwNetwork network_p, boolean excludeHiddenAndNonInstantiable_p)
           
 List getChilds(com.wewebu.ow.server.ecm.OwNetwork network_p, boolean excludeHiddenAndNonInstantiable_p)
           
 String getClassName()
           
 String getDescription(Locale locale_p)
           
 String getDisplayName(Locale locale_p)
           
 String getMimetype()
           
 List getModes(int operation_p)
           
 String getNamePropertyName()
           
 org.oasis_open.docs.ns.cmis.core._200908.CmisTypeDefinitionType getNativeObject()
          Return the native representation type of current objectclass.
protected  OwCMISNetwork getNetwork()
          Getter method for the current network.
 OwCMISObjectClass getParent()
           
 List<String> getPreferredPropertyOrder()
          Get the preferred property order.
protected  OwCMISObjectClass getPrimaryClass()
          Getter method to the native/primary class definition.
 OwCMISPropertyClass getPropertyClass(String propertyClassName_p)
           
 Map<String,OwCMISPropertyClass> getPropertyClasses()
           
 Collection<String> getPropertyClassNames()
           
 Set<OwCMISPropertyClass> getQueryablePropertyClasses(OwCMISQueryContext context_p)
           
 String getQueryName()
          Should return an non-null value if this object is query able.
 OwCMISResource getResource()
           
 int getType()
           
 boolean hasChilds(com.wewebu.ow.server.ecm.OwNetwork network_p, boolean excludeHiddenAndNonInstantiable_p, int context_p)
           
 boolean hasVersionSeries()
           
 boolean isAspectApplied(String aspectName_p)
          Check if an Aspect is applied to this type.
 boolean isAssignableFrom(OwCMISObjectClass class_p)
          A java class analogous method : Determines if the object-class represented by this object-class object is either the same as, or is a superclass of the object-class represented by the specified object-class parameter.
 boolean isContentRequired()
          Define if for this object the content is required.
 boolean isHidden()
           
 boolean isQueryable()
          As specified by the CMIS definition, the request method to verify if this object can be used in query FROM statement.
protected  Collection<String> reorderProperties(Collection<String> allProperties_p)
          Sort provided properties regarding definition of getPreferredPropertyOrder() list.
 void subclassedBy(OwCMISObjectClass subclass_p)
          Method called when this class is sub-classed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OwCMISALObjectClass

public OwCMISALObjectClass(OwCMISObjectClass primaryClass,
                           OwCMISNetwork network)
Method Detail

getAppliedAspectTypes

public List<String> getAppliedAspectTypes()
                                   throws com.wewebu.ow.server.exceptions.OwException
Return a list of Id's representing the Aspects applied to this type.

Returns:
List of Strings representing the Id of an Aspect
Throws:
com.wewebu.ow.server.exceptions.OwException

isAspectApplied

public boolean isAspectApplied(String aspectName_p)
                        throws com.wewebu.ow.server.exceptions.OwException
Check if an Aspect is applied to this type.

Parameters:
aspectName_p - String Id
Returns:
boolean true only if it exist in the getAppliedAspectTypes() collection
Throws:
com.wewebu.ow.server.exceptions.OwException

canCreateNewObject

public boolean canCreateNewObject()
                           throws com.wewebu.ow.server.exceptions.OwException
Specified by:
canCreateNewObject in interface com.wewebu.ow.server.ecm.OwObjectClass
Specified by:
canCreateNewObject in interface OwCMISObjectClass
Throws:
com.wewebu.ow.server.exceptions.OwException

createCMISObject

public OwCMISObject createCMISObject(OwCMISNetwork network_p,
                                     org.oasis_open.docs.ns.cmis.core._200908.CmisObjectType object_p,
                                     boolean preserveVersion_p)
                              throws com.wewebu.ow.server.exceptions.OwException
Description copied from interface: OwCMISObjectClass
Creates an OwCMISObject for the given native CmisObjectType

Specified by:
createCMISObject in interface OwCMISObjectClass
preserveVersion_p - boolean, true if the exact version should be used
Returns:
the OwCMISObject corresponding to the given CmisObjectType
Throws:
com.wewebu.ow.server.exceptions.OwException

createNewObject

public String createNewObject(OwCMISNetwork network_p,
                              boolean promote_p,
                              Object mode_p,
                              com.wewebu.ow.server.ecm.OwResource resource_p,
                              com.wewebu.ow.server.ecm.OwPropertyCollection properties_p,
                              com.wewebu.ow.server.ecm.OwPermissionCollection permissions_p,
                              com.wewebu.ow.server.ecm.OwContentCollection content_p,
                              com.wewebu.ow.server.ecm.OwObject parent_p,
                              String strMimeType_p,
                              String strMimeParameter_p,
                              boolean keepCheckedOut_p)
                       throws com.wewebu.ow.server.exceptions.OwException
Specified by:
createNewObject in interface OwCMISObjectClass
Returns:
a String DMSID for the newly created object
Throws:
com.wewebu.ow.server.exceptions.OwException

getChildNames

public Map getChildNames(com.wewebu.ow.server.ecm.OwNetwork network_p,
                         boolean excludeHiddenAndNonInstantiable_p)
                  throws Exception
Specified by:
getChildNames in interface com.wewebu.ow.server.ecm.OwObjectClass
Throws:
Exception

getChilds

public List getChilds(com.wewebu.ow.server.ecm.OwNetwork network_p,
                      boolean excludeHiddenAndNonInstantiable_p)
               throws Exception
Specified by:
getChilds in interface com.wewebu.ow.server.ecm.OwObjectClass
Throws:
Exception

getClassName

public String getClassName()
Specified by:
getClassName in interface com.wewebu.ow.server.ecm.OwObjectClass

getDescription

public String getDescription(Locale locale_p)
Specified by:
getDescription in interface com.wewebu.ow.server.ecm.OwObjectClass

getDisplayName

public String getDisplayName(Locale locale_p)
Specified by:
getDisplayName in interface com.wewebu.ow.server.ecm.OwObjectClass

getMimetype

public String getMimetype()
Specified by:
getMimetype in interface OwCMISObjectClass

getModes

public List getModes(int operation_p)
              throws Exception
Specified by:
getModes in interface com.wewebu.ow.server.ecm.OwObjectClass
Throws:
Exception

getNamePropertyName

public String getNamePropertyName()
                           throws com.wewebu.ow.server.exceptions.OwException
Specified by:
getNamePropertyName in interface com.wewebu.ow.server.ecm.OwObjectClass
Specified by:
getNamePropertyName in interface OwCMISObjectClass
Throws:
com.wewebu.ow.server.exceptions.OwException

getParent

public OwCMISObjectClass getParent()
                            throws com.wewebu.ow.server.exceptions.OwException
Specified by:
getParent in interface com.wewebu.ow.server.ecm.OwObjectClass
Specified by:
getParent in interface OwCMISObjectClass
Throws:
com.wewebu.ow.server.exceptions.OwException

getPropertyClass

public OwCMISPropertyClass getPropertyClass(String propertyClassName_p)
                                     throws com.wewebu.ow.server.exceptions.OwException
Specified by:
getPropertyClass in interface com.wewebu.ow.server.ecm.OwObjectClass
Specified by:
getPropertyClass in interface OwCMISObjectClass
Throws:
com.wewebu.ow.server.exceptions.OwException

getPropertyClasses

public Map<String,OwCMISPropertyClass> getPropertyClasses()
                                                   throws com.wewebu.ow.server.exceptions.OwException
Specified by:
getPropertyClasses in interface OwCMISObjectClass
Returns:
a Map of property classes fully qualified names mapped to OwCMISPropertyClass for all properties defined by this object class (inherited properties included).
Throws:
com.wewebu.ow.server.exceptions.OwException

getPropertyClassNames

public Collection<String> getPropertyClassNames()
                                         throws com.wewebu.ow.server.exceptions.OwException
Specified by:
getPropertyClassNames in interface com.wewebu.ow.server.ecm.OwObjectClass
Specified by:
getPropertyClassNames in interface OwCMISObjectClass
Throws:
com.wewebu.ow.server.exceptions.OwException

getQueryablePropertyClasses

public Set<OwCMISPropertyClass> getQueryablePropertyClasses(OwCMISQueryContext context_p)
                                                     throws com.wewebu.ow.server.exceptions.OwException
Specified by:
getQueryablePropertyClasses in interface OwCMISObjectClass
Returns:
a Set of OwCMISPropertyClass for all queryable property classes that are defined by this object class
Throws:
com.wewebu.ow.server.exceptions.OwException

getQueryName

public String getQueryName()
Description copied from interface: OwCMISObjectClass
Should return an non-null value if this object is query able.

Specified by:
getQueryName in interface OwCMISObjectClass
Returns:
String escaped query name, which MUST be used for searches

getResource

public OwCMISResource getResource()
Specified by:
getResource in interface OwCMISObjectClass
Returns:
the resource that this class associates with

getType

public int getType()
Specified by:
getType in interface com.wewebu.ow.server.ecm.OwObjectClass

hasChilds

public boolean hasChilds(com.wewebu.ow.server.ecm.OwNetwork network_p,
                         boolean excludeHiddenAndNonInstantiable_p,
                         int context_p)
                  throws Exception
Specified by:
hasChilds in interface com.wewebu.ow.server.ecm.OwObjectClass
Throws:
Exception

hasVersionSeries

public boolean hasVersionSeries()
                         throws Exception
Specified by:
hasVersionSeries in interface com.wewebu.ow.server.ecm.OwObjectClass
Throws:
Exception

isContentRequired

public boolean isContentRequired()
                          throws com.wewebu.ow.server.exceptions.OwException
Description copied from interface: OwCMISObjectClass
Define if for this object the content is required.

Specified by:
isContentRequired in interface OwCMISObjectClass
Returns:
boolean true if is required, otherwise false
Throws:
com.wewebu.ow.server.exceptions.OwException

isHidden

public boolean isHidden()
                 throws Exception
Specified by:
isHidden in interface com.wewebu.ow.server.ecm.OwObjectClass
Throws:
Exception

isQueryable

public boolean isQueryable()
Description copied from interface: OwCMISObjectClass
As specified by the CMIS definition, the request method to verify if this object can be used in query FROM statement.

Specified by:
isQueryable in interface OwCMISObjectClass
Returns:
boolean query able

subclassedBy

public void subclassedBy(OwCMISObjectClass subclass_p)
                  throws com.wewebu.ow.server.exceptions.OwInvalidOperationException
Description copied from interface: OwCMISObjectClass
Method called when this class is sub-classed.

Specified by:
subclassedBy in interface OwCMISObjectClass
Parameters:
subclass_p - the new child of this class
Throws:
com.wewebu.ow.server.exceptions.OwInvalidOperationException - if the subclass constraints of this class are not met or the this class can not be sub-classed

isAssignableFrom

public boolean isAssignableFrom(OwCMISObjectClass class_p)
                         throws com.wewebu.ow.server.exceptions.OwException
Description copied from interface: OwCMISObjectClass
A java class analogous method : Determines if the object-class represented by this object-class object is either the same as, or is a superclass of the object-class represented by the specified object-class parameter.

Specified by:
isAssignableFrom in interface OwCMISObjectClass
Returns:
the boolean value indicating whether objects of the type class can be interpreted as objects of this class
Throws:
com.wewebu.ow.server.exceptions.OwException

getNativeObject

public org.oasis_open.docs.ns.cmis.core._200908.CmisTypeDefinitionType getNativeObject()
Description copied from interface: OwCMISObjectClass
Return the native representation type of current objectclass.

Attention: Can return null if this object is not based on a native representation, but a local structure object.

Specified by:
getNativeObject in interface OwCMISObjectClass
Returns:
CmisTypeDefinitionType or null

getPrimaryClass

protected OwCMISObjectClass getPrimaryClass()
Getter method to the native/primary class definition.

Returns:
OwCMISObjectClass

getNetwork

protected OwCMISNetwork getNetwork()
Getter method for the current network.

Returns:
OwCMISNetwork

getAllAspectProperties

protected Map<String,OwCMISPropertyClass> getAllAspectProperties()
                                                          throws com.wewebu.ow.server.exceptions.OwException
Helper used to iterate over the getAppliedAspectTypes() calling the getAspectProperties(String).

Returns:
Map with specific properties or empty map.
Throws:
com.wewebu.ow.server.exceptions.OwException

getAspectProperties

protected Map<String,OwCMISPropertyClass> getAspectProperties(String aspectClassId_p)
                                                       throws com.wewebu.ow.server.exceptions.OwException
Helper method to filter out only editable Aspect properties. All system properties will be removed from returned collection.

May be some properties must be removed in post processing of the returned map! (cmis:name or cmis:policy.cmis:name)

Parameters:
aspectClassId_p - String id/symbolic name of the Aspect
Returns:
Map of property-id to property class
Throws:
com.wewebu.ow.server.exceptions.OwException

getPreferredPropertyOrder

public List<String> getPreferredPropertyOrder()
Get the preferred property order.

Returns:
List of Strings (property names)
Since:
4.0.0.0

reorderProperties

protected Collection<String> reorderProperties(Collection<String> allProperties_p)
                                        throws com.wewebu.ow.server.exceptions.OwException
Sort provided properties regarding definition of getPreferredPropertyOrder() list.

Parameters:
allProperties_p - Collection to be sorted
Returns:
Collection with preferred property order
Throws:
com.wewebu.ow.server.exceptions.OwException
Since:
4.0.0.0


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.