TemplateService

public interface TemplateService

Template service, manages IVR templates. A org.motechproject.ivr.domain.Template usually contains text to be returned to the IVR provider as CCXML/VXML. See org.motechproject.ivr.domain.Template

Methods

allTemplates

List<Template> allTemplates()

Retrieves all templates stored in the configuration system.

Returns:the list of all templates

getTemplate

Template getTemplate(String name)

Retrieves the template with the given name.

Parameters:
  • name – the name of the template to retrieve
Throws:
Returns:

the template with the given name, never null

hasTemplate

boolean hasTemplate(String name)

Checks whether the template with the given name exists.

Parameters:
  • name – the name to check
Returns:

true if the template with the given name exists, false otherwise

updateTemplates

void updateTemplates(List<Template> templates)

Updates the templates. The old templates collection is overwritten by the new one.

Parameters:
  • templates – the collection of configurations to save