Permalink
Browse files

Imported the latest changes from the kitchensink quickstart

  • Loading branch information...
1 parent 87f778d commit f39c7fdd3002cf77259d979fe66d4d2ef3706738 @bleathem bleathem committed Apr 3, 2012
Showing with 339 additions and 225 deletions.
  1. +1 −1 kitchensink/src/main/resources/META-INF/maven/archetype-metadata.xml
  2. +6 −2 kitchensink/src/main/resources/archetype-resources/README.md
  3. +24 −17 kitchensink/src/main/resources/archetype-resources/pom.xml
  4. +56 −0 kitchensink/src/main/resources/archetype-resources/src/main/java/controller/PageBean.java
  5. +2 −4 kitchensink/src/main/resources/archetype-resources/src/main/java/service/MemberRegistration.java
  6. +77 −0 ...nsink/src/main/resources/archetype-resources/src/main/java/util/RewriteConfigurationProvider.java
  7. +0 −2 kitchensink/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/desktop.xhtml
  8. +2 −3 kitchensink/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/mobile.xhtml
  9. +1 −1 kitchensink/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
  10. +0 −100 kitchensink/src/main/resources/archetype-resources/src/main/webapp/desktopHome.xhtml
  11. +0 −10 kitchensink/src/main/resources/archetype-resources/src/main/webapp/index.html
  12. +6 −0 kitchensink/src/main/resources/archetype-resources/src/main/webapp/index.jsf
  13. +96 −24 kitchensink/src/main/resources/archetype-resources/src/main/webapp/index.xhtml
  14. +6 −2 kitchensink/src/main/resources/archetype-resources/src/main/webapp/mobile/home.xhtml
  15. +6 −0 kitchensink/src/main/resources/archetype-resources/src/main/webapp/mobile/index.jsf
  16. +47 −0 kitchensink/src/main/resources/archetype-resources/src/main/webapp/mobile/index.xhtml
  17. +4 −0 kitchensink/src/main/resources/archetype-resources/src/main/webapp/mobile/list.xhtml
  18. +3 −3 kitchensink/src/main/resources/archetype-resources/src/main/webapp/mobile/new.xhtml
  19. +0 −55 kitchensink/src/main/resources/archetype-resources/src/main/webapp/mobileHome.xhtml
  20. +2 −1 kitchensink/src/test/resources/projects/basic/archetype.properties
View
2 kitchensink/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -28,7 +28,6 @@
<includes>
<include>**/*.xhtml</include>
<include>**/*.xml</include>
- <include>**/*.html</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
@@ -43,6 +42,7 @@
<include>**/*.png</include>
<include>**/*.js</include>
<include>**/*.css</include>
+ <include>**/*.jsf</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8">
View
8 kitchensink/src/main/resources/archetype-resources/README.md
@@ -30,6 +30,10 @@ Some key points to make note of while running the application:
* Popups: Click the view link next to a member in the member list to view a popup with the member details. To close
the popup, click the "X" in the top right-hadn corner, or clck anywhere on the background mask.
+* Mobile support: view the application form a webkit powered browser on a mobile device to try out the mobile version
+ of the application. Alternatively, view the mobile version on your desktop by navigating to the url:
+ <http://localhost:8080/jboss-as-kitchensink-rf/mobile/>
+
System requirements
-------------------
@@ -61,9 +65,9 @@ You can now deploy the artifact to JBoss AS by executing the following command:
mvn jboss-as:deploy
-This will deploy `target/jboss-as-kitchensink.war`.
+This will deploy `target/jboss-as-kitchensink-rf.war`.
-The application will be running at the following URL <http://localhost:8080/jboss-as-kitchensink/>.
+The application will be running at the following URL <http://localhost:8080/jboss-as-kitchensink-rf/>.
To undeploy from JBoss AS, run this command:
View
41 kitchensink/src/main/resources/archetype-resources/pom.xml
@@ -17,18 +17,12 @@
<!-- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Define the version of JBoss' Java EE 6 APIs and Tools we want to import. -->
- <javaee6.with.tools.version>1.0.0.M1</javaee6.with.tools.version>
- <!-- Alternatively, comment out the above line, and un-comment the line below to
- use version 3.0.0.Beta1-redhat-1 which is a release certified
- to work with JBoss EAP 6. It requires you have access to the JBoss EAP 6 maven repository. -->
+ <javaee6.with.tools.version>1.0.0.M4</javaee6.with.tools.version>
+ <!-- Alternatively, comment out the above line, and un-comment the line below to use version 3.0.0.Beta1-redhat-1
+ which is a release certified to work with JBoss EAP 6. It requires you have access to the JBoss EAP 6 maven repository. -->
<!--
<javaee6.spec.version>3.0.0.Beta1-redhat-1</javaee6.spec.version>
-->
- #if ($enterprise == "true" || $enterprise == "y" || $enterprise == "yes" )
- <org.richfaces.bom.version>${richfaces-enterprise-version}</org.richfaces.bom.version>
- #else
- <org.richfaces.bom.version>${richfaces-version}</org.richfaces.bom.version>
- #end
</properties>
<dependencyManagement>
@@ -120,6 +114,13 @@
<scope>provided</scope>
</dependency>
+ <!-- Import the JSF impl, to allow for application debugging -->
+ <dependency>
+ <groupId>com.sun.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
<!-- Import the Servlet API, we use provided scope as the API is included in JBoss AS 7 -->
<dependency>
<groupId>org.jboss.spec.javax.servlet</groupId>
@@ -153,14 +154,6 @@
<groupId>org.atmosphere</groupId>
<artifactId>atmosphere-runtime</artifactId>
<exclusions>
- <!--<exclusion>-->
- <!--<groupId>org.atmosphere</groupId>-->
- <!--<artifactId>atmosphere-compat-weblogic</artifactId>-->
- <!--</exclusion>-->
- <!--<exclusion>-->
- <!--<groupId>org.atmosphere</groupId>-->
- <!--<artifactId>atmosphere-compat-tomcat</artifactId>-->
- <!--</exclusion>-->
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
@@ -178,6 +171,20 @@
<scope>provided</scope>
</dependency>
+ <!-- The rewrite library allows us to do url rewriting - used here for rewriting mobile devices to mobile specific views -->
+ <dependency>
+ <groupId>org.ocpsoft.rewrite</groupId>
+ <artifactId>rewrite-servlet</artifactId>
+ <version>1.0.3.Final</version>
+ </dependency>
+
+ <!-- The cdi integration allows for CDI injection into the rewrite configuration class -->
+ <dependency>
+ <groupId>org.ocpsoft.rewrite</groupId>
+ <artifactId>rewrite-integration-cdi</artifactId>
+ <version>1.0.3.Final</version>
+ </dependency>
+
<!-- Needed for running tests (you may also use TestNG) -->
<dependency>
<groupId>junit</groupId>
View
56 kitchensink/src/main/resources/archetype-resources/src/main/java/controller/PageBean.java
@@ -0,0 +1,56 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ **/
+package ${package}.controller;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.SessionScoped;
+import javax.enterprise.inject.Model;
+import javax.inject.Named;
+import java.io.Serializable;
+
+/**
+ * @author <a href="http://community.jboss.org/people/bleathem">Brian Leathem</a>
+ */
+@Named
+@SessionScoped
+public class PageBean implements Serializable {
+ private static final long serialVersionUID = 281964859634018452L;
+
+ private String location;
+ private String page;
+
+ public String getPage() {
+ return page;
+ }
+
+ public String getLocation() {
+ return location;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ this.page = String.format("/mobile/%s.xhtml", location);
+ }
+}
View
6 ...sink/src/main/resources/archetype-resources/src/main/java/service/MemberRegistration.java
@@ -3,16 +3,14 @@
#set( $symbol_escape = '\' )
package ${package}.service;
+import ${package}.model.Member;
+
import javax.ejb.Stateless;
import javax.enterprise.event.Event;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import java.util.logging.Logger;
-import ${package}.service.MemberRegistration;
-import ${package}.model.Member;
-import org.richfaces.cdi.push.Push;
-
// The @Stateless annotation eliminates the need for manual transaction demarcation
@Stateless
public class MemberRegistration {
View
77 ...c/main/resources/archetype-resources/src/main/java/util/RewriteConfigurationProvider.java
@@ -0,0 +1,77 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ **/
+package ${package}.util;
+
+import org.ocpsoft.rewrite.config.Condition;
+import org.ocpsoft.rewrite.config.Configuration;
+import org.ocpsoft.rewrite.config.ConfigurationBuilder;
+import org.ocpsoft.rewrite.config.Direction;
+import org.ocpsoft.rewrite.config.True;
+import org.ocpsoft.rewrite.context.EvaluationContext;
+import org.ocpsoft.rewrite.servlet.config.Forward;
+import org.ocpsoft.rewrite.servlet.config.HttpCondition;
+import org.ocpsoft.rewrite.servlet.config.HttpConfigurationProvider;
+import org.ocpsoft.rewrite.servlet.config.Path;
+import org.ocpsoft.rewrite.servlet.http.event.HttpServletRewrite;
+
+import javax.inject.Inject;
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+
+/**
+ * This class provides the configuration for ReWrite.
+ *
+ * @author <a href="http://community.jboss.org/people/bleathem">Brian Leathem</a>
+ */
+public class RewriteConfigurationProvider extends HttpConfigurationProvider {
+
+ @Override
+ public int priority() {
+ return 10;
+ }
+
+ /**
+ * Uses the ReWrtie ConfigurationBuilder to define a set of rules used for the URL rewriting. We define a single
+ * rule that rewrites requests for the index page if the request is determined to originate from a mobile browser.
+ * @param context the ServletContext
+ * @return the ReWrite Configuration
+ */
+ @Override
+ public Configuration getConfiguration(final ServletContext context) {
+ return ConfigurationBuilder.begin()
+ .defineRule()
+ .when(Direction.isInbound().and(Path.matches("/").or(Path.matches("/index.jsf"))).and(new HttpCondition() {
+ @Override
+ public boolean evaluateHttp(HttpServletRewrite httpServletRewrite, EvaluationContext evaluationContext) {
+ HttpServletRequest request = httpServletRewrite.getRequest();
+ String userAgentStr = request.getHeader("user-agent");
+ String httpAccept = request.getHeader("Accept");
+ UAgentInfo uAgentInfo = new UAgentInfo(userAgentStr, httpAccept);
+ return uAgentInfo.detectTierIphone() || uAgentInfo.detectTierTablet();
+ }
+ }))
+ .perform(Forward.to("/mobile/"));
+ }
+}
View
2 ...nk/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/desktop.xhtml
@@ -5,7 +5,6 @@
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
-<ui:composition>
<h:head>
<title>Java EE 6 Starter Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
@@ -31,5 +30,4 @@
</div>
</div>
</h:body>
-</ui:composition>
</html>
View
5 ...ink/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/templates/mobile.xhtml
@@ -1,11 +1,10 @@
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
-<ui:composition>
<h:head>
<title>Java EE 6 Starter Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
@@ -22,6 +21,7 @@
//initialize mobile RichFaces with slidfast
slidfast({
defaultPageID:'home-page',
+ callback: 'handleHashChange',
backButtonID: 'back-button'
});
</script>
@@ -39,5 +39,4 @@
</div>
</div>
</h:body>
-</ui:composition>
</html>
View
2 kitchensink/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
@@ -24,6 +24,6 @@
<!-- add a welcome-file-list entry to allow JSF pages to be sued as welcome files -->
<welcome-file-list>
- <welcome-file>faces/index.xhtml</welcome-file>
+ <welcome-file>index.jsf</welcome-file>
</welcome-file-list>
</web-app>
View
100 kitchensink/src/main/resources/archetype-resources/src/main/webapp/desktopHome.xhtml
@@ -1,100 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-<!DOCTYPE html>
-<html lang="en">
-
-<ui:composition template="/WEB-INF/templates/desktop.xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:rich="http://richfaces.org/rich"
- xmlns:my="http://java.sun.com/jsf/composite/components">
- <ui:define name="content">
- <h:outputStylesheet name="app.css" library="css"/>
- <h:outputScript target="head" name="showMessage.js" library="js"/>
-
- <h1>Welcome to JBoss AS 7!</h1>
-
- <p>You have successfully deployed a RichFaces web application on JBoss AS 7.</p>
-
- <h:form id="reg">
- <rich:panel id="newMemberPanel" header="Register (Bean Validation example)" headerClass="header">
- <my:memberForm member="${symbol_pound}{newMember}"/>
-
- <p>Enforces annotation-based constraints defined on the model class.</p>
-
- <h:panelGrid columns="2">
- <a4j:commandButton id="register" action="${symbol_pound}{memberController.register}" value="Register"
- execute="newMemberPanel" render="newMemberPanel"/>
- <rich:messages globalOnly="true"/>
- </h:panelGrid>
- </rich:panel>
- <br />
-
- <div id="newMemberMessages" class="update"/>
-
- <rich:collapsiblePanel id="memberList" header="Members" headerClass="header"
- title="Click to expand/collapse">
- <h:panelGroup rendered="${symbol_pound}{empty members}">
- <em>No registered members.</em>
- </h:panelGroup>
- <rich:dataTable var="_member" value="${symbol_pound}{members}" rendered="${symbol_pound}{not empty members}" style="width : 100%">
- <rich:column>
- <a4j:commandLink styleClass="no-decor" render="memberPanel" execute="@this"
- oncomplete="${symbol_pound}{rich:component('memberPopup')}.show()">
- View
- <f:setPropertyActionListener target="${symbol_pound}{memberController.member}" value="${symbol_pound}{_member}"/>
- </a4j:commandLink>
- </rich:column>
- <rich:column>
- <f:facet name="header">Id</f:facet>
- ${symbol_pound}{_member.id}
- </rich:column>
- <rich:column>
- <f:facet name="header">Name</f:facet>
- ${symbol_pound}{_member.name}
- </rich:column>
- <rich:column>
- <f:facet name="header">Email</f:facet>
- ${symbol_pound}{_member.email}
- </rich:column>
- <rich:column>
- <f:facet name="header">Phone ${symbol_pound}</f:facet>
- ${symbol_pound}{_member.phoneNumber}
- </rich:column>
- <rich:column>
- <f:facet name="header">REST URL</f:facet>
- <a href="${symbol_pound}{request.contextPath}/rest/members/${symbol_pound}{_member.id}">/rest/members/${symbol_pound}{_member.id}</a>
- </rich:column>
- <f:facet name="footer">
- REST URL for all members: <a href="${symbol_pound}{request.contextPath}/rest/members">/rest/members</a>
- </f:facet>
- </rich:dataTable>
- </rich:collapsiblePanel>
-
- <rich:popupPanel id="memberPopup" modal="true" onmaskclick="${symbol_pound}{rich:component('memberPopup')}.hide()"
- domElementAttachment="form" autosized="true">
- <f:facet name="header">
- <h:outputText value="Member Details"/>
- </f:facet>
- <f:facet name="controls">
- <h:outputLink value="${symbol_pound}" onclick="${symbol_pound}{rich:component('memberPopup')}.hide(); return false;">
- X
- </h:outputLink>
- </f:facet>
- <h:panelGroup id="memberPanel">
- <my:memberForm member="${symbol_pound}{member}"/>
- </h:panelGroup>
- </rich:popupPanel>
-
- <a4j:push address="pushCdi" ondataavailable="showMessage(event.rf.data)">
- <a4j:ajax event="dataavailable" render="memberList" />
- </a4j:push>
-
- </h:form>
- </ui:define>
-</ui:composition>
-
-</html>
View
10 kitchensink/src/main/resources/archetype-resources/src/main/webapp/index.html
@@ -1,10 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-<!-- Plain HTML page that kicks us into the app -->
-
-<html>
-<head>
-<meta http-equiv="Refresh" content="0; URL=index.jsf">
-</head>
-</html>
View
6 kitchensink/src/main/resources/archetype-resources/src/main/webapp/index.jsf
@@ -0,0 +1,6 @@
+** Do not delete this file. **
+
+This empty file is required to "trick" the servlet container into beleiveing "index.jsf" exists, and can be used as a
+welcome file. Serving of this resource will then instead be performed by the Faces Servlet.
+
+** Do not delete this file. **
View
120 kitchensink/src/main/resources/archetype-resources/src/main/webapp/index.xhtml
@@ -1,28 +1,100 @@
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:c="http://java.sun.com/jsp/jstl/core">
-
- <c:choose>
- <c:when test="${symbol_pound}{userAgent.phone}">
- <ui:include src="mobileHome.xhtml">
- [phone]
- </ui:include>
- </c:when>
- <c:when test="${symbol_pound}{userAgent.tablet}">
- <ui:include src="mobileHome.xhtml">
- [tablet]
- </ui:include>
- </c:when>
- <c:otherwise>
- <ui:include src="desktopHome.xhtml">
- [desktop]
- </ui:include>
- </c:otherwise>
-
- </c:choose>
+<!DOCTYPE html>
+<html lang="en">
+
+<ui:composition template="/WEB-INF/templates/desktop.xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:my="http://java.sun.com/jsf/composite/components">
+ <ui:define name="content">
+ <h:outputStylesheet name="app.css" library="css"/>
+ <h:outputScript target="head" name="showMessage.js" library="js"/>
+
+ <h1>Welcome to JBoss AS 7!</h1>
+
+ <p>You have successfully deployed a RichFaces web application on JBoss AS 7.</p>
+
+ <h:form id="reg">
+ <rich:panel id="newMemberPanel" header="Register (Bean Validation example)" headerClass="header">
+ <my:memberForm member="${symbol_pound}{newMember}"/>
+
+ <p>Enforces annotation-based constraints defined on the model class.</p>
+
+ <h:panelGrid columns="2">
+ <a4j:commandButton id="register" action="${symbol_pound}{memberController.register}" value="Register"
+ execute="newMemberPanel" render="newMemberPanel"/>
+ <rich:messages globalOnly="true"/>
+ </h:panelGrid>
+ </rich:panel>
+ <br />
+
+ <div id="newMemberMessages" class="update"/>
+
+ <rich:collapsiblePanel id="memberList" header="Members" headerClass="header"
+ title="Click to expand/collapse">
+ <h:panelGroup rendered="${symbol_pound}{empty members}">
+ <em>No registered members.</em>
+ </h:panelGroup>
+ <rich:dataTable var="_member" value="${symbol_pound}{members}" rendered="${symbol_pound}{not empty members}" style="width : 100%">
+ <rich:column>
+ <a4j:commandLink styleClass="no-decor" render="memberPanel" execute="@this"
+ oncomplete="${symbol_pound}{rich:component('memberPopup')}.show()">
+ View
+ <f:setPropertyActionListener target="${symbol_pound}{memberController.member}" value="${symbol_pound}{_member}"/>
+ </a4j:commandLink>
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">Id</f:facet>
+ ${symbol_pound}{_member.id}
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">Name</f:facet>
+ ${symbol_pound}{_member.name}
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">Email</f:facet>
+ ${symbol_pound}{_member.email}
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">Phone ${symbol_pound}</f:facet>
+ ${symbol_pound}{_member.phoneNumber}
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">REST URL</f:facet>
+ <a href="${symbol_pound}{request.contextPath}/rest/members/${symbol_pound}{_member.id}">/rest/members/${symbol_pound}{_member.id}</a>
+ </rich:column>
+ <f:facet name="footer">
+ REST URL for all members: <a href="${symbol_pound}{request.contextPath}/rest/members">/rest/members</a>
+ </f:facet>
+ </rich:dataTable>
+ </rich:collapsiblePanel>
+
+ <rich:popupPanel id="memberPopup" modal="true" onmaskclick="${symbol_pound}{rich:component('memberPopup')}.hide()"
+ domElementAttachment="form" autosized="true">
+ <f:facet name="header">
+ <h:outputText value="Member Details"/>
+ </f:facet>
+ <f:facet name="controls">
+ <h:outputLink value="${symbol_pound}" onclick="${symbol_pound}{rich:component('memberPopup')}.hide(); return false;">
+ X
+ </h:outputLink>
+ </f:facet>
+ <h:panelGroup id="memberPanel">
+ <my:memberForm member="${symbol_pound}{member}"/>
+ </h:panelGroup>
+ </rich:popupPanel>
+
+ <a4j:push address="pushCdi" ondataavailable="showMessage(event.rf.data)">
+ <a4j:ajax event="dataavailable" render="memberList" />
+ </a4j:push>
+
+ </h:form>
+ </ui:define>
+</ui:composition>
+
</html>
View
8 kitchensink/src/main/resources/archetype-resources/src/main/webapp/mobile/home.xhtml
@@ -24,8 +24,12 @@
</p>
</div>
<rich:panelMenuGroup label="Application Menu" expanded="true">
- <rich:panelMenuItem label="Add Member" mode="client" onclick="location.hash='new-page'"/>
- <rich:panelMenuItem label="List Members" mode="client" onclick="location.hash='list-page'" />
+ <rich:panelMenuItem label="Add Member"
+ onclick="location.hash='new'"
+ mode="client" />
+ <rich:panelMenuItem label="List Members"
+ onclick="location.hash='list'"
+ mode="client" />
</rich:panelMenuGroup>
</rich:panelMenu>
</h:panelGroup>
View
6 kitchensink/src/main/resources/archetype-resources/src/main/webapp/mobile/index.jsf
@@ -0,0 +1,6 @@
+** Do not delete this file. **
+
+This empty file is required to "trick" the servlet container into beleiveing "index.jsf" exists, and can be used as a
+welcome file. Serving of this resource will then instead be performed by the Faces Servlet.
+
+** Do not delete this file. **
View
47 kitchensink/src/main/resources/archetype-resources/src/main/webapp/mobile/index.xhtml
@@ -0,0 +1,47 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<!DOCTYPE html>
+<html lang="en">
+
+<ui:composition template="/WEB-INF/templates/mobile.xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:my="http://java.sun.com/jsf/composite/components">
+ <ui:define name="content">
+ <h:outputStylesheet name="app.css" library="css"/>
+ <h:outputStylesheet name="mobile.css" library="css"/>
+
+ <div id="browser">
+ <header>
+ <div>
+ <div id="back-button" class="hide-button">Home</div>
+ <div id="info-button" class="right-header-button info-link">
+ <a href="${symbol_pound}about">i</a>
+ </div>
+ <p>Richfaces Mobile</p>
+ </div>
+ </header>
+ <h:form id="mobileForm">
+ <a4j:jsFunction name="handleHashChange" data="${symbol_pound}{pageBean.location}" render="@form"
+ oncomplete="slidfast.core.slideTo('app-page')">
+ <a4j:param name="page" assignTo="${symbol_pound}{pageBean.location}"/>
+ </a4j:jsFunction>
+
+ <div id="page-container">
+ <div id="home-page" class="page stage-left">
+ <ui:include src="/mobile/home.xhtml"/>
+ </div>
+ <div id="app-page" class="page stage-right">
+ <ui:include src="${symbol_pound}{pageBean.page}"/>
+ </div>
+ </div>
+ </h:form>
+ </div>
+ </ui:define>
+</ui:composition>
+
+</html>
View
4 kitchensink/src/main/resources/archetype-resources/src/main/webapp/mobile/list.xhtml
@@ -43,6 +43,10 @@
</h:panelGroup>
<div id="newMemberMessages" class="update"/>
+ <a4j:push address="pushCdi" ondataavailable="showMessage(event.rf.data)">
+ <a4j:ajax event="dataavailable" render="mobileForm:membersPanel" />
+ </a4j:push>
+
</ui:composition>
</html>
View
6 kitchensink/src/main/resources/archetype-resources/src/main/webapp/mobile/new.xhtml
@@ -12,10 +12,10 @@
xmlns:mobile="http://java.sun.com/jsf/composite/components/mobile">
<h:panelGroup id="newMemberPanel" layout="block" styleClass="mobileContent">
<br />
- <mobile:memberForm member="${symbol_pound}{newMember}"/>
+ <mobile:memberForm id="memberForm" member="${symbol_pound}{newMember}"/>
<a4j:commandButton id="register" action="${symbol_pound}{memberController.register}" value="Register"
- oncomplete="if ( ${symbol_pound}{not facesContext.validationFailed} ) location.hash='list-page'"
- execute="newMemberPanel" render="newMemberPanel,membersPanel"/>
+ oncomplete="if ( ${symbol_pound}{not facesContext.validationFailed} ) location.hash='list'"
+ execute="@form" render="newMemberPanel"/>
<rich:messages globalOnly="true"/>
</h:panelGroup>
</ui:composition>
View
55 kitchensink/src/main/resources/archetype-resources/src/main/webapp/mobileHome.xhtml
@@ -1,55 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-<!DOCTYPE html>
-<html lang="en">
-
-<ui:composition template="/WEB-INF/templates/mobile.xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:rich="http://richfaces.org/rich"
- xmlns:my="http://java.sun.com/jsf/composite/components">
- <ui:define name="content">
- <h:outputStylesheet name="app.css" library="css"/>
- <h:outputStylesheet name="mobile.css" library="css"/>
- <div id="browser">
- <h:form>
- <header>
- <div>
- <div id="back-button" class="hide-button">Home</div>
- <div id="info-button" class="right-header-button info-link">
- <a4j:commandLink value="i"
- oncomplete="location.hash='about-page'"
- render="@form" />
- </div>
- <p>Richfaces Mobile</p>
- </div>
- </header>
- <a4j:push address="pushCdi">
- <a4j:ajax event="dataavailable" render="@form" />
- </a4j:push>
- <div id="page-container">
- <div id="home-page" class="page stage-left">
- <ui:include src="mobile/home.xhtml"/>
- </div>
- <div id="new-page" class="page stage-right">
- <ui:include src="mobile/new.xhtml"/>
- </div>
- <div id="detail-page" class="page stage-right">
- <ui:include src="mobile/detail.xhtml"/>
- </div>
- <div id="list-page" class="page stage-right">
- <ui:include src="mobile/list.xhtml"/>
- </div>
- <div id="about-page" class="page stage-right">
- <ui:include src="mobile/about.xhtml"/>
- </div>
- </div>
- </h:form>
- </div>
- </ui:define>
-</ui:composition>
-
-</html>
View
3 kitchensink/src/test/resources/projects/basic/archetype.properties
@@ -1,4 +1,5 @@
-#Sun Mar 11 18:30:33 PDT 2012
+#Mon Apr 02 14:22:49 PDT 2012
+package=it.pkg
version=0.1-SNAPSHOT
groupId=archetype.it
artifactId=basic

0 comments on commit f39c7fd

Please sign in to comment.