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.
 String getContentIdByPrimaryKey(String primaryKeyValue)
          Returns the contentId corresponding to the given primary key.
 ForumConfig getForum(String forumId, ITransaction transaction)
           
 String getForumIdByTopicId(String topicId, ITransaction transaction)
           
 Collection<String> getForumIdsByCategory(String categoryContentId, ITransaction transaction)
           
 Collection<String> getForumTopicIds(String forumContentId, ITransaction transaction)
           
 String getLastPostedMessageId(String topicContentId, String excludedMessageId, ITransaction transaction)
          Returns the id of the last message posted on the specified topic.
 String getLastPostedTopicId(String forumContentId, 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.
 String getPrimaryKeyByContentId(String contentId)
          Returns the primary key through the given contentId.
 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)
          Increase the topic view counter.
 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)
          Sets the topic state.
 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

getPrimaryKeyByContentId

public String getPrimaryKeyByContentId(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 String getContentIdByPrimaryKey(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(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 forumContentId,
                                   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 String getLastPostedMessageId(String topicContentId,
                                     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(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
Increase the topic view counter.

Parameters:
topicId - the topic identifier.
transaction - the transaction for persistence access.
Throws:
PortalException

setTopicState

public void setTopicState(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

setForumState

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

getForumTopicIds

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

getForumIdsByCategory

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


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.