@SuppressWarnings("unchecked")
@Override
public void encodeBegin(FacesContext facesContext) throws IOException
{
ChannelFeed channelFeed = (ChannelFeed) Contexts.getEventContext().get(FEED_IMPL_KEY);
ItemEntry itemEntry = new ItemEntry();
itemEntry.setUid(getUid());
itemEntry.setTitle(makeText(getTitle()));
itemEntry.addLink(getLink());
String author = getAuthor();
if (author != null)
{
Person authorPerson = new Person();
authorPerson.setName(author);
itemEntry.addAuthorOrCreator(authorPerson);
}
itemEntry.setDescriptionOrSummary(makeText(getSummary()));
if (getUpdated() != null) {
itemEntry.setUpdatedDate(getUpdated(), new SimpleDateFormat(ATOM_DATE_FORMAT));
}
if (getPublished() != null) {
itemEntry.setPubDate(getPublished(), new SimpleDateFormat(ATOM_DATE_FORMAT));
}
channelFeed.addItem(itemEntry);
}