Author: nickarls
Date: 2008-09-22 01:52:13 -0400 (Mon, 22 Sep 2008)
New Revision: 9084
Added:
trunk/examples/rss/
trunk/examples/rss/build.xml
trunk/examples/rss/dist/
trunk/examples/rss/exploded-archives/
trunk/examples/rss/exploded-archives/jboss-seam-rss.ear/
trunk/examples/rss/exploded-archives/jboss-seam-rss.jar/
trunk/examples/rss/exploded-archives/jboss-seam-rss.war/
trunk/examples/rss/readme.txt
trunk/examples/rss/resources/
trunk/examples/rss/resources/META-INF/
trunk/examples/rss/resources/META-INF/MANIFEST.MF
trunk/examples/rss/resources/META-INF/application.xml
trunk/examples/rss/resources/META-INF/ejb-jar.xml
trunk/examples/rss/resources/META-INF/jboss-app.xml
trunk/examples/rss/resources/META-INF/persistence.xml
trunk/examples/rss/resources/WEB-INF/
trunk/examples/rss/resources/WEB-INF/components.xml
trunk/examples/rss/resources/WEB-INF/faces-config.xml
trunk/examples/rss/resources/WEB-INF/pages.xml
trunk/examples/rss/resources/WEB-INF/web.xml
trunk/examples/rss/resources/components.properties
trunk/examples/rss/resources/seam.properties
trunk/examples/rss/src/
trunk/examples/rss/src/org/
trunk/examples/rss/src/org/jboss/
trunk/examples/rss/src/org/jboss/seam/
trunk/examples/rss/src/org/jboss/seam/rss/
trunk/examples/rss/src/org/jboss/seam/rss/Entry.java
trunk/examples/rss/src/org/jboss/seam/rss/Feed.java
trunk/examples/rss/src/org/jboss/seam/rss/RSSTest.java
trunk/examples/rss/src/org/jboss/seam/rss/test/
trunk/examples/rss/src/org/jboss/seam/rss/test/testng.xml
trunk/examples/rss/view/
trunk/examples/rss/view/index.html
trunk/examples/rss/view/rss.xhtml
Log:
RSS example
Added: trunk/examples/rss/build.xml
===================================================================
--- trunk/examples/rss/build.xml (rev 0)
+++ trunk/examples/rss/build.xml 2008-09-22 05:52:13 UTC (rev 9084)
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+
+<project name="rss" default="deploy" basedir=".">
+ <!-- Example name -->
+ <property name="Name" value="RSS generation
document example"/>
+ <property name="example.name"
value="jboss-seam-rss"/>
+
+ <!-- Libraries -->
+ <property name="seam.ui.lib" value="yes"/>
+ <property name="seam.rss.lib" value="yes"/>
+ <property name="seam.debug.lib" value="yes"/>
+ <property name="facelets.lib" value="yes"/>
+
+ <import file="../build.xml"/>
+
+ <path id="test.classpath.extras">
+ <fileset refid="seam.rss.jar" />
+ </path>
+
+ <path id="build.classpath.extras">
+ <fileset refid="seam.rss.jar" />
+ </path>
+
+
+</project>
+
Added: trunk/examples/rss/readme.txt
===================================================================
--- trunk/examples/rss/readme.txt (rev 0)
+++ trunk/examples/rss/readme.txt 2008-09-22 05:52:13 UTC (rev 9084)
@@ -0,0 +1,5 @@
+Seam RSS Example
+==================
+This example demonstrates the Seam RSS functionality. It runs on both JBoss AS and
Tomcat.
+
+example.name=rss
\ No newline at end of file
Added: trunk/examples/rss/resources/META-INF/MANIFEST.MF
===================================================================
--- trunk/examples/rss/resources/META-INF/MANIFEST.MF (rev 0)
+++ trunk/examples/rss/resources/META-INF/MANIFEST.MF 2008-09-22 05:52:13 UTC (rev 9084)
@@ -0,0 +1,4 @@
+Manifest-Version: 1.0
+Ant-Version: Apache Ant 1.6.5
+Created-By: 1.5.0_14-b03 (Sun Microsystems Inc.)
+
Added: trunk/examples/rss/resources/META-INF/application.xml
===================================================================
--- trunk/examples/rss/resources/META-INF/application.xml (rev 0)
+++ trunk/examples/rss/resources/META-INF/application.xml 2008-09-22 05:52:13 UTC (rev
9084)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<application
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/application_5.xsd"
+ version="5">
+
+ <display-name>Seam RSS Example</display-name>
+
+ <module>
+ <web>
+ <web-uri>jboss-seam-rss.war</web-uri>
+ <context-root>/seam-rss</context-root>
+ </web>
+ </module>
+
+ <module>
+ <ejb>jboss-seam-rss.jar</ejb>
+ </module>
+ <module>
+ <ejb>jboss-seam.jar</ejb>
+ </module>
+</application>
Added: trunk/examples/rss/resources/META-INF/ejb-jar.xml
===================================================================
--- trunk/examples/rss/resources/META-INF/ejb-jar.xml (rev 0)
+++ trunk/examples/rss/resources/META-INF/ejb-jar.xml 2008-09-22 05:52:13 UTC (rev 9084)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
+ version="3.0">
+
+ <interceptors>
+ <interceptor>
+
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+ </interceptor>
+ </interceptors>
+
+ <assembly-descriptor>
+ <interceptor-binding>
+ <ejb-name>*</ejb-name>
+
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+ </interceptor-binding>
+ </assembly-descriptor>
+</ejb-jar>
Added: trunk/examples/rss/resources/META-INF/jboss-app.xml
===================================================================
--- trunk/examples/rss/resources/META-INF/jboss-app.xml (rev 0)
+++ trunk/examples/rss/resources/META-INF/jboss-app.xml 2008-09-22 05:52:13 UTC (rev
9084)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE jboss-app
+ PUBLIC "-//JBoss//DTD J2EE Application 4.2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd">
+<jboss-app>
+ <loader-repository>
+ seam.jboss.org:loader=seam-rss
+ </loader-repository>
+</jboss-app>
Added: trunk/examples/rss/resources/META-INF/persistence.xml
===================================================================
--- trunk/examples/rss/resources/META-INF/persistence.xml (rev 0)
+++ trunk/examples/rss/resources/META-INF/persistence.xml 2008-09-22 05:52:13 UTC (rev
9084)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence
xmlns="http://java.sun.com/xml/ns/persistence"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+ version="1.0">
+ <persistence-unit name="userDatabase">
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <jta-data-source>java:/DefaultDS</jta-data-source>
+ <properties>
+ <property name="hibernate.hbm2ddl.auto"
value="create-drop"/>
+ <property name="hibernate.show_sql" value="true"/>
+ <property name="jboss.entity.manager.factory.jndi.name"
+ value="java:/seamrssEntityManagerFactory"/>
+ </properties>
+ </persistence-unit>
+</persistence>
Added: trunk/examples/rss/resources/WEB-INF/components.xml
===================================================================
--- trunk/examples/rss/resources/WEB-INF/components.xml (rev 0)
+++ trunk/examples/rss/resources/WEB-INF/components.xml 2008-09-22 05:52:13 UTC (rev
9084)
@@ -0,0 +1,16 @@
+<components
xmlns="http://jboss.com/products/seam/components"
+
xmlns:excel="http://jboss.com/products/seam/excel"
+
xmlns:core="http://jboss.com/products/seam/core"
+
xmlns:framework="http://jboss.com/products/seam/framework"
+
xmlns:document="http://jboss.com/products/seam/document"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://jboss.com/products/seam/core
http://jboss.com/products/seam/core-2.1.xsd
+
http://jboss.com/products/seam/framework
http://jboss.com/products/seam/framework-2.1.xsd
+
http://jboss.com/products/seam/document
http://jboss.com/products/seam/document-2.1.xsd
+
http://jboss.com/products/seam/excel
http://jboss.com/products/seam/excel-2.1.xsd
+
http://jboss.com/products/seam/components
http://jboss.com/products/seam/components-2.1.xsd">
+
+
+ <core:init debug="true" jndi-pattern="@jndiPattern@" />
+
+</components>
Added: trunk/examples/rss/resources/WEB-INF/faces-config.xml
===================================================================
--- trunk/examples/rss/resources/WEB-INF/faces-config.xml (rev 0)
+++ trunk/examples/rss/resources/WEB-INF/faces-config.xml 2008-09-22 05:52:13 UTC (rev
9084)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<faces-config version="1.2"
+
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+ <!-- Facelets support -->
+ <application>
+ <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+ </application>
+
+</faces-config>
Added: trunk/examples/rss/resources/WEB-INF/pages.xml
===================================================================
--- trunk/examples/rss/resources/WEB-INF/pages.xml (rev 0)
+++ trunk/examples/rss/resources/WEB-INF/pages.xml 2008-09-22 05:52:13 UTC (rev 9084)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pages
xmlns="http://jboss.com/products/seam/pages"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://jboss.com/products/seam/pages
http://jboss.com/products/seam/pages-2.0.xsd" >
+
+
+
+</pages>
Added: trunk/examples/rss/resources/WEB-INF/web.xml
===================================================================
--- trunk/examples/rss/resources/WEB-INF/web.xml (rev 0)
+++ trunk/examples/rss/resources/WEB-INF/web.xml 2008-09-22 05:52:13 UTC (rev 9084)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ version="2.5">
+ <listener>
+ <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
+ </listener>
+ <filter>
+ <filter-name>Seam Filter</filter-name>
+ <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>Seam Filter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <servlet>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <url-pattern>/seam/resource/*</url-pattern>
+ </servlet-mapping>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.seam</url-pattern>
+ </servlet-mapping>
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>webAppRootKey</param-name>
+ <param-value>seam-rss</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+</web-app>
\ No newline at end of file
Added: trunk/examples/rss/resources/components.properties
===================================================================
--- trunk/examples/rss/resources/components.properties (rev 0)
+++ trunk/examples/rss/resources/components.properties 2008-09-22 05:52:13 UTC (rev 9084)
@@ -0,0 +1,3 @@
+# The pattern in components.xml is replaced by an application server specific value in
the ant build. This value is used for running tests
+
+jndiPattern \#{ejbName}/local
\ No newline at end of file
Added: trunk/examples/rss/resources/seam.properties
===================================================================
Added: trunk/examples/rss/src/org/jboss/seam/rss/Entry.java
===================================================================
--- trunk/examples/rss/src/org/jboss/seam/rss/Entry.java (rev 0)
+++ trunk/examples/rss/src/org/jboss/seam/rss/Entry.java 2008-09-22 05:52:13 UTC (rev
9084)
@@ -0,0 +1,84 @@
+package nik.rss;
+
+import java.util.Date;
+
+public class Entry
+{
+ private String uid;
+ private String title;
+ private String link;
+ private String author;
+ private String summary;
+ private Date published;
+ private Date updated;
+
+ public String getUid()
+ {
+ return uid;
+ }
+
+ public void setUid(String uid)
+ {
+ this.uid = uid;
+ }
+
+ public String getTitle()
+ {
+ return title;
+ }
+
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+
+ public String getLink()
+ {
+ return link;
+ }
+
+ public void setLink(String link)
+ {
+ this.link = link;
+ }
+
+ public String getAuthor()
+ {
+ return author;
+ }
+
+ public void setAuthor(String author)
+ {
+ this.author = author;
+ }
+
+ public String getSummary()
+ {
+ return summary;
+ }
+
+ public void setSummary(String summary)
+ {
+ this.summary = summary;
+ }
+
+ public Date getPublished()
+ {
+ return published;
+ }
+
+ public void setPublished(Date published)
+ {
+ this.published = published;
+ }
+
+ public Date getUpdated()
+ {
+ return updated;
+ }
+
+ public void setUpdated(Date updated)
+ {
+ this.updated = updated;
+ }
+}
Added: trunk/examples/rss/src/org/jboss/seam/rss/Feed.java
===================================================================
--- trunk/examples/rss/src/org/jboss/seam/rss/Feed.java (rev 0)
+++ trunk/examples/rss/src/org/jboss/seam/rss/Feed.java 2008-09-22 05:52:13 UTC (rev
9084)
@@ -0,0 +1,76 @@
+package nik.rss;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class Feed
+{
+ private String uid;
+ private String title;
+ private String subtitle;
+ private Date updated;
+ private String link;
+ private List<Entry> entries;
+
+ public String getUid()
+ {
+ return uid;
+ }
+
+ public void setUid(String uid)
+ {
+ this.uid = uid;
+ }
+
+ public String getTitle()
+ {
+ return title;
+ }
+
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+
+ public String getSubtitle()
+ {
+ return subtitle;
+ }
+
+ public void setSubtitle(String subtitle)
+ {
+ this.subtitle = subtitle;
+ }
+
+ public Date getUpdated()
+ {
+ return updated;
+ }
+
+ public void setUpdated(Date updated)
+ {
+ this.updated = updated;
+ }
+
+ public String getLink()
+ {
+ return link;
+ }
+
+ public void setLink(String link)
+ {
+ this.link = link;
+ }
+
+ public List<Entry> getEntries()
+ {
+ return entries;
+ }
+
+ public void setEntries(List<Entry> entries)
+ {
+ this.entries = entries;
+ }
+
+}
Added: trunk/examples/rss/src/org/jboss/seam/rss/RSSTest.java
===================================================================
--- trunk/examples/rss/src/org/jboss/seam/rss/RSSTest.java (rev
0)
+++ trunk/examples/rss/src/org/jboss/seam/rss/RSSTest.java 2008-09-22 05:52:13 UTC (rev
9084)
@@ -0,0 +1,39 @@
+package org.jboss.seam.excel;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+@Name("rssTest")
+(a)Scope(ScopeType.SESSION)
+public class RSSTest
+{
+ private Feed feed;
+ private List<Entry> entries;
+
+ @Create
+ public void create()
+ {
+ feed = new Feed();
+ entries = new ArrayList<Entry>();
+ for (int i = 0; i < 5; i++) {
+ Entry entry = new Entry();
+ entires.add(entry);
+ }
+ }
+
+ public Feed getFeed() {
+ return feed;
+ }
+
+ public List<Entry> getEntries() {
+ return entries;
+ }
+
+}
Added: trunk/examples/rss/src/org/jboss/seam/rss/test/testng.xml
===================================================================
--- trunk/examples/rss/src/org/jboss/seam/rss/test/testng.xml (rev
0)
+++ trunk/examples/rss/src/org/jboss/seam/rss/test/testng.xml 2008-09-22 05:52:13 UTC (rev
9084)
@@ -0,0 +1,10 @@
+<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
+
+<suite name="RSS" verbose="2" parallel="false">
+
+ <test name="RSS Tests">
+ <classes>
+ </classes>
+ </test>
+
+</suite>
\ No newline at end of file
Added: trunk/examples/rss/view/index.html
===================================================================
--- trunk/examples/rss/view/index.html (rev 0)
+++ trunk/examples/rss/view/index.html 2008-09-22 05:52:13 UTC (rev 9084)
@@ -0,0 +1,5 @@
+<html>
+<head>
+ <meta http-equiv="Refresh" content="0; URL=rss.seam">
+</head>
+</html>
\ No newline at end of file
Added: trunk/examples/rss/view/rss.xhtml
===================================================================
--- trunk/examples/rss/view/rss.xhtml (rev 0)
+++ trunk/examples/rss/view/rss.xhtml 2008-09-22 05:52:13 UTC (rev 9084)
@@ -0,0 +1,21 @@
+<r:feed
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:r="http://jboss.com/products/seam/rss"
+ title="#{rss.feed.title}"
+ uid="#{rss.feed.uid}"
+ subtitle="#{rss.feed.subtitle}"
+ updated="#{rss.feed.updated}"
+ link="#{rss.feed.link}">
+ <ui:repeat value="#{rss.feed.entries}" var="entry">
+ <r:entry
+ uid="#{entry.uid}"
+ title="#{entry.title}"
+ link="#{entry.link}"
+ author="#{entry.author}"
+ summary="#{entry.summary}"
+ published="#{entry.published}"
+ updated="#{entry.updated}"
+ />
+ </ui:repeat>
+</r:feed>