com.google.gdata.data.Entry feedEntry = new com.google.gdata.data.Entry();
if (key != null) {
feedEntry.setId(key.toString());
}
feedEntry.setTitle(new PlainTextConstruct(item.getTitle()));
feedEntry.setContent(new PlainTextConstruct(item.getContents()));
String href = item.getLink();
if (href == null && key != null) {
href = key.toString();
}
if (href != null) {
feedEntry.addHtmlLink(href, "", "");
}
String related = item.getRelated();
if (related != null) {
feedEntry.addHtmlLink(related, "", "related");
}
String alternate = item.getAlternate();
if (alternate != null) {
feedEntry.addHtmlLink(alternate, "", "alternate");
}
Date date = item.getDate();
if (date != null) {
DateTime datetime = new DateTime(date);
feedEntry.setUpdated(datetime);
}
return feedEntry;
} else if (data != null) {
com.google.gdata.data.Entry feedEntry = new com.google.gdata.data.Entry();
feedEntry.setId(key.toString());
feedEntry.setTitle(new PlainTextConstruct("item"));
// Convert the item to XML
String value = mediator.mediate(data, itemClassType, itemXMLType, null).toString();
// Might be wrong because the example uses XML datatype, I am using
// plainText here
feedEntry.setContent(new PlainTextConstruct(value));
feedEntry.addHtmlLink(key.toString(), "", "");
return feedEntry;
} else {