Class DefaultAnswerService
- java.lang.Object
-
- org.silverpeas.core.questioncontainer.answer.service.DefaultAnswerService
-
- All Implemented Interfaces:
AnswerService
@Service @Singleton public class DefaultAnswerService extends Object implements AnswerService
Answer Business Manager See AnswerService for methods documentation Stateless service to manage answer- Author:
- neysseri
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultAnswerService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAnswersToAQuestion(Collection<Answer> answers, ResourceReference questionPK)
Add some answers to a questionvoid
addAnswerToAQuestion(Answer answer, ResourceReference questionPK)
Add an answer to a questionvoid
deleteAnswersToAQuestion(ResourceReference questionPK)
Delete all answers to a given questionvoid
deleteAnswerToAQuestion(ResourceReference questionPK, String answerId)
Delete an answer to a questionCollection<Answer>
getAnswersByQuestionPK(ResourceReference questionPK)
Get answers which composed the questionvoid
recordThisAnswerAsVote(ResourceReference questionPK, AnswerPK answerPK)
Record that the answer (answerPK) has been chosen to the question (questionPK)void
updateAnswerToAQuestion(ResourceReference questionPK, Answer answer)
Update an answer to a question
-
-
-
Method Detail
-
getAnswersByQuestionPK
public Collection<Answer> getAnswersByQuestionPK(ResourceReference questionPK)
Description copied from interface:AnswerService
Get answers which composed the question- Specified by:
getAnswersByQuestionPK
in interfaceAnswerService
- Parameters:
questionPK
- the QuestionPK (question id)- Returns:
- a Collection of Answer
-
recordThisAnswerAsVote
public void recordThisAnswerAsVote(ResourceReference questionPK, AnswerPK answerPK)
Description copied from interface:AnswerService
Record that the answer (answerPK) has been chosen to the question (questionPK)- Specified by:
recordThisAnswerAsVote
in interfaceAnswerService
- Parameters:
questionPK
- the QuestionPK (question id)answerPK
- the AnswerPK (answer id)
-
addAnswersToAQuestion
public void addAnswersToAQuestion(Collection<Answer> answers, ResourceReference questionPK)
Description copied from interface:AnswerService
Add some answers to a question- Specified by:
addAnswersToAQuestion
in interfaceAnswerService
- Parameters:
answers
- a Collection of AnswerquestionPK
- the QuestionPK (question id)
-
addAnswerToAQuestion
public void addAnswerToAQuestion(Answer answer, ResourceReference questionPK)
Description copied from interface:AnswerService
Add an answer to a question- Specified by:
addAnswerToAQuestion
in interfaceAnswerService
- Parameters:
answer
- the AnswerquestionPK
- the QuestionPK (question id)
-
deleteAnswersToAQuestion
public void deleteAnswersToAQuestion(ResourceReference questionPK)
Description copied from interface:AnswerService
Delete all answers to a given question- Specified by:
deleteAnswersToAQuestion
in interfaceAnswerService
- Parameters:
questionPK
- the QuestionPK (question id)
-
deleteAnswerToAQuestion
public void deleteAnswerToAQuestion(ResourceReference questionPK, String answerId)
Description copied from interface:AnswerService
Delete an answer to a question- Specified by:
deleteAnswerToAQuestion
in interfaceAnswerService
- Parameters:
questionPK
- the QuestionPK (question id)answerId
- the answer id
-
updateAnswerToAQuestion
public void updateAnswerToAQuestion(ResourceReference questionPK, Answer answer)
Description copied from interface:AnswerService
Update an answer to a question- Specified by:
updateAnswerToAQuestion
in interfaceAnswerService
- Parameters:
questionPK
- the QuestionPK (question id)answer
- the Answer
-
-