[seam-commits] Seam SVN: r9089 - trunk/src/rss/org/jboss/seam/rss/ui.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Mon Sep 22 03:58:47 EDT 2008
Author: nickarls
Date: 2008-09-22 03:58:47 -0400 (Mon, 22 Sep 2008)
New Revision: 9089
Modified:
trunk/src/rss/org/jboss/seam/rss/ui/UIEntry.java
Log:
summaryFormat support
Modified: trunk/src/rss/org/jboss/seam/rss/ui/UIEntry.java
===================================================================
--- trunk/src/rss/org/jboss/seam/rss/ui/UIEntry.java 2008-09-22 07:58:25 UTC (rev 9088)
+++ trunk/src/rss/org/jboss/seam/rss/ui/UIEntry.java 2008-09-22 07:58:47 UTC (rev 9089)
@@ -4,35 +4,21 @@
import java.text.SimpleDateFormat;
import java.util.Date;
-import org.jboss.seam.contexts.Contexts;
import javax.faces.context.FacesContext;
+import org.jboss.seam.contexts.Contexts;
+
import yarfraw.core.datamodel.ChannelFeed;
-import yarfraw.core.datamodel.Content;
import yarfraw.core.datamodel.ItemEntry;
-import yarfraw.core.datamodel.Link;
import yarfraw.core.datamodel.Person;
import yarfraw.core.datamodel.Text;
import yarfraw.core.datamodel.Text.TextType;
/**
- *atomEntry =
- element atom:entry {
- atomCommonAttributes,
- (atomAuthor*
- & atomCategory*
- & atomContent?
- & atomContributor*
- & atomId
- & atomLink*
- & atomPublished?
- & atomRights?
- & atomSource?
- & atomSummary?
- & atomTitle
- & atomUpdated
- & extensionElement*)
- }
+ *atomEntry = element atom:entry { atomCommonAttributes, (atomAuthor* &
+ * atomCategory* & atomContent? & atomContributor* & atomId & atomLink* &
+ * atomPublished? & atomRights? & atomSource? & atomSummary? & atomTitle &
+ * atomUpdated & extensionElement*) }
*/
public class UIEntry extends SyndicationComponent
@@ -44,6 +30,7 @@
private String link;
private String author;
private String summary;
+ private TextType summaryFormat = TextType.html;
private Date published;
private Date updated;
@@ -53,7 +40,6 @@
return COMPONENT_TYPE;
}
-
@SuppressWarnings("unchecked")
@Override
public void encodeBegin(FacesContext facesContext) throws IOException
@@ -65,16 +51,19 @@
itemEntry.setTitle(getTitle());
itemEntry.addLink(getLink());
String author = getAuthor();
- if (author != null) {
+ if (author != null)
+ {
Person authorPerson = new Person();
authorPerson.setName(author);
itemEntry.addAuthorOrCreator(authorPerson);
}
- itemEntry.setDescriptionOrSummary(getSummary());
+ Text summary = new Text(summaryFormat);
+ summary.setText(getSummary());
+ itemEntry.setDescriptionOrSummary(summary);
itemEntry.setUpdatedDate(getUpdated(), new SimpleDateFormat(ATOM_DATE_FORMAT));
itemEntry.setPubDate(getPublished(), new SimpleDateFormat(ATOM_DATE_FORMAT));
-
- channelFeed.addItem(itemEntry);
+
+ channelFeed.addItem(itemEntry);
}
public String getTitle()
@@ -82,43 +71,36 @@
return (String) valueOf("title", title);
}
-
public void setTitle(String title)
{
this.title = title;
}
-
public String getLink()
{
return (String) valueOf("link", link);
}
-
public void setLink(String link)
{
this.link = link;
}
-
public String getAuthor()
{
return (String) valueOf("author", author);
}
-
public void setAuthor(String author)
{
this.author = author;
}
-
public String getSummary()
{
return (String) valueOf("summary", summary);
}
-
public void setSummary(String summary)
{
this.summary = summary;
@@ -129,34 +111,39 @@
return (Date) valueOf("published", published);
}
-
public void setPublished(Date published)
{
this.published = published;
}
-
public Date getUpdated()
{
return (Date) valueOf("updated", updated);
}
-
public void setUpdated(Date updated)
{
this.updated = updated;
}
-
public String getUid()
{
return (String) valueOf("uid", uid);
}
-
public void setUid(String uid)
{
this.uid = uid;
- }
+ }
+ public TextType getSummaryFormat()
+ {
+ return summaryFormat;
+ }
+
+ public void setSummaryFormat(TextType summaryFormat)
+ {
+ this.summaryFormat = summaryFormat;
+ }
+
}
More information about the seam-commits
mailing list