Example usage for org.apache.commons.collections ListUtils EMPTY_LIST

List of usage examples for org.apache.commons.collections ListUtils EMPTY_LIST

Introduction

In this page you can find the example usage for org.apache.commons.collections ListUtils EMPTY_LIST.

Prototype

List EMPTY_LIST

To view the source code for org.apache.commons.collections ListUtils EMPTY_LIST.

Click Source Link

Document

An empty unmodifiable list.

Usage

From source file:org.encuestame.mvc.controller.syndication.AbstractFeedController.java

/**
 * Get RSS item tweet poll.// w w  w .j  a  v  a 2s .  co  m
 * @param username
 * @param request
 * @return
 * @throws EnMeNoResultsFoundException
 * @throws UnsupportedEncodingException
 */
@SuppressWarnings("unchecked")
public List<Item> getItemRssFeed(final String username, final HttpServletRequest request,
        final TypeSearchResult itemType, final Integer limits)
        throws EnMeNoResultsFoundException, UnsupportedEncodingException {
    List<Item> item = new ArrayList<Item>();
    log.debug("getItemRssFeed username " + username);
    log.debug("getItemRssFeed itemType " + itemType);
    log.debug("getItemRssFeed limits " + limits);
    if (itemType.equals(TypeSearchResult.TWEETPOLL)) {
        item = FeedUtils.convertTweetPollBeanToItemRSS(getTweetPolls(username, request),
                InternetUtils.getDomain(request), velocityEngine);
    } else if (itemType.equals(TypeSearchResult.POLL)) {
        item = FeedUtils.convertPollBeanToItemRSS(getPolls(username), InternetUtils.getDomain(request),
                velocityEngine);
    } else if (itemType.equals(TypeSearchResult.SURVEY)) {
        item = ListUtils.EMPTY_LIST;
    } else if (itemType.equals(TypeSearchResult.PROFILE)) {
        item = FeedUtils.convertHomeBeanToItemRSS(
                getFrontService().getLastItemsPublishedFromUserAccount(username, limits, false, request),
                InternetUtils.getDomain(request), velocityEngine);
        //        } else if (itemType.equals("projects")) {
        //            item = ListUtils.EMPTY_LIST;
    } else if (itemType.equals(TypeSearchResult.ALL)) {
        try {
            item = FeedUtils.convertHomeBeanToItemRSS(
                    //FUTURE: migrate to SearchPeriods Enum
                    getFrontService().getFrontEndItems(SearchPeriods.ALLTIME.toString(),
                            EnMeUtils.DEFAULT_START, limits, true, request),
                    InternetUtils.getDomain(request), velocityEngine);
        } catch (EnMeSearchException e) {
            log.error("Error on retrieve RSS home items ", e);
            item = ListUtils.EMPTY_LIST;
        }
    }
    log.debug("getItemRssFeed item " + item.size());
    return item;
}

From source file:org.encuestame.mvc.controller.syndication.SyndicationController.java

/**
 * Display TweetPoll ATOM Feed.//from   w w  w.ja v  a2s  . com
 * @param username
 * @param model
 * @param request
 * @return
 * @throws UnsupportedEncodingException
 */
@RequestMapping(value = "/feed/{username}/tweetpoll.atom", method = RequestMethod.GET)
public String tweetPollAtom(@PathVariable String username, Model model, HttpServletRequest request)
        throws UnsupportedEncodingException {
    final UserAccount secUserSecondary = findByUsername(username);
    if (secUserSecondary != null) {
        try {
            model.addAttribute("items",
                    this.getEntryAtomFeed(username, request, TypeSearchResult.TWEETPOLL, rssDisplayItems));
        } catch (EnMeException e) {
            log.error(e);
            //e.printStackTrace();
            model.addAttribute("items", ListUtils.EMPTY_LIST);
        }
    }
    return "tweetPollAtomFeedView";
}

From source file:org.encuestame.mvc.controller.syndication.SyndicationController.java

/**
 *
 * @param model/*from www. j  a  v a2  s .  com*/
 * @param request
 * @return
 */
@RequestMapping(value = "/feed/tweetpoll.atom", method = RequestMethod.GET)
public String tweetPollAtom(Model model, HttpServletRequest request) {
    model.addAttribute("items", ListUtils.EMPTY_LIST); //TODO: without filter.
    return "tweetPollAtomFeedView";
}

From source file:org.encuestame.mvc.controller.syndication.SyndicationController.java

/**
 * Display TweetPoll RSS Feed.//from w w w. j av  a2  s.c o m
 * @param username username
 * @param model model
 * @param request request
 * @return
 */
@RequestMapping(value = "/feed/{username}/tweetpoll.rss", method = RequestMethod.GET)
public String tweetPollRss(@PathVariable String username, Model model, HttpServletRequest request) {
    final UserAccount secUserSecondary = findByUsername(username);
    if (secUserSecondary != null) {
        try {
            model.addAttribute("items",
                    this.getItemRssFeed(username, request, TypeSearchResult.TWEETPOLL, rssDisplayItems));
        } catch (Exception e) {
            log.error(e);
            //e.printStackTrace();
            model.addAttribute("items", ListUtils.EMPTY_LIST);
        }
    }
    return "tweetPollRssFeedView";
}

From source file:org.encuestame.mvc.controller.syndication.SyndicationController.java

/**
*
* @param model//from www  .  jav a  2 s.c  om
* @param request
* @return
*/
@RequestMapping(value = "/feed/tweetpoll.rss", method = RequestMethod.GET)
public String tweetPollRss(Model model, HttpServletRequest request) {
    model.addAttribute("items", ListUtils.EMPTY_LIST); //TODO: without filter.
    return "tweetPollRssFeedView";
}

From source file:org.encuestame.mvc.controller.syndication.SyndicationController.java

/**
 * Display profile RSS Feed.//  w  w w.ja v  a 2 s .  com
 * @param username
 * @param model
 * @param request
 * @return
 */
@RequestMapping(value = "/feed/{username}/profile.rss", method = RequestMethod.GET)
public String profileRss(@PathVariable String username, Model model, HttpServletRequest request) {
    final UserAccount secUserSecondary = findByUsername(username);
    if (secUserSecondary != null) {
        try {
            final List<Item> items = this.getItemRssFeed(username, request, TypeSearchResult.PROFILE,
                    rssDisplayItems);
            log.debug("/feed/{username}/profile.rss items size " + items.size());
            model.addAttribute("items", items);
        } catch (Exception e) {
            log.error(e);
            //e.printStackTrace();
            model.addAttribute("items", ListUtils.EMPTY_LIST);
        }
    }
    return "profileRssFeedView";
}

From source file:org.encuestame.mvc.controller.syndication.SyndicationController.java

/**
 * Display profile ATOM Feed.//from   www  .j av  a  2 s . c  o  m
 * @param username
 * @param model
 * @param request
 * @return
 * @throws UnsupportedEncodingException
 */
@RequestMapping(value = "/feed/{username}/profile.atom", method = RequestMethod.GET)
public String profileAtom(@PathVariable String username, Model model, HttpServletRequest request)
        throws UnsupportedEncodingException {
    final UserAccount secUserSecondary = findByUsername(username);
    if (secUserSecondary != null) {
        try {
            model.addAttribute("items",
                    this.getEntryAtomFeed(username, request, TypeSearchResult.PROFILE, rssDisplayItems));
            this.buildTweetPollFeedBody(username, model, request, secUserSecondary);
        } catch (EnMeException e) {
            log.error(e);
            //e.printStackTrace();
            model.addAttribute("items", ListUtils.EMPTY_LIST);
        }
    }
    return "profileAtomFeedView";
}

From source file:org.encuestame.mvc.controller.syndication.SyndicationController.java

/**
*
* @param model/*  www.j a v a2  s .  c  o  m*/
* @param request
* @return
*/
@RequestMapping(value = "/feed/survey.atom", method = RequestMethod.GET)
public String surveyAtom(Model model, HttpServletRequest request) {
    model.addAttribute("items", ListUtils.EMPTY_LIST); //TODO: without filter.
    return "surveyAtomFeedView";
}

From source file:org.encuestame.mvc.controller.syndication.SyndicationController.java

/**
 * Display survey RSS Feed.//from   w w  w.  j  av a2 s.  c  o m
 * @param username username
 * @param model model
 * @param request request
 * @return
 */
@RequestMapping(value = "/feed/{username}/survey.rss", method = RequestMethod.GET)
public String surveyRss(@PathVariable String username, Model model, HttpServletRequest request) {
    final UserAccount secUserSecondary = findByUsername(username);
    if (secUserSecondary != null) {
        try {
            model.addAttribute("items",
                    this.getItemRssFeed(username, request, TypeSearchResult.SURVEY, rssDisplayItems));
        } catch (Exception e) {
            log.error(e);
            //e.printStackTrace();
            model.addAttribute("items", ListUtils.EMPTY_LIST);
        }
    }
    return "surveyRssFeedView";
}

From source file:org.encuestame.mvc.controller.syndication.SyndicationController.java

/**
 *
 * @param model// ww  w .java  2  s .com
 * @param request
 * @return
 */
@RequestMapping(value = "/feed/survey.rss", method = RequestMethod.GET)
public String surveyRss(Model model, HttpServletRequest request) {
    model.addAttribute("items", ListUtils.EMPTY_LIST); //TODO: without filter.
    return "surveyRssFeedView";
}