it.sistematica.isharedoc.opencmis.indatabase.storedobj.impl
Class AbstractSingleFilingImpl

java.lang.Object
  extended by it.sistematica.isharedoc.opencmis.indatabase.storedobj.impl.StoredObjectImpl
      extended by it.sistematica.isharedoc.opencmis.indatabase.storedobj.impl.AbstractSingleFilingImpl
All Implemented Interfaces:
Filing, SingleFiling, StoredObject
Direct Known Subclasses:
FolderImpl

public abstract class AbstractSingleFilingImpl
extends StoredObjectImpl
implements SingleFiling

AbstractPathImpl is the common superclass of all objects hold in the repository that have a single parent, these are: Folders.

Author:
Jens

Field Summary
 
Fields inherited from class it.sistematica.isharedoc.opencmis.indatabase.storedobj.impl.StoredObjectImpl
fNativeObject, fObjStore, fProperties, fRepositoryId, fTypeId, ICON_SIZE, policyIds, RENDITION_MIME_TYPE_JPEG, RENDITION_MIME_TYPE_PNG, RENDITION_SUFFIX, secondaryTypeIds
 
Fields inherited from interface it.sistematica.isharedoc.opencmis.indatabase.storedobj.api.Filing
PATH_SEPARATOR
 
Constructor Summary
protected AbstractSingleFilingImpl(ObjectStoreImpl objStore)
           
protected AbstractSingleFilingImpl(ObjectStoreImpl objStore, File file)
           
 
Method Summary
 Folder getParent()
           
 java.lang.String getParentId()
           
 java.util.List<Folder> getParents()
           
 java.util.List<Folder> getParents(java.lang.String user)
          return a list of parents the principal has access to. for single parent object this list must contain only one element. returns an empty list if this is an unfiled document.
 java.lang.String getPath()
           
 boolean hasParent()
          usually true except for the root folder, optimized call that just tests existence to provide information for AtomPub links (much cheaper than calling getParents() and test for empty result.
 void move(Folder oldParent, Folder newParent)
          Move an object to a different folder.
 void rename(java.lang.String newName)
          Rename an object
 void setParent(Folder parent)
          Put the document in a folder and set the parent.
 
Methods inherited from class it.sistematica.isharedoc.opencmis.indatabase.storedobj.impl.StoredObjectImpl
addAcl, addAppliedPolicy, createSystemBasePropertiesWhenCreated, fillProperties, getAcl, getAllowableActions, getAppliedPolicies, getChangeToken, getConfidentialityLevel, getCreatedAt, getCreatedBy, getDeleted, getDescription, getHidden, getIconFromResourceDir, getId, getModifiedAt, getModifiedBy, getName, getNativeObject, getObjectRelationships, getObjectTemplate, getOrganization, getOriginalNativeObject, getProperties, getRenditionContent, getRenditions, getRepositoryId, getSecondaryTypeIds, getSignatureExpireDate, getSignatureStatus, getSignatureValidationDate, getSignatureValidationNote, getSignatureValidationStatus, getSigned, getType, getTypeId, hasRendition, persist, removeAcl, removePolicy, setAppliedPolicies, setConfidentialityLevel, setConfidentialityLevelId, setCreatedAt, setCreatedBy, setCustomProperties, setDeleted, setDescription, setHidden, setId, setModifiedAtNow, setModifiedBy, setName, setNativeObject, setNote, setObjectTemplate, setObjectTemplateId, setOrganization, setOrganizationId, setOriginalFileId, setProperties, setRemoteURL, setRepositoryId, setSecondaryTypeIds, setSignatureValidationNote, setSignatureValidationStatus, setStatus, setSystemBasePropertiesWhenCreatedDirect, setTypeId, testRenditionFilterForImage, updateSystemBasePropertiesWhenModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSingleFilingImpl

protected AbstractSingleFilingImpl(ObjectStoreImpl objStore)

AbstractSingleFilingImpl

protected AbstractSingleFilingImpl(ObjectStoreImpl objStore,
                                   File file)
Method Detail

getPath

public java.lang.String getPath()
Specified by:
getPath in interface SingleFiling
Returns:

getParent

public Folder getParent()
Specified by:
getParent in interface SingleFiling
Returns:

getParentId

public java.lang.String getParentId()

hasParent

public boolean hasParent()
Description copied from interface: Filing
usually true except for the root folder, optimized call that just tests existence to provide information for AtomPub links (much cheaper than calling getParents() and test for empty result.

Specified by:
hasParent in interface Filing
Returns:
true if object has a parent, false if it is a root object

getParents

public java.util.List<Folder> getParents()

getParents

public java.util.List<Folder> getParents(java.lang.String user)
Description copied from interface: Filing
return a list of parents the principal has access to. for single parent object this list must contain only one element. returns an empty list if this is an unfiled document.

Specified by:
getParents in interface Filing
Parameters:
user - user id
Returns:
list of parent folders

setParent

public void setParent(Folder parent)
Description copied from interface: SingleFiling
Put the document in a folder and set the parent. This method should not be used to file a document in a folder. It is used internally when a document is filed to the folder. The document does not get persisted in this call.

Specified by:
setParent in interface SingleFiling
Parameters:
parent - parent folder of the document to be assigned.

rename

public void rename(java.lang.String newName)
Description copied from interface: StoredObject
Rename an object

Specified by:
rename in interface StoredObject
Overrides:
rename in class StoredObjectImpl
Parameters:
newName - the new name of the object

move

public void move(Folder oldParent,
                 Folder newParent)
Description copied from interface: Filing
Move an object to a different folder. Source and target object are persisted in this call as part of a transactional step.

Specified by:
move in interface Filing
newParent - new parent folder for the object