Interface DocumentTemplateRepository
-
- All Known Implementing Classes:
DefaultDocumentTemplateRepository
public interface DocumentTemplateRepository
This interface defines the abilities a document template repository MUST provide.- Author:
- silveryocha
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DocumentTemplate
create(DocumentTemplate documentTemplate, InputStream content)
Creates the given document template into the repository.void
delete(DocumentTemplate documentTemplate)
Deletes the given document template from the repository.Optional<DocumentTemplate>
getById(String id)
Gets the document template from given identifier.Stream<DocumentTemplate>
streamAll()
Lists all document template registered into repository.DocumentTemplate
update(DocumentTemplate documentTemplate, InputStream content)
Updates the given document template into the repository.
-
-
-
Method Detail
-
getById
Optional<DocumentTemplate> getById(String id)
Gets the document template from given identifier.- Returns:
- an optional
DocumentTemplate
instance
-
streamAll
Stream<DocumentTemplate> streamAll()
Lists all document template registered into repository.- Returns:
- a list of
DocumentTemplate
instance. The list is not sorted.
-
create
DocumentTemplate create(DocumentTemplate documentTemplate, InputStream content)
Creates the given document template into the repository.- Parameters:
documentTemplate
- theDocumentTemplate
instance to take into account.content
- the content of the document template.- Returns:
- the document template created into Silverpeas's context.
- Throws:
DocumentTemplateRuntimeException
- if the document template already exists.
-
update
DocumentTemplate update(DocumentTemplate documentTemplate, InputStream content)
Updates the given document template into the repository.- Parameters:
documentTemplate
- theDocumentTemplate
instance to take into account.content
- the content of the document template.- Returns:
- the document template updated into Silverpeas's context.
- Throws:
DocumentTemplateRuntimeException
- if the document template is not found against itsDocumentTemplate.getId()
value.
-
delete
void delete(DocumentTemplate documentTemplate)
Deletes the given document template from the repository.- Parameters:
documentTemplate
- theDocumentTemplate
instance to take into account.- Throws:
DocumentTemplateRuntimeException
- if the document template is not found against itsDocumentTemplate.getId()
value.
-
-