rome upgrade

This commit is contained in:
Athou
2014-08-15 13:51:13 +02:00
parent 20292a7742
commit fa0e7bcb54
15 changed files with 81 additions and 111 deletions

View File

@@ -1,19 +1,20 @@
package com.commafeed.backend.rome;
import org.jdom.Element;
import org.jdom2.Element;
import com.sun.syndication.feed.opml.Opml;
import com.rometools.opml.feed.opml.Opml;
/**
* Add missing title to the generated OPML
*
*/
public class OPML11Generator extends com.sun.syndication.io.impl.OPML10Generator {
public class OPML11Generator extends com.rometools.opml.io.impl.OPML10Generator {
public OPML11Generator() {
super("opml_1.1");
}
@Override
protected Element generateHead(Opml opml) {
Element head = new Element("head");
addNotNullSimpleElement(head, "title", opml.getTitle());

View File

@@ -1,9 +1,9 @@
package com.commafeed.backend.rome;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom2.Document;
import org.jdom2.Element;
import com.sun.syndication.io.impl.OPML10Parser;
import com.rometools.opml.io.impl.OPML10Parser;
/**
* Support for OPML 1.1 parsing

View File

@@ -1,10 +1,10 @@
package com.commafeed.backend.rome;
import com.sun.syndication.feed.rss.Description;
import com.sun.syndication.feed.rss.Item;
import com.sun.syndication.feed.synd.SyndContentImpl;
import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.feed.synd.impl.ConverterForRSS090;
import com.rometools.rome.feed.rss.Description;
import com.rometools.rome.feed.rss.Item;
import com.rometools.rome.feed.synd.SyndContentImpl;
import com.rometools.rome.feed.synd.SyndEntry;
import com.rometools.rome.feed.synd.impl.ConverterForRSS090;
/**
* Support description tag for RSS09

View File

@@ -1,10 +1,12 @@
package com.commafeed.backend.rome;
import org.jdom.Element;
import java.util.Locale;
import com.sun.syndication.feed.rss.Description;
import com.sun.syndication.feed.rss.Item;
import com.sun.syndication.io.impl.RSS090Parser;
import org.jdom2.Element;
import com.rometools.rome.feed.rss.Description;
import com.rometools.rome.feed.rss.Item;
import com.rometools.rome.io.impl.RSS090Parser;
/**
* Support description tag for RSS09
@@ -13,9 +15,8 @@ import com.sun.syndication.io.impl.RSS090Parser;
public class RSS090DescriptionParser extends RSS090Parser {
@Override
protected Item parseItem(Element rssRoot, Element eItem) {
Item item = super.parseItem(rssRoot, eItem);
protected Item parseItem(Element rssRoot, Element eItem, Locale locale) {
Item item = super.parseItem(rssRoot, eItem, locale);
Element e = eItem.getChild("description", getRSSNamespace());
if (e != null) {
Description desc = new Description();
@@ -25,5 +26,4 @@ public class RSS090DescriptionParser extends RSS090Parser {
return item;
}
}

View File

@@ -2,13 +2,13 @@ package com.commafeed.backend.rome;
import java.util.List;
import org.apache.commons.collections.CollectionUtils;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.Namespace;
import org.apache.commons.collections4.CollectionUtils;
import org.jdom2.Document;
import org.jdom2.Element;
import org.jdom2.Namespace;
import com.google.common.collect.Lists;
import com.sun.syndication.io.impl.RSS10Parser;
import com.rometools.rome.io.impl.RSS10Parser;
public class RSSRDF10Parser extends RSS10Parser {
@@ -19,14 +19,13 @@ public class RSSRDF10Parser extends RSS10Parser {
super("rss_1.0", RSS_NS);
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public boolean isMyType(Document document) {
boolean ok = false;
Element rssRoot = document.getRootElement();
Namespace defaultNS = rssRoot.getNamespace();
List additionalNSs = Lists.newArrayList(rssRoot.getAdditionalNamespaces());
List<Namespace> additionalNSs = Lists.newArrayList(rssRoot.getAdditionalNamespaces());
List<Element> children = rssRoot.getChildren();
if (CollectionUtils.isNotEmpty(children)) {
Element child = children.get(0);