FeedTeasersFeedPreferenceValueTemplate.java :  » JBoss » jboss-seam-2.2.0 » org » jboss » seam » wiki » plugin » feed » Java Open Source

Java Open Source » JBoss » jboss seam 2.2.0 
jboss seam 2.2.0 » org » jboss » seam » wiki » plugin » feed » FeedTeasersFeedPreferenceValueTemplate.java
/*
 * JBoss, Home of Professional Open Source
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.seam.wiki.plugin.feed;

import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.wiki.core.feeds.FeedDAO;
import org.jboss.seam.wiki.core.model.Feed;
import org.jboss.seam.wiki.preferences.PreferenceValueTemplate;

import java.io.Serializable;
import java.util.List;

/**
 * @author Christian Bauer
 */
@Name("feedTeasersFeedPreferenceValueTemplate")
@Scope(ScopeType.CONVERSATION)
public class FeedTeasersFeedPreferenceValueTemplate implements PreferenceValueTemplate, Serializable {

    @In
    FeedDAO feedDAO;

    List<String> feedIdentifiers;

    public List<String> getTemplateValues() {
        if (feedIdentifiers == null) {
            List<Feed> feeds = feedDAO.findAllFeeds();
            for (Feed feed : feeds) {
                feedIdentifiers.add(feed.getId().toString());
            }
        }
        return feedIdentifiers;
    }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.