use of com.sun.syndication.feed.module.georss.SimpleModuleImpl in project pentaho-kettle by pentaho.
the class RssOutput method createEntry.
/**
* @param author
* : The author of the event
* @param title
* : The title of the event
* @param link
* : The link to the element in RES
* @param date
* : The event's date
* @param desc
* : The event's description
*/
@SuppressWarnings("unchecked")
public boolean createEntry(String author, String title, String link, Date date, String desc, String geopointLat, String geopointLong) {
boolean retval = false;
try {
// Add entry to the feed
SyndEntry entry = new SyndEntryImpl();
SyndContent description;
entry = new SyndEntryImpl();
if (title != null) {
entry.setTitle(title);
}
if (link != null) {
entry.setLink(link);
}
if (date != null) {
entry.setPublishedDate(date);
}
if (author != null) {
entry.setAuthor(author);
}
if (desc != null) {
description = new SyndContentImpl();
description.setType("text/plain");
description.setValue(desc);
entry.setDescription(description);
}
if (meta.AddGeoRSS() && geopointLat != null && geopointLong != null) {
// Add GeoRSS?
GeoRSSModule geoRSSModule = new SimpleModuleImpl();
if (meta.useGeoRSSGML()) {
geoRSSModule = new W3CGeoModuleImpl();
}
geoRSSModule.setPosition(new Position(Const.toDouble(geopointLat.replace(',', '.'), 0), Const.toDouble(geopointLong.replace(',', '.'), 0)));
entry.getModules().add(geoRSSModule);
}
data.entries.add(entry);
retval = true;
} catch (Exception e) {
logError(BaseMessages.getString(PKG, "RssOutput.Log.ErrorAddingEntry", e.getMessage()));
setErrors(1);
retval = false;
}
return retval;
}
Aggregations