public class CollectionManagerImpl extends DefaultComponent implements CollectionManager
lastModified
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.
|
protected DocumentModel |
createCollection(String newTitle,
String newDescription,
DocumentModel context,
CoreSession session) |
protected DocumentModel |
createDefaultCollections(CoreSession session,
DocumentModel userWorkspace) |
static void |
disableEvents(DocumentModel doc) |
void |
doRemoveFromCollection(DocumentModel documentToBeRemoved,
String collectionId,
CoreSession session) |
protected void |
fireEvent(DocumentModel doc,
CoreSession session,
String eventName,
Map<String,Serializable> props) |
protected Locale |
getLocale(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 |
processRestoredCollection(DocumentModel collection,
DocumentModel version)
Restore the collection members of the version.
|
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, setModifiedNow, unregisterContribution, unregisterExtension
public CollectionManagerImpl()
public static void disableEvents(DocumentModel doc)
public void addToCollection(DocumentModel collection, DocumentModel documentToBeAdded, CoreSession session) throws DocumentSecurityException
CollectionManager
addToCollection
in interface CollectionManager
collection
- the collectiondocumentToBeAdded
- the document to be addedsession
- the core sessionDocumentSecurityException
public void addToCollection(DocumentModel collection, List<DocumentModel> documentListToBeAdded, CoreSession session)
CollectionManager
addToCollection
in interface CollectionManager
collection
- the collectiondocumentListToBeAdded
- the list of document to be addedsession
- the core sessionpublic void addToNewCollection(String newTitle, String newDescription, DocumentModel documentToBeAdded, CoreSession session)
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 sessionpublic void addToNewCollection(String newTitle, String newDescription, List<DocumentModel> documentListToBeAdded, CoreSession session)
CollectionManager
addToNewCollection
in interface CollectionManager
newTitle
- the title of the new collectionnewDescription
- the description of the new collectiondocumentListToBeAdded
- the list of document to be addedpublic boolean canAddToCollection(DocumentModel collection, CoreSession session)
CollectionManager
canAddToCollection
in interface CollectionManager
collection
- the collectionsession
- the core sessionpublic boolean canManage(DocumentModel collection, CoreSession session)
CollectionManager
canManage
in interface CollectionManager
collection
- the collectionsession
- the core sessionpublic void checkCanAddToCollection(DocumentModel collection, DocumentModel documentToBeAdded, CoreSession session)
protected DocumentModel createCollection(String newTitle, String newDescription, DocumentModel context, CoreSession session)
protected DocumentModel createDefaultCollections(CoreSession session, DocumentModel userWorkspace)
public DocumentModel getUserDefaultCollections(DocumentModel context, CoreSession session)
CollectionManager
getUserDefaultCollections
in interface CollectionManager
context
- contextual documentsession
- the core sessionpublic List<DocumentModel> getVisibleCollection(DocumentModel collectionMember, CoreSession session)
CollectionManager
getVisibleCollection
in interface CollectionManager
collectionMember
- the documentsession
- the core sessionpublic List<DocumentModel> getVisibleCollection(DocumentModel collectionMember, int maxResult, CoreSession session)
CollectionManager
getVisibleCollection
in interface CollectionManager
collectionMember
- the documentmaxResult
- the limitsession
- the core sessionpublic boolean hasVisibleCollection(DocumentModel collectionMember, CoreSession session)
CollectionManager
hasVisibleCollection
in interface CollectionManager
collectionMember
- the documentsession
- the core sessionpublic 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)
CollectionManager
isInCollection
in interface CollectionManager
collection
- the collectiondocument
- the document to checksession
- the sessionpublic void processCopiedCollection(DocumentModel collection)
CollectionManager
processCopiedCollection
in interface CollectionManager
collection
- the collectionpublic 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 processRestoredCollection(DocumentModel collection, DocumentModel version)
CollectionManager
processRestoredCollection
in interface CollectionManager
collection
- the collectionpublic void removeAllFromCollection(DocumentModel collection, List<DocumentModel> documentListToBeRemoved, CoreSession session)
CollectionManager
removeAllFromCollection
in interface CollectionManager
collection
- the collectiondocumentListToBeRemoved
- the document to be removedsession
- the core sessionpublic void removeFromCollection(DocumentModel collection, DocumentModel documentToBeRemoved, CoreSession session)
CollectionManager
removeFromCollection
in interface CollectionManager
collection
- the collectiondocumentToBeRemoved
- the document to be removedsession
- the core sessionpublic void doRemoveFromCollection(DocumentModel documentToBeRemoved, String collectionId, CoreSession session)
doRemoveFromCollection
in interface CollectionManager
public DocumentModel createCollection(CoreSession session, String title, String description, String path)
CollectionManager
createCollection
in interface CollectionManager
protected Locale getLocale(CoreSession session)
protected void fireEvent(DocumentModel doc, CoreSession session, String eventName, Map<String,Serializable> props)
Copyright © 2015 Nuxeo SA. All rights reserved.