incubator-wink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jra...@apache.org
Subject svn commit: r935989 - in /incubator/wink/trunk: wink-common/src/main/java/org/apache/wink/common/internal/providers/entity/rss/ wink-common/src/main/java/org/apache/wink/common/model/rss/ wink-examples/client/ReadRSS-client/src/main/java/org/apache/win...
Date Tue, 20 Apr 2010 16:48:08 GMT
Author: jramos
Date: Tue Apr 20 16:48:08 2010
New Revision: 935989

URL: http://svn.apache.org/viewvc?rev=935989&view=rev
Log:
[WINK-149] Apply patches from WINK-149 (1, 3, and 4; patch 2 was not applied). Thanks to Shiva
for the contributions

Removed:
    incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/internal/providers/entity/rss/
Modified:
    incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssCategory.java
    incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssChannel.java
    incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssEnclosure.java
    incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssFeed.java
    incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssItem.java
    incubator/wink/trunk/wink-examples/client/ReadRSS-client/src/main/java/org/apache/wink/example/ReadRssAsSyndFeed.java

Modified: incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssCategory.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssCategory.java?rev=935989&r1=935988&r2=935989&view=diff
==============================================================================
--- incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssCategory.java
(original)
+++ incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssCategory.java
Tue Apr 20 16:48:08 2010
@@ -83,9 +83,19 @@ public class RssCategory {
     @XmlAttribute
     protected String domain;
 
+    /**
+     * Creates an RssCategory object
+     */
     public RssCategory() {
     }
 
+    /**
+     * Creates an RssCategory object out of a SyndCategory object. Used for
+     * mapping Syndication Object Model into RSS.
+     * 
+     * @param syndCategory the SyndCategory object which has to be mapped into
+     *            an RssCategory object.
+     */
     public RssCategory(SyndCategory syndCategory) {
         if (syndCategory.getLabel() != null) {
             setContent(syndCategory.getLabel());
@@ -95,6 +105,15 @@ public class RssCategory {
         }
     }
 
+    /**
+     * Maps an RssCategory object into a SyndCategory object. Used for mapping
+     * RSS into Syndication Object Model.
+     * 
+     * @param syndCategory the SyndCategory object into which the given
+     *            RssCategory object has to be mapped into
+     * @return the SyndCategory object into which the given RssCategory object
+     *         has been mapped into
+     */
     public SyndCategory toSynd(SyndCategory syndCategory) {
         if (syndCategory == null) {
             return syndCategory;

Modified: incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssChannel.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssChannel.java?rev=935989&r1=935988&r2=935989&view=diff
==============================================================================
--- incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssChannel.java
(original)
+++ incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssChannel.java
Tue Apr 20 16:48:08 2010
@@ -281,9 +281,19 @@ public class RssChannel {
     private static String       RSS_DATE_FORMAT = "EEE, d MMM yyyy HH:mm:ss z";
     private static final Logger logger          = LoggerFactory.getLogger(RssChannel.class);
 
+    /**
+     * Creates an RssChannel object.
+     */
     public RssChannel() {
     }
 
+    /**
+     * Creates an RssChannel object out of a SyndFeed object. Used for mapping
+     * Syndication Object Model into RSS.
+     * 
+     * @param syndFeed the SyndFeed object which has to be mapped into an
+     *            RssChannel object
+     */
     public RssChannel(SyndFeed syndFeed) {
         if (syndFeed == null) {
             return;
@@ -337,6 +347,15 @@ public class RssChannel {
         }
     }
 
+    /**
+     * Maps an RssChannel object into a SyndFeed object. Used for mapping RSS
+     * into Syndication Object Model.
+     * 
+     * @param syndFeed the syndFeed object into which the given RssChannel
+     *            object has to be mapped into
+     * @return the SyndFeed object into which the given RssChannel object has
+     *         been mapped into
+     */
     public SyndFeed toSynd(SyndFeed syndFeed) {
         if (syndFeed == null) {
             return syndFeed;

Modified: incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssEnclosure.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssEnclosure.java?rev=935989&r1=935988&r2=935989&view=diff
==============================================================================
--- incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssEnclosure.java
(original)
+++ incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssEnclosure.java
Tue Apr 20 16:48:08 2010
@@ -83,15 +83,34 @@ public class RssEnclosure {
     @XmlAttribute(required = true)
     protected String type;
 
+    /**
+     * Creates an RssEnclosure object
+     */
     public RssEnclosure() {
     }
 
+    /**
+     * Creates an RssEnclosure object out of a SyndLink object. Used for mapping
+     * Syndication Object Model into RSS.
+     * 
+     * @param syndLink the SyndLink object which has to be mapped into an
+     *            RssEnclosure object.
+     */
     public RssEnclosure(SyndLink syndLink) {
         setType(syndLink.getType());
         setUrl(syndLink.getHref());
         setLength(syndLink.getLength());
     }
 
+    /**
+     * Maps an RssEnclosure object into a SyndLink object. Used for mapping RSS
+     * into Syndication Object Model.
+     * 
+     * @param syndLink the SyndLink object into which the given RssEnclosure
+     *            object has to be mapped into
+     * @return the SyndLink object into which the given RssEnclosure object has
+     *         been mapped into
+     */
     public SyndLink toSynd(SyndLink syndLink) {
         if (syndLink == null) {
             return syndLink;

Modified: incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssFeed.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssFeed.java?rev=935989&r1=935988&r2=935989&view=diff
==============================================================================
--- incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssFeed.java
(original)
+++ incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssFeed.java
Tue Apr 20 16:48:08 2010
@@ -73,14 +73,44 @@ import org.apache.wink.common.model.synd
 @XmlRootElement(name = "rss")
 public class RssFeed {
 
+    /**
+     * Creates an RssFeed object
+     */
     public RssFeed() {
     }
 
+    /**
+     * Creates an RssFeed object out of a SyndFeed object. Used for mapping
+     * Syndication Object Model into RSS.
+     * 
+     * @param syndFeed the SyndFeed object which has to be mapped into an RSS
+     *            object
+     */
     public RssFeed(SyndFeed syndFeed) {
         setChannel(new RssChannel(syndFeed));
         setVersion("2.0");
     }
 
+    /**
+     * Maps RssFeed into Syndication Object Model (SyndFeed). This enables the
+     * common SyndFeed APIs to be used for reading both RSS and Atom documents.
+     * 
+     * <pre>
+     * ...
+     * // perform a GET on the RSS resource. The resource will be returned as an Rss object
+     * RssFeed rssFeed = resource.accept(MediaType.APPLICATION_XML).get(RssFeed.class);
+     * 
+     * // Map RSS into SyndFeed
+     * SyndFeed syndFeed = new SyndFeed();
+     * syndFeed = rssFeed.toSynd(syndFeed);
+     * 
+     * // Now access RSS using SyndFeed APIs
+     * ...
+     * </pre>
+     * 
+     * @param syndFeed the SyndFeed object into which the given RSS object has to be mapped
into
+     * @return the SyndFeed object into which the given RSS object has been mapped into
+     */
     public SyndFeed toSynd(SyndFeed syndFeed) {
         if (syndFeed == null) {
             return syndFeed;

Modified: incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssItem.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssItem.java?rev=935989&r1=935988&r2=935989&view=diff
==============================================================================
--- incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssItem.java
(original)
+++ incubator/wink/trunk/wink-common/src/main/java/org/apache/wink/common/model/rss/RssItem.java
Tue Apr 20 16:48:08 2010
@@ -176,9 +176,19 @@ public class RssItem {
     @XmlAnyElement(lax = true)
     protected List<Object>      any;
 
+    /**
+     * Creates an RssItem object
+     */
     public RssItem() {
     }
 
+    /**
+     * Creates an RssItem object out of a SyndEntry object. Used for mapping
+     * Syndication Object Model into RSS.
+     * 
+     * @param syndEntry the SyndEntry object which has to be mapped into an
+     *            RssItem object.
+     */
     public RssItem(SyndEntry syndEntry) {
         if (syndEntry.getTitle() != null && syndEntry.getTitle().getValue() != null)
{
             setTitle(syndEntry.getTitle().getValue());
@@ -214,6 +224,15 @@ public class RssItem {
         }
     }
 
+    /**
+     * Maps an RssItem object into a SyndEntry object. Used for mapping RSS into
+     * Syndication Object Model.
+     * 
+     * @param syndEntry the SyndEntry object into which the given RssItem object
+     *            has to be mapped into
+     * @return the SyndEntry object into which the given RssItem object has been
+     *         mapped into
+     */
     public SyndEntry toSynd(SyndEntry syndEntry) {
         if (syndEntry == null) {
             return syndEntry;

Modified: incubator/wink/trunk/wink-examples/client/ReadRSS-client/src/main/java/org/apache/wink/example/ReadRssAsSyndFeed.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-examples/client/ReadRSS-client/src/main/java/org/apache/wink/example/ReadRssAsSyndFeed.java?rev=935989&r1=935988&r2=935989&view=diff
==============================================================================
--- incubator/wink/trunk/wink-examples/client/ReadRSS-client/src/main/java/org/apache/wink/example/ReadRssAsSyndFeed.java
(original)
+++ incubator/wink/trunk/wink-examples/client/ReadRSS-client/src/main/java/org/apache/wink/example/ReadRssAsSyndFeed.java
Tue Apr 20 16:48:08 2010
@@ -50,7 +50,7 @@ public class ReadRssAsSyndFeed {
             Resource feedResource = restClient.resource(rss_url);
 
             // perform a GET on the resource. The resource will be returned as an Rss object
-            RssFeed rssFeed = feedResource.accept(MediaType.APPLICATION_XML_TYPE).get(RssFeed.class);
+            RssFeed rssFeed = feedResource.accept(MediaType.APPLICATION_XML).get(RssFeed.class);
 
             // Map RSS into SyndFeed
             SyndFeed syndFeed = new SyndFeed();



Mime
View raw message