Class AbstractVirtualFolderItemFactory
- java.lang.Object
-
- org.nuxeo.drive.service.impl.AbstractVirtualFolderItemFactory
-
- All Implemented Interfaces:
FileSystemItemFactory,VirtualFolderItemFactory
- Direct Known Subclasses:
DefaultTopLevelFolderItemFactory,PermissionTopLevelFactory,SharedSyncRootParentFactory,UserWorkspaceSyncRootParentFactory
public abstract class AbstractVirtualFolderItemFactory extends Object implements VirtualFolderItemFactory
BaseFileSystemItemFactoryfor a virtualFolderItem.- Author:
- Antoine Taillefer
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringDEFAULT_FOLDER_NAMEprotected static StringFOLDER_NAME_PARAMprotected StringfolderNameprotected Stringname
-
Constructor Summary
Constructors Constructor Description AbstractVirtualFolderItemFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanHandleFileSystemItemId(String id)Returns true if the givenFileSystemItemid can be handled by this factory.booleanexists(String id, NuxeoPrincipal principal)Returns true if aFileSystemItemwith the given id exists for the given principal.FileSystemItemgetFileSystemItem(DocumentModel doc)Gets theFileSystemItemfor the givenDocumentModel.FileSystemItemgetFileSystemItem(DocumentModel doc, boolean includeDeleted)Gets theFileSystemItemfor the givenDocumentModel.FileSystemItemgetFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint)Gets theFileSystemItemfor the givenDocumentModel.FileSystemItemgetFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo)Gets theFileSystemItemfor the givenDocumentModel.FileSystemItemgetFileSystemItem(DocumentModel doc, FolderItem parentItem)FileSystemItemgetFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted)FileSystemItemgetFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint)FileSystemItemgetFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo)FileSystemItemgetFileSystemItemById(String id, String parentId, NuxeoPrincipal principal)Gets theFileSystemItemwith the given id and parent id using a core session fetched with the given principal.FileSystemItemgetFileSystemItemById(String id, NuxeoPrincipal principal)Gets theFileSystemItemwith the given id using a core session fetched with the given principal.StringgetFolderName()StringgetName()Gets the factory unique name.voidhandleParameters(Map<String,String> parameters)Handles the factory parameters contributed through thefileSystemItemFactorycontribution.booleanisFileSystemItem(DocumentModel doc)Returns true if the givenDocumentModelis adaptable as aFileSystemItem.booleanisFileSystemItem(DocumentModel doc, boolean includeDeleted)Returns true if the givenDocumentModelis adaptable as aFileSystemItem.booleanisFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint)Returns true if the givenDocumentModelis adaptable as aFileSystemItem.voidsetFolderName(String folderName)voidsetName(String name)Sets the factory unique name.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.drive.service.VirtualFolderItemFactory
getVirtualFolderItem
-
-
-
-
Field Detail
-
FOLDER_NAME_PARAM
protected static final String FOLDER_NAME_PARAM
- See Also:
- Constant Field Values
-
DEFAULT_FOLDER_NAME
protected static final String DEFAULT_FOLDER_NAME
- See Also:
- Constant Field Values
-
name
protected String name
-
folderName
protected String folderName
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:FileSystemItemFactoryGets the factory unique name.- Specified by:
getNamein interfaceFileSystemItemFactory
-
setName
public void setName(String name)
Description copied from interface:FileSystemItemFactorySets the factory unique name.- Specified by:
setNamein interfaceFileSystemItemFactory
-
handleParameters
public void handleParameters(Map<String,String> parameters)
Description copied from interface:FileSystemItemFactoryHandles the factory parameters contributed through thefileSystemItemFactorycontribution.- Specified by:
handleParametersin interfaceFileSystemItemFactory
-
isFileSystemItem
public boolean isFileSystemItem(DocumentModel doc)
Description copied from interface:FileSystemItemFactoryReturns true if the givenDocumentModelis adaptable as aFileSystemItem.- Specified by:
isFileSystemItemin interfaceFileSystemItemFactory- See Also:
FileSystemItemFactory.isFileSystemItem(DocumentModel, boolean)
-
isFileSystemItem
public boolean isFileSystemItem(DocumentModel doc, boolean includeDeleted)
Description copied from interface:FileSystemItemFactoryReturns true if the givenDocumentModelis adaptable as aFileSystemItem. IfincludeDeletedis true no filter is applied on the "trashed" state, else if the document is in this state it is not considered as adaptable as aFileSystemItem, thus the method returns false.- Specified by:
isFileSystemItemin interfaceFileSystemItemFactory
-
isFileSystemItem
public boolean isFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint)
Description copied from interface:FileSystemItemFactoryReturns true if the givenDocumentModelis adaptable as aFileSystemItem.If
includeDeletedis true no filter is applied on the "trashed" state, else if the document is in this state it is not considered as adaptable as aFileSystemItem, thus the method returns false.If
relaxSyncRootConstraintis true no filter is applied on the synchronization root aspect for the current user.- Specified by:
isFileSystemItemin interfaceFileSystemItemFactory
-
getFileSystemItem
public FileSystemItem getFileSystemItem(DocumentModel doc)
Description copied from interface:FileSystemItemFactoryGets theFileSystemItemfor the givenDocumentModel.- Specified by:
getFileSystemItemin interfaceFileSystemItemFactory- Returns:
- the
FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem - See Also:
FileSystemItemFactory.isFileSystemItem(DocumentModel),FileSystemItemFactory.getFileSystemItem(DocumentModel, boolean)
-
getFileSystemItem
public FileSystemItem getFileSystemItem(DocumentModel doc, boolean includeDeleted)
Description copied from interface:FileSystemItemFactoryGets theFileSystemItemfor the givenDocumentModel. IfincludeDeletedis true no filter is applied on the "trashed" state, else if the document is in the trash it is not considered as adaptable as aFileSystemItem, thus the method returns null.- Specified by:
getFileSystemItemin interfaceFileSystemItemFactory- Returns:
- the
FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem - See Also:
FileSystemItemFactory.isFileSystemItem(DocumentModel, boolean)
-
getFileSystemItem
public FileSystemItem getFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint)
Description copied from interface:FileSystemItemFactoryGets theFileSystemItemfor the givenDocumentModel.If
includeDeletedis true no filter is applied on the "trashed" state, else if the document is in this state it is not considered as adaptable as aFileSystemItem, thus the method returns null.If
relaxSyncRootConstraintis true no filter is applied on the synchronization root aspect for the current user.- Specified by:
getFileSystemItemin interfaceFileSystemItemFactory- Returns:
- the
FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem - See Also:
FileSystemItemFactory.isFileSystemItem(DocumentModel, boolean, boolean)
-
getFileSystemItem
public FileSystemItem getFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo)
Description copied from interface:FileSystemItemFactoryGets theFileSystemItemfor the givenDocumentModel.If
includeDeletedis true no filter is applied on the "trashed" state, else if the document is in this state it is not considered as adaptable as aFileSystemItem, thus the method returns null.If
relaxSyncRootConstraintis true no filter is applied on the synchronization root aspect for the current user.If
getLockInfois true theLockis fetched from theDocumentModeland set on the returnedFileSystemItem.- Specified by:
getFileSystemItemin interfaceFileSystemItemFactory- Returns:
- the
FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem - See Also:
FileSystemItemFactory.isFileSystemItem(DocumentModel, boolean, boolean)
-
getFileSystemItem
public FileSystemItem getFileSystemItem(DocumentModel doc, FolderItem parentItem)
Description copied from interface:FileSystemItemFactory- Specified by:
getFileSystemItemin interfaceFileSystemItemFactory- Returns:
- the
FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem - See Also:
FileSystemItemFactory.getFileSystemItem(DocumentModel, FolderItem, boolean)
-
getFileSystemItem
public FileSystemItem getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted)
Description copied from interface:FileSystemItemFactoryGets theFileSystemItemfor the givenDocumentModelforcing its parent with the givenparentItem. IfincludeDeletedis true no filter is applied on the "trashed" state, else if the document is in the trash it is not considered as adaptable as aFileSystemItem, thus the method returns null.- Specified by:
getFileSystemItemin interfaceFileSystemItemFactory- Returns:
- the
FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem
-
getFileSystemItem
public FileSystemItem getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint)
Description copied from interface:FileSystemItemFactoryGets theFileSystemItemfor the givenDocumentModelforcing its parent with the givenparentItem.If
includeDeletedis true no filter is applied on the "trashed" state, else if the document is in this state it is not considered as adaptable as aFileSystemItem, thus the method returns null.If
relaxSyncRootConstraintis true no filter is applied on the synchronization root aspect for the current user.- Specified by:
getFileSystemItemin interfaceFileSystemItemFactory- Returns:
- the
FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem
-
getFileSystemItem
public FileSystemItem getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo)
Description copied from interface:FileSystemItemFactoryGets theFileSystemItemfor the givenDocumentModelforcing its parent with the givenparentItem.If
includeDeletedis true no filter is applied on the "trashed" state, else if the document is in this state it is not considered as adaptable as aFileSystemItem, thus the method returns null.If
relaxSyncRootConstraintis true no filter is applied on the synchronization root aspect for the current user.If
getLockInfois true theLockis fetched from theDocumentModeland set on the returnedFileSystemItem.- Specified by:
getFileSystemItemin interfaceFileSystemItemFactory- Returns:
- the
FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem
-
canHandleFileSystemItemId
public boolean canHandleFileSystemItemId(String id)
Description copied from interface:FileSystemItemFactoryReturns true if the givenFileSystemItemid can be handled by this factory. It is typically the case when the factory has been responsible for generating theFileSystemItem.- Specified by:
canHandleFileSystemItemIdin interfaceFileSystemItemFactory
-
exists
public boolean exists(String id, NuxeoPrincipal principal)
Description copied from interface:FileSystemItemFactoryReturns true if aFileSystemItemwith the given id exists for the given principal.- Specified by:
existsin interfaceFileSystemItemFactory
-
getFileSystemItemById
public FileSystemItem getFileSystemItemById(String id, NuxeoPrincipal principal)
Description copied from interface:FileSystemItemFactoryGets theFileSystemItemwith the given id using a core session fetched with the given principal.- Specified by:
getFileSystemItemByIdin interfaceFileSystemItemFactory- Returns:
- the
FileSystemItemor null if none matches the given id
-
getFileSystemItemById
public FileSystemItem getFileSystemItemById(String id, String parentId, NuxeoPrincipal principal)
Description copied from interface:FileSystemItemFactoryGets theFileSystemItemwith the given id and parent id using a core session fetched with the given principal.- Specified by:
getFileSystemItemByIdin interfaceFileSystemItemFactory- Returns:
- the
FileSystemItemor null if none matches the given id and parent id
-
getFolderName
public String getFolderName()
- Specified by:
getFolderNamein interfaceVirtualFolderItemFactory
-
setFolderName
public void setFolderName(String folderName)
- Specified by:
setFolderNamein interfaceVirtualFolderItemFactory
-
-