Author: alexsmirnov
Date: 2007-09-04 18:55:44 -0400 (Tue, 04 Sep 2007)
New Revision: 2747
Added:
trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/Media.java
trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/MediaBean.java
trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/MediaData.java
trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/PageDescriptionBean.java
trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/PagesBean.java
trunk/samples/seamIntegration/src/main/webapp/index.jsp
trunk/samples/seamIntegration/src/main/webapp/pages/mediaOutput.xhtml
Removed:
trunk/samples/seamIntegration/src/main/webapp/home.xhtml
trunk/samples/seamIntegration/src/main/webapp/index.html
trunk/samples/seamIntegration/src/main/webapp/index.jsp
trunk/samples/seamIntegration/src/main/webapp/layout/display.xhtml
trunk/samples/seamIntegration/src/main/webapp/layout/edit.xhtml
trunk/samples/seamIntegration/src/main/webapp/layout/loginout.xhtml
trunk/samples/seamIntegration/src/main/webapp/layout/menu.xhtml
trunk/samples/seamIntegration/src/main/webapp/layout/template.xhtml
trunk/samples/seamIntegration/src/main/webapp/login.page.xml
trunk/samples/seamIntegration/src/main/webapp/login.xhtml
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/resource/ResourceLifecycle.java
trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
trunk/samples/seamIntegration/pom.xml
trunk/samples/seamIntegration/src/main/webapp/WEB-INF/components.xml
trunk/samples/seamIntegration/src/main/webapp/WEB-INF/pages.xml
trunk/samples/seamIntegration/src/main/webapp/WEB-INF/web.xml
Log:
Fix exception from seam pdf library during send facesContext-requuried resources.
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/resource/ResourceLifecycle.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/resource/ResourceLifecycle.java 2007-09-04
21:15:09 UTC (rev 2746)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/resource/ResourceLifecycle.java 2007-09-04
22:55:44 UTC (rev 2747)
@@ -25,15 +25,18 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import java.util.Locale;
import javax.faces.FacesException;
import javax.faces.FactoryFinder;
+import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
import javax.faces.lifecycle.Lifecycle;
import javax.faces.lifecycle.LifecycleFactory;
+import javax.faces.render.RenderKitFactory;
import javax.servlet.ServletException;
import org.ajax4jsf.resource.InternetResource;
@@ -132,6 +135,12 @@
}
}
}
+ // create "dummy" viewRoot, to avoid problems in phase listeners.
+ UIViewRoot root = new UIViewRoot();
+ root.setViewId(resource.getKey());
+ root.setLocale(Locale.getDefault());
+ root.setRenderKitId(RenderKitFactory.HTML_BASIC_RENDER_KIT);
+ facesContext.setViewRoot(root);
// Invoke after restore view phase listeners
for (int i = phaseListeners.length - 1; i > 0; i--) {
PhaseListener phaseListener = phaseListeners[i];
Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2007-09-04 21:15:09 UTC
(rev 2746)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js 2007-09-04 22:55:44 UTC
(rev 2747)
@@ -734,10 +734,6 @@
A4J.AJAX.replaceViewState(inputs,newinputs);
}
- if ((typeof Event != "undefined") && (typeof
Event.unloadElementsCache === "function")) {
- Event.unloadElementsCache();
- }
-
// Process listeners.
for(var li = 0; li < A4J.AJAX._listeners.length; li++){
var listener = A4J.AJAX._listeners[li];
@@ -874,6 +870,11 @@
*/
A4J.AJAX.finishRequest = function(request){
var options = request.options;
+ // Remove unload prototype events for a removed elements.
+ if ((typeof Event != "undefined") && (typeof
Event.unloadElementsCache == "function")) {
+ Event.unloadElementsCache();
+ }
+
// we can set listener for complete request - for example,
// it can shedule next request for update page.
var oncomplete = request.getElementById('org.ajax4jsf.oncomplete');
@@ -894,14 +895,14 @@
}
// mark status object ( if any ) for complete request ;
A4J.AJAX.status(request.containerId,options.status,false);},
- 50);
+ 10);
} else if(options.oncomplete){
LOG.debug( "Call component oncomplete function after processing updates"
);
window.setTimeout(function(){
options.oncomplete(request,request.domEvt,request.getJSON('_ajax:data'));
// mark status object ( if any ) for complete request ;
A4J.AJAX.status(request.containerId,options.status,false);},
- 50);
+ 10);
} else {
// mark status object ( if any ) for complete request ;
Modified: trunk/samples/seamIntegration/pom.xml
===================================================================
--- trunk/samples/seamIntegration/pom.xml 2007-09-04 21:15:09 UTC (rev 2746)
+++ trunk/samples/seamIntegration/pom.xml 2007-09-04 22:55:44 UTC (rev 2747)
@@ -38,6 +38,9 @@
<include>
jboss-seam-remoting.jar
</include>
+ <include>
+ jboss-seam-pdf.jar
+ </include>
</includes>
</resource>
<resource>
@@ -69,6 +72,27 @@
</dependency>
<dependency>
<groupId>jboss</groupId>
+ <artifactId>seam-debug</artifactId>
+ <version>2.0.0.BETA</version>
+ <scope>system</scope>
+ <systemPath>${seamHome}/jboss-seam-debug.jar</systemPath>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>seam-remoting</artifactId>
+ <version>2.0.0.BETA</version>
+ <scope>system</scope>
+ <systemPath>${seamHome}/jboss-seam-remoting.jar</systemPath>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>seam-pdf</artifactId>
+ <version>2.0.0.BETA</version>
+ <scope>system</scope>
+ <systemPath>${seamHome}/jboss-seam-pdf.jar</systemPath>
+ </dependency>
+ <dependency>
+ <groupId>jboss</groupId>
<artifactId>jboss-el</artifactId>
<version>2.0.0.BETA</version>
<scope>system</scope>
@@ -96,9 +120,19 @@
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ <version>3.2.4.ga</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>3.0.0.ga</version>
</dependency>
+ <dependency>
+ <groupId>jstl</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.2</version>
+ </dependency>
</dependencies>
</project>
Added: trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/Media.java
===================================================================
--- trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/Media.java
(rev 0)
+++ trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/Media.java 2007-09-04
22:55:44 UTC (rev 2747)
@@ -0,0 +1,17 @@
+package org.ajax4jsf;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+
+public interface Media {
+
+ public void paint(OutputStream out, Object data) throws IOException;
+
+ public void initData();
+
+ public void setData(MediaData data);
+
+ public MediaData getData();
+
+}
Property changes on: trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/Media.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/MediaBean.java
===================================================================
--- trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/MediaBean.java
(rev 0)
+++ trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/MediaBean.java 2007-09-04
22:55:44 UTC (rev 2747)
@@ -0,0 +1,62 @@
+package org.ajax4jsf;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.io.OutputStream;
+
+import javax.imageio.ImageIO;
+
+import org.jboss.seam.annotations.Factory;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+
+
+@Name("media")
+public class MediaBean implements Media {
+
+ private MediaData data;
+
+ /**
+ * @return the data
+ */
+ @Out
+ public MediaData getData() {
+ return data;
+ }
+
+ /**
+ * @param data the data to set
+ */
+ public void setData(MediaData data) {
+ this.data = data;
+ }
+
+ @Factory(value="data")
+ public void initData(){
+ data= new MediaData();
+ data.setWidth(100);
+ data.setHeight(100);
+ data.setBackground(Color.BLUE);
+ data.setDrawColor(Color.RED);
+ }
+
+ public void paint(OutputStream out, Object data) throws IOException{
+ if (data instanceof MediaData) {
+
+ MediaData paintData = (MediaData) data;
+ BufferedImage img = new
BufferedImage(paintData.getWidth(),paintData.getHeight(),BufferedImage.TYPE_INT_RGB);
+ Graphics2D graphics2D = img.createGraphics();
+ graphics2D.setBackground(paintData.getBackground());
+ graphics2D.setColor(paintData.getDrawColor());
+ graphics2D.clearRect(0,0,paintData.getWidth(),paintData.getHeight());
+ graphics2D.drawLine(5,5,paintData.getWidth()-5,paintData.getHeight()-5);
+ graphics2D.drawChars(new String("RichFaces").toCharArray(),0,9,40,15);
+ graphics2D.drawChars(new String("mediaOutput").toCharArray(),0,11,5,45);
+
+ ImageIO.write(img,"jpeg",out);
+
+ }
+ }
+}
\ No newline at end of file
Property changes on:
trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/MediaBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/MediaData.java
===================================================================
--- trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/MediaData.java
(rev 0)
+++ trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/MediaData.java 2007-09-04
22:55:44 UTC (rev 2747)
@@ -0,0 +1,39 @@
+package org.ajax4jsf;
+
+import java.awt.Color;
+import java.io.Serializable;
+
+public class MediaData implements Serializable{
+
+ private static final long serialVersionUID = 1L;
+ Integer Width=110;
+ Integer Height=50;
+ Color Background=new Color(0,0,0);
+ Color DrawColor=new Color(255,255,255);
+ public MediaData() {
+ }
+ public Color getBackground() {
+ return Background;
+ }
+ public void setBackground(Color background) {
+ Background = background;
+ }
+ public Color getDrawColor() {
+ return DrawColor;
+ }
+ public void setDrawColor(Color drawColor) {
+ DrawColor = drawColor;
+ }
+ public Integer getHeight() {
+ return Height;
+ }
+ public void setHeight(Integer height) {
+ Height = height;
+ }
+ public Integer getWidth() {
+ return Width;
+ }
+ public void setWidth(Integer width) {
+ Width = width;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/MediaData.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/PageDescriptionBean.java
===================================================================
--- trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/PageDescriptionBean.java
(rev 0)
+++
trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/PageDescriptionBean.java 2007-09-04
22:55:44 UTC (rev 2747)
@@ -0,0 +1,44 @@
+/**
+ *
+ */
+package org.ajax4jsf;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class PageDescriptionBean {
+
+ private String _path;
+
+ private String _title;
+
+ /**
+ * @return the path
+ */
+ public String getPath() {
+ return _path;
+ }
+
+ /**
+ * @param path the path to set
+ */
+ public void setPath(String path) {
+ _path = path;
+ }
+
+ /**
+ * @return the title
+ */
+ public String getTitle() {
+ return _title;
+ }
+
+ /**
+ * @param title the title to set
+ */
+ public void setTitle(String title) {
+ _title = title;
+ }
+
+}
Property changes on:
trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/PageDescriptionBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Added: trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/PagesBean.java
===================================================================
--- trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/PagesBean.java
(rev 0)
+++ trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/PagesBean.java 2007-09-04
22:55:44 UTC (rev 2747)
@@ -0,0 +1,125 @@
+/**
+ *
+ */
+package org.ajax4jsf;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.servlet.ServletContext;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class PagesBean {
+
+ private static final Pattern JSP_PATTERN = Pattern.compile(".*\\.jspx?");
+
+ private static final Pattern XHTML_PATTERN = Pattern.compile(".*\\.xhtml");
+
+ private static final Pattern TITLE_PATTERN =
Pattern.compile("<title>(.*)</title>",Pattern.CASE_INSENSITIVE|Pattern.MULTILINE);
+
+ private ServletContext _servletContext;
+
+ private List<PageDescriptionBean> _jspPages;
+
+ private String _path;
+
+ private List<PageDescriptionBean> _xhtmlPages;
+
+ /**
+ * @return the path
+ */
+ public String getPath() {
+ return _path;
+ }
+
+ /**
+ * @param path
+ * the path to set
+ */
+ public void setPath(String path) {
+ _path = path;
+ }
+
+ /**
+ * @return the servletContext
+ */
+ public ServletContext getServletContext() {
+ return _servletContext;
+ }
+
+ /**
+ * @param servletContext
+ * the servletContext to set
+ */
+ public void setServletContext(ServletContext servletContext) {
+ _servletContext = servletContext;
+ }
+
+ public List<PageDescriptionBean> getJspPages() {
+ if (_jspPages == null && null != getServletContext()) {
+ _jspPages = getPagesByPattern(JSP_PATTERN);
+ }
+
+ return _jspPages;
+ }
+
+ public List<PageDescriptionBean> getXhtmlPages() {
+ if (_xhtmlPages == null && null != getServletContext()) {
+ _xhtmlPages = getPagesByPattern(XHTML_PATTERN);
+ }
+
+ return _xhtmlPages;
+ }
+
+ /**
+ *
+ */
+ private List<PageDescriptionBean> getPagesByPattern(Pattern pattern) {
+ List<PageDescriptionBean> jspPages = new ArrayList<PageDescriptionBean>();
+ Set resourcePaths = getServletContext().getResourcePaths(getPath());
+ for (Iterator iterator = resourcePaths.iterator(); iterator
+ .hasNext();) {
+ String page = (String) iterator.next();
+ if (pattern.matcher(page).matches()) {
+ PageDescriptionBean pageBean = new PageDescriptionBean();
+ pageBean.setPath(page);
+ InputStream pageInputStream = getServletContext().getResourceAsStream(page);
+ if(null != pageInputStream){
+ byte[] head = new byte[1024];
+ try {
+ int readed = pageInputStream.read(head);
+ String headString = new String(head,0,readed);
+ Matcher titleMatcher = TITLE_PATTERN.matcher(headString);
+ if(titleMatcher.find() && titleMatcher.group(1).length()>0){
+ pageBean.setTitle(titleMatcher.group(1));
+ } else {
+ pageBean.setTitle(page);
+ }
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } finally {
+ try {
+ pageInputStream.close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+ jspPages.add(pageBean);
+ }
+ }
+ return jspPages;
+ }
+
+}
Property changes on:
trunk/samples/seamIntegration/src/main/java/org/ajax4jsf/PagesBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Modified: trunk/samples/seamIntegration/src/main/webapp/WEB-INF/components.xml
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/WEB-INF/components.xml 2007-09-04
21:15:09 UTC (rev 2746)
+++ trunk/samples/seamIntegration/src/main/webapp/WEB-INF/components.xml 2007-09-04
22:55:44 UTC (rev 2747)
@@ -47,7 +47,8 @@
<mail:mail-session host="localhost" port="2525"
username="test" password="test" />
- --><!-- For use with jBPM pageflow or process management -->
+ -->
+ <!-- For use with jBPM pageflow or process management -->
<!--
<bpm:jbpm>
<bpm:process-definitions></bpm:process-definitions>
Modified: trunk/samples/seamIntegration/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/WEB-INF/pages.xml 2007-09-04 21:15:09
UTC (rev 2746)
+++ trunk/samples/seamIntegration/src/main/webapp/WEB-INF/pages.xml 2007-09-04 22:55:44
UTC (rev 2747)
@@ -2,18 +2,9 @@
<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"
+>
- no-conversation-view-id="/home.xhtml"
- login-view-id="/login.xhtml">
- <page view-id="*">
- <navigation>
- <rule if-outcome="home">
- <redirect view-id="/home.xhtml"/>
- </rule>
- </navigation>
- </page>
-
<exception class="org.jboss.seam.framework.EntityNotFoundException">
<redirect view-id="/error.xhtml">
<message>Not found</message>
@@ -39,11 +30,6 @@
</redirect>
</exception>
- <exception class="org.jboss.seam.security.NotLoggedInException">
- <redirect view-id="/login.xhtml">
- <message>Please log in first</message>
- </redirect>
- </exception>
<exception>
<redirect view-id="/error.xhtml">
Modified: trunk/samples/seamIntegration/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/WEB-INF/web.xml 2007-09-04 21:15:09 UTC
(rev 2746)
+++ trunk/samples/seamIntegration/src/main/webapp/WEB-INF/web.xml 2007-09-04 22:55:44 UTC
(rev 2747)
@@ -1,81 +1,94 @@
<?xml version="1.0" ?>
<web-app
xmlns="http://java.sun.com/xml/ns/j2ee"
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
- version="2.4">
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
- <!-- Ajax4jsf -->
-
- <context-param>
- <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
- <param-value>com.sun.facelets.FaceletViewHandler</param-value>
- </context-param>
-
- <context-param>
- <param-name>org.ajax4jsf.SKIN</param-name>
- <param-value>blueSky</param-value>
- </context-param>
-
- <!-- Seam -->
-
- <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>
+ <!-- Ajax4jsf -->
- <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>
-
- <!-- Facelets development mode (disable in production) -->
-
- <context-param>
- <param-name>facelets.DEVELOPMENT</param-name>
- <param-value>true</param-value>
- </context-param>
-
- <!-- JSF -->
-
- <context-param>
- <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
- <param-value>.xhtml</param-value>
- </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
+ <param-value>com.sun.facelets.FaceletViewHandler</param-value>
+ </context-param>
- <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>
-
- <security-constraint>
- <display-name>Restrict raw XHTML Documents</display-name>
- <web-resource-collection>
- <web-resource-name>XHTML</web-resource-name>
- <url-pattern>*.xhtml</url-pattern>
- </web-resource-collection>
- <auth-constraint>
- <role-name>NONE</role-name>
- </auth-constraint>
- </security-constraint>
-
+ <context-param>
+ <param-name>org.ajax4jsf.SKIN</param-name>
+ <param-value>blueSky</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.VIEW_MAPPINGS</param-name>
+ <param-value>*.xhtml</param-value>
+ </context-param>
+
+ <!-- Seam -->
+
+ <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>
+
+ <!-- Facelets development mode (disable in production) -->
+
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <!-- JSF -->
+
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+
+ <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>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+
+ <security-constraint>
+ <display-name>Restrict raw XHTML Documents</display-name>
+ <web-resource-collection>
+ <web-resource-name>XHTML</web-resource-name>
+ <url-pattern>*.xhtml</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>NONE</role-name>
+ </auth-constraint>
+ </security-constraint>
+
</web-app>
Deleted: trunk/samples/seamIntegration/src/main/webapp/home.xhtml
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/home.xhtml 2007-09-04 21:15:09 UTC (rev
2746)
+++ trunk/samples/seamIntegration/src/main/webapp/home.xhtml 2007-09-04 22:55:44 UTC (rev
2747)
@@ -1,31 +0,0 @@
-<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:s="http://jboss.com/products/seam/taglib"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:rich="http://richfaces.org/rich"
- template="layout/template.xhtml">
-
-<ui:define name="body">
-
- <h:messages globalOnly="true" styleClass="message"/>
-
- <rich:panel>
- <f:facet name="header">Welcome!</f:facet>
- <p>This empty shell application includes:</p>
- <ul>
- <li>Ant build script</li>
- <li>Deployment to JBoss AS</li>
- <li>Integration testing using TestNG and JBoss Embeddable EJB3</li>
- <li>EJB 3.0 Seam components</li>
- <li>Templated Facelets views</li>
- <li>HSQL (or MySQL) Datasource</li>
- <li>Default CSS stylesheet</li>
- <li>Internationalization support</li>
- </ul>
- </rich:panel>
-
-</ui:define>
-</ui:composition>
Deleted: trunk/samples/seamIntegration/src/main/webapp/index.html
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/index.html 2007-09-04 21:15:09 UTC (rev
2746)
+++ trunk/samples/seamIntegration/src/main/webapp/index.html 2007-09-04 22:55:44 UTC (rev
2747)
@@ -1,5 +0,0 @@
-<html>
-<head>
- <meta http-equiv="Refresh" content="0; URL=home.seam">
-</head>
-</html>
\ No newline at end of file
Deleted: trunk/samples/seamIntegration/src/main/webapp/index.jsp
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/index.jsp 2007-09-04 21:15:09 UTC (rev
2746)
+++ trunk/samples/seamIntegration/src/main/webapp/index.jsp 2007-09-04 22:55:44 UTC (rev
2747)
@@ -1,11 +0,0 @@
-<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
-
-<html>
-
-<head></head>
-
- <body>
- <jsp:forward page="/pages/index.jsf" />
- </body>
-
-</html>
\ No newline at end of file
Added: trunk/samples/seamIntegration/src/main/webapp/index.jsp
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/index.jsp (rev
0)
+++ trunk/samples/seamIntegration/src/main/webapp/index.jsp 2007-09-04 22:55:44 UTC (rev
2747)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<%@ taglib
uri="http://java.sun.com/jsp/jstl/core"
+ prefix="c" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
/>
+<title>Richfaces examples and tests</title>
+</head>
+<body>
+<jsp:useBean id="pages" scope="application"
class="org.ajax4jsf.PagesBean">
+ <jsp:setProperty name="pages" property="servletContext"
value="${pageContext.servletContext}"/>
+ <jsp:setProperty name="pages" property="path"
value="/pages"/>
+</jsp:useBean>
+<h2>JSF pages</h2>
+<ul>
+<c:forEach var="page" items="${pages.jspPages}">
+ <li><a
href="${pageContext.request.contextPath}/faces${page.path}">${page.title}</a></li>
+</c:forEach>
+</ul>
+<h2>Facelets pages</h2>
+<ul>
+<c:forEach var="page" items="${pages.xhtmlPages}">
+ <li><a
href="${pageContext.request.contextPath}/faces${page.path}">${page.title}</a></li>
+</c:forEach>
+</ul>
+</body>
+</html>
\ No newline at end of file
Property changes on: trunk/samples/seamIntegration/src/main/webapp/index.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/samples/seamIntegration/src/main/webapp/layout/display.xhtml
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/layout/display.xhtml 2007-09-04 21:15:09
UTC (rev 2746)
+++ trunk/samples/seamIntegration/src/main/webapp/layout/display.xhtml 2007-09-04 22:55:44
UTC (rev 2747)
@@ -1,16 +0,0 @@
-<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:s="http://jboss.com/products/seam/taglib">
-
- <div class="prop">
- <span class="name">
- <ui:insert name="label"/>
- </span>
- <span class="value">
- <ui:insert/>
- </span>
- </div>
-
-</ui:composition>
\ No newline at end of file
Deleted: trunk/samples/seamIntegration/src/main/webapp/layout/edit.xhtml
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/layout/edit.xhtml 2007-09-04 21:15:09
UTC (rev 2746)
+++ trunk/samples/seamIntegration/src/main/webapp/layout/edit.xhtml 2007-09-04 22:55:44
UTC (rev 2747)
@@ -1,24 +0,0 @@
-<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:s="http://jboss.com/products/seam/taglib">
-
- <div class="prop">
-
- <s:label styleClass="name
#{invalid?'errors':''}">
- <ui:insert name="label"/>
- <s:span styleClass="required"
rendered="#{required}">*</s:span>
- </s:label>
-
- <span class="value #{invalid?'errors':''}">
- <s:validateAll>
- <ui:insert/>
- </s:validateAll>
- </span>
-
- <s:message styleClass="error errors"/>
-
- </div>
-
-</ui:composition>
\ No newline at end of file
Deleted: trunk/samples/seamIntegration/src/main/webapp/layout/loginout.xhtml
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/layout/loginout.xhtml 2007-09-04
21:15:09 UTC (rev 2746)
+++ trunk/samples/seamIntegration/src/main/webapp/layout/loginout.xhtml 2007-09-04
22:55:44 UTC (rev 2747)
@@ -1,12 +0,0 @@
-<div class="loginout"
-
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:s="http://jboss.com/products/seam/taglib">
- <h:outputText value="Welcome, #{identity.username}"
rendered="#{identity.loggedIn}"/>
-  | 
- <s:link view="/login.xhtml" value="Login"
rendered="#{not identity.loggedIn}"/>
- <s:link view="/home.xhtml" action="#{identity.logout}"
value="Logout" rendered="#{identity.loggedIn}"/>
- |
-</div>
Deleted: trunk/samples/seamIntegration/src/main/webapp/layout/menu.xhtml
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/layout/menu.xhtml 2007-09-04 21:15:09
UTC (rev 2746)
+++ trunk/samples/seamIntegration/src/main/webapp/layout/menu.xhtml 2007-09-04 22:55:44
UTC (rev 2747)
@@ -1,17 +0,0 @@
-<rich:toolBar
-
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:s="http://jboss.com/products/seam/taglib"
-
xmlns:rich="http://richfaces.org/rich">
- <rich:toolBarGroup>
- <h:outputText value="#{projectName}:"/>
- <s:link view="/home.xhtml" value="Home"/>
- </rich:toolBarGroup>
- <rich:toolBarGroup location="right">
- <h:outputText value="Welcome, #{identity.username}"
rendered="#{identity.loggedIn}"/>
- <s:link view="/login.xhtml" value="Login"
rendered="#{not identity.loggedIn}"/>
- <s:link view="/home.xhtml" action="#{identity.logout}"
value="Logout" rendered="#{identity.loggedIn}"/>
- </rich:toolBarGroup>
-</rich:toolBar>
Deleted: trunk/samples/seamIntegration/src/main/webapp/layout/template.xhtml
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/layout/template.xhtml 2007-09-04
21:15:09 UTC (rev 2746)
+++ trunk/samples/seamIntegration/src/main/webapp/layout/template.xhtml 2007-09-04
22:55:44 UTC (rev 2747)
@@ -1,30 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:s="http://jboss.com/products/seam/taglib">
-<head>
- <meta http-equiv="Content-Type" content="text/html;
charset=UTF-8" />
- <title>seamIntegration</title>
- <link href="stylesheet/theme.css" rel="stylesheet"
type="text/css" />
-</head>
-
-<body>
-
- <ui:include src="menu.xhtml">
- <ui:param name="projectName" value="seamIntegration"/>
- </ui:include>
-
- <div class="body">
- <ui:insert name="body"/>
- </div>
-
- <div class="footer">
- Powered by <a
href="http://jboss.com/products/seam">Seam</a>.
- Generated by seam-gen.
- </div>
-
-</body>
-</html>
Deleted: trunk/samples/seamIntegration/src/main/webapp/login.page.xml
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/login.page.xml 2007-09-04 21:15:09 UTC
(rev 2746)
+++ trunk/samples/seamIntegration/src/main/webapp/login.page.xml 2007-09-04 22:55:44 UTC
(rev 2747)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<page
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">
-
- <navigation from-action="#{identity.login}">
- <rule if="#{identity.loggedIn}">
- <redirect view-id="/home.xhtml"/>
- </rule>
- </navigation>
-
-</page>
Deleted: trunk/samples/seamIntegration/src/main/webapp/login.xhtml
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/login.xhtml 2007-09-04 21:15:09 UTC (rev
2746)
+++ trunk/samples/seamIntegration/src/main/webapp/login.xhtml 2007-09-04 22:55:44 UTC (rev
2747)
@@ -1,45 +0,0 @@
-<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:s="http://jboss.com/products/seam/taglib"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:rich="http://richfaces.org/rich"
- template="layout/template.xhtml">
-
-<ui:define name="body">
-
- <h:messages styleClass="message"/>
-
- <h:form id="login">
-
- <rich:panel>
- <f:facet name="header">Login</f:facet>
-
- <p>Please login using any username and password</p>
-
- <div class="dialog">
- <h:panelGrid columns="2" rowClasses="prop"
columnClasses="name,value">
- <h:outputLabel
for="username">Username</h:outputLabel>
- <h:inputText id="username"
- value="#{identity.username}"/>
- <h:outputLabel
for="password">Password</h:outputLabel>
- <h:inputSecret id="password"
- value="#{identity.password}"/>
- <h:outputLabel for="rememberMe">Remember
me</h:outputLabel>
- <h:selectBooleanCheckbox id="rememberMe"
- value="#{identity.rememberMe}"/>
- </h:panelGrid>
- </div>
-
- </rich:panel>
-
- <div class="actionButtons">
- <h:commandButton value="Login"
action="#{identity.login}"/>
- </div>
-
- </h:form>
-
- </ui:define>
-</ui:composition>
Added: trunk/samples/seamIntegration/src/main/webapp/pages/mediaOutput.xhtml
===================================================================
--- trunk/samples/seamIntegration/src/main/webapp/pages/mediaOutput.xhtml
(rev 0)
+++ trunk/samples/seamIntegration/src/main/webapp/pages/mediaOutput.xhtml 2007-09-04
22:55:44 UTC (rev 2747)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:s="http://jboss.com/products/seam/taglib"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:f="http://java.sun.com/jsf/core">
+
+ <head>
+ <title>Paint image in a4j:mediaOutput</title>
+ </head>
+ <body>
+ <f:view>
+ <h:form>
+ <h:panelGrid columns="2">
+ Width: <h:inputText value="#{data.width}"
required="true"/>
+ Height: <h:inputText value="#{data.height}"
required="true"/>
+ </h:panelGrid>
+ <a4j:mediaOutput mimeType="image/jpeg"
createContent="#{media.paint}" session="true"
value="#{data}"
+ cacheable="false" uriAttribute="src"
element="img" style="width:#{data.width};height:#{data.height}"/>
+ <h:messages/>
+ <h:commandButton value="Paint" />
+ </h:form>
+ </f:view>
+ </body>
+
+</html>
\ No newline at end of file
Property changes on:
trunk/samples/seamIntegration/src/main/webapp/pages/mediaOutput.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain