Package lumis.service.forum
Class ForumDaoJdbc
- java.lang.Object
-
- lumis.service.forum.ForumDaoJdbc
-
public class ForumDaoJdbc extends 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 Summary
Constructors Constructor Description ForumDaoJdbc()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 theForumCategoryConfig
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 theForumMessageConfig
for the specified message id.String
getPrimaryKeyByContentId(String contentId)
Returns the primary key through the given contentId.ForumTopicConfig
getTopic(String topicId, ITransaction transaction)
Gets theForumTopicConfig
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.
-
-
-
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 theForumTopicConfig
for the specified topicId.- Parameters:
topicId
-transaction
-- Returns:
- Throws:
PortalException
-
getMessage
public ForumMessageConfig getMessage(String messageId, ITransaction transaction) throws PortalException
Gets theForumMessageConfig
for the specified message id.- Parameters:
messageId
-transaction
-- Returns:
- Throws:
PortalException
-
getCategory
public ForumCategoryConfig getCategory(String categoryId, ITransaction transaction) throws PortalException
Gets theForumCategoryConfig
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
-
-