fix opml export not showing head and title

This commit is contained in:
Athou
2013-05-29 16:37:22 +02:00
parent 7c2d000c26
commit ed18bc55b7
3 changed files with 23 additions and 2 deletions

View File

@@ -27,7 +27,7 @@ public class OPMLExporter {
@SuppressWarnings("unchecked")
public Opml export(User user) {
Opml opml = new Opml();
opml.setFeedType("opml_1.0");
opml.setFeedType("opml_1.1");
opml.setTitle(String.format("%s subscriptions in CommaFeed",
user.getName()));
opml.setCreated(Calendar.getInstance().getTime());

View File

@@ -0,0 +1,19 @@
package com.commafeed.backend.rome;
import org.jdom.Element;
import com.sun.syndication.feed.opml.Opml;
public class OPML11Generator extends
com.sun.syndication.io.impl.OPML10Generator {
public OPML11Generator() {
super("opml_1.1");
}
protected Element generateHead(Opml opml) {
Element head = new Element("head");
addNotNullSimpleElement(head, "title", opml.getTitle());
return head;
}
}