Interface DocumentRoutingPersister
-
- All Known Implementing Classes:
DocumentRoutingTreePersister
public interface DocumentRoutingPersisterThe DocumentRoutingPersister is responsible creating a folder structure to persistDocumentRouteinstance, persisting newDocumentRouteinstances and creatingDocumentRoutemodel fromDocumentRouteinstance.- Author:
- arussel
-
-
Field Summary
Fields Modifier and Type Field Description static StringDocumentRouteInstanceRootNameThe name of the document in which will be create
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DocumentModelcreateDocumentRouteInstanceFromDocumentRouteModel(DocumentModel model, CoreSession session)Creates a blankDocumentRouteinstance from a model.StringgetNewModelName(DocumentModel instance)Return the new name of a model when it is created from an instance.DocumentModelgetOrCreateRootOfDocumentRouteInstanceStructure(CoreSession session)Will get, and create if it does not exists the root document in whichDocumentRoutestructure will be created.DocumentModelgetParentFolderForDocumentRouteInstance(DocumentModel document, CoreSession session)Get or create the parent folder for aDocumentRouteroute instance.DocumentModelgetParentFolderForDocumentRouteModels(CoreSession session)Gets or creates the parent folder for aDocumentRouteroute instance.DocumentModelgetParentFolderForNewModel(CoreSession session, DocumentModel instance)Returns a folder in which new model, created from an instance of route will be stored.DocumentModelsaveDocumentRouteInstanceAsNewModel(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 aDocumentRouteroute instance.- Parameters:
document- TheDocumentRoutemodel from which the instance will be created. Its metadata may be used when creating the parent.- Returns:
- The parent folder in which the
DocumentRoutewill be persisted.
-
createDocumentRouteInstanceFromDocumentRouteModel
DocumentModel createDocumentRouteInstanceFromDocumentRouteModel(DocumentModel model, CoreSession session)
Creates a blankDocumentRouteinstance 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 whichDocumentRoutestructure will be created.- Parameters:
session- The session use to get or create the document.- Returns:
- The root of the
DocumentRoutestructure.
-
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 aDocumentRouteroute instance.- Returns:
- The parent folder in which the
DocumentRoutewill be persisted. - Since:
- 5.6
-
-