Class CmsTemplateServiceImpl
java.lang.Object
ch.tocco.nice2.optional.cms.impl.template.CmsTemplateServiceImpl
- All Implemented Interfaces:
CmsTemplateService
-
Constructor Summary
ConstructorDescriptionCmsTemplateServiceImpl
(org.slf4j.Logger log, Context context, QueryBuilderFactory queryBuilderFactory, CascadingDelete cascadingDelete, SecurityManager securityManager, L10N l10n, TextResources textResources, EntityDefaultValueService defaultValueService) -
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.
-
Constructor Details
-
CmsTemplateServiceImpl
public CmsTemplateServiceImpl(org.slf4j.Logger log, Context context, QueryBuilderFactory queryBuilderFactory, CascadingDelete cascadingDelete, SecurityManager securityManager, L10N l10n, TextResources textResources, EntityDefaultValueService defaultValueService)
-
-
Method Details
-
createOrUpdate
Description copied from interface:CmsTemplateService
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.- Specified by:
createOrUpdate
in interfaceCmsTemplateService
- Parameters:
cmsTemplate
- The template bean to store in the database.
-
delete
Description copied from interface:CmsTemplateService
Delete a template.- Specified by:
delete
in interfaceCmsTemplateService
- Parameters:
uniqueId
- The unique id of the template to delete.
-
isInUse
Description copied from interface:CmsTemplateService
Method to determine if a template is in use.- Specified by:
isInUse
in interfaceCmsTemplateService
- Parameters:
uniqueId
- The unique id of the template to check.- Returns:
- true if the template is in use, else false.
-
findEnabledByType
Description copied from interface:CmsTemplateService
Get a list of all cms templates of a certain type which are enabled.- Specified by:
findEnabledByType
in interfaceCmsTemplateService
- Parameters:
type
- The type to filter.- Returns:
- a list of all templates of the given type which are enabled.
-
findByType
Description copied from interface:CmsTemplateService
Get a list of all cms templates of a certain type.- Specified by:
findByType
in interfaceCmsTemplateService
- Parameters:
type
- The type to filter.- Returns:
- a list of all templates of the given type.
-
findByUniqueId
Description copied from interface:CmsTemplateService
Get the template with the given unique id.- Specified by:
findByUniqueId
in interfaceCmsTemplateService
- Parameters:
uniqueId
- The unique id of the template to return.- Returns:
- an
Optional
containing the template.
-
findExternal
Description copied from interface:CmsTemplateService
Get a list of all external cms templates.- Specified by:
findExternal
in interfaceCmsTemplateService
- Returns:
- a list of all external cms templates.
-