fr.paris.lutece.plugins.newsletter.util
Class NewsletterUtils

java.lang.Object
  extended by fr.paris.lutece.plugins.newsletter.util.NewsletterUtils

public final class NewsletterUtils
extends java.lang.Object

This classe provides utility methods for newsletters.


Method Summary
static java.lang.String convertForJavascript(java.lang.String strIn)
          Cleans a string in order to make it usable in a javascript script
static java.lang.String encodeForURL(java.lang.String strEntry)
          Encode a string for passage in parameter in URL
static java.lang.String fillTemplateWithDocumentInfos(java.lang.String strTemplatePath, fr.paris.lutece.plugins.document.business.Document document, int nPortletId, fr.paris.lutece.portal.service.plugin.Plugin plugin, java.util.Locale locale, java.lang.String strBaseUrl)
          Fills a given document template with the document data
static java.lang.String getHtmlTemplatePath(int nTemplateId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Retrieve the html template for the given template id
static NewsletterUtils getInstance()
          Fetches the singleton instance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static NewsletterUtils getInstance()
Fetches the singleton instance

Returns:
The singleton instance

getHtmlTemplatePath

public static java.lang.String getHtmlTemplatePath(int nTemplateId,
                                                   fr.paris.lutece.portal.service.plugin.Plugin plugin)
Retrieve the html template for the given template id

Parameters:
nTemplateId - the id of the template to retrieve
plugin - the plugin
Returns:
the html template to use of null if no NewsletterTemplate found for this Id

convertForJavascript

public static java.lang.String convertForJavascript(java.lang.String strIn)
Cleans a string in order to make it usable in a javascript script

Parameters:
strIn - the string to clean
Returns:
the javascript escaped String

fillTemplateWithDocumentInfos

public static java.lang.String fillTemplateWithDocumentInfos(java.lang.String strTemplatePath,
                                                             fr.paris.lutece.plugins.document.business.Document document,
                                                             int nPortletId,
                                                             fr.paris.lutece.portal.service.plugin.Plugin plugin,
                                                             java.util.Locale locale,
                                                             java.lang.String strBaseUrl)
Fills a given document template with the document data

Parameters:
strBaseUrl - The base url of the portal
strTemplatePath - The path of the template file
document - the object gathering the document data
nPortletId - the portlet id
plugin - the plugin needed to retrieve properties
locale - the locale used to build the template
Returns:
the html code corresponding to the document data

encodeForURL

public static java.lang.String encodeForURL(java.lang.String strEntry)
Encode a string for passage in parameter in URL

Parameters:
strEntry - the string entry
Returns:
the string encoding


Copyright © 2008 Mairie de Paris. All Rights Reserved.