Package org.encuestame.persistence.domain.question

Examples of org.encuestame.persistence.domain.question.Question


     * Update Question Name.
     * @param questionId
     * @param questionName
     */
    public void updateQuestionName(final Long questionId, final String questionName){
            final Question question = getQuestionDao().retrieveQuestionById(questionId);
            if (question != null) {
                question.setQuestion(questionName);
                getQuestionDao().saveOrUpdate(question);
            }
    }
View Full Code Here


            final String questionName,
            final UserAccount user) throws EnMeExpcetion, NoSuchAlgorithmException, UnsupportedEncodingException{
        final QuestionBean questionBean = new QuestionBean();
        questionBean.setQuestionName(questionName);
        questionBean.setUserId(user.getUid());
        final Question questionDomain = createQuestion(questionBean, user, QuestionPattern.LINKS);
        return questionDomain;
    }
View Full Code Here

     * Update Question.
     * @param unitQuestionPoll
     * @throws EnMeExpcetion  Exception
     */
     public void updateQuestion(final QuestionBean unitQuestionPoll) throws EnMeExpcetion{
         final Question question = getQuestionDao().retrieveQuestionById(unitQuestionPoll.getId());
         if (question == null){
             throw new EnMeExpcetion("question not found");
         }
         else{
             question.setQuestion(unitQuestionPoll.getQuestionName());
             getQuestionDao().saveOrUpdate(question);
         }
     }
View Full Code Here

     * @return
     * @throws EnMeNoResultsFoundException
     */
    public Question getQuestionById(final Long id)
            throws EnMeNoResultsFoundException {
        final Question question = getQuestionDao().retrieveQuestionById(id);
        if (question == null) {
            throw new EnMeNoResultsFoundException(
                    "Question not found with this id:" + id);
        } else {
            return question;
View Full Code Here

            final String questionName,
            final UserAccount user) throws EnMeExpcetion, NoSuchAlgorithmException, UnsupportedEncodingException{
        final QuestionBean questionBean = new QuestionBean();
        questionBean.setQuestionName(questionName);
        questionBean.setUserId(user.getUid());
        final Question questionDomain = createQuestion(questionBean, user, QuestionPattern.LINKS);
        return questionDomain;
    }
View Full Code Here

            final TweetPollBean tweetPollBean,
            final String questionName,
            final UserAccount user,
            final HttpServletRequest request) throws EnMeExpcetion {
        try{
            final Question question = createTweetPollQuestion(questionName, user);
            log.debug("question found:{" + question);
            if (question == null) {
                throw new EnMeNoResultsFoundException("question not found");
            } else {
                final TweetPoll tweetPollDomain = newTweetPoll(tweetPollBean, question);
View Full Code Here

        //TODO: disabled to create hashtag directly from own service.
        //final List<HashTag> newList = retrieveListOfHashTags(tweetPollBean.getHashTags());
        //log.debug("new list of hashtags size: "+newList.size());

        //update question name.
        final Question questionDomain = tweetPoll.getQuestion();
        Assert.notNull(questionDomain);
        questionDomain.setQuestion(tweetPollBean.getQuestionBean().getQuestionName());
        questionDomain.setSlugQuestion(RestFullUtil.slugify(tweetPollBean.getQuestionBean().getQuestionName()));
        questionDomain.setCreateDate(Calendar.getInstance().getTime());
        getQuestionDao().saveOrUpdate(questionDomain);

        //update hashtags.
        //TODO: disabled to create hashtag directly from own service.
        //tweetPoll.getHashTags().addAll(retrieveListOfHashTags(tweetPollBean.getHashTags())); //TODO check if this action remove old hashtags.
View Full Code Here

    public TweetPollSwitch createTweetPollQuestionAnswer(
            final QuestionAnswerBean answerBean,
            final TweetPoll tp,
            final HttpServletRequest request)
            throws EnMeNoResultsFoundException {
        final Question question = tp.getQuestion();
        //create answer
        final QuestionAnswer questionAnswer = createQuestionAnswer(answerBean,
                question);
        if (questionAnswer == null) {
            throw new EnMeNoResultsFoundException("answer is missing");
View Full Code Here

     * (non-Javadoc)
     * @see org.encuestame.core.service.imp.SearchServiceOperations#getQuestionInfo(java.lang.Long)
     */
  @Override
  public QuestionBean getQuestionInfo(Long questionId) throws EnMeNoResultsFoundException {
    final Question question = getQuestionDao().retrieveQuestionById(questionId);
    if (question == null) {
      throw new EnMeNoResultsFoundException("question not found");
    }
    return ConvertDomainBean.convertQuestionsToBean(question);
  }
View Full Code Here

    @Before
    public void initData(){
        this.secondary = createUserAccount("paola", createAccount());
        this.hashTag = createHashTag("hardware",50L);
        createHashTagHit(hashTag, this.ipAddress);
        final Question question = createQuestion("Who I am?", "");
        createQuestionAnswer("yes", question, "12345");
        createQuestionAnswer("no", question, "12346");
        this.tweetPoll = createPublishedTweetPoll(secondary.getAccount(), question);
        final HashTag hashTag2 = createHashTag("programmer",80L);
        this.tweetPoll.getHashTags().add(hashTag);
View Full Code Here

TOP

Related Classes of org.encuestame.persistence.domain.question.Question

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.