lumis.service.forum
Class ForumDaoJdbc

Package class diagram package ForumDaoJdbc
java.lang.Object
  extended by lumis.service.forum.ForumDaoJdbc

public class ForumDaoJdbc
extends Object

Forum Database manipulation class.

Since:
4.0.5

Constructor Summary
ForumDaoJdbc()
           
 
Method Summary
 void decreasePostedMessages(String topicId, ITransaction transaction)
          Decrease the count of messages (by one) on the specified topic and it's forum.
 void decreasePostedTopics(String topicId, ITransaction transaction)
          Decrease the count of messages from the specified topic on it's forum.
 ForumCategoryConfig getCategory(String categoryId, ITransaction transaction)
          Gets the ForumCategoryConfig for the specified categoryId.
 ForumConfig getForum(String forumId, ITransaction transaction)
           
 String getForumIdByTopicId(String topicId, ITransaction transaction)
           
 Collection<String> getForumIdsByCategory(String categoryId, ITransaction transaction)
           
 Collection<String> getForumTopicIds(String forumId, ITransaction transaction)
           
 String getLastPostedMessageId(String topicId, String excludedMessageId, ITransaction transaction)
          Returns the id of the last message posted on the specified topic.
 String getLastPostedTopicId(String forumId, String excludedTopicId, ITransaction transaction)
          Returns the id of the last updated topic on the specified forum.
 ForumMessageConfig getMessage(String messageId, ITransaction transaction)
          Gets the ForumMessageConfig for the specified message id.
 ForumTopicConfig getTopic(String topicId, ITransaction transaction)
          Gets the ForumTopicConfig for the specified topicId.
 void increasePostedMessages(String topicId, ITransaction transaction)
          Increase topic and forum's message counters.
 void increasePostedTopics(String topicId, ITransaction transaction)
          Increase the forum's topic counter.
 void increaseTopicViews(String topicId, ITransaction transaction)
          Removes the specified topic from the database.
 void setForumLastMessageInfo(String forumId, String lastTopicUser, Timestamp lastTopicDate, ITransaction transaction)
          Sets the forum's last message post date and user.
 void setForumState(String forumId, int state, ITransaction transaction)
           
 void setTopicFirstMessage(String topicId, String messageId, ITransaction transaction)
          Updates the topic's firstMessageId colum with the specified messageId.
 void setTopicLastMessageInfo(String topicId, String lastMessageUser, Timestamp lastMessageDate, ITransaction transaction)
          Sets the topic's last message post date and user.
 void setTopicState(String topicId, int state, ITransaction transaction)
           
 void setTopicSubject(String topicId, String subject, ITransaction transaction)
          Updates the topic subject.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForumDaoJdbc

public ForumDaoJdbc()
Method Detail

getForumIdByTopicId

public String getForumIdByTopicId(String topicId,
                                  ITransaction transaction)
                           throws PortalException
Throws:
PortalException

setTopicSubject

public void setTopicSubject(String topicId,
                            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(String topicId,
                                 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(String topicId,
                                 ITransaction transaction)
                          throws PortalException
Increase the forum's topic counter.

Parameters:
topicId -
transaction -
Throws:
PortalException

increasePostedMessages

public void increasePostedMessages(String topicId,
                                   ITransaction transaction)
                            throws PortalException
Increase topic and forum's message counters.

Parameters:
topicId -
transaction -
Throws:
PortalException

decreasePostedTopics

public void decreasePostedTopics(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(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 String getLastPostedTopicId(String forumId,
                                   String excludedTopicId,
                                   ITransaction transaction)
                            throws PortalException
Returns the id of the last updated topic on the specified forum.

Parameters:
forumId -
excludedTopicId -
transaction -
Returns:
Throws:
PortalException

getLastPostedMessageId

public String getLastPostedMessageId(String topicId,
                                     String excludedMessageId,
                                     ITransaction transaction)
                              throws PortalException
Returns the id of the last message posted on the specified topic.

Parameters:
topicId -
excludedMessageId -
transaction -
Returns:
Throws:
PortalException

setTopicLastMessageInfo

public void setTopicLastMessageInfo(String topicId,
                                    String lastMessageUser,
                                    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(String forumId,
                                    String lastTopicUser,
                                    Timestamp lastTopicDate,
                                    ITransaction transaction)
                             throws PortalException
Sets the forum's last message post date and user.

Parameters:
forumId -
lastTopicUser -
lastTopicDate -
transaction -
Throws:
PortalException

getTopic

public ForumTopicConfig getTopic(String topicId,
                                 ITransaction transaction)
                          throws PortalException
Gets the ForumTopicConfig for the specified topicId.

Parameters:
topicId -
transaction -
Returns:
Throws:
PortalException

getMessage

public ForumMessageConfig getMessage(String messageId,
                                     ITransaction transaction)
                              throws PortalException
Gets the ForumMessageConfig for the specified message id.

Parameters:
messageId -
transaction -
Returns:
Throws:
PortalException

getCategory

public ForumCategoryConfig getCategory(String categoryId,
                                       ITransaction transaction)
                                throws PortalException
Gets the ForumCategoryConfig for the specified categoryId.

Parameters:
categoryId -
transaction -
Returns:
Throws:
PortalException

getForum

public ForumConfig getForum(String forumId,
                            ITransaction transaction)
                     throws PortalException
Throws:
PortalException

increaseTopicViews

public void increaseTopicViews(String topicId,
                               ITransaction transaction)
                        throws PortalException
Removes the specified topic from the database.

Parameters:
topicId -
transaction -
Throws:
PortalException

setTopicState

public void setTopicState(String topicId,
                          int state,
                          ITransaction transaction)
                   throws PortalException
Throws:
PortalException

setForumState

public void setForumState(String forumId,
                          int state,
                          ITransaction transaction)
                   throws PortalException
Throws:
PortalException

getForumTopicIds

public Collection<String> getForumTopicIds(String forumId,
                                           ITransaction transaction)
                                    throws PortalException
Throws:
PortalException

getForumIdsByCategory

public Collection<String> getForumIdsByCategory(String categoryId,
                                                ITransaction transaction)
                                         throws PortalException
Throws:
PortalException


Lumisportal  4.1.0.071221 - Copyright © 2001-2007, Lumis. All Rights Reserved.