public class CollectionManagerImpl extends DefaultComponent implements CollectionManager
Constructor and Description |
---|
CollectionManagerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addToCollection(DocumentModel collection,
DocumentModel documentToBeAdded,
CoreSession session)
Add a document to a collection.
|
void |
addToCollection(DocumentModel collection,
List<DocumentModel> documentListToBeAdded,
CoreSession session)
Add a list of document to a collection.
|
void |
addToNewCollection(String newTitle,
String newDescription,
DocumentModel documentToBeAdded,
CoreSession session)
Add a document to a new collection.
|
void |
addToNewCollection(String newTitle,
String newDescription,
List<DocumentModel> documentListToBeAdded,
CoreSession session)
Add a list of document to a new collection.
|
boolean |
canAddToCollection(DocumentModel collection,
CoreSession session)
Check that a document is a collection and that the given core session has permission to add document inside.
|
boolean |
canManage(DocumentModel collection,
CoreSession session)
Check that the given core session has permission to manage the collection.
|
void |
checkCanAddToCollection(DocumentModel collection,
DocumentModel documentToBeAdded,
CoreSession session) |
DocumentModel |
createCollection(CoreSession session,
String title,
String description,
String path)
Create a collection with a given name, description and path.
|
void |
doRemoveFromCollection(DocumentModel documentToBeRemoved,
String collectionId,
CoreSession session) |
DocumentModel |
getUserDefaultCollections(DocumentModel context,
CoreSession session)
Get user collections root document.
|
List<DocumentModel> |
getVisibleCollection(DocumentModel collectionMember,
CoreSession session)
Get the list of collection of a document.
|
List<DocumentModel> |
getVisibleCollection(DocumentModel collectionMember,
int maxResult,
CoreSession session)
Get the list of collection of a document.
|
boolean |
hasVisibleCollection(DocumentModel collectionMember,
CoreSession session)
Check that the given core session has READ permission on at least one collection of the given document.
|
boolean |
isCollectable(DocumentModel doc)
Check that a document can be added to a collection.
|
boolean |
isCollected(DocumentModel doc)
Check that a document has already been added to a collection.
|
boolean |
isCollection(DocumentModel doc)
Check that a document is a collection.
|
boolean |
isInCollection(DocumentModel collection,
DocumentModel document,
CoreSession session)
Check whether a document is in a given collection.
|
void |
processCopiedCollection(DocumentModel collection)
Update all documents referenced by a collection to add a reference back the collection.
|
void |
processRemovedCollection(DocumentModel collection)
Update all documents referenced by a collection to remove the reference to the collection.
|
void |
processRemovedCollectionMember(DocumentModel collectionMember)
Update all collections referenced by a document.
|
void |
removeAllFromCollection(DocumentModel collection,
List<DocumentModel> documentListToBeRemoved,
CoreSession session)
Remove a list of document from a given collection.
|
void |
removeFromCollection(DocumentModel collection,
DocumentModel documentToBeRemoved,
CoreSession session)
Remove a document from a collection.
|
activate, applicationStarted, deactivate, getAdapter, getApplicationStartedOrder, getLastModified, registerContribution, registerExtension, setLastModified, unregisterContribution, unregisterExtension
public void addToCollection(DocumentModel collection, DocumentModel documentToBeAdded, CoreSession session) throws ClientException, DocumentSecurityException
CollectionManager
addToCollection
in interface CollectionManager
collection
- the collectiondocumentToBeAdded
- the document to be addedsession
- the core sessionClientException
DocumentSecurityException
public void addToCollection(DocumentModel collection, List<DocumentModel> documentListToBeAdded, CoreSession session) throws ClientException
CollectionManager
addToCollection
in interface CollectionManager
collection
- the collectiondocumentListToBeAdded
- the list of document to be addedsession
- the core sessionClientException
public void addToNewCollection(String newTitle, String newDescription, DocumentModel documentToBeAdded, CoreSession session) throws ClientException
CollectionManager
addToNewCollection
in interface CollectionManager
newTitle
- the title of the new collectionnewDescription
- the description of the new collectiondocumentToBeAdded
- the document to be addedsession
- the core sessionClientException
public void addToNewCollection(String newTitle, String newDescription, List<DocumentModel> documentListToBeAdded, CoreSession session) throws ClientException
CollectionManager
addToNewCollection
in interface CollectionManager
newTitle
- the title of the new collectionnewDescription
- the description of the new collectiondocumentListToBeAdded
- the list of document to be addedClientException
public boolean canAddToCollection(DocumentModel collection, CoreSession session) throws ClientException
CollectionManager
canAddToCollection
in interface CollectionManager
collection
- the collectionsession
- the core sessionClientException
public boolean canManage(DocumentModel collection, CoreSession session) throws ClientException
CollectionManager
canManage
in interface CollectionManager
collection
- the collectionsession
- the core sessionClientException
public void checkCanAddToCollection(DocumentModel collection, DocumentModel documentToBeAdded, CoreSession session) throws ClientException
ClientException
public DocumentModel getUserDefaultCollections(DocumentModel context, CoreSession session) throws ClientException
CollectionManager
getUserDefaultCollections
in interface CollectionManager
context
- contextual documentsession
- the core sessionClientException
public List<DocumentModel> getVisibleCollection(DocumentModel collectionMember, CoreSession session) throws ClientException
CollectionManager
getVisibleCollection
in interface CollectionManager
collectionMember
- the documentsession
- the core sessionClientException
public List<DocumentModel> getVisibleCollection(DocumentModel collectionMember, int maxResult, CoreSession session) throws ClientException
CollectionManager
getVisibleCollection
in interface CollectionManager
collectionMember
- the documentmaxResult
- the limitsession
- the core sessionClientException
public boolean hasVisibleCollection(DocumentModel collectionMember, CoreSession session) throws ClientException
CollectionManager
hasVisibleCollection
in interface CollectionManager
collectionMember
- the documentsession
- the core sessionClientException
public boolean isCollectable(DocumentModel doc)
CollectionManager
isCollectable
in interface CollectionManager
doc
- the documentpublic boolean isCollected(DocumentModel doc)
CollectionManager
isCollected
in interface CollectionManager
doc
- the documentpublic boolean isCollection(DocumentModel doc)
CollectionManager
isCollection
in interface CollectionManager
doc
- the documentpublic boolean isInCollection(DocumentModel collection, DocumentModel document, CoreSession session) throws ClientException
CollectionManager
isInCollection
in interface CollectionManager
collection
- the collectiondocument
- the document to checksession
- the sessionClientException
public void processCopiedCollection(DocumentModel collection) throws ClientException
CollectionManager
processCopiedCollection
in interface CollectionManager
collection
- the collectionClientException
public void processRemovedCollection(DocumentModel collection)
CollectionManager
processRemovedCollection
in interface CollectionManager
collection
- the collectionpublic void processRemovedCollectionMember(DocumentModel collectionMember)
CollectionManager
processRemovedCollectionMember
in interface CollectionManager
collectionMember
- the documentpublic void removeAllFromCollection(DocumentModel collection, List<DocumentModel> documentListToBeRemoved, CoreSession session) throws ClientException
CollectionManager
removeAllFromCollection
in interface CollectionManager
collection
- the collectiondocumentListToBeRemoved
- the document to be removedsession
- the core sessionClientException
public void removeFromCollection(DocumentModel collection, DocumentModel documentToBeRemoved, CoreSession session) throws ClientException
CollectionManager
removeFromCollection
in interface CollectionManager
collection
- the collectiondocumentToBeRemoved
- the document to be removedsession
- the core sessionClientException
public void doRemoveFromCollection(DocumentModel documentToBeRemoved, String collectionId, CoreSession session)
doRemoveFromCollection
in interface CollectionManager
public DocumentModel createCollection(CoreSession session, String title, String description, String path) throws ClientException
CollectionManager
createCollection
in interface CollectionManager
ClientException
Copyright © 2015 Nuxeo SA. All rights reserved.