Class SilverpeasQuestionManager
- java.lang.Object
-
- org.silverpeas.components.questionreply.service.SilverpeasQuestionManager
-
- All Implemented Interfaces:
QuestionManager
@Service public class SilverpeasQuestionManager extends Object implements QuestionManager
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseQuestions(Collection<Long> questionIds)longcreateQuestion(Question question)Create and persist a question with targeted recipient (be careful recipient doesn't have question identifier set)longcreateQuestionReply(Question question, Reply reply)Save and persist question and reply given in parameterlongcreateReply(Reply reply, Question question)voiddeleteQuestionAndReplies(Collection<Long> questionIds)List<Question>getAllQuestions(String instanceId)List<Question>getAllQuestionsByCategory(String instanceId, String categoryId)List<Reply>getAllReplies(long questionId, String instanceId)List<Question>getPublicQuestions(String instanceId)QuestiongetQuestion(long questionId)QuestiongetQuestionAndReplies(long questionId)List<Reply>getQuestionPrivateReplies(long questionId, String instanceId)List<Reply>getQuestionPublicReplies(long questionId, String instanceId)List<Recipient>getQuestionRecipients(long questionId)List<Reply>getQuestionReplies(long questionId, String instanceId)List<Question>getQuestions(String instanceId)List<Question>getQuestionsByIds(List<String> ids)Gets the questions with the specified identifiers, whatever the FAQ they belong to.List<Question>getReceiveQuestions(String userId, String instanceId)ReplygetReply(long replyId)List<Question>getSendQuestions(String userId, String instanceId)protected booleanisSortable(String instanceId)voidopenQuestions(Collection<Long> questionIds)voidupdateQuestion(Question question)voidupdateQuestionRecipients(Question question)voidupdateQuestionRepliesPrivateStatus(Collection<Long> questionIds)voidupdateQuestionRepliesPublicStatus(Collection<Long> questionIds)voidupdateRepliesPrivateStatus(Collection<Long> replyIds, Question question)voidupdateRepliesPublicStatus(Collection<Long> replyIds, Question question)voidupdateReply(Reply reply)protected voidupdateWysiwygContent(Reply reply)
-
-
-
Method Detail
-
createQuestion
public long createQuestion(Question question) throws QuestionReplyException
Create and persist a question with targeted recipient (be careful recipient doesn't have question identifier set)- Specified by:
createQuestionin interfaceQuestionManager- Parameters:
question- the question to create- Returns:
- the generated question identifier
- Throws:
QuestionReplyException- if an error occurs
-
createReply
public long createReply(Reply reply, Question question) throws QuestionReplyException
- Specified by:
createReplyin interfaceQuestionManager- Throws:
QuestionReplyException
-
closeQuestions
public void closeQuestions(Collection<Long> questionIds) throws QuestionReplyException
- Specified by:
closeQuestionsin interfaceQuestionManager- Throws:
QuestionReplyException
-
openQuestions
public void openQuestions(Collection<Long> questionIds) throws QuestionReplyException
- Specified by:
openQuestionsin interfaceQuestionManager- Throws:
QuestionReplyException
-
updateQuestionRecipients
public void updateQuestionRecipients(Question question) throws QuestionReplyException
- Specified by:
updateQuestionRecipientsin interfaceQuestionManager- Throws:
QuestionReplyException
-
updateQuestionRepliesPublicStatus
public void updateQuestionRepliesPublicStatus(Collection<Long> questionIds) throws QuestionReplyException
- Specified by:
updateQuestionRepliesPublicStatusin interfaceQuestionManager- Throws:
QuestionReplyException
-
updateQuestionRepliesPrivateStatus
public void updateQuestionRepliesPrivateStatus(Collection<Long> questionIds) throws QuestionReplyException
- Specified by:
updateQuestionRepliesPrivateStatusin interfaceQuestionManager- Throws:
QuestionReplyException
-
updateRepliesPublicStatus
public void updateRepliesPublicStatus(Collection<Long> replyIds, Question question) throws QuestionReplyException
- Specified by:
updateRepliesPublicStatusin interfaceQuestionManager- Throws:
QuestionReplyException
-
updateRepliesPrivateStatus
public void updateRepliesPrivateStatus(Collection<Long> replyIds, Question question) throws QuestionReplyException
- Specified by:
updateRepliesPrivateStatusin interfaceQuestionManager- Throws:
QuestionReplyException
-
updateQuestion
public void updateQuestion(Question question) throws QuestionReplyException
- Specified by:
updateQuestionin interfaceQuestionManager- Throws:
QuestionReplyException
-
updateReply
public void updateReply(Reply reply) throws QuestionReplyException
- Specified by:
updateReplyin interfaceQuestionManager- Throws:
QuestionReplyException
-
deleteQuestionAndReplies
public void deleteQuestionAndReplies(Collection<Long> questionIds) throws QuestionReplyException
- Specified by:
deleteQuestionAndRepliesin interfaceQuestionManager- Throws:
QuestionReplyException
-
getAllReplies
public List<Reply> getAllReplies(long questionId, String instanceId) throws QuestionReplyException
- Specified by:
getAllRepliesin interfaceQuestionManager- Throws:
QuestionReplyException
-
getQuestion
public Question getQuestion(long questionId) throws QuestionReplyException
- Specified by:
getQuestionin interfaceQuestionManager- Throws:
QuestionReplyException
-
getQuestionAndReplies
public Question getQuestionAndReplies(long questionId) throws QuestionReplyException
- Specified by:
getQuestionAndRepliesin interfaceQuestionManager- Throws:
QuestionReplyException
-
getQuestionsByIds
public List<Question> getQuestionsByIds(List<String> ids) throws QuestionReplyException
Description copied from interface:QuestionManagerGets the questions with the specified identifiers, whatever the FAQ they belong to.- Specified by:
getQuestionsByIdsin interfaceQuestionManager- Parameters:
ids- the unique identifiers of the questions to get.- Returns:
- the questions found, or an empty list if no identifiers are given.
- Throws:
QuestionReplyException- if an error occurs while fetching the questions.
-
getQuestionReplies
public List<Reply> getQuestionReplies(long questionId, String instanceId) throws QuestionReplyException
- Specified by:
getQuestionRepliesin interfaceQuestionManager- Throws:
QuestionReplyException
-
getQuestionPublicReplies
public List<Reply> getQuestionPublicReplies(long questionId, String instanceId) throws QuestionReplyException
- Specified by:
getQuestionPublicRepliesin interfaceQuestionManager- Throws:
QuestionReplyException
-
getQuestionPrivateReplies
public List<Reply> getQuestionPrivateReplies(long questionId, String instanceId) throws QuestionReplyException
- Specified by:
getQuestionPrivateRepliesin interfaceQuestionManager- Throws:
QuestionReplyException
-
getQuestionRecipients
public List<Recipient> getQuestionRecipients(long questionId) throws QuestionReplyException
- Specified by:
getQuestionRecipientsin interfaceQuestionManager- Throws:
QuestionReplyException
-
getReply
public Reply getReply(long replyId) throws QuestionReplyException
- Specified by:
getReplyin interfaceQuestionManager- Throws:
QuestionReplyException
-
getSendQuestions
public List<Question> getSendQuestions(String userId, String instanceId) throws QuestionReplyException
- Specified by:
getSendQuestionsin interfaceQuestionManager- Throws:
QuestionReplyException
-
getReceiveQuestions
public List<Question> getReceiveQuestions(String userId, String instanceId) throws QuestionReplyException
- Specified by:
getReceiveQuestionsin interfaceQuestionManager- Throws:
QuestionReplyException
-
getQuestions
public List<Question> getQuestions(String instanceId) throws QuestionReplyException
- Specified by:
getQuestionsin interfaceQuestionManager- Throws:
QuestionReplyException
-
getAllQuestions
public List<Question> getAllQuestions(String instanceId) throws QuestionReplyException
- Specified by:
getAllQuestionsin interfaceQuestionManager- Throws:
QuestionReplyException
-
getAllQuestionsByCategory
public List<Question> getAllQuestionsByCategory(String instanceId, String categoryId) throws QuestionReplyException
- Specified by:
getAllQuestionsByCategoryin interfaceQuestionManager- Throws:
QuestionReplyException
-
getPublicQuestions
public List<Question> getPublicQuestions(String instanceId) throws QuestionReplyException
- Specified by:
getPublicQuestionsin interfaceQuestionManager- Throws:
QuestionReplyException
-
createQuestionReply
public long createQuestionReply(Question question, Reply reply) throws QuestionReplyException
Save and persist question and reply given in parameter- Specified by:
createQuestionReplyin interfaceQuestionManager- Parameters:
question- the new questionreply- the answer linked to the given question- Returns:
- the created question identifier
- Throws:
QuestionReplyException- if an error occurs
-
updateWysiwygContent
protected void updateWysiwygContent(Reply reply)
-
isSortable
protected boolean isSortable(String instanceId)
-
-