Class DefaultForumService
java.lang.Object
org.silverpeas.components.forums.service.DefaultForumService
- All Implemented Interfaces:
ForumService
Forums service layer which manage forums application
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddModerator(ForumPK forumPK, String userId) voidcreateCategory(org.silverpeas.core.node.model.NodeDetail category) intcreateForum(ForumPK forumPK, String forumName, String forumDescription, String forumCreator, int forumParent, String categoryId, String keywords) Creates a new forum.voidcreateIndex(ForumPK forumPK) voidcreateIndex(MessagePK messagePK) intcreateMessage(MessagePK messagePK, String title, String authorId, Date creationDate, int forumId, int parentId, String content, String keywords, String status) Create new forum messagevoidvoiddeleteCategory(String categoryId, String instanceId) voiddeleteForum(ForumPK forumPK) Supprime un forum et tous ses sous-forums a partir de sa primary keyvoiddeleteMessage(MessagePK messagePK) Remove the specified message and all the submessages.Collection<org.silverpeas.core.node.model.NodeDetail> getAllCategories(String instanceId) intgetAuthorNbMessages(String userId, String status) org.silverpeas.core.node.model.NodeDetailgetCategory(org.silverpeas.core.node.model.NodePK pk) getForumCreatorId(int forumId) getForumDetail(ForumPK forumPK) getForumInstanceId(int forumId) getForumName(int forumId) intgetForumParentId(int forumId) getForumPath(ForumPK forumPK) getForums(Collection<ForumPK> forumPKs) getForumsByCategory(ForumPK forumPK, String categoryId) getForumSonsIds(ForumPK forumPK) getForumTags(ForumPK forumPK) getLastMessage(ForumPK forumPK, int messageParentId, String status) getLastMessage(ForumPK forumPK, String status) Gets the last message posted into the given forum.getLastMessage(ForumPK forumPK, List<String> messageParentIds, String status) getLastMessageRSS(String instanceId, int nbReturned) getMessage(MessagePK messagePK) intgetMessageParentId(int messageId) getMessagePath(MessagePK messagePK) getMessages(ForumPK forumPK) getMessageTags(MessagePK messagePK) getMessageTitle(int messageId) getModerators(int forumId) intgetNbMessages(int forumId, String type, String status) intgetNbResponses(int forumId, int messageId, String status) intgetSilverObjectId(ForumPK forumPK) protected org.silverpeas.core.subscription.SubscriptionServiceprotected StringgetWysiwygContent(String componentId, String messageId) booleanisForumActive(int forumId) booleanisModerator(String userId, ForumPK forumPK) booleanisNewMessage(String userId, ForumPK forumPK, int messageParentId, String status) booleanisNewMessageByForum(String userId, ForumPK forumPK, String status) Is there any non read messages with the given status in the specified forum?booleanisSubscriber(String instanceId, String userId) Indicates if the given user has subscribed to the given component instance.booleanisSubscriber(ForumPK forumPK, String userId) Indicates if the given user has subscribed to the given forum.booleanisSubscriber(MessagePK messagePK, String userId) Indicates if the given user has subscribed to the given forum message.booleanisSubscriberByInheritance(ForumPK forumPK, String userId) Indicates if the given user is subscribed by inheritance to the given forum.booleanisSubscriberByInheritance(MessagePK messagePK, String userId) Indicates if the given user is subscribed by inheritance to the given forum message.org.silverpeas.core.subscription.util.SubscriptionSubscriberListlistAllSubscribers(ForumPK forumPK) Gets the list of subscribers related to the given forum.org.silverpeas.core.subscription.util.SubscriptionSubscriberListlistAllSubscribers(MessagePK messagePK) Gets the list of subscribers related to the given forum message.voidLocks recursively in writing the tree of a given forum.voidmoveMessage(MessagePK messagePK, ForumPK forumPK) protected ConnectionOpen connectionvoidremoveAllModerators(ForumPK forumPK) voidremoveModerator(ForumPK forumPK, String userId) voidsetLastVisit(String userId, int messageId) Saves the date of the last visit of the given user to the specified message.voidsubscribeForum(ForumPK forumPK, String userId) Subscribe the given user to the given forum.voidsubscribeMessage(MessagePK messagePK, String userId) Subscribe the given user to the given forum message.intunlockForum(ForumPK forumPK, int level) Unlock the forum in writing forum.voidunsubscribeForum(ForumPK forumPK, String userId) Unsubscribe the given user to the given forum.voidunsubscribeMessage(MessagePK messagePK, String userId) Unsubscribe the given user to the given forum message.voidupdateCategory(org.silverpeas.core.node.model.NodeDetail category) voidupdateForum(ForumPK forumPK, String forumName, String forumDescription, int forumParent, String categoryId, String keywords) Updates the specified forum with the given information.voidvoidupdateMessageKeywords(MessagePK messagePK, String keywords)
-
Constructor Details
-
DefaultForumService
public DefaultForumService()
-
-
Method Details
-
getForums
- Specified by:
getForumsin interfaceForumService
-
getForum
- Specified by:
getForumin interfaceForumService
-
getForumPath
- Specified by:
getForumPathin interfaceForumService
-
getForumName
- Specified by:
getForumNamein interfaceForumService
-
deleteAll
- Specified by:
deleteAllin interfaceForumService
-
isForumActive
public boolean isForumActive(int forumId) - Specified by:
isForumActivein interfaceForumService
-
getForumParentId
public int getForumParentId(int forumId) - Specified by:
getForumParentIdin interfaceForumService
-
getForumInstanceId
- Specified by:
getForumInstanceIdin interfaceForumService
-
getForumCreatorId
-
getForums
- Specified by:
getForumsin interfaceForumService
-
getForumDetail
- Specified by:
getForumDetailin interfaceForumService- Parameters:
forumPK- forum primary key- Returns:
- a ForumDetail from the forum primary key identifier
-
getForumsByCategory
- Specified by:
getForumsByCategoryin interfaceForumService
-
getForumSonsIds
- Specified by:
getForumSonsIdsin interfaceForumService
-
lockForum
Locks recursively in writing the tree of a given forum.- Specified by:
lockForumin interfaceForumService- Parameters:
forumPK- the unique identifier of the forum.level- the locking level.
-
unlockForum
Unlock the forum in writing forum.- Specified by:
unlockForumin interfaceForumService- Parameters:
forumPK- the unique identifier of the forum.level- the level of the forum locking- Returns:
- the result of the operation. Greater than 0 means error.
-
deleteForum
Supprime un forum et tous ses sous-forums a partir de sa primary key- Specified by:
deleteForumin interfaceForumService- Parameters:
forumPK- la primary key du forum
-
createForum
public int createForum(ForumPK forumPK, String forumName, String forumDescription, String forumCreator, int forumParent, String categoryId, String keywords) Creates a new forum.- Specified by:
createForumin interfaceForumService- Parameters:
forumPK- the global identifier of the forum to createforumName- the name of the forumforumDescription- a short description of the forum.forumCreator- the unique identifier of the creator.forumParent- the unique identifier of a parent forum (if any).categoryId- the unique identifier of the category for which the forum will be createdkeywords- keywords- Returns:
- the unique identifier of the forum.
-
updateForum
public void updateForum(ForumPK forumPK, String forumName, String forumDescription, int forumParent, String categoryId, String keywords) Updates the specified forum with the given information.- Specified by:
updateForumin interfaceForumService- Parameters:
forumPK- the unique identifier of a forumforumName- the new name of the forumforumDescription- the new description of the forumforumParent- the unique identifier of the new parent forumcategoryId- the unique identifier of the new categorykeywords- the new keywords of the forum.
-
getMessages
- Specified by:
getMessagesin interfaceForumService
-
getNbMessages
- Specified by:
getNbMessagesin interfaceForumService
-
getAuthorNbMessages
- Specified by:
getAuthorNbMessagesin interfaceForumService
-
getNbResponses
- Specified by:
getNbResponsesin interfaceForumService
-
getLastMessage
Gets the last message posted into the given forum.- Specified by:
getLastMessagein interfaceForumService- Parameters:
forumPK- the unique identifier of the forum.status- the status of the message to get.- Returns:
- the last message in the forum with the specified status.
-
getLastMessageRSS
- Specified by:
getLastMessageRSSin interfaceForumService
-
getLastMessage
- Specified by:
getLastMessagein interfaceForumService
-
getLastMessage
- Specified by:
getLastMessagein interfaceForumService
-
isNewMessageByForum
Is there any non read messages with the given status in the specified forum?- Specified by:
isNewMessageByForumin interfaceForumService- Parameters:
userId- the unique identifier of a userforumPK- the unique identifier of the forumstatus- the status of the non read messages (validated, waiting, ...)- Returns:
- true if there is at least one message with the given status non read by the user. False otherwise.
-
isNewMessage
- Specified by:
isNewMessagein interfaceForumService
-
setLastVisit
Saves the date of the last visit of the given user to the specified message.- Specified by:
setLastVisitin interfaceForumService- Parameters:
userId- the unique identifier of the usermessageId- the unique identifier of the message
-
getMessage
- Specified by:
getMessagein interfaceForumService
-
getMessagePath
- Specified by:
getMessagePathin interfaceForumService
-
getMessageTitle
- Specified by:
getMessageTitlein interfaceForumService
-
getMessageParentId
public int getMessageParentId(int messageId) - Specified by:
getMessageParentIdin interfaceForumService
-
createMessage
public int createMessage(MessagePK messagePK, String title, String authorId, Date creationDate, int forumId, int parentId, String content, String keywords, String status) Create new forum message- Specified by:
createMessagein interfaceForumService- Parameters:
messagePK- message primary key identifiertitle- message titleauthorId- message author identifiercreationDate- creation dateforumId- forum identifierparentId- parent message identifiercontent- message contentkeywords- the message keywordsstatus- the message status- Returns:
- new message identifier
-
updateMessage
public void updateMessage(MessagePK messagePK, String title, String message, String userId, String status) - Specified by:
updateMessagein interfaceForumService
-
updateMessageKeywords
- Specified by:
updateMessageKeywordsin interfaceForumService
-
deleteMessage
Remove the specified message and all the submessages.- Specified by:
deleteMessagein interfaceForumService- Parameters:
messagePK- the unique identifier of the message- Since:
- 04 Octobre 2000
-
isModerator
- Specified by:
isModeratorin interfaceForumService
-
addModerator
- Specified by:
addModeratorin interfaceForumService
-
removeModerator
- Specified by:
removeModeratorin interfaceForumService
-
removeAllModerators
- Specified by:
removeAllModeratorsin interfaceForumService
-
getModerators
- Specified by:
getModeratorsin interfaceForumService
-
moveMessage
- Specified by:
moveMessagein interfaceForumService
-
subscribeMessage
Subscribe the given user to the given forum message.- Specified by:
subscribeMessagein interfaceForumService- Parameters:
messagePK- the unique identifier of the message.userId- the unique identifier of the user to subscribe.
-
unsubscribeMessage
Unsubscribe the given user to the given forum message.- Specified by:
unsubscribeMessagein interfaceForumService- Parameters:
messagePK- the unique identifier of the message.userId- the unique identifier of the user to unsubscribe.
-
subscribeForum
Subscribe the given user to the given forum.- Specified by:
subscribeForumin interfaceForumService- Parameters:
forumPK- the unique identifier of the forum.userId- the unique identifier of the user to subscribe.
-
unsubscribeForum
Unsubscribe the given user to the given forum.- Specified by:
unsubscribeForumin interfaceForumService- Parameters:
forumPK- the unique identifier of the forum.userId- the unique identifier of the user to unsubscribe.
-
listAllSubscribers
public org.silverpeas.core.subscription.util.SubscriptionSubscriberList listAllSubscribers(MessagePK messagePK) Gets the list of subscribers related to the given forum message.- Specified by:
listAllSubscribersin interfaceForumService- Parameters:
messagePK- the unique identifier of the message.- Returns:
- a list of subscribers.
-
listAllSubscribers
public org.silverpeas.core.subscription.util.SubscriptionSubscriberList listAllSubscribers(ForumPK forumPK) Gets the list of subscribers related to the given forum.- Specified by:
listAllSubscribersin interfaceForumService- Parameters:
forumPK- the unique identifier of the forum.- Returns:
- a list of subscribers.
-
isSubscriber
Indicates if the given user has subscribed to the given forum message.- Specified by:
isSubscriberin interfaceForumService- Parameters:
messagePK- the unique identifier of a message.userId- the unique identifier of the user.- Returns:
- true if the given user has subscribed to the specified message. False otherwise.
-
isSubscriberByInheritance
Indicates if the given user is subscribed by inheritance to the given forum message.- Specified by:
isSubscriberByInheritancein interfaceForumService- Parameters:
messagePK- the unique identifier of a message.userId- the unique identifier of the user.- Returns:
- true if the given user has subscribed to the specified message. False otherwise.
-
isSubscriber
Indicates if the given user has subscribed to the given forum.- Specified by:
isSubscriberin interfaceForumService- Parameters:
forumPK- the unique identifier of the forum.userId- the unique identifier of the user.- Returns:
- true if the given user has subscribed to the specified forum. False otherwise.
-
isSubscriberByInheritance
Indicates if the given user is subscribed by inheritance to the given forum.- Specified by:
isSubscriberByInheritancein interfaceForumService- Parameters:
forumPK- the unique identifier of the forum.userId- the unique identifier of the user.- Returns:
- true if the given user has subscribed to the specified forum. False otherwise.
-
isSubscriber
Indicates if the given user has subscribed to the given component instance.- Specified by:
isSubscriberin interfaceForumService- Parameters:
instanceId- the unique identifier of the component instance.userId- the unique identifier of the user.- Returns:
- true if the given user has subscribed to the specified component instance. False otherwise.
-
createIndex
- Specified by:
createIndexin interfaceForumService
-
createIndex
- Specified by:
createIndexin interfaceForumService
-
openConnection
Open connection- Returns:
- the connection
-
getSilverObjectId
- Specified by:
getSilverObjectIdin interfaceForumService
-
createCategory
public void createCategory(org.silverpeas.core.node.model.NodeDetail category) - Specified by:
createCategoryin interfaceForumService
-
updateCategory
public void updateCategory(org.silverpeas.core.node.model.NodeDetail category) - Specified by:
updateCategoryin interfaceForumService
-
deleteCategory
- Specified by:
deleteCategoryin interfaceForumService
-
getCategory
public org.silverpeas.core.node.model.NodeDetail getCategory(org.silverpeas.core.node.model.NodePK pk) - Specified by:
getCategoryin interfaceForumService
-
getAllCategories
- Specified by:
getAllCategoriesin interfaceForumService
-
getForumTags
- Specified by:
getForumTagsin interfaceForumService
-
getMessageTags
- Specified by:
getMessageTagsin interfaceForumService
-
getWysiwygContent
-
getSubscribeService
protected org.silverpeas.core.subscription.SubscriptionService getSubscribeService()
-