Interface QuestionManager
- All Known Implementing Classes:
SilverpeasQuestionManager
public interface QuestionManager
The service managing the questions and the replies of the FAQs, that is to say of the
QuestionReply application instances. Except for finding out the FAQ of a question, the
questions and the replies are always accessed within a given FAQ: those of other FAQs are
ignored.
-
Method Summary
Modifier and TypeMethodDescriptionvoidcloseQuestions(Collection<Long> questionIds, String instanceId) Closes the specified questions of the given FAQ.longcreateQuestion(Question question) longcreateQuestionReply(Question question, Reply reply) Create and persist a question replylongcreateQuestionReply(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) 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)
-
Method Details
-
createQuestion
- Throws:
QuestionReplyException
-
createReply
- Throws:
QuestionReplyException
-
closeQuestions
Closes the specified questions of the given FAQ. The questions of other FAQs are ignored.- Parameters:
questionIds- the unique identifiers of the questions.instanceId- the unique identifier of the FAQ.- Throws:
QuestionReplyException- if an error occurs.
-
openQuestions
Opens again the specified questions of the given FAQ. The questions of other FAQs are ignored.- Parameters:
questionIds- the unique identifiers of the questions.instanceId- the unique identifier of the FAQ.- Throws:
QuestionReplyException- if an error occurs.
-
updateRepliesPublicStatus
void updateRepliesPublicStatus(Collection<Long> replyIds, Question question) throws QuestionReplyException - Throws:
QuestionReplyException
-
updateRepliesPrivateStatus
void updateRepliesPrivateStatus(Collection<Long> replyIds, Question question) throws QuestionReplyException - Throws:
QuestionReplyException
-
updateQuestion
- Throws:
QuestionReplyException
-
updateReply
- Throws:
QuestionReplyException
-
deleteQuestionAndReplies
void deleteQuestionAndReplies(Collection<Long> questionIds, String instanceId) throws QuestionReplyException Deletes the specified questions of the given FAQ with their replies. The questions of other FAQs are ignored.- Parameters:
questionIds- the unique identifiers of the questions.instanceId- the unique identifier of the FAQ.- Throws:
QuestionReplyException- if an error occurs.
-
getAllReplies
Gets the private then the public replies to the specified question of the given FAQ.- 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
Gets 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.- Parameters:
questionId- the unique identifier of the question.- Returns:
- the unique identifier of the FAQ, or nothing if there is no such question.
- Throws:
QuestionReplyException- if an error occurs.
-
getQuestion
Gets the specified question of the given FAQ.- 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.
- Throws:
QuestionReplyException- if an error occurs.
-
getQuestionsByIds
Gets the specified questions of the given FAQ. The questions of other FAQs are ignored.- 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.
- Throws:
QuestionReplyException- if an error occurs while fetching the questions.
-
getQuestionReplies
Gets all the replies to the specified question of the given FAQ.- 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.
-
getQuestionPublicReplies
List<Reply> getQuestionPublicReplies(long questionId, String instanceId) throws QuestionReplyException Gets the public replies to the specified question of the given FAQ.- 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.
- Throws:
QuestionReplyException- if an error occurs.
-
getQuestionPrivateReplies
List<Reply> getQuestionPrivateReplies(long questionId, String instanceId) throws QuestionReplyException Gets the private replies to the specified question of the given FAQ.- 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.
- Throws:
QuestionReplyException- if an error occurs.
-
getQuestionRecipients
- Throws:
QuestionReplyException
-
getReply
Gets the specified reply to a question of the given FAQ.- 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.
- Throws:
QuestionReplyException- if an error occurs.
-
getSendQuestions
- Throws:
QuestionReplyException
-
getReceiveQuestions
- Throws:
QuestionReplyException
-
getQuestions
- Throws:
QuestionReplyException
-
getAllQuestions
- Throws:
QuestionReplyException
-
getAllQuestionsByCategory
List<Question> getAllQuestionsByCategory(String instanceId, String categoryId) throws QuestionReplyException - Throws:
QuestionReplyException
-
getPublicQuestions
- Throws:
QuestionReplyException
-
createQuestionReply
Create and persist a question reply- Parameters:
question- the new questionreply- the answer linked to the given question- Returns:
- long identifier of the created question
- Throws:
QuestionReplyException
-
createQuestionReply
long createQuestionReply(Question question, Reply reply, List<org.silverpeas.core.pdc.pdc.model.PdcPosition> positions) throws QuestionReplyException Creates 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.- 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
-