Interface CmsTemplateService

All Known Implementing Classes:
CmsTemplateServiceImpl

public interface CmsTemplateService
This service manages the cms templates in the database.
  • Method Details

    • createOrUpdate

      void createOrUpdate(CmsTemplate cmsTemplate)
      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

      void delete(String uniqueId)
      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

      boolean isInUse(String uniqueId)
      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

      List<CmsTemplate> findEnabledByType(String type)
      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

      List<CmsTemplate> findByType(String type)
      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

      Optional<CmsTemplate> findByUniqueId(String uniqueId)
      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.