Class ForumDaoJdbc


  • public class ForumDaoJdbc
    extends java.lang.Object
    Forum Database manipulation class.
    Since:
    4.0.5
    Version:
    $Revision: 10707 $ $Date: 2009-07-20 18:47:03 -0300 (Mon, 20 Jul 2009) $
    • Constructor Detail

      • ForumDaoJdbc

        public ForumDaoJdbc()
    • Method Detail

      • getPrimaryKeyByContentId

        public java.lang.String getPrimaryKeyByContentId​(java.lang.String contentId)
        Returns the primary key through the given contentId.
        Parameters:
        contentId - the content identifier.
        Returns:
        the primary key.
        Since:
        4.2.0
      • getContentIdByPrimaryKey

        public java.lang.String getContentIdByPrimaryKey​(java.lang.String primaryKeyValue)
                                                  throws PortalException
        Returns the contentId corresponding to the given primary key.
        Parameters:
        primaryKeyValue - the primary key.
        Returns:
        the content identifier.
        Throws:
        PortalException
        Since:
        4.2.0
      • setTopicSubject

        public void setTopicSubject​(java.lang.String topicId,
                                    java.lang.String subject,
                                    ITransaction transaction)
                             throws PortalException
        Updates the topic subject. Should be used when the first message from a topic is updated.
        Parameters:
        topicId -
        subject -
        transaction -
        Throws:
        PortalException
      • setTopicFirstMessage

        public void setTopicFirstMessage​(java.lang.String topicId,
                                         java.lang.String messageId,
                                         ITransaction transaction)
                                  throws PortalException
        Updates the topic's firstMessageId colum with the specified messageId. This method is meant to set the id of the first message, created with the topic, on the topic table.
        Parameters:
        topicId -
        messageId -
        transaction -
        Throws:
        PortalException
      • increasePostedTopics

        public void increasePostedTopics​(java.lang.String topicId,
                                         ITransaction transaction)
                                  throws PortalException
        Increase the forum's topic counter.
        Parameters:
        topicId -
        transaction -
        Throws:
        PortalException
      • increasePostedMessages

        public void increasePostedMessages​(java.lang.String topicId,
                                           ITransaction transaction)
                                    throws PortalException
        Increase topic and forum's message counters.
        Parameters:
        topicId -
        transaction -
        Throws:
        PortalException
      • decreasePostedTopics

        public void decreasePostedTopics​(java.lang.String topicId,
                                         ITransaction transaction)
                                  throws PortalException
        Decrease the count of messages from the specified topic on it's forum. Topic must still exists when this method is called, being excluded after.
        Parameters:
        topicId -
        transaction -
        Throws:
        PortalException
      • decreasePostedMessages

        public void decreasePostedMessages​(java.lang.String topicId,
                                           ITransaction transaction)
                                    throws PortalException
        Decrease the count of messages (by one) on the specified topic and it's forum.
        Parameters:
        topicId -
        transaction -
        Throws:
        PortalException
      • getLastPostedTopicId

        public java.lang.String getLastPostedTopicId​(java.lang.String forumContentId,
                                                     java.lang.String excludedTopicId,
                                                     ITransaction transaction)
                                              throws PortalException
        Returns the id of the last updated topic on the specified forum.
        Parameters:
        forumContentId -
        excludedTopicId -
        transaction -
        Returns:
        Throws:
        PortalException
      • getLastPostedMessageId

        public java.lang.String getLastPostedMessageId​(java.lang.String topicContentId,
                                                       java.lang.String excludedMessageId,
                                                       ITransaction transaction)
                                                throws PortalException
        Returns the id of the last message posted on the specified topic.
        Parameters:
        topicContentId - the topic content identifier.
        excludedMessageId -
        transaction -
        Returns:
        the message identifier.
        Throws:
        PortalException
      • setTopicLastMessageInfo

        public void setTopicLastMessageInfo​(java.lang.String topicId,
                                            java.lang.String lastMessageUser,
                                            java.sql.Timestamp lastMessageDate,
                                            ITransaction transaction)
                                     throws PortalException
        Sets the topic's last message post date and user.
        Parameters:
        topicId -
        lastMessageUser -
        lastMessageDate -
        transaction -
        Throws:
        PortalException
      • setForumLastMessageInfo

        public void setForumLastMessageInfo​(java.lang.String forumId,
                                            java.lang.String lastTopicUser,
                                            java.sql.Timestamp lastTopicDate,
                                            ITransaction transaction)
                                     throws PortalException
        Sets the forum's last message post date and user.
        Parameters:
        forumId -
        lastTopicUser -
        lastTopicDate -
        transaction -
        Throws:
        PortalException
      • increaseTopicViews

        public void increaseTopicViews​(java.lang.String topicId,
                                       ITransaction transaction)
                                throws PortalException
        Increase the topic view counter.
        Parameters:
        topicId - the topic identifier.
        transaction - the transaction for persistence access.
        Throws:
        PortalException
      • setTopicState

        public void setTopicState​(java.lang.String topicId,
                                  int state,
                                  ITransaction transaction)
                           throws PortalException
        Sets the topic state. It may be blocked or not blocked.
        Parameters:
        topicId - the topic identifier.
        state - the state to set.
        transaction - the transaction for persistence access.
        Throws:
        PortalException