本文整理了Java中org.apache.abdera.model.Feed.setTitle()
方法的一些代码示例,展示了Feed.setTitle()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Feed.setTitle()
方法的具体详情如下:
包路径:org.apache.abdera.model.Feed
类名称:Feed
方法名:setTitle
暂无
代码示例来源:origin: fcrepo3/fcrepo
private Feed createAtomObject(String spid, String contentLocation) throws Exception {
PID pid = PID.getInstance(spid);
Date date = new Date(1);
String title = "title";
String author = "org.fcrepo.test.api.TestManagedDatastreams";
Feed feed = abdera.newFeed();
feed.setId(pid.toURI());
feed.setTitle(title);
feed.setUpdated(date);
feed.addAuthor(author);
if (contentLocation != null && contentLocation.length() > 0) {
addAtomManagedDatastream(feed, contentLocation);
}
return feed;
}
代码示例来源:origin: org.apache.abdera/abdera-server
protected Feed createFeed() throws Exception {
Feed feed = abdera.newFeed();
feed.setId(config.getFeedUri());
feed.setTitle(config.getFeedTitle());
feed.setUpdated(new Date());
feed.addAuthor(config.getFeedAuthor());
return feed;
}
代码示例来源:origin: org.fuzzydb.atom/org.fuzzydb.abdera.util
private Document<Feed> init_feed_doc(Abdera abdera) {
Factory factory = abdera.getFactory();
Feed feed = factory.newFeed();
try {
feed.setId("tag:example.org,2006:feed");
feed.setTitle("Simple");
feed.setUpdated(new Date());
feed.addLink("");
feed.addLink("", "self");
feed.addAuthor("Simple");
} catch (Exception e) {
e.printStackTrace();
} // FIXME: Document this exception
return feed.getDocument();
}
代码示例来源:origin: rackerlabs/atom-hopper
@Override
public AdapterResponse<Feed> getFeed(GetFeedRequest getFeedRequest) {
final Feed feed = getFeedRequest.getAbdera().newFeed();
feed.setTitle("A Feed");
feed.addLink(getFeedRequest.urlFor(
new EnumKeyedTemplateParameters<URITemplate>(URITemplate.FEED))).setRel("self");
for (AtomEntry ae : liveFeed.values()) {
feed.addEntry(ae.getEntry());
}
return ResponseBuilder.found(feed);
}
代码示例来源:origin: org.xcmis/xcmis-restatom
/**
* {@inheritDoc}
*/
@Override
protected Feed createFeedBase(RequestContext request) throws ResponseContextException
{
Factory factory = request.getAbdera().getFactory();
Feed feed = factory.newFeed();
feed.setId(getId(request));
feed.setTitle(getTitle(request));
feed.addAuthor(getAuthor(request));
feed.setUpdated(AtomUtils.getAtomDate(Calendar.getInstance()));
// Service link.
feed.addLink(getServiceLink(request), AtomCMIS.LINK_SERVICE, AtomCMIS.MEDIATYPE_ATOM_SERVICE, null, null, -1);
Map<String, String> params = new HashMap<String, String>();
params.put("repoid", getRepositoryId(request));
params.put("atomdoctype", "types");
params.put("id", request.getTarget().getParameter("typeid"));
String self = request.absoluteUrlFor(TargetType.ENTRY, params);
feed.addLink(self, AtomCMIS.LINK_SELF, AtomCMIS.MEDIATYPE_ATOM_FEED, null, null, -1);
return feed;
}
代码示例来源:origin: org.apache.abdera/abdera-server
/**
* Create the base feed for the requested collection.
*/
protected Feed createFeedBase(RequestContext request) throws ResponseContextException {
Factory factory = request.getAbdera().getFactory();
Feed feed = factory.newFeed();
feed.setId(getId(request));
feed.setTitle(getTitle(request));
feed.addLink("");
feed.addLink("", "self");
feed.addAuthor(getAuthor(request));
feed.setUpdated(new Date());
return feed;
}
代码示例来源:origin: org.xcmis/xcmis-restatom
/**
* {@inheritDoc}
*/
@Override
protected Feed createFeedBase(RequestContext request) throws ResponseContextException
{
Factory factory = request.getAbdera().getFactory();
Feed feed = factory.newFeed();
feed.setId(getId(request));
feed.setTitle(getTitle(request));
feed.addAuthor(getAuthor(request));
feed.setUpdated(AtomUtils.getAtomDate(Calendar.getInstance()));
feed.addLink(getServiceLink(request), "service", "application/atomsvc+xml", null, null, -1);
return feed;
}
代码示例来源:origin: apache/cxf
private Feed doGetBookAsFeed(@Context UriInfo uParam) {
Factory factory = Abdera.getNewFactory();
Feed f = factory.newFeed();
f.setBaseUri(uParam.getAbsolutePath().toString());
f.setTitle("Collection of Books");
f.setId("http://www.books.com");
f.addAuthor("BookStore Management Company");
try {
for (Book b : books.values()) {
Entry e = AtomUtils.createBookEntry(factory, b);
f.addEntry(e);
}
} catch (Exception ex) {
// ignore
}
return f;
}
代码示例来源:origin: org.xcmis/xcmis-restatom
/**
* {@inheritDoc}
*/
@Override
protected Feed createFeedBase(RequestContext request) throws ResponseContextException
{
Factory factory = request.getAbdera().getFactory();
Feed feed = factory.newFeed();
feed.setId(getId(request));
feed.setTitle(getTitle(request));
feed.addAuthor(getAuthor(request));
feed.setUpdated(AtomUtils.getAtomDate(Calendar.getInstance()));
feed.addLink(getServiceLink(request), AtomCMIS.LINK_SERVICE, AtomCMIS.MEDIATYPE_ATOM_SERVICE, null, null, -1);
return feed;
}
}
代码示例来源:origin: org.kie.uberfire/kie-uberfire-social-activities-backend
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();
}
}
代码示例来源:origin: org.xcmis/xcmis-restatom
/**
* {@inheritDoc}
*/
@Override
protected Feed createFeedBase(RequestContext request) throws ResponseContextException
{
Factory factory = request.getAbdera().getFactory();
Feed feed = factory.newFeed();
feed.setId(getId(request));
feed.setTitle(getTitle(request));
feed.addAuthor(getAuthor(request));
// Updated is incorrect when pass Date.
// Abdera uses Calendar.getInstance(TimeZone.getTimeZone("GMT"))
// See org.apache.abdera.model.AtomDate .
feed.setUpdated(AtomUtils.getAtomDate(Calendar.getInstance()));
feed.addLink(getServiceLink(request), "service", "application/atomsvc+xml", null, null, -1);
return feed;
}
代码示例来源:origin: org.xcmis/xcmis-restatom
/**
* {@inheritDoc}
*/
@Override
protected Feed createFeedBase(RequestContext request) throws ResponseContextException
{
Factory factory = request.getAbdera().getFactory();
Feed feed = factory.newFeed();
feed.setId(getId(request));
feed.setTitle(getTitle(request));
feed.addAuthor(getAuthor(request));
// Updated is incorrect when pass Date.
// Abdera uses Calendar.getInstance(TimeZone.getTimeZone("GMT"))
// See org.apache.abdera.model.AtomDate .
feed.setUpdated(AtomUtils.getAtomDate(Calendar.getInstance()));
feed.addLink(getServiceLink(request), "service", "application/atomsvc+xml", null, null, -1);
return feed;
}
代码示例来源:origin: org.xcmis/xcmis-restatom
/**
* {@inheritDoc}
*/
@Override
protected Feed createFeedBase(RequestContext request) throws ResponseContextException
{
Factory factory = request.getAbdera().getFactory();
Feed feed = factory.newFeed();
feed.setId(getId(request));
feed.setTitle(getTitle(request));
feed.addAuthor(getAuthor(request));
// Updated is incorrect when pass Date.
// Abdera uses Calendar.getInstance(TimeZone.getTimeZone("GMT"))
// See org.apache.abdera.model.AtomDate .
feed.setUpdated(AtomUtils.getAtomDate(Calendar.getInstance()));
feed.addLink(getServiceLink(request), "service", "application/atomsvc+xml", null, null, -1);
return feed;
}
代码示例来源:origin: org.uberfire/uberfire-social-activities-backend
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();
}
}
代码示例来源:origin: kiegroup/appformer
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();
}
}
代码示例来源:origin: org.apache.abdera/abdera-filesystem
public ResponseContext getFeed(RequestContext request) {
Feed feed = abdera.newFeed();
feed.setId(config.getServerConfiguration().getServerUri() + "/" + config.getFeedId());
feed.setTitle(config.getFeedTitle());
feed.addAuthor(config.getFeedAuthor());
feed.addLink(config.getFeedUri());
feed.addLink(config.getFeedUri(), "self");
feed.setUpdated(new Date());
getEntries(request, feed, root);
return ProviderHelper.returnBase(feed.getDocument(), 200, null);
}
代码示例来源:origin: net.sf.taverna.t2.activities/interaction-activity
@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);
}
代码示例来源:origin: org.fcrepo/fcrepo-server
private void addObjectProperties(DigitalObject obj, Feed feed) throws ObjectIntegrityException {
String state = DOTranslationUtility.getStateAttribute(obj);
String ownerId = obj.getOwnerId();
String label = obj.getLabel();
Date cdate = obj.getCreateDate();
Date mdate = obj.getLastModDate();
feed.setId(PID.toURI(obj.getPid()));
feed.setTitle(label == null ? "" : label);
feed.setUpdated(mdate);
feed.addAuthor(ownerId == null ? "" : StreamUtility.enc(ownerId));
feed.addCategory(MODEL.STATE.uri, state, null);
if (cdate != null) {
feed.addCategory(MODEL.CREATED_DATE.uri, DateUtility
.convertDateToString(cdate), null);
}
// TODO not sure I'm satisfied with this representation of extProperties
for (String extProp : obj.getExtProperties().keySet()) {
feed.addCategory(MODEL.EXT_PROPERTY.uri, extProp, obj
.getExtProperty(extProp));
}
}
代码示例来源:origin: fcrepo3/fcrepo
private void addObjectProperties(DigitalObject obj, Feed feed) throws ObjectIntegrityException {
String state = DOTranslationUtility.getStateAttribute(obj);
String ownerId = obj.getOwnerId();
String label = obj.getLabel();
Date cdate = obj.getCreateDate();
Date mdate = obj.getLastModDate();
feed.setId(PID.toURI(obj.getPid()));
feed.setTitle(label == null ? "" : label);
feed.setUpdated(mdate);
feed.addAuthor(ownerId == null ? "" : StreamUtility.enc(ownerId));
feed.addCategory(MODEL.STATE.uri, state, null);
if (cdate != null) {
feed.addCategory(MODEL.CREATED_DATE.uri, DateUtility
.convertDateToString(cdate), null);
}
// TODO not sure I'm satisfied with this representation of extProperties
for (String extProp : obj.getExtProperties().keySet()) {
feed.addCategory(MODEL.EXT_PROPERTY.uri, extProp, obj
.getExtProperty(extProp));
}
}
代码示例来源:origin: org.xcmis/xcmis-restatom
/**
* {@inheritDoc}
*/
@Override
protected Feed createFeedBase(RequestContext request) throws ResponseContextException
{
Factory factory = request.getAbdera().getFactory();
Feed feed = factory.newFeed();
feed.setId(getId(request));
feed.setTitle(getTitle(request));
feed.addAuthor(getAuthor(request));
// Updated is incorrect when pass Date.
// Abdera uses Calendar.getInstance(TimeZone.getTimeZone("GMT"))
// See org.apache.abdera.model.AtomDate .
feed.setUpdated(AtomUtils.getAtomDate(Calendar.getInstance())); // TODO proper date
String service = getServiceLink(request);
feed.addLink(service, AtomCMIS.LINK_SERVICE, AtomCMIS.MEDIATYPE_ATOM_SERVICE, null, null, -1);
String self = getSelfLink(getId(request), request);
feed.addLink(self, AtomCMIS.LINK_SELF, AtomCMIS.MEDIATYPE_ATOM_FEED, null, null, -1);
String via = getObjectLink(getId(request), request);
feed.addLink(via, AtomCMIS.LINK_VIA, AtomCMIS.MEDIATYPE_ATOM_ENTRY, null, null, -1);
return feed;
}
内容来源于网络,如有侵权,请联系作者删除!