本文整理汇总了Java中com.rometools.rome.feed.synd.SyndFeedImpl类的典型用法代码示例。如果您正苦于以下问题:Java SyndFeedImpl类的具体用法?Java SyndFeedImpl怎么用?Java SyndFeedImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SyndFeedImpl类属于com.rometools.rome.feed.synd包,在下文中一共展示了SyndFeedImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testCreate
import com.rometools.rome.feed.synd.SyndFeedImpl; //导入依赖的package包/类
public void testCreate() throws Exception {
final SyndFeed feed = new SyndFeedImpl();
final String feedType = "rss_2.0";
feed.setFeedType(feedType);
feed.setLanguage("en-us");
feed.setTitle("sales.com on the Radio!");
feed.setDescription("sales.com radio shows in MP3 format");
feed.setLink("http://foo/rss/podcasts.rss");
final FeedInformation fi = new FeedInformationImpl();
fi.setOwnerName("sales.com");
fi.getCategories().add(new Category("Shopping"));
fi.setOwnerEmailAddress("[email protected]");
fi.setType("serial");
feed.getModules().add(fi);
final SyndFeedOutput output = new SyndFeedOutput();
final StringWriter writer = new StringWriter();
output.output(feed, writer);
LOG.debug("{}", writer);
}
开发者ID:rometools,项目名称:rome,代码行数:24,代码来源:ITunesGeneratorTest.java
示例2: testCreate
import com.rometools.rome.feed.synd.SyndFeedImpl; //导入依赖的package包/类
public void testCreate() throws Exception {
final SyndFeed feed = new SyndFeedImpl();
final String feedType = "rss_2.0";
feed.setFeedType(feedType);
feed.setLanguage("en-us");
feed.setTitle("sales.com on the Radio!");
feed.setDescription("sales.com radio shows in MP3 format");
feed.setLink("http://foo/rss/podcasts.rss");
final FeedInformation fi = new FeedInformationImpl();
fi.setOwnerName("sales.com");
fi.getCategories().add(new Category("Shopping"));
fi.setOwnerEmailAddress("[email protected]");
feed.getModules().add(fi);
final SyndFeedOutput output = new SyndFeedOutput();
final StringWriter writer = new StringWriter();
output.output(feed, writer);
LOG.debug("{}", writer);
}
开发者ID:rometools,项目名称:rome-modules,代码行数:23,代码来源:ITunesGeneratorTest.java
示例3: setUp
import com.rometools.rome.feed.synd.SyndFeedImpl; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
url = "http://" + rsg.generate(10);
uri = rsg.generate(10);
opdsPath = rsg.generate(10);
extLibrary = new ExtLibrary();
extLibrary.setUrl(url);
extLibrary.setOpdsPath(opdsPath);
bookService = mock(BookService.class);
connectionService = mock(ExtLibConnection.class);
extLib = createExtLib(extLibrary);
syndFeed = new SyndFeedImpl();
syndFeed.setTitle(rsg.generate(10));
syndEntry = new SyndEntryImpl();
syndEntry.setUri(rsg.generate(10));
syndEntry.setTitle(rsg.generate(10));
syndLink = new SyndLinkImpl();
syndLink.setType("profile=opds-catalog");
syndLink.setHref(rsg.generate(10));
syndLink.setRel(rsg.generate(10));
syndEntry.setLinks(Collections.singletonList(syndLink));
syndContent = new SyndContentImpl();
syndContent.setType(rsg.generate(10));
syndContent.setValue(rsg.generate(10));
syndContent.setMode("xml");
syndEntry.setContents(Collections.singletonList(syndContent));
syndFeed.setEntries(Collections.singletonList(syndEntry));
when(connectionService.getData(eq(uri), any())).thenReturn(syndFeed);
}
开发者ID:patexoid,项目名称:ZombieLib2,代码行数:37,代码来源:ExtLibTest.java
示例4: verifyFeedSerialization
import com.rometools.rome.feed.synd.SyndFeedImpl; //导入依赖的package包/类
@Test
public void verifyFeedSerialization() throws IOException, ClassNotFoundException, CloneNotSupportedException, FeedException {
SyndFeed feed1 = new SyndFeedImpl();
feed1.setFeedType("atom_1.0");
feed1.setUri("foobar");
String s = FeedCacheUtils.feedToString(feed1);
SyndFeed feed2 = FeedCacheUtils.feedFromString(s);
assertThat(feed2, IsEqual.equalTo(feed1));
}
开发者ID:motech,项目名称:modules,代码行数:10,代码来源:FeedCacheUtilsTest.java
示例5: writeRevisionsFeed
import com.rometools.rome.feed.synd.SyndFeedImpl; //导入依赖的package包/类
private void writeRevisionsFeed(HttpServletRequest request, HttpServletResponse response, ServiceMap serviceMap) throws IOException, FeedException, ServiceException, PublicInterfaceNotFoundException {
long poid = Long.parseLong(request.getParameter("poid"));
SProject sProject = serviceMap.getServiceInterface().getProjectByPoid(poid);
SyndFeed feed = new SyndFeedImpl();
feed.setFeedType(FEED_TYPE);
feed.setTitle("BIMserver.org revisions feed for project '" + sProject.getName() + "'");
feed.setLink(request.getContextPath());
feed.setDescription("This feed represents all the revisions of project '" + sProject.getName() + "'");
List<SyndEntry> entries = new ArrayList<SyndEntry>();
try {
List<SRevision> allRevisionsOfProject = serviceMap.getServiceInterface().getAllRevisionsOfProject(poid);
Collections.sort(allRevisionsOfProject, new SRevisionIdComparator(false));
for (SRevision sVirtualRevision : allRevisionsOfProject) {
SUser user = serviceMap.getServiceInterface().getUserByUoid(sVirtualRevision.getUserId());
SyndEntry entry = new SyndEntryImpl();
entry.setTitle("Revision " + sVirtualRevision.getOid());
entry.setLink(request.getContextPath() + "/revision.jsp?poid=" + sVirtualRevision.getOid() + "&roid=" + sVirtualRevision.getOid());
entry.setPublishedDate(sVirtualRevision.getDate());
SyndContent description = new SyndContentImpl();
description.setType("text/html");
description.setValue("<table><tr><td>User</td><td>" + user.getUsername() + "</td></tr><tr><td>Comment</td><td>" + sVirtualRevision.getComment()
+ "</td></tr></table>");
entry.setDescription(description);
entries.add(entry);
}
} catch (ServiceException e) {
LOGGER.error("", e);
}
feed.setEntries(entries);
SyndFeedOutput output = new SyndFeedOutput();
output.output(feed, response.getWriter());
}
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:36,代码来源:SyndicationServlet.java
示例6: writeCheckoutsFeed
import com.rometools.rome.feed.synd.SyndFeedImpl; //导入依赖的package包/类
private void writeCheckoutsFeed(HttpServletRequest request, HttpServletResponse response, ServiceMap serviceMap) throws ServiceException, IOException, FeedException, PublicInterfaceNotFoundException {
long poid = Long.parseLong(request.getParameter("poid"));
SProject sProject = serviceMap.getServiceInterface().getProjectByPoid(poid);
SyndFeed feed = new SyndFeedImpl();
feed.setFeedType(FEED_TYPE);
feed.setTitle("BIMserver.org checkouts feed for project '" + sProject.getName() + "'");
feed.setLink(request.getContextPath());
feed.setDescription("This feed represents all the checkouts of project '" + sProject.getName() + "'");
List<SyndEntry> entries = new ArrayList<SyndEntry>();
try {
List<SCheckout> allCheckoutsOfProject = serviceMap.getServiceInterface().getAllCheckoutsOfProjectAndSubProjects(poid);
for (SCheckout sCheckout : allCheckoutsOfProject) {
SRevision revision = serviceMap.getServiceInterface().getRevision(sCheckout.getRevision().getOid());
SProject project = serviceMap.getServiceInterface().getProjectByPoid(sCheckout.getProjectId());
SUser user = serviceMap.getServiceInterface().getUserByUoid(sCheckout.getUserId());
SyndEntry entry = new SyndEntryImpl();
entry.setTitle("Checkout on " + project.getName() + ", revision " + revision.getId());
entry.setLink(request.getContextPath() + "/project.jsp?poid=" + sProject.getOid());
entry.setPublishedDate(sCheckout.getDate());
SyndContent description = new SyndContentImpl();
description.setType("text/plain");
description
.setValue("<table><tr><td>User</td><td>" + user.getUsername() + "</td></tr><tr><td>Revision</td><td>" + sCheckout.getRevision().getOid() + "</td></tr></table>");
entry.setDescription(description);
entries.add(entry);
}
} catch (UserException e) {
LOGGER.error("", e);
}
feed.setEntries(entries);
SyndFeedOutput output = new SyndFeedOutput();
output.output(feed, response.getWriter());
}
开发者ID:opensourceBIM,项目名称:BIMserver,代码行数:37,代码来源:SyndicationServlet.java
示例7: testWireFeedSyndFeedConversion
import com.rometools.rome.feed.synd.SyndFeedImpl; //导入依赖的package包/类
public void testWireFeedSyndFeedConversion() throws Exception {
final SyndFeed sFeed1 = this.getCachedSyndFeed();
final WireFeed wFeed1 = sFeed1.createWireFeed();
final SyndFeed sFeed2 = new SyndFeedImpl(wFeed1);
assertTrue(sFeed1.equals(sFeed2));
}
开发者ID:rometools,项目名称:rome,代码行数:8,代码来源:FeedOpsTest.java
示例8: testWireFeedSyndFeedConversion
import com.rometools.rome.feed.synd.SyndFeedImpl; //导入依赖的package包/类
@Override
public void testWireFeedSyndFeedConversion() throws Exception {
final SyndFeed sFeed1 = getCachedSyndFeed();
final WireFeed wFeed1 = sFeed1.createWireFeed();
final SyndFeed sFeed2 = new SyndFeedImpl(wFeed1);
PrintWriter w = new PrintWriter(new FileOutputStream("target/test-reports/1"));
w.println(sFeed1.toString());
w.close();
w = new PrintWriter(new FileOutputStream("target/test-reports/2"));
w.println(sFeed2.toString());
w.close();
assertEquals(sFeed1, sFeed2);
}
开发者ID:rometools,项目名称:rome,代码行数:15,代码来源:TestOpsOPML10.java
示例9: testWireFeedSyndFeedConversion
import com.rometools.rome.feed.synd.SyndFeedImpl; //导入依赖的package包/类
public void testWireFeedSyndFeedConversion() throws Exception {
final SyndFeed sFeed1 = getCachedSyndFeed();
final WireFeed wFeed1 = sFeed1.createWireFeed();
final SyndFeed sFeed2 = new SyndFeedImpl(wFeed1);
assertEquals(sFeed1, sFeed2);
}
开发者ID:rometools,项目名称:rome,代码行数:8,代码来源:FeedOpsTest.java
示例10: testWireFeedSyndFeedConversion
import com.rometools.rome.feed.synd.SyndFeedImpl; //导入依赖的package包/类
@Override
public void testWireFeedSyndFeedConversion() throws Exception {
final SyndFeed sFeed1 = getCachedSyndFeed();
final WireFeed wFeed1 = sFeed1.createWireFeed();
final SyndFeed sFeed2 = new SyndFeedImpl(wFeed1);
PrintWriter w = new PrintWriter(new FileOutputStream("target/test-reports/1"));
w.println(sFeed1.toString());
w.close();
w = new PrintWriter(new FileOutputStream("target/test-reports/2"));
w.println(sFeed2.toString());
w.close();
assertEquals(sFeed2.createWireFeed(), sFeed1.createWireFeed());
}
开发者ID:rometools,项目名称:rome,代码行数:15,代码来源:TestOpsOPML10links.java
示例11: testTemp
import com.rometools.rome.feed.synd.SyndFeedImpl; //导入依赖的package包/类
public void testTemp() throws Exception {
final WireFeedInput input = new WireFeedInput();
final WireFeed wf = input.build(TestUtil.loadFile("/opml_1.0_links.xml"));
final WireFeedOutput output = new WireFeedOutput();
final SyndFeedImpl sf = new SyndFeedImpl(wf);
sf.setFeedType("rss_2.0");
sf.setDescription("");
sf.setLink("http://foo.com");
sf.setFeedType("opml_1.0");
output.output(sf.createWireFeed(), new NullWriter());
}
开发者ID:rometools,项目名称:rome,代码行数:13,代码来源:TestOpsOPML10links.java
示例12: testWireFeedSyndFeedConversion
import com.rometools.rome.feed.synd.SyndFeedImpl; //导入依赖的package包/类
@Override
public void testWireFeedSyndFeedConversion() throws Exception {
final SyndFeed sFeed1 = getCachedSyndFeed();
final WireFeed wFeed1 = sFeed1.createWireFeed();
final SyndFeed sFeed2 = new SyndFeedImpl(wFeed1);
PrintWriter w = new PrintWriter(new FileOutputStream("target/test-reports/3"));
w.println(sFeed1.toString());
w.close();
w = new PrintWriter(new FileOutputStream("target/test-reports/4"));
w.println(sFeed2.toString());
w.close();
assertEquals(sFeed1, sFeed2);
}
开发者ID:rometools,项目名称:rome,代码行数:14,代码来源:TestOpsOPML20.java
示例13: testCopiedFeedCategories
import com.rometools.rome.feed.synd.SyndFeedImpl; //导入依赖的package包/类
public void testCopiedFeedCategories() throws Exception {
final SyndFeed copiedFeed = new SyndFeedImpl();
copiedFeed.copyFrom(getCachedSyndFeed());
checkFeed(copiedFeed);
}
开发者ID:rometools,项目名称:rome,代码行数:6,代码来源:Issue131Test.java
示例14: main
import com.rometools.rome.feed.synd.SyndFeedImpl; //导入依赖的package包/类
public static void main(final String[] args) {
boolean ok = false;
if (args.length >= 2) {
try {
final String outputType = args[0];
final SyndFeed feed = new SyndFeedImpl();
feed.setFeedType(outputType);
feed.setTitle("Aggregated Feed");
feed.setDescription("Anonymous Aggregated Feed");
feed.setAuthor("anonymous");
feed.setLink("http://www.anonymous.com");
final List<SyndEntry> entries = new ArrayList<SyndEntry>();
feed.setEntries(entries);
final FeedFetcherCache feedInfoCache = HashMapFeedInfoCache.getInstance();
final FeedFetcher feedFetcher = new HttpURLFeedFetcher(feedInfoCache);
for (int i = 1; i < args.length; i++) {
final URL inputUrl = new URL(args[i]);
final SyndFeed inFeed = feedFetcher.retrieveFeed(inputUrl);
entries.addAll(inFeed.getEntries());
}
final SyndFeedOutput output = new SyndFeedOutput();
output.output(feed, new PrintWriter(System.out));
ok = true;
} catch (final Exception ex) {
System.out.println("ERROR: " + ex.getMessage());
ex.printStackTrace();
}
}
if (!ok) {
System.out.println();
System.out.println("FeedAggregator aggregates different feeds into a single one.");
System.out.println("The first parameter must be the feed type for the aggregated feed.");
System.out.println(" [valid values are: rss_0.9, rss_0.91, rss_0.92, rss_0.93, ]");
System.out.println(" [ rss_0.94, rss_1.0, rss_2.0 & atom_0.3 ]");
System.out.println("The second to last parameters are the URLs of feeds to aggregate.");
System.out.println();
}
}
开发者ID:rometools,项目名称:rome,代码行数:53,代码来源:FeedAggregator.java
示例15: build
import com.rometools.rome.feed.synd.SyndFeedImpl; //导入依赖的package包/类
/**
* Builds SyndFeedImpl from a file.
* <p>
*
* @param file file to read to create the SyndFeedImpl.
* @return the SyndFeedImpl read from the file.
* @throws FileNotFoundException thrown if the file could not be found.
* @throws IOException thrown if there is problem reading the file.
* @throws IllegalArgumentException thrown if feed type could not be understood by any of the
* underlying parsers.
* @throws FeedException if the feed could not be parsed
*
*/
public SyndFeed build(final File file) throws FileNotFoundException, IOException, IllegalArgumentException, FeedException {
return new SyndFeedImpl(feedInput.build(file), preserveWireFeed);
}
开发者ID:rometools,项目名称:rome,代码行数:17,代码来源:SyndFeedInput.java
注:本文中的com.rometools.rome.feed.synd.SyndFeedImpl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论