Package org.encuestame.persistence.domain.survey

Examples of org.encuestame.persistence.domain.survey.Survey


                    .getDislikeVote();
            likeDislikeRate = (likeVotes - dislikeVotes);
            genericBean = ConvertDomainBean.createGenericStatsBean(likeDislikeRate, totalHits, createdBy, average, createdAt);
        } else if (itemType.equals(TypeSearchResult.SURVEY)) {
            id = new Long(Long.parseLong(itemId));
            final Survey survey = this.getSurvey(id);
            totalHits = survey.getHits();
            createdBy = survey.getEditorOwner().getUsername() == null ? " "
                    : survey.getEditorOwner().getUsername();
            createdAt = convertRelativeTimeToString(survey.getCreateDate(), request);
            likeVotes = survey.getLikeVote();
            dislikeVotes = survey.getDislikeVote();
            likeDislikeRate = (likeVotes - dislikeVotes);
            genericBean = ConvertDomainBean.createGenericStatsBean(likeDislikeRate, totalHits, createdBy, average, createdAt);
        } else if (itemType.equals(TypeSearchResult.HASHTAG)) {
            final HashTag tag = getHashTagItem(itemId);
            totalHits = tag.getHits();
View Full Code Here


           final Date startDate,
           final SurveyFormat surveyFormat,
           final String name,
           final Date createdAt
           ){
       final Survey survey = new Survey();
       survey.setName(name);
       survey.setComplete(complete);
       survey.setDateInterview(dateInterview);
       survey.setEndDate(endDate);
       survey.setOwner(secUsers);
       survey.setStartDate(startDate);
       survey.setTicket(3);
       survey.setCreateDate(createdAt);
       survey.setRelevance(1L);
       getSurveyDaoImp().saveOrUpdate(survey);
       return survey;
   }
View Full Code Here

        getPollDao().saveOrUpdate(poll3);


        // Surveys

        final Survey survey = createDefaultSurvey(getSpringSecurityLoggedUserAccount()
                .getAccount());
        survey.getHashTags().add(tag);
        survey.setCreateDate(new Date());
        getSurveyDaoImp().saveOrUpdate(survey);
        final Survey survey2 = createDefaultSurvey(getSpringSecurityLoggedUserAccount()
                .getAccount());
        survey2.getHashTags().add(tag);
        survey2.setCreateDate(new Date());
        getSurveyDaoImp().saveOrUpdate(survey2);

        final Survey survey3 = createDefaultSurvey(getSpringSecurityLoggedUserAccount()
                .getAccount());
        survey3.getHashTags().add(tag);
        survey3.setCreateDate(myDate.getTime());
        getSurveyDaoImp().saveOrUpdate(survey3);

        myDate.add(Calendar.MONTH, +6);
        final Survey survey4 = createDefaultSurvey(getSpringSecurityLoggedUserAccount()
                    .getAccount());
        survey4.getHashTags().add(tag);
        survey4.setCreateDate(myDate.getTime());
        getSurveyDaoImp().saveOrUpdate(survey4);

        final List<HashTagDetailStats> stats = getStatisticsService()
                .getTotalUsagebyHashTagAndDateRange(tag.getHashTag(), SearchPeriods.ONEYEAR, this.request);
        Assert.assertEquals("Should be equals", 4, stats.size());
View Full Code Here

     * @return
     * @throws EnMeNoResultsFoundException
     */
    public Survey addSurveyToFolder(final Long folderId, final Long userId, final Long surveyId) throws EnMeNoResultsFoundException{
        final SurveyFolder sfolder = getSurveyDaoImp().getSurveyFolderById(folderId);
        final Survey survey = getSurveyDaoImp().getSurveyByIdandUserId(surveyId, userId);
        survey.setSurveysfolder(sfolder);
        getSurveyDaoImp().saveOrUpdate(survey);
        return survey;
    }
View Full Code Here

                Boolean.TRUE, Boolean.TRUE);
        poll2.getHashTags().add(hashtag1);
        getPollDao().saveOrUpdate(poll2);

        // Survey
        final Survey mySurvey = createDefaultSurvey(account, "Survey test",
                myDate);
        mySurvey.getHashTags().add(hashtag1);
        getSurveyDaoImp().saveOrUpdate(mySurvey);
      //FIXME: methods not longer exist
        // Total usage TweetPoll, Poll and Survey by tagId
//        final Long totalUsage = getStatisticsService().getTotalUsageByHashTag(
//               hashtag1.getHashTag(), 0, 10, TypeSearchResult.HASHTAG);
View Full Code Here

         poll4.setCreateDate(createdAt.toDate());
         getPollDao().saveOrUpdate(poll4);


         createdAt = this.creationDate.minusMonths(6);
         final Survey survey5 = createDefaultSurvey(
                getSpringSecurityLoggedUserAccount().getAccount(),
                "survey name", createdAt.toDate());
        survey5.getHashTags().add(mytag);
        getSurveyDaoImp().saveOrUpdate(survey5);


        final List<HashTagDetailStats> stats = getStatisticsService()
                .getTotalUsagebyHashtagAndDateRangeGraph(mytag.getHashTag(), SearchPeriods.ONEYEAR, this.request);
View Full Code Here

        final FolderBean fbean = surveyService.createSurveyFolder(
                "My First Folder", this.myUsername);
        Assert.assertNotNull(fbean);
        final SurveyBean mySurveyBean = createSurveyBean("My Second survey",
                this.myUsername, this.mySurveyDate.getTime());
        final Survey mySurvey = surveyService.createSurvey(mySurveyBean, this.request);
        surveyService.addSurveyToFolder(fbean.getId(), this.myUsername,
                mySurvey.getSid());
        final List<Survey> listSurvey = surveyService.retrieveSurveyByFolder(
                getSpringSecurityLoggedUserAccount().getAccount().getUid(),
                fbean.getId());
        assertEquals("should be equals", 1, listSurvey.size());
    }
View Full Code Here

   
    @Test
    public void testCreateSurvey() throws EnMeExpcetion{
      // Create survey with section default
      final SurveyBean surveyBean = createSurveyBean("default survey", getSpringSecurityLoggedUserAccount().toString(), new Date());
      final Survey newSurvey = surveyService.createSurvey(surveyBean, this.request);  
     
      // Create new Section
      final UnitSurveySection unitSection = createSurveySection("default 2", "default 2", newSurvey);
      surveyService.createSurveySection(unitSection, newSurvey);
      
View Full Code Here

     * Test get {@link Survey} by id.
     * @throws EnMeNoResultsFoundException
     */
    @Test
    public void testGetSurveybyId() throws EnMeNoResultsFoundException{
      final Survey mySurvey = createDefaultSurvey(this.user);
      final Survey surveyById = surveyService.getSurveyById(mySurvey.getSid());
      assertEquals("should be equals", mySurvey.getSid(), surveyById.getSid());
    }
View Full Code Here

     */
  @Test
  public void testAddQuestionToSurveySection() throws EnMeExpcetion,
      NoSuchAlgorithmException, UnsupportedEncodingException {
    final String questionName = "What is your favorite superhero?";
    final Survey defaultSurvey = createDefaultSurvey(this.user);
    final SurveySection defaultSection = createDefaultSection("Comics",
        defaultSurvey);

    final Question questionAdded = surveyService
        .addQuestionToSurveySection(questionName, userSecondary,
View Full Code Here

TOP

Related Classes of org.encuestame.persistence.domain.survey.Survey

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.