com.wewebu.ow.server.ecm
Class OwStandardVirtualFolderObjectFactory

java.lang.Object
  extended by com.wewebu.ow.server.ecm.OwStandardVirtualFolderObjectFactory
All Implemented Interfaces:
OwObject, OwObjectReference, OwVirtualFolderObject, OwVirtualFolderObjectFactory, OwFieldProvider

public class OwStandardVirtualFolderObjectFactory
extends Object
implements OwVirtualFolderObjectFactory, OwVirtualFolderObject

Base Class for virtual folder objects.
Folder Objects can contain other objects like documents and sub folders. They can be real physical folders or virtual search based folders. OwVitualFolderObject implements a search based virtual folder, which is feed by a XML description. Both virtual and real folders are treated the same way.
Virtual Folders are made up of Searches. I.e. each node creates a OwSearchNode Object which result list acts as the nodes objects.

To be implemented with the specific ECM system.

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


Nested Class Summary
static class OwStandardVirtualFolderObjectFactory.OwVirtualFolderObjectClass
           ObjectClass of virtual folder.
protected static class OwStandardVirtualFolderObjectFactory.OwVirtualFolderRefineCriteria
           Tuple of criteria name and value to refine a search criteria.
 
Field Summary
protected  OwObjectCollection m_folderChilds
          cached child list
protected  String m_nodePath
          the path to the currently opened sub folder
protected  String m_objectPath
          the path to the currently opened sub folder
protected  OwXMLUtil m_OpenFolderNode
          the OwXMLUtil wrapped DOM node of the currently opened sub folder
protected  OwStandardVirtualFolderObjectFactory m_parent
          parent
protected  OwPropertyCollection m_PropertyMap
          map containing the properties of the virtual folder object
protected  List m_refinementCriteriaList
          a List of criteria to refine this node
protected  OwRepository m_repository
          reference to the repository
protected  Node m_rootNode
          root node describing the virtual folder
protected  OwSearchTemplate m_SearchTemplate
          search template to use for this node, can be null
protected  Set m_searchTemplateRefinementCriteriaNameSet
          a set of criteria names to refine the search template
protected static OwStandardVirtualFolderObjectFactory.OwVirtualFolderObjectClass m_StandardClassDescription
          the one and only class description for the virtual folder objects
protected  String m_strDMSID
          ID of virtual folder used in getDMSID to recreate the folder
static String MIME_TYPE
          the MIME type of the virtual folder
protected static String NODE_ATTRIBUTE_CONTAINS_DOCUMENTS
          name of the containing documents attribute flag
protected static String NODE_ATTRIBUTE_NAME
          name of the for the name attribute
protected static String NODE_TAG_NAME
          name of the node tag
protected static String REFINE_CRITERIA_NODE_TAG_NAME
          node name of the refine criteria node
protected static String SEARCH_NODE_TAG_NAME
          node name of the search node
 
Fields inherited from interface com.wewebu.ow.server.ecm.OwVirtualFolderObjectFactory
CLASSNAME_TAG_NAME, ROOT_NODE_TAG_NAME
 
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
OwStandardVirtualFolderObjectFactory()
          Empty default constructor.
 
Method Summary
 void add(OwObject oObject_p)
          adds a object reference to this parent object / folder
 boolean canAdd(OwObject oObject_p, int iContext_p)
          checks if object supports add function
 boolean canChangeClass()
          check if object can change its class
 boolean canDelete(int iContext_p)
          check if object can be deleted
 boolean canFilterChilds()
          check if the FilterCriteria_p in getChilds is possible NOTE: The FilterCriteria_p parameter in getChilds is an additional filter to the internal SearchTemplate used in the getSearchTemplate(...) function The internal SearchTemplate used in the getSearchTemplate(...) is used for virtual folders, the FilterCriteria_p is used to refine the result of a node
 boolean canGetContent(int iContentType_p, int iContext_p)
          check if content retrieval is allowed
 boolean canGetPermissions()
          check if permissions are accessible
 boolean canGetProperties(int iContext_p)
          check if property retrieval is allowed
 boolean canLock()
          check if object supports lock mechanism
 boolean canMove(OwObject oObject_p, OwObject oldParent_p, int iContext_p)
          check if move operation is allowed
 boolean canRemoveReference(OwObject oObject_p, int iContext_p)
          checks if the reference can be removed this object needs to be parent of given object, and user needs to have sufficient access rights
 boolean canSetContent(int iContentType_p, int iContext_p)
          check if content can be set on this document with setContent
 boolean canSetPermissions()
          check if permissions can be set
 boolean canSetProperties(int iContext_p)
          check if object allows to set / change properties
 void changeClass(String strNewClassName_p, OwPropertyCollection properties_p, OwPermissionCollection permissions_p)
          change the class of the object
protected  boolean compatibleObjectClasses(OwClass classInfo_p, OwObjectClass objectClass_p)
          (overridable) Checks whether two given class descriptions (an OwClass and an OwObjectClass) are compatible in the context of this virtual folder.
protected  OwStandardVirtualFolderObjectFactory createNewSubfolderInstance()
          (overridable) create a virtual folder object, used internally in getChilds
protected  void createProperties(String strName_p)
          (overridable) create all properties of the file.
protected  OwSearchTemplate createSearchTemplate(Node searchNode_p, String sResourceName_p)
          overridable factory method
 void delete()
          delete object and all references from DB
 int getChildCount(int[] iObjectTypes_p, int iContext_p)
          get the number of children
 OwObjectCollection getChilds(int[] iObjectTypes_p, Collection propertyNames_p, OwSort sort_p, int iMaxSize_p, int iVersionSelection_p, OwSearchNode filterCriteria_p)
          get the children of the object.
 OwObjectCollection getChilds(OwSearchNode search_p, int[] iObjectTypes_p, Collection propertyNames_p, OwSort sort_p, int iMaxSize_p, int iVersionSelection_p, OwSearchNode filterCriteria_p)
          get the children of the object.
 String getClassName()
          get the class name of the object, the class names are defined by the ECM System
 OwPermissionCollection getClonedPermissions()
          get the cloned permissions
 OwPropertyCollection getClonedProperties(Collection strPropertyNames_p)
          retrieve the specified properties from the object as a copy NOTE: The returned collection might contain more Properties than requested with PropertyNames_p

NOTE: if the properties where not already obtained from the archive (e.g.
 Collection getColumnInfoList()
          get the column info list that describes the columns for the child list
 OwContentCollection getContentCollection()
          get the content of the object
 OwNetworkContext getContext()
          get context
 String getDMSID()
          get the ECM specific ID of the Object.
 OwField getField(String strFieldClassName_p)
          implementation of the OwFieldProvider interface get a field with the given field definition class name
 String getFieldProviderName()
          get a name that identifies the field provider, can be used to create ID's
 Object getFieldProviderSource()
          get the source object that originally provided the fields.
 int getFieldProviderType()
          get the type of field provider as defined with TYPE_...
 Collection getFields()
          get all the properties in the form
 Collection getFilterProperties(Collection propertynames_p)
          get a collection of OwFieldDefinition's for a given list of names
protected  OwObjectCollection getFolderChilds()
           
 String getID()
          get Object symbolic name of the object which is unique among its siblings used for path construction
 OwObject getInstance()
          get a instance from this reference
 OwVirtualFolderObject getInstance(String strDmsIDPart_p)
          get a folder instance from the factory with the given DMSID part.
 boolean getLock(int iContext_p)
          get the lock state of the object
 String getLockUserID(int iContext_p)
          get the lock user of the object
 String getMIMEParameter()
          get the additional MIME Parameter of the Object
 String getMIMEType()
          get the MIME type of the Object
 boolean getMyLock(int iContext_p)
          get the lock state of the object for the CURRENTLY logged on user
 String getName()
          get Object name property string
 Object getNativeObject()
          get the native object from the ECM system WARNING: The returned object is Opaque.
 OwObjectClass getObjectClass()
          get the class description of the object, the class descriptions are defined by the ECM System
 int getPageCount()
          retrieve the number of pages in the objects
protected  OwStandardVirtualFolderObjectFactory getParent()
          virtual folders have only one parent, easy access to it, rather than using getParents
 OwObjectCollection getParents()
          get the containing parent of this object, does NOT cache returned objects
 String getPath()
          get the path to the object, which can be used in OwNetwork.getObjectFromPath to recreate the object The path is build with the name property.
 OwPermissionCollection getPermissions()
          get the permissions object
 Map getPropagationMap()
          Return a map which represents external triggered value propagation.
 OwPropertyCollection getProperties(Collection propertyNames_p)
          retrieve the specified properties from the object.
 OwProperty getProperty(String strPropertyName_p)
          retrieve the specified property from the object.
protected  List getRefineCriteriaList()
          get from the given node, a list of criteria to refine the search template
protected  OwSearchNode getRefinedSearch(OwSearchNode search_p, List refineList_p)
          refine a search according to the given refine criteria list
 OwRepository getRepository()
          get repository
 OwResource getResource()
          get the resource the object belongs to in a multiple resource Network
 String getResourceID()
          get the ID / name identifying the resource the object belongs to
protected  Node getRootNode()
          get the root DOM Node of the folder structure
protected  OwStandardVirtualFolderObjectFactory getRootObject()
          get the root virtual folder object
 Object getSafeFieldValue(String sName_p, Object defaultvalue_p)
          retrieve the value of a Field
 OwSearchTemplate getSearchTemplate()
          get a search template associated with this Object The search from the template can be used to refine the result in getChilds(...) ==> The search is automatically performed when calling getChilds(...) The ColumnInfoList from the template can be used to format the result list of the children NOTE: This function is especially used in virtual folders
protected  Set getSearchTemplateRefineCriteriaNameSet()
          get from the whole search template, a list of criteria to refine the search template
protected  Node getSubNode(String strPath_p)
          retrieve a sub DOM Node from the structure XML document using a string path
 int getType()
          get Object type
 OwVersion getVersion()
          get the current version object
 OwVersionSeries getVersionSeries()
          get the version series object to this object, if the object is versionable
 String getVirtualFolderName()
          Retrieve the name of the virtual folder template used for constructing this object as defined in the bootstrap SemiVirtualRecordClass configurations.
 boolean hasChilds(int[] iObjectTypes_p, int iContext_p)
          check if object has children
 boolean hasContent(int iContext_p)
          check if the object contains a content, which can be retrieved using getContentCollection
 boolean hasVersionSeries()
          check if a version series object is available, i.e.
 void init(OwNetworkContext context_p, OwRepository repository_p, String strBaseDMSID_p, String virtualFolderName_p, Node rootNode_p)
          init a virtual folder object
 boolean isRoot()
          check if this is the root folder
 void move(OwObject oObject_p, OwObject oldParent_p)
          moves a object reference to this parent object (folder)
 void refreshProperties()
          refresh the property cache
 void refreshProperties(Collection props_p)
          refresh the property cache
 void removeReference(OwObject oObject_p)
          removes the reference of the given object from this object (folder) this object needs to be parent of given object
protected  Object resolveLiteralPlaceholder(String contextname_p, String placeholdername_p)
          (overridable) resolve the given literal placeholder name to a property / criteria value
protected  Object resolveLiteralValue(String contextname_p, OwFieldDefinition propClass_p, Node literal_p)
          resolve the given literal node to a property / criteria value
protected  void scanSearchNode(Node searchDOMNode_p)
          Recursively traverse the DOM nodes of the search template to collect refine criteria names.
 void setContentCollection(OwContentCollection content_p)
          set the content to the object
 void setField(String sName_p, Object value_p)
          modify a Field value, but does not save the value right away
 void setFiledObjectProperties(OwObjectClass objectClass_p, OwPropertyCollection properties_p)
          modify the properties of an object to meet the criteria list of this virtual folders search template This method is used to add documents to a virtual folder.
 boolean setLock(boolean fLock_p)
          lock / unlock object, make it unaccessible for other users
 void setPermissions(OwPermissionCollection permissions_p)
          set the permissions object
 void setPropagationMap(Map propagationMap)
          Set a map which defines an external triggered value propagation.
 void setProperties(OwPropertyCollection properties_p)
          set the properties in the object
 void setProperties(OwPropertyCollection properties_p, Object mode_p)
          set the properties in the object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIME_TYPE

public static final String MIME_TYPE
the MIME type of the virtual folder

See Also:
Constant Field Values

NODE_ATTRIBUTE_CONTAINS_DOCUMENTS

protected static final String NODE_ATTRIBUTE_CONTAINS_DOCUMENTS
name of the containing documents attribute flag

See Also:
Constant Field Values

NODE_ATTRIBUTE_NAME

protected static final String NODE_ATTRIBUTE_NAME
name of the for the name attribute

See Also:
Constant Field Values

NODE_TAG_NAME

protected static final String NODE_TAG_NAME
name of the node tag

See Also:
Constant Field Values

SEARCH_NODE_TAG_NAME

protected static final String SEARCH_NODE_TAG_NAME
node name of the search node

See Also:
Constant Field Values

REFINE_CRITERIA_NODE_TAG_NAME

protected static final String REFINE_CRITERIA_NODE_TAG_NAME
node name of the refine criteria node

See Also:
Constant Field Values

m_StandardClassDescription

protected static final OwStandardVirtualFolderObjectFactory.OwVirtualFolderObjectClass m_StandardClassDescription
the one and only class description for the virtual folder objects


m_folderChilds

protected OwObjectCollection m_folderChilds
cached child list


m_parent

protected OwStandardVirtualFolderObjectFactory m_parent
parent


m_repository

protected OwRepository m_repository
reference to the repository


m_rootNode

protected Node m_rootNode
root node describing the virtual folder


m_PropertyMap

protected OwPropertyCollection m_PropertyMap
map containing the properties of the virtual folder object


m_nodePath

protected String m_nodePath
the path to the currently opened sub folder


m_objectPath

protected String m_objectPath
the path to the currently opened sub folder


m_OpenFolderNode

protected OwXMLUtil m_OpenFolderNode
the OwXMLUtil wrapped DOM node of the currently opened sub folder


m_strDMSID

protected String m_strDMSID
ID of virtual folder used in getDMSID to recreate the folder


m_SearchTemplate

protected OwSearchTemplate m_SearchTemplate
search template to use for this node, can be null


m_refinementCriteriaList

protected List m_refinementCriteriaList
a List of criteria to refine this node


m_searchTemplateRefinementCriteriaNameSet

protected Set m_searchTemplateRefinementCriteriaNameSet
a set of criteria names to refine the search template

Constructor Detail

OwStandardVirtualFolderObjectFactory

public OwStandardVirtualFolderObjectFactory()
Empty default constructor. Use init-method to initialize

Method Detail

init

public void init(OwNetworkContext context_p,
                 OwRepository repository_p,
                 String strBaseDMSID_p,
                 String virtualFolderName_p,
                 Node rootNode_p)
          throws Exception
Description copied from interface: OwVirtualFolderObjectFactory
init a virtual folder object

Specified by:
init in interface OwVirtualFolderObjectFactory
Parameters:
context_p - OwNetworkContext
repository_p - OwRepository
strBaseDMSID_p - String name to identify the virtual folder by the DMSID, to be extended by instance part (see getInstance)
virtualFolderName_p - name of the virtual folder
rootNode_p - Node XML root node describing the virtual folder
Throws:
Exception

createNewSubfolderInstance

protected OwStandardVirtualFolderObjectFactory createNewSubfolderInstance()
                                                                   throws Exception
(overridable) create a virtual folder object, used internally in getChilds

Returns:
OwStandardVirtualFolderObjectFactory
Throws:
Exception

getContext

public OwNetworkContext getContext()
get context


getRepository

public OwRepository getRepository()
get repository


getRootNode

protected Node getRootNode()
                    throws Exception
get the root DOM Node of the folder structure

Returns:
DOM Node
Throws:
Exception

getSubNode

protected Node getSubNode(String strPath_p)
                   throws Exception
retrieve a sub DOM Node from the structure XML document using a string path

Parameters:
strPath_p - String path to the sub node
Throws:
Exception

createProperties

protected void createProperties(String strName_p)
                         throws Exception
(overridable) create all properties of the file. There are so little, we just load all at once

Parameters:
strName_p - String the name to set the name property
Throws:
Exception

isRoot

public boolean isRoot()
               throws Exception
check if this is the root folder

Throws:
Exception

getName

public String getName()
get Object name property string

Specified by:
getName in interface OwObjectReference
Returns:
the name property string of the object

getID

public String getID()
get Object symbolic name of the object which is unique among its siblings used for path construction

Specified by:
getID in interface OwObjectReference
Returns:
the symbolic name of the object which is unique among its siblings

getRefineCriteriaList

protected List getRefineCriteriaList()
                              throws Exception
get from the given node, a list of criteria to refine the search template

Returns:
Set of RefineCriteria
Throws:
Exception

getSearchTemplateRefineCriteriaNameSet

protected Set getSearchTemplateRefineCriteriaNameSet()
                                              throws Exception
get from the whole search template, a list of criteria to refine the search template

Returns:
Set of OwVirtualFolderRefineCriteria
Throws:
Exception

scanSearchNode

protected void scanSearchNode(Node searchDOMNode_p)
                       throws Exception
Recursively traverse the DOM nodes of the search template to collect refine criteria names.

Parameters:
searchDOMNode_p - node to traverse further
Throws:
Exception

getRefinedSearch

protected OwSearchNode getRefinedSearch(OwSearchNode search_p,
                                        List refineList_p)
                                 throws Exception
refine a search according to the given refine criteria list

Parameters:
search_p - OwSearchNode to refine
refineList_p - List of OwVirtualFolderRefineCriteria for refinement
Returns:
OwSearchNode refined search
Throws:
Exception

resolveLiteralValue

protected Object resolveLiteralValue(String contextname_p,
                                     OwFieldDefinition propClass_p,
                                     Node literal_p)
                              throws Exception
resolve the given literal node to a property / criteria value

Parameters:
contextname_p -
propClass_p -
literal_p -
Returns:
an Object
Throws:
Exception

resolveLiteralPlaceholder

protected Object resolveLiteralPlaceholder(String contextname_p,
                                           String placeholdername_p)
                                    throws Exception
(overridable) resolve the given literal placeholder name to a property / criteria value

Parameters:
contextname_p - String name of calling context, e.g. search template name
placeholdername_p - String name of placeholder to retrieve value for
Returns:
an Object
Throws:
Exception

getClassName

public String getClassName()
get the class name of the object, the class names are defined by the ECM System

Specified by:
getClassName in interface OwObject
Returns:
class name of object class

getObjectClass

public OwObjectClass getObjectClass()
get the class description of the object, the class descriptions are defined by the ECM System

Specified by:
getObjectClass in interface OwObject
Returns:
class description name of object class

getRootObject

protected OwStandardVirtualFolderObjectFactory getRootObject()
                                                      throws Exception
get the root virtual folder object

Returns:
OwStandardVirtualFolderObjectFactory
Throws:
Exception

getParent

protected OwStandardVirtualFolderObjectFactory getParent()
                                                  throws Exception
virtual folders have only one parent, easy access to it, rather than using getParents

Returns:
OwObject
Throws:
Exception

getParents

public OwObjectCollection getParents()
                              throws Exception
get the containing parent of this object, does NOT cache returned objects

Specified by:
getParents in interface OwObject
Returns:
Parent Object, or null if object does not have any parents
Throws:
Exception

getChilds

public OwObjectCollection getChilds(int[] iObjectTypes_p,
                                    Collection propertyNames_p,
                                    OwSort sort_p,
                                    int iMaxSize_p,
                                    int iVersionSelection_p,
                                    OwSearchNode filterCriteria_p)
                             throws Exception
get the children of the object. NOTE: Physical folders do not cache the returned objects, virtual folders do, because they are all based on identical objects For Compound Documents returns the list of contained documents For Folders returns the list of sub folders

Specified by:
getChilds in interface OwObject
Parameters:
iObjectTypes_p - the requested object types (folder or document)
propertyNames_p - properties to fetch from ECM system along with the children, can be null.
sort_p - OwSort sort criteria list to sort return list
iMaxSize_p - int maximum number of objects to retrieve
iVersionSelection_p - int Selects the versions as defined in OwSearchTemplate.VERSION_SELECT_...
filterCriteria_p - optional OwSearchNode to filter the children, can be null NOTE: This parameter is an additional filter to the internal SearchTemplate used in the getSearchTemplate(...) function The internal SearchTemplate used in the getSearchTemplate(...) is used for virtual folders, the FilterCriteria_p is used to refine the result of a node
Returns:
list of child objects, or null
Throws:
Exception

getFolderChilds

protected OwObjectCollection getFolderChilds()
                                      throws Exception
Throws:
Exception

getChilds

public OwObjectCollection getChilds(OwSearchNode search_p,
                                    int[] iObjectTypes_p,
                                    Collection propertyNames_p,
                                    OwSort sort_p,
                                    int iMaxSize_p,
                                    int iVersionSelection_p,
                                    OwSearchNode filterCriteria_p)
                             throws Exception
get the children of the object. NOTE: Physical folders do not cache the returned objects, virtual folders do, because they are all based on identical objects For Compound Documents returns the list of contained documents For Folders returns the list of sub folders

Parameters:
search_p - OwSearchNode to use for virtual search
iObjectTypes_p - the requested object types (folder or document)
propertyNames_p - properties to fetch from ECM system along with the children, can be null.
sort_p - OwSort sort criteria list to sort return list
iMaxSize_p - int maximum number of objects to retrieve
iVersionSelection_p - int Selects the versions as defined in OwSearchTemplate.VERSION_SELECT_...
filterCriteria_p - optional OwSearchNode to filter the children, can be null NOTE: This parameter is an additional filter to the internal SearchTemplate used in the getSearchTemplate(...) function The internal SearchTemplate used in the getSearchTemplate(...) is used for virtual folders, the FilterCriteria_p is used to refine the result of a node
Returns:
list of child objects, or null
Throws:
Exception

compatibleObjectClasses

protected boolean compatibleObjectClasses(OwClass classInfo_p,
                                          OwObjectClass objectClass_p)
(overridable) Checks whether two given class descriptions (an OwClass and an OwObjectClass) are compatible in the context of this virtual folder.
This default implementation compares the names of the two descriptions ignoring case.

Parameters:
classInfo_p -
objectClass_p -
Returns:
true if the given OwObjectClass is virtually compatible with the given OwClass
false otherwise
Since:
2.5.2.0

setFiledObjectProperties

public void setFiledObjectProperties(OwObjectClass objectClass_p,
                                     OwPropertyCollection properties_p)
                              throws Exception
modify the properties of an object to meet the criteria list of this virtual folders search template This method is used to add documents to a virtual folder. Since the contents of a virtual folder is the result of a search template, a file in a virtual folder must meet all criteria of this search template.

Specified by:
setFiledObjectProperties in interface OwVirtualFolderObject
Parameters:
objectClass_p - OwObjectClass of the new document
properties_p - OwPropertyCollection to be modified
Throws:
Exception

canFilterChilds

public boolean canFilterChilds()
                        throws Exception
check if the FilterCriteria_p in getChilds is possible NOTE: The FilterCriteria_p parameter in getChilds is an additional filter to the internal SearchTemplate used in the getSearchTemplate(...) function The internal SearchTemplate used in the getSearchTemplate(...) is used for virtual folders, the FilterCriteria_p is used to refine the result of a node

Specified by:
canFilterChilds in interface OwObject
Returns:
true = filter children with FilterCriteria_p is possible, false = filter is not possible / ignored
Throws:
Exception

getFilterProperties

public Collection getFilterProperties(Collection propertynames_p)
                               throws Exception
get a collection of OwFieldDefinition's for a given list of names

Specified by:
getFilterProperties in interface OwObject
Parameters:
propertynames_p - Collection of property names the client wants to use as filter properties or null to retrieve all possible filter properties
Returns:
Collection of OwFieldDefinition's that can actually be filtered, may be a subset of propertynames_p, or null if no filter properties are allowed
Throws:
Exception

getVersionSeries

public OwVersionSeries getVersionSeries()
                                 throws Exception
get the version series object to this object, if the object is versionable

Specified by:
getVersionSeries in interface OwObject
Returns:
a list of object versions
Throws:
Exception

hasVersionSeries

public boolean hasVersionSeries()
                         throws Exception
check if a version series object is available, i.e. the object is versionable

Specified by:
hasVersionSeries in interface OwObject
Returns:
true if object is versionable
Throws:
Exception

getVersion

public OwVersion getVersion()
                     throws Exception
get the current version object

Specified by:
getVersion in interface OwObject
Returns:
OwVersion Object identifying the currently set version, or null if versions not supported
Throws:
Exception

getType

public int getType()
get Object type

Specified by:
getType in interface OwObjectReference
Returns:
the type of the object

getDMSID

public String getDMSID()
                throws Exception
get the ECM specific ID of the Object. The DMSID is not interpreted by the Workdesk, nor does the Workdesk need to know the syntax. However, it must hold enough information, so that the ECM Adapter is able to reconstruct the Object. The reconstruction is done through OwNetwork.createObjectFromDMSID(...) The Workdesk uses the DMSID to store ObjectReferences as Strings. E.g.: in the task databases.

Specified by:
getDMSID in interface OwObjectReference
Throws:
Exception

getProperty

public OwProperty getProperty(String strPropertyName_p)
                       throws Exception
retrieve the specified property from the object. NOTE: If the property was not already obtained from the archive (e.g. by OwNetwork.doSearch(...,PropertyList)), than the ECM Adapter has to launch a new query. It is therefore best practice to obtain the needed properties in advance in a call to OwNetwork.doSearch(...) ==> Alternatively you can use the getProperties Function to retrieve a whole bunch of properties in one step, making the ECM adaptor use only one new query.

Specified by:
getProperty in interface OwObject
Parameters:
strPropertyName_p - the name of the requested property
Returns:
a property object or null if not found
Throws:
Exception

getProperties

public OwPropertyCollection getProperties(Collection propertyNames_p)
                                   throws Exception
retrieve the specified properties from the object. NOTE: The returned collection might contain more Properties than requested with PropertyNames_p

NOTE: if the properties where not already obtained from the archive (e.g. by OwNetwork.doSearch(...,PropertyList)), than the ECM Adapter has to launch a new query. It is therefore best practice to obtain the needed properties in advance in a call to OwNetwork.doSearch(...)

Specified by:
getProperties in interface OwObject
Parameters:
propertyNames_p - a collection of property names to retrieve, if null all properties are retrieved
Returns:
a property list
Throws:
Exception

getClonedProperties

public OwPropertyCollection getClonedProperties(Collection strPropertyNames_p)
                                         throws Exception
retrieve the specified properties from the object as a copy NOTE: The returned collection might contain more Properties than requested with PropertyNames_p

NOTE: if the properties where not already obtained from the archive (e.g. by OwNetwork.doSearch(...,PropertyList)), than the ECM Adapter has to launch a new query. It is therefore best practice to obtain the needed properties in advance in a call to OwNetwork.doSearch(...)

Specified by:
getClonedProperties in interface OwObject
Parameters:
strPropertyNames_p - a collection of property names to retrieve, if null all properties are retrieved
Returns:
a property list
Throws:
Exception

setProperties

public void setProperties(OwPropertyCollection properties_p)
                   throws Exception
set the properties in the object

Specified by:
setProperties in interface OwObject
Parameters:
properties_p - OwPropertyList list of OwProperties to set
Throws:
Exception

canSetProperties

public boolean canSetProperties(int iContext_p)
                         throws Exception
check if object allows to set / change properties

Specified by:
canSetProperties in interface OwObject
Parameters:
iContext_p - OwStatusContextDefinitions
Returns:
true if allowed
Throws:
Exception

canGetProperties

public boolean canGetProperties(int iContext_p)
                         throws Exception
check if property retrieval is allowed

Specified by:
canGetProperties in interface OwObject
Parameters:
iContext_p - OwStatusContextDefinitions
Returns:
true if allowed
Throws:
Exception

canLock

public boolean canLock()
                throws Exception
check if object supports lock mechanism

Specified by:
canLock in interface OwObject
Returns:
true, if object supports lock, i.e. the setLock function works
Throws:
Exception

setLock

public boolean setLock(boolean fLock_p)
                throws Exception
lock / unlock object, make it unaccessible for other users

Specified by:
setLock in interface OwObject
Parameters:
fLock_p - true to lock it, false to unlock it.
Returns:
the new lock state of the object
Throws:
Exception

getLock

public boolean getLock(int iContext_p)
                throws Exception
get the lock state of the object

Specified by:
getLock in interface OwObject
Parameters:
iContext_p - OwStatusContextDefinitions
Returns:
the lock state of the object
Throws:
Exception

getMyLock

public boolean getMyLock(int iContext_p)
                  throws Exception
get the lock state of the object for the CURRENTLY logged on user

Specified by:
getMyLock in interface OwObject
Parameters:
iContext_p - int value from OwStatusContextDefinitions
Returns:
the lock state of the object
Throws:
Exception

getLockUserID

public String getLockUserID(int iContext_p)
                     throws Exception
get the lock user of the object

Specified by:
getLockUserID in interface OwObject
Parameters:
iContext_p - int value from OwStatusContextDefinitions
Returns:
the User ID of the user who locked the item, or null if it is not locked
Throws:
Exception

canSetContent

public boolean canSetContent(int iContentType_p,
                             int iContext_p)
                      throws Exception
check if content can be set on this document with setContent

Specified by:
canSetContent in interface OwObject
Parameters:
iContentType_p - int designating the type of content (CONTENT_TYPE_DOCUMENT, CONTENT_TYPE_ANNOTATION,...)
iContext_p - OwStatusContextDefinitions
Returns:
true, if content can be set with setContent
Throws:
Exception

canGetContent

public boolean canGetContent(int iContentType_p,
                             int iContext_p)
                      throws Exception
check if content retrieval is allowed

Specified by:
canGetContent in interface OwObject
Parameters:
iContentType_p - int designating the type of content (CONTENT_TYPE_DOCUMENT, CONTENT_TYPE_ANNOTATION,...)
iContext_p - OwStatusContextDefinitions
Returns:
true if allowed
Throws:
Exception

getMIMEType

public String getMIMEType()
                   throws Exception
get the MIME type of the Object

Specified by:
getMIMEType in interface OwObjectReference
Returns:
MIME type as String
Throws:
Exception

getMIMEParameter

public String getMIMEParameter()
                        throws Exception
get the additional MIME Parameter of the Object

Specified by:
getMIMEParameter in interface OwObjectReference
Returns:
MIME parameter as String
Throws:
Exception

delete

public void delete()
            throws Exception
delete object and all references from DB

Specified by:
delete in interface OwObject
Throws:
Exception

canDelete

public boolean canDelete(int iContext_p)
                  throws Exception
check if object can be deleted

Specified by:
canDelete in interface OwObject
Parameters:
iContext_p - OwStatusContextDefinitions
Returns:
true, if delete operation works on object
Throws:
Exception

removeReference

public void removeReference(OwObject oObject_p)
                     throws Exception
removes the reference of the given object from this object (folder) this object needs to be parent of given object

Specified by:
removeReference in interface OwObject
Parameters:
oObject_p - OwObject reference to be removed from this object (folder)
Throws:
Exception

canRemoveReference

public boolean canRemoveReference(OwObject oObject_p,
                                  int iContext_p)
                           throws Exception
checks if the reference can be removed this object needs to be parent of given object, and user needs to have sufficient access rights

Specified by:
canRemoveReference in interface OwObject
Parameters:
oObject_p - OwObject reference to be checked upon
iContext_p - OwStatusContextDefinitions
Returns:
true, if given OwObject reference can be removed from this object (folder)
Throws:
Exception

add

public void add(OwObject oObject_p)
         throws Exception
adds a object reference to this parent object / folder

Specified by:
add in interface OwObject
Parameters:
oObject_p - OwObject reference to add to
Throws:
Exception

canAdd

public boolean canAdd(OwObject oObject_p,
                      int iContext_p)
               throws Exception
checks if object supports add function

Specified by:
canAdd in interface OwObject
Parameters:
oObject_p - OwObject reference to be added
iContext_p - int representing one of the OwStatusContextDefinitions
Returns:
true if object supports add function
Throws:
Exception

move

public void move(OwObject oObject_p,
                 OwObject oldParent_p)
          throws Exception
moves a object reference to this parent object (folder)

Specified by:
move in interface OwObject
Parameters:
oObject_p - OwObject reference to add to
oldParent_p - OwObject Old Parent to remove from, used for move operation, can be null
Throws:
Exception

canMove

public boolean canMove(OwObject oObject_p,
                       OwObject oldParent_p,
                       int iContext_p)
                throws Exception
check if move operation is allowed

Specified by:
canMove in interface OwObject
Parameters:
oObject_p - OwObject reference to add to
oldParent_p - OwObject Old Parent to remove from, used for move operation, can be null
iContext_p - int representing one of OwStatusContextDefinitions
Throws:
Exception

getSearchTemplate

public OwSearchTemplate getSearchTemplate()
                                   throws Exception
get a search template associated with this Object The search from the template can be used to refine the result in getChilds(...) ==> The search is automatically performed when calling getChilds(...) The ColumnInfoList from the template can be used to format the result list of the children NOTE: This function is especially used in virtual folders

Specified by:
getSearchTemplate in interface OwObject
Returns:
OwSearchTemplate or null if not defined for the object
Throws:
Exception

createSearchTemplate

protected OwSearchTemplate createSearchTemplate(Node searchNode_p,
                                                String sResourceName_p)
                                         throws Exception
overridable factory method

Parameters:
searchNode_p -
sResourceName_p -
Returns:
an OwSearchTemplate
Throws:
Exception

getColumnInfoList

public Collection getColumnInfoList()
                             throws Exception
get the column info list that describes the columns for the child list

Specified by:
getColumnInfoList in interface OwObject
Returns:
List of OwSearchTemplate.OwObjectColumnInfos, or null if not defined
Throws:
Exception

getPageCount

public int getPageCount()
                 throws Exception
retrieve the number of pages in the objects

Specified by:
getPageCount in interface OwObjectReference
Returns:
number of pages
Throws:
Exception

getResource

public OwResource getResource()
                       throws Exception
get the resource the object belongs to in a multiple resource Network

Specified by:
getResource in interface OwObject
Returns:
OwResource to identify the resource, or null for the default resource
Throws:
Exception

getPermissions

public OwPermissionCollection getPermissions()
                                      throws Exception
get the permissions object

Specified by:
getPermissions in interface OwObject
Returns:
OwPermissionCollection of the object
Throws:
Exception

getClonedPermissions

public OwPermissionCollection getClonedPermissions()
                                            throws Exception
get the cloned permissions

Specified by:
getClonedPermissions in interface OwObject
Returns:
OwPermissionCollection clone of the object
Throws:
Exception

canGetPermissions

public boolean canGetPermissions()
                          throws Exception
check if permissions are accessible

Specified by:
canGetPermissions in interface OwObject
Returns:
true = permissions can be retrieved
Throws:
Exception

canSetPermissions

public boolean canSetPermissions()
                          throws Exception
check if permissions can be set

Specified by:
canSetPermissions in interface OwObject
Returns:
true = permissions can be set
Throws:
Exception

setPermissions

public void setPermissions(OwPermissionCollection permissions_p)
                    throws Exception
set the permissions object

Specified by:
setPermissions in interface OwObject
Parameters:
permissions_p - OwPermissionCollection to set
Throws:
Exception

setContentCollection

public void setContentCollection(OwContentCollection content_p)
                          throws Exception
set the content to the object

Specified by:
setContentCollection in interface OwObject
Parameters:
content_p - OwContentCollection to store in the object
Throws:
Exception

getContentCollection

public OwContentCollection getContentCollection()
                                         throws Exception
get the content of the object

By default this method returns null

Specified by:
getContentCollection in interface OwObject
Returns:
OwContentCollection
Throws:
Exception

refreshProperties

public void refreshProperties()
                       throws Exception
refresh the property cache

Specified by:
refreshProperties in interface OwObject
Throws:
Exception

refreshProperties

public void refreshProperties(Collection props_p)
                       throws Exception
refresh the property cache

Specified by:
refreshProperties in interface OwObject
Parameters:
props_p - Collection of property names to update
Throws:
Exception

getNativeObject

public Object getNativeObject()
                       throws Exception
get the native object from the ECM system WARNING: The returned object is Opaque. Using the native object makes the client dependent on the ECM System

Specified by:
getNativeObject in interface OwObject
Returns:
no native object available
Throws:
Exception

getField

public OwField getField(String strFieldClassName_p)
                 throws Exception,
                        OwObjectNotFoundException
implementation of the OwFieldProvider interface get a field with the given field definition class name

Specified by:
getField in interface OwFieldProvider
Parameters:
strFieldClassName_p - String class name of requested fields
Returns:
OwField or throws OwObjectNotFoundException
Throws:
Exception
OwObjectNotFoundException

getFieldProviderSource

public Object getFieldProviderSource()
get the source object that originally provided the fields. e.g. the field provider might be a template pattern implementation like a view, where the original provider would still be an OwObject

Specified by:
getFieldProviderSource in interface OwFieldProvider
Returns:
Object the original source object where the fields have been taken, can be a this pointer

getFieldProviderType

public int getFieldProviderType()
get the type of field provider as defined with TYPE_...

Specified by:
getFieldProviderType in interface OwFieldProvider

hasContent

public boolean hasContent(int iContext_p)
                   throws Exception
check if the object contains a content, which can be retrieved using getContentCollection

Specified by:
hasContent in interface OwObjectReference
Parameters:
iContext_p - int value from OwStatusContextDefinitions
Returns:
boolean true = object contains content, false = object has no content
Throws:
Exception

hasChilds

public boolean hasChilds(int[] iObjectTypes_p,
                         int iContext_p)
                  throws Exception
check if object has children

Specified by:
hasChilds in interface OwObject
Parameters:
iContext_p - int value from OwStatusContextDefinitions
iObjectTypes_p -
Returns:
true, object has children
Throws:
Exception

getPath

public String getPath()
               throws Exception
get the path to the object, which can be used in OwNetwork.getObjectFromPath to recreate the object The path is build with the name property. Unlike the symbol name and the DMSID, the path is not necessarily unique, but provides a readable information of the objects location.

Specified by:
getPath in interface OwObject
Throws:
Exception

getInstance

public OwVirtualFolderObject getInstance(String strDmsIDPart_p)
                                  throws Exception
get a folder instance from the factory with the given DMSID part. The complete DMSID is strBaseDMSID_p + strDmsIDPart_p (see init(OwNetworkContext, OwRepository, String, String, Node))

Specified by:
getInstance in interface OwVirtualFolderObjectFactory
Parameters:
strDmsIDPart_p - String DMSID part for the instance, or null to get a default virtual folder
Returns:
OwObject
Throws:
Exception

getChildCount

public int getChildCount(int[] iObjectTypes_p,
                         int iContext_p)
                  throws Exception
get the number of children

By default an empty OwStatusContextException is thrown

Specified by:
getChildCount in interface OwObject
Parameters:
iObjectTypes_p - the requested object types (folder or document)
iContext_p - int value from OwStatusContextDefinitions
Returns:
int number of children or throws OwStatusContextException
Throws:
Exception

changeClass

public void changeClass(String strNewClassName_p,
                        OwPropertyCollection properties_p,
                        OwPermissionCollection permissions_p)
                 throws Exception
change the class of the object

Specified by:
changeClass in interface OwObject
Parameters:
strNewClassName_p - String
properties_p - OwPropertyCollection (optional, can be null to set previous properties)
permissions_p - OwPermissionCollection (optional, can be null to set previous permissions)
Throws:
Exception

canChangeClass

public boolean canChangeClass()
                       throws Exception
check if object can change its class

Specified by:
canChangeClass in interface OwObject
Throws:
Exception

getFieldProviderName

public String getFieldProviderName()
get a name that identifies the field provider, can be used to create ID's

Specified by:
getFieldProviderName in interface OwFieldProvider
Returns:
String unique ID / Name of field provider

setField

public void setField(String sName_p,
                     Object value_p)
              throws Exception,
                     OwObjectNotFoundException
modify a Field value, but does not save the value right away

Specified by:
setField in interface OwFieldProvider
Parameters:
sName_p -
value_p -
Throws:
Exception
OwObjectNotFoundException

getSafeFieldValue

public Object getSafeFieldValue(String sName_p,
                                Object defaultvalue_p)
retrieve the value of a Field

Specified by:
getSafeFieldValue in interface OwFieldProvider
Parameters:
sName_p -
defaultvalue_p -
Returns:
Object the value of the Field of defaultvalue_p

getInstance

public OwObject getInstance()
                     throws Exception
get a instance from this reference

Specified by:
getInstance in interface OwObjectReference
Returns:
OwObject or throws OwObjectNotFoundException
Throws:
Exception, - OwObjectNotFoundException
Exception

getResourceID

public String getResourceID()
                     throws Exception
get the ID / name identifying the resource the object belongs to

Specified by:
getResourceID in interface OwObjectReference
Returns:
String ID of resource or throws OwObjectNotFoundException
Throws:
Exception, - OwObjectNotFoundException
Exception
See Also:
OwResource

setProperties

public void setProperties(OwPropertyCollection properties_p,
                          Object mode_p)
                   throws Exception
Description copied from interface: OwObject
set the properties in the object

Specified by:
setProperties in interface OwObject
Parameters:
properties_p - OwPropertyList list of OwProperties to set
mode_p - mode to use or null to use default mode, @see OwObjectClass.getModes(int)
Throws:
Exception

getFields

public Collection getFields()
                     throws Exception
get all the properties in the form

Specified by:
getFields in interface OwFieldProvider
Returns:
Collection of OwField
Throws:
Exception

getPropagationMap

public Map getPropagationMap()
Description copied from interface: OwVirtualFolderObject
Return a map which represents external triggered value propagation. Map is constructed of criteria name (String) and value (Object), can also be null if no propagation map was set.

Specified by:
getPropagationMap in interface OwVirtualFolderObject
Returns:
Map if set, else null
See Also:
OwVirtualFolderObject.setPropagationMap(Map)

setPropagationMap

public void setPropagationMap(Map propagationMap)
Description copied from interface: OwVirtualFolderObject
Set a map which defines an external triggered value propagation. This map will be used to set the search corresponding its definition, and will also be provided to subnodes of current virtual object.

Can be set to null to avoid any external defined propagation.

Specified by:
setPropagationMap in interface OwVirtualFolderObject
Parameters:
propagationMap - Map (String criteria Name, Object value)
See Also:
OwVirtualFolderObject.getPropagationMap()

getVirtualFolderName

public String getVirtualFolderName()
Description copied from interface: OwVirtualFolderObject
Retrieve the name of the virtual folder template used for constructing this object as defined in the bootstrap SemiVirtualRecordClass configurations.

Specified by:
getVirtualFolderName in interface OwVirtualFolderObject
Returns:
the name of the virtual folder template used for constructing this object


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.