info.magnolia.module.templating
Class TemplateManager

java.lang.Object
  extended by info.magnolia.cms.beans.config.ObservedManager
      extended by info.magnolia.module.templating.TemplateManager

public class TemplateManager
extends info.magnolia.cms.beans.config.ObservedManager

Manages the templates of the system.

Author:
philipp

Field Summary
 
Fields inherited from class info.magnolia.cms.beans.config.ObservedManager
log, registeredUUIDs
 
Constructor Summary
TemplateManager()
           
 
Method Summary
 Iterator<Template> getAvailableTemplates()
          Get templates collection.
 Iterator<Template> getAvailableTemplates(info.magnolia.cms.core.Content node)
           
 Template getDefaultTemplate(info.magnolia.cms.core.Content node)
          Get the Template that could be used for the provided Content as a default.
 Template getInfo(String key)
          Deprecated. since 4.0 Use getTemplateDefinition(String) instead
 Template getInfo(String key, String extension)
          Returns the cached content of the requested template.
static TemplateManager getInstance()
           
 Template getTemplateDefinition(String key)
          Returns the cached content of the requested template.
protected  void onClear()
           
protected  void onRegister(info.magnolia.cms.core.Content node)
          Called by the ObservedManager.
 
Methods inherited from class info.magnolia.cms.beans.config.ObservedManager
clear, register, reload, reload
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateManager

public TemplateManager()
Method Detail

onRegister

protected void onRegister(info.magnolia.cms.core.Content node)
Called by the ObservedManager.

Specified by:
onRegister in class info.magnolia.cms.beans.config.ObservedManager

onClear

protected void onClear()
Specified by:
onClear in class info.magnolia.cms.beans.config.ObservedManager

getInfo

@Deprecated
public Template getInfo(String key)
Deprecated. since 4.0 Use getTemplateDefinition(String) instead

Returns the cached content of the requested template. TemplateInfo properties:
  1. title - title describing template
  2. type - jsp / servlet
  3. path - jsp / servlet path
  4. description - description of a template

Returns:
TemplateInfo

getTemplateDefinition

public Template getTemplateDefinition(String key)
Returns the cached content of the requested template. TemplateInfo properties:
  1. title - title describing template
  2. type - jsp / servlet
  3. path - jsp / servlet path
  4. description - description of a template

Returns:
TemplateInfo

getInfo

public Template getInfo(String key,
                        String extension)
Returns the cached content of the requested template. TemplateInfo properties:
  1. title - title describing template
  2. type - jsp / servlet
  3. path - jsp / servlet path
  4. description - description of a template

Returns:
TemplateInfo

getAvailableTemplates

public Iterator<Template> getAvailableTemplates(info.magnolia.cms.core.Content node)

getAvailableTemplates

public Iterator<Template> getAvailableTemplates()
Get templates collection.

Returns:
Collection list containing templates as Template objects

getDefaultTemplate

public Template getDefaultTemplate(info.magnolia.cms.core.Content node)
Get the Template that could be used for the provided Content as a default.


getInstance

public static TemplateManager getInstance()
Returns:
Returns the instance.


Copyright © 2003-2010 Magnolia International Ltd.. All Rights Reserved.