Skip to content

Commit

Permalink
Add richfaces and primefaces project templates
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoyanchev committed Feb 29, 2012
1 parent a3a4e93 commit 60796e9
Show file tree
Hide file tree
Showing 54 changed files with 1,166 additions and 267 deletions.
10 changes: 2 additions & 8 deletions README.markdown
Expand Up @@ -38,21 +38,15 @@ For the purpose of these instructions, we'll assume your new JIRA issue ID is "S

1\. In your local clone of this repository, create a copy of the appopriate template sub-directory. Their names start with `SWF-0000`.

For Spring Web Flow (non-JSF) issues:
For example:

```bash
$ cd spring-webflow-issues
$ ./create-repro-project.sh SWF-0000/ SPR-1502
$ cd SPR-1502
```

For Spring Web Flow with JSF 2 issues:

```bash
$ cd spring-webflow-issues
$ ./create-repro-project.sh SWF-JSF-0000/ SPR-1502
$ cd SPR-1502
```
Also available are `SWF-0000-primefaces`, `SWF-0000-richfaces`, and `SWF-0000-jsf`.

2\. Review the list of dependencies and version numbers and modify the pom.xml as necessary.

Expand Down
218 changes: 218 additions & 0 deletions SWF-0000-jsf/pom.xml
@@ -0,0 +1,218 @@
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.webflow.issues</groupId>
<artifactId>SWF-0000-jsf</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Spring Web Flow and JSF Issue Reproduction Project</name>
<packaging>war</packaging>

<properties>
<java-version>1.6</java-version>
<org.springwebflow-version>2.3.1.BUILD-SNAPSHOT</org.springwebflow-version>
<org.springframework-version>3.1.1.RELEASE</org.springframework-version>
<org.springsecurity-version>3.0.7.RELEASE</org.springsecurity-version>
<jsf-version>2.1.7</jsf-version>
<org.slf4j-version>1.6.1</org.slf4j-version>
</properties>

<dependencies>
<!-- Spring Framework -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>

<!-- Spring Web Flow -->
<dependency>
<groupId>org.springframework.webflow</groupId>
<artifactId>spring-faces</artifactId>
<version>${org.springwebflow-version}</version>
</dependency>

<!-- JSF -->
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>${jsf-version}</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>${jsf-version}</version>
</dependency>

<!-- Spring Security
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${org.springsecurity-version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>${org.springsecurity-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${org.springsecurity-version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
-->

<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>runtime</scope>
</dependency>

<!-- Servlet API, JSP API, JSTL -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>

<!-- Bean Validation with the Hibernate Validator implementation -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.1.0.Final</version>
</dependency>

<!-- JAXB for Hibernate Validator when running on Java 5
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.1</version>
</dependency>
-->

<!-- JUnit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8</version>
<scope>test</scope>
</dependency>

</dependencies>

<repositories>

<repository>
<id>spring-related-snapshot-releases</id>
<name>Latest Spring Snapshot Repository</name>
<url>http://maven.springframework.org/snapshot</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>

</repositories>

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>install</id>
<phase>install</phase>
<goals>
<goal>sources</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/*Tests.java</include>
</includes>
<excludes>
<exclude>**/*Abstract*.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
</plugins>
</build>

</project>

Expand Up @@ -6,7 +6,7 @@
<f:view contentType="text/html">
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>SWF-JSF Test App</title>
<title>Spring Web Flow and JSF Issue Project</title>
</h:head>
<body>
<ui:insert name="content" />
Expand Down
Expand Up @@ -2,13 +2,12 @@
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow.xsd">

<view-state id="showNumbers">
http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">

<view-state id="view">
<transition on="continue" to="done" />
</view-state>

<end-state id="done" view="externalRedirect:contextRelative:/" />

</flow>
Expand Up @@ -7,14 +7,11 @@
template="/WEB-INF/layouts/standard.xhtml">
<ui:define name="content">
<div>
<h1>Phone Numbers</h1>
<hr/>
<h1>My Page</h1>
<h:form>
<p>(917) 455-3605</p>
<p>(347) 219-2216</p>
<p>
<h:commandButton id="continue" value="End Flow" action="continue" />
</p>
<p>Line 1</p>
<p>Line 2</p>
<h:commandButton id="continue" value="End Flow" action="continue" />
</h:form>
</div>
</ui:define>
Expand Down
Expand Up @@ -8,9 +8,11 @@
http://www.springframework.org/schema/faces http://www.springframework.org/schema/faces/spring-faces-2.2.xsd">

<context:component-scan base-package="org.springframework.webflow.issues" />

<faces:resources />

<bean class="org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter"/>

<!-- Maps request paths to flows in the flowRegistry -->
<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping">
<property name="order" value="1" />
Expand Down
Expand Up @@ -17,7 +17,7 @@

<!-- The registry with flow definitions -->
<webflow:flow-registry id="flowRegistry" flow-builder-services="facesFlowBuilderServices" base-path="/WEB-INF">
<webflow:flow-location-pattern value="/**/*-flow.xml" />
<webflow:flow-location-pattern value="/**/*flow.xml" />
</webflow:flow-registry>

<!-- Enable the Spring Web Flow JSF integration -->
Expand All @@ -32,4 +32,4 @@
<bean id="securityFlowExecutionListener" class="org.springframework.webflow.security.SecurityFlowExecutionListener" />
-->

</beans>
</beans>
Expand Up @@ -7,9 +7,9 @@
<ui:define name="content">
<div>
<h1>Home</h1>
<p><em>See the server output for debug information</em></p>
<p><strong>See server log for debug information</strong></p>
<hr />
<a href="main/phonebook">Start Flow</a>
<a href="main/myflow">Start Flow</a>
</div>
</ui:define>
</ui:composition>
Expand Up @@ -8,16 +8,18 @@
import org.springframework.webflow.test.MockFlowBuilderContext;
import org.springframework.webflow.test.execution.AbstractXmlFlowExecutionTests;

public class PhonebookFlowExecutionTests extends AbstractXmlFlowExecutionTests {
public class MyFlowExecutionTests extends AbstractXmlFlowExecutionTests {

@Override
protected FlowDefinitionResource getResource(FlowDefinitionResourceFactory resourceFactory) {
return resourceFactory.createFileResource("src/main/webapp/WEB-INF/phonebook/phonebook-flow.xml");
return resourceFactory.createFileResource("src/main/webapp/WEB-INF/myflow/myflow.xml");
}

@Override
protected void configureFlowBuilderContext(MockFlowBuilderContext builderContext) {
// register beans -- e.g. builderContext.registerBean("phoneService", phoneService);
// Register beans here..
// MyService myService = ... ;
// builderContext.registerBean("myService", myService);
}

public void testStartFlow() {
Expand All @@ -27,12 +29,12 @@ public void testStartFlow() {

startFlow(input, context);

assertCurrentStateEquals("showNumbers");
assertResponseWrittenEquals("showNumbers", context);
assertCurrentStateEquals("view");
assertResponseWrittenEquals("view", context);
}

public void testEndFlow() {
setCurrentState("showNumbers");
setCurrentState("view");

MockExternalContext context = new MockExternalContext();
context.setEventId("continue");
Expand Down
8 changes: 8 additions & 0 deletions SWF-0000-primefaces/README.txt
@@ -0,0 +1,8 @@
This is a simple template for creating a project to reproduce
an issue as described in the README.markdown file in the root
of this repository (and at
https://github.com/SpringSource/spring-webflow-issues#readme).
Please read that document.

A Maven (pom.xml) build script is included for your convenience.
You may want to customize the dependencies it contains.

0 comments on commit 60796e9

Please sign in to comment.