rome/RomeV0.4FeedAndEntryURIMapping.html

182 lines
11 KiB
HTML
Raw Normal View History

2014-04-18 19:37:21 +02:00
<!DOCTYPE html>
<!--
| Generated by Apache Maven Doxia at 2014-04-18
| Rendered using Apache Maven Fluido Skin 1.3.0
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
2014-04-18 19:37:21 +02:00
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="author" content="mkurz" />
<meta name="Date-Creation-yyyymmdd" content="20110815" />
2014-04-18 19:37:21 +02:00
<meta name="Date-Revision-yyyymmdd" content="20140418" />
<meta http-equiv="Content-Language" content="en" />
2014-04-18 19:37:21 +02:00
<title>ROME - Rome v0.4, Feed and Entry URI Mapping</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">
2014-04-18 19:37:21 +02:00
<div class="container-fluid">
<div id="banner">
<div class="pull-left">
<a href="http://github.com/rometools/" id="bannerLeft">
<img src="images/romelogo.png" alt="ROME"/>
</a>
2014-04-18 19:37:21 +02:00
</div>
<div class="pull-right"> </div>
<div class="clear"><hr/></div>
</div>
2014-04-18 19:37:21 +02:00
<div id="breadcrumbs">
<ul class="breadcrumb">
2014-04-18 19:37:21 +02:00
2014-04-18 19:37:21 +02:00
<li id="publishDate" class="pull-right">Last Published: 2014-04-18</li> <li class="divider pull-right">|</li>
<li id="projectVersion" class="pull-right">Version: 1.5.0-SNAPSHOT</li>
</ul>
</div>
2014-04-18 19:37:21 +02:00
<div class="row-fluid">
<div id="leftColumn" class="span3">
<div class="well sidebar-nav">
2014-04-18 19:37:21 +02:00
<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>
2014-04-18 19:37:21 +02:00
<li>
<a href="HowRomeWorks/index.html" title="How Rome Works">
<i class="icon-chevron-right"></i>
How Rome Works</a>
</li>
2014-04-18 19:37:21 +02:00
<li>
<a href="RssAndAtOMUtilitiEsROMEV0.5AndAboveTutorialsAndArticles/index.html" title="Tutorials And Articles">
<i class="none"></i>
Tutorials And Articles</a>
</li>
2014-04-18 19:37:21 +02:00
<li>
<a href="ROMEReleases/index.html" title="Releases">
<i class="icon-chevron-right"></i>
Releases</a>
</li>
2014-04-18 19:37:21 +02:00
<li>
<a href="ROMEDevelopmentProposals/index.html" title="ROME Development Proposals">
<i class="none"></i>
ROME Development Proposals</a>
</li>
2014-04-18 19:37:21 +02:00
<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>
2014-04-18 19:37:21 +02:00
</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">
2014-04-18 19:37:21 +02:00
<img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" />
</a>
2014-04-18 19:37:21 +02:00
</div>
</div>
</div>
<div id="bodyColumn" class="span9" >
<div class="section">
<h2>Rome v0.4, Feed and Entry URI Mapping<a name="Rome_v0.4_Feed_and_Entry_URI_Mapping"></a></h2>
<p>Rome Synd beans define the concept of URI at both feed and entry levels. The purpose of this URI is to help uniquely identifying feeds and entries when processed with Rome. This is particularly useful when a system is persisting feeds and when doing data manipulation where a primary key for the feeds or the entries is needed.</p>
<div class="section">
<h3>The Problem<a name="The_Problem"></a></h3>
<p>RSS 0.90, 0.91, 0.92, 0.93 and 1.0 do not define any special element for the purposes of identifying the feed or the items other than the items link element. The channel link element cannot be used to identify the feed as its semantics is to refer to the web site that has the information being published through the feed and, if web site offers more than one feed most likely both of them will have the same feed link value.</p>
<p>RSS 0.94 and RSS 2.0 define the guid element at item level. The guid element has an overloaded meaning. If the isPermalink attribute is true, the guid value can be used also as the URL for the item instead of the link element as well as a unique ID for the item. If the isPermalink attribute is false, the guid value can be used as a unique ID for the item. However, RSS 0.94 or RSS 2.0, do not define that the value of the guid element must be an URI.</p>
<p>Atom 0.3 defines an id element at feed and entry levels. The id element is defined as an URI. The Atom specification being currently designed requires the id element to contain a normalized URI as defined by RFC 2396bis.</p>
<p>The RSS0.94 and RSS 2.0 guid element and the Atom 0.3 id element are optional elements. Because of this, they may not be present at all in feeds.</p></div>
<div class="section">
<h3>Rome's Solution<a name="Romes_Solution"></a></h3>
<p>Because the concept of a URI it is not defined in all the feed formats, Rome makes an arbitrary design decision to provide the URI functionality regardless of the original (or target) feed type. The following behavior as been chosen based on expected and assumed usage pattern of feed and entry data.</p></div>
<div class="section">
<h3>URI Normalization<a name="URI_Normalization"></a></h3>
<p>If the uri property of a SyndFeed or SyndEntry bean is not NULL, the getter method must return a normalized URI following the rules defined in RFC2396bis.</p>
<div class="section">
<h4>Converting from WireFeed (RSS or Atom) to SyndFeed<a name="Converting_from_WireFeed_RSS_or_Atom_to_SyndFeed"></a></h4>
<p>The common use case for this scenario is when consuming a feed. Because of that, for clarity purposes, when referring to the data in the WireFeed the following sections talks about elements (as in the XML feed) instead of talking of properties.</p></div>
<div class="section">
<h4>SyndFeed<a name="SyndFeed"></a></h4>
<p>None of the RSS versions define an ID at channel level. In addition to this, Rome input classes (WireFeedInput and SyndFeedInput) do not have access to the URL (if any) used to fetch the feed. Because of this Rome does not set in the SyndFeed uri property , it is left to developer to set (if needed) a URI in the feed bean.</p>
<p>In the case of Atom 0.3, if the id element is present in the feed, the SyndFeed uri property will be set with the value of the id element. If it is not present, the developer must set (if needed) a URI manually.</p>
<div class="section">
<h5>SyndEntry<a name="SyndEntry"></a></h5>
<p>For RSS 0.91, RSS 0.92, RSS 0.93 &amp; RSS 1.0 if the link element is present in the item, the SyndEntry uri property will be set with the value of the link element. Otherwise the SyndEntry uri property is left as NULL and the developer must set it (if needed).</p>
<p>For RSS 0.94 &amp; RSS 2.0 if the guid property is present in the item, the SyndEntry uri property will be set with the value of the guid element. If the guid element is not present, the SyndEntry uri property will be set with the value of the link element. If the link element is missing but the guid is present and it is flagged as a permalink, Rome will set set the SyndEntry link property with the value of the guid element (Rome is doing this because is a common practice to generated RSS 2.0 fees with guid elements marked as permalinks and without a link element).</p>
<p>For Atom 0.3 if the id element is present, the SyndEntry uri property is set with the value of the id element. If the id element is not present, the SyndEntry uri property is set with the value of the alternate link element.</p></div></div>
<div class="section">
<h4>Converting from SyndFeed to WireFeed (RSS or Atom)<a name="Converting_from_SyndFeed_to_WireFeed_RSS_or_Atom"></a></h4>
<p>The common use case for this scenario is when generating a feed. Because of that, for clarity purposes, when referring to the data in the WireFeed the following sections talks about elements (as in the XML feed) instead of talking of properties.</p>
<div class="section">
<h5>SyndFeed<a name="SyndFeed"></a></h5>
<p>For RSS 0.91, RSS 0.92, RSS 0.93, RSS 1.0 &amp; RSS 2.0 the SyndFeed uri property is lost as there is not possible representation in the channel element for it.</p>
<p>For Atom 0.3 set the SyndFeed uri property is set as the value for the id element.</p></div>
<div class="section">
<h5>SyndEntry<a name="SyndEntry"></a></h5>
<p>For RSS 0.91, RSS 0.92, RSS 0.93 &amp; RSS 1.0 the SyndEntry uri property is lost as there is not possible representation in the item element for it.</p>
<p>For RSS 0.94 &amp; RSS 2.0 the SyndEntry uri property is set as the value of the guid element with permalink set to false. If the SyndEntry uri property is not set, the SyndEntry link property is set as the value of the guid element with permalink set to true. Note that if the SyndFEntry linkproperty is missing the SyndEntry uri cannot be set as the value of the link element because it cannot be assumed that the uri property is an URL.</p>
<p>Because SyndEntry instances always return a normalized URI the value of the guid elements of a generated RSS 0.94 or RSS 2.0 may differ from the values of the guid elements of the original feed.</p>
<p>For Atom 0.3 the SyndEntry uri property is set as the id element.</p>
<p>Mosh...</p></div></div></div></div>
</div>
2014-04-18 19:37:21 +02:00
</div>
</div>
<hr/>
<footer>
<div class="container-fluid">
<div class="row span12">Copyright &copy; 2014.
All Rights Reserved.
</div>
2014-04-18 19:37:21 +02:00
</div>
</footer>
</body>
</html>