Package org.alfresco.repo.virtual.store
Class VirtualStoreImpl
java.lang.Object
org.alfresco.repo.virtual.store.VirtualStoreImpl
- All Implemented Interfaces:
VirtualFolderDefinitionResolver,VirtualStore
public class VirtualStoreImpl
extends Object
implements VirtualStore, VirtualFolderDefinitionResolver
-
Field Summary
Fields inherited from interface org.alfresco.repo.virtual.store.VirtualStore
FILING_OR_MATERIAL_ADHERENCE, MATERIAL_ADHERENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanMaterialize(Reference reference) booleancanVirtualize(NodeRef nodeRef) createFilingData(Reference parentReference, QName assocTypeQName, QName assocQName, QName nodeTypeQName, Map<QName, Serializable> properties) getAllSetPermissions(Reference reference) getChildAssocs(Reference parentReference, Set<QName> childNodeTypeQNames) Retrieve immediate children references of a given reference where the child nodes are in the given inclusive list.getChildAssocs(Reference parentReference, QNamePattern typeQNamePattern, QNamePattern qnamePattern, int maxResults, boolean preload) Gets all child references associations where the pattern of the association qualified name is an exact match.getChildAssocsByPropertyValue(Reference parentReference, QName propertyQName, Serializable value) Retrieve the immediate children of a given node based on the value of a property of those children.getChildAssocsWithoutParentAssocsOfType(Reference parentReference, QName assocTypeQName) Gets the set of child associations of a certain parent node without parent associations of a certain type to other nodes with the same parent! In effect the 'orphans' with respect to a certain association type.getChildByName(Reference reference, QName assocTypeQName, String childName) Get the reference of the virtualized artefact with the given name within the virtual context (only) of the parent reference.
The name is case-insensitive as Alfresco has to support case-insensitive clients as standard.getProperties(Reference reference) getSetPermissions(Reference reference) hasPermission(Reference reference, String perm) Check that the given authentication has a particular permission for the given virtualized artefact.hasPermission(Reference reference, PermissionReference perm) Check that the given authentication has a particular permission for the given virtualized artefact.booleanLists all immediate children of the referred virtualized artefact.
Note: this could be a long list (and will be trimmed at a pre-configured maximum).org.alfresco.query.PagingResults<Reference>list(Reference ref, boolean actual, boolean virtual, boolean files, boolean folders, String pattern, Set<QName> ignoreTypeQNames, Set<QName> ignoreAspectQNames, List<Pair<QName, Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest) Lists page of immediate children of the referred virtualized artefact with optional filtering (exclusion of certain child file/folder subtypes, actual-virtual filtering) and sorting.org.alfresco.query.PagingResults<Reference>list(Reference ref, boolean actual, boolean virtual, boolean files, boolean folders, String pattern, Set<QName> searchTypeQNames, Set<QName> ignoreTypeQNames, Set<QName> ignoreAspectQNames, List<Pair<QName, Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest) Lists page of immediate children of the referred virtualized artefact with optional filtering (exclusion of certain child file/folder subtypes, actual-virtual filtering) and sorting.
Pattern uses '*' as a wildcardorg.alfresco.query.PagingResults<Reference>list(Reference ref, boolean actual, boolean virtual, Set<QName> searchTypeQNames, Set<QName> ignoreTypeQNames, Set<QName> ignoreAspectQNames, List<Pair<QName, Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest) Lists page of immediate children of the referred virtualized artefact with optional filtering (exclusion of certain child file/folder subtypes, actual-virtual filtering) and sorting.materialize(Reference reference) materializeIfPossible(Collection<NodeRef> nodeRefs) materializeIfPossible(NodeRef nodeRef) resolveVirtualFolderDefinition(Reference reference) search(Reference reference, String namePattern, boolean fileSearch, boolean folderSearch, boolean includeSubFolders) Perform a search against the name of the files or folders within a virtualized artefactReferencehierarchy.voidsetEnvironment(ActualEnvironment environment) voidsetUserPermissions(VirtualUserPermissions userPermissions) voidsetVirtualizationMethods(List<VirtualizationMethod> methdods) virtualize(NodeRef nodeRef)
-
Constructor Details
-
VirtualStoreImpl
public VirtualStoreImpl()
-
-
Method Details
-
setVirtualizationMethods
-
setEnvironment
-
isVirtual
- Specified by:
isVirtualin interfaceVirtualStore- Throws:
VirtualizationException
-
canVirtualize
- Specified by:
canVirtualizein interfaceVirtualStore- Throws:
VirtualizationException
-
canMaterialize
- Specified by:
canMaterializein interfaceVirtualStore- Throws:
VirtualizationException
-
virtualize
- Specified by:
virtualizein interfaceVirtualStore- Throws:
VirtualizationException
-
materialize
- Specified by:
materializein interfaceVirtualStore- Throws:
VirtualizationException
-
materializeIfPossible
public Collection<NodeRef> materializeIfPossible(Collection<NodeRef> nodeRefs) throws VirtualizationException - Specified by:
materializeIfPossiblein interfaceVirtualStore- Throws:
VirtualizationException
-
materializeIfPossible
- Specified by:
materializeIfPossiblein interfaceVirtualStore- Throws:
VirtualizationException
-
getChildAssocs
public List<ChildAssociationRef> getChildAssocs(Reference parentReference, QNamePattern typeQNamePattern, QNamePattern qnamePattern, int maxResults, boolean preload) throws InvalidNodeRefException Description copied from interface:VirtualStoreGets all child references associations where the pattern of the association qualified name is an exact match.- Specified by:
getChildAssocsin interfaceVirtualStore- Parameters:
parentReference- the parent node - usually a containertypeQNamePattern- the qualified name of the association ( null to ignore)qnamePattern- the path qualified name (null to ignore)maxResults- the number of results to getpreload- true if the nodes must be preloaded into the cache- Returns:
- Returns a list of
ChildAssociationRefinstances - Throws:
InvalidNodeRefException- if the node could not be found- See Also:
-
getChildAssocs
public List<ChildAssociationRef> getChildAssocs(Reference parentReference, Set<QName> childNodeTypeQNames) Description copied from interface:VirtualStoreRetrieve immediate children references of a given reference where the child nodes are in the given inclusive list.- Specified by:
getChildAssocsin interfaceVirtualStore- Parameters:
parentReference- the parent node - usually a containerchildNodeTypeQNames- the types that the children may be. Subtypes are not automatically calculated and the list must therefore be exhaustive.- Returns:
- Returns a list of
ChildAssociationRefinstances.
-
getChildAssocsWithoutParentAssocsOfType
public Collection<ChildAssociationRef> getChildAssocsWithoutParentAssocsOfType(Reference parentReference, QName assocTypeQName) Description copied from interface:VirtualStoreGets the set of child associations of a certain parent node without parent associations of a certain type to other nodes with the same parent! In effect the 'orphans' with respect to a certain association type.- Specified by:
getChildAssocsWithoutParentAssocsOfTypein interfaceVirtualStoreassocTypeQName- the association type QName- Returns:
- a
Collectionof child associations
-
getChildAssocsByPropertyValue
public List<ChildAssociationRef> getChildAssocsByPropertyValue(Reference parentReference, QName propertyQName, Serializable value) Description copied from interface:VirtualStoreRetrieve the immediate children of a given node based on the value of a property of those children.If the property to be searched is multi-valued then will match on any one values.
Please note, the following system maintained properties that cannot be used with this method.
- cm:name - use getChildByName instead
- cm:created
- cm:creator
- cm:modified
- cm:modifier
- sys:node-uuid
- sys:node-dbid
- sys:store-identifier
- sys:store-protocol
- Specified by:
getChildAssocsByPropertyValuein interfaceVirtualStore- Parameters:
parentReference- the parent reference - usually a containerpropertyQName- the fully qualified name of the propertyvalue- the value to search for. Must be a simple type such as String, Number, Date or Boolean, it cannot be a collection, a content property, MLText or a float.- Returns:
- Returns a list of
ChildAssociationRefinstances.
-
getChildByName
public Reference getChildByName(Reference reference, QName assocTypeQName, String childName) throws VirtualizationException Description copied from interface:VirtualStoreGet the reference of the virtualized artefact with the given name within the virtual context (only) of the parent reference.
The name is case-insensitive as Alfresco has to support case-insensitive clients as standard.- Specified by:
getChildByNamein interfaceVirtualStore- Parameters:
reference- parentReference- Returns:
- the virtual child reference for the given name in the context of the given parent reference
- Throws:
VirtualizationException- See Also:
-
resolveVirtualFolderDefinition
public VirtualFolderDefinition resolveVirtualFolderDefinition(Reference reference) throws VirtualizationException - Specified by:
resolveVirtualFolderDefinitionin interfaceVirtualFolderDefinitionResolver- Returns:
- the
VirtualFolderDefinitionof the givenReferenceconsidering inner paths - Throws:
VirtualizationException
-
list
public org.alfresco.query.PagingResults<Reference> list(Reference ref, boolean actual, boolean virtual, boolean files, boolean folders, String pattern, Set<QName> searchTypeQNames, Set<QName> ignoreTypeQNames, Set<QName> ignoreAspectQNames, List<Pair<QName, Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest) throws VirtualizationExceptionDescription copied from interface:VirtualStoreLists page of immediate children of the referred virtualized artefact with optional filtering (exclusion of certain child file/folder subtypes, actual-virtual filtering) and sorting.
Pattern uses '*' as a wildcard- Specified by:
listin interfaceVirtualStore- Throws:
VirtualizationException
-
list
public org.alfresco.query.PagingResults<Reference> list(Reference ref, boolean actual, boolean virtual, boolean files, boolean folders, String pattern, Set<QName> ignoreTypeQNames, Set<QName> ignoreAspectQNames, List<Pair<QName, Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest) throws VirtualizationExceptionDescription copied from interface:VirtualStoreLists page of immediate children of the referred virtualized artefact with optional filtering (exclusion of certain child file/folder subtypes, actual-virtual filtering) and sorting.- Specified by:
listin interfaceVirtualStore- Throws:
VirtualizationException
-
list
public org.alfresco.query.PagingResults<Reference> list(Reference ref, boolean actual, boolean virtual, Set<QName> searchTypeQNames, Set<QName> ignoreTypeQNames, Set<QName> ignoreAspectQNames, List<Pair<QName, Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest) throws VirtualizationExceptionDescription copied from interface:VirtualStoreLists page of immediate children of the referred virtualized artefact with optional filtering (exclusion of certain child file/folder subtypes, actual-virtual filtering) and sorting.- Specified by:
listin interfaceVirtualStore- Throws:
VirtualizationException
-
list
Description copied from interface:VirtualStoreLists all immediate children of the referred virtualized artefact.
Note: this could be a long list (and will be trimmed at a pre-configured maximum). You should consider using a paging request.- Specified by:
listin interfaceVirtualStore- Throws:
VirtualizationException
-
search
public List<Reference> search(Reference reference, String namePattern, boolean fileSearch, boolean folderSearch, boolean includeSubFolders) throws VirtualizationException Description copied from interface:VirtualStorePerform a search against the name of the files or folders within a virtualized artefactReferencehierarchy.
Wildcard characters are * and ?.
Warning: Please avoid using this method with any "namePattern" other than "*". Although it works, its performance is poor which is why this method is deprecated.- Specified by:
searchin interfaceVirtualStore- Throws:
VirtualizationException
-
getProperties
- Specified by:
getPropertiesin interfaceVirtualStore- Returns:
- all virtual properties of the referred virtualized artefact keyed by their qualified name
- Throws:
VirtualizationException
-
getType
- Specified by:
getTypein interfaceVirtualStore- Returns:
- qualified type of the referred virtualized artefact
- Throws:
VirtualizationException
-
createFilingData
public FilingData createFilingData(Reference parentReference, QName assocTypeQName, QName assocQName, QName nodeTypeQName, Map<QName, Serializable> properties) throws VirtualizationException- Specified by:
createFilingDatain interfaceVirtualStore- Returns:
FilingDataof the given parent location- Throws:
VirtualizationException
-
hasPermission
Description copied from interface:VirtualStoreCheck that the given authentication has a particular permission for the given virtualized artefact. (The default behaviour is to inherit permissions)- Specified by:
hasPermissionin interfaceVirtualStore- Returns:
- an
AccessStatus - Throws:
VirtualizationException
-
hasPermission
public AccessStatus hasPermission(Reference reference, PermissionReference perm) throws VirtualizationException Description copied from interface:VirtualStoreCheck that the given authentication has a particular permission for the given virtualized artefact. (The default behaviour is to inherit permissions)- Specified by:
hasPermissionin interfaceVirtualStore- Returns:
- an
AccessStatus - Throws:
VirtualizationException
-
setUserPermissions
- Parameters:
userPermissions- user permissions
-
getUserPermissions
- Returns:
- a
VirtualUserPermissionsclone
-
getSetPermissions
- Specified by:
getSetPermissionsin interfaceVirtualStore- Throws:
VirtualizationException
-
getAllSetPermissions
- Specified by:
getAllSetPermissionsin interfaceVirtualStore
-
getPath
- Specified by:
getPathin interfaceVirtualStore- Throws:
VirtualizationException
-
adhere
- Specified by:
adherein interfaceVirtualStore- Throws:
VirtualizationException
-