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
BaseFileSystemItemFactory
for a virtualFolderItem
.- Author:
- Antoine Taillefer
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
DEFAULT_FOLDER_NAME
protected static String
FOLDER_NAME_PARAM
protected String
folderName
protected String
name
-
Constructor Summary
Constructors Constructor Description AbstractVirtualFolderItemFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canHandleFileSystemItemId(String id)
Returns true if the givenFileSystemItem
id can be handled by this factory.boolean
exists(String id, NuxeoPrincipal principal)
Returns true if aFileSystemItem
with the given id exists for the given principal.FileSystemItem
getFileSystemItem(DocumentModel doc)
Gets theFileSystemItem
for the givenDocumentModel
.FileSystemItem
getFileSystemItem(DocumentModel doc, boolean includeDeleted)
Gets theFileSystemItem
for the givenDocumentModel
.FileSystemItem
getFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint)
Gets theFileSystemItem
for the givenDocumentModel
.FileSystemItem
getFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo)
Gets theFileSystemItem
for the givenDocumentModel
.FileSystemItem
getFileSystemItem(DocumentModel doc, FolderItem parentItem)
FileSystemItem
getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted)
FileSystemItem
getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint)
FileSystemItem
getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo)
FileSystemItem
getFileSystemItemById(String id, String parentId, NuxeoPrincipal principal)
Gets theFileSystemItem
with the given id and parent id using a core session fetched with the given principal.FileSystemItem
getFileSystemItemById(String id, NuxeoPrincipal principal)
Gets theFileSystemItem
with the given id using a core session fetched with the given principal.String
getFolderName()
String
getName()
Gets the factory unique name.void
handleParameters(Map<String,String> parameters)
Handles the factory parameters contributed through thefileSystemItemFactory
contribution.boolean
isFileSystemItem(DocumentModel doc)
Returns true if the givenDocumentModel
is adaptable as aFileSystemItem
.boolean
isFileSystemItem(DocumentModel doc, boolean includeDeleted)
Returns true if the givenDocumentModel
is adaptable as aFileSystemItem
.boolean
isFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint)
Returns true if the givenDocumentModel
is adaptable as aFileSystemItem
.void
setFolderName(String folderName)
void
setName(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:FileSystemItemFactory
Gets the factory unique name.- Specified by:
getName
in interfaceFileSystemItemFactory
-
setName
public void setName(String name)
Description copied from interface:FileSystemItemFactory
Sets the factory unique name.- Specified by:
setName
in interfaceFileSystemItemFactory
-
handleParameters
public void handleParameters(Map<String,String> parameters)
Description copied from interface:FileSystemItemFactory
Handles the factory parameters contributed through thefileSystemItemFactory
contribution.- Specified by:
handleParameters
in interfaceFileSystemItemFactory
-
isFileSystemItem
public boolean isFileSystemItem(DocumentModel doc)
Description copied from interface:FileSystemItemFactory
Returns true if the givenDocumentModel
is adaptable as aFileSystemItem
.- Specified by:
isFileSystemItem
in interfaceFileSystemItemFactory
- See Also:
FileSystemItemFactory.isFileSystemItem(DocumentModel, boolean)
-
isFileSystemItem
public boolean isFileSystemItem(DocumentModel doc, boolean includeDeleted)
Description copied from interface:FileSystemItemFactory
Returns true if the givenDocumentModel
is adaptable as aFileSystemItem
. IfincludeDeleted
is 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:
isFileSystemItem
in interfaceFileSystemItemFactory
-
isFileSystemItem
public boolean isFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint)
Description copied from interface:FileSystemItemFactory
Returns true if the givenDocumentModel
is adaptable as aFileSystemItem
.If
includeDeleted
is 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
relaxSyncRootConstraint
is true no filter is applied on the synchronization root aspect for the current user.- Specified by:
isFileSystemItem
in interfaceFileSystemItemFactory
-
getFileSystemItem
public FileSystemItem getFileSystemItem(DocumentModel doc)
Description copied from interface:FileSystemItemFactory
Gets theFileSystemItem
for the givenDocumentModel
.- Specified by:
getFileSystemItem
in interfaceFileSystemItemFactory
- Returns:
- the
FileSystemItem
or null if theDocumentModel
is 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:FileSystemItemFactory
Gets theFileSystemItem
for the givenDocumentModel
. IfincludeDeleted
is 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:
getFileSystemItem
in interfaceFileSystemItemFactory
- Returns:
- the
FileSystemItem
or null if theDocumentModel
is not adaptable as aFileSystemItem
- See Also:
FileSystemItemFactory.isFileSystemItem(DocumentModel, boolean)
-
getFileSystemItem
public FileSystemItem getFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint)
Description copied from interface:FileSystemItemFactory
Gets theFileSystemItem
for the givenDocumentModel
.If
includeDeleted
is 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
relaxSyncRootConstraint
is true no filter is applied on the synchronization root aspect for the current user.- Specified by:
getFileSystemItem
in interfaceFileSystemItemFactory
- Returns:
- the
FileSystemItem
or null if theDocumentModel
is 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:FileSystemItemFactory
Gets theFileSystemItem
for the givenDocumentModel
.If
includeDeleted
is 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
relaxSyncRootConstraint
is true no filter is applied on the synchronization root aspect for the current user.If
getLockInfo
is true theLock
is fetched from theDocumentModel
and set on the returnedFileSystemItem
.- Specified by:
getFileSystemItem
in interfaceFileSystemItemFactory
- Returns:
- the
FileSystemItem
or null if theDocumentModel
is 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:
getFileSystemItem
in interfaceFileSystemItemFactory
- Returns:
- the
FileSystemItem
or null if theDocumentModel
is 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:FileSystemItemFactory
Gets theFileSystemItem
for the givenDocumentModel
forcing its parent with the givenparentItem
. IfincludeDeleted
is 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:
getFileSystemItem
in interfaceFileSystemItemFactory
- Returns:
- the
FileSystemItem
or null if theDocumentModel
is not adaptable as aFileSystemItem
-
getFileSystemItem
public FileSystemItem getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint)
Description copied from interface:FileSystemItemFactory
Gets theFileSystemItem
for the givenDocumentModel
forcing its parent with the givenparentItem
.If
includeDeleted
is 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
relaxSyncRootConstraint
is true no filter is applied on the synchronization root aspect for the current user.- Specified by:
getFileSystemItem
in interfaceFileSystemItemFactory
- Returns:
- the
FileSystemItem
or null if theDocumentModel
is not adaptable as aFileSystemItem
-
getFileSystemItem
public FileSystemItem getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo)
Description copied from interface:FileSystemItemFactory
Gets theFileSystemItem
for the givenDocumentModel
forcing its parent with the givenparentItem
.If
includeDeleted
is 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
relaxSyncRootConstraint
is true no filter is applied on the synchronization root aspect for the current user.If
getLockInfo
is true theLock
is fetched from theDocumentModel
and set on the returnedFileSystemItem
.- Specified by:
getFileSystemItem
in interfaceFileSystemItemFactory
- Returns:
- the
FileSystemItem
or null if theDocumentModel
is not adaptable as aFileSystemItem
-
canHandleFileSystemItemId
public boolean canHandleFileSystemItemId(String id)
Description copied from interface:FileSystemItemFactory
Returns true if the givenFileSystemItem
id can be handled by this factory. It is typically the case when the factory has been responsible for generating theFileSystemItem
.- Specified by:
canHandleFileSystemItemId
in interfaceFileSystemItemFactory
-
exists
public boolean exists(String id, NuxeoPrincipal principal)
Description copied from interface:FileSystemItemFactory
Returns true if aFileSystemItem
with the given id exists for the given principal.- Specified by:
exists
in interfaceFileSystemItemFactory
-
getFileSystemItemById
public FileSystemItem getFileSystemItemById(String id, NuxeoPrincipal principal)
Description copied from interface:FileSystemItemFactory
Gets theFileSystemItem
with the given id using a core session fetched with the given principal.- Specified by:
getFileSystemItemById
in interfaceFileSystemItemFactory
- Returns:
- the
FileSystemItem
or null if none matches the given id
-
getFileSystemItemById
public FileSystemItem getFileSystemItemById(String id, String parentId, NuxeoPrincipal principal)
Description copied from interface:FileSystemItemFactory
Gets theFileSystemItem
with the given id and parent id using a core session fetched with the given principal.- Specified by:
getFileSystemItemById
in interfaceFileSystemItemFactory
- Returns:
- the
FileSystemItem
or null if none matches the given id and parent id
-
getFolderName
public String getFolderName()
- Specified by:
getFolderName
in interfaceVirtualFolderItemFactory
-
setFolderName
public void setFolderName(String folderName)
- Specified by:
setFolderName
in interfaceVirtualFolderItemFactory
-
-