Package org.encuestame.persistence.domain

Examples of org.encuestame.persistence.domain.Schedule


            HttpServletRequest request, HttpServletResponse response,
            final UserAccount user)
            throws JsonGenerationException, JsonMappingException, IOException {
        try {
          final TweetPollSavedPublishedStatus tweetPoll = getTweetPollService().getTweetPollSavedPublishedStatusById(id);
            final Schedule schedule = this.getTweetPollService().createTweetPollPublishedStatusScheduled(
                bean.getScheduledDate(),
                TypeSearchResult.getTypeSearchResult(type),
                tweetPoll);
            final Map<String, Object> jsonResponse = new HashMap<String, Object>();
            jsonResponse.put("schedulded_item", ConvertDomainBean.convertScheduletoBean(schedule));
View Full Code Here


            getTweetPollDao().saveOrUpdate(tp);
        }
        final String tweetText = generateTweetPollContent(tp);
        for (SocialAccountBean socialBean : bean.getSocialAccounts()) {
            final SocialAccount soc = getAccountDao().getSocialAccountById(socialBean.getAccountId());
            final Schedule schedule = new Schedule();
            schedule.setScheduleDate(tp.getScheduleDate());
            schedule.setTpoll(tp);
            schedule.setTypeSearch(searchResult);
            schedule.setTweetText(tweetText);
            schedule.setSocialAccount(soc);
            schedule.setStatus(Status.FAILED);
            schedule.setPublishAttempts(0);
            schedule.setTpollSavedPublished(null);
            getTweetPollDao().saveOrUpdate(schedule);
            list.add(schedule);
        }
        return list;
    }
View Full Code Here

    public Schedule createTweetPollPublishedStatusScheduled(
            final Date scheduleDate,
            final TypeSearchResult typeSearch,
            final TweetPollSavedPublishedStatus tpollSaved) {
        final SocialAccount socialAccount = tpollSaved.getSocialAccount();
        final Schedule schedule = new Schedule();
        schedule.setScheduleDate(scheduleDate);
        if (typeSearch.equals(TypeSearchResult.TWEETPOLL)) {
            schedule.setTpoll(tpollSaved.getTweetPoll());
            schedule.setTypeSearch(TypeSearchResult.TWEETPOLL);
        } else if(typeSearch.equals(TypeSearchResult.POLL)) {
            schedule.setPoll(tpollSaved.getPoll());
            schedule.setTypeSearch(TypeSearchResult.POLL);
        } else if(typeSearch.equals(TypeSearchResult.SURVEY)) {
            schedule.setSurvey(tpollSaved.getSurvey());
            schedule.setTypeSearch(TypeSearchResult.SURVEY);
        }
        schedule.setTweetText(tpollSaved.getTweetContent());
        schedule.setSocialAccount(socialAccount);
        schedule.setStatus(Status.FAILED);
        schedule.setPublishAttempts(0);
        schedule.setTpollSavedPublished(tpollSaved);
        getTweetPollDao().saveOrUpdate(schedule);
        return schedule;
    }
View Full Code Here

    public Schedule createScheduledItem(final TweetPoll tpoll,
            final Survey survey, final Poll poll, final Date scheduleDate,
            final SocialAccount socialAccount, final Status status,
            final Integer attempts,
            final TweetPollSavedPublishedStatus tpollSaved, final String tweetText, final TypeSearchResult typeSearch) {
        final Schedule schedule = new Schedule();
        schedule.setPublishAttempts(attempts);
        schedule.setPoll(poll);
        schedule.setScheduleDate(scheduleDate);
        schedule.setSocialAccount(socialAccount);
        schedule.setStatus(status);
        schedule.setSurvey(survey);
        schedule.setTpoll(tpoll);
        schedule.setTpollSavedPublished(tpollSaved);
        schedule.setTweetText(tweetText);
        schedule.setTypeSearch(typeSearch);
        getScheduleDao().saveOrUpdate(schedule);
        return schedule;
    }
View Full Code Here

    // SocialAccount
    final SocialAccount socialAcc = createDefaultSettedSocialAccount(this.userAccount);

    // Scheduled 1
    final Schedule schedule1 = createTweetpollScheduleDefault(tweetPoll1,
        this.initDate.minusDays(2).toDate(), socialAcc, Status.ACTIVE,
        TypeSearchResult.TWEETPOLL, this.tweetText);

    // Scheduled 2
    final Schedule schedule2 = createTweetpollScheduleDefault(tweetPoll2,
        this.initDate.minusDays(2).toDate(), socialAcc, Status.ACTIVE,
        TypeSearchResult.TWEETPOLL, this.tweetText);

    // Scheduled 3
    final Schedule schedule3 = createTweetpollScheduleDefault(tweetPoll1,
        this.initDate.plus(2).toDate(), socialAcc, Status.ACTIVE,
        TypeSearchResult.TWEETPOLL, this.tweetText);

    final Date minDate = getScheduleDao().retrieveMinimumScheduledDate(
        Status.ACTIVE);
View Full Code Here

TOP

Related Classes of org.encuestame.persistence.domain.Schedule

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.