fr.opensagres.xdocreport.template.utils
Class TemplateUtils

java.lang.Object
  extended by fr.opensagres.xdocreport.template.utils.TemplateUtils

public class TemplateUtils
extends Object

Utilities for template cache, context.


Constructor Summary
TemplateUtils()
           
 
Method Summary
static String getCachedTemplateName(String reportId, String entryName)
          Returns the template cache name used to cache the given entry name (which is a template) of the given report id.
static String getEntryName(String cachedTemplateName, int index)
          Returns the entry name of of the given cached template name.
static int getIndexReportEntryName(String cachedTemplateName)
          Returns the last index of the token '!'
static String getReportId(String cachedTemplateName, int index)
          Returns the report of of the given cached template name.
static IEntryInfo getTemplateCacheInfo(ITemplateCacheInfoProvider templateCacheInfoProvider, String templateName)
           
static Object putContextForDottedKey(IContext context, String key, Object value)
          If key has '.' character in the key (ex : project.name), this method create a DynamicBean instance to emulate the bean Project#getName().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateUtils

public TemplateUtils()
Method Detail

getCachedTemplateName

public static String getCachedTemplateName(String reportId,
                                           String entryName)
Returns the template cache name used to cache the given entry name (which is a template) of the given report id.

Parameters:
reportId - report id.
entryName - entry name.
Returns:

getIndexReportEntryName

public static int getIndexReportEntryName(String cachedTemplateName)
Returns the last index of the token '!' from the cachedTemplateName which delimit reportId and entryName.

Parameters:
cachedTemplateName - cached template name which follow pattern ($reportId '!' $entryName).
Returns:

getReportId

public static String getReportId(String cachedTemplateName,
                                 int index)
Returns the report of of the given cached template name.

Parameters:
cachedTemplateName - cached template name which follow pattern ($reportId '!' $entryName).
index - of the '!' character.
Returns:

getEntryName

public static String getEntryName(String cachedTemplateName,
                                  int index)
Returns the entry name of of the given cached template name.

Parameters:
cachedTemplateName - cached template name which follow pattern ($reportId '!' $entryName).
index - of the '!' character.
Returns:

getTemplateCacheInfo

public static IEntryInfo getTemplateCacheInfo(ITemplateCacheInfoProvider templateCacheInfoProvider,
                                              String templateName)
Parameters:
templateCacheInfoProvider -
templateName -
Returns:

putContextForDottedKey

public static Object putContextForDottedKey(IContext context,
                                            String key,
                                            Object value)
If key has '.' character in the key (ex : project.name), this method create a DynamicBean instance to emulate the bean Project#getName().

Parameters:
context -
key -
value -
Returns:


Copyright © 2013. All rights reserved.