Interface CmsTemplateService
- All Known Implementing Classes:
CmsTemplateServiceImpl
public interface CmsTemplateService
This service manages the cms templates in the database.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createOrUpdate
(CmsTemplate cmsTemplate) Update a template or create a new one, if it does not exist yet.void
Delete a template.findByType
(String type) Get a list of all cms templates of a certain type.findByUniqueId
(String uniqueId) Get the template with the given unique id.findEnabledByType
(String type) Get a list of all cms templates of a certain type which are enabled.Get a list of all external cms templates.boolean
Method to determine if a template is in use.
-
Method Details
-
createOrUpdate
Update a template or create a new one, if it does not exist yet. If there is a template with the same unique id but not of the same type, he method will return immediately and there will be no changes in the database.- Parameters:
cmsTemplate
- The template bean to store in the database.
-
delete
Delete a template.- Parameters:
uniqueId
- The unique id of the template to delete.- Throws:
TemplateInUseException
- if the template is in use and cannot be deleted.
-
isInUse
Method to determine if a template is in use.- Parameters:
uniqueId
- The unique id of the template to check.- Returns:
- true if the template is in use, else false.
-
findEnabledByType
Get a list of all cms templates of a certain type which are enabled.- Parameters:
type
- The type to filter.- Returns:
- a list of all templates of the given type which are enabled.
-
findByType
Get a list of all cms templates of a certain type.- Parameters:
type
- The type to filter.- Returns:
- a list of all templates of the given type.
-
findByUniqueId
Get the template with the given unique id.- Parameters:
uniqueId
- The unique id of the template to return.- Returns:
- an
Optional
containing the template.
-
findExternal
List<CmsTemplate> findExternal()Get a list of all external cms templates.- Returns:
- a list of all external cms templates.
-