Class DefaultDocumentTemplateService
- java.lang.Object
-
- org.silverpeas.core.documenttemplate.DefaultDocumentTemplateService
-
- All Implemented Interfaces:
DocumentTemplateService
@Service public class DefaultDocumentTemplateService extends Object implements DocumentTemplateService
Default implementation of document template service interface.This implementation uses
DocumentTemplateRepository
for repository management.- Author:
- silveryocha
-
-
Constructor Summary
Constructors Constructor Description DefaultDocumentTemplateService()
-
Method Summary
All Methods Instance Methods Concrete 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
public Optional<DocumentTemplate> getById(String id)
Description copied from interface:DocumentTemplateService
Gets the document template from given identifier.- Specified by:
getById
in interfaceDocumentTemplateService
- Returns:
- an optional
DocumentTemplate
instance
-
put
public DocumentTemplate put(DocumentTemplate documentTemplate, InputStream content)
Description copied from interface:DocumentTemplateService
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.
- Specified by:
put
in interfaceDocumentTemplateService
- 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.
-
remove
public void remove(DocumentTemplate documentTemplate)
Description copied from interface:DocumentTemplateService
Removes the given document template from the Silverpeas's context.- Specified by:
remove
in interfaceDocumentTemplateService
- Parameters:
documentTemplate
- a document template representation.
-
listAll
public List<DocumentTemplate> listAll()
Description copied from interface:DocumentTemplateService
List all the document templates from Silverpeas's context sorted onDocumentTemplate.getPosition()
value.- Specified by:
listAll
in interfaceDocumentTemplateService
- Returns:
- a list of
DocumentTemplate
instance.
-
-