Class DefaultQuestionService
- java.lang.Object
-
- org.silverpeas.core.questioncontainer.question.service.DefaultQuestionService
-
- All Implemented Interfaces:
QuestionService
@Service @Singleton public class DefaultQuestionService extends Object implements QuestionService
Question Business Manager See QuestionBmBusinessSkeleton for methods documentation Stateless service to manage questions- Author:
- neysseri
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DefaultQuestionService()
Hidden constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createAnswersToAQuestion(Question questionDetail)
Create some answers to a questionAnswerPK
createAnswerToAQuestion(Answer answerDetail, QuestionPK questionPK)
Add an answer to a questionQuestionPK
createQuestion(Question question)
Create a new questionvoid
createQuestions(Collection<Question> questions, String fatherId)
Create some questions to a given fathervoid
deleteAnswersToAQuestion(QuestionPK questionPK)
Delete all answers to a questionvoid
deleteAnswerToAQuestion(AnswerPK answerPK, QuestionPK questionPK)
Delete an answer to a questionvoid
deleteQuestion(QuestionPK questionPK)
Delete a questionvoid
deleteQuestionsByFatherPK(QuestionPK questionPK, String fatherId)
Delete the questions of a fatherQuestion
getQuestion(QuestionPK questionPK)
Get a questionCollection<Question>
getQuestionsByFatherPK(QuestionPK questionPK, String fatherId)
Get all questions for a given fathervoid
updateAnswersToAQuestion(Question questionDetail)
Update the answers to a questionvoid
updateAnswerToAQuestion(Answer answerDetail)
Update an answer to a questionvoid
updateQuestion(Question questionDetail)
Update a questionvoid
updateQuestionHeader(Question questionDetail)
Update a question header (self attributes)
-
-
-
Method Detail
-
getQuestion
public Question getQuestion(QuestionPK questionPK)
Description copied from interface:QuestionService
Get a question- Specified by:
getQuestion
in interfaceQuestionService
- Parameters:
questionPK
- the question id- Returns:
- a Question
-
getQuestionsByFatherPK
public Collection<Question> getQuestionsByFatherPK(QuestionPK questionPK, String fatherId)
Description copied from interface:QuestionService
Get all questions for a given father- Specified by:
getQuestionsByFatherPK
in interfaceQuestionService
- Parameters:
questionPK
- the question idfatherId
- the father id- Returns:
- a Collection of Question
-
createQuestion
public QuestionPK createQuestion(Question question)
Description copied from interface:QuestionService
Create a new question- Specified by:
createQuestion
in interfaceQuestionService
- Parameters:
question
- the question to create- Returns:
- the id of the new question
-
createQuestions
public void createQuestions(Collection<Question> questions, String fatherId)
Description copied from interface:QuestionService
Create some questions to a given father- Specified by:
createQuestions
in interfaceQuestionService
- Parameters:
questions
- a Collection of Question to createfatherId
- the father id
-
deleteQuestionsByFatherPK
public void deleteQuestionsByFatherPK(QuestionPK questionPK, String fatherId)
Description copied from interface:QuestionService
Delete the questions of a father- Specified by:
deleteQuestionsByFatherPK
in interfaceQuestionService
- Parameters:
questionPK
- the question contextfatherId
- the father id
-
deleteQuestion
public void deleteQuestion(QuestionPK questionPK)
Description copied from interface:QuestionService
Delete a question- Specified by:
deleteQuestion
in interfaceQuestionService
- Parameters:
questionPK
- the question id to delete
-
updateQuestion
public void updateQuestion(Question questionDetail)
Description copied from interface:QuestionService
Update a question- Specified by:
updateQuestion
in interfaceQuestionService
- Parameters:
questionDetail
- the question to update
-
updateQuestionHeader
public void updateQuestionHeader(Question questionDetail)
Description copied from interface:QuestionService
Update a question header (self attributes)- Specified by:
updateQuestionHeader
in interfaceQuestionService
- Parameters:
questionDetail
- the question attributes
-
updateAnswersToAQuestion
public void updateAnswersToAQuestion(Question questionDetail)
Description copied from interface:QuestionService
Update the answers to a question- Specified by:
updateAnswersToAQuestion
in interfaceQuestionService
- Parameters:
questionDetail
- the question containing the answers
-
updateAnswerToAQuestion
public void updateAnswerToAQuestion(Answer answerDetail)
Description copied from interface:QuestionService
Update an answer to a question- Specified by:
updateAnswerToAQuestion
in interfaceQuestionService
- Parameters:
answerDetail
- the answer to update
-
deleteAnswersToAQuestion
public void deleteAnswersToAQuestion(QuestionPK questionPK)
Description copied from interface:QuestionService
Delete all answers to a question- Specified by:
deleteAnswersToAQuestion
in interfaceQuestionService
- Parameters:
questionPK
- the question
-
deleteAnswerToAQuestion
public void deleteAnswerToAQuestion(AnswerPK answerPK, QuestionPK questionPK)
Description copied from interface:QuestionService
Delete an answer to a question- Specified by:
deleteAnswerToAQuestion
in interfaceQuestionService
- Parameters:
answerPK
- the answer id to deletequestionPK
- the question id
-
createAnswersToAQuestion
public void createAnswersToAQuestion(Question questionDetail)
Description copied from interface:QuestionService
Create some answers to a question- Specified by:
createAnswersToAQuestion
in interfaceQuestionService
- Parameters:
questionDetail
- the question which contains the answers
-
createAnswerToAQuestion
public AnswerPK createAnswerToAQuestion(Answer answerDetail, QuestionPK questionPK)
Description copied from interface:QuestionService
Add an answer to a question- Specified by:
createAnswerToAQuestion
in interfaceQuestionService
- Parameters:
answerDetail
- the new answerquestionPK
- the question id- Returns:
- the PK of the new answer
-
-