fr.paris.lutece.plugins.newsletter.modules.document.business
Class NewsletterDocumentDAO

java.lang.Object
  extended by fr.paris.lutece.plugins.newsletter.modules.document.business.NewsletterDocumentDAO
All Implemented Interfaces:
INewsletterDocumentDAO

public class NewsletterDocumentDAO
extends Object
implements INewsletterDocumentDAO

DAO implementation for newsletter document


Constructor Summary
NewsletterDocumentDAO()
           
 
Method Summary
 void associateNewsLetterDocumentCategory(int nTopicId, int nCategoryId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Associate a new category to a newsletter topic
 void associateNewsLetterDocumentPortlet(int nTopicId, int nPortletId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Associate a new portlet to a newsletter topic
 void createDocumentTopic(NewsletterDocument topic, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Insert a new newsletter document topic into the database
 void deleteDocumentTopic(int nIdTopic, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove a newsletter document topic from the database
 void deleteNewsLetterDocumentCategories(int nTopicId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove the relationship between a topic and the list of documents
 void deleteNewsLetterDocumentPortlet(int nTopicId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Remove the relationship between a topic and the list of portlets
 NewsletterDocument findByPrimaryKey(int nIdTopic, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get a newsletter document topic from its id
 boolean findTemplate(int nIdNewsletterTemplate, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Check if a template is used by a topic
 List<Integer> getPublishedDocumentsIdsListByPortletIds(int[] nPortletsIds, Date datePublishing, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of id of published documents associated with a given collection of portlets.
 fr.paris.lutece.util.ReferenceList selectDocumentListPortlets()
          Returns the list of the portlets which are document portlets
 Collection<fr.paris.lutece.plugins.document.business.Document> selectDocumentsByDateAndCategory(int nPortletId, Timestamp dateLastSending, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Select the list of documents published since the last sending of the newsletter
 int[] selectNewsletterCategoryIds(int nTopicId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          loads the list of categories linked to the newsletter
 int[] selectNewsletterPortletsIds(int nTopicId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          loads the list of document list portlets linked to the newsletter
 void updateDocumentTopic(NewsletterDocument topic, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update a newsletter document topic
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NewsletterDocumentDAO

public NewsletterDocumentDAO()
Method Detail

findByPrimaryKey

public NewsletterDocument findByPrimaryKey(int nIdTopic,
                                           fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get a newsletter document topic from its id

Specified by:
findByPrimaryKey in interface INewsletterDocumentDAO
Parameters:
nIdTopic - the id of the topic to get
plugin - The plugin
Returns:
The topic, or null if no topic was found

updateDocumentTopic

public void updateDocumentTopic(NewsletterDocument topic,
                                fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update a newsletter document topic

Specified by:
updateDocumentTopic in interface INewsletterDocumentDAO
Parameters:
topic - The topic to update
plugin - The plugin

deleteDocumentTopic

public void deleteDocumentTopic(int nIdTopic,
                                fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove a newsletter document topic from the database

Specified by:
deleteDocumentTopic in interface INewsletterDocumentDAO
Parameters:
nIdTopic - The id of the newsletter document topic to remove
plugin - The plugin

createDocumentTopic

public void createDocumentTopic(NewsletterDocument topic,
                                fr.paris.lutece.portal.service.plugin.Plugin plugin)
Insert a new newsletter document topic into the database

Specified by:
createDocumentTopic in interface INewsletterDocumentDAO
Parameters:
topic - The newsletter document topic to insert
plugin - the plugin

selectDocumentsByDateAndCategory

public Collection<fr.paris.lutece.plugins.document.business.Document> selectDocumentsByDateAndCategory(int nPortletId,
                                                                                                       Timestamp dateLastSending,
                                                                                                       fr.paris.lutece.portal.service.plugin.Plugin plugin)
Select the list of documents published since the last sending of the newsletter

Specified by:
selectDocumentsByDateAndCategory in interface INewsletterDocumentDAO
Parameters:
nPortletId - The id of the category
dateLastSending - the date of the last newsletter sending
plugin - the document Plugin
Returns:
a list of documents

selectDocumentListPortlets

public fr.paris.lutece.util.ReferenceList selectDocumentListPortlets()
Returns the list of the portlets which are document portlets

Specified by:
selectDocumentListPortlets in interface INewsletterDocumentDAO
Returns:
the list in form of a Collection object

associateNewsLetterDocumentCategory

public void associateNewsLetterDocumentCategory(int nTopicId,
                                                int nCategoryId,
                                                fr.paris.lutece.portal.service.plugin.Plugin plugin)
Associate a new category to a newsletter topic

Specified by:
associateNewsLetterDocumentCategory in interface INewsletterDocumentDAO
Parameters:
nTopicId - the topic id
nCategoryId - the document category identifier
plugin - the newsletter document plugin

deleteNewsLetterDocumentCategories

public void deleteNewsLetterDocumentCategories(int nTopicId,
                                               fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove the relationship between a topic and the list of documents

Specified by:
deleteNewsLetterDocumentCategories in interface INewsletterDocumentDAO
Parameters:
nTopicId - the topic id
plugin - the newsletter document plugin

selectNewsletterCategoryIds

public int[] selectNewsletterCategoryIds(int nTopicId,
                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
loads the list of categories linked to the newsletter

Specified by:
selectNewsletterCategoryIds in interface INewsletterDocumentDAO
Parameters:
nTopicId - the topic id
plugin - the newsletter document plugin
Returns:
the array of categories id

associateNewsLetterDocumentPortlet

public void associateNewsLetterDocumentPortlet(int nTopicId,
                                               int nPortletId,
                                               fr.paris.lutece.portal.service.plugin.Plugin plugin)
Associate a new portlet to a newsletter topic

Specified by:
associateNewsLetterDocumentPortlet in interface INewsletterDocumentDAO
Parameters:
nTopicId - the topic id
nPortletId - the portlet identifier
plugin - the newsletter document plugin

deleteNewsLetterDocumentPortlet

public void deleteNewsLetterDocumentPortlet(int nTopicId,
                                            fr.paris.lutece.portal.service.plugin.Plugin plugin)
Remove the relationship between a topic and the list of portlets

Specified by:
deleteNewsLetterDocumentPortlet in interface INewsletterDocumentDAO
Parameters:
nTopicId - the topic id
plugin - the newsletter document plugin

selectNewsletterPortletsIds

public int[] selectNewsletterPortletsIds(int nTopicId,
                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
loads the list of document list portlets linked to the newsletter

Specified by:
selectNewsletterPortletsIds in interface INewsletterDocumentDAO
Parameters:
nTopicId - the topic id
plugin - the newsletter document plugin
Returns:
the array of categories id

getPublishedDocumentsIdsListByPortletIds

public List<Integer> getPublishedDocumentsIdsListByPortletIds(int[] nPortletsIds,
                                                              Date datePublishing,
                                                              fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of id of published documents associated with a given collection of portlets.

Specified by:
getPublishedDocumentsIdsListByPortletIds in interface INewsletterDocumentDAO
Parameters:
nPortletsIds - The list of portlet ids.
datePublishing - TODO
plugin - The document plugin
Returns:
The list of documents id.

findTemplate

public boolean findTemplate(int nIdNewsletterTemplate,
                            fr.paris.lutece.portal.service.plugin.Plugin plugin)
Check if a template is used by a topic

Specified by:
findTemplate in interface INewsletterDocumentDAO
Parameters:
nIdNewsletterTemplate - The id of the template
plugin - The newsletter plugin
Returns:
True if the template is used by a topic, false otherwise


Copyright © 2013 Mairie de Paris. All Rights Reserved.