fr.paris.lutece.plugins.newsletter.modules.document.service
Class NewsletterDocumentService

java.lang.Object
  extended by fr.paris.lutece.plugins.newsletter.modules.document.service.NewsletterDocumentService

public class NewsletterDocumentService
extends Object

Newsletter document service. This class implements the singleton design pattern.


Constructor Summary
NewsletterDocumentService()
           
 
Method Summary
 String copyFileFromDocument(fr.paris.lutece.plugins.document.business.Document document, String strFileType, String strDestFolderPath)
          Copy specified document's type file into a given folder
 String fillTemplateWithDocumentInfos(String strTemplatePath, fr.paris.lutece.plugins.document.business.Document document, Locale locale, String strBaseUrl, fr.paris.lutece.portal.business.user.AdminUser user)
          Fills a given document template with the document data
 String generateDocumentsList(NewsletterDocument newsletterDocument, int nTemplateId, Timestamp datePublishing, String strBaseUrl, fr.paris.lutece.portal.business.user.AdminUser user, Locale locale)
          Generate the html code for documents corresponding to the documents associated with the topic and to a given publishing date
static NewsletterDocumentService getInstance()
          Returns the instance of the singleton
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NewsletterDocumentService

public NewsletterDocumentService()
Method Detail

getInstance

public static NewsletterDocumentService getInstance()
Returns the instance of the singleton

Returns:
The instance of the singleton

copyFileFromDocument

public String copyFileFromDocument(fr.paris.lutece.plugins.document.business.Document document,
                                   String strFileType,
                                   String strDestFolderPath)
Copy specified document's type file into a given folder

Parameters:
document - the document
strFileType - the file type
strDestFolderPath - the destination folder
Returns:
name of the copy file or null if there is no copied file

generateDocumentsList

public String generateDocumentsList(NewsletterDocument newsletterDocument,
                                    int nTemplateId,
                                    Timestamp datePublishing,
                                    String strBaseUrl,
                                    fr.paris.lutece.portal.business.user.AdminUser user,
                                    Locale locale)
Generate the html code for documents corresponding to the documents associated with the topic and to a given publishing date

Parameters:
newsletterDocument - the topic to generate
nTemplateId - the document id to use
datePublishing - minimum date of publishing of documents. Documents published before this date will not be considered
strBaseUrl - the url of the portal
user - The current admin user
locale - The locale
Returns:
the html code for the document list of null if no document template available

fillTemplateWithDocumentInfos

public String fillTemplateWithDocumentInfos(String strTemplatePath,
                                            fr.paris.lutece.plugins.document.business.Document document,
                                            Locale locale,
                                            String strBaseUrl,
                                            fr.paris.lutece.portal.business.user.AdminUser user)
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
locale - the locale used to build the template
user - The current user
Returns:
the html code corresponding to the document data


Copyright © 2013 Mairie de Paris. All Rights Reserved.