本文整理汇总了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;
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}