public class OwFileObject extends Object implements OwObject, OwContentCollection, OwContentElement, OwPageableObject<OwFileObject>
Implements OwObject for files on the files system. A useful class when working with configuration XML-Files, which can not be stored on the 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
| Modifier and Type | Class and Description |
|---|---|
static class |
OwFileObject.OwFileObjectClass
File documents class definition for the OwFileDocument Object.
|
protected static class |
OwFileObject.OwFilePropertyClass
Property class definition for the OwStandardProperty properties.
|
protected static class |
OwFileObject.OwObjectFileFilter
a file filter that accepts only the given object types array
|
| Modifier and Type | Field and Description |
|---|---|
protected static OwFileObject.OwFileObjectClass |
m_DirectoryClassDescription
the one and only class description for the file objects
|
protected OwEventManager |
m_eventmanager |
protected File |
m_File
reference to the file the object is pointing to
|
protected static OwFileObject.OwFileObjectClass |
m_FileClassDescription
the one and only class description for the file objects
|
protected Locale |
m_locale |
protected OwPropertyCollection |
m_PropertyMap
map containing the properties of the file document object
|
CONTENT_REPRESENTATION_TYPE_NONE, CONTENT_REPRESENTATION_TYPE_OBJECT, CONTENT_REPRESENTATION_TYPE_STREAM, CONTENT_REPRESENTATION_TYPE_URL, CONTENT_REPRESENTATION_TYPE_USER_START, CONTENT_TYPE_ANNOTATION, CONTENT_TYPE_DOCUMENT, CONTENT_TYPE_SECURITY, CONTENT_TYPE_USER_STARTSTANDARD_PATH_DELIMITEROBJECT_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_TRACKERTYPE_AJAX, TYPE_CHECKIN_OBJECT, TYPE_CREATE_OBJECT, TYPE_META_OBJECT, TYPE_RESULT_LIST, TYPE_SEARCH, TYPE_SMALL| Modifier | Constructor and Description |
|---|---|
protected |
OwFileObject()
default constructor for overriding classes
|
|
OwFileObject(OwNetwork<?> network_p,
File file_p)
construct File Object
|
|
OwFileObject(OwNetwork<?> network_p,
File file_p,
String fileName_p)
FileObject where the file (name and extension) is encrypted for security reasons,
and MIME type and file name can be defined separately.
|
|
OwFileObject(OwNetwork network_p,
File file_p,
String fileName_p,
String mimeType_p)
FileObject where the file (name and extension) is encrypted for security reasons,
and MIME type and file name can be defined separately.
|
| Modifier and Type | Method and Description |
|---|---|
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 OwFileObject |
createFileObject(File file_p)
overridable factory method
|
void |
delete()
delete object and all references from DB
|
boolean |
exists() |
int |
getChildCount(int[] iObjectTypes_p,
int iContext_p)
get the number of children
|
OwIterable<OwFileObject> |
getChildren(OwLoadContext filter) |
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, does NOT cache the returned 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 propertyNames_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
|
OwContentElement |
getContentElement(int iContentType_p,
int iPage_p)
get a content element for the given type and page
|
String |
getContentFilePath()
get the file path to the content (optional, only available if content is stored locally)
NOTE: This function is only used for ECM Systems which can only download through files
If a FilePath exists, a stream will also exist.
|
Object |
getContentObject()
get the content object
The content representation is of type Object
|
int |
getContentRepresentation()
get the content representation, which can be either url, stream or object
|
InputStream |
getContentStream(OutputStream out_p)
get the content from the object.
|
Collection |
getContentTypes()
get a list of content types used in this object
|
String |
getContentURL()
get the content URL from the object.
|
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 IDs
|
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
|
File |
getFileObject()
get the internal java file object
|
Collection |
getFilterProperties(Collection propertynames_p)
get a collection of OwFieldDefinition's for a given list of names
|
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
|
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.
|
protected OwNetwork<?> |
getNetwork()
get reference to the network
used internally by the objects
|
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
|
int |
getPageNumber(int lPageIndex_p)
retrieve the page number for the given zero based index
NOTE: the Page numbers might be arbitrary in the collection in order to submit specific page content
|
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
|
OwPropertyCollection |
getProperties(Collection propertyNames_p)
retrieve the specified properties from the object.
|
OwProperty |
getProperty(String strPropertyName_p)
retrieve the specified property from the object.
|
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
|
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
|
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
|
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.
|
boolean |
isInputStreamNative()
check if getContentStream is based on an native InputStream or OutputStream
NOTE: getContentStream must implement for Input- and OutputStream.
|
protected void |
loadProperties()
load all properties of the file.
|
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 |
releaseResources()
method is called e.g.
|
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
|
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
|
boolean |
setLock(boolean fLock_p)
lock / unlock object, make it unaccessible for other users
|
void |
setPermissions(OwPermissionCollection permissions_p)
set the permissions object
|
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
|
protected File m_File
protected OwPropertyCollection m_PropertyMap
protected static final OwFileObject.OwFileObjectClass m_FileClassDescription
protected static final OwFileObject.OwFileObjectClass m_DirectoryClassDescription
protected OwEventManager m_eventmanager
protected Locale m_locale
protected OwFileObject()
throws Exception
Exceptionpublic OwFileObject(OwNetwork<?> network_p, File file_p) throws Exception
network_p - reference to the network Adapterfile_p - reference to the file, the object is working onExceptionpublic OwFileObject(OwNetwork<?> network_p, File file_p, String fileName_p) throws Exception
network_p - OwNetwork to use for localizationfile_p - java.io.File location of the filefileName_p - String file nameExceptionpublic OwFileObject(OwNetwork network_p, File file_p, String fileName_p, String mimeType_p) throws Exception
network_p - OwNetwork to use for localizationfile_p - java.io.File location of the filefileName_p - String file namemimeType_p - String MIME type for this objectExceptionprotected OwNetwork<?> getNetwork()
public File getFileObject()
public boolean exists()
protected void loadProperties()
throws Exception
Exceptionpublic String getName()
getName in interface OwObjectReferencepublic String getID()
getID in interface OwObjectReferencepublic String getClassName()
getClassName in interface OwObjectpublic OwObjectClass getObjectClass()
getObjectClass in interface OwObjectpublic void setContentCollection(OwContentCollection content_p) throws Exception
setContentCollection in interface OwObjectcontent_p - OwContentCollection to store in the objectExceptionpublic String getContentURL() throws Exception
getContentURL in interface OwContentElementExceptionpublic boolean isInputStreamNative()
isInputStreamNative in interface OwContentElementpublic Object getContentObject() throws Exception
getContentObject in interface OwContentElementExceptionpublic int getContentRepresentation()
throws Exception
getContentRepresentation in interface OwContentElementExceptionpublic InputStream getContentStream(OutputStream out_p) throws Exception
getContentStream in interface OwContentElementout_p - optional OutputStream, if set the method writes the OutputStream and returns null, otherwise it returns an InputStreamExceptionpublic boolean canSetContent(int iContentType_p,
int iContext_p)
throws Exception
canSetContent in interface OwObjectiContentType_p - int designating the type of content (CONTENT_TYPE_DOCUMENT,
CONTENT_TYPE_ANNOTATION,...)iContext_p - OwStatusContextDefinitionsExceptionpublic boolean canGetContent(int iContentType_p,
int iContext_p)
throws Exception
canGetContent in interface OwObjectiContentType_p - int designating the type of content (CONTENT_TYPE_DOCUMENT, CONTENT_TYPE_ANNOTATION,...)iContext_p - OwStatusContextDefinitionsExceptionpublic Collection getContentTypes() throws Exception
getContentTypes in interface OwContentCollectionExceptionpublic int getType()
getType in interface OwObjectReferencepublic OwObjectCollection getParents() throws Exception
getParents in interface OwObjectExceptionpublic OwObjectCollection getChilds(int[] iObjectTypes_p, Collection propertyNames_p, OwSort sort_p, int iMaxSize_p, int iVersionSelection_p, OwSearchNode filterCriteria_p) throws Exception
getChilds in interface OwObjectiObjectTypes_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 Sortcriteria list to sort return listiMaxSize_p - int maximum number of objects to retrieveiVersionSelection_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 nodeExceptionprotected OwFileObject createFileObject(File file_p) throws Exception
file_p - OwFileObjectExceptionpublic boolean canFilterChilds()
throws Exception
canFilterChilds in interface OwObjectExceptionpublic Collection getFilterProperties(Collection propertynames_p) throws Exception
getFilterProperties in interface OwObjectpropertynames_p - Collection of property names the client wants to use as filter properties or null to retrieve all possible filter propertiesExceptionpublic OwVersionSeries getVersionSeries() throws Exception
getVersionSeries in interface OwObjectExceptionpublic boolean hasVersionSeries()
throws Exception
hasVersionSeries in interface OwObjectExceptionpublic OwVersion getVersion() throws Exception
getVersion in interface OwObjectExceptionpublic String getMIMEType() throws Exception
getMIMEType in interface OwContentElementgetMIMEType in interface OwObjectReferenceExceptionpublic String getMIMEParameter() throws Exception
getMIMEParameter in interface OwContentElementgetMIMEParameter in interface OwObjectReferenceExceptionpublic String getDMSID() throws Exception
getDMSID in interface OwObjectReferenceExceptionpublic OwProperty getProperty(String strPropertyName_p) throws Exception
getProperty in interface OwObjectstrPropertyName_p - the name of the requested propertyExceptionpublic OwPropertyCollection getProperties(Collection propertyNames_p) throws Exception
getProperties in interface OwObjectpropertyNames_p - a collection of property names to retrieve, if null all properties are retrievedExceptionpublic OwPropertyCollection getClonedProperties(Collection propertyNames_p) throws Exception
getClonedProperties in interface OwObjectpropertyNames_p - a collection of property names to retrieve, if null all properties are retrievedExceptionpublic void setProperties(OwPropertyCollection properties_p) throws Exception
setProperties in interface OwObjectproperties_p - OwPropertyList list of OwProperties to setExceptionpublic boolean canSetProperties(int iContext_p)
throws Exception
canSetProperties in interface OwObjectiContext_p - OwStatusContextDefinitionsExceptionpublic boolean canGetProperties(int iContext_p)
throws Exception
canGetProperties in interface OwObjectiContext_p - OwStatusContextDefinitionsExceptionpublic boolean canLock()
throws Exception
public boolean setLock(boolean fLock_p)
throws Exception
public boolean getLock(int iContext_p)
throws Exception
public boolean getMyLock(int iContext_p)
throws Exception
getMyLock in interface OwObjectiContext_p - as defined in OwStatusContextDefinitionsExceptionpublic String getLockUserID(int iContext_p) throws Exception
getLockUserID in interface OwObjectiContext_p - as defined in OwStatusContextDefinitionsExceptionpublic void delete()
throws Exception
public boolean canDelete(int iContext_p)
throws Exception
public void removeReference(OwObject oObject_p) throws Exception
removeReference in interface OwObjectoObject_p - OwObject reference to be removed from this object (folder)Exceptionpublic boolean canRemoveReference(OwObject oObject_p, int iContext_p) throws Exception
canRemoveReference in interface OwObjectoObject_p - OwObject reference to be checked uponiContext_p - OwStatusContextDefinitionsExceptionpublic void add(OwObject oObject_p) throws Exception
public boolean canAdd(OwObject oObject_p, int iContext_p) throws Exception
public void move(OwObject oObject_p, OwObject oldParent_p) throws Exception
public boolean canMove(OwObject oObject_p, OwObject oldParent_p, int iContext_p) throws Exception
public OwSearchTemplate getSearchTemplate() throws Exception
getSearchTemplate in interface OwObjectExceptionpublic Collection getColumnInfoList() throws Exception
getColumnInfoList in interface OwObjectExceptionpublic int getPageNumber(int lPageIndex_p)
throws Exception
getPageNumber in interface OwContentElementlPageIndex_p - zero based page index for the pages in the collectionExceptionpublic int getPageCount()
throws Exception
getPageCount in interface OwContentCollectiongetPageCount in interface OwObjectReferenceExceptionpublic OwResource getResource() throws Exception
getResource in interface OwObjectExceptionpublic OwPermissionCollection getPermissions() throws Exception
getPermissions in interface OwObjectExceptionpublic OwPermissionCollection getClonedPermissions() throws Exception
getClonedPermissions in interface OwObjectExceptionpublic boolean canGetPermissions()
throws Exception
canGetPermissions in interface OwObjectExceptionpublic boolean canSetPermissions()
throws Exception
canSetPermissions in interface OwObjectExceptionpublic void setPermissions(OwPermissionCollection permissions_p) throws Exception
setPermissions in interface OwObjectpermissions_p - OwPermissionCollection to setExceptionpublic OwContentCollection getContentCollection() throws Exception
getContentCollection in interface OwObjectExceptionpublic void refreshProperties()
throws Exception
refreshProperties in interface OwObjectExceptionpublic void refreshProperties(Collection props_p) throws Exception
refreshProperties in interface OwObjectprops_p - Collection of property names to updateExceptionpublic Object getNativeObject() throws Exception
getNativeObject in interface OwObjectExceptionpublic OwField getField(String strFieldClassName_p) throws Exception, OwObjectNotFoundException
getField in interface OwFieldProviderstrFieldClassName_p - String class name of requested fieldsExceptionOwObjectNotFoundExceptionpublic Object getFieldProviderSource()
getFieldProviderSource in interface OwFieldProviderpublic int getFieldProviderType()
getFieldProviderType in interface OwFieldProviderpublic boolean hasContent(int iContext_p)
throws Exception
hasContent in interface OwObjectReferenceiContext_p - as defined in OwStatusContextDefinitionsExceptionpublic String getContentFilePath() throws Exception
getContentFilePath in interface OwContentElementExceptionpublic boolean hasChilds(int[] iObjectTypes_p,
int iContext_p)
throws Exception
hasChilds in interface OwObjectiContext_p - as defined in OwStatusContextDefinitionsiObjectTypes_p - the requested object types (folder or document)Exceptionpublic String getPath() throws Exception
public void releaseResources()
OwContentElementreleaseResources in interface OwContentElementOwContentElement.releaseResources()public int getChildCount(int[] iObjectTypes_p,
int iContext_p)
throws Exception
getChildCount in interface OwObjectiObjectTypes_p - the requested object types (folder or document)iContext_p - as defined in OwStatusContextDefinitionsExceptionpublic void changeClass(String strNewClassName_p, OwPropertyCollection properties_p, OwPermissionCollection permissions_p) throws Exception
changeClass in interface OwObjectstrNewClassName_p - Stringproperties_p - OwPropertyCollection (optional, can be null to set previous properties)permissions_p - OwPermissionCollection (optional, can be null to set previous permissions)Exceptionpublic boolean canChangeClass()
throws Exception
canChangeClass in interface OwObjectExceptionpublic String getFieldProviderName()
getFieldProviderName in interface OwFieldProviderpublic void setField(String sName_p, Object value_p) throws Exception, OwObjectNotFoundException
setField in interface OwFieldProvidersName_p - value_p - ExceptionOwObjectNotFoundExceptionpublic Object getSafeFieldValue(String sName_p, Object defaultvalue_p)
getSafeFieldValue in interface OwFieldProvidersName_p - defaultvalue_p - public Collection getFields() throws Exception
getFields in interface OwFieldProviderExceptionpublic OwContentElement getContentElement(int iContentType_p, int iPage_p) throws Exception
getContentElement in interface OwContentCollectioniContentType_p - intiPage_p - intExceptionpublic OwObject getInstance() throws Exception
getInstance in interface OwObjectReferenceException, - OwObjectNotFoundExceptionExceptionpublic String getResourceID() throws Exception
getResourceID in interface OwObjectReferenceException, - OwObjectNotFoundExceptionExceptionOwResourcepublic void setProperties(OwPropertyCollection properties_p, Object mode_p) throws Exception
OwObjectsetProperties in interface OwObjectproperties_p - OwPropertyList list of OwProperties to setmode_p - mode to use or null to use default mode, @see OwObjectClass.getModes(int)Exceptionpublic OwIterable<OwFileObject> getChildren(OwLoadContext filter) throws OwException
getChildren in interface OwPageableObject<OwFileObject>OwExceptionCopyright © 2014 Alfresco Business Solutions. All Rights Reserved.