Author: sboscarine
Date: 2010-06-15 23:26:00 -0400 (Tue, 15 Jun 2010)
New Revision: 6438
Added:
archetypes/branches/prototype/pom.xml
archetypes/branches/prototype/readme.txt
archetypes/branches/prototype/src/
archetypes/branches/prototype/src/main/
archetypes/branches/prototype/src/main/java/
archetypes/branches/prototype/src/main/java/com/
archetypes/branches/prototype/src/main/java/com/mycompany/
archetypes/branches/prototype/src/main/java/com/mycompany/HelloWorld.java
archetypes/branches/prototype/src/main/java/com/mycompany/Widget.java
archetypes/branches/prototype/src/main/java/com/mycompany/WidgetListProducer.java
archetypes/branches/prototype/src/main/java/com/mycompany/WidgetRepository.java
archetypes/branches/prototype/src/main/java/com/mycompany/WidgetRepositoryProducer.java
archetypes/branches/prototype/src/main/resources/
archetypes/branches/prototype/src/main/resources/META-INF/
archetypes/branches/prototype/src/main/resources/META-INF/persistence.xml
archetypes/branches/prototype/src/main/resources/import.sql
archetypes/branches/prototype/src/main/webapp/
archetypes/branches/prototype/src/main/webapp/META-INF/
archetypes/branches/prototype/src/main/webapp/META-INF/MANIFEST.MF
archetypes/branches/prototype/src/main/webapp/META-INF/context.xml
archetypes/branches/prototype/src/main/webapp/WEB-INF/
archetypes/branches/prototype/src/main/webapp/WEB-INF/beans.xml
archetypes/branches/prototype/src/main/webapp/WEB-INF/faces-config.xml
archetypes/branches/prototype/src/main/webapp/WEB-INF/lib/
archetypes/branches/prototype/src/main/webapp/WEB-INF/templates/
archetypes/branches/prototype/src/main/webapp/WEB-INF/templates/default.xhtml
archetypes/branches/prototype/src/main/webapp/WEB-INF/web.xml
archetypes/branches/prototype/src/main/webapp/home.xhtml
archetypes/branches/prototype/src/main/webapp/index.jsp
archetypes/branches/prototype/src/main/webapp/resources/
archetypes/branches/prototype/src/main/webapp/resources/css/
archetypes/branches/prototype/src/main/webapp/resources/css/screen.css
archetypes/branches/prototype/src/main/webapp/resources/gfx/
archetypes/branches/prototype/src/main/webapp/resources/gfx/banner.png
archetypes/branches/prototype/src/main/webapp/resources/gfx/weld.png
archetypes/branches/prototype/src/test/
archetypes/branches/prototype/src/test/java/
archetypes/branches/prototype/src/test/java/com/
archetypes/branches/prototype/src/test/java/com/mycompany/
archetypes/branches/prototype/src/test/java/com/mycompany/HelloWorldTest.java
archetypes/branches/prototype/src/test/resources/
Modified:
archetypes/branches/prototype/
Log:
first round of archetypes revamp
Property changes on: archetypes/branches/prototype
___________________________________________________________________
Name: svn:ignore
+ .settings
target
.classpath
.project
Added: archetypes/branches/prototype/pom.xml
===================================================================
--- archetypes/branches/prototype/pom.xml (rev 0)
+++ archetypes/branches/prototype/pom.xml 2010-06-16 03:26:00 UTC (rev 6438)
@@ -0,0 +1,120 @@
+<?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/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.mycompany</groupId>
+ <artifactId>myproject</artifactId>
+ <packaging>war</packaging>
+ <name>myproject</name>
+ <version>1.0.0-SNAPSHOT</version>
+
+ <properties>
+ <!--
+ Explicitly declaring the source encoding eliminates the following message:
[WARNING] Using platform encoding
+ (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
+ -->
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <!--
+ Timestamp format for the maven.build.timestamp property; you can reference
property in pom.xml or filtered
+ resources (must enable third-party plugin if using Maven < 2.1)
+ -->
+
<maven.build.timestamp.format>yyyyMMdd'T'HHmmss</maven.build.timestamp.format>
+ <!--
+ To set the jboss.home environment variable the Maven way, set the jboss.home
property in an active profile in
+ the Maven 2 settings.xml file
+ -->
+ <jboss.home>${env.JBOSS_HOME}</jboss.home>
+ <jboss.domain>default</jboss.domain>
+ </properties>
+
+ <repositories>
+ <!-- Optional Repository. -->
+ <!-- Soon all required dependencies will be pushed to maven central. -->
+ <!-- In the mean time, we need to point this archetype to the JBoss Maven
Repository -->
+ <repository>
+ <id>jboss-public-repository</id>
+ <name>JBoss Repository</name>
+ <
url>https://repository.jboss.org/nexus/content/groups/public</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>daily</updatePolicy>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <!-- GlassFish repository required for embedded-glassfish plugin -->
+ <pluginRepository>
+ <id>glassfish</id>
+ <name>GlassFish Maven 2 Repository</name>
+ <
url>http://download.java.net/maven/glassfish</url>
+ </pluginRepository>
+ </pluginRepositories>
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.spec</groupId>
+ <artifactId>jboss-javaee-6.0</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <scope>provided</scope>
+ <type>pom</type>
+ </dependency>
+ <!-- Bean Validation Implementation -->
+ <!-- Provides portable constraints such as @NotEmpty, @Email and @Url -->
+ <!-- Hibernate Validator is the only JSR-303 implementation at the moment, so we
can assume it's provided -->
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>4.0.0.GA</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- Optional, but highly recommended. -->
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <version>5.11</version>
+ <scope>test</scope>
+ <classifier>jdk15</classifier>
+ </dependency>
+ </dependencies>
+ <build>
+ <finalName>${artifactId}</finalName>
+ <plugins>
+ <!-- Compiler plugin enforces Java 1.6 compatibility -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+
+ <!-- Eclipse plugin can force download of source and JavaDoc jars -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <configuration>
+ <downloadSources>true</downloadSources>
+ <downloadJavadocs>true</downloadJavadocs>
+ </configuration>
+ </plugin>
+
+ <!-- Configure the JBoss AS Maven deploy plugin -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jboss-maven-plugin</artifactId>
+ <configuration>
+ <jbossHome>${jboss.home}</jbossHome>
+ <serverName>${jboss.domain}</serverName>
+ <fileNames>
+
<fileName>${project.build.directory}/${build.finalName}.war</fileName>
+ </fileNames>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: archetypes/branches/prototype/readme.txt
===================================================================
--- archetypes/branches/prototype/readme.txt (rev 0)
+++ archetypes/branches/prototype/readme.txt 2010-06-16 03:26:00 UTC (rev 6438)
@@ -0,0 +1,138 @@
+
+ myproject
+
+ Source archetype: weld-jsf-jee
+
+ What is it?
+ ===========
+
+ This is your project! It's a sample, deployable Maven 2 project to help you
+ get your foot in the door developing with Java EE 6. This project is setup to
+ allow you to create a compliant Java EE 6 application using JSF 2.0, CDI 1.0,
+ EJB 3.1 and JPA 2.0) that can run on a certified application server (Complete
+ or Web Profile). It includes a persistence unit and some sample persistence
+ and transaction code to help you get your feet wet with database access in
+ enterprise Java.
+
+ System requirements
+ ===================
+
+ All you need to run this project is Java 5.0 (Java SDK 1.5) or greator and
+ Maven 2.0.10 or greater. This application is setup to be run on a Java EE 6
+ certified application server. It has been tested with GlassFish V3 and JBoss
+ AS 6.0.
+
+ If you want to deploy the application to a standalone Servlet Container, then
+ you will need to set one up. Alternatively, you can use a Maven command to run
+ the application in place on an embedded version of GlassFish V3.
+
+ Please note that Maven 2 project needs to use the JBoss Maven repository
+ because there are certain Java EE API JARs that are not yet publised to the
+ Maven Central Repository (see
https://jira.jboss.org/jira/browse/WELD-222)
+
+ Deploying the application
+ =========================
+
+ To deploy the application to JBoss AS (standalone), first make sure that the
+ JBOSS_HOME environment variable points to a JBoss AS 6.0 installation.
+ Alternatively, you can set the location of JBoss AS using the following
+ profile defintion in the .m2/settings.xml file in your home directory:
+
+<?xml version="1.0" encoding="UTF-8"?>
+<settings
+
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/settings-1.0.0.xsd">
+
+ <profiles>
+ <profile>
+ <id>environment</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <properties>
+ <jboss.home>/path/to/jboss-as-6.0.0.M1</jboss.home>
+ </properties>
+ </profile>
+ </profiles>
+
+</settings>
+
+ You can now deploy to JBoss AS by executing the following command:
+
+ mvn package jboss:hard-deploy
+
+ Start JBoss AS. The application will be running at the following URL:
+
+
http://localhost:8080/myproject
+
+ If you want to deploy to GlassFish V3 (standalone), you first need to change
+ the name of the DataSource used by the persistence unit! Open this file:
+
+ src/main/resources/META-INF/persistence.xml
+
+ Change the value of <jta-data-source> to the following:
+
+ <jta-data-source>jdbc/__default</jta-data-source>
+
+ This configuration uses the built-in default Derby DataSource in GlassFish.
+ Optionally, you can use an alternative DataSource of your choice.
+
+ Now, execute the command:
+
+ mvn package
+
+ There are several ways to deploy the archive to GlassFish V3. The recommended
+ approach is to open the project in NetBeans 6.8, right-click on the project
+ and select "Run" from the context menu. That starts JavaDB, GlassFish and
+ deploys the application.
+
+ You can also start GlassFish from the commandline. Change to the glassfish/bin
+ directory in the GlassFish install root and run these three commands:
+
+ asadmin start-database
+ asadmin start-domain domain1
+
+ Now you can either deploy the target/myproject.war through the web-based
+ GlassFish admininstration console, or you can again use asadmin:
+
+ asadmin /path/to/project/target/myproject.war
+
+ Unfortunately, the embedded GlassFish V3 application server does not bootstrap
+ the persistence unit(s), so you won't be able to leverage the Maven plugin to
+ run the application in place (like you can in a jee-minimal project).
+
+ Importing the project into an IDE
+ =================================
+
+ If you created the project using the Maven 2 archetype wizard in your IDE
+ (Eclipse, NetBeans or IntelliJ IDEA), then there is nothing to do. You should
+ already have an IDE project.
+
+ If you created the project from the commandline using archetype:generate, then
+ you need to bring the project into your IDE. If you are using NetBeans 6.8 or
+ IntelliJ IDEA 9, then all you have to do is open the project as an existing
+ project. Both of these IDEs recognize Maven 2 projects natively.
+
+ To import into Eclipse, you first need to install the m2eclipse plugin. To get
+ started, add the m2eclipse update site (
http://m2eclipse.sonatype.org/update/)
+ to Eclipse and install the m2eclipse plugin and required dependencies. Once
+ that is installed, you'll be ready to import the project into Eclipse.
+
+ Select File > Import... and select "Import... > Maven Projects" and
select
+ your project directory. m2eclipse should take it from there.
+
+ Once in the IDE, you can execute the Maven commands through the IDE controls
+ to run the application on an embedded Servlet Container.
+
+ Resources
+ =========
+
+ Weld archetypes:
+ - Quickstart:
http://seamframework.org/Documentation/WeldQuickstartForMavenUsers
+ - Issue tracker:
https://jira.jboss.org/jira/browse/WELDX
+ - Source code:
http://anonsvn.jboss.org/repos/weld/archetypes
+ - Forums:
http://seamframework.org/Community/WeldUsers
+ JSR-299 overview:
http://seamframework.org/Weld
+ JSF community site:
http://www.javaserverfaces.org
+
Added: archetypes/branches/prototype/src/main/java/com/mycompany/HelloWorld.java
===================================================================
--- archetypes/branches/prototype/src/main/java/com/mycompany/HelloWorld.java
(rev 0)
+++ archetypes/branches/prototype/src/main/java/com/mycompany/HelloWorld.java 2010-06-16
03:26:00 UTC (rev 6438)
@@ -0,0 +1,74 @@
+package com.mycompany;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.inject.Model;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+
+import org.hibernate.validator.constraints.Email;
+import org.hibernate.validator.constraints.NotEmpty;
+
+public @Model class HelloWorld
+{
+ private final String text = "Hello World!";
+
+ private String letters;
+
+ private String numbers;
+
+ private String email;
+
+ public HelloWorld() {}
+
+ @PostConstruct
+ public void initialize()
+ {
+ System.out.println(this.getClass().getSimpleName() + " was
constructed");
+ }
+
+ public String getText()
+ {
+ return text;
+ }
+
+ @NotNull
+ @NotEmpty
+ @Pattern(regexp = "[A-Za-z]*", message = "must contain only
letters")
+ public String getLetters()
+ {
+ return letters;
+ }
+
+ public void setLetters(String letters)
+ {
+ this.letters = letters;
+ }
+
+ @NotNull
+ @NotEmpty
+ @Digits(fraction = 0, integer = 2)
+ public String getNumbers()
+ {
+ return numbers;
+ }
+
+ public void setNumbers(String numbers)
+ {
+ this.numbers = numbers;
+ }
+
+ @NotNull
+ @NotEmpty
+ @Email
+ public String getEmail()
+ {
+ return email;
+ }
+
+ public void setEmail(String email)
+ {
+ this.email = email;
+ }
+
+}
Added: archetypes/branches/prototype/src/main/java/com/mycompany/Widget.java
===================================================================
--- archetypes/branches/prototype/src/main/java/com/mycompany/Widget.java
(rev 0)
+++ archetypes/branches/prototype/src/main/java/com/mycompany/Widget.java 2010-06-16
03:26:00 UTC (rev 6438)
@@ -0,0 +1,64 @@
+package com.mycompany;
+
+import java.io.Serializable;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+
+@Entity
+public class Widget implements Serializable
+{
+ private Long id;
+ private String partNumber;
+ private String name;
+ private String description;
+
+ @Id
+ @GeneratedValue
+ public Long getId()
+ {
+ return id;
+ }
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ // demonstrates a column name override
+ @Column(name = "partno")
+ public String getPartNumber()
+ {
+ return partNumber;
+ }
+
+ public void setPartNumber(String partNumber)
+ {
+ this.partNumber = partNumber;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+
+ /** Default value included to remove warning. Remove or modify at will. */
+ private static final long serialVersionUID = 1L;
+}
\ No newline at end of file
Added: archetypes/branches/prototype/src/main/java/com/mycompany/WidgetListProducer.java
===================================================================
--- archetypes/branches/prototype/src/main/java/com/mycompany/WidgetListProducer.java
(rev 0)
+++
archetypes/branches/prototype/src/main/java/com/mycompany/WidgetListProducer.java 2010-06-16
03:26:00 UTC (rev 6438)
@@ -0,0 +1,22 @@
+package com.mycompany;
+
+import java.util.List;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Produces;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.persistence.EntityManager;
+
+public class WidgetListProducer
+{
+ @Inject @WidgetRepository EntityManager widgetRepository;
+
+ @Produces
+ @Named
+ @RequestScoped
+ @SuppressWarnings("unchecked")
+ List<Widget> getWidgets() {
+ return widgetRepository.createQuery("select w from Widget w order by
w.name").getResultList();
+ }
+}
Added: archetypes/branches/prototype/src/main/java/com/mycompany/WidgetRepository.java
===================================================================
--- archetypes/branches/prototype/src/main/java/com/mycompany/WidgetRepository.java
(rev 0)
+++
archetypes/branches/prototype/src/main/java/com/mycompany/WidgetRepository.java 2010-06-16
03:26:00 UTC (rev 6438)
@@ -0,0 +1,13 @@
+package com.mycompany;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.inject.Qualifier;
+
+@Qualifier
+(a)Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
+(a)Retention(RetentionPolicy.RUNTIME)
+public @interface WidgetRepository {}
Added:
archetypes/branches/prototype/src/main/java/com/mycompany/WidgetRepositoryProducer.java
===================================================================
---
archetypes/branches/prototype/src/main/java/com/mycompany/WidgetRepositoryProducer.java
(rev 0)
+++
archetypes/branches/prototype/src/main/java/com/mycompany/WidgetRepositoryProducer.java 2010-06-16
03:26:00 UTC (rev 6438)
@@ -0,0 +1,19 @@
+package com.mycompany;
+
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.Disposes;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+
+public class WidgetRepositoryProducer
+{
+ // NOTE cannot use producer field because Weld attempts to close EntityManager
+ //
https://jira.jboss.org/jira/browse/WELD-341
+ @PersistenceContext EntityManager em;
+
+ public @Produces @WidgetRepository EntityManager retrieveEntityManager() {
+ return em;
+ }
+
+ public void disposeEntityManager(@Disposes @WidgetRepository EntityManager em) {}
+}
Added: archetypes/branches/prototype/src/main/resources/META-INF/persistence.xml
===================================================================
--- archetypes/branches/prototype/src/main/resources/META-INF/persistence.xml
(rev 0)
+++ archetypes/branches/prototype/src/main/resources/META-INF/persistence.xml 2010-06-16
03:26:00 UTC (rev 6438)
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence version="1.0"
+
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">
+ <persistence-unit name="widgets">
+ <!-- You can force a non-default JPA provider using one of these declarations
-->
+ <!--
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
+ -->
+
+ <!-- Use this data source name for JBoss AS -->
+ <jta-data-source>java:/DefaultDS</jta-data-source>
+ <!-- Use this data source name for Glassfish -->
+ <!--
+ <jta-data-source>jdbc/__default</jta-data-source>
+ -->
+ <properties>
+ <!-- Properties for Hibernate (default provider for JBoss AS) -->
+ <property name="hibernate.hbm2ddl.auto"
value="create-drop"/>
+ <property name="hibernate.show_sql" value="true"/>
+ <property name="hibernate.format_sql" value="false"/>
+ <property name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>
+
+ <!-- Properties for EclipseLink (default provider for GlassFish) -->
+ <property name="eclipselink.ddl-generation"
value="drop-and-create-tables"/>
+ <property name="eclipselink.logging.level"
value="FINE"/>
+
+ </properties>
+ </persistence-unit>
+</persistence>
Added: archetypes/branches/prototype/src/main/resources/import.sql
===================================================================
--- archetypes/branches/prototype/src/main/resources/import.sql
(rev 0)
+++ archetypes/branches/prototype/src/main/resources/import.sql 2010-06-16 03:26:00 UTC
(rev 6438)
@@ -0,0 +1 @@
+insert into Widget (id, partno, name, description) values (1, 'AAA001',
'Portable Hole', 'A hole for when you need to disappear fast.')
Added: archetypes/branches/prototype/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- archetypes/branches/prototype/src/main/webapp/META-INF/MANIFEST.MF
(rev 0)
+++ archetypes/branches/prototype/src/main/webapp/META-INF/MANIFEST.MF 2010-06-16 03:26:00
UTC (rev 6438)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: archetypes/branches/prototype/src/main/webapp/META-INF/context.xml
===================================================================
--- archetypes/branches/prototype/src/main/webapp/META-INF/context.xml
(rev 0)
+++ archetypes/branches/prototype/src/main/webapp/META-INF/context.xml 2010-06-16 03:26:00
UTC (rev 6438)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context>
+ <!-- disable storage of sessions across restarts -->
+ <Manager pathname=""/>
+</Context>
Added: archetypes/branches/prototype/src/main/webapp/WEB-INF/beans.xml
===================================================================
--- archetypes/branches/prototype/src/main/webapp/WEB-INF/beans.xml
(rev 0)
+++ archetypes/branches/prototype/src/main/webapp/WEB-INF/beans.xml 2010-06-16 03:26:00
UTC (rev 6438)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans
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/beans_1_0.xsd">
+ <alternatives/>
+ <decorators/>
+ <interceptors/>
+</beans>
Added: archetypes/branches/prototype/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- archetypes/branches/prototype/src/main/webapp/WEB-INF/faces-config.xml
(rev 0)
+++ archetypes/branches/prototype/src/main/webapp/WEB-INF/faces-config.xml 2010-06-16
03:26:00 UTC (rev 6438)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- This file is not required if you don't need any extra configuration. -->
+<faces-config version="2.0"
+
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_2_0.xsd">
+
+ <!-- Write your navigation rules here. You are encouraged to use CDI for creating
@Named managed beans. -->
+
+</faces-config>
Added: archetypes/branches/prototype/src/main/webapp/WEB-INF/templates/default.xhtml
===================================================================
--- archetypes/branches/prototype/src/main/webapp/WEB-INF/templates/default.xhtml
(rev 0)
+++
archetypes/branches/prototype/src/main/webapp/WEB-INF/templates/default.xhtml 2010-06-16
03:26:00 UTC (rev 6438)
@@ -0,0 +1,52 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+ <h:head>
+ <title>Java EE 6 Starter Application</title>
+ <meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
+ <h:outputStylesheet name="css/screen.css"/>
+ </h:head>
+ <h:body>
+ <div id="container">
+ <div id="content">
+ <div id="sidebar">
+ <h3>Find out more</h3>
+ <p>
+ Explore JavaServer Faces.
+ </p>
+ <ul>
+ <li><a href="http://www.javaserverfaces.org">JSF
community site</a></li>
+ </ul>
+ <p>
+ Learn more about Java EE 6 and the extensions provided by Weld and
Seam.
+ </p>
+ <ul>
+ <li><a
href="http://seamframework.org/Weld/JSR299AndWeldOverview">O...
+ <li><a href="http://seamframework.org">Project
site</a></li>
+ <li><a
href="http://seamframework.org/Documentation/SeamDocumentation#H-Wel...
+ <li><a
href="http://seamframework.org/Community/Forums">User
forums</a></li>
+ <li><a
href="http://seamframework.org/Community/MailingLists">Mailing
lists</a></li>
+ <li><a
href="https://jira.jboss.org/jira/browse/WELD">Issue
tracker</a></li>
+ </ul>
+ <p>
+ If you have an add-on, please <a
href="http://seamframework.org/Community/Forums">let us know</a> and
+ consider <a
href="http://seamframework.org/Community/Contribute">contrib...
it back to the
+ community!
+ </p>
+ </div>
+ <ui:insert name="content">
+ [Template content will be inserted here]
+ </ui:insert>
+ </div>
+ <div id="footer">
+ <h:graphicImage value="/resources/gfx/weld.png" alt="Weld
logo"/>
+ <p>
+ This project was generated from a Maven archetype maintained by the Weld
team.<br/>
+ Weld is the reference implementation of CDI, released under the Apache
License, Version 2.0.<br/>
+ </p>
+ </div>
+ </div>
+ </h:body>
+</html>
Added: archetypes/branches/prototype/src/main/webapp/WEB-INF/web.xml
===================================================================
--- archetypes/branches/prototype/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++ archetypes/branches/prototype/src/main/webapp/WEB-INF/web.xml 2010-06-16 03:26:00 UTC
(rev 6438)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="3.0"
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-app_3_0.xsd">
+
+ <!-- This is an optional parameter, but it makes troubleshooting errors much easier
-->
+ <!-- You should delete it before final deployment -->
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+
+ <!-- Activate the JSF 2.0 servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <!-- Tell the context which URLs to process with JSF -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Added: archetypes/branches/prototype/src/main/webapp/home.xhtml
===================================================================
--- archetypes/branches/prototype/src/main/webapp/home.xhtml (rev
0)
+++ archetypes/branches/prototype/src/main/webapp/home.xhtml 2010-06-16 03:26:00 UTC (rev
6438)
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+ template="/WEB-INF/templates/default.xhtml">
+ <ui:define name="content">
+ <h1>Hello World!</h1>
+ <p>Your CDI bean <code>HelloWorld</code> says <span
style="color: blue;">#{helloWorld.text}</span> using the Unified
EL.</p>
+
+ <h:form id="bv">
+ <h2>Bean Validation examples</h2>
+ <p>Enforces annotation-based constraints defined on the model
class.</p>
+ <table>
+ <tr>
+ <th style="text-align: right;">
+ <h:outputLabel for="letters"
value="Letters:"/>
+ </th>
+ <td>
+ <h:inputText id="letters"
value="#{helloWorld.letters}"/>
+ <h:message for="letters"
errorClass="invalid"/>
+ </td>
+ </tr>
+ <tr>
+ <th style="text-align: right;">
+ <h:outputLabel for="numbers"
value="Numbers:"/>
+ </th>
+ <td>
+ <h:inputText id="numbers"
value="#{helloWorld.numbers}"/>
+ <h:message for="numbers"
errorClass="invalid"/>
+ </td>
+ </tr>
+ <tr>
+ <th style="text-align: right;">
+ <h:outputLabel for="email" value="Email:"/>
+ </th>
+ <td>
+ <h:inputText id="email"
value="#{helloWorld.email}"/>
+ <h:message for="email"
errorClass="invalid"/>
+ </td>
+ </tr>
+ </table>
+ <p>
+ <h:commandButton id="check" action="check"
value="Check values"/>
+ <h:outputText value=" All clear!"
rendered="#{facesContext.postback and empty facesContext.messageList}"
style="color: green;"/>
+ </p>
+ </h:form>
+ <h2>Widgets</h2>
+ <h:dataTable var="_widget" value="#{widgets}">
+ <h:column>
+ <f:facet name="header">Id</f:facet>
+ #{_widget.id}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Part Number</f:facet>
+ #{_widget.partNumber}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Name</f:facet>
+ #{_widget.name}
+ </h:column>
+ <h:column>
+ <f:facet name="header">Description</f:facet>
+ #{_widget.description}
+ </h:column>
+ </h:dataTable>
+ </ui:define>
+</ui:composition>
Added: archetypes/branches/prototype/src/main/webapp/index.jsp
===================================================================
--- archetypes/branches/prototype/src/main/webapp/index.jsp (rev
0)
+++ archetypes/branches/prototype/src/main/webapp/index.jsp 2010-06-16 03:26:00 UTC (rev
6438)
@@ -0,0 +1 @@
+<% response.sendRedirect("home.jsf"); %>
Added: archetypes/branches/prototype/src/main/webapp/resources/css/screen.css
===================================================================
--- archetypes/branches/prototype/src/main/webapp/resources/css/screen.css
(rev 0)
+++ archetypes/branches/prototype/src/main/webapp/resources/css/screen.css 2010-06-16
03:26:00 UTC (rev 6438)
@@ -0,0 +1,39 @@
+body {
+ margin: 0;
+ padding: 0;
+ background-color: #EAECEE;
+ font-family: Verdana, sans-serif;
+ font-size: 0.9em;
+}
+#container {
+ margin: 0 auto;
+ padding: 0 20px 10px 20px;
+ border: 1px solid #666666;
+ width: 865px; /* subtract 40px from banner width for padding */
+ background: #FFFFFF url(#{request.contextPath}/resources/gfx/banner.png) no-repeat;
+ padding-top: 110px;
+}
+#sidebar {
+ font-size: 0.9em;
+ width: 225px;
+ float: right;
+ border: 1px solid #666666;
+ background: #EAECEE;
+ padding: 0 15px 5px 15px;
+}
+#sidebar ul {
+ padding-left: 30px;
+}
+#footer {
+ clear: both;
+ text-align: center;
+ color: #666666;
+ font-size: 0.85em;
+}
+code {
+ font-size: 1.1em;
+}
+span.invalid {
+ padding-left: 3px;
+ color: red;
+}
\ No newline at end of file
Added: archetypes/branches/prototype/src/main/webapp/resources/gfx/banner.png
===================================================================
(Binary files differ)
Property changes on:
archetypes/branches/prototype/src/main/webapp/resources/gfx/banner.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: archetypes/branches/prototype/src/main/webapp/resources/gfx/weld.png
===================================================================
(Binary files differ)
Property changes on: archetypes/branches/prototype/src/main/webapp/resources/gfx/weld.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: archetypes/branches/prototype/src/test/java/com/mycompany/HelloWorldTest.java
===================================================================
--- archetypes/branches/prototype/src/test/java/com/mycompany/HelloWorldTest.java
(rev 0)
+++
archetypes/branches/prototype/src/test/java/com/mycompany/HelloWorldTest.java 2010-06-16
03:26:00 UTC (rev 6438)
@@ -0,0 +1,12 @@
+package com.mycompany;
+
+import org.testng.annotations.Test;
+
+public class HelloWorldTest
+{
+ @Test
+ public void testGetText() {
+ HelloWorld fixture = new HelloWorld();
+ assert "Hello World!".equals(fixture.getText());
+ }
+}