WAS KANN ICH TUN???
public class SyndEntryNewElement extends SyndEntryImpl
{
private String _height;
private String _width;
private String _picURL;
private ObjectBean _objBean;
private String _uri;
private String _title;
private String _link;
private Date _updatedDate;
private SyndContent _summary;
private SyndContent _description;
private List _links;
private List _contents; // deprecated by Atom 1.0
private List _modules;
private List _enclosures;
private List _authors;
private List _contributors;
public List getAuthors() {
return _authors;
}
public void setAuthors(List _authors) {
this._authors = _authors;
}
public List getContents() {
return _contents;
}
public void setContents(List _contents) {
this._contents = _contents;
}
public List getContributors() {
return _contributors;
}
public void setContributors(List _contributors) {
this._contributors = _contributors;
}
public SyndContent getDescription() {
return _description;
}
public void setDescription(SyndContent _description) {
this._description = _description;
}
public List getEnclosures() {
return _enclosures;
}
public void setEnclosures(List _enclosures) {
this._enclosures = _enclosures;
}
public String getLink() {
return _link;
}
public void setLink(String _link) {
this._link = _link;
}
public List getLinks() {
return _links;
}
public void setLinks(List _links) {
this._links = _links;
}
public List getModules() {
return _modules;
}
public void setModules(List _modules) {
this._modules = _modules;
}
public ObjectBean getObjBean() {
return _objBean;
}
public void setObjBean(ObjectBean bean) {
_objBean = bean;
}
public SyndContent getSummary() {
return _summary;
}
public void setSummary(SyndContent _summary) {
this._summary = _summary;
}
public String getTitle() {
return _title;
}
public void setTitle(String _title) {
this._title = _title;
}
public Date getUpdatedDate() {
return _updatedDate;
}
public void setUpdatedDate(Date date) {
_updatedDate = date;
}
public String getUri() {
return _uri;
}
public void setUri(String _uri) {
this._uri = _uri;
}
public String getHeight()
{
return _height;
}
public void setHeight(String height)
{
_height = height;
}
public String getPicURL()
{
return _picURL;
}
public void setPicURL(String picURL)
{
_picURL = picURL;
}
public String getWidth()
{
return _width;
}
public void setWidth(String width)
{
_width = width;
}
}
public class SyndFeedNewElement extends SyndFeedImpl
{
private ObjectBean _objBean;
private String _encoding;
private String _uri;
private String _title;
private String _feedType;
private String _link;
private String _height;
private String _width;
private String _picURL;
private List _links;
private String _description;
private SyndImage _image;
private List _entries;
private List _modules;
private List _authors;
private List _contributors;
private static final Converters CONVERTERS = new Converters();
public String getHeight()
{
return _height;
}
public void setHeight(String height)
{
_height = height;
}
public String getPicURL()
{
return _picURL;
}
public void setPicURL(String picURL)
{
_picURL = picURL;
}
public String getWidth()
{
return _width;
}
public void setWidth(String width)
{
_width = width;
}
public WireFeed createWireFeed() {
return createWireFeed(_feedType);
}
public WireFeed createWireFeed(String feedType) {
if (feedType==null) {
throw new IllegalArgumentException("Feed type cannot be null");
}
Converter converter = CONVERTERS.getConverter(feedType);
if (converter==null) {
throw new IllegalArgumentException("Invalid feed type ["+feedType+"]");
}
return converter.createRealFeed(this);
}
public static Converters getCONVERTERS()
{
return CONVERTERS;
}
public List getAuthors()
{
return _authors;
}
public void setAuthors(List _authors)
{
this._authors = _authors;
}
public List getContributors()
{
return _contributors;
}
public void setContributors(List _contributors)
{
this._contributors = _contributors;
}
public String getDescription()
{
return _description;
}
public void setDescription(String _description)
{
this._description = _description;
}
public String getEncoding()
{
return _encoding;
}
public void setEncoding(String _encoding)
{
this._encoding = _encoding;
}
public List getEntries()
{
return _entries;
}
public void setEntries(List _entries)
{
this._entries = _entries;
}
public String getFeedType()
{
return _feedType;
}
public void setFeedType(String type)
{
_feedType = type;
}
public SyndImage getImage()
{
return _image;
}
public void setImage(SyndImage _image)
{
this._image = _image;
}
public String getLink()
{
return _link;
}
public void setLink(String _link)
{
this._link = _link;
}
public List getLinks()
{
return _links;
}
public void setLinks(List _links)
{
this._links = _links;
}
public List getModules()
{
return _modules;
}
public void setModules(List _modules)
{
this._modules = _modules;
}
public ObjectBean getObjBean()
{
return _objBean;
}
public void setObjBean(ObjectBean bean)
{
_objBean = bean;
}
public String getTitle()
{
return _title;
}
public void setTitle(String _title)
{
this._title = _title;
}
public String getUri()
{
return _uri;
}
public void setUri(String _uri)
{
this._uri = _uri;
}
}
public class CreateAndWriteOwnFeed
{
public static void main(String[] args) throws Throwable
{
SyndFeedNewElement feed = new SyndFeedNewElement();
DateFormat dateParser = new SimpleDateFormat("yyyy-MM-dd");
feed.setFeedType("rss_1.0");
feed.setTitle("Sample Feed (created with ROME)");
feed.setLink("http://rome.dev.java.net");
feed.setDescription("This feed has been created using ROME (Java syndication utilities");
feed.setHeight("Height");
List entries = new ArrayList();
SyndEntryNewElement entry;
SyndContent description;
entry = new SyndEntryNewElement();
entry.setTitle("ROME v1.0");
entry.setLink("http://wiki.java.net/bin/view/Javawsxml/Rome01");
entry.setHeight("Height");
description = new SyndContentImpl();
description.setType("text/plain");
description.setValue("Initial release of ROME");
entry.setDescription(description);
entries.add(entry);
feed.setEntries(entries);
SyndFeedOutputNewElement output = new SyndFeedOutputNewElement();
StringWriter s = new StringWriter();
output.output(feed,s);
System.out.println(s.getBuffer());
}
}
public static void main(String[] args)
{
try{
SyndFeedNewElement feed = new SyndFeedNewElement();
DateFormat dateParser = new SimpleDateFormat("yyyy-MM-dd");
feed.setFeedType("rss_1.0");
feed.setTitle("Sample Feed (created with ROME)");
feed.setLink("http://rome.dev.java.net");
feed.setDescription("This feed has been created using ROME (Java syndication utilities");
feed.setHeight("Height");
List entries = new ArrayList();
SyndEntryNewElement entry;
SyndContent description;
entry = new SyndEntryNewElement();
entry.setTitle("ROME v1.0");
entry.setLink("http://wiki.java.net/bin/view/Javawsxml/Rome01");
entry.setHeight("Height");
description = new SyndContentImpl();
description.setType("text/plain");
description.setValue("Initial release of ROME");
entry.setDescription(description);
entries.add(entry);
feed.setEntries(entries);
SyndFeedOutputNewElement output = new SyndFeedOutputNewElement();
StringWriter s = new StringWriter();
output.output(feed,s);
System.out.println(s.getBuffer());
} catch(Exception ex){
ex.printStackTrace();
}
}
public class SyndFeedOutputNewElement extends SyndFeedOutput
{
private WireFeedOutput _feedOutput;
public void output(SyndFeedNewElement feed,Writer writer) throws IOException, FeedException
{
_feedOutput = new WireFeedOutput();
_feedOutput.output(feed.createWireFeed(),writer);
}
}
public void output(WireFeed feed,Writer writer) throws IllegalArgumentException,IOException, FeedException {
Document doc = outputJDom(feed);
String encoding = feed.getEncoding();
Format format = Format.getPrettyFormat();
if (encoding!=null) {
format.setEncoding(encoding);
}
XMLOutputter outputter = new XMLOutputter(format);
outputter.output(doc,writer);
}
Channel.ttl=-1
Channel.title=Sample Feed (created with ROME)
Channel.categories=[]
Channel.rating=null
Channel.modules=[]
Channel.textInput=null
Channel.encoding=null
Channel.managingEditor=null
Channel.height=Height
Channel.docs=null
Channel.items[0].comments=null
Channel.items[0].title=ROME v1.0
Channel.items[0].categories=[]
Channel.items[0].link=http://wiki.java.net/bin/view/Javawsxml/Rome01
Channel.items[0].pubDate=null
Channel.items[0].modules[0].descriptions=[]
Channel.items[0].modules[0].creators=[]
Channel.items[0].modules[0].contributors=[]
Channel.items[0].modules[0].title=null
Channel.items[0].modules[0].relations=[]
Channel.items[0].modules[0].publisher=null
Channel.items[0].modules[0].date=null
Channel.items[0].modules[0].languages=[]
Channel.items[0].modules[0].titles=[]
Channel.items[0].modules[0].rightsList=[]
Channel.items[0].modules[0].interface=interface com.sun.syndication.feed.module.DCModule
Channel.items[0].modules[0].subjects=[]
Channel.items[0].modules[0].contributor=null
Channel.items[0].modules[0].sources=[]
Channel.items[0].modules[0].types=[]
Channel.items[0].modules[0].type=null
Channel.items[0].modules[0].rights=null
Channel.items[0].modules[0].publishers=[]
Channel.items[0].modules[0].formats=[]
Channel.items[0].modules[0].dates=[]
Channel.items[0].modules[0].language=null
Channel.items[0].modules[0].identifiers=[]
Channel.items[0].modules[0].creator=null
Channel.items[0].modules[0].coverage=null
Channel.items[0].modules[0].uri=http://purl.org/dc/elements/1.1/
Channel.items[0].modules[0].description=null
Channel.items[0].modules[0].identifier=null
Channel.items[0].modules[0].subject=null
Channel.items[0].modules[0].relation=null
Channel.items[0].modules[0].source=null
Channel.items[0].modules[0].format=null
Channel.items[0].modules[0].coverages=[]
Channel.items[0].enclosures=[]
Channel.items[0].uri=null
Channel.items[0].description.value=Initial release of ROME
Channel.items[0].description.type=text/plain
Channel.items[0].guid=null
Channel.items[0].source=null
Channel.items[0].expirationDate=null
Channel.items[0].author=null
Channel.image=null
Channel.copyright=null
Channel.webMaster=null
Channel.pubDate=null
Channel.link=http://rome.dev.java.net
Channel.skipDays=[]
Channel.cloud=null
Channel.language=null
Channel.skipHours=[]
Channel.feedType=rss_1.0
Channel.uri=http://rome.dev.java.net
Channel.lastBuildDate=null
Channel.description=This feed has been created using ROME (Java syndication utilities
Channel.generator=null
public class SampleModuleGenerator implements ModuleGenerator {
private static final Namespace SAMPLE_NS = Namespace.getNamespace("sample", SampleModule.URI);
public String getNamespaceUri() {
return SampleModule.URI;
}
private static final Set NAMESPACES;
static {
Set nss = new HashSet();
nss.add(SAMPLE_NS);
NAMESPACES = Collections.unmodifiableSet(nss);
}
public Set getNamespaces() {
return NAMESPACES;
}
public void generate(Module module, Element element) {
// this is not necessary, it is done to avoid the namespace definition in every item.
Element root = element;
while (root.getParent()!=null && root.getParent() instanceof Element) {
root = (Element) element.getParent();
}
root.addNamespaceDeclaration(SAMPLE_NS);
SampleModuleI fm = (SampleModule)module;
if (fm.getBar() != null) {
element.addContent(generateSimpleElement("bar", fm.getBar()));
}
List foos = fm.getFoos();
for (int i = 0; i < foos.size(); i++) {
element.addContent(generateSimpleElement("foo",foos.get(i).toString()));
}
if (fm.getDate() != null) {
element.addContent(generateSimpleElement("date", DateParser.formatW3CDateTime(fm.getDate())));
}
}
protected Element generateSimpleElement(String name, String value) {
Element element = new Element(name, SAMPLE_NS);
element.addContent(value);
return element;
}
}
# Parsers for RSS 1.0 feed modules
#
rss_1.0.feed.ModuleParser.classes=com.sun.syndication.samples.module.SampleModuleParser
# Parsers for RSS 1.0 item modules
#
rss_1.0.item.ModuleParser.classes=com.sun.syndication.samples.module.SampleModuleParser
# Generators for RSS 1.0 feed modules
#
rss_1.0.feed.ModuleGenerator.classes=com.sun.syndication.samples.module.SampleModuleGenerator
# Generators for RSS_1.0 entry modules
#
rss_1.0.item.ModuleGenerator.classes=com.sun.syndication.samples.module.SampleModuleGenerator
Channel.ttl=-1
Channel.title=Sample Feed (created with ROME)
Channel.categories=[]
Channel.rating=null
Channel.modules=[]
Channel.textInput=null
Channel.encoding=null
Channel.managingEditor=null
Channel.height=Height
Channel.docs=null
Channel.items[0].comments=null
Channel.items[0].title=ROME v1.0
Channel.items[0].categories=[]
Channel.items[0].link=http://wiki.java.net/bin/view/Javawsxml/Rome01
Channel.items[0].pubDate=null
Channel.items[0].modules[0].descriptions=[]
Channel.items[0].modules[0].creators=[]
Channel.items[0].modules[0].contributors=[]
Channel.items[0].modules[0].title=null
Channel.items[0].modules[0].relations=[]
Channel.items[0].modules[0].publisher=null
Channel.items[0].modules[0].date=null
Channel.items[0].modules[0].languages=[]
Channel.items[0].modules[0].titles=[]
Channel.items[0].modules[0].rightsList=[]
Channel.items[0].modules[0].interface=interface com.sun.syndication.feed.module.DCModule
Channel.items[0].modules[0].subjects=[]
Channel.items[0].modules[0].contributor=null
Channel.items[0].modules[0].sources=[]
Channel.items[0].modules[0].types=[]
Channel.items[0].modules[0].type=null
Channel.items[0].modules[0].rights=null
Channel.items[0].modules[0].publishers=[]
Channel.items[0].modules[0].formats=[]
Channel.items[0].modules[0].dates=[]
Channel.items[0].modules[0].language=null
Channel.items[0].modules[0].identifiers=[]
Channel.items[0].modules[0].creator=null
Channel.items[0].modules[0].coverage=null
Channel.items[0].modules[0].uri=http://purl.org/dc/elements/1.1/
Channel.items[0].modules[0].description=null
Channel.items[0].modules[0].identifier=null
Channel.items[0].modules[0].subject=null
Channel.items[0].modules[0].relation=null
Channel.items[0].modules[0].source=null
Channel.items[0].modules[0].format=null
Channel.items[0].modules[0].coverages=[]
Channel.items[0].enclosures=[]
Channel.items[0].uri=null
Channel.items[0].description.value=Initial release of ROME
Channel.items[0].description.type=text/plain
Channel.items[0].guid=null
Channel.items[0].source=null
Channel.items[0].expirationDate=null
Channel.items[0].author=null
Channel.image=null
Channel.copyright=null
Channel.webMaster=null
Channel.pubDate=null
Channel.link=http://rome.dev.java.net
Channel.skipDays=[]
Channel.cloud=null
Channel.language=null
Channel.skipHours=[]
Channel.feedType=rss_1.0
Channel.uri=http://rome.dev.java.net
Channel.lastBuildDate=null
Channel.description=This feed has been created using ROME (Java syndication utilities
Channel.generator=null