Class DocumentTemplateWebManager
- java.lang.Object
-
- org.silverpeas.core.webapi.documenttemplate.DocumentTemplateWebManager
-
@Service public class DocumentTemplateWebManager extends Object
Permits to centralize WEB service processing betweenDocumentTemplateResource
and the WAR controller.- Author:
- silveryocha
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DocumentTemplateWebManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearCachedList()
Clears the cached list of document template.DocumentTemplate
createDocumentTemplate(DocumentTemplate newDocumentTemplate, UploadedFile content)
Creates a category into Silverpeas's context.void
deleteDocumentTemplates(List<String> documentTemplateIds)
Deletes document templates from their identifier.boolean
existsDocumentTemplate()
Indicates if it exists at least one document template.static DocumentTemplateWebManager
get()
List<DocumentTemplate>
getAllDocumentTemplates()
Gets all the sorted list of document templates.DocumentTemplate
getDocumentTemplate(String id)
Gets the document template data from its identifier.void
sortDocumentTemplates(List<String> sortedDocumentTemplateIds)
Sorts the document templates against the given sorted list of document template identifier.DocumentTemplate
updateDocumentTemplate(DocumentTemplate updatedDocumentTemplate, UploadedFile content)
Updates a document template into Silverpeas's context.
-
-
-
Method Detail
-
get
public static DocumentTemplateWebManager get()
-
getDocumentTemplate
public DocumentTemplate getDocumentTemplate(String id)
Gets the document template data from its identifier.- Parameters:
id
- the identifier of a document template.- Returns:
- a
DocumentTemplate
instance or throws exception if not found is unknown.
-
createDocumentTemplate
public DocumentTemplate createDocumentTemplate(DocumentTemplate newDocumentTemplate, UploadedFile content)
Creates a category into Silverpeas's context.- Parameters:
newDocumentTemplate
- data of a new document template.content
- the document template content (mandatory).- Returns:
- the new document template instance.
-
updateDocumentTemplate
public DocumentTemplate updateDocumentTemplate(DocumentTemplate updatedDocumentTemplate, UploadedFile content)
Updates a document template into Silverpeas's context.- Parameters:
updatedDocumentTemplate
- data of an updated document template.content
- the document template content (mandatory).- Returns:
- the saved data.
-
deleteDocumentTemplates
public void deleteDocumentTemplates(List<String> documentTemplateIds)
Deletes document templates from their identifier.- Parameters:
documentTemplateIds
- list of document template identifier.
-
sortDocumentTemplates
public void sortDocumentTemplates(List<String> sortedDocumentTemplateIds)
Sorts the document templates against the given sorted list of document template identifier.- Parameters:
sortedDocumentTemplateIds
- list of identifier as string.
-
clearCachedList
public void clearCachedList()
Clears the cached list of document template.
-
getAllDocumentTemplates
public List<DocumentTemplate> getAllDocumentTemplates()
Gets all the sorted list of document templates.No filtering rule is performed.
- Returns:
- a list of
DocumentTemplate
instance.
-
existsDocumentTemplate
public boolean existsDocumentTemplate()
Indicates if it exists at least one document template.- Returns:
- true if exists, false otherwise.
-
-