Interface DocumentTemplateService
-
- All Known Implementing Classes:
DefaultDocumentTemplateService
public interface DocumentTemplateService
Services dedicated to document template manipulations.- Author:
- silveryocha
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<DocumentTemplate>
getById(String id)
Gets the document template from given identifier.List<DocumentTemplate>
listAll()
List all the document templates from Silverpeas's context sorted onDocumentTemplate.getPosition()
value.DocumentTemplate
put(DocumentTemplate documentTemplate, InputStream content)
Puts the given document template into Silverpeas's context.void
remove(DocumentTemplate documentTemplate)
Removes the given document template from the Silverpeas's context.
-
-
-
Method Detail
-
getById
Optional<DocumentTemplate> getById(String id)
Gets the document template from given identifier.- Returns:
- an optional
DocumentTemplate
instance
-
put
DocumentTemplate put(DocumentTemplate documentTemplate, InputStream content)
Puts the given document template into Silverpeas's context.If document template does not yet exists (no identifier), then the document template is created into repository (a new identifier is automatically generated).
If the document template does already exist (id is defined), then the document template is updated into repository.
- Parameters:
documentTemplate
- a document template representation.content
- anInputStream
instance over the document template content. This stream is optional in case of an update.- Returns:
- the document template putted into Silverpeas's context.
- Throws:
DocumentTemplateRuntimeException
- in case of data integrity error.
-
remove
void remove(DocumentTemplate documentTemplate)
Removes the given document template from the Silverpeas's context.- Parameters:
documentTemplate
- a document template representation.- Throws:
DocumentTemplateRuntimeException
- in case of data integrity error.
-
listAll
List<DocumentTemplate> listAll()
List all the document templates from Silverpeas's context sorted onDocumentTemplate.getPosition()
value.- Returns:
- a list of
DocumentTemplate
instance.
-
-