Interface DocumentRoutingPersister
- All Known Implementing Classes:
DocumentRoutingTreePersister
public interface DocumentRoutingPersister
The DocumentRoutingPersister is responsible creating a folder structure to persist
DocumentRoute
instance,
persisting new DocumentRoute
instances and creating DocumentRoute
model from DocumentRoute
instance.- Author:
- arussel
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The name of the document in which will be create -
Method Summary
Modifier and TypeMethodDescriptionCreates a blankDocumentRoute
instance from a model.getNewModelName
(DocumentModel instance) Return the new name of a model when it is created from an instance.Will get, and create if it does not exists the root document in whichDocumentRoute
structure will be created.getParentFolderForDocumentRouteInstance
(DocumentModel document, CoreSession session) Get or create the parent folder for aDocumentRoute
route instance.Gets or creates the parent folder for aDocumentRoute
route instance.getParentFolderForNewModel
(CoreSession session, DocumentModel instance) Returns a folder in which new model, created from an instance of route will be stored.saveDocumentRouteInstanceAsNewModel
(DocumentModel routeInstance, DocumentModel parentFolder, String newName, CoreSession session)
-
Field Details
-
DocumentRouteInstanceRootName
The name of the document in which will be create- See Also:
-
-
Method Details
-
getParentFolderForDocumentRouteInstance
Get or create the parent folder for aDocumentRoute
route instance.- 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
DocumentModel createDocumentRouteInstanceFromDocumentRouteModel(DocumentModel model, CoreSession session) Creates a blankDocumentRoute
instance from a model.- Parameters:
model
- the model- Returns:
- The created
DocumentRoute
-
saveDocumentRouteInstanceAsNewModel
DocumentModel saveDocumentRouteInstanceAsNewModel(DocumentModel routeInstance, DocumentModel parentFolder, String newName, CoreSession session) -
getOrCreateRootOfDocumentRouteInstanceStructure
Will get, and create if it does not exists the root document in whichDocumentRoute
structure will be created.- Parameters:
session
- The session use to get or create the document.- Returns:
- The root of the
DocumentRoute
structure.
-
getParentFolderForNewModel
Returns a folder in which new model, created from an instance of route will be stored.- Parameters:
session
- the session of the userinstance
- the instance that will be persisted as new model.
-
getNewModelName
Return the new name of a model when it is created from an instance.- Returns:
- the new name
- See Also:
-
getParentFolderForDocumentRouteModels
Gets or creates the parent folder for aDocumentRoute
route instance.- Returns:
- The parent folder in which the
DocumentRoute
will be persisted. - Since:
- 5.6
-