rome/Opml/index.html

285 lines
14 KiB
HTML
Raw Normal View History

2016-04-24 20:54:49 +02:00
<!DOCTYPE html>
<!--
| Generated by Apache Maven Doxia at 2016-04-24
| Rendered using Apache Maven Fluido Skin 1.3.0
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="author" content="kwebble" />
<meta name="Date-Creation-yyyymmdd" content="20110923" />
<meta name="Date-Revision-yyyymmdd" content="20160424" />
<meta http-equiv="Content-Language" content="en" />
<title>ROME - Home</title>
<link rel="stylesheet" href="../css/apache-maven-fluido-1.3.0.min.css" />
<link rel="stylesheet" href="../css/site.css" />
<link rel="stylesheet" href="../css/print.css" media="print" />
<script type="text/javascript" src="../js/apache-maven-fluido-1.3.0.min.js"></script>
</head>
<body class="topBarDisabled">
<a href="http://github.com/rometools/rome">
<img style="position: absolute; top: 0; right: 0; border: 0; z-index: 10000;"
src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"
alt="Fork me on GitHub">
</a>
<div class="container-fluid">
<div id="banner">
<div class="pull-left">
<a href="../index.html" id="bannerLeft">
<img src="../images/romelogo.png" alt="ROME"/>
</a>
</div>
<div class="pull-right"> </div>
<div class="clear"><hr/></div>
</div>
<div id="breadcrumbs">
<ul class="breadcrumb">
<li id="publishDate" class="pull-right">Last Published: 2016-04-24</li> <li class="divider pull-right">|</li>
<li id="projectVersion" class="pull-right">Version: 1.7.0-SNAPSHOT</li>
</ul>
</div>
<div class="row-fluid">
<div id="leftColumn" class="span3">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">Rome</li>
<li>
<a href="../index.html" title="Overview">
<i class="none"></i>
Overview</a>
</li>
<li>
<a href="../HowRomeWorks/index.html" title="How Rome Works">
<i class="icon-chevron-right"></i>
How Rome Works</a>
</li>
<li>
<a href="../RssAndAtOMUtilitiEsROMEV0.5AndAboveTutorialsAndArticles/index.html" title="Tutorials And Articles">
<i class="none"></i>
Tutorials And Articles</a>
</li>
<li>
<a href="../ROMEReleases/index.html" title="Releases">
<i class="icon-chevron-right"></i>
Releases</a>
</li>
<li>
<a href="../ROMEDevelopmentProposals/index.html" title="ROME Development Proposals">
<i class="none"></i>
ROME Development Proposals</a>
</li>
<li>
<a href="../Modules/index.html" title="Modules">
<i class="icon-chevron-right"></i>
Modules</a>
</li>
<li>
<a href="../Fetcher/index.html" title="Fetcher">
<i class="icon-chevron-right"></i>
Fetcher</a>
</li>
<li class="active">
<a href="#"><i class="none"></i>OPML</a>
</li>
<li>
<a href="../Propono/index.html" title="Propono">
<i class="none"></i>
Propono</a>
</li>
<li>
<a href="../Certiorem/index.html" title="Certiorem">
<i class="icon-chevron-right"></i>
Certiorem</a>
</li>
<li class="nav-header">Project Documentation</li>
<li>
<a href="../project-info.html" title="Project Information">
<i class="icon-chevron-right"></i>
Project Information</a>
</li>
</ul>
<hr class="divider" />
<div id="poweredBy">
<div class="clear"></div>
<div class="clear"></div>
<div class="clear"></div>
<a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
<img class="builtBy" alt="Built by Maven" src="../images/logos/maven-feather.png" />
</a>
</div>
</div>
</div>
<div id="bodyColumn" class="span9" >
<div class="section">
<h2>ROME OPML<a name="ROME_OPML"></a></h2>
<p>This project provides support for <a class="externalLink" href="http://www.opml.org/">OPML</a> in ROME.</p>
<div class="section">
<h3>Downloads<a name="Downloads"></a></h3>
<ul>
<li><a href="./apidocs/index.html">JavaDocs</a></li></ul></div>
<div class="section">
<h3>Sample Usage<a name="Sample_Usage"></a></h3>
<p>To use this parser, simply include the jar file in your classpath as you are using ROME. Be sure it exists at the same level as ROME, such that, if ROME is in the common classpath of an application server, don't include this jar in your webapps WEB-INF/lib.</p>
<div class="source">
<pre>WireFeedInput input = new WireFeedInput();
Opml feed = (Opml) input.build( new File(&quot;myOpml.xml&quot;) );
List&lt;Outline&gt; outlines = (List&lt;Outline&gt;) feed.getOutlines();</pre></div></div>
<div class="section">
<h3>Hierarchy vs Flat<a name="Hierarchy_vs_Flat"></a></h3>
<p>Since OPML is a hierarchical format, some magic is required to preserve this information when they feed is moved to a Synd* structure. This is accomplished by adding categories indicating the tree structure to the <a class="externalLink" href="http://wiki.java.net/bin/edit/Javawsxml/SyndEntries?topicparent=Javawsxml.OPML;nowysiwyg=0">SyndEntries</a> ...</p>
<p>For example:</p>
<div class="source">
<pre>&lt;opml version=&quot;1.0&quot;&gt;
&lt;head&gt;
&lt;title&gt;Top Ten Sources for podcasting&lt;/title&gt;
&lt;ownerName&gt;Newsilike Media Group&lt;/ownerName&gt;
&lt;ownerEmail&gt;opml@TopTenSources.com&lt;/ownerEmail&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;outline type=&quot;link&quot; text=&quot;TopTenSources: podcasting&quot;
url=&quot;http://podcasting.TopTenSources.com/TopTenSources/&quot; /&gt;
&lt;outline text=&quot;CBS Technology News Podcast - Larry Magid' Tech Report&quot;&gt;
&lt;outline type=&quot;link&quot; text=&quot;Larry Magid's Tech Report&quot; url=&quot;http://www.cbsnews.com&quot; /&gt;
&lt;/outline&gt;
&lt;outline text=&quot;Adam Curry: Daily Source Code&quot;&gt;
&lt;outline type=&quot;link&quot; text=&quot;#374 Daily Source Code for Tuesday April 25th 2006&quot;
url=&quot;http://radio.weblogs.com/0001014/2006/04/26.html#a7304&quot; /&gt;
&lt;outline type=&quot;link&quot; text=&quot;#373 Daily Source Code for Monday April 24th 2006&quot;
url=&quot;http://radio.weblogs.com/0001014/2006/04/24.html#a7303&quot; /&gt;
&lt;outline type=&quot;link&quot; text=&quot;#372 Daily Source Code for Friday April 21st 2006&quot;
url=&quot;http://radio.weblogs.com/0001014/2006/04/21.html#a7302&quot; /&gt;
&lt;outline type=&quot;link&quot; text=&quot;#371 Daily Source Code for Thursday April 20th 2006&quot;
url=&quot;http://radio.weblogs.com/0001014/2006/04/20.html#a7301&quot; /&gt;
&lt;outline type=&quot;link&quot; text=&quot;#370 Daily Source Code for Wednesday April 19th 2006&quot;
url=&quot;http://radio.weblogs.com/0001014/2006/04/19.html#a7300&quot; /&gt;
&lt;/outline&gt;
&lt;outline text=&quot;Gillmor Gang&quot;&gt;
&lt;outline type=&quot;link&quot; text=&quot;Syndicate Gang Part I&quot; url=&quot;http://gillmorgang.podshow.com/?p=44&quot; /&gt;
&lt;outline type=&quot;link&quot; text=&quot;HughTrain Gang&quot; url=&quot;http://gillmorgang.podshow.com/?p=43&quot; /&gt;
&lt;outline type=&quot;link&quot; text=&quot;Phlegm at 11 Gang&quot; url=&quot;http://gillmorgang.podshow.com/?p=42&quot; /&gt;
&lt;outline type=&quot;link&quot; text=&quot;NDA Gang&quot; url=&quot;http://gillmorgang.podshow.com/?p=41&quot; /&gt;
&lt;outline type=&quot;link&quot; text=&quot;When the Music?s Over Gang&quot; url=&quot;http://gillmorgang.podshow.com/?p=40&quot; /&gt;
&lt;/outline&gt;</pre></div>
<p>...<br />When converted to RSS2 becomes:</p>
<div class="source">
<pre>&lt;channel&gt;
&lt;title&gt;Top Ten Sources for podcasting&lt;/title&gt;
&lt;link&gt;http://foo.com&lt;/link&gt;
&lt;description /&gt;
&lt;managingEditor&gt;Newsilike Media Group&lt;/managingEditor&gt;
&lt;item&gt;
&lt;title&gt;TopTenSources: podcasting&lt;/title&gt;
&lt;link&gt;http://podcasting.TopTenSources.com/TopTenSources/&lt;/link&gt;
&lt;category domain=&quot;urn:rome.tree&quot;&gt;node.-1732517202&lt;/category&gt;
&lt;category domain=&quot;urn:rome.attribute#url&quot;&gt;http://podcasting.TopTenSources.com/TopTenSources/&lt;/category&gt;
&lt;guid&gt;http://podcasting.TopTenSources.com/TopTenSources/&lt;/guid&gt;
&lt;/item&gt;
&lt;item&gt;
&lt;title&gt;CBS Technology News Podcast - Larry Magid' Tech Report&lt;/title&gt;
&lt;category domain=&quot;urn:rome.tree&quot;&gt;node.1353657827&lt;/category&gt;
&lt;/item&gt;
&lt;item&gt;
&lt;title&gt;Larry Magid's Tech Report&lt;/title&gt;
&lt;link&gt;http://www.cbsnews.com&lt;/link&gt;
&lt;category domain=&quot;urn:rome.tree&quot;&gt;node.-4085850&lt;/category&gt;
&lt;category domain=&quot;urn:rome.tree&quot;&gt;parent.1353657827&lt;/category&gt;
&lt;category domain=&quot;urn:rome.attribute#url&quot;&gt;http://www.cbsnews.com&lt;/category&gt;
&lt;guid&gt;http://www.cbsnews.com&lt;/guid&gt;
&lt;/item&gt;
&lt;item&gt;
&lt;title&gt;Adam Curry: Daily Source Code&lt;/title&gt;
&lt;category domain=&quot;urn:rome.tree&quot;&gt;node.835791399&lt;/category&gt;
&lt;/item&gt;
&lt;item&gt;
&lt;title&gt;#374 Daily Source Code for Tuesday April 25th 2006&lt;/title&gt;
&lt;link&gt;http://radio.weblogs.com/0001014/2006/04/26.html#a7304&lt;/link&gt;
&lt;category domain=&quot;urn:rome.tree&quot;&gt;node.222050897&lt;/category&gt;
&lt;category domain=&quot;urn:rome.tree&quot;&gt;parent.835791399&lt;/category&gt;
&lt;category domain=&quot;urn:rome.attribute#url&quot;&gt;http://radio.weblogs.com/0001014/2006/04/26.html#a7304&lt;/category&gt;
&lt;guid&gt;http://radio.weblogs.com/0001014/2006/04/26.html#a7304&lt;/guid&gt;
&lt;/item&gt;
&lt;item&gt;
&lt;title&gt;#373 Daily Source Code for Monday April 24th 2006&lt;/title&gt;
&lt;link&gt;http://radio.weblogs.com/0001014/2006/04/24.html#a7303&lt;/link&gt;
&lt;category domain=&quot;urn:rome.tree&quot;&gt;node.2088220478&lt;/category&gt;
&lt;category domain=&quot;urn:rome.tree&quot;&gt;parent.835791399&lt;/category&gt;
&lt;category domain=&quot;urn:rome.attribute#url&quot;&gt;http://radio.weblogs.com/0001014/2006/04/24.html#a7303&lt;/category&gt;
&lt;guid&gt;http://radio.weblogs.com/0001014/2006/04/24.html#a7303&lt;/guid&gt;
&lt;/item&gt;</pre></div>
<p>Nodes get categories with the &quot;urn:rome.tree&quot; URI that is used to maintain the tree structure.</p>
<p>The other thing you will notice is the &quot;urn:rome.attribute#url&quot;. Since OPML allows you to add arbitrary attributes to each outline element, these are used to preserve these values.</p></div></div>
</div>
</div>
</div>
<hr/>
<footer>
<div class="container-fluid">
<div class="row span12">Copyright &copy; 2016.
All Rights Reserved.
</div>
</div>
</footer>
</body>
</html>