Examples of TweetPoll


Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll

     * @param username
     * @throws EnMeNoResultsFoundException
     */
    public void changeStatusTweetPoll(final Long tweetPollId, final String username)
           throws EnMeNoResultsFoundException, EnmeFailOperation{
        final TweetPoll tweetPoll = getTweetPoll(tweetPollId, username);
        if (tweetPoll != null) {
            tweetPoll.setCloseNotification(Boolean.TRUE);
            getTweetPollDao().saveOrUpdate(tweetPoll);
        } else {
               throw new EnmeFailOperation("Fail Change Status Operation");
        }
    }
View Full Code Here

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll

     * @throws EnMeNoResultsFoundException
     * @throws EnmeFailOperation
     */
    public void setFavouriteTweetPoll(final Long tweetPollId, final String username) throws
           EnMeNoResultsFoundException, EnmeFailOperation{
        final TweetPoll tweetPoll = getTweetPoll(tweetPollId, username);
        if (tweetPoll != null) {
            tweetPoll.setFavourites(tweetPoll.getFavourites() == null ? false : !tweetPoll.getFavourites());
            getTweetPollDao().saveOrUpdate(tweetPoll);
        } else {
               throw new EnmeFailOperation("Fail Change Status Operation");
        }
    }
View Full Code Here

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll

     * @param username
     * @throws EnMeNoResultsFoundException
     */
    public void changeAllowLiveResultsTweetPoll(final Long tweetPollId, final String username)
                throws EnMeNoResultsFoundException, EnmeFailOperation{
        final TweetPoll tweetPoll = getTweetPollDao().getTweetPollByIdandUserId(tweetPollId, getUserAccountId(username));
        if (tweetPoll != null){
            tweetPoll.setAllowLiveResults(tweetPoll.getAllowLiveResults() == null
                      ? false : !tweetPoll.getAllowLiveResults());
            getTweetPollDao().saveOrUpdate(tweetPoll);
        }
        else {
            throw new EnmeFailOperation("Fail Change Allow Live Results Operation");
        }
View Full Code Here

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll

     * @param username
     * @throws EnMeNoResultsFoundException
     */
    public void changeAllowCaptchaTweetPoll(final Long tweetPollId, final String username)
           throws EnMeNoResultsFoundException, EnmeFailOperation{
        final TweetPoll tweetPoll = getTweetPoll(tweetPollId, username);
        if (tweetPoll != null) {
             tweetPoll.setCaptcha(tweetPoll.getCaptcha() == null ? false : !tweetPoll.getCaptcha());
             getTweetPollDao().saveOrUpdate(tweetPoll);
        } else {
            throw new EnmeFailOperation("Fail Change Allow Captcha Operation");
        }
    }
View Full Code Here

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll

     * @param username
     * @throws EnMeNoResultsFoundException
     */
    public void changeResumeLiveResultsTweetPoll(final Long tweetPollId, final String username)
           throws EnMeNoResultsFoundException, EnmeFailOperation {
        final TweetPoll tweetPoll = getTweetPoll(tweetPollId, username);
        if (tweetPoll != null) {
            tweetPoll.setResumeLiveResults(tweetPoll.getResumeLiveResults() == null
                      ? false : !tweetPoll.getResumeLiveResults());
            getTweetPollDao().saveOrUpdate(tweetPoll);
        }
        else {
            throw new EnmeFailOperation("Fail Change Resume Live Results Operation");
        }
View Full Code Here

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll

    * (non-Javadoc)
    * @see org.encuestame.core.service.imp.ITweetPollService#changeAllowRepeatedTweetPoll(java.lang.Long, java.lang.String)
    */
    public void changeAllowRepeatedTweetPoll(final Long tweetPollId, final String username)
                throws EnMeNoResultsFoundException, EnmeFailOperation{
        final TweetPoll tweetPoll = this.getTweetPoll(tweetPollId, username);
        if (tweetPoll != null){
            tweetPoll.setAllowRepatedVotes(tweetPoll.getAllowRepatedVotes() == null ? false : !tweetPoll.getAllowRepatedVotes());
            getTweetPollDao().saveOrUpdate(tweetPoll);
        } else {
            throw new EnmeFailOperation("Fail Change Allow Repeated Operation");
        }
    }
View Full Code Here

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll

     * (non-Javadoc)
     * @see org.encuestame.core.service.imp.ITweetPollService#chaneCommentStatusTweetPoll(java.lang.Long, java.lang.String)
     */
    public void chaneCommentStatusTweetPoll(final Long tweetPollId, final String username)
            throws EnMeNoResultsFoundException, EnmeFailOperation{
    final TweetPoll tweetPoll = this.getTweetPoll(tweetPollId, username);
    final CommentOptions commentOption = tweetPoll.getShowComments();
    if (commentOption == null) {
        tweetPoll.setShowComments(CommentOptions.MODERATE);
    } else if (commentOption.equals(CommentOptions.MODERATE)) {
        tweetPoll.setShowComments(CommentOptions.PUBLISHED);
    } else if (commentOption.equals(CommentOptions.PUBLISHED)) {
        tweetPoll.setShowComments(CommentOptions.MODERATE);
    }
    getTweetPollDao().saveOrUpdate(tweetPoll);
}
View Full Code Here

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll

     * @throws EnMeNoResultsFoundException
     * @throws EnmeFailOperation
     */
    public void changeCloseNotificationTweetPoll(final Long tweetPollId, final String username)
           throws EnMeNoResultsFoundException, EnmeFailOperation{
        final TweetPoll tweetPoll = this.getTweetPoll(tweetPollId, username);
        if (tweetPoll != null){
            tweetPoll.setCloseNotification(tweetPoll.getCloseNotification() == null
                      ? false : !tweetPoll.getCloseNotification());
            getTweetPollDao().saveOrUpdate(tweetPoll);
        } else {
            throw new EnmeFailOperation("Fail Change Allow Repeated Operation");
        }
    }
View Full Code Here

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll

    public TweetPollDetailBean getTweetPollDetailInfo(final Long tpollId)
            throws EnMeNoResultsFoundException {
        final TweetPollDetailBean tpollDetail = new TweetPollDetailBean();

        final TweetPoll tpoll = getTweetPollById(tpollId);
        tpollDetail.setTpollBean(ConvertDomainBean
                .convertTweetPollToBean(tpoll));
        tpollDetail.setResults(this.getResultsByTweetPollId(tpoll
                .getTweetPollId()));
        tpollDetail.setListAnswers(ConvertDomainBean
                .convertAnswersToQuestionAnswerBean(getQuestionDao()
                        .getAnswersByQuestionId(tpoll.getQuestion().getQid())));
        return tpollDetail;
    }
View Full Code Here

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll

     * @throws EnMeExpcetion
     */
    @Test
    public void testRegisterAccessRateVotedLike() throws EnMeNoResultsFoundException, EnMeExpcetion{
         final Question question = createQuestion("Who are you?", "");
         final TweetPoll tp = createPublishedTweetPoll(getSpringSecurityLoggedUserAccount().getAccount(), question);
         final String ipAddress = "192.168.1.81";
         flushIndexes();
         // I like it vote.
         final AccessRate rate = getFrontEndService().registerAccessRate(
                 TypeSearchResult.TWEETPOLL,
                 tp.getTweetPollId(),
                 ipAddress,
                 Boolean.TRUE);
         Assert.assertNotNull(rate);

         // I like it vote again.
         String ipAddress2 = "192.168.1.82";
         final AccessRate rate2 = getFrontEndService().registerAccessRate(
                 TypeSearchResult.TWEETPOLL,
                 tp.getTweetPollId(),
                 ipAddress2,
                 Boolean.TRUE);
         Assert.assertNotNull(rate2);

         // I don't like it vote.
         final AccessRate rate3 = getFrontEndService().registerAccessRate(
                 TypeSearchResult.TWEETPOLL,
                 tp.getTweetPollId(),
                 ipAddress,
                 Boolean.FALSE);
         Assert.assertNotNull(rate3);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.