public abstract class AbstractFileSystemItemFactory extends Object implements FileSystemItemFactory
FileSystemItemFactory
implementers. It is DocumentModel
backed.DefaultFileSystemItemFactory
Constructor and Description |
---|
AbstractFileSystemItemFactory() |
Modifier and Type | Method and Description |
---|---|
protected FileSystemItem |
adaptDocument(DocumentModel doc,
boolean forceParentItem,
FolderItem parentItem) |
protected abstract FileSystemItem |
adaptDocument(DocumentModel doc,
boolean forceParentItem,
FolderItem parentItem,
boolean relaxSyncRootConstraint,
boolean getLockInfo)
Adapts the given
DocumentModel to a FileSystemItem . |
boolean |
canHandleFileSystemItemId(String id)
Returns true if the given
FileSystemItem id can be handled by this factory. |
boolean |
exists(String id,
NuxeoPrincipal principal)
The default factory considers that a
FileSystemItem with the given id exists if the backing
DocumentModel can be fetched and isFileSystemItem(DocumentModel) returns true. |
protected DocumentModel |
getDocumentById(String docId,
CoreSession session) |
FileSystemItem |
getFileSystemItem(DocumentModel doc)
Gets the
FileSystemItem for the given DocumentModel . |
FileSystemItem |
getFileSystemItem(DocumentModel doc,
boolean includeDeleted)
Gets the
FileSystemItem for the given DocumentModel . |
FileSystemItem |
getFileSystemItem(DocumentModel doc,
boolean includeDeleted,
boolean relaxSyncRootConstraint)
Gets the
FileSystemItem for the given DocumentModel . |
FileSystemItem |
getFileSystemItem(DocumentModel doc,
boolean includeDeleted,
boolean relaxSyncRootConstraint,
boolean getLockInfo)
Gets the
FileSystemItem for the given DocumentModel . |
protected FileSystemItem |
getFileSystemItem(DocumentModel doc,
boolean forceParentItem,
FolderItem parentItem,
boolean includeDeleted,
boolean relaxSyncRootConstraint,
boolean getLockInfo) |
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,
NuxeoPrincipal principal)
Gets the
FileSystemItem with the given id using a core session fetched with the given principal. |
FileSystemItem |
getFileSystemItemById(String id,
String parentId,
NuxeoPrincipal principal)
Gets the
FileSystemItem with the given id and parent id using a core session fetched with the given
principal. |
String |
getName()
Gets the factory unique name.
|
boolean |
isFileSystemItem(DocumentModel doc)
Returns true if the given
DocumentModel is adaptable as a FileSystemItem . |
boolean |
isFileSystemItem(DocumentModel doc,
boolean includeDeleted)
Returns true if the given
DocumentModel is adaptable as a FileSystemItem . |
protected String[] |
parseFileSystemId(String id) |
void |
setName(String name)
Sets the factory unique name.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handleParameters, isFileSystemItem
public AbstractFileSystemItemFactory()
protected abstract FileSystemItem adaptDocument(DocumentModel doc, boolean forceParentItem, FolderItem parentItem, boolean relaxSyncRootConstraint, boolean getLockInfo)
DocumentModel
to a FileSystemItem
.public String getName()
FileSystemItemFactory
getName
in interface FileSystemItemFactory
public void setName(String name)
FileSystemItemFactory
setName
in interface FileSystemItemFactory
public boolean isFileSystemItem(DocumentModel doc)
FileSystemItemFactory
DocumentModel
is adaptable as a FileSystemItem
.isFileSystemItem
in interface FileSystemItemFactory
FileSystemItemFactory.isFileSystemItem(DocumentModel, boolean)
public boolean isFileSystemItem(DocumentModel doc, boolean includeDeleted)
FileSystemItemFactory
DocumentModel
is adaptable as a FileSystemItem
. 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 a FileSystemItem
, thus the method returns false.isFileSystemItem
in interface FileSystemItemFactory
public FileSystemItem getFileSystemItem(DocumentModel doc)
FileSystemItemFactory
FileSystemItem
for the given DocumentModel
.getFileSystemItem
in interface FileSystemItemFactory
FileSystemItem
or null if the DocumentModel
is not adaptable as a
FileSystemItem
FileSystemItemFactory.isFileSystemItem(DocumentModel)
,
FileSystemItemFactory.getFileSystemItem(DocumentModel, boolean)
public FileSystemItem getFileSystemItem(DocumentModel doc, boolean includeDeleted)
FileSystemItemFactory
FileSystemItem
for the given DocumentModel
. If includeDeleted
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 a
FileSystemItem
, thus the method returns null.getFileSystemItem
in interface FileSystemItemFactory
FileSystemItem
or null if the DocumentModel
is not adaptable as a
FileSystemItem
FileSystemItemFactory.isFileSystemItem(DocumentModel, boolean)
public FileSystemItem getFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint)
FileSystemItemFactory
FileSystemItem
for the given DocumentModel
.
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 a FileSystemItem
, thus the method returns null.
If relaxSyncRootConstraint
is true no filter is applied on the synchronization root aspect for the
current user.
getFileSystemItem
in interface FileSystemItemFactory
FileSystemItem
or null if the DocumentModel
is not adaptable as a
FileSystemItem
FileSystemItemFactory.isFileSystemItem(DocumentModel, boolean, boolean)
public FileSystemItem getFileSystemItem(DocumentModel doc, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo)
FileSystemItemFactory
FileSystemItem
for the given DocumentModel
.
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 a FileSystemItem
, 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 the Lock
is fetched from the DocumentModel
and set on the returned
FileSystemItem
.
getFileSystemItem
in interface FileSystemItemFactory
FileSystemItem
or null if the DocumentModel
is not adaptable as a
FileSystemItem
FileSystemItemFactory.isFileSystemItem(DocumentModel, boolean, boolean)
public FileSystemItem getFileSystemItem(DocumentModel doc, FolderItem parentItem)
FileSystemItemFactory
getFileSystemItem
in interface FileSystemItemFactory
FileSystemItem
or null if the DocumentModel
is not adaptable as a
FileSystemItem
FileSystemItemFactory.getFileSystemItem(DocumentModel, FolderItem, boolean)
public FileSystemItem getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted)
FileSystemItemFactory
FileSystemItem
for the given DocumentModel
forcing its parent with the given
parentItem
. If includeDeleted
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 a FileSystemItem
, thus the method returns
null.getFileSystemItem
in interface FileSystemItemFactory
FileSystemItem
or null if the DocumentModel
is not adaptable as a
FileSystemItem
public FileSystemItem getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint)
FileSystemItemFactory
FileSystemItem
for the given DocumentModel
forcing its parent with the given
parentItem
.
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 a FileSystemItem
, thus the method returns null.
If relaxSyncRootConstraint
is true no filter is applied on the synchronization root aspect for the
current user.
getFileSystemItem
in interface FileSystemItemFactory
FileSystemItem
or null if the DocumentModel
is not adaptable as a
FileSystemItem
public FileSystemItem getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo)
FileSystemItemFactory
FileSystemItem
for the given DocumentModel
forcing its parent with the given
parentItem
.
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 a FileSystemItem
, 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 the Lock
is fetched from the DocumentModel
and set on the returned
FileSystemItem
.
getFileSystemItem
in interface FileSystemItemFactory
FileSystemItem
or null if the DocumentModel
is not adaptable as a
FileSystemItem
public boolean canHandleFileSystemItemId(String id)
FileSystemItemFactory
FileSystemItem
id can be handled by this factory. It is typically the case when
the factory has been responsible for generating the FileSystemItem
.canHandleFileSystemItemId
in interface FileSystemItemFactory
public boolean exists(String id, NuxeoPrincipal principal)
FileSystemItem
with the given id exists if the backing
DocumentModel
can be fetched and isFileSystemItem(DocumentModel)
returns true.exists
in interface FileSystemItemFactory
isFileSystemItem(DocumentModel)
public FileSystemItem getFileSystemItemById(String id, NuxeoPrincipal principal)
FileSystemItemFactory
FileSystemItem
with the given id using a core session fetched with the given principal.getFileSystemItemById
in interface FileSystemItemFactory
FileSystemItem
or null if none matches the given idpublic FileSystemItem getFileSystemItemById(String id, String parentId, NuxeoPrincipal principal)
FileSystemItemFactory
FileSystemItem
with the given id and parent id using a core session fetched with the given
principal.getFileSystemItemById
in interface FileSystemItemFactory
FileSystemItem
or null if none matches the given id and parent idprotected FileSystemItem adaptDocument(DocumentModel doc, boolean forceParentItem, FolderItem parentItem)
protected FileSystemItem getFileSystemItem(DocumentModel doc, boolean forceParentItem, FolderItem parentItem, boolean includeDeleted, boolean relaxSyncRootConstraint, boolean getLockInfo)
protected String[] parseFileSystemId(String id)
protected DocumentModel getDocumentById(String docId, CoreSession session)
Copyright © 2019 Nuxeo. All rights reserved.