public class DocumentRoutingTreePersister extends Object implements DocumentRoutingPersister
DocumentRoute
in a tree hierarchy ressembling the current date. New
model created from instance are stored in the personal workspace of the user.Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log |
DocumentRouteInstanceRootName
Constructor and Description |
---|
DocumentRoutingTreePersister() |
Modifier and Type | Method and Description |
---|---|
DocumentModel |
createDocumentRouteInstanceFromDocumentRouteModel(DocumentModel model,
CoreSession session)
Creates a blank
DocumentRoute 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 which
DocumentRoute structure will be
created. |
DocumentModel |
getParentFolderForDocumentRouteInstance(DocumentModel document,
CoreSession session)
Get or create the parent folder for a
DocumentRoute route instance. |
DocumentModel |
getParentFolderForDocumentRouteModels(CoreSession session)
Gets or creates the parent folder for a
DocumentRoute 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) |
protected static final org.apache.commons.logging.Log log
public DocumentRoutingTreePersister()
public DocumentModel getParentFolderForDocumentRouteInstance(DocumentModel document, CoreSession session)
DocumentRoutingPersister
DocumentRoute
route instance.getParentFolderForDocumentRouteInstance
in interface DocumentRoutingPersister
document
- The DocumentRoute
model from which the instance will be created. Its metadata may be used
when creating the parent.DocumentRoute
will be persisted.public DocumentModel createDocumentRouteInstanceFromDocumentRouteModel(DocumentModel model, CoreSession session)
DocumentRoutingPersister
DocumentRoute
instance from a model.createDocumentRouteInstanceFromDocumentRouteModel
in interface DocumentRoutingPersister
model
- the modelDocumentRoute
public DocumentModel saveDocumentRouteInstanceAsNewModel(DocumentModel routeInstance, DocumentModel parentFolder, String newName, CoreSession session)
saveDocumentRouteInstanceAsNewModel
in interface DocumentRoutingPersister
public DocumentModel getOrCreateRootOfDocumentRouteInstanceStructure(CoreSession session)
DocumentRoutingPersister
DocumentRoute
structure will be
created.getOrCreateRootOfDocumentRouteInstanceStructure
in interface DocumentRoutingPersister
session
- The session use to get or create the document.DocumentRoute
structure.protected DocumentModel createDocumentRoutesStructure(String routeStructureDocType, String id, CoreSession session)
protected DocumentModel createModelsRoutesStructure(String routeStructureDocType, String id, CoreSession session)
routeStructureDocType
- id
- session
- protected UserManager getUserManager()
protected DocumentModel getDocumentRoutesStructure(String type, CoreSession session)
public DocumentModel getParentFolderForNewModel(CoreSession session, DocumentModel instance)
DocumentRoutingPersister
getParentFolderForNewModel
in interface DocumentRoutingPersister
session
- the session of the userinstance
- the instance that will be persisted as new model.public String getNewModelName(DocumentModel instance)
DocumentRoutingPersister
getNewModelName
in interface DocumentRoutingPersister
DocumentRoutingService#saveRouteAsNewModel(DocumentRoute, String, CoreSession)
protected DocumentModel undoReadOnlySecurityPolicy(DocumentModel instance, CoreSession session)
public DocumentModel getParentFolderForDocumentRouteModels(CoreSession session)
DocumentRoutingPersister
DocumentRoute
route instance.getParentFolderForDocumentRouteModels
in interface DocumentRoutingPersister
DocumentRoute
will be persisted.Copyright © 2017 Nuxeo. All rights reserved.