fr.paris.lutece.plugins.newsletter.business.topic
Class NewsletterTopicHome

java.lang.Object
  extended by fr.paris.lutece.plugins.newsletter.business.topic.NewsletterTopicHome

public final class NewsletterTopicHome
extends Object

Home for NewsletterTopic objects


Method Summary
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.
static List<NewsletterTopic> findAllByIdNewsletter(int nIdNewsletter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of NewsletterTopic associated with a given newsletter.
static NewsletterTopic findByPrimaryKey(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get a NewsletterTopic by its primary key from the database
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
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
static void insertNewsletterTopic(NewsletterTopic newsletterTopic, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Insert a new NewsletterTopic into the database
static void removeAllByIdNewsletter(int nIdNewsletter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Get the list of NewsletterTopic associated with a given newsletter.
static void removeNewsletterTopic(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Delete a NewsletterTopic from the database
static void updateNewsletterTopic(NewsletterTopic newsletterTopic, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update a NewsletterTopic in the database
static void updateNewsletterTopicOrder(NewsletterTopic newsletterTopic, int nNewOrder, fr.paris.lutece.portal.service.plugin.Plugin plugin)
          Update topic orders of a newsletter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

findByPrimaryKey

public static NewsletterTopic findByPrimaryKey(int nId,
                                               fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get a NewsletterTopic by its primary key from the database

Parameters:
nId - The id of the NewsletterTopic to get
plugin - The plugin
Returns:
The NewsletterTopic with the given id, or null if no NewsletterTopic has this id.

insertNewsletterTopic

public static void insertNewsletterTopic(NewsletterTopic newsletterTopic,
                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Insert a new NewsletterTopic into the database

Parameters:
newsletterTopic - The NewsletterTopic to insert.
plugin - The plugin

updateNewsletterTopic

public static void updateNewsletterTopic(NewsletterTopic newsletterTopic,
                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Update a NewsletterTopic in the database

Parameters:
newsletterTopic - The new values of the NewsletterTopic.
plugin - The plugin

removeNewsletterTopic

public static void removeNewsletterTopic(int nId,
                                         fr.paris.lutece.portal.service.plugin.Plugin plugin)
Delete a NewsletterTopic from the database

Parameters:
nId - The id of the NewsletterTopic to delete.
plugin - The plugin

removeAllByIdNewsletter

public static void removeAllByIdNewsletter(int nIdNewsletter,
                                           fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of NewsletterTopic associated with a given newsletter.

Parameters:
nIdNewsletter - The id of the newsletter
plugin - The plugin

findAllByIdNewsletter

public static List<NewsletterTopic> findAllByIdNewsletter(int nIdNewsletter,
                                                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
Get the list of NewsletterTopic associated with a given newsletter.

Parameters:
nIdNewsletter - The id of the newsletter
plugin - The plugin
Returns:
The list of NewsletterTopic found.

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 topic
plugin - 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 newsletter
nSection - The section
plugin - 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 newsletter
nSection - The id of the section
plugin - 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 of
nOrder - The order with no topic
nSection - The section of topics to update
plugin - the plugin


Copyright © 2013 Mairie de Paris. All Rights Reserved.