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.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. |
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 |
getParentFolderForNewModel(CoreSession session,
DocumentModel instance)
Returns a folder in which new model, created from an instance of route
will be stored.
|
DocumentModel |
saveDocumentRouteInstanceAsNewModel(DocumentModel routeInstance,
DocumentModel parentFolder,
CoreSession session) |
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, 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.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)
Copyright © 2011 Nuxeo SA. All Rights Reserved.