You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rm...@apache.org on 2014/04/19 18:42:44 UTC
svn commit: r1588673 [1/3] - in /tomee/tomee/trunk/examples: ./
deltaspike-fullstack/ deltaspike-fullstack/src/
deltaspike-fullstack/src/main/ deltaspike-fullstack/src/main/java/
deltaspike-fullstack/src/main/java/org/ deltaspike-fullstack/src/main/jav...
Author: rmannibucau
Date: Sat Apr 19 16:42:42 2014
New Revision: 1588673
URL: http://svn.apache.org/r1588673
Log:
TOMEE-1154 DeltaSpike full-stack demo. Thanks Gerhard
Added:
tomee/tomee/trunk/examples/deltaspike-fullstack/
tomee/tomee/trunk/examples/deltaspike-fullstack/README.md
tomee/tomee/trunk/examples/deltaspike-fullstack/pom.xml
tomee/tomee/trunk/examples/deltaspike-fullstack/src/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/CustomProjectStage.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/DebugPhaseListener.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/WebappMessageBundle.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/AbstractDomainObject.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/Comment.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/Feedback.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/User.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/DifferentName.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/DifferentNameValidator.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Full.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Name.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Partial.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UniqueUserName.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UniqueUserNameValidator.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UserName.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/FeedbackRepository.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/GenericRepository.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/Repository.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/UserRepository.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/AbstractGenericJpaRepository.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/EntityManagerProducer.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/JpaFeedbackRepository.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/JpaUserRepository.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/startup/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/startup/ExtValStartupListener.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/startup/ModuleStartupObserver.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/FeedbackPage.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/InfoPage.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/MenuBean.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/RegistrationPage.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/UserHolder.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/config/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/config/Pages.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/security/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/security/LoginAccessDecisionVoter.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/util/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/util/InfoBean.java
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/resources/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/resources/LICENSE.txt
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/resources/META-INF/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/resources/META-INF/faces-config.xml
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/resources/META-INF/persistence.xml
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/resources/META-INF/services/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/resources/META-INF/services/org.apache.deltaspike.core.api.projectstage.ProjectStageHolder
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/resources/META-INF/validation.xml
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/resources/NOTICE.txt
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/resources/org/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/resources/org/superbiz/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/resources/org/superbiz/deltaspike/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/resources/org/superbiz/deltaspike/i18n/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/resources/org/superbiz/deltaspike/i18n/messages.properties
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/WEB-INF/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/WEB-INF/beans.xml
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/WEB-INF/faces-config.xml
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/WEB-INF/web.xml
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/layout/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/layout/main-template.xhtml
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/layout/menu.xhtml
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/pages/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/pages/about.xhtml
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/pages/index.xhtml
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/pages/login.xhtml
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/pages/registration.xhtml
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/pages/secure/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/pages/secure/feedbackList.xhtml
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/codi_logo.png (with props)
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/myfaces_logo.jpg (with props)
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/slices/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/slices/code_section.png (with props)
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/slices/footer.png (with props)
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/slices/h2.png (with props)
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/slices/left_menu_bottom.png (with props)
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/slices/left_menu_expand.gif (with props)
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/slices/left_menu_expand_hover.gif (with props)
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/slices/left_menu_expand_selected.gif (with props)
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/slices/left_menu_option.gif (with props)
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/slices/left_menu_option_hover.gif (with props)
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/slices/left_menu_top.png (with props)
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/slices/logo_banner_container.png (with props)
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/slices/main_space_list.gif (with props)
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/slices/table_head.png (with props)
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/slices/table_head_dark.png (with props)
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/slices/top_menu.png (with props)
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/slices/top_menu_hover.png (with props)
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/images/slices/transparent.gif (with props)
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/styles/
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/styles/base.css
tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/webapp/resources/styles/theme.css
Modified:
tomee/tomee/trunk/examples/pom.xml
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/README.md
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/README.md?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/README.md (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/README.md Sat Apr 19 16:42:42 2014
@@ -0,0 +1,64 @@
+Title: Apache DeltaSpike Demo
+Notice: Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ .
+ http://www.apache.org/licenses/LICENSE-2.0
+ .
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+<h2>Steps to run the example</h2>
+
+Build and start the demo:
+
+ mvn clean package tomee:run
+
+Open:
+
+ http://localhost:8080/
+
+This example shows how to improve JSF2/CDI/BV/JPA applications with features provided by Apache DeltaSpike and MyFaces ExtVal.
+
+<h2>Intro of Apache DeltaSpike and MyFaces ExtVal</h2>
+
+The Apache DeltaSpike project hosts portable extensions for Contexts and Dependency Injection (CDI - JSR 299). DeltaSpike is a toolbox for your CDI application. Like CDI itself DeltaSpike is focused on type-safety. It is a modularized and extensible framework. So it's easy to choose the needed parts to facilitate the daily work in your project.
+
+MyFaces Extensions Validator (aka ExtVal) is a JSF centric validation framework which is compatible with JSF 1.x and JSF 2.x.
+This example shows how it improves the default integration of Bean-Validation (JSR-303) with JSF2 as well as meta-data based cross-field validation.
+
+
+<h2>Illustrated Features</h2>
+
+<h3>Apache DeltaSpike</h3>
+
+<ul>
+ <li><a href="./src/main/java/org/superbiz/deltaspike/view/config/Pages.java" target="_blank">Type-safe view-config</a></li>
+ <li><a href="./src/main/java/org/superbiz/deltaspike/view/InfoPage.java" target="_blank">Type-safe (custom) view-meta-data</a></li>
+ <li><a href="./src/main/java/org/superbiz/deltaspike/view/MenuBean.java" target="_blank">Type-safe navigation</a></li>
+ <li><a href="./src/main/java/org/superbiz/deltaspike/CustomProjectStage.java" target="_blank">Type-safe custom project-stage</a></li>
+ <li><a href="./src/main/java/org/superbiz/deltaspike/view/UserHolder.java" target="_blank">@WindowScoped</a></li>
+ <li><a href="./src/main/java/org/superbiz/deltaspike/view/MenuBean.java" target="_blank">Controlling DeltaSpike grouped-conversations with GroupedConversationManager</a></li>
+ <li><a href="./src/main/java/org/superbiz/deltaspike/view/FeedbackPage.java" target="_blank">@GroupedConversationScoped</a></li>
+ <li><a href="./src/main/java/org/superbiz/deltaspike/view/FeedbackPage.java" target="_blank">Manual conversation handling</a></li>
+ <li><a href="./src/main/java/org/superbiz/deltaspike/view/security/LoginAccessDecisionVoter.java" target="_blank">Secured pages (AccessDecisionVoter)</a></li>
+ <li><a href="./src/main/java/org/superbiz/deltaspike/repository/Repository.java" target="_blank">@Transactional</a></li>
+ <li><a href="./src/main/java/org/superbiz/deltaspike/view/RegistrationPage.java" target="_blank">I18n (type-safe messages)</a></li>
+ <li><a href="./src/main/java/org/superbiz/deltaspike/domain/validation/UniqueUserNameValidator.java" target="_blank">Dependency-Injection for JSR303 (BV) constraint-validators</a></li>
+ <li><a href="./src/main/java/org/superbiz/deltaspike/DebugPhaseListener.java" target="_blank">Dependency-Injection for JSF phase-listeners</a></li>
+</ul>
+
+<h3>Apache MyFaces ExtVal</h3>
+
+<ul>
+ <li><a href="./src/main/java/org/superbiz/myfaces/view/RegistrationPage.java" target="_blank">Cross-Field validation (@Equals)</a></li>
+ <li><a href="./src/main/java/org/superbiz/myfaces/view/RegistrationPage.java" target="_blank">Type-safe group-validation (@BeanValidation) for JSF action-methods</a></li>
+</ul>
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/pom.xml
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/pom.xml?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/pom.xml (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/pom.xml Sat Apr 19 16:42:42 2014
@@ -0,0 +1,191 @@
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ You under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<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">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.superbiz</groupId>
+ <artifactId>deltaspike-stack001</artifactId>
+
+ <name>OpenEJB :: Examples :: JSF2/CDI/BV/JPA/DeltaSpike</name>
+ <version>1.0-SNAPSHOT</version>
+
+ <packaging>war</packaging>
+
+ <properties>
+ <myfaces2.version>2.1.15</myfaces2.version>
+ <ds.version>0.6</ds.version>
+ <extval.version>2.0.7</extval.version>
+ </properties>
+
+ <build>
+ <defaultGoal>install</defaultGoal>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.0</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.openejb.maven</groupId>
+ <artifactId>tomee-maven-plugin</artifactId>
+ <version>1.6.1-SNAPSHOT</version>
+ <configuration>
+ <context>ROOT</context>
+ <simpleLog>true</simpleLog>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <repositories>
+ <repository>
+ <id>prime-repo</id>
+ <name>Prime Technology Maven Repository</name>
+ <url>http://repository.primefaces.org/</url>
+ <layout>default</layout>
+ </repository>
+ </repositories>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>javaee-api</artifactId>
+ <version>6.0-5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.deltaspike.core</groupId>
+ <artifactId>deltaspike-core-api</artifactId>
+ <version>${ds.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.deltaspike.core</groupId>
+ <artifactId>deltaspike-core-impl</artifactId>
+ <version>${ds.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.deltaspike.modules</groupId>
+ <artifactId>deltaspike-jsf-module-api</artifactId>
+ <version>${ds.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.deltaspike.modules</groupId>
+ <artifactId>deltaspike-jsf-module-impl</artifactId>
+ <version>${ds.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.deltaspike.modules</groupId>
+ <artifactId>deltaspike-jpa-module-api</artifactId>
+ <version>${ds.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.deltaspike.modules</groupId>
+ <artifactId>deltaspike-jpa-module-impl</artifactId>
+ <version>${ds.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.deltaspike.modules</groupId>
+ <artifactId>deltaspike-security-module-api</artifactId>
+ <version>${ds.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.deltaspike.modules</groupId>
+ <artifactId>deltaspike-security-module-impl</artifactId>
+ <version>${ds.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.deltaspike.modules</groupId>
+ <artifactId>deltaspike-bean-validation-module-api</artifactId>
+ <version>${ds.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.deltaspike.modules</groupId>
+ <artifactId>deltaspike-bean-validation-module-impl</artifactId>
+ <version>${ds.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.validator</groupId>
+ <artifactId>myfaces-extval-core</artifactId>
+ <version>${extval.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.validator.validation-modules</groupId>
+ <artifactId>myfaces-extval-property-validation</artifactId>
+ <version>${extval.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.extensions.validator.validation-modules</groupId>
+ <artifactId>myfaces-extval-bean-validation</artifactId>
+ <version>${extval.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>${myfaces2.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <version>${myfaces2.version}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- 3rd party libs -->
+ <dependency>
+ <groupId>org.primefaces</groupId>
+ <artifactId>primefaces</artifactId>
+ <version>2.2</version>
+ </dependency>
+ </dependencies>
+
+ <!--
+ This section allows you to configure where to publish libraries for sharing.
+ It is not required and may be deleted. For more information see:
+ http://maven.apache.org/plugins/maven-deploy-plugin/
+ -->
+ <distributionManagement>
+ <repository>
+ <id>localhost</id>
+ <url>file://${basedir}/target/repo/</url>
+ </repository>
+ <snapshotRepository>
+ <id>localhost</id>
+ <url>file://${basedir}/target/snapshot-repo/</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+</project>
+
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/CustomProjectStage.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/CustomProjectStage.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/CustomProjectStage.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/CustomProjectStage.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike;
+
+import org.apache.deltaspike.core.api.projectstage.ProjectStage;
+import org.apache.deltaspike.core.api.projectstage.ProjectStageHolder;
+
+public class CustomProjectStage implements ProjectStageHolder
+{
+ public static final class Debugging extends ProjectStage
+ {
+ private static final long serialVersionUID = -8626602281649294170L;
+ }
+
+ public static final Debugging Debugging = new Debugging();
+}
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/DebugPhaseListener.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/DebugPhaseListener.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/DebugPhaseListener.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/DebugPhaseListener.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike;
+
+import org.apache.deltaspike.core.api.exclude.Exclude;
+import org.apache.deltaspike.core.api.projectstage.ProjectStage;
+import org.apache.deltaspike.jsf.api.listener.phase.JsfPhaseListener;
+
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+import java.util.logging.Logger;
+
+@Exclude(exceptIfProjectStage = {ProjectStage.Development.class, CustomProjectStage.Debugging.class})
+
+@JsfPhaseListener
+public class DebugPhaseListener implements PhaseListener
+{
+ private static final long serialVersionUID = 5899542118538949019L;
+
+ private Logger logger = Logger.getLogger(Logger.class.getName());
+
+ public void beforePhase(PhaseEvent phaseEvent)
+ {
+ this.logger.info("before " + phaseEvent.getPhaseId());
+ }
+
+ public void afterPhase(PhaseEvent phaseEvent)
+ {
+ this.logger.info("after " + phaseEvent.getPhaseId());
+ }
+
+ public PhaseId getPhaseId()
+ {
+ return PhaseId.ANY_PHASE;
+ }
+}
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/WebappMessageBundle.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/WebappMessageBundle.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/WebappMessageBundle.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/WebappMessageBundle.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike;
+
+import org.apache.deltaspike.core.api.message.MessageBundle;
+import org.apache.deltaspike.core.api.message.MessageContextConfig;
+
+@MessageBundle
+@MessageContextConfig(messageSource = "org.superbiz.deltaspike.i18n.messages")
+public interface WebappMessageBundle
+{
+ String msgAccessDenied();
+
+ String msgUserRegistered(String userName);
+
+ String msgLoginSuccessful();
+
+ String msgLoginFailed();
+
+ String msgError(String message);
+
+ String msgWelcome();
+}
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/AbstractDomainObject.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/AbstractDomainObject.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/AbstractDomainObject.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/AbstractDomainObject.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain;
+
+import javax.persistence.*;
+import java.io.Serializable;
+
+@MappedSuperclass
+public abstract class AbstractDomainObject implements Serializable
+{
+ @Id
+ @GeneratedValue
+ private Long id;
+
+ @Version
+ private Long version;
+
+ public boolean isTransient()
+ {
+ return this.version == null;
+ }
+
+ public Long getId()
+ {
+ return id;
+ }
+}
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/Comment.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/Comment.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/Comment.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/Comment.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.ManyToOne;
+
+@Entity
+public class Comment extends AbstractDomainObject
+{
+ private static final long serialVersionUID = -5718296682587279635L;
+
+ @Column(length = 2048)
+ private String description;
+
+ @ManyToOne(optional = false)
+ private Feedback feedback;
+
+ void setFeedback(Feedback feedback)
+ {
+ this.feedback = feedback;
+ }
+
+ /*
+ * generated
+ */
+
+ public Comment()
+ {
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+}
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/Feedback.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/Feedback.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/Feedback.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/Feedback.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.OneToMany;
+import java.util.ArrayList;
+import java.util.List;
+
+@Entity
+public class Feedback extends AbstractDomainObject
+{
+ private static final long serialVersionUID = -431924785266663236L;
+
+ @Column(nullable = false, length = 32)
+ private String topic;
+
+ @Column(length = 128)
+ private String description;
+
+ @OneToMany(mappedBy = "feedback", cascade = CascadeType.ALL)
+ private List<Comment> comments = new ArrayList<Comment>();
+
+ public void addComment(Comment comment)
+ {
+ comment.setFeedback(this);
+ this.comments.add(comment);
+ }
+
+ /*
+ * generated
+ */
+
+ public List<Comment> getComments()
+ {
+ return comments;
+ }
+
+ public String getTopic()
+ {
+ return topic;
+ }
+
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setTopic(String topic)
+ {
+ this.topic = topic;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+}
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/User.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/User.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/User.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/User.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain;
+
+import org.superbiz.deltaspike.domain.validation.*;
+
+import javax.enterprise.inject.Typed;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.NamedQuery;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+
+@Table(name = "T_User")
+@Entity
+@NamedQuery(name = "findUserByName", query = "select u from User u where u.userName = :currentUser")
+@DifferentName(groups = Partial.class)
+@Typed()
+public class User extends AbstractDomainObject
+{
+ private static final long serialVersionUID = 3810638653455000233L;
+
+ @UserName(groups = UniqueUserName.class)
+ @Column(nullable = false, length = 9, unique = true)
+ private String userName;
+
+ @Size(min = 2, max = 20, message = "invalid first name")
+ @NotNull
+ @Column
+ private String firstName;
+
+ @Column
+ @Name(message = "invalid last name")
+ private String lastName;
+
+ @Column
+ private String password;
+
+ /*
+ * generated
+ */
+
+ public User()
+ {
+ }
+
+ public User(String userName, String firstName, String lastName)
+ {
+ this.userName = userName;
+ this.firstName = firstName;
+ this.lastName = lastName;
+ }
+
+ public String getUserName()
+ {
+ return userName;
+ }
+
+ public void setUserName(String userName)
+ {
+ this.userName = userName;
+ }
+
+ public String getFirstName()
+ {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName)
+ {
+ this.firstName = firstName;
+ }
+
+ public String getLastName()
+ {
+ return lastName;
+ }
+
+ public void setLastName(String lastName)
+ {
+ this.lastName = lastName;
+ }
+
+ public String getPassword()
+ {
+ return password;
+ }
+
+ public void setPassword(String password)
+ {
+ this.password = password;
+ }
+}
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/DifferentName.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/DifferentName.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/DifferentName.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/DifferentName.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain.validation;
+
+import javax.validation.Constraint;
+import javax.validation.Payload;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Constraint(validatedBy = DifferentNameValidator.class)
+@Target(TYPE)
+@Retention(RUNTIME)
+public @interface DifferentName
+{
+ String message() default "invalid name";
+
+ Class<?>[] groups() default {};
+
+ Class<? extends Payload>[] payload() default {};
+}
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/DifferentNameValidator.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/DifferentNameValidator.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/DifferentNameValidator.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/DifferentNameValidator.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain.validation;
+
+import org.superbiz.deltaspike.domain.User;
+
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+
+public class DifferentNameValidator implements ConstraintValidator<DifferentName, User>
+{
+ public void initialize(DifferentName differentName)
+ {
+ }
+
+ public boolean isValid(User person, ConstraintValidatorContext constraintValidatorContext)
+ {
+ return person == null || !(person.getFirstName() != null && person.getFirstName().equals(person.getLastName()));
+ }
+}
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Full.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Full.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Full.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Full.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain.validation;
+
+import javax.validation.GroupSequence;
+import javax.validation.groups.Default;
+
+@GroupSequence({Default.class, UniqueUserName.class})
+public interface Full
+{
+}
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Name.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Name.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Name.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Name.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain.validation;
+
+import javax.validation.Constraint;
+import javax.validation.Payload;
+import javax.validation.ReportAsSingleViolation;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Size(min = 2, max = 20)
+@NotNull
+
+@Constraint(validatedBy = {})
+@ReportAsSingleViolation
+
+@Target({METHOD, FIELD, ANNOTATION_TYPE})
+@Retention(RUNTIME)
+public @interface Name
+{
+ public abstract String message() default "invalid name";
+
+ public abstract Class<?>[] groups() default {};
+
+ public abstract Class<? extends Payload>[] payload() default {};
+}
\ No newline at end of file
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Partial.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Partial.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Partial.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/Partial.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain.validation;
+
+public interface Partial
+{
+}
\ No newline at end of file
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UniqueUserName.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UniqueUserName.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UniqueUserName.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UniqueUserName.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain.validation;
+
+public interface UniqueUserName
+{
+}
\ No newline at end of file
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UniqueUserNameValidator.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UniqueUserNameValidator.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UniqueUserNameValidator.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UniqueUserNameValidator.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain.validation;
+
+import org.superbiz.deltaspike.repository.UserRepository;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.inject.Inject;
+import javax.validation.ConstraintValidator;
+import javax.validation.ConstraintValidatorContext;
+
+@ApplicationScoped
+public class UniqueUserNameValidator implements ConstraintValidator<UserName, String>
+{
+ @Inject
+ private UserRepository userRepository;
+
+ public void initialize(UserName differentName)
+ {
+ }
+
+ public boolean isValid(String userName, ConstraintValidatorContext constraintValidatorContext)
+ {
+ return this.userRepository.loadUser(userName) == null;
+ }
+}
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UserName.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UserName.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UserName.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/domain/validation/UserName.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.domain.validation;
+
+import javax.validation.Constraint;
+import javax.validation.Payload;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import javax.validation.groups.Default;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@NotNull(groups = Default.class)
+@Size(min = 2, max = 9, message = "invalid name", groups = Default.class)
+
+@Constraint(validatedBy = UniqueUserNameValidator.class)
+@Target(FIELD)
+@Retention(RUNTIME)
+public @interface UserName
+{
+ String message() default "user-name exists already";
+
+ Class<?>[] groups() default {};
+
+ Class<? extends Payload>[] payload() default {};
+}
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/FeedbackRepository.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/FeedbackRepository.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/FeedbackRepository.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/FeedbackRepository.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.repository;
+
+import org.superbiz.deltaspike.domain.Feedback;
+
+public interface FeedbackRepository extends GenericRepository<Feedback>
+{
+}
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/GenericRepository.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/GenericRepository.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/GenericRepository.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/GenericRepository.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.repository;
+
+import org.superbiz.deltaspike.domain.AbstractDomainObject;
+
+import java.io.Serializable;
+import java.util.List;
+
+public interface GenericRepository<T extends AbstractDomainObject> extends Serializable
+{
+ void save(T entity);
+
+ void remove(T entity);
+
+ List<T> loadAll();
+
+ T loadById(Long id);
+
+ T createNewEntity();
+}
\ No newline at end of file
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/Repository.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/Repository.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/Repository.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/Repository.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.repository;
+
+import org.apache.deltaspike.jpa.api.transaction.Transactional;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Stereotype;
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Stereotype
+
+@Target({TYPE})
+@Retention(RUNTIME)
+@Documented
+
+@RequestScoped
+@Transactional
+public @interface Repository
+{
+}
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/UserRepository.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/UserRepository.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/UserRepository.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/UserRepository.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,26 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.repository;
+
+import org.superbiz.deltaspike.domain.User;
+
+public interface UserRepository extends GenericRepository<User>
+{
+ User loadUser(String userName);
+}
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/AbstractGenericJpaRepository.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/AbstractGenericJpaRepository.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/AbstractGenericJpaRepository.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/AbstractGenericJpaRepository.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.repository.jpa;
+
+import org.superbiz.deltaspike.domain.AbstractDomainObject;
+import org.superbiz.deltaspike.repository.GenericRepository;
+
+import javax.inject.Inject;
+import javax.persistence.EntityManager;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.List;
+
+/**
+ * Abstract repository class which provides default implementations for common repository methods.
+ */
+public abstract class AbstractGenericJpaRepository<T extends AbstractDomainObject> implements GenericRepository<T>
+{
+ protected final Class<? extends AbstractDomainObject> entityClass;
+
+ @Inject
+ protected EntityManager entityManager;
+
+ public AbstractGenericJpaRepository()
+ {
+ Class currentClass = getClass();
+
+ if (currentClass.getName().contains("$$"))
+ { //we are in a proxy
+ currentClass = currentClass.getSuperclass();
+ }
+
+ for (Type interfaceClass : currentClass.getGenericInterfaces())
+ {
+ for (Type genericInterfaceClass : ((Class) interfaceClass).getGenericInterfaces())
+ {
+ if (genericInterfaceClass instanceof ParameterizedType &&
+ GenericRepository.class.isAssignableFrom((Class) ((ParameterizedType) genericInterfaceClass).getRawType()))
+ {
+ for (Type parameterizedType : ((ParameterizedType) genericInterfaceClass).getActualTypeArguments())
+ {
+ if (AbstractDomainObject.class.isAssignableFrom((Class) parameterizedType))
+ {
+ this.entityClass = (Class<? extends AbstractDomainObject>) parameterizedType;
+ return;
+ }
+ }
+ }
+ }
+ }
+
+ throw new IllegalStateException("Entity type of " + currentClass.getName() + " not detected!");
+ }
+
+ @Override
+ public T createNewEntity()
+ {
+ try
+ {
+ return (T)this.entityClass.newInstance();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void save(T entity)
+ {
+ if (entity.isTransient())
+ {
+ this.entityManager.persist(entity);
+ }
+ else
+ {
+ this.entityManager.merge(entity);
+ }
+ }
+
+ public void remove(T entity)
+ {
+ if (entity.isTransient())
+ {
+ throw new IllegalStateException("entity is not persistent");
+ }
+
+ this.entityManager.remove(loadById(entity.getId()));
+ }
+
+ public List<T> loadAll()
+ {
+ return (List<T>) this.entityManager.createQuery("select entity from " + this.entityClass.getSimpleName() + " entity")
+ .getResultList();
+ }
+
+ public T loadById(Long id)
+ {
+ return (T) this.entityManager.find(this.entityClass, id);
+ }
+}
\ No newline at end of file
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/EntityManagerProducer.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/EntityManagerProducer.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/EntityManagerProducer.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/EntityManagerProducer.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.repository.jpa;
+
+import javax.enterprise.context.ApplicationScoped;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Default;
+import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.Produces;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.PersistenceUnit;
+
+@ApplicationScoped
+public class EntityManagerProducer
+{
+ @PersistenceUnit(unitName = "demoApplicationPU")
+ private EntityManagerFactory entityManagerFactory;
+
+ @Produces
+ @Default
+ @RequestScoped
+ public EntityManager create()
+ {
+ return this.entityManagerFactory.createEntityManager();
+ }
+
+ public void dispose(@Disposes @Default EntityManager entityManager)
+ {
+ if (entityManager.isOpen())
+ {
+ entityManager.close();
+ }
+ }
+}
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/JpaFeedbackRepository.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/JpaFeedbackRepository.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/JpaFeedbackRepository.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/JpaFeedbackRepository.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.repository.jpa;
+
+import org.superbiz.deltaspike.domain.Feedback;
+import org.superbiz.deltaspike.repository.FeedbackRepository;
+import org.superbiz.deltaspike.repository.Repository;
+
+@Repository
+public class JpaFeedbackRepository extends AbstractGenericJpaRepository<Feedback> implements FeedbackRepository
+{
+ private static final long serialVersionUID = -4140472572607337575L;
+}
\ No newline at end of file
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/JpaUserRepository.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/JpaUserRepository.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/JpaUserRepository.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/repository/jpa/JpaUserRepository.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.repository.jpa;
+
+import org.superbiz.deltaspike.domain.User;
+import org.superbiz.deltaspike.repository.Repository;
+import org.superbiz.deltaspike.repository.UserRepository;
+
+import javax.persistence.Query;
+import java.util.List;
+
+@Repository
+public class JpaUserRepository extends AbstractGenericJpaRepository<User> implements UserRepository
+{
+ private static final long serialVersionUID = 672568789774892077L;
+
+ public User loadUser(String userName)
+ {
+ Query query = this.entityManager.createNamedQuery("findUserByName");
+ query.setParameter("currentUser", userName);
+
+ //just for the demo:
+ List result = query.getResultList();
+ if (result != null && result.size() == 1)
+ {
+ return (User) result.iterator().next();
+ }
+ return null;
+ }
+}
\ No newline at end of file
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/startup/ExtValStartupListener.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/startup/ExtValStartupListener.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/startup/ExtValStartupListener.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/startup/ExtValStartupListener.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.startup;
+
+import org.apache.myfaces.extensions.validator.core.DefaultExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.core.ExtValCoreConfiguration;
+import org.apache.myfaces.extensions.validator.core.proxy.DefaultProxyHelper;
+import org.apache.myfaces.extensions.validator.core.proxy.ProxyHelper;
+import org.apache.myfaces.extensions.validator.core.startup.AbstractStartupListener;
+
+//TODO remove it after upgrading to ExtVal r8+
+public class ExtValStartupListener extends AbstractStartupListener
+{
+ @Override
+ protected void init()
+ {
+ ExtValCoreConfiguration.use(new DefaultExtValCoreConfiguration() {
+ @Override
+ public ProxyHelper proxyHelper() {
+ return new DefaultProxyHelper() {
+ @Override
+ public boolean isProxiedClass(Class currentClass) {
+ if (currentClass == null || currentClass.getSuperclass() == null) {
+ return false;
+ }
+ return currentClass.getName().startsWith(currentClass.getSuperclass().getName()) &&
+ currentClass.getName().contains("$$");
+ }
+ };
+ }
+ }, true);
+ }
+}
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/startup/ModuleStartupObserver.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/startup/ModuleStartupObserver.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/startup/ModuleStartupObserver.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/startup/ModuleStartupObserver.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.startup;
+
+import javax.annotation.PostConstruct;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+@Singleton
+@Startup
+public class ModuleStartupObserver
+{
+ private Logger logger = Logger.getLogger(ModuleStartupObserver.class.getName());
+
+ @PostConstruct
+ public void logStartup()
+ {
+ if (logger.isLoggable(Level.INFO))
+ {
+ logger.info("starting application module");
+ }
+ }
+}
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/FeedbackPage.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/FeedbackPage.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/FeedbackPage.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/FeedbackPage.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,80 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.view;
+
+import org.apache.deltaspike.core.api.config.view.controller.PreRenderView;
+import org.apache.deltaspike.core.api.scope.GroupedConversation;
+import org.apache.deltaspike.core.api.scope.GroupedConversationScoped;
+import org.superbiz.deltaspike.domain.Feedback;
+import org.superbiz.deltaspike.repository.FeedbackRepository;
+
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+import javax.inject.Named;
+import java.io.Serializable;
+import java.util.List;
+
+@Named
+@GroupedConversationScoped
+public class FeedbackPage implements Serializable
+{
+ private static final long serialVersionUID = 744025508253889974L;
+
+ private List<Feedback> feedbackList;
+
+ @Inject
+ private GroupedConversation conversation;
+
+ @Inject
+ private FeedbackRepository feedbackRepository;
+
+ private Feedback feedback;
+
+ @PostConstruct
+ protected void init()
+ {
+ this.feedback = this.feedbackRepository.createNewEntity();
+ }
+
+ @PreRenderView
+ public void reloadFeedbackList()
+ {
+ this.feedbackList = this.feedbackRepository.loadAll();
+ }
+
+ public void save()
+ {
+ this.feedbackRepository.save(this.feedback);
+ this.conversation.close();
+ }
+
+ /*
+ * generated
+ */
+
+ public List<Feedback> getFeedbackList()
+ {
+ return feedbackList;
+ }
+
+ public Feedback getFeedback()
+ {
+ return feedback;
+ }
+}
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/InfoPage.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/InfoPage.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/InfoPage.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/InfoPage.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.view;
+
+import org.apache.deltaspike.core.api.config.view.metadata.ViewMetaData;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+@Target({TYPE})
+@Retention(RUNTIME)
+@Documented
+
+@ViewMetaData
+public @interface InfoPage
+{
+}
Added: tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/MenuBean.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/MenuBean.java?rev=1588673&view=auto
==============================================================================
--- tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/MenuBean.java (added)
+++ tomee/tomee/trunk/examples/deltaspike-fullstack/src/main/java/org/superbiz/deltaspike/view/MenuBean.java Sat Apr 19 16:42:42 2014
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.superbiz.deltaspike.view;
+
+import org.apache.deltaspike.core.spi.scope.conversation.GroupedConversationManager;
+import org.superbiz.deltaspike.view.config.Pages;
+
+import javax.enterprise.inject.Model;
+import javax.inject.Inject;
+
+@Model
+public class MenuBean
+{
+ @Inject
+ private GroupedConversationManager groupedConversationManager;
+
+ public Class<? extends Pages> home()
+ {
+ //close all conversations of the current window
+ this.groupedConversationManager.closeConversations();
+ return Pages.Index.class;
+ }
+
+ public Class<? extends Pages.Secure> feedback()
+ {
+ //close all conversations of the current window
+ this.groupedConversationManager.closeConversations();
+ return Pages.Secure.FeedbackList.class;
+ }
+
+ public Class<? extends Pages> about()
+ {
+ //close all conversations of the current window
+ this.groupedConversationManager.closeConversations();
+ return Pages.About.class;
+ }
+
+ public Class<? extends Pages> login()
+ {
+ //close all conversations of the current window
+ this.groupedConversationManager.closeConversations();
+ return Pages.Login.class;
+ }
+
+ public Class<? extends Pages> register()
+ {
+ //close all conversations of the current window
+ this.groupedConversationManager.closeConversations();
+ return Pages.Registration.class;
+ }
+}