## com.imcode.imcms.api
Class TemplateService

    java.lang.Object
      com.imcode.imcms.api.TemplateService

    public class TemplateService

extends java.lang.Object

Method Summary
`TemplateGroup[]` `getAllTemplateGroups()` Get all the template groups found in the system.
`Template[]` `getPossibleTemplates(TextDocument textDocument)` Get an array of all templates that may be used for a TextDocument.
`Template` `getTemplate(java.lang.String templateName)`
`TemplateGroup` `getTemplateGroupById(int templateGroupId)`
`Template[]` `getTemplates(TemplateGroup templateGroup)` Get an array of all the Templates in a TemplateGroup.
`TemplateGroup[]` `getTemplatesGroups(TextDocument textDocument)` Get a list of all template groups the calling user has right to see for this document

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getTemplatesGroups

    public TemplateGroup[] getTemplatesGroups(TextDocument textDocument)
                                       throws NoPermissionException

  Get a list of all template groups the calling user has right to see for this document

  Parameters:
    `textDocument` - The textDocument for witch we would like to see the possible groups.
  Returns:
    Only the templategroups that the current logged in user has the permissions to see
  Throws:
    `NoPermissionException` - If the current user isn't superadmin

### getAllTemplateGroups

    public TemplateGroup[] getAllTemplateGroups()

  Get all the template groups found in the system.

  Returns:
    An array of template groups

### getTemplates

    public Template[] getTemplates(TemplateGroup templateGroup)
                            throws NoPermissionException

  Get an array of all the Templates in a TemplateGroup.

  Parameters:
    `templateGroup` - The wanted TemplateGroup
  Returns:
    An array of all the Templates in the given TemplateGroup
  Throws:
    `NoPermissionException` - If the current user doesn't have permission to list the templates in the templategroup.

### getPossibleTemplates

    public Template[] getPossibleTemplates(TextDocument textDocument)
                                    throws NoPermissionException

  Get an array of all templates that may be used for a TextDocument.

  Parameters:
    `textDocument` - The TextDocument
  Returns:
    An array of all templates that may be used for the given TextDocument.
  Throws:
    `NoPermissionException`

### getTemplate

    public Template getTemplate(java.lang.String templateName)

### getTemplateGroupById

    public TemplateGroup getTemplateGroupById(int templateGroupId)