com.wewebu.ow.server.ecmimpl.cmis.object
Class OwCMISFolderObject

java.lang.Object
  extended by com.wewebu.ow.server.ecmimpl.cmis.object.OwCMISObjectBase
      extended by com.wewebu.ow.server.ecmimpl.cmis.object.OwCMISFolderObject
All Implemented Interfaces:
com.wewebu.ow.server.ecm.OwObject, com.wewebu.ow.server.ecm.OwObjectReference, OwCMISObject, com.wewebu.ow.server.field.OwFieldProvider
Direct Known Subclasses:
OwCMISRepositoryFolder, OwCMISSemiVirtualFolderObject

public class OwCMISFolderObject
extends OwCMISObjectBase

Class representing a Folder in CMIS environments.

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


Field Summary
 
Fields inherited from class com.wewebu.ow.server.ecmimpl.cmis.object.OwCMISObjectBase
ADD_PROPERTY_EXTENSIONS_EP, CUSTOMIZE_CLASS_EP, FILTER_PROPERTY_EXTENSIONS_EP, m_cmisObjType, m_network, PROCESS_NATIVE_PROPERITIES_EP, REQUEST_CACHED_PROPERITIES_EP
 
Fields inherited from interface com.wewebu.ow.server.ecm.OwObject
STANDARD_PATH_DELIMITER
 
Fields inherited from interface com.wewebu.ow.server.ecm.OwObjectReference
OBJECT_TYPE_ALL_CONTAINER_OBJECTS, OBJECT_TYPE_ALL_CONTENT_OBJECTS, OBJECT_TYPE_ALL_TUPLE_OBJECTS, OBJECT_TYPE_ALL_WORKFLOW_OBJECTS, OBJECT_TYPE_BPM_ROOT_FOLDER, OBJECT_TYPE_CONTAINER_USER_START, OBJECT_TYPE_CONTENT_USER_START, OBJECT_TYPE_CROSS_QUEUE_FOLDER, OBJECT_TYPE_CUSTOM, OBJECT_TYPE_DOCUMENT, OBJECT_TYPE_DYNAMIC_VIRTUAL_FOLDER, OBJECT_TYPE_ECM_ROOT_FOLDER, OBJECT_TYPE_FOLDER, OBJECT_TYPE_HISTORY, OBJECT_TYPE_LINK, OBJECT_TYPE_PROXY_QUEUE_FOLDER, OBJECT_TYPE_PUBLIC_QUEUE_FOLDER, OBJECT_TYPE_ROSTER_FOLDER, OBJECT_TYPE_ROSTERITEM, OBJECT_TYPE_STORED_SEARCH, OBJECT_TYPE_SYS_QUEUE_FOLDER, OBJECT_TYPE_TRACKER_QUEUE_FOLDER, OBJECT_TYPE_TUPLE_USER_START, OBJECT_TYPE_UNDEFINED, OBJECT_TYPE_USER_QUEUE_FOLDER, OBJECT_TYPE_VIRTUAL_FOLDER, OBJECT_TYPE_WORKFLOW_USER_START, OBJECT_TYPE_WORKITEM, OBJECT_TYPE_WORKITEM_PROXY, OBJECT_TYPE_WORKITEM_TRACKER
 
Fields inherited from interface com.wewebu.ow.server.field.OwFieldProvider
TYPE_AJAX, TYPE_CHECKIN_OBJECT, TYPE_CREATE_OBJECT, TYPE_META_OBJECT, TYPE_RESULT_LIST, TYPE_SEARCH, TYPE_SMALL
 
Constructor Summary
OwCMISFolderObject(OwCMISNetwork network_p, OwCMISObjectModel objectModel_p, org.oasis_open.docs.ns.cmis.core._200908.CmisObjectType cmistype_p)
           
 
Method Summary
 void add(com.wewebu.ow.server.ecm.OwObject object_p)
           
protected static void addPropertyName(StringBuilder existingProp_p, String newPropName_p)
          Helper method to add a property name to a StringBuilder, which contains/represents a String of comma (",") separated property names.
 boolean canAdd(com.wewebu.ow.server.ecm.OwObject object_p, int context_p)
           
 boolean canGetContent(int contentType_p, int context_p)
           
 boolean canMove(com.wewebu.ow.server.ecm.OwObject object_p, com.wewebu.ow.server.ecm.OwObject oldParent_p, int context_p)
           
 boolean canRemoveReference(com.wewebu.ow.server.ecm.OwObject object_p, int context_p)
           
 boolean canSetContent(int contentType_p, int context_p)
           
 OwCMISObject createCopy(OwCMISObject copyParent_p, com.wewebu.ow.server.ecm.OwPropertyCollection properties_p, com.wewebu.ow.server.ecm.OwPermissionCollection permissions_p, int[] childTypes_p)
           
protected  com.wewebu.ow.server.ecm.OwStandardObjectCollection createObjectCollection()
          (overridable) Factory method for the ObjectCollection which will be used in the getChilds(int[], Collection, OwSort, int, int, OwSearchNode) method.
 void delete()
           
protected  void doClientsideSorting(com.wewebu.ow.server.ecm.OwObjectCollection col_p)
          (overridable) Called to do a client side sorting, because the sorting for the given property does not work on server side.
 int getChildCount(int[] objectTypes_p, int context_p)
           
protected  String getChildrenPropertiesAsString(Collection<String> propertyNames_p, OwCMISObjectClass defaultObjClass_p)
          Convert the Collection of Strings into a String of comma separated property names.
 com.wewebu.ow.server.ecm.OwObjectCollection getChilds(int[] objectTypes_p, Collection propertyNames_p, com.wewebu.ow.server.field.OwSort sort_p, int maxSize_p, int versionSelection_p, com.wewebu.ow.server.field.OwSearchNode filterCriteria_p)
           
protected  com.wewebu.ow.server.field.OwSort getClientSortCollection()
          Return an OwSort containing properties which cloud not be used for sorting on server side.
protected  String getCurrentObjectId(com.wewebu.ow.server.ecm.OwObject object_p)
          Helper method to get the correct object id, which is used in move operation (like latest object id, to avoid errors for version dependent filing).
 com.wewebu.ow.server.ecm.OwObjectCollection getParents()
           
 String getPath()
           
protected  String getSortString(com.wewebu.ow.server.field.OwSort sortingOrder_p, int maxSortCriteria_p)
          Return a String of the defined OwSort criteria in correct order.
 com.wewebu.ow.server.ecm.OwVersion getVersion()
           
 com.wewebu.ow.server.ecm.OwVersionSeries getVersionSeries()
           
 boolean hasChilds(int[] objectTypes_p, int context_p)
           
 boolean hasVersionSeries()
           
protected  boolean isSubtypeOf(String typeId, String isParentId)
          Helper Method which will recursively traverse bottom-up the object-class/-type tree, searching for matching Id's.
 void move(com.wewebu.ow.server.ecm.OwObject object_p, com.wewebu.ow.server.ecm.OwObject oldParent_p)
           
 void removeReference(com.wewebu.ow.server.ecm.OwObject object_p)
           
protected  void setClientSortCollection(com.wewebu.ow.server.field.OwSort sort_p)
          Set the collection which should be used for client side sorting.
 void setContentCollection(com.wewebu.ow.server.ecm.OwContentCollection content_p)
           
 
Methods inherited from class com.wewebu.ow.server.ecmimpl.cmis.object.OwCMISObjectBase
canChangeClass, canDelete, canFilterChilds, canGetPermissions, canGetProperties, canLock, canSetPermissions, canSetProperties, changeClass, decodeID, encodeID, equals, getChangeToken, getClassName, getClonedPermissions, getClonedProperties, getColumnInfoList, getContentCollection, getDecodedID, getDMSID, getField, getFieldProviderName, getFieldProviderSource, getFieldProviderType, getFields, getFilterProperties, getID, getInstance, getLock, getLockUserID, getMIMEParameter, getMIMEType, getMyLock, getName, getNativeObject, getNetwork, getObjectClass, getObjectModel, getPageCount, getPermissions, getProperties, getProperty, getResource, getResourceID, getSafeFieldValue, getSearchTemplate, getType, hasContent, hashCode, refreshProperties, refreshProperties, resetNativeObject, retrieveCmisProperties, retrieveCmisProperty, setField, setLock, setPermissions, setProperties, setProperties
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OwCMISFolderObject

public OwCMISFolderObject(OwCMISNetwork network_p,
                          OwCMISObjectModel objectModel_p,
                          org.oasis_open.docs.ns.cmis.core._200908.CmisObjectType cmistype_p)
                   throws com.wewebu.ow.server.exceptions.OwException
Throws:
com.wewebu.ow.server.exceptions.OwException
Method Detail

getChildCount

public int getChildCount(int[] objectTypes_p,
                         int context_p)
                  throws com.wewebu.ow.server.exceptions.OwException
Specified by:
getChildCount in interface com.wewebu.ow.server.ecm.OwObject
Overrides:
getChildCount in class OwCMISObjectBase
Throws:
com.wewebu.ow.server.exceptions.OwException

getChilds

public com.wewebu.ow.server.ecm.OwObjectCollection getChilds(int[] objectTypes_p,
                                                             Collection propertyNames_p,
                                                             com.wewebu.ow.server.field.OwSort sort_p,
                                                             int maxSize_p,
                                                             int versionSelection_p,
                                                             com.wewebu.ow.server.field.OwSearchNode filterCriteria_p)
                                                      throws com.wewebu.ow.server.exceptions.OwException
Specified by:
getChilds in interface com.wewebu.ow.server.ecm.OwObject
Overrides:
getChilds in class OwCMISObjectBase
Throws:
com.wewebu.ow.server.exceptions.OwException

getParents

public com.wewebu.ow.server.ecm.OwObjectCollection getParents()
                                                       throws com.wewebu.ow.server.exceptions.OwException
Specified by:
getParents in interface com.wewebu.ow.server.ecm.OwObject
Overrides:
getParents in class OwCMISObjectBase
Throws:
com.wewebu.ow.server.exceptions.OwException

canAdd

public boolean canAdd(com.wewebu.ow.server.ecm.OwObject object_p,
                      int context_p)
               throws com.wewebu.ow.server.exceptions.OwException
Specified by:
canAdd in interface com.wewebu.ow.server.ecm.OwObject
Overrides:
canAdd in class OwCMISObjectBase
Throws:
com.wewebu.ow.server.exceptions.OwException

canGetContent

public boolean canGetContent(int contentType_p,
                             int context_p)
                      throws com.wewebu.ow.server.exceptions.OwException
Throws:
com.wewebu.ow.server.exceptions.OwException

getChildrenPropertiesAsString

protected String getChildrenPropertiesAsString(Collection<String> propertyNames_p,
                                               OwCMISObjectClass defaultObjClass_p)
                                        throws com.wewebu.ow.server.exceptions.OwException
Convert the Collection of Strings into a String of comma separated property names.

if Collection is null, then all possible properties are retrieved using the SQL operator *,
else the collection is transformed into a String of comma separated property names.

Parameters:
propertyNames_p - Collection, can be null
defaultObjClass_p - OwCMISObjectClass default object class for filtering use
Returns:
String of comma separated property names, or "*" if Collection is null
Throws:
com.wewebu.ow.server.exceptions.OwException

getSortString

protected String getSortString(com.wewebu.ow.server.field.OwSort sortingOrder_p,
                               int maxSortCriteria_p)
                        throws com.wewebu.ow.server.exceptions.OwException
Return a String of the defined OwSort criteria in correct order. If given OwSort is null or empty null is returned.

Method will check every property if it isOrderable, regarding it's property definition. If the property can be used for sorting (isOrderable == true) the property will be add to returned String with the specific cmis:queryname, else the property will silently ignored and the next one will be processed

Parameters:
sortingOrder_p - OwSort sort definition
maxSortCriteria_p - maxim number of sort criteria supported by the native CMIS system
Returns:
String representing the sorting, or null
Throws:
com.wewebu.ow.server.exceptions.OwException - if cannot resolve sort criteria

delete

public void delete()
            throws com.wewebu.ow.server.exceptions.OwException
Specified by:
delete in interface com.wewebu.ow.server.ecm.OwObject
Overrides:
delete in class OwCMISObjectBase
Throws:
com.wewebu.ow.server.exceptions.OwException

removeReference

public void removeReference(com.wewebu.ow.server.ecm.OwObject object_p)
                     throws com.wewebu.ow.server.exceptions.OwException
Specified by:
removeReference in interface com.wewebu.ow.server.ecm.OwObject
Overrides:
removeReference in class OwCMISObjectBase
Throws:
com.wewebu.ow.server.exceptions.OwException

canRemoveReference

public boolean canRemoveReference(com.wewebu.ow.server.ecm.OwObject object_p,
                                  int context_p)
                           throws com.wewebu.ow.server.exceptions.OwException
Specified by:
canRemoveReference in interface com.wewebu.ow.server.ecm.OwObject
Overrides:
canRemoveReference in class OwCMISObjectBase
Throws:
com.wewebu.ow.server.exceptions.OwException

add

public void add(com.wewebu.ow.server.ecm.OwObject object_p)
         throws com.wewebu.ow.server.exceptions.OwException
Specified by:
add in interface com.wewebu.ow.server.ecm.OwObject
Overrides:
add in class OwCMISObjectBase
Throws:
com.wewebu.ow.server.exceptions.OwException

addPropertyName

protected static void addPropertyName(StringBuilder existingProp_p,
                                      String newPropName_p)
Helper method to add a property name to a StringBuilder, which contains/represents a String of comma (",") separated property names.

Check if the existingProp is ending with a comma, and appending a comma if missing before appending new property name.

Does not check if existingProp already contains the newPropName!

Parameters:
existingProp_p - StringBuilder which is non-empty
newPropName_p - String new property name to be add.

getVersion

public com.wewebu.ow.server.ecm.OwVersion getVersion()
                                              throws com.wewebu.ow.server.exceptions.OwException
Throws:
com.wewebu.ow.server.exceptions.OwException

getVersionSeries

public com.wewebu.ow.server.ecm.OwVersionSeries getVersionSeries()
                                                          throws com.wewebu.ow.server.exceptions.OwException
Throws:
com.wewebu.ow.server.exceptions.OwException

hasVersionSeries

public boolean hasVersionSeries()
                         throws com.wewebu.ow.server.exceptions.OwException
Throws:
com.wewebu.ow.server.exceptions.OwException

canSetContent

public boolean canSetContent(int contentType_p,
                             int context_p)
                      throws com.wewebu.ow.server.exceptions.OwException
Throws:
com.wewebu.ow.server.exceptions.OwException

setContentCollection

public void setContentCollection(com.wewebu.ow.server.ecm.OwContentCollection content_p)
                          throws com.wewebu.ow.server.exceptions.OwException
Throws:
com.wewebu.ow.server.exceptions.OwException

hasChilds

public boolean hasChilds(int[] objectTypes_p,
                         int context_p)
                  throws com.wewebu.ow.server.exceptions.OwException
Throws:
com.wewebu.ow.server.exceptions.OwException

createCopy

public OwCMISObject createCopy(OwCMISObject copyParent_p,
                               com.wewebu.ow.server.ecm.OwPropertyCollection properties_p,
                               com.wewebu.ow.server.ecm.OwPermissionCollection permissions_p,
                               int[] childTypes_p)
                        throws com.wewebu.ow.server.exceptions.OwException
Specified by:
createCopy in interface OwCMISObject
Overrides:
createCopy in class OwCMISObjectBase
Throws:
com.wewebu.ow.server.exceptions.OwException

setClientSortCollection

protected void setClientSortCollection(com.wewebu.ow.server.field.OwSort sort_p)
Set the collection which should be used for client side sorting.

Parameters:
sort_p - OwSort
Since:
3.1.0.0

getClientSortCollection

protected com.wewebu.ow.server.field.OwSort getClientSortCollection()
Return an OwSort containing properties which cloud not be used for sorting on server side.

Can return null if server side can sort every defined properties for getChilds(int[], Collection, OwSort, int, int, OwSearchNode) method.

Returns:
OwSort or null
Since:
3.1.0.0

createObjectCollection

protected com.wewebu.ow.server.ecm.OwStandardObjectCollection createObjectCollection()
(overridable) Factory method for the ObjectCollection which will be used in the getChilds(int[], Collection, OwSort, int, int, OwSearchNode) method.

Returns:
OwStandardObjectCollection
Since:
3.1.0.0

doClientsideSorting

protected void doClientsideSorting(com.wewebu.ow.server.ecm.OwObjectCollection col_p)
                            throws com.wewebu.ow.server.exceptions.OwException
(overridable) Called to do a client side sorting, because the sorting for the given property does not work on server side.

Sorting is incomplete because the list of object is not the whole list which exist on server side.

Parameters:
col_p - OwObjectCollection which should be sorted
Throws:
com.wewebu.ow.server.exceptions.OwException
Since:
3.1.0.0

getPath

public String getPath()
               throws com.wewebu.ow.server.exceptions.OwException
Specified by:
getPath in interface com.wewebu.ow.server.ecm.OwObject
Overrides:
getPath in class OwCMISObjectBase
Throws:
com.wewebu.ow.server.exceptions.OwException

canMove

public boolean canMove(com.wewebu.ow.server.ecm.OwObject object_p,
                       com.wewebu.ow.server.ecm.OwObject oldParent_p,
                       int context_p)
                throws com.wewebu.ow.server.exceptions.OwException
Specified by:
canMove in interface com.wewebu.ow.server.ecm.OwObject
Overrides:
canMove in class OwCMISObjectBase
Throws:
com.wewebu.ow.server.exceptions.OwException

move

public void move(com.wewebu.ow.server.ecm.OwObject object_p,
                 com.wewebu.ow.server.ecm.OwObject oldParent_p)
          throws com.wewebu.ow.server.exceptions.OwException
Specified by:
move in interface com.wewebu.ow.server.ecm.OwObject
Overrides:
move in class OwCMISObjectBase
Throws:
com.wewebu.ow.server.exceptions.OwException

isSubtypeOf

protected boolean isSubtypeOf(String typeId,
                              String isParentId)
                       throws com.wewebu.ow.server.exceptions.OwException
Helper Method which will recursively traverse bottom-up the object-class/-type tree, searching for matching Id's.

Parameters:
typeId - String current id/symbolic name of type
isParentId - String parent type id/symbolic name
Returns:
boolean true if both are equals, or typeId is sub type of parent id.
Throws:
com.wewebu.ow.server.exceptions.OwException - could not find object type or parent object type
Since:
3.2.0.0

getCurrentObjectId

protected String getCurrentObjectId(com.wewebu.ow.server.ecm.OwObject object_p)
                             throws com.wewebu.ow.server.exceptions.OwException
Helper method to get the correct object id, which is used in move operation (like latest object id, to avoid errors for version dependent filing).

Parameters:
object_p - OwObject to be moved
Returns:
String id which should be used for move operation
Throws:
com.wewebu.ow.server.exceptions.OwException - if could not retrieve corresponding id
Since:
3.2.0.0


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.