Interface DocumentRoutingPersister
-
- All Known Implementing Classes:
DocumentRoutingTreePersister
public interface DocumentRoutingPersister
The DocumentRoutingPersister is responsible creating a folder structure to persistDocumentRoute
instance, persisting newDocumentRoute
instances and creatingDocumentRoute
model fromDocumentRoute
instance.- Author:
- arussel
-
-
Field Summary
Fields Modifier and Type Field Description static String
DocumentRouteInstanceRootName
The name of the document in which will be create
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DocumentModel
createDocumentRouteInstanceFromDocumentRouteModel(DocumentModel model, CoreSession session)
Creates a blankDocumentRoute
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 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.DocumentModel
saveDocumentRouteInstanceAsNewModel(DocumentModel routeInstance, DocumentModel parentFolder, String newName, CoreSession session)
-
-
-
Field Detail
-
DocumentRouteInstanceRootName
static final String DocumentRouteInstanceRootName
The name of the document in which will be create- See Also:
- Constant Field Values
-
-
Method Detail
-
getParentFolderForDocumentRouteInstance
DocumentModel getParentFolderForDocumentRouteInstance(DocumentModel document, CoreSession session)
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
DocumentModel getOrCreateRootOfDocumentRouteInstanceStructure(CoreSession session)
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
DocumentModel getParentFolderForNewModel(CoreSession session, DocumentModel instance)
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
String getNewModelName(DocumentModel instance)
Return the new name of a model when it is created from an instance.- Returns:
- the new name
- See Also:
DocumentRoutingService.saveRouteAsNewModel(DocumentRoute, CoreSession)
-
getParentFolderForDocumentRouteModels
DocumentModel getParentFolderForDocumentRouteModels(CoreSession session)
Gets or creates the parent folder for aDocumentRoute
route instance.- Returns:
- The parent folder in which the
DocumentRoute
will be persisted. - Since:
- 5.6
-
-