Class NewsLetterHome
java.lang.Object
fr.paris.lutece.plugins.newsletter.business.NewsLetterHome
This class provides instances management methods (create, find, ...) for NewsLetter objects
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddSubscriber(int nNewsLetterId, int nSubscriberId, boolean bValidate, Timestamp tToday, fr.paris.lutece.portal.service.plugin.Plugin plugin) insert a new subscriber for e newsletterstatic voidaddSubscriber(int nNewsLetterId, int nSubscriberId, Timestamp tToday, fr.paris.lutece.portal.service.plugin.Plugin plugin) insert a new subscriber for e newsletter.static booleancheckLinkedPortlets(int nIdNewsletter) Verifies if a portlet uses a newsletterstatic NewsLettercreate(NewsLetter newsLetter, fr.paris.lutece.portal.service.plugin.Plugin plugin) Create an instance of the newsletterstatic Collection<NewsLetter>findAll(fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns a collection of NewsLetter objectsstatic Collection<NewsLetter>findAllByTemplateId(int nTemplateId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Gets a collection of NewsLetter associated with a given templatestatic fr.paris.lutece.util.ReferenceListfindAllId(fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns a ReferenceList of NewsLetter ids and namesstatic NewsLetterfindByPrimaryKey(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns an object NewsLetter from its identifierstatic intfindNbrActiveSubscribers(int nNewsLetterId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns the number of active subscriber for a newsletterstatic intfindNbrSubscribers(int nNewsLetterId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns the number of subscriber for a newsletterstatic booleanfindRegistration(int nNewsLetterId, int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin) controls that a subscriber is not yet registered for a newsletterstatic booleanisTemplateUsedByNewsletter(int nTemplateId, fr.paris.lutece.portal.service.plugin.Plugin plugin) controls that a template is used by a newsletterstatic voidremove(int nNewsLetterId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove the record from the identifier a newsletterstatic voidremoveOldUnconfirmed(int nConfirmLimit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Performs confirm unsubscription processstatic voidremoveSubscriber(int nNewsLetterId, int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin) removes an subscriber's inscription for a newsletterstatic NewsLetterupdate(NewsLetter newsLetter, fr.paris.lutece.portal.service.plugin.Plugin plugin) update of the newsletter which is specified in parameterstatic voidvalidateSubscriber(int nNewsLetterId, int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin) validates a new subscriber for a newsletter
-
Method Details
-
create
public static NewsLetter create(NewsLetter newsLetter, fr.paris.lutece.portal.service.plugin.Plugin plugin) Create an instance of the newsletter- Parameters:
newsLetter- the object to insert into the databaseplugin- the Plugin- Returns:
- the instance created
-
update
public static NewsLetter update(NewsLetter newsLetter, fr.paris.lutece.portal.service.plugin.Plugin plugin) update of the newsletter which is specified in parameter- Parameters:
newsLetter- the instance of newsletter which contains the data to storeplugin- the Plugin- Returns:
- the new instance updated
-
remove
public static void remove(int nNewsLetterId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Remove the record from the identifier a newsletter- Parameters:
nNewsLetterId- the newsletter identifierplugin- the Plugin
-
findByPrimaryKey
public static NewsLetter findByPrimaryKey(int nKey, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns an object NewsLetter from its identifier- Parameters:
nKey- the primary key of the newsletterplugin- the Plugin- Returns:
- an instance of the class
-
findAll
Returns a collection of NewsLetter objects- Parameters:
plugin- the Plugin- Returns:
- the collection of objects
-
findAllId
public static fr.paris.lutece.util.ReferenceList findAllId(fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns a ReferenceList of NewsLetter ids and names- Parameters:
plugin- the Plugin- Returns:
- the ReferenceList of id and name
-
findAllByTemplateId
public static Collection<NewsLetter> findAllByTemplateId(int nTemplateId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Gets a collection of NewsLetter associated with a given template- Parameters:
nTemplateId- The id of the templateplugin- the Plugin- Returns:
- the collection of objects
-
addSubscriber
public static void addSubscriber(int nNewsLetterId, int nSubscriberId, Timestamp tToday, fr.paris.lutece.portal.service.plugin.Plugin plugin) insert a new subscriber for e newsletter. The subscriber is automatically marked as confirmed- Parameters:
nNewsLetterId- the newsletter identifiernSubscriberId- the subscriber identifierplugin- the PlugintToday- the day
-
addSubscriber
public static void addSubscriber(int nNewsLetterId, int nSubscriberId, boolean bValidate, Timestamp tToday, fr.paris.lutece.portal.service.plugin.Plugin plugin) insert a new subscriber for e newsletter- Parameters:
nNewsLetterId- the newsletter identifiernSubscriberId- the subscriber identifierbValidate- true if user is automatically confirmed, false otherwiseplugin- the PlugintToday- the day
-
validateSubscriber
public static void validateSubscriber(int nNewsLetterId, int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin) validates a new subscriber for a newsletter- Parameters:
nNewsLetterId- the newsletter identifiernSubscriberId- the subscriber identifierplugin- the Plugin
-
removeSubscriber
public static void removeSubscriber(int nNewsLetterId, int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin) removes an subscriber's inscription for a newsletter- Parameters:
nNewsLetterId- the newsletter identifiernSubscriberId- the subscriber identifierplugin- the Plugin
-
removeOldUnconfirmed
public static void removeOldUnconfirmed(int nConfirmLimit, fr.paris.lutece.portal.service.plugin.Plugin plugin) Performs confirm unsubscription process- Parameters:
nConfirmLimit- How many days before deleting a subscriberplugin- the plugin
-
findNbrSubscribers
public static int findNbrSubscribers(int nNewsLetterId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns the number of subscriber for a newsletter- Parameters:
nNewsLetterId- the identifier of the newsletterplugin- the Plugin- Returns:
- the number of subscriber for a newsletter
-
findNbrActiveSubscribers
public static int findNbrActiveSubscribers(int nNewsLetterId, fr.paris.lutece.portal.service.plugin.Plugin plugin) Returns the number of active subscriber for a newsletter- Parameters:
nNewsLetterId- the identifier of the newsletterplugin- the Plugin- Returns:
- the number of subscriber for a newsletter
-
findRegistration
public static boolean findRegistration(int nNewsLetterId, int nSubscriberId, fr.paris.lutece.portal.service.plugin.Plugin plugin) controls that a subscriber is not yet registered for a newsletter- Parameters:
nNewsLetterId- the newsletter identifiernSubscriberId- the subscriber identifierplugin- the Plugin- Returns:
- true if he is registered, false if not
-
isTemplateUsedByNewsletter
public static boolean isTemplateUsedByNewsletter(int nTemplateId, fr.paris.lutece.portal.service.plugin.Plugin plugin) controls that a template is used by a newsletter- Parameters:
nTemplateId- the template identifierplugin- the Plugin- Returns:
- true if the template is used, false if not
-
checkLinkedPortlets
public static boolean checkLinkedPortlets(int nIdNewsletter) Verifies if a portlet uses a newsletter- Parameters:
nIdNewsletter- the template identifier- Returns:
- true if portlet uses newsletter
-