Class DocumentRoutingTreePersister
- java.lang.Object
-
- org.nuxeo.ecm.platform.routing.core.impl.DocumentRoutingTreePersister
-
- All Implemented Interfaces:
DocumentRoutingPersister
public class DocumentRoutingTreePersister extends Object implements DocumentRoutingPersister
The default persister. It persists theDocumentRoute
in a tree hierarchy ressembling the current date. New model created from instance are stored in the personal workspace of the user.- Author:
- arussel
-
-
Field Summary
Fields Modifier and Type Field Description protected static Log
log
-
Fields inherited from interface org.nuxeo.ecm.platform.routing.api.DocumentRoutingPersister
DocumentRouteInstanceRootName
-
-
Constructor Summary
Constructors Constructor Description DocumentRoutingTreePersister()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DocumentModel
createDocumentRouteInstanceFromDocumentRouteModel(DocumentModel model, CoreSession session)
Creates a blankDocumentRoute
instance from a model.protected DocumentModel
createDocumentRoutesStructure(String routeStructureDocType, String id, CoreSession session)
Finds the first domain by name, and creates under it the root container for the structure containing the route instances.protected DocumentModel
createModelsRoutesStructure(String routeStructureDocType, String id, CoreSession session)
Create the rootModels under to root document.protected List<ACE>
getACEs()
protected DocumentModel
getDocumentRoutesStructure(String type, CoreSession session)
String
getNewModelName(DocumentModel instance)
Return the new name of a model when it is created from an instance.DocumentModel
getOrCreateRootOfDocumentRouteInstanceStructure(CoreSession session)
Will get, and create if it does not exists the root document in whichDocumentRoute
structure will be created.DocumentModel
getParentFolderForDocumentRouteInstance(DocumentModel document, CoreSession session)
Get or create the parent folder for aDocumentRoute
route instance.DocumentModel
getParentFolderForDocumentRouteModels(CoreSession session)
Gets or creates the parent folder for aDocumentRoute
route instance.DocumentModel
getParentFolderForNewModel(CoreSession session, DocumentModel instance)
Returns a folder in which new model, created from an instance of route will be stored.protected UserManager
getUserManager()
DocumentModel
saveDocumentRouteInstanceAsNewModel(DocumentModel routeInstance, DocumentModel parentFolder, String newName, CoreSession session)
protected DocumentModel
undoReadOnlySecurityPolicy(DocumentModel instance, CoreSession session)
-
-
-
Constructor Detail
-
DocumentRoutingTreePersister
public DocumentRoutingTreePersister()
-
-
Method Detail
-
getParentFolderForDocumentRouteInstance
public DocumentModel getParentFolderForDocumentRouteInstance(DocumentModel document, CoreSession session)
Description copied from interface:DocumentRoutingPersister
Get or create the parent folder for aDocumentRoute
route instance.- Specified by:
getParentFolderForDocumentRouteInstance
in interfaceDocumentRoutingPersister
- Parameters:
document
- TheDocumentRoute
model from which the instance will be created. Its metadata may be used when creating the parent.- Returns:
- The parent folder in which the
DocumentRoute
will be persisted.
-
createDocumentRouteInstanceFromDocumentRouteModel
public DocumentModel createDocumentRouteInstanceFromDocumentRouteModel(DocumentModel model, CoreSession session)
Description copied from interface:DocumentRoutingPersister
Creates a blankDocumentRoute
instance from a model.- Specified by:
createDocumentRouteInstanceFromDocumentRouteModel
in interfaceDocumentRoutingPersister
- Parameters:
model
- the model- Returns:
- The created
DocumentRoute
-
saveDocumentRouteInstanceAsNewModel
public DocumentModel saveDocumentRouteInstanceAsNewModel(DocumentModel routeInstance, DocumentModel parentFolder, String newName, CoreSession session)
- Specified by:
saveDocumentRouteInstanceAsNewModel
in interfaceDocumentRoutingPersister
-
getOrCreateRootOfDocumentRouteInstanceStructure
public DocumentModel getOrCreateRootOfDocumentRouteInstanceStructure(CoreSession session)
Description copied from interface:DocumentRoutingPersister
Will get, and create if it does not exists the root document in whichDocumentRoute
structure will be created.- Specified by:
getOrCreateRootOfDocumentRouteInstanceStructure
in interfaceDocumentRoutingPersister
- Parameters:
session
- The session use to get or create the document.- Returns:
- The root of the
DocumentRoute
structure.
-
createDocumentRoutesStructure
protected DocumentModel createDocumentRoutesStructure(String routeStructureDocType, String id, CoreSession session)
Finds the first domain by name, and creates under it the root container for the structure containing the route instances.
-
createModelsRoutesStructure
protected DocumentModel createModelsRoutesStructure(String routeStructureDocType, String id, CoreSession session)
Create the rootModels under to root document. Grant READ to everyone on the root models ; workflow availability is specified on each route
-
getUserManager
protected UserManager getUserManager()
-
getDocumentRoutesStructure
protected DocumentModel getDocumentRoutesStructure(String type, CoreSession session)
-
getParentFolderForNewModel
public DocumentModel getParentFolderForNewModel(CoreSession session, DocumentModel instance)
Description copied from interface:DocumentRoutingPersister
Returns a folder in which new model, created from an instance of route will be stored.- Specified by:
getParentFolderForNewModel
in interfaceDocumentRoutingPersister
- Parameters:
session
- the session of the userinstance
- the instance that will be persisted as new model.
-
getNewModelName
public String getNewModelName(DocumentModel instance)
Description copied from interface:DocumentRoutingPersister
Return the new name of a model when it is created from an instance.- Specified by:
getNewModelName
in interfaceDocumentRoutingPersister
- Returns:
- the new name
- See Also:
DocumentRoutingService.saveRouteAsNewModel(DocumentRoute, CoreSession)
-
undoReadOnlySecurityPolicy
protected DocumentModel undoReadOnlySecurityPolicy(DocumentModel instance, CoreSession session)
-
getParentFolderForDocumentRouteModels
public DocumentModel getParentFolderForDocumentRouteModels(CoreSession session)
Description copied from interface:DocumentRoutingPersister
Gets or creates the parent folder for aDocumentRoute
route instance.- Specified by:
getParentFolderForDocumentRouteModels
in interfaceDocumentRoutingPersister
- Returns:
- The parent folder in which the
DocumentRoute
will be persisted.
-
-