本文整理汇总了Java中com.rometools.rome.feed.atom.Feed.setTitle方法的典型用法代码示例。如果您正苦于以下问题:Java Feed.setTitle方法的具体用法?Java Feed.setTitle怎么用?Java Feed.setTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.rometools.rome.feed.atom.Feed
的用法示例。
在下文中一共展示了Feed.setTitle方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildFeedMetadata
import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) {
feed.setId("https://github.com/mploed/event-driven-spring-boot/customer");
feed.setTitle("Customer");
List<Link> alternateLinks = new ArrayList<>();
Link link = new Link();
link.setRel("self");
link.setHref(baseUrl(request) + "feed");
alternateLinks.add(link);
List<SyndPerson> authors = new ArrayList<SyndPerson>();
Person person = new Person();
person.setName("Big Pug Bank");
authors.add(person);
feed.setAuthors(authors);
feed.setAlternateLinks(alternateLinks);
feed.setUpdated(customerRepository.lastUpdate());
Content subtitle = new Content();
subtitle.setValue("List of all customers");
feed.setSubtitle(subtitle);
}
示例2: buildFeedMetadata
import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) {
feed.setId("tag:ewolff.com/microservice-atom/order");
feed.setTitle("Order");
List<Link> alternateLinks = new ArrayList<>();
Link link = new Link();
link.setRel("self");
link.setHref(baseUrl(request) + "feed");
alternateLinks.add(link);
List<SyndPerson> authors = new ArrayList<SyndPerson>();
Person person = new Person();
person.setName("Big Money Online Commerce Inc.");
authors.add(person);
feed.setAuthors(authors);
feed.setAlternateLinks(alternateLinks);
feed.setUpdated(orderRepository.lastUpdate());
Content subtitle = new Content();
subtitle.setValue("List of all orders");
feed.setSubtitle(subtitle);
}
示例3: buildFeedMetadata
import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) {
ZUser user = userService.getCurrentUser();
ZUserConfig userConfig = user.getUserConfig();
Locale locale;
if (userConfig != null) {
locale = userConfig.getLocale();
} else {
locale = Locale.getDefault();
}
super.buildFeedMetadata(model, feed, request);
OPDSMetadata metadata = (OPDSMetadata) model.get(OPDS_METADATA);
Res title = metadata.getTitle();
feed.setTitle(res.get(locale, title.getKey(), title.getObjs()));
feed.setId(metadata.getId());
feed.setUpdated(metadata.getUpdated());
feed.setIcon("favicon.ico");
feed.setEncoding("utf-8");
//noinspection unchecked
feed.setOtherLinks(metadata.getOtherLinks());
}
示例4: buildFeedMetadata
import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed,
HttpServletRequest request) {
feed.setTitle("User Feeds News");
feed.setId("tag:hrmsUserTypes");
feed.setUpdated(new Date());
}
示例5: write
import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
@Test
public void write() throws IOException, SAXException {
Feed feed = new Feed("atom_1.0");
feed.setTitle("title");
Entry entry1 = new Entry();
entry1.setId("id1");
entry1.setTitle("title1");
Entry entry2 = new Entry();
entry2.setId("id2");
entry2.setTitle("title2");
List<Entry> entries = new ArrayList<Entry>(2);
entries.add(entry1);
entries.add(entry2);
feed.setEntries(entries);
MockHttpOutputMessage outputMessage = new MockHttpOutputMessage();
converter.write(feed, null, outputMessage);
assertEquals("Invalid content-type", new MediaType("application", "atom+xml", utf8),
outputMessage.getHeaders().getContentType());
String expected = "<feed xmlns=\"http://www.w3.org/2005/Atom\">" + "<title>title</title>" +
"<entry><id>id1</id><title>title1</title></entry>" +
"<entry><id>id2</id><title>title2</title></entry></feed>";
assertXMLEqual(expected, outputMessage.getBodyAsString(utf8));
}
示例6: writeOtherCharset
import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
@Test
public void writeOtherCharset() throws IOException, SAXException {
Feed feed = new Feed("atom_1.0");
feed.setTitle("title");
String encoding = "ISO-8859-1";
feed.setEncoding(encoding);
MockHttpOutputMessage outputMessage = new MockHttpOutputMessage();
converter.write(feed, null, outputMessage);
assertEquals("Invalid content-type", new MediaType("application", "atom+xml", Charset.forName(encoding)),
outputMessage.getHeaders().getContentType());
}
示例7: buildFeedMetadata
import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
protected void buildFeedMetadata(Map model, Feed feed, HttpServletRequest request) {
feed.setId("" + model.get("feed_id"));
feed.setTitle("" + model.get("feed_title"));
Content subTitle = new Content();
subTitle.setValue("" + model.get("feed_description"));
feed.setSubtitle(subTitle);
}
示例8: testGenerator
import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
/**
* Generator-Test (Simplified INSPIRE Service Feed)
* @throws com.rometools.rome.io.FeedException
* @throws java.io.IOException
*/
public void testGenerator() throws FeedException, IOException {
// Atom Container-Element
Feed atomFeed = new Feed();
atomFeed.setEncoding("utf-8");
atomFeed.setTitle("Digitales Geländemodell 200m Bayern - INSPIRE Atom Example");
atomFeed.setUpdated(new Date());
// Atom Entry-Element
Entry atomEntry = new Entry();
atomEntry.setTitle("Digitales Geländemodell 200m Bayern - INSPIRE Atom Example");
atomEntry.setUpdated(new Date());
// GeoRSS-Extension (Bounding-Box)
GeoRSSModule geoRssModule = new SimpleModuleImpl();
geoRssModule.setGeometry(new Envelope(47.2279397510939845, 8.8934968721451053, 50.5798028875686470, 13.9247471058637764));
// INSPIRE_DLS-Extension
InspireDlsModule inspireDlsModule = new InspireDlsModuleImpl();
SpatialDatasetIdentifier identifier = new SpatialDatasetIdentifier();
identifier.setCode("DEBY_1d4ab890-27e7-3ebb-95ba-2d2ab8071871");
identifier.setNamespace("http://www.geodaten.bayern.de");
inspireDlsModule.setSpatialDatasetIdentifier(identifier);
List<Module> modules = new ArrayList<Module>();
modules.add(geoRssModule);
modules.add(inspireDlsModule);
atomEntry.setModules(modules);
atomFeed.setEntries(Arrays.asList(atomEntry));
// build JDOM-Document
Document atomXml = new Atom10Generator().generate(atomFeed);
// print JDOM-Document to System.out
XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
outputter.output(atomXml, System.out);
}
示例9: buildFeedMetadata
import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) {
String feedPath = (String) model.get("feed-path");
feed.setTitle((String) model.get("feed-title"));
feed.setId(String.format("http://spring.io%s", feedPath));
feed.setIcon(siteUrl.getAbsoluteUrl("/favicon.ico"));
setFeedUrl(feedPath, feed);
setBlogUrl((String) model.get("blog-path"), feed);
setUpdatedDate(model, feed);
super.buildFeedMetadata(model, feed, request);
}
示例10: buildFeedMetadata
import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
@Override
protected void buildFeedMetadata(Map model, Feed feed, HttpServletRequest request) {
feed.setTitle("Test Feed");
}
示例11: buildFeedMetadata
import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) {
feed.setId("tag:springsource.org");
feed.setTitle("Veterinarians");
//feed.setUpdated(date);
}
示例12: buildFeedMetadata
import com.rometools.rome.feed.atom.Feed; //导入方法依赖的package包/类
@Override
protected void buildFeedMetadata(Map<String, Object> model, Feed feed, HttpServletRequest request) {
feed.setId("tag:springsource.org");
feed.setTitle("Veterinarians");
feed.setUpdated(new Date());
}