Package org.encuestame.utils.enums

Examples of org.encuestame.utils.enums.CommentOptions


      HttpServletResponse response) {
    try {
      final TypeSearchResult type = TypeSearchResult
          .getTypeSearchResult(filterValue(typeSearch));

      final CommentOptions statusComm = CommentOptions
          .getCommentOption(filterValue(status));

      final SearchPeriods searchPeriod = SearchPeriods
          .getPeriodString(filterValue(period));
View Full Code Here


    /**
     * Test Comments option enum.
     */
    @Test
    public void testCommentsOptionEnum(){
        final CommentOptions optApprove = CommentOptions.getCommentOption("APPROVE");
        assertEquals("Should be equals", "APPROVE", optApprove.toString());
        final CommentOptions optRestrict = CommentOptions.getCommentOption("RESTRICT");
        assertEquals("Should be equals", "RESTRICT", optRestrict.toString());
        final CommentOptions optModerate = CommentOptions.getCommentOption("MODERATE");
        assertEquals("Should be equals", "MODERATE", optModerate.toString());
    }
View Full Code Here

            } else if (createPollBean.getAnswers().length  == 0 ) {
                  throw new EnMeNoResultsFoundException("answers are required to create Poll");
            }
            else{
            final String hashPoll = MD5Utils.md5(RandomStringUtils.randomAlphanumeric(500));
            final CommentOptions commentOpt = CommentOptions.getCommentOption(createPollBean.getShowComments());
            final ShowResultsOptions showResultsOptions = ShowResultsOptions.getShowResults(createPollBean.getShowComments());
            pollDomain.setEditorOwner(user);
            pollDomain.setCreateDate(Calendar.getInstance().getTime());
            pollDomain.setPollHash(hashPoll);
            pollDomain.setQuestion(question);
View Full Code Here

     * @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

     * @return
     */
    public static final List<CommentOptions> convertToCommentsOptions(
            final List<String> options) {
        final List<CommentOptions> comments = new ArrayList<CommentOptions>();
        CommentOptions commentRestriction;
        for (String restrictOption : options) {
            commentRestriction = CommentOptions.getCommentOption(restrictOption);
            if(commentRestriction !=null){
                comments.add(commentRestriction);
            }
View Full Code Here

TOP

Related Classes of org.encuestame.utils.enums.CommentOptions

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.