Class UserSyncRootParentFactory
- java.lang.Object
-
- org.nuxeo.drive.service.impl.AbstractFileSystemItemFactory
-
- org.nuxeo.drive.hierarchy.permission.factory.UserSyncRootParentFactory
-
- All Implemented Interfaces:
FileSystemItemFactory,VirtualFolderItemFactory
public class UserSyncRootParentFactory extends AbstractFileSystemItemFactory implements VirtualFolderItemFactory
User workspace based implementation ofFileSystemItemFactoryfor the parentFolderItemof the user's synchronization roots.- Author:
- Antoine Taillefer
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringFOLDER_NAME_PARAMprotected StringfolderName-
Fields inherited from class org.nuxeo.drive.service.impl.AbstractFileSystemItemFactory
name
-
-
Constructor Summary
Constructors Constructor Description UserSyncRootParentFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FileSystemItemadaptDocument(DocumentModel doc, boolean forceParentItem, FolderItem parentItem, boolean relaxSyncRootConstraint, boolean getLockInfo)Adapts the givenDocumentModelto aFileSystemItem.FileSystemItemgetFileSystemItem(DocumentModel doc, boolean includeDeleted)Force parent item usinggetTopLevelFolderItem(NuxeoPrincipal).FileSystemItemgetFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint)Gets theFileSystemItemfor the givenDocumentModel.FileSystemItemgetFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo)Gets theFileSystemItemfor the givenDocumentModel.StringgetFolderName()protected FolderItemgetTopLevelFolderItem(NuxeoPrincipal principal)FolderItemgetVirtualFolderItem(NuxeoPrincipal principal)Returns the (unique) virtualFolderItem.voidhandleParameters(Map<String,String> parameters)Handles the factory parameters contributed through thefileSystemItemFactorycontribution.booleanisFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint)Returns true if the givenDocumentModelis adaptable as aFileSystemItem.voidsetFolderName(String folderName)-
Methods inherited from class org.nuxeo.drive.service.impl.AbstractFileSystemItemFactory
adaptDocument, canHandleFileSystemItemId, exists, getDocumentById, getFileSystemItem, getFileSystemItem, getFileSystemItem, getFileSystemItem, getFileSystemItem, getFileSystemItem, getFileSystemItemById, getFileSystemItemById, getName, isFileSystemItem, isFileSystemItem, parseFileSystemId, setName
-
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.FileSystemItemFactory
canHandleFileSystemItemId, exists, getFileSystemItem, getFileSystemItem, getFileSystemItem, getFileSystemItem, getFileSystemItem, getFileSystemItemById, getFileSystemItemById, getName, isFileSystemItem, isFileSystemItem, setName
-
-
-
-
Field Detail
-
FOLDER_NAME_PARAM
protected static final String FOLDER_NAME_PARAM
- See Also:
- Constant Field Values
-
folderName
protected String folderName
-
-
Method Detail
-
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, 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
-
adaptDocument
protected FileSystemItem adaptDocument(DocumentModel doc, boolean forceParentItem, FolderItem parentItem, boolean relaxSyncRootConstraint, boolean getLockInfo)
Description copied from class:AbstractFileSystemItemFactoryAdapts the givenDocumentModelto aFileSystemItem.
-
getFileSystemItem
public FileSystemItem getFileSystemItem(DocumentModel doc, boolean includeDeleted)
Force parent item usinggetTopLevelFolderItem(NuxeoPrincipal).- Specified by:
getFileSystemItemin interfaceFileSystemItemFactory- Overrides:
getFileSystemItemin classAbstractFileSystemItemFactory- 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- Overrides:
getFileSystemItemin classAbstractFileSystemItemFactory- 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- Overrides:
getFileSystemItemin classAbstractFileSystemItemFactory- Returns:
- the
FileSystemItemor null if theDocumentModelis not adaptable as aFileSystemItem - See Also:
FileSystemItemFactory.isFileSystemItem(DocumentModel, boolean, boolean)
-
getVirtualFolderItem
public FolderItem getVirtualFolderItem(NuxeoPrincipal principal)
Description copied from interface:VirtualFolderItemFactoryReturns the (unique) virtualFolderItem.- Specified by:
getVirtualFolderItemin interfaceVirtualFolderItemFactory
-
getFolderName
public String getFolderName()
- Specified by:
getFolderNamein interfaceVirtualFolderItemFactory
-
setFolderName
public void setFolderName(String folderName)
- Specified by:
setFolderNamein interfaceVirtualFolderItemFactory
-
getTopLevelFolderItem
protected FolderItem getTopLevelFolderItem(NuxeoPrincipal principal)
-
-