本文整理汇总了Java中com.rometools.rome.feed.synd.SyndEntryImpl类的典型用法代码示例。如果您正苦于以下问题:Java SyndEntryImpl类的具体用法?Java SyndEntryImpl怎么用?Java SyndEntryImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SyndEntryImpl类属于com.rometools.rome.feed.synd包,在下文中一共展示了SyndEntryImpl类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createSyndEntry
import com.rometools.rome.feed.synd.SyndEntryImpl; //导入依赖的package包/类
protected SyndEntry createSyndEntry(final Item item, final boolean preserveWireItem) {
final SyndEntryImpl syndEntry = new SyndEntryImpl();
if (preserveWireItem) {
syndEntry.setWireEntry(item);
}
syndEntry.setModules(ModuleUtils.cloneModules(item.getModules()));
final List<Element> foreignMarkup = item.getForeignMarkup();
if (!foreignMarkup.isEmpty()) {
syndEntry.setForeignMarkup(foreignMarkup);
}
syndEntry.setUri(item.getUri());
syndEntry.setLink(item.getLink());
syndEntry.setTitle(item.getTitle());
syndEntry.setLink(item.getLink());
syndEntry.setSource(createSource(item.getSource()));
return syndEntry;
}
开发者ID:rometools,项目名称:rome,代码行数:23,代码来源:ConverterForRSS090.java
示例2: asRss
import com.rometools.rome.feed.synd.SyndEntryImpl; //导入依赖的package包/类
public SyndEntry asRss() {
SyndEntry entry = new SyndEntryImpl();
entry.setUri(getGuid());
entry.setTitle(getTitle());
entry.setAuthor(getAuthor());
SyndContentImpl content = new SyndContentImpl();
content.setValue(getContent());
entry.setContents(Arrays.<SyndContent> asList(content));
if (getEnclosureUrl() != null) {
SyndEnclosureImpl enclosure = new SyndEnclosureImpl();
enclosure.setType(getEnclosureType());
enclosure.setUrl(getEnclosureUrl());
entry.setEnclosures(Arrays.<SyndEnclosure> asList(enclosure));
}
entry.setLink(getUrl());
entry.setPublishedDate(getDate());
return entry;
}
开发者ID:Athou,项目名称:commafeed,代码行数:23,代码来源:Entry.java
示例3: setUp
import com.rometools.rome.feed.synd.SyndEntryImpl; //导入依赖的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: writeRevisionsFeed
import com.rometools.rome.feed.synd.SyndEntryImpl; //导入依赖的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
示例5: writeCheckoutsFeed
import com.rometools.rome.feed.synd.SyndEntryImpl; //导入依赖的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
示例6: testGenerate
import com.rometools.rome.feed.synd.SyndEntryImpl; //导入依赖的package包/类
public void testGenerate() throws IOException, FeedException {
final SyndFeed feed = getSyndFeed("thr/threading-main.xml");
List<SyndEntry> entries = feed.getEntries();
// create a new "root" entry that the next entry will reference to
SyndEntry newRootEntry = new SyndEntryImpl();
newRootEntry.setTitle("New, 2nd root entry");
newRootEntry.setUri("tag:example.org,2005:2");
newRootEntry.setLink("http://www.example.org/entries/2");
entries.add(newRootEntry);
// create a new reply entry that will reference the new root entry
SyndEntry newReplyEntry = new SyndEntryImpl();
newReplyEntry.setTitle("New test reply entry");
newReplyEntry.setUri("tag:example.org,2005:2,1");
ThreadingModule threadingModule = new ThreadingModuleImpl();
threadingModule.setRef("tag:example.org,2005:2");
threadingModule.setType("application/xhtml+xml");
threadingModule.setHref("http://www.example.org/entries/2");
threadingModule.setSource("http://example.org/entries/2");
newReplyEntry.getModules().add(threadingModule);
entries.add(newReplyEntry);
File outputFile = new File("target/threading-testGenerate.xml");
final SyndFeedOutput output = new SyndFeedOutput();
output.output(feed, outputFile);
// read back in and validate
final SyndFeed generatedFeed = getSyndFeed(outputFile);
SyndEntry generatedReplyEntry = generatedFeed.getEntries().get(3);
assertNotNull(generatedReplyEntry);
ThreadingModule generatedReplyThreadingModule = (ThreadingModule) generatedReplyEntry.getModule(ThreadingModule.URI);
assertEquals("tag:example.org,2005:2", generatedReplyThreadingModule.getRef());
assertEquals("application/xhtml+xml", generatedReplyThreadingModule.getType());
assertEquals("http://www.example.org/entries/2", generatedReplyThreadingModule.getHref());
assertEquals("http://example.org/entries/2", generatedReplyThreadingModule.getSource());
}
开发者ID:rometools,项目名称:rome,代码行数:40,代码来源:ThreadingModuleTest.java
示例7: testCopiedFeedEntryCategories
import com.rometools.rome.feed.synd.SyndEntryImpl; //导入依赖的package包/类
public void testCopiedFeedEntryCategories() throws Exception {
for (final SyndEntry entry : getCachedSyndFeed().getEntries()) {
final SyndEntry copiedEntry = new SyndEntryImpl();
copiedEntry.copyFrom(entry);
checkEntryCategories(copiedEntry.getCategories());
}
}
开发者ID:rometools,项目名称:rome,代码行数:8,代码来源:Issue131Test.java
示例8: checkSyndEntry
import com.rometools.rome.feed.synd.SyndEntryImpl; //导入依赖的package包/类
private void checkSyndEntry(SyndEntryImpl syndEntry, OPDSEntryI entry) {
assertEquals("Entry Title", syndEntry.getTitle(), entry.getTitle().getObjs()[0]);
assertEquals("Entry Id", syndEntry.getUri(), entry.getId());
}
开发者ID:patexoid,项目名称:ZombieLib2,代码行数:5,代码来源:ExtLibTest.java
注:本文中的com.rometools.rome.feed.synd.SyndEntryImpl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论