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


Java Feed.setId方法代码示例

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


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

示例1: getFeed

import org.apache.abdera.model.Feed; //导入方法依赖的package包/类
@Override
@CallCounted
@RolesAllowed(USER)
public Feed getFeed(UriInfo ui) {
	Feed feed = abdera.getFactory().newFeed();
	feed.setTitle("events relating to workflow runs").setLanguage(
			feedLanguage);
	String user = support.getPrincipal().toString()
			.replaceAll("[^A-Za-z0-9]+", "");
	feed.setId(format("urn:taverna-server:%s:%s", uuid, user));
	org.joda.time.DateTime modification = null;
	for (Event e : eventSource.getEvents(support.getPrincipal())) {
		if (modification == null || e.getPublished().isAfter(modification))
			modification = e.getPublished();
		feed.addEntry(e.getEntry(abdera, feedLanguage));
	}
	if (modification == null)
		feed.setUpdated(new Date());
	else
		feed.setUpdated(modification.toDate());
	feed.addLink(ui.getAbsolutePath().toASCIIString(), "self");
	return feed;
}
 
开发者ID:apache,项目名称:incubator-taverna-server,代码行数:24,代码来源:AtomFeed.java

示例2: 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

示例3: getGuestFeed

import org.apache.abdera.model.Feed; //导入方法依赖的package包/类
@GET
@Produces(MediaType.APPLICATION_ATOM_XML)
public Feed getGuestFeed(@Context UriInfo uriInfo) {
    Feed feed = abdera.newFeed();

    feed.setId("tag:koenighotze.org,2015:/guest");
    feed.setTitle("Guests");
    feed.setUpdated(new Date());

    final String baseUri = uriInfo.getBaseUri().toString();
    feed.addLink(baseUri + "feed", "self"); // todo self ref
    guestService.getAllGuests().stream().forEach(guest -> {
        Entry entry = feed.addEntry();
        entry.setId(guest.getId() + "");
        entry.setUpdated(from(guest.getLastUpdate().toInstant(UTC)));
        entry.setAttributeValue("Version", guest.getVersion() + "");
        entry.addLink(baseUri + "guests/" + guest.getPublicId());
    });

    return feed;
}
 
开发者ID:koenighotze,项目名称:Hotel-Reservation-Tool,代码行数:22,代码来源:GuestAtomFeed.java

示例4: 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

示例5: 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

示例6: 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.setId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。