Skip to content

Commit

Permalink
Adding Booking-Monitor use case powered by Errai
Browse files Browse the repository at this point in the history
  • Loading branch information
csadilek authored and pmuir committed May 28, 2012
1 parent d09e99f commit 92646c9
Show file tree
Hide file tree
Showing 34 changed files with 877 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -9,3 +9,5 @@ target
.errai
gwt-unitCache
rpcPolicyManifest
src/main/webapp/WEB-INF/deploy/
src/main/webapp/BookingMonitor
191 changes: 188 additions & 3 deletions pom.xml
Expand Up @@ -33,6 +33,12 @@
to work with JBoss EAP 6. It requires you have access to the JBoss EAP 6
maven repository. -->
<jboss.bom.version>1.0.0.M7</jboss.bom.version>

<errai.version>2.0.CR2</errai.version>
<gwt.version>2.4.0</gwt.version>
<gwt.maven.version>2.4.0</gwt.maven.version>
<mvel.version>2.1.Beta8</mvel.version>

</properties>

<dependencyManagement>
Expand Down Expand Up @@ -139,6 +145,93 @@
</exclusions>
</dependency>


<!-- The next set of dependencies are for Errai, which we use for
the TicketMonster admin console -->
<dependency>
<groupId>org.jboss.errai</groupId>
<artifactId>errai-bus</artifactId>
<version>${errai.version}</version>
<exclusions>
<exclusion>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</exclusion>
<exclusion>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.errai</groupId>
<artifactId>errai-ioc</artifactId>
<version>${errai.version}</version>
<exclusions>
<exclusion>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
</exclusion>
<exclusion>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.errai</groupId>
<artifactId>errai-tools</artifactId>
<version>${errai.version}</version>
</dependency>
<dependency>
<groupId>org.mvel</groupId>
<artifactId>mvel2</artifactId>
<version>${mvel.version}</version>
</dependency>

<!-- CDI Integration Modules -->
<dependency>
<groupId>org.jboss.errai</groupId>
<artifactId>errai-cdi-client</artifactId>
<version>${errai.version}</version>
</dependency>

<dependency>
<groupId>org.jboss.errai</groupId>
<artifactId>errai-javax-enterprise</artifactId>
<version>${errai.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.jboss.errai</groupId>
<artifactId>errai-weld-integration</artifactId>
<version>${errai.version}</version>
<exclusions>
<exclusion>
<groupId>
org.jboss.weld.servlet
</groupId>
<artifactId>weld-servlet</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>${gwt.version}</version>
<scope>provided</scope>
</dependency>
<!-- End of Errai dependencies -->

<!-- Now we declare any tools needed -->

<!-- Annotation processor to generate the JPA 2.0 metamodel classes
Expand Down Expand Up @@ -195,11 +288,55 @@
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<!-- Java EE 6 doesn't require web.xml, Maven needs to
catch up! -->
<failOnMissingWebXml>false</failOnMissingWebXml>
<!-- We must exclude GWT client local classes from the
deployment, or classpath scanners such as Hibernate and Weld get confused
when the webapp is bootstrapping. -->
<packagingExcludes>**/javax/**/*.*,**/client/local/**/*.class</packagingExcludes>

<archive>
<manifestEntries>
<Dependencies>org.jboss.as.naming,org.jboss.as.server,org.jboss.msc</Dependencies>
</manifestEntries>
</archive>

</configuration>
</plugin>

<!-- GWT plugin to compile client-side java code to javascript
and to run GWT development mode -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>${gwt.maven.version}</version>
<configuration>
<inplace>true</inplace>
<logLevel>INFO</logLevel>
<extraJvmArgs>-Xmx512m</extraJvmArgs>

<!-- Configure GWT's development mode (formerly known
as hosted mode) to not start the default server (embedded jetty), but to
download the HTML host page from the configured runTarget. -->
<noServer>true</noServer>
<runTarget>http://localhost:8080/ticket-monster/booking-monitor.html</runTarget>

</configuration>
<executions>
<execution>
<goals>
<goal>resources</goal>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>gwt-clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- The JBoss AS plugin deploys your war to a local JBoss AS
container -->
<!-- To use, set the JBOSS_HOME environment variable and run:
Expand All @@ -210,8 +347,56 @@
<version>7.1.1.Final</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>

<configuration>
<filesets>
<fileset>
<directory>.errai</directory>
<includes>
<include>**</include>
</includes>
</fileset>
</filesets>
</configuration>
</plugin>
</plugins>

<pluginManagement>
<plugins>

<!-- m2e (Maven integration for Eclipse) requires the following
configuration -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<versionRange>[2.3.0,)</versionRange>
<goals>
<goal>resources</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>

</build>

<profiles>
Expand Down
@@ -0,0 +1,22 @@
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6//EN"
"http://google-web-toolkit.googlecode.com/svn/releases/1.6/distro-source/core/src/gwt-module.dtd">

<!--
This file declares the Errai/GWT module for the TicketMonster booking monitor,
which shares the model classes with the user-facing part of the app, but defines
its own user interface for TicketMonster administrators.
-->

<module rename-to="BookingMonitor">
<inherits name="org.jboss.errai.common.ErraiCommon"/>
<inherits name="org.jboss.errai.bus.ErraiBus"/>
<inherits name="org.jboss.errai.ioc.Container"/>
<inherits name="org.jboss.errai.enterprise.CDI"/>

<!-- Model classes that are shared with the rest of the application -->
<source path="model"/>

<!-- Classes that are specific to 'booking monitor' features; not shared with rest of app -->
<source path="monitor"/>

</module>
@@ -1,7 +1,11 @@
package org.jboss.jdf.example.ticketmonster.model;

import java.io.Serializable;

import javax.persistence.Embeddable;

import org.jboss.errai.common.client.api.annotations.Portable;

/**
* <p>
* A reusable representation of an address.
Expand All @@ -16,7 +20,10 @@
* @author Pete Muir
*/
@Embeddable
public class Address {
@Portable
public class Address implements Serializable {

private static final long serialVersionUID = -1;

/* Declaration of fields */
private String street;
Expand Down
Expand Up @@ -4,6 +4,8 @@
import static javax.persistence.FetchType.EAGER;
import static javax.persistence.GenerationType.IDENTITY;

import java.math.BigDecimal;
import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
Expand All @@ -19,6 +21,7 @@

import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;
import org.jboss.errai.common.client.api.annotations.Portable;

/**
* <p>
Expand All @@ -33,7 +36,10 @@
* @author Marius Bogoevici
*/
@Entity
public class Booking {
@Portable
public class Booking implements Serializable {

private static final long serialVersionUID = -1;

/* Declaration of fields */

Expand Down
Expand Up @@ -12,6 +12,9 @@
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotEmpty;
import org.jboss.errai.common.client.api.annotations.Portable;

/**
* <p>
* Represents an event, which may have multiple performances with different dates and venues.
Expand All @@ -33,6 +36,7 @@
*/
@SuppressWarnings("serial")
@Entity
@Portable
public class Event implements Serializable {

/* Declaration of fields */
Expand Down
Expand Up @@ -10,6 +10,7 @@
import javax.persistence.Id;

import org.hibernate.validator.constraints.NotEmpty;
import org.jboss.errai.common.client.api.annotations.Portable;

/**
* <p>
Expand All @@ -29,6 +30,7 @@
*/
@SuppressWarnings("serial")
@Entity
@Portable
public class EventCategory implements Serializable {

/* Declaration of fields */
Expand Down
Expand Up @@ -13,6 +13,8 @@

import org.hibernate.validator.constraints.URL;

import org.jboss.errai.common.client.api.annotations.Portable;

/**
* <p>
* A reference to a media object such as images, sound bites, video recordings, that can be used in the application.
Expand All @@ -32,6 +34,7 @@
*/
@SuppressWarnings("serial")
@Entity
@Portable
public class MediaItem implements Serializable {

/* Declaration of fields */
Expand Down
@@ -1,5 +1,7 @@
package org.jboss.jdf.example.ticketmonster.model;

import org.jboss.errai.common.client.api.annotations.Portable;

/**
* <p>
* The {@link MediaType} describes the types of media this application can handle and render.
Expand All @@ -20,6 +22,7 @@
* @author Pete Muir
*
*/
@Portable
public enum MediaType {

/**
Expand Down
Expand Up @@ -16,6 +16,7 @@
import javax.validation.constraints.NotNull;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.jboss.errai.common.client.api.annotations.Portable;

/**
* <p>
Expand All @@ -39,6 +40,7 @@
@Table(uniqueConstraints = @UniqueConstraint(columnNames = { "date", "show_id" }))
// TODO Document use of @JsonIgnoreProperties
@JsonIgnoreProperties("show")
@Portable
public class Performance implements Serializable {

/* Declaration of fields */
Expand Down

0 comments on commit 92646c9

Please sign in to comment.