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 |
---|---|
boolean |
canHandleFileSystemItemId(String id)
Returns true if the given
FileSystemItem id can be handled by
this factory. |
boolean |
exists(String id,
Principal 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. |
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,
FolderItem parentItem)
Gets the
FileSystemItem for the given DocumentModel
forcing its parent id with the given id. |
FileSystemItem |
getFileSystemItem(DocumentModel doc,
FolderItem parentItem,
boolean includeDeleted)
Gets the
FileSystemItem for the given DocumentModel
forcing its parent id with the given id. |
FileSystemItem |
getFileSystemItemById(String id,
Principal principal)
Gets the
FileSystemItem with the given id using a core session
fetched with the given principal. |
String |
getName()
Gets the factory unique name.
|
abstract void |
handleParameters(Map<String,String> parameters)
Handles the factory parameters contributed through the
fileSystemItemFactory contribution. |
boolean |
isFileSystemItem(DocumentModel doc)
Returns true if the given
DocumentModel is adaptable as a
FileSystemItem . |
abstract boolean |
isFileSystemItem(DocumentModel doc,
boolean includeDeleted)
Returns true if the given
DocumentModel is adaptable as a
FileSystemItem . |
void |
setName(String name)
Sets the factory unique name.
|
public abstract void handleParameters(Map<String,String> parameters) throws ClientException
FileSystemItemFactory
fileSystemItemFactory
contribution.handleParameters
in interface FileSystemItemFactory
ClientException
public abstract boolean isFileSystemItem(DocumentModel doc, boolean includeDeleted) throws ClientException
FileSystemItemFactory
DocumentModel
is adaptable as a
FileSystemItem
. If includeDeleted
is true no filter is
applied on the "deleted" life cycle 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
ClientException
public String getName()
FileSystemItemFactory
getName
in interface FileSystemItemFactory
public void setName(String name)
FileSystemItemFactory
setName
in interface FileSystemItemFactory
public boolean isFileSystemItem(DocumentModel doc) throws ClientException
FileSystemItemFactory
DocumentModel
is adaptable as a
FileSystemItem
.isFileSystemItem
in interface FileSystemItemFactory
ClientException
FileSystemItemFactory.isFileSystemItem(DocumentModel, boolean)
public FileSystemItem getFileSystemItem(DocumentModel doc) throws ClientException
FileSystemItemFactory
FileSystemItem
for the given DocumentModel
.getFileSystemItem
in interface FileSystemItemFactory
FileSystemItem
or null if the DocumentModel
is not adaptable as a FileSystemItem
ClientException
FileSystemItemFactory.isFileSystemItem(DocumentModel)
,
FileSystemItemFactory.getFileSystemItem(DocumentModel, boolean)
public FileSystemItem getFileSystemItem(DocumentModel doc, boolean includeDeleted) throws ClientException
FileSystemItemFactory
FileSystemItem
for the given DocumentModel
. If
includeDeleted
is true no filter is applied on the "deleted" life
cycle state, else if the document is in this state 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
ClientException
#isFileSystemItem(DocumentModel, boolean))
public FileSystemItem getFileSystemItem(DocumentModel doc, FolderItem parentItem) throws ClientException
FileSystemItemFactory
FileSystemItem
for the given DocumentModel
forcing its parent id with the given id.getFileSystemItem
in interface FileSystemItemFactory
FileSystemItem
or null if the DocumentModel
is not adaptable as a FileSystemItem
ClientException
FileSystemItemFactory.isFileSystemItem(DocumentModel)
,
#getFileSystemItem(DocumentModel, String, boolean)
public FileSystemItem getFileSystemItem(DocumentModel doc, FolderItem parentItem, boolean includeDeleted) throws ClientException
FileSystemItemFactory
FileSystemItem
for the given DocumentModel
forcing its parent id with the given id. If includeDeleted
is
true no filter is applied on the "deleted" life cycle state, else if the
document is in this state 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
ClientException
FileSystemItemFactory.isFileSystemItem(DocumentModel, boolean)
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, Principal principal) throws ClientException
FileSystemItem
with the
given id exists if the backing DocumentModel
can be fetched and
isFileSystemItem(DocumentModel)
returns true.exists
in interface FileSystemItemFactory
ClientException
isFileSystemItem(DocumentModel)
public FileSystemItem getFileSystemItemById(String id, Principal principal) throws ClientException
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 idClientException
Copyright © 2013 Nuxeo SA. All Rights Reserved.