Class NewsLetterDAO
java.lang.Object
fr.paris.lutece.plugins.newsletter.business.NewsLetterDAO
- All Implemented Interfaces:
INewsLetterDAO
This class provides Data Access methods for NewsLetter objects
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckLinkedPortlet(int nIdNewsletter) Checks whether a portlet uses the newsletterbooleancheckPrimaryKey(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check the unicity of the primary keyvoiddelete(int nNewsLetterId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove a record from the tablevoiddeleteOldUnconfirmed(Timestamp confirmLimitDate, fr.paris.lutece.portal.service.plugin.Plugin plugin) Performs confirm unsubscription processvoiddeleteSubscriber(int nNewsLetterId, int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove the subscriber's inscription to a newslettervoidinsert(NewsLetter newsLetter, fr.paris.lutece.portal.service.plugin.Plugin plugin) Insert a new record in the table.voidinsertSubscriber(int nNewsLetterId, int nSubscriberId, boolean bValidate, Timestamp tToday, fr.paris.lutece.portal.service.plugin.Plugin plugin) Insert a new subscriber for a newslettervoidinsertSubscriber(int nNewsLetterId, int nSubscriberId, Timestamp tToday, fr.paris.lutece.portal.service.plugin.Plugin plugin) Insert a new subscriber for a newsletterbooleanisRegistered(int nNewsLetterId, int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin) check if the subscriber is not yet registered to a newsletterbooleanisTemplateUsed(int nTemplateId, fr.paris.lutece.portal.service.plugin.Plugin plugin) controls that a template is used by a newsletterload(int nNewsLetterId, fr.paris.lutece.portal.service.plugin.Plugin plugin) loads the data of the newsletter from the tableintnewPrimaryKey(fr.paris.lutece.portal.service.plugin.Plugin plugin) Generate a new primary key to add a newsletterselectAll(fr.paris.lutece.portal.service.plugin.Plugin plugin) Select the list of the newsletters availableselectAllByTemplateId(int nTemplateId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Gets a collection of NewsLetter associated with a given templatefr.paris.lutece.util.ReferenceListselectAllId(fr.paris.lutece.portal.service.plugin.Plugin plugin) Select the list of the newsletters availableintselectNbrActiveSubscribers(int nNewsLetterId, String strSearchString, fr.paris.lutece.portal.service.plugin.Plugin plugin) Counts the active subscribers for a newsletterintselectNbrSubscribers(int nNewsLetterId, String strSearchString, fr.paris.lutece.portal.service.plugin.Plugin plugin) Counts the subscribers for a newslettervoidstore(NewsLetter newsLetter, fr.paris.lutece.portal.service.plugin.Plugin plugin) Update the record in the tablevoidvalidateSubscriber(int nNewsLetterId, int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Updates a subscriber for a newsletter
-
Constructor Details
-
NewsLetterDAO
public NewsLetterDAO()
-
-
Method Details
-
insert
Insert a new record in the table.- Specified by:
insertin interfaceINewsLetterDAO- Parameters:
newsLetter- the object to insertplugin- the Plugin
-
delete
public void delete(int nNewsLetterId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove a record from the table- Specified by:
deletein interfaceINewsLetterDAO- Parameters:
nNewsLetterId- the newsletter identifierplugin- the Plugin
-
load
loads the data of the newsletter from the table- Specified by:
loadin interfaceINewsLetterDAO- Parameters:
nNewsLetterId- the newsletter identifierplugin- the Plugin- Returns:
- the object inserted
-
store
Update the record in the table- Specified by:
storein interfaceINewsLetterDAO- Parameters:
newsLetter- the object to be updatedplugin- the Plugin
-
checkPrimaryKey
public boolean checkPrimaryKey(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Check the unicity of the primary key- Specified by:
checkPrimaryKeyin interfaceINewsLetterDAO- Parameters:
nKey- the key to be checkedplugin- the Plugin- Returns:
- true if the identifier exist and false if not
-
checkLinkedPortlet
public boolean checkLinkedPortlet(int nIdNewsletter) Checks whether a portlet uses the newsletter- Specified by:
checkLinkedPortletin interfaceINewsLetterDAO- Parameters:
nIdNewsletter- the id of the newsletter- Returns:
- true if the newsletter is used
-
newPrimaryKey
public int newPrimaryKey(fr.paris.lutece.portal.service.plugin.Plugin plugin) Generate a new primary key to add a newsletter- Specified by:
newPrimaryKeyin interfaceINewsLetterDAO- Parameters:
plugin- the Plugin- Returns:
- the new key
-
selectAll
Select the list of the newsletters available- Specified by:
selectAllin interfaceINewsLetterDAO- Parameters:
plugin- the Plugin- Returns:
- a collection of objects
-
selectAllId
public fr.paris.lutece.util.ReferenceList selectAllId(fr.paris.lutece.portal.service.plugin.Plugin plugin) Select the list of the newsletters available- Specified by:
selectAllIdin interfaceINewsLetterDAO- Parameters:
plugin- the Plugin- Returns:
- a
ReferenceListof id and name
-
selectAllByTemplateId
public Collection<NewsLetter> selectAllByTemplateId(int nTemplateId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Gets a collection of NewsLetter associated with a given template- Specified by:
selectAllByTemplateIdin interfaceINewsLetterDAO- Parameters:
nTemplateId- The id of the templateplugin- the Plugin- Returns:
- the collection of objects
-
insertSubscriber
public void insertSubscriber(int nNewsLetterId, int nSubscriberId, Timestamp tToday, fr.paris.lutece.portal.service.plugin.Plugin plugin) Insert a new subscriber for a newsletter- Specified by:
insertSubscriberin interfaceINewsLetterDAO- Parameters:
nNewsLetterId- the newsletter identifiernSubscriberId- the subscriber identifiertToday- The dayplugin- the Plugin
-
insertSubscriber
public void insertSubscriber(int nNewsLetterId, int nSubscriberId, boolean bValidate, Timestamp tToday, fr.paris.lutece.portal.service.plugin.Plugin plugin) Insert a new subscriber for a newsletter- Specified by:
insertSubscriberin interfaceINewsLetterDAO- Parameters:
nNewsLetterId- the newsletter identifiernSubscriberId- the subscriber identifierbValidate- the validation statustToday- The dayplugin- the Plugin
-
deleteSubscriber
public void deleteSubscriber(int nNewsLetterId, int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove the subscriber's inscription to a newsletter- Specified by:
deleteSubscriberin interfaceINewsLetterDAO- Parameters:
nNewsLetterId- the newsletter identifiernSubscriberId- the subscriber identifierplugin- the Plugin
-
deleteOldUnconfirmed
public void deleteOldUnconfirmed(Timestamp confirmLimitDate, fr.paris.lutece.portal.service.plugin.Plugin plugin) Performs confirm unsubscription process- Specified by:
deleteOldUnconfirmedin interfaceINewsLetterDAO- Parameters:
confirmLimitDate- all unconfirmed subscriber which subscription date is below confirmLimitDate will be deletedplugin- the plugin
-
isRegistered
public boolean isRegistered(int nNewsLetterId, int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin) check if the subscriber is not yet registered to a newsletter- Specified by:
isRegisteredin interfaceINewsLetterDAO- Parameters:
nNewsLetterId- the newsletter identifiernSubscriberId- the subscriber identifierplugin- the Plugin- Returns:
- true if he is registered and false if not
-
isTemplateUsed
public boolean isTemplateUsed(int nTemplateId, fr.paris.lutece.portal.service.plugin.Plugin plugin) controls that a template is used by a newsletter- Specified by:
isTemplateUsedin interfaceINewsLetterDAO- Parameters:
nTemplateId- the template identifierplugin- the Plugin- Returns:
- true if the template is used, false if not
-
selectNbrSubscribers
public int selectNbrSubscribers(int nNewsLetterId, String strSearchString, fr.paris.lutece.portal.service.plugin.Plugin plugin) Counts the subscribers for a newsletter- Specified by:
selectNbrSubscribersin interfaceINewsLetterDAO- Parameters:
nNewsLetterId- the newsletter newsletterstrSearchString- the string to search in the subscriber's emailplugin- the Plugin- Returns:
- the number of subscribers
-
selectNbrActiveSubscribers
public int selectNbrActiveSubscribers(int nNewsLetterId, String strSearchString, fr.paris.lutece.portal.service.plugin.Plugin plugin) Counts the active subscribers for a newsletter- Specified by:
selectNbrActiveSubscribersin interfaceINewsLetterDAO- Parameters:
nNewsLetterId- the newsletter newsletterstrSearchString- the string to search in the subscriber's emailplugin- the Plugin- Returns:
- the number of subscribers
-
validateSubscriber
public void validateSubscriber(int nNewsLetterId, int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Updates a subscriber for a newsletter- Specified by:
validateSubscriberin interfaceINewsLetterDAO- Parameters:
nNewsLetterId- the newsletter identifiernSubscriberId- the subscriber identifierplugin- the Plugin
-