当前位置: 首页>>代码示例>>Java>>正文


Java Feed.addAuthor方法代码示例

本文整理汇总了Java中org.apache.abdera.model.Feed.addAuthor方法的典型用法代码示例。如果您正苦于以下问题:Java Feed.addAuthor方法的具体用法?Java Feed.addAuthor怎么用?Java Feed.addAuthor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.abdera.model.Feed的用法示例。


在下文中一共展示了Feed.addAuthor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generate

import org.apache.abdera.model.Feed; //导入方法依赖的package包/类
public static String generate(List<SocialActivitiesEvent> eventTimeline,
                              String type) {
    Abdera abdera = new Abdera();
    Feed feed = abdera.newFeed();

    feed.setId("tag:org.uberfire,2014:/" + type);
    feed.setTitle("Social Activities Feed");
    feed.setUpdated(new Date());
    feed.addAuthor("Red Hat JBoss");

    for (SocialActivitiesEvent event : eventTimeline) {
        Entry entry = feed.addEntry();
        entry.setTitle(event.getType());
        entry.setSummary(event.getSocialUser().getUserName() + "  " + event.toString());
        entry.setUpdated(event.getTimestamp());
        entry.setPublished(event.getTimestamp());
    }
    return feed.toString();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:AtomSocialTimelineConverter.java

示例2: createFeed

import org.apache.abdera.model.Feed; //导入方法依赖的package包/类
protected Feed createFeed() {
  String feedTitle = config.getFeedTitle();
  String feedAuthor = config.getFeedAuthor();
  
  Feed feed = abdera.newFeed();
  feed.setId(config.getFeedUri());
  feed.setTitle(feedTitle == null ? "feed" : feedTitle);
  feed.setUpdated(new Date());
  feed.addAuthor(feedAuthor == null ? getServerName() : feedAuthor);

  return feed;
}
 
开发者ID:jyang,项目名称:google-feedserver,代码行数:13,代码来源:AbstractManagedCollectionAdapter.java

示例3: getFeed

import org.apache.abdera.model.Feed; //导入方法依赖的package包/类
@Override
public ResponseContext getFeed(final RequestContext request) {
	final Feed feed = this.abdera.newFeed();
	feed.setId(this.config.getServerConfiguration().getServerUri() + "/"
			+ this.config.getFeedId());
	feed.setTitle(this.config.getFeedTitle());
	feed.addAuthor(this.config.getFeedAuthor());
	feed.addLink(this.config.getFeedUri());
	feed.addLink(this.config.getFeedUri(), "self");
	feed.setUpdated(new Date());
	this.getEntries(request, feed, this.root);
	return ProviderHelper.returnBase(feed.getDocument(), 200, null);
}
 
开发者ID:apache,项目名称:incubator-taverna-common-activities,代码行数:14,代码来源:HackedFilesystemAdapter.java

示例4: getAllCommentRssFeeds

import org.apache.abdera.model.Feed; //导入方法依赖的package包/类
@GET
@Produces(MediaType.APPLICATION_ATOM_XML)
@Path("comments")
public Feed getAllCommentRssFeeds(@Context UriInfo uriInfo) {

    Calendar cal = Calendar.getInstance();
    Date date = new Date();
    cal.setTime(date);

    Configuration conf = HibernateConfig.INSTANCE.getConnection(context);

    ServiceRegistryBuilder srb = new ServiceRegistryBuilder().applySettings(conf.getProperties());
    SessionFactory sf = conf.buildSessionFactory(srb.buildServiceRegistry());
    Session session = sf.openSession();

    Transaction tx = session.beginTransaction();

    @SuppressWarnings("unchecked")
    List<CommentaryEntity> queryResults = session.getNamedQuery("getAllCommentsOrderedByCreatedDesc").list();

    tx.commit();
    session.close();

    Feed feed = AbderaSupport.getAbdera().getFactory().newFeed();

    feed.setId("tag:localhost:8080," + cal.get(Calendar.YEAR) + ":/govdata/comments");
    feed.setTitle("GovData Kommentare zu Metadatenbeschreibungen");
    feed.setUpdated(date);
    feed.addAuthor("GovData.de");
    URI feedLink = uriInfo.getRequestUri();
    feed.addLink(feedLink.toString(), "self");

    int i = 1;
    for (CommentaryEntity comment : queryResults) {
        Entry entry = feed.addEntry();
        entry.setId("tag:localhost:8080," + cal.get(Calendar.YEAR) + ":/govdata/comments/entries" + i);
        entry.setTitle("Kommentar zu http://localhost:8080/web/guest/daten/-/details/" + comment.getMetadataname());
        entry.setPublished(comment.getCreated());
        entry.setUpdated(comment.getCreated());
        entry.addAuthor(comment.getLiferayScreenName());
        entry.addLink(feedLink.toString(), "self");

        StringBuilder sb = new StringBuilder();
        sb.append("<div>");
        sb.append("<p>").append(comment.getText()).append("</p>");
        sb.append("<p>").append("Dieser Kommentar wurde erstellt von: " + comment.getLiferayScreenName()).append("</p>");
        sb.append("</div>");

        sb.append("<div>");
        sb.append("<a href=\"http://localhost:8080/web/guest/daten/-/details/" + comment.getMetadataname()
                + "\">http://localhost:8080/web/guest/daten/-/details/" + comment.getMetadataname() + "</a>");
        sb.append("</div>");

        entry.setContentAsHtml(sb.toString());

        i++;
    }

    return feed;
}
 
开发者ID:fraunhoferfokus,项目名称:odp-rss-servlet,代码行数:61,代码来源:RSSService.java


注:本文中的org.apache.abdera.model.Feed.addAuthor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。