info.magnolia.module.templating
Class ParagraphManager

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

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

Manages the paragraphs on the system. Modules can register the nodes where the paragraphs are defined.

Author:
philipp

Field Summary
 
Fields inherited from class info.magnolia.cms.beans.config.ObservedManager
log, registeredUUIDs
 
Constructor Summary
ParagraphManager()
           
 
Method Summary
protected  void addParagraphToCache(info.magnolia.cms.core.Content c)
          Adds paragraph definition to ParagraphInfo cache.
 void addParagraphToCache(Paragraph paragraph)
           
 Paragraph getInfo(String key)
          Deprecated. since 4.0 Use getParagraphDefinition(String) instead
static ParagraphManager getInstance()
          Gets the current singleton instance.
 Paragraph getParagraphDefinition(String key)
          Returns the cached content of the requested template.
 Map<String,Paragraph> getParagraphs()
          Get a map of all registered paragraphs.
 void onClear()
           
protected  void onRegister(info.magnolia.cms.core.Content node)
          Register all the paragraphs under this and subnodes.
 
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

ParagraphManager

public ParagraphManager()
Method Detail

getInstance

public static ParagraphManager getInstance()
Gets the current singleton instance.


getInfo

public Paragraph getInfo(String key)
Deprecated. since 4.0 Use getParagraphDefinition(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:
a Paragraph instance

getParagraphDefinition

public Paragraph getParagraphDefinition(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:
a Paragraph instance

getParagraphs

public Map<String,Paragraph> getParagraphs()
Get a map of all registered paragraphs.


onRegister

protected void onRegister(info.magnolia.cms.core.Content node)
Register all the paragraphs under this and subnodes.

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

addParagraphToCache

protected void addParagraphToCache(info.magnolia.cms.core.Content c)
Adds paragraph definition to ParagraphInfo cache.


addParagraphToCache

public void addParagraphToCache(Paragraph paragraph)
Parameters:
paragraph -

onClear

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


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