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 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(Content node)
           
 Template getDefaultTemplate(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()
          The implementor should clear everthing.
protected  void onRegister(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(Content node)
Called by the ObservedManager.

Specified by:
onRegister in class ObservedManager

onClear

protected void onClear()
Description copied from class: ObservedManager
The implementor should clear everthing. If needed the nodes will get registered.

Specified by:
onClear in class 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(Content node)

getAvailableTemplates

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

Returns:
Collection list containing templates as Template objects

getDefaultTemplate

public Template getDefaultTemplate(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-2011 Magnolia International Ltd.. All Rights Reserved.