Search in sources :

Example 21 with SecureActionForum

use of it.vige.rubia.auth.SecureActionForum in project rubia-forums by flashboss.

the class ViewMyForumsBase method getTopicsLastPosts.

/**
 * @return a map of the last posts and respective topics
 */
@SecureActionForum
@Interceptors(AuthorizationListener.class)
public Map<Object, Object> getTopicsLastPosts() {
    if (topicsLastPosts == null) {
        try {
            Collection<Topic> watched = getWatchedTopics();
            if (watched != null) {
                Set<Topic> temporaryContainer = new HashSet<Topic>(watched.size());
                Iterator<Topic> it = watched.iterator();
                while (it.hasNext()) {
                    Topic topic = it.next();
                    temporaryContainer.add(topic);
                }
                topicsLastPosts = getMyForumsModule().findLastPostsOfTopics(temporaryContainer);
            }
        } catch (Exception e) {
            handleException(e);
        }
    }
    return topicsLastPosts;
}
Also used : Topic(it.vige.rubia.model.Topic) JSFUtil.handleException(it.vige.rubia.ui.JSFUtil.handleException) HashSet(java.util.HashSet) Interceptors(javax.interceptor.Interceptors) SecureActionForum(it.vige.rubia.auth.SecureActionForum)

Aggregations

SecureActionForum (it.vige.rubia.auth.SecureActionForum)21 Interceptors (javax.interceptor.Interceptors)21 JSFUtil.handleException (it.vige.rubia.ui.JSFUtil.handleException)17 Topic (it.vige.rubia.model.Topic)13 ModuleException (it.vige.rubia.ModuleException)9 Post (it.vige.rubia.model.Post)6 Forum (it.vige.rubia.model.Forum)5 PollOption (it.vige.rubia.model.PollOption)4 ViewTopic (it.vige.rubia.ui.view.ViewTopic)4 Poll (it.vige.rubia.model.Poll)3 Poster (it.vige.rubia.model.Poster)3 Date (java.util.Date)3 PortalUtil.createMessage (it.vige.rubia.PortalUtil.createMessage)2 PortalUtil.createPoll (it.vige.rubia.PortalUtil.createPoll)2 PortalUtil.createPollOption (it.vige.rubia.PortalUtil.createPollOption)2 Message (it.vige.rubia.model.Message)2 JSFUtil.getPoster (it.vige.rubia.ui.JSFUtil.getPoster)2 ArrayList (java.util.ArrayList)2 LinkedList (java.util.LinkedList)2 PortalUtil.getPoster (it.vige.rubia.PortalUtil.getPoster)1