Package lumis.service.forum
Class ForumDaoJdbc
- java.lang.Object
-
- lumis.service.forum.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 Summary
Constructors Constructor Description ForumDaoJdbc()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
decreasePostedMessages(java.lang.String topicId, ITransaction transaction)
Decrease the count of messages (by one) on the specified topic and it's forum.void
decreasePostedTopics(java.lang.String topicId, ITransaction transaction)
Decrease the count of messages from the specified topic on it's forum.ForumCategoryConfig
getCategory(java.lang.String categoryId, ITransaction transaction)
Gets theForumCategoryConfig
for the specified categoryId.java.lang.String
getContentIdByPrimaryKey(java.lang.String primaryKeyValue)
Returns the contentId corresponding to the given primary key.ForumConfig
getForum(java.lang.String forumId, ITransaction transaction)
java.lang.String
getForumIdByTopicId(java.lang.String topicId, ITransaction transaction)
java.util.Collection<java.lang.String>
getForumIdsByCategory(java.lang.String categoryContentId, ITransaction transaction)
java.util.Collection<java.lang.String>
getForumTopicIds(java.lang.String forumContentId, ITransaction transaction)
java.lang.String
getLastPostedMessageId(java.lang.String topicContentId, java.lang.String excludedMessageId, ITransaction transaction)
Returns the id of the last message posted on the specified topic.java.lang.String
getLastPostedTopicId(java.lang.String forumContentId, java.lang.String excludedTopicId, ITransaction transaction)
Returns the id of the last updated topic on the specified forum.ForumMessageConfig
getMessage(java.lang.String messageId, ITransaction transaction)
Gets theForumMessageConfig
for the specified message id.java.lang.String
getPrimaryKeyByContentId(java.lang.String contentId)
Returns the primary key through the given contentId.ForumTopicConfig
getTopic(java.lang.String topicId, ITransaction transaction)
Gets theForumTopicConfig
for the specified topicId.void
increasePostedMessages(java.lang.String topicId, ITransaction transaction)
Increase topic and forum's message counters.void
increasePostedTopics(java.lang.String topicId, ITransaction transaction)
Increase the forum's topic counter.void
increaseTopicViews(java.lang.String topicId, ITransaction transaction)
Increase the topic view counter.void
setForumLastMessageInfo(java.lang.String forumId, java.lang.String lastTopicUser, java.sql.Timestamp lastTopicDate, ITransaction transaction)
Sets the forum's last message post date and user.void
setForumState(java.lang.String forumId, int state, ITransaction transaction)
void
setTopicFirstMessage(java.lang.String topicId, java.lang.String messageId, ITransaction transaction)
Updates the topic's firstMessageId colum with the specified messageId.void
setTopicLastMessageInfo(java.lang.String topicId, java.lang.String lastMessageUser, java.sql.Timestamp lastMessageDate, ITransaction transaction)
Sets the topic's last message post date and user.void
setTopicState(java.lang.String topicId, int state, ITransaction transaction)
Sets the topic state.void
setTopicSubject(java.lang.String topicId, java.lang.String subject, ITransaction transaction)
Updates the topic subject.
-
-
-
Method Detail
-
getForumIdByTopicId
public java.lang.String getForumIdByTopicId(java.lang.String topicId, ITransaction transaction) throws PortalException
- Throws:
PortalException
-
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
-
getTopic
public ForumTopicConfig getTopic(java.lang.String topicId, ITransaction transaction) throws PortalException
Gets theForumTopicConfig
for the specified topicId.- Parameters:
topicId
-transaction
-- Returns:
- Throws:
PortalException
-
getMessage
public ForumMessageConfig getMessage(java.lang.String messageId, ITransaction transaction) throws PortalException
Gets theForumMessageConfig
for the specified message id.- Parameters:
messageId
-transaction
-- Returns:
- Throws:
PortalException
-
getCategory
public ForumCategoryConfig getCategory(java.lang.String categoryId, ITransaction transaction) throws PortalException
Gets theForumCategoryConfig
for the specified categoryId.- Parameters:
categoryId
-transaction
-- Returns:
- Throws:
PortalException
-
getForum
public ForumConfig getForum(java.lang.String forumId, ITransaction transaction) throws PortalException
- 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
-
setForumState
public void setForumState(java.lang.String forumId, int state, ITransaction transaction) throws PortalException
- Throws:
PortalException
-
getForumTopicIds
public java.util.Collection<java.lang.String> getForumTopicIds(java.lang.String forumContentId, ITransaction transaction) throws PortalException
- Throws:
PortalException
-
getForumIdsByCategory
public java.util.Collection<java.lang.String> getForumIdsByCategory(java.lang.String categoryContentId, ITransaction transaction) throws PortalException
- Throws:
PortalException
-
-