Class NewsletterTopicHome
- java.lang.Object
-
- fr.paris.lutece.plugins.newsletter.business.topic.NewsletterTopicHome
-
public final class NewsletterTopicHome extends java.lang.ObjectHome for NewsletterTopic objects
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidfillBlankInOrder(int nIdNewsletter, int nOrder, int nSection, fr.paris.lutece.portal.service.plugin.Plugin plugin)Fill a blank in the order of topics of a newsletter.static java.util.List<NewsletterTopic>findAllByIdNewsletter(int nIdNewsletter, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the list ofNewsletterTopicassociated with a given newsletter.static NewsletterTopicfindByPrimaryKey(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get aNewsletterTopicby its primary key from the databasestatic intgetLastOrder(int nIdNewsletter, int nSection, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the highest order for a given newsletter and a given sectionstatic intgetNewOrder(int nIdNewsletter, int nSection, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the next available order value for topics of a newsletterstatic voidinsertNewsletterTopic(NewsletterTopic newsletterTopic, fr.paris.lutece.portal.service.plugin.Plugin plugin)Insert a newNewsletterTopicinto the databasestatic voidremoveAllByIdNewsletter(int nIdNewsletter, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the list ofNewsletterTopicassociated with a given newsletter.static voidremoveNewsletterTopic(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)Delete aNewsletterTopicfrom the databasestatic voidupdateNewsletterTopic(NewsletterTopic newsletterTopic, fr.paris.lutece.portal.service.plugin.Plugin plugin)Update aNewsletterTopicin the databasestatic voidupdateNewsletterTopicOrder(NewsletterTopic newsletterTopic, int nNewOrder, fr.paris.lutece.portal.service.plugin.Plugin plugin)Update topic orders of a newsletter.
-
-
-
Method Detail
-
findByPrimaryKey
public static NewsletterTopic findByPrimaryKey(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get aNewsletterTopicby its primary key from the database- Parameters:
nId- The id of theNewsletterTopicto getplugin- The plugin- Returns:
- The
NewsletterTopicwith the given id, or null if noNewsletterTopichas this id.
-
insertNewsletterTopic
public static void insertNewsletterTopic(NewsletterTopic newsletterTopic, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Insert a newNewsletterTopicinto the database- Parameters:
newsletterTopic- TheNewsletterTopicto insert.plugin- The plugin
-
updateNewsletterTopic
public static void updateNewsletterTopic(NewsletterTopic newsletterTopic, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update aNewsletterTopicin the database- Parameters:
newsletterTopic- The new values of theNewsletterTopic.plugin- The plugin
-
removeNewsletterTopic
public static void removeNewsletterTopic(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)Delete aNewsletterTopicfrom the database- Parameters:
nId- The id of theNewsletterTopicto delete.plugin- The plugin
-
removeAllByIdNewsletter
public static void removeAllByIdNewsletter(int nIdNewsletter, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the list ofNewsletterTopicassociated with a given newsletter.- Parameters:
nIdNewsletter- The id of the newsletterplugin- The plugin
-
findAllByIdNewsletter
public static java.util.List<NewsletterTopic> findAllByIdNewsletter(int nIdNewsletter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list ofNewsletterTopicassociated with a given newsletter.- Parameters:
nIdNewsletter- The id of the newsletterplugin- The plugin- Returns:
- The list of
NewsletterTopicfound.
-
updateNewsletterTopicOrder
public static void updateNewsletterTopicOrder(NewsletterTopic newsletterTopic, int nNewOrder, fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update topic orders of a newsletter. The order of the given topic is set to the new value, and the topic that had this order gets the old order of the updated topic.- Parameters:
newsletterTopic- The topic to move. The order attribute of the topic MUST be its old order.nNewOrder- The new order of the topicplugin- The plugin
-
getNewOrder
public static int getNewOrder(int nIdNewsletter, int nSection, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the next available order value for topics of a newsletter- Parameters:
nIdNewsletter- The id of the newsletternSection- The sectionplugin- The plugin- Returns:
- The next available order value
-
getLastOrder
public static int getLastOrder(int nIdNewsletter, int nSection, fr.paris.lutece.portal.service.plugin.Plugin plugin)Get the highest order for a given newsletter and a given section- Parameters:
nIdNewsletter- The id of the newsletternSection- The id of the sectionplugin- The plugin- Returns:
- The highest order actually used for the given newsletter and the given section
-
fillBlankInOrder
public static void fillBlankInOrder(int nIdNewsletter, int nOrder, int nSection, fr.paris.lutece.portal.service.plugin.Plugin plugin)Fill a blank in the order of topics of a newsletter.- Parameters:
nIdNewsletter- The newsletter to update the topics ofnOrder- The order with no topicnSection- The section of topics to updateplugin- the plugin
-
-