Author: lfryc(a)redhat.com
Date: 2010-07-10 14:18:32 -0400 (Sat, 10 Jul 2010)
New Revision: 17823
Added:
root/tests/metamer/trunk/src/main/webapp/templates/blueDiv.xhtml
root/tests/metamer/trunk/src/main/webapp/templates/redDiv.xhtml
root/tests/metamer/trunk/src/main/webapp/templates/richDataTable1.xhtml
root/tests/metamer/trunk/src/main/webapp/templates/richDataTable2.xhtml
Removed:
root/tests/metamer/trunk/src/main/webapp/templates/blue_div.xhtml
root/tests/metamer/trunk/src/main/webapp/templates/red_div.xhtml
Modified:
root/tests/metamer/trunk/pom.xml
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/Attributes.java
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/Template.java
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/TemplatesList.java
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JCommandButtonBean.java
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JCommandLinkBean.java
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/RichBean.java
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/TemplateBean.java
root/tests/metamer/trunk/src/main/webapp/WEB-INF/web.xml
root/tests/metamer/trunk/src/main/webapp/index.xhtml
root/tests/metamer/trunk/src/main/webapp/templates/template.xhtml
root/tests/metamer/trunk/src/test/java/org/richfaces/testapp/TemplatesListTest.java
Log:
https://jira.jboss.org/browse/RFPL-466
* pom.xml refactored to use RichFaces' module examples as parent and to use it's
profiles to build binaries
* TemplateBean - removed unnecessary attributes and methods
* HtmlCommandLink and HtmlCommandButton changed to UICommandLink and UICommandButton
* templating refactored
* added two new templates - rich data table (line 1 and 2)
* added css style to main page
Modified: root/tests/metamer/trunk/pom.xml
===================================================================
--- root/tests/metamer/trunk/pom.xml 2010-07-10 18:17:29 UTC (rev 17822)
+++ root/tests/metamer/trunk/pom.xml 2010-07-10 18:18:32 UTC (rev 17823)
@@ -1,145 +1,143 @@
<?xml version="1.0" encoding="UTF-8"?>
-
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <!-- <parent>-->
- <!-- <artifactId>examples</artifactId>-->
- <!-- <groupId>org.richfaces</groupId>-->
- <!-- <version>4.0.0-SNAPSHOT</version>-->
- <!-- </parent>-->
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.testapps</groupId>
+
+ <parent>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>examples-aggregator</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </parent>
+
+
+ <groupId>org.richfaces.examples</groupId>
<artifactId>testapp</artifactId>
<packaging>war</packaging>
<name>RichFaces Testing Application</name>
- <version>4.0.0-SNAPSHOT</version>
- <repositories>
- <repository>
- <id>repository.jboss.org</id>
- <name>JBoss Repository for Maven</name>
- <
url>http://repository.jboss.org/maven2</url>
- </repository>
- <repository>
- <id>snapshots.jboss.org</id>
- <name>JBoss Snapshots Repository for Maven</name>
- <
url>http://snapshots.jboss.org/maven2</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- <repository>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <id>maven-repository2.dev.java.net</id>
- <
name>Java.net Repository for Maven 2</name>
- <
url>http://download.java.net/maven/2</url>
- </repository>
- </repositories>
-
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui-core-ui</artifactId>
+ </dependency>
+ <!--<dependency>
<groupId>org.richfaces.ui.components</groupId>
<artifactId>core-ui</artifactId>
<version>4.0.0-SNAPSHOT</version>
- </dependency>
+ </dependency>-->
+ <!--<dependency>
+ <groupId>org.richfaces.ui.iteration</groupId>
+ <artifactId>datascroller-ui</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
+ </dependency>-->
<dependency>
- <groupId>org.testng</groupId>
- <artifactId>testng</artifactId>
- <version>5.9</version>
- <scope>test</scope>
+ <groupId>org.richfaces.ui-sandbox</groupId>
+ <artifactId>tables-ui</artifactId>
+ <version>4.0.0-SNAPSHOT</version>
</dependency>
+
<dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>2.0.2</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.sun.faces</groupId>
- <artifactId>jsf-impl</artifactId>
- <version>2.0.2</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
- <version>1.5.11</version>
- <type>jar</type>
- <scope>provided</scope>
</dependency>
+ <!--<dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>-->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
- <version>1.5.11</version>
- <type>jar</type>
- <scope>provided</scope>
</dependency>
+
<dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-jcl</artifactId>
- <version>1.5.11</version>
- <type>jar</type>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.9</version>
+ <scope>test</scope>
</dependency>
- <dependency>
+
+
+ <!--<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.0.2.GA</version>
<type>jar</type>
<scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
+ </dependency>-->
+
+ <dependency>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ <version>2.2</version>
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>javax.el</groupId>
- <artifactId>el-api</artifactId>
- <version>1.2</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.el</groupId>
- <artifactId>jboss-el</artifactId>
- <version>1.0_02.CR5</version>
- </dependency>
+ <groupId>org.glassfish.web</groupId>
+ <artifactId>el-impl</artifactId>
+ <version>2.2</version>
+ <scope>runtime</scope>
+ </dependency>
+
</dependencies>
<build>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.6</source>
- <target>1.6</target>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-beta-5</version>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <descriptors>
-
<descriptor>src/main/assembly/tomcat6-assembly.xml</descriptor>
- </descriptors>
- </configuration>
- </plugin>
- </plugins>
+ <finalName>testapp</finalName>
</build>
+ <profiles>
+ <profile>
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>jee5</id>
+ <phase>package</phase>
+ <goals>
+ <goal>war</goal>
+ </goals>
+ <configuration>
+
<webappDirectory>${project.build.directory}/${project.build.finalName}-jee5
+ </webappDirectory>
+ <classifier>jee5</classifier>
+
<packagingExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*,WEB-INF/lib/jta-*
+ </packagingExcludes>
+
<warSourceExcludes>WEB-INF/lib/jsf-api*,WEB-INF/lib/jsf-impl*,WEB-INF/lib/jta-*
+ </warSourceExcludes>
+ </configuration>
+ </execution>
+ </executions>
+ <configuration>
+ <classifier>tomcat6</classifier>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>jee5</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+
<webappDirectory>${project.build.directory}/${project.build.finalName}-jee5
+ </webappDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+
</project>
+
+
Modified: root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/Attributes.java
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/Attributes.java 2010-07-10
18:17:29 UTC (rev 17822)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/Attributes.java 2010-07-10
18:18:32 UTC (rev 17823)
@@ -354,7 +354,7 @@
if (hasSelectOptions("action")) {
method = ExpressionFactory.newInstance().createMethodExpression(elContext,
getMethodEL(outcome), String.class,
new Class[0]);
-
+
return (String) method.invoke(elContext, null);
}
Modified: root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/Template.java
===================================================================
--- root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/Template.java 2010-07-10
18:17:29 UTC (rev 17822)
+++ root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/Template.java 2010-07-10
18:18:32 UTC (rev 17823)
@@ -1,23 +1,25 @@
-/**
- * License Agreement.
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
*
- * JBoss RichFaces - Ajax4jsf Component Library
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
*
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
+ * This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+
package org.richfaces.testapp;
/**
@@ -27,8 +29,10 @@
*/
public enum Template {
PLAIN ("plain", "", "Plain"),
- RED_DIV ("red_div", "", "Red div"),
- BLUE_DIV ("blue_div", "", "Blue div");
+ REDDIV ("redDiv", "", "Red div"),
+ BLUEDIV ("blueDiv", "", "Blue div"),
+ RICHDATATABLE1 ("richDataTable1", "", "Rich Data Table Row
1"),
+ RICHDATATABLE2 ("richDataTable2", "", "Rich Data Table Row
2");
private String name;
@@ -72,4 +76,11 @@
return desc;
}
+ /* (non-Javadoc)
+ * @see java.lang.Enum#toString()
+ */
+ @Override
+ public String toString() {
+ return name;
+ }
}
Modified: root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/TemplatesList.java
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/TemplatesList.java 2010-07-10
18:17:29 UTC (rev 17822)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/TemplatesList.java 2010-07-10
18:18:32 UTC (rev 17823)
@@ -91,7 +91,7 @@
@Override
public boolean contains(Object o) {
- return templates.contains((Template) o);
+ return templates.contains(o);
}
@Override
@@ -136,7 +136,7 @@
@Override
public boolean remove(Object o) {
- return templates.remove((Template) o);
+ return templates.remove(o);
}
@Override
Modified:
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JCommandButtonBean.java
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JCommandButtonBean.java 2010-07-10
18:17:29 UTC (rev 17822)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JCommandButtonBean.java 2010-07-10
18:18:32 UTC (rev 17823)
@@ -28,7 +28,7 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.event.ActionEvent;
-import org.richfaces.component.html.HtmlCommandButton;
+import org.richfaces.component.UICommandButton;
import org.richfaces.testapp.Attributes;
import org.slf4j.Logger;
@@ -60,7 +60,7 @@
logger = LoggerFactory.getLogger(A4JCommandButtonBean.class);
logger.info("initializing bean " + getClass().getName());
- attributes = new Attributes(HtmlCommandButton.class, getClass());
+ attributes = new Attributes(UICommandButton.class, getClass());
attributes.put("value", "command button");
attributes.put("rendered", "true");
Modified:
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JCommandLinkBean.java
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JCommandLinkBean.java 2010-07-10
18:17:29 UTC (rev 17822)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JCommandLinkBean.java 2010-07-10
18:18:32 UTC (rev 17823)
@@ -28,8 +28,8 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.event.ActionEvent;
+import org.richfaces.component.UICommandLink;
-import org.richfaces.component.html.HtmlCommandLink;
import org.richfaces.testapp.Attributes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -60,7 +60,7 @@
logger = LoggerFactory.getLogger(A4JCommandLinkBean.class);
logger.info("initializing bean " + getClass().getName());
- attributes = new Attributes(HtmlCommandLink.class, getClass());
+ attributes = new Attributes(UICommandLink.class, getClass());
attributes.put("value", "command link");
attributes.put("rendered", "true");
Modified: root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/RichBean.java
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/RichBean.java 2010-07-10
18:17:29 UTC (rev 17822)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/RichBean.java 2010-07-10
18:18:32 UTC (rev 17823)
@@ -71,7 +71,7 @@
public void init() {
logger = LoggerFactory.getLogger(RichBean.class);
skins = createSkinList();
- components = createComponentsMap();
+ createComponentsMap();
component = "none";
container = "plain";
@@ -85,14 +85,12 @@
reComponent = true;
}
- private Map<String, String> createComponentsMap() {
- Map<String, String> components = new TreeMap<String, String>();
+ private void createComponentsMap() {
+ components = new TreeMap<String, String>();
components.put("a4jCommandLink", "A4J Command Link");
components.put("a4jCommandButton", "A4J Command Button");
components.put("commandButton", "JSF Command Button");
-
- return components;
}
private List<String> createSkinList() {
Modified:
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/TemplateBean.java
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/TemplateBean.java 2010-07-10
18:17:29 UTC (rev 17822)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/TemplateBean.java 2010-07-10
18:18:32 UTC (rev 17823)
@@ -1,23 +1,25 @@
-/**
- * License Agreement.
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, Exadel, Inc.,
+ * 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
*
- * JBoss RichFaces - Ajax4jsf Component Library
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
*
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
+ * This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
package org.richfaces.testapp.bean;
@@ -40,26 +42,20 @@
public class TemplateBean implements Serializable {
private static final long serialVersionUID = 5078700314562231363L;
-
- private static final Logger logger = LoggerFactory.getLogger(TemplateBean.class);
-
- static final List<String> dataTableModel = new ArrayList<String>();
- static {
- dataTableModel.add("1");
- dataTableModel.add("2");
- }
-
+ private static Logger logger = LoggerFactory.getLogger(TemplateBean.class);
+ private List<String> dataTableModel = new ArrayList<String>();
private TemplatesList templates;
-
- private Integer dataTableRowIndex = 0;
-
private int templateIndex = 0;
-
+
@PostConstruct
public void init() {
templates = new TemplatesList();
+ dataTableModel.add("row 1");
+ dataTableModel.add("row 2");
+ dataTableModel.add("row 3");
+ dataTableModel.add("row 4");
}
-
+
/**
* @return the templates
*/
@@ -81,25 +77,18 @@
}
/**
- * @return the dataTableRowIndex
- */
- public Integer getDataTableRowIndex() {
- return dataTableRowIndex;
- }
-
- /**
* @return the dataTableModel
*/
public List<String> getDataTableModel() {
return dataTableModel;
}
-
+
public String getFirstTemplate() {
templateIndex = 0;
- return templates.get(0).toString().toLowerCase();
+ return templates.get(0).toString();
}
-
+
public String getNextTemplate() {
- return templates.get(++templateIndex).toString().toLowerCase();
+ return templates.get(++templateIndex).toString();
}
-}
\ No newline at end of file
+}
Modified: root/tests/metamer/trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/WEB-INF/web.xml 2010-07-10 18:17:29 UTC (rev
17822)
+++ root/tests/metamer/trunk/src/main/webapp/WEB-INF/web.xml 2010-07-10 18:18:32 UTC (rev
17823)
@@ -1,30 +1,16 @@
<?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">
+<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
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-app_2_5.xsd">
<display-name>testapp</display-name>
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
<context-param>
- <param-name>org.richfaces.SKIN</param-name>
- <param-value>#{richBean.skin}</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.CONTROL_SKINNING</param-name>
- <param-value>#{richBean.skinning}</param-value>
- </context-param>
- <context-param>
- <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
- <param-value>#{richBean.skinningClasses}</param-value>
- </context-param>
- <context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
- <param-name>javax.faces.SKIP_COMMENTS</param-name>
- <param-value>true</param-value>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
@@ -39,4 +25,4 @@
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
-</web-app>
\ No newline at end of file
+</web-app>
Modified: root/tests/metamer/trunk/src/main/webapp/index.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/index.xhtml 2010-07-10 18:17:29 UTC (rev
17822)
+++ root/tests/metamer/trunk/src/main/webapp/index.xhtml 2010-07-10 18:18:32 UTC (rev
17823)
@@ -1,23 +1,19 @@
<!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:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://java.sun.com/jsf/composite/rich"
-
xmlns:a4j="http://richfaces.org/a4j"
xmlns:c="http://java.sun.com/jsp/jstl/core">
+<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jsp/jstl/core">
-<h:head>
- <title>Testing Application</title>
- <meta http-equiv="Content-Type" content="text/xhtml;
charset=UTF-8" />
- <!-- <h:outputStylesheet library="css" name="common.css"
/>-->
-</h:head>
+ <h:head>
+ <title>Testing Application</title>
+ <meta http-equiv="Content-Type" content="text/xhtml;
charset=UTF-8" />
+ <h:outputStylesheet library="css" name="common.css" />
+ </h:head>
-<h:body>
-
- <h:form id="linksForm">
- <h:panelGrid id="attributes">
- <c:forEach items="#{richBean.components}"
var="entry">
- <h:commandLink action="#{richBean.getListPage(entry.key)}"
value="#{entry.key}" />
- </c:forEach>
- </h:panelGrid>
- </h:form>
-
-</h:body>
+ <h:body>
+ <h:form id="linksForm">
+ <h:panelGrid id="attributes">
+ <c:forEach items="#{richBean.components}"
var="entry">
+ <h:commandLink
action="#{richBean.getListPage(entry.key)}" value="#{entry.key}"
/>
+ </c:forEach>
+ </h:panelGrid>
+ </h:form>
+ </h:body>
</html>
\ No newline at end of file
Added: root/tests/metamer/trunk/src/main/webapp/templates/blueDiv.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/templates/blueDiv.xhtml
(rev 0)
+++ root/tests/metamer/trunk/src/main/webapp/templates/blueDiv.xhtml 2010-07-10 18:18:32
UTC (rev 17823)
@@ -0,0 +1,10 @@
+<!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">
+
+ <ui:composition>
+
+ <div style="border: 2px blue dotted; padding: 10px; margin-top: 10px;
margin-bottom: 10px;"><ui:include
+ src="#{templateBean.nextTemplate}.xhtml" /></div>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Deleted: root/tests/metamer/trunk/src/main/webapp/templates/blue_div.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/templates/blue_div.xhtml 2010-07-10 18:17:29
UTC (rev 17822)
+++ root/tests/metamer/trunk/src/main/webapp/templates/blue_div.xhtml 2010-07-10 18:18:32
UTC (rev 17823)
@@ -1,12 +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:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:rich="http://java.sun.com/jsf/composite/rich">
-
-<ui:composition>
-
- <div style="border: 2px blue dotted; padding: 10px; margin-top: 10px;
margin-bottom: 10px;"><ui:include
- src="#{templateBean.nextTemplate}.xhtml" /></div>
-
-</ui:composition>
-</html>
\ No newline at end of file
Added: root/tests/metamer/trunk/src/main/webapp/templates/redDiv.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/templates/redDiv.xhtml
(rev 0)
+++ root/tests/metamer/trunk/src/main/webapp/templates/redDiv.xhtml 2010-07-10 18:18:32
UTC (rev 17823)
@@ -0,0 +1,10 @@
+<!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">
+
+ <ui:composition>
+
+ <div style="border: 2px red solid; padding: 10px; margin-top: 10px;
margin-bottom: 10px;"><ui:include
+ src="#{templateBean.nextTemplate}.xhtml" /></div>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Deleted: root/tests/metamer/trunk/src/main/webapp/templates/red_div.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/templates/red_div.xhtml 2010-07-10 18:17:29
UTC (rev 17822)
+++ root/tests/metamer/trunk/src/main/webapp/templates/red_div.xhtml 2010-07-10 18:18:32
UTC (rev 17823)
@@ -1,12 +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:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:rich="http://java.sun.com/jsf/composite/rich">
-
-<ui:composition>
-
- <div style="border: 2px red solid; padding: 10px; margin-top: 10px;
margin-bottom: 10px;"><ui:include
- src="#{templateBean.nextTemplate}.xhtml" /></div>
-
-</ui:composition>
-</html>
\ No newline at end of file
Added: root/tests/metamer/trunk/src/main/webapp/templates/richDataTable1.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/templates/richDataTable1.xhtml
(rev 0)
+++ root/tests/metamer/trunk/src/main/webapp/templates/richDataTable1.xhtml 2010-07-10
18:18:32 UTC (rev 17823)
@@ -0,0 +1,20 @@
+<!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:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://richfaces.org/rich">
+
+ <ui:composition>
+
+ <rich:dataTable value="#{templateBean.dataTableModel}"
var="item" id="containerDataTable1" rowKeyVar="row">
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Data Table" />
+ </f:facet>
+ <h:panelGroup columns="1" rendered="#{row
==0}">
+ <ui:include src="#{templateBean.nextTemplate}.xhtml"
/>
+ </h:panelGroup>
+ <h:outputText value="#{item}" rendered="#{row !=
0}" />
+ </rich:column>
+ </rich:dataTable>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Added: root/tests/metamer/trunk/src/main/webapp/templates/richDataTable2.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/templates/richDataTable2.xhtml
(rev 0)
+++ root/tests/metamer/trunk/src/main/webapp/templates/richDataTable2.xhtml 2010-07-10
18:18:32 UTC (rev 17823)
@@ -0,0 +1,20 @@
+<!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:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:rich="http://richfaces.org/rich">
+
+ <ui:composition>
+
+ <rich:dataTable value="#{templateBean.dataTableModel}"
var="item" id="containerDataTable2" rowKeyVar="row">
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="Data Table" />
+ </f:facet>
+ <h:panelGroup columns="1" rendered="#{row ==
1}">
+ <ui:include src="#{templateBean.nextTemplate}.xhtml"
/>
+ </h:panelGroup>
+ <h:outputText value="#{item}" rendered="#{row !=
1}" />
+ </rich:column>
+ </rich:dataTable>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: root/tests/metamer/trunk/src/main/webapp/templates/template.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/templates/template.xhtml 2010-07-10 18:17:29
UTC (rev 17822)
+++ root/tests/metamer/trunk/src/main/webapp/templates/template.xhtml 2010-07-10 18:18:32
UTC (rev 17823)
@@ -7,6 +7,19 @@
<meta http-equiv="Content-Type" content="text/xhtml;
charset=UTF-8" />
<h:outputStylesheet library="css" name="common.css" />
<ui:insert name="head"/>
+ <script type="text/javascript">A4J.AJAX.onExpired = function(loc,
expiredMsg){
+
+ if(window.confirm("Custom onExpired handler "+expiredMsg+" for a
location: "+loc)){
+
+ return loc;
+
+ } else {
+
+ return false;
+
+ }
+
+}</script>
</h:head>
<h:body>
Modified:
root/tests/metamer/trunk/src/test/java/org/richfaces/testapp/TemplatesListTest.java
===================================================================
---
root/tests/metamer/trunk/src/test/java/org/richfaces/testapp/TemplatesListTest.java 2010-07-10
18:17:29 UTC (rev 17822)
+++
root/tests/metamer/trunk/src/test/java/org/richfaces/testapp/TemplatesListTest.java 2010-07-10
18:18:32 UTC (rev 17823)
@@ -1,3 +1,25 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ *******************************************************************************/
+
package org.richfaces.testapp;
import org.testng.annotations.BeforeMethod;
@@ -6,7 +28,8 @@
/**
*
- * @author Pavol Pitonak
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
*/
public class TemplatesListTest {
@@ -25,21 +48,21 @@
@Test
public void testSetIntTemplate() {
- templates.set(0, Template.RED_DIV);
+ templates.set(0, Template.REDDIV);
assertEquals(templates.size(), 2, "Size after red_div was inserted on
position 0");
- assertEquals(templates.get(0), Template.RED_DIV, "position 0");
+ assertEquals(templates.get(0), Template.REDDIV, "position 0");
assertEquals(templates.get(1), Template.PLAIN, "position 1");
- templates.set(1, Template.BLUE_DIV);
+ templates.set(1, Template.BLUEDIV);
assertEquals(templates.size(), 3, "Size after blue_div was inserted on
position 1");
- assertEquals(templates.get(0), Template.RED_DIV, "position 0");
- assertEquals(templates.get(1), Template.BLUE_DIV, "position 1");
+ assertEquals(templates.get(0), Template.REDDIV, "position 0");
+ assertEquals(templates.get(1), Template.BLUEDIV, "position 1");
assertEquals(templates.get(2), Template.PLAIN, "position 2");
- templates.set(0, Template.BLUE_DIV);
+ templates.set(0, Template.BLUEDIV);
assertEquals(templates.size(), 3, "Size after blue_div was inserted on
position 0");
- assertEquals(templates.get(0), Template.BLUE_DIV, "position 0");
- assertEquals(templates.get(1), Template.BLUE_DIV, "position 1");
+ assertEquals(templates.get(0), Template.BLUEDIV, "position 0");
+ assertEquals(templates.get(1), Template.BLUEDIV, "position 1");
assertEquals(templates.get(2), Template.PLAIN, "position 2");
}
}