Class SilverpeasQuestionManager
java.lang.Object
org.silverpeas.components.questionreply.service.SilverpeasQuestionManager
- All Implemented Interfaces:
QuestionManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcloseQuestions(Collection<Long> questionIds, String instanceId) Closes the specified questions of the given FAQ.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 parameterlongcreateQuestionReply(Question question, Reply reply, List<org.silverpeas.core.pdc.pdc.model.PdcPosition> positions) Creates and persists a question with its reply, and classifies the question on the PdC on the specified positions.longcreateReply(Reply reply, Question question) voiddeleteQuestionAndReplies(Collection<Long> questionIds, String instanceId) Deletes the specified questions of the given FAQ with their replies.getAllQuestions(String instanceId) getAllQuestionsByCategory(String instanceId, String categoryId) getAllReplies(long questionId, String instanceId) Gets the private then the public replies to the specified question of the given FAQ.getInstanceIdOfQuestion(long questionId) Gets the unique identifier of the FAQ in which the specified question is asked.getPublicQuestions(String instanceId) getQuestion(long questionId, String instanceId) Gets the specified question of the given FAQ.getQuestionPrivateReplies(long questionId, String instanceId) Gets the private replies to the specified question of the given FAQ.getQuestionPublicReplies(long questionId, String instanceId) Gets the public replies to the specified question of the given FAQ.getQuestionRecipients(long questionId) getQuestionReplies(long questionId, String instanceId) Gets all the replies to the specified question of the given FAQ.getQuestions(String instanceId) getQuestionsByIds(List<String> ids, String instanceId) Gets the specified questions of the given FAQ.getReceiveQuestions(String userId, String instanceId) Gets the specified reply to a question of the given FAQ.getSendQuestions(String userId, String instanceId) protected booleanisSortable(String instanceId) voidopenQuestions(Collection<Long> questionIds, String instanceId) Opens again the specified questions of the given FAQ.voidupdateQuestion(Question question) voidupdateRepliesPrivateStatus(Collection<Long> replyIds, Question question) voidupdateRepliesPublicStatus(Collection<Long> replyIds, Question question) voidupdateReply(Reply reply) protected voidupdateWysiwygContent(Reply reply)
-
Constructor Details
-
SilverpeasQuestionManager
public SilverpeasQuestionManager()
-
-
Method Details
-
createQuestion
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
- Specified by:
createReplyin interfaceQuestionManager- Throws:
QuestionReplyException
-
closeQuestions
public void closeQuestions(Collection<Long> questionIds, String instanceId) throws QuestionReplyException Description copied from interface:QuestionManagerCloses the specified questions of the given FAQ. The questions of other FAQs are ignored.- Specified by:
closeQuestionsin interfaceQuestionManager- Parameters:
questionIds- the unique identifiers of the questions.instanceId- the unique identifier of the FAQ.- Throws:
QuestionReplyException- if an error occurs.
-
openQuestions
public void openQuestions(Collection<Long> questionIds, String instanceId) throws QuestionReplyException Description copied from interface:QuestionManagerOpens again the specified questions of the given FAQ. The questions of other FAQs are ignored.- Specified by:
openQuestionsin interfaceQuestionManager- Parameters:
questionIds- the unique identifiers of the questions.instanceId- the unique identifier of the FAQ.- Throws:
QuestionReplyException- if an error occurs.
-
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
- Specified by:
updateQuestionin interfaceQuestionManager- Throws:
QuestionReplyException
-
updateReply
- Specified by:
updateReplyin interfaceQuestionManager- Throws:
QuestionReplyException
-
deleteQuestionAndReplies
public void deleteQuestionAndReplies(Collection<Long> questionIds, String instanceId) throws QuestionReplyException Description copied from interface:QuestionManagerDeletes the specified questions of the given FAQ with their replies. The questions of other FAQs are ignored.- Specified by:
deleteQuestionAndRepliesin interfaceQuestionManager- Parameters:
questionIds- the unique identifiers of the questions.instanceId- the unique identifier of the FAQ.- Throws:
QuestionReplyException- if an error occurs.
-
getAllReplies
Description copied from interface:QuestionManagerGets the private then the public replies to the specified question of the given FAQ.- Specified by:
getAllRepliesin interfaceQuestionManager- Parameters:
questionId- the unique identifier of the question.instanceId- the unique identifier of the FAQ.- Returns:
- the replies, or an empty list if the FAQ has no such question.
- Throws:
QuestionReplyException- if an error occurs.
-
getInstanceIdOfQuestion
Description copied from interface:QuestionManagerGets the unique identifier of the FAQ in which the specified question is asked. It is for the permalinks of the questions, that don't refer the FAQ.- Specified by:
getInstanceIdOfQuestionin interfaceQuestionManager- Parameters:
questionId- the unique identifier of the question.- Returns:
- the unique identifier of the FAQ, or nothing if there is no such question.
-
getQuestion
Description copied from interface:QuestionManagerGets the specified question of the given FAQ.- Specified by:
getQuestionin interfaceQuestionManager- Parameters:
questionId- the unique identifier of the question.instanceId- the unique identifier of the FAQ.- Returns:
- the question, or null if the FAQ has no such question.
-
getQuestionsByIds
Description copied from interface:QuestionManagerGets the specified questions of the given FAQ. The questions of other FAQs are ignored.- Specified by:
getQuestionsByIdsin interfaceQuestionManager- Parameters:
ids- the unique identifiers of the questions to get.instanceId- the unique identifier of the FAQ.- Returns:
- the questions found, or an empty list if no identifiers are given.
-
getQuestionReplies
Description copied from interface:QuestionManagerGets all the replies to the specified question of the given FAQ.- Specified by:
getQuestionRepliesin interfaceQuestionManager- Parameters:
questionId- the unique identifier of the question.instanceId- the unique identifier of the FAQ.- Returns:
- the replies, or an empty list if the FAQ has no such question.
-
getQuestionPublicReplies
Description copied from interface:QuestionManagerGets the public replies to the specified question of the given FAQ.- Specified by:
getQuestionPublicRepliesin interfaceQuestionManager- Parameters:
questionId- the unique identifier of the question.instanceId- the unique identifier of the FAQ.- Returns:
- the public replies, or an empty list if the FAQ has no such question.
-
getQuestionPrivateReplies
Description copied from interface:QuestionManagerGets the private replies to the specified question of the given FAQ.- Specified by:
getQuestionPrivateRepliesin interfaceQuestionManager- Parameters:
questionId- the unique identifier of the question.instanceId- the unique identifier of the FAQ.- Returns:
- the private replies, or an empty list if the FAQ has no such question.
-
getQuestionRecipients
- Specified by:
getQuestionRecipientsin interfaceQuestionManager
-
getReply
Description copied from interface:QuestionManagerGets the specified reply to a question of the given FAQ.- Specified by:
getReplyin interfaceQuestionManager- Parameters:
replyId- the unique identifier of the reply.instanceId- the unique identifier of the FAQ.- Returns:
- the reply, or null if no question of the FAQ has such a reply.
-
getSendQuestions
- Specified by:
getSendQuestionsin interfaceQuestionManager
-
getReceiveQuestions
- Specified by:
getReceiveQuestionsin interfaceQuestionManager
-
getQuestions
- Specified by:
getQuestionsin interfaceQuestionManager
-
getAllQuestions
- Specified by:
getAllQuestionsin interfaceQuestionManager
-
getAllQuestionsByCategory
- Specified by:
getAllQuestionsByCategoryin interfaceQuestionManager
-
getPublicQuestions
- Specified by:
getPublicQuestionsin interfaceQuestionManager
-
createQuestionReply
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
-
createQuestionReply
public long createQuestionReply(Question question, Reply reply, List<org.silverpeas.core.pdc.pdc.model.PdcPosition> positions) throws QuestionReplyException Description copied from interface:QuestionManagerCreates and persists a question with its reply, and classifies the question on the PdC on the specified positions. The question is classified before the subscribers are notified about the reply, and without alerting the subscribers on the PdC about the classification: they are notified about the reply with the other subscribers.- Specified by:
createQuestionReplyin interfaceQuestionManager- Parameters:
question- the new questionreply- the answer linked to the given questionpositions- the positions on the PdC on which the question has to be classified. If empty, the question isn't classified.- Returns:
- long identifier of the created question
- Throws:
QuestionReplyException- if an error occurs
-
updateWysiwygContent
-
isSortable
-