Class NewsletterTopicDao

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      java.util.List<NewsletterTopic> findAllByIdNewsletter​(int nIdNewsletter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Get the list of NewsletterTopic associated with a given newsletter.
      java.util.List<NewsletterTopic> findByNewsletterIdAndOrder​(int nIdNewsletter, int nOrder, int nSection, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Get the list of newsletter topics associated to a given newsletter and with the given order in a section
      NewsletterTopic findByPrimaryKey​(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Get a NewsletterTopic by its primary key from the database
      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
      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
      void insert​(NewsletterTopic newsletterTopic, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Insert a new NewsletterTopic into the database
      void remove​(int nId, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Delete a NewsletterTopic from the database
      void removeAllByIdNewsletter​(int nIdNewsletter, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Remove every topic associated with a given newsletter
      void update​(NewsletterTopic newsletterTopic, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Update a NewsletterTopic in the database
      void updateNewsletterTopicOrder​(int nIdNewsletterTopic, int nNewOrder, fr.paris.lutece.portal.service.plugin.Plugin plugin)
      Update the order of a newsletter topic
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NewsletterTopicDao

        public NewsletterTopicDao()
    • Method Detail

      • updateNewsletterTopicOrder

        public void updateNewsletterTopicOrder​(int nIdNewsletterTopic,
                                               int nNewOrder,
                                               fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Update the order of a newsletter topic
        Specified by:
        updateNewsletterTopicOrder in interface INewsletterTopicDAO
        Parameters:
        nIdNewsletterTopic - The id of the newsletter topic to update
        nNewOrder - The new order of the topic
        plugin - The plugin
      • findByNewsletterIdAndOrder

        public java.util.List<NewsletterTopic> findByNewsletterIdAndOrder​(int nIdNewsletter,
                                                                          int nOrder,
                                                                          int nSection,
                                                                          fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Get the list of newsletter topics associated to a given newsletter and with the given order in a section
        Specified by:
        findByNewsletterIdAndOrder in interface INewsletterTopicDAO
        Parameters:
        nIdNewsletter - The id of the newsletter the topic must be associated with.
        nOrder - The order the topics must have
        nSection - The section of the Topic
        plugin - The plugin
        Returns:
        The list of newsletter topics. The list should contain only one or zero element. If it has more, then it indicates that several topics have the same order and should be reordered.
      • getNewOrder

        public 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
        Specified by:
        getNewOrder in interface INewsletterTopicDAO
        Parameters:
        nIdNewsletter - The id of the newsletter
        nSection - The section of the newsletter
        plugin - The plugin
        Returns:
        The next available order value
      • getLastOrder

        public 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
        Specified by:
        getLastOrder in interface INewsletterTopicDAO
        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 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.
        Specified by:
        fillBlankInOrder in interface INewsletterTopicDAO
        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
      • removeAllByIdNewsletter

        public void removeAllByIdNewsletter​(int nIdNewsletter,
                                            fr.paris.lutece.portal.service.plugin.Plugin plugin)
        Remove every topic associated with a given newsletter
        Specified by:
        removeAllByIdNewsletter in interface INewsletterTopicDAO
        Parameters:
        nIdNewsletter - The id of the newsletter to remove the topics of.
        plugin - The plugin