From d96cacbee9f0c0acdda13567e72a796fbea1e8f6 Mon Sep 17 00:00:00 2001
From: snjeza <snjezana.peco@redhat.com>
Date: Fri, 9 Mar 2012 21:17:52 +0100
Subject: [PATCH] JBIDE-10823 JBoss Central Quickstarts Updates

---
 helloworld-html5/README.md              |    4 +-
 helloworld-html5/pom.xml                |    2 +-
 helloworld/cheatsheets/helloworld.xml   |  104 ++++++
 kitchensink/cheatsheets/kitchensink.xml |  603 +++++++++++++++++++++++++++++++
 numberguess/cheatsheets/numberguess.xml |  182 ++++++++++
 5 files changed, 892 insertions(+), 3 deletions(-)
 create mode 100644 helloworld/cheatsheets/helloworld.xml
 create mode 100644 kitchensink/cheatsheets/kitchensink.xml
 create mode 100644 numberguess/cheatsheets/numberguess.xml

diff --git a/helloworld-html5/README.md b/helloworld-html5/README.md
index eeefe1f..bfc057c 100644
--- a/helloworld-html5/README.md
+++ b/helloworld-html5/README.md
@@ -10,10 +10,10 @@ To set up Maven or JBoss Tools in Eclipse, refer to the _Getting Started Guide_.
 
 To deploy to JBoss AS 7, start JBoss AS 7, and type `mvn package jboss-as:deploy`. 
 
-The application is deployed to http://localhost:8080/poh5-helloworld
+The application is deployed to http://localhost:8080/helloworld-html5
 
 You can test the REST endpoint using the following URL
-http://localhost:8080/poh5-helloworld/hello/json/David 
+http://localhost:8080/helloworld-html5/hello/json/David 
 
 HelloWorld.java - establishes the RESTful endpoints using JAX-RS
 
diff --git a/helloworld-html5/pom.xml b/helloworld-html5/pom.xml
index 8b736cb..ced528d 100644
--- a/helloworld-html5/pom.xml
+++ b/helloworld-html5/pom.xml
@@ -79,7 +79,7 @@
    <build>
       <!-- Set the name of the war, used as the context root when the app 
          is deployed -->
-      <finalName>poh5-helloworld</finalName>
+      <finalName>helloworld-html5</finalName>
       <plugins>
          <plugin>
             <artifactId>maven-war-plugin</artifactId>
diff --git a/helloworld/cheatsheets/helloworld.xml b/helloworld/cheatsheets/helloworld.xml
new file mode 100644
index 0000000..ff0fcab
--- /dev/null
+++ b/helloworld/cheatsheets/helloworld.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?> 
+<cheatsheet title="CDI + Servlet: Helloworld quickstart">
+  <intro>
+    <description>This quickstart shows you how to deploy a simple servlet to JBoss AS. The business logic is encapsulated in a service, which is provided as a CDI bean, and injected into the Servlet.
+<br/><br/>
+<b>	Contexts and Dependency Injection</b>
+<br/><br/>
+CDI is a new specification in Java EE 6, inspired by JBoss Seam and Google Guice, and also drawing on lessons learned from frameworks such as Spring. It allows application developers to concentrate on developing their application logic by providing the ability to wire services together, and abstract out orthogonal concerns, all in a type safe manner.
+
+<br/>
+<br/>
+</description>
+</intro>
+  <item
+        skip="true"
+        title="The helloworld example in depth">
+     <description>
+    	 The helloworld is very simple - all it does is print <b>Hello World</b> onto a web page.
+The helloworld example is comprised a servlet and a CDI bean.
+We also include an empty <b>beans.xml</b> file, 
+which tells JBoss AS to look for beans in this application and to activate the CDI. 
+<b>beans.xml</b> is located in <b>WEB-INF</b>, which can be found in the <b>src/main/webapp</b> directory of the example. 
+Also in this directory we include <b>index.html</b> which uses a simple meta refresh to send the users browser to the Servlet, which is located at <b>http://localhost:8080/jboss-as-helloworld/HelloWorld</b>.
+All the configuration files for this example are located in <b>WEB-INF/</b>,
+ which can be found in the <b>src/main/webapp</b> directory of the example.
+<br/><br/>
+Notice that we don&apos;t even need a web.xml!
+<br/><br/>
+Let&apos;s start by taking a look at the servlet:
+    </description>         
+  </item>
+   <item
+         title="HelloWorldServlet.java">
+      <description>
+      Hello World Servlet - Servlet 3.0
+      </description>
+      <subitem
+            label="If you've used Servlet before, then you'll remember having to use xml to register your servlets. Fortunately, this is a thing of the past. Now all you need to do is add the @WebServlet annotation, and provide a mapping to a URL used to access the servlet. Much cleaner!"
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloWorldServlet.java"
+			param2="27" />
+	  </subitem>
+	  <subitem
+            label="Every web page needs to be correctly formed HTML. We've created static Strings to hold the minimum header and footer to write out."
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloWorldServlet.java"
+			param2="30"
+			param3="32" />
+	  </subitem>
+	  <subitem
+            label="We inject the HelloService (a CDI bean) which generates the actual message. This allows to alter the implementation of HelloService at a later date without changing the view layer at all (assuming we don't alter the API of HelloService)."
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloWorldServlet.java"
+			param2="34"
+			param3="35" />
+	  </subitem>
+	  <subitem
+            label="We call into the service to generate the message Hello World, and write it out to the HTTP request."
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloWorldServlet.java"
+			param2="41" />
+	  </subitem>
+  </item>
+  
+  <item
+        skip="true"
+        title="HelloService.java">
+     <description>
+    	 Now we understand how the information is sent to the browser, let&apos;s take a look at the service.
+
+The service is very simple - no registration (XML or annotation) is required!
+    </description>
+    <action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-helloworld/src/main/java/org/jboss/as/quickstarts/helloworld/HelloService.java"
+			param2="9"
+			param3="15" />       
+  </item>
+  
+  <item
+        skip="true"
+        title="Run and deploy the application">
+     <description>
+    	 Right-click the jboss-as-helloworld project and select <b>Run As</b> &gt; <b>Run On Server</b> or click on the &quot;Click to Perform&quot; link below. 
+    </description>
+    <action
+		pluginId="org.jboss.tools.project.examples.cheatsheet"
+		class="org.jboss.tools.project.examples.cheatsheet.actions.RunOnServer"
+		param1="jboss-as-helloworld"/> 
+  </item>
+</cheatsheet>
diff --git a/kitchensink/cheatsheets/kitchensink.xml b/kitchensink/cheatsheets/kitchensink.xml
new file mode 100644
index 0000000..fb2e7ba
--- /dev/null
+++ b/kitchensink/cheatsheets/kitchensink.xml
@@ -0,0 +1,603 @@
+<?xml version="1.0" encoding="UTF-8"?> 
+<cheatsheet title="CDI + JSF + EJB + JTA + Bean Validation + JAX-RS + Arquillian: Kitchensink quickstart">
+  <intro>
+    <description>
+This quickstart shows off all the new features of Java EE 6, and makes a great starting point for your project.
+<br/><br/>
+<b>Bean Validation</b>
+<br/><br/>
+Bean Validation is a new specification in Java EE 6, inspired by Hibernate Validator. It allows application developers to specify constraints once (often in their domain model), and have them applied in all layers of the application, protecting data and giving useful feedback to users.
+<br/><br/>
+<b>JAX-RS: The Java API for RESTful Web Services</b>
+<br/><br/>
+JAX-RS is a new specification in Java EE 6. It allows application developers to easily expose Java services as RESTful web services.
+</description>
+</intro>
+  <item
+        skip="true"
+        title="The kitchensink example in depth">
+     <description>
+    	 The kitchensink application shows off a number of Java EE technologies such as CDI, JSF, EJB, JTA, JAX-RS and Arquillian. 
+    	 It does this by providing a member registration database, available via JSF and JAX-RS.
+<br/><br/>
+As usual, let&apos;s start by looking at the necessary deployment descriptors. 
+By now, we're very used to seeing <b>beans.xml</b> and <b>faces-config.xml</b> in <b>WEB-INF/</b> 
+(which can be found in the <b>src/main/webapp</b> directory of the example). 
+Notice that, once again, we don&apos;t need a web.xml. 
+There are two configuration files in <b>WEB-INF/classes/META-INF</b> 
+(which can be found in the <b>src/main/resources</b> directory of the example) — <b>persistence.xml</b>, 
+which sets up JPA, and <b>import.sql</b> which Hibernate, the JPA provider in JBoss AS 7, 
+will use to load the initial users into the application when the application starts. 
+We discussed both of these files in detail in The <b>login example in depth</b>, and these are largely the same.
+    </description>         
+  </item>
+  
+   <item
+         title="default.xhtml">
+      <description>
+      Next, let&apos;s take a look at the JSF view the user sees. As usual, we use a template to provide the sidebar and footer. This one lives in <b>WEB-INF/templates/default.xhtml</b>:
+      </description>
+      <subitem
+            label="We have a common &lt;head&gt; element, where we define styles and more. "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/webapp/WEB-INF/templates/default.xhtml"
+			param2="6"
+			param3="10" />
+	  </subitem>
+	  <subitem
+            label="This application defines a common sidebar, putting them in the template means we only have to define them once."
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/webapp/WEB-INF/templates/default.xhtml"
+			param2="14"
+			param3="70" />
+	  </subitem>
+	  <subitem
+            label="and a common footer... "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/webapp/WEB-INF/templates/default.xhtml"
+			param2="75"
+			param3="81" />
+	  </subitem>
+	  <subitem
+            label="The content is inserted here, and defined by views using this template. "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/webapp/WEB-INF/templates/default.xhtml"
+			param2="71"
+			param3="73" />
+	  </subitem>
+
+  </item>
+  
+  <item
+      title="index.xhtml">
+      <description>
+      That leaves the main page, index.xhtml, in which we place the content unique to the main page:
+      </description>
+      <subitem
+            label="The JSF form allows us to register new users. There should be one already created when the application started."
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/webapp/index.xhtml"
+			param2="12"
+			param3="46" />
+	  </subitem>
+	  <subitem
+            label="The application uses Bean Validation to validate data entry. The error messages from Bean Validation are automatically attached to the relevant field by JSF, and adding a messages JSF component will display them. "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/webapp/index.xhtml"
+			param2="22" />
+	  </subitem>
+	  <subitem
+            label="..."
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/webapp/index.xhtml"
+			param2="29" />
+	  </subitem>
+	  <subitem
+            label="..."
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/webapp/index.xhtml"
+			param2="36" />
+	  </subitem>
+	  <subitem
+            label="This application exposes REST endpoints for each registered member. The application helpfully displays the URL to the REST endpoint on this page. "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/webapp/index.xhtml"
+			param2="51"
+			param3="77" />
+	  </subitem>
+
+  </item>
+  
+  <item
+        skip="true"
+        title="Member.java">
+     <description>
+    	 Next, let&apos;s take a look at the Member entity, before we look at how the application is wired together:
+    </description>
+    <subitem
+            label="As usual with JPA, we define that the class is an entity by adding @Entity"
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/model/Member.java"
+			param2="20" />
+	</subitem>
+	<subitem
+            label="Members are exposed as a RESTful service using JAX-RS. We can use JAXB to map the object to XML and to do this we need to add @XmlRootElement."
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/model/Member.java"
+			param2="21" />
+	</subitem>
+	<subitem
+            label="Bean Validation allows constraints to be defined once (on the entity) and applied everywhere. Here we constrain the person's name to a certain size and regular expression. "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/model/Member.java"
+			param2="31"
+			param3="33" />
+	</subitem>
+	<subitem
+            label="Hibernate Validator also offers some extra validations such as @Email. "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/model/Member.java"
+			param2="38" />
+	</subitem>
+	<subitem
+            label="@Digits, @NotNull and @Size are further examples of constraints. "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/model/Member.java"
+			param2="41"
+			param3="43" />
+	</subitem>
+	
+  </item>
+
+   <item
+        skip="true"
+        title="MemberListProducer.java">
+     <description>
+    	 Next, let&apos;s take a look at MemberListProducer, which is responsible for building the list of members, ordered by name. It uses JPA 2 criteria to do this.
+    </description>
+    <subitem
+            label="This bean is request scoped, meaning that any fields (such as members) will be stored for the entire request."
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/data/MemberListProducer.java"
+			param2="18" />
+	</subitem>
+	<subitem
+            label="The list of members is exposed as a producer method, it's also available via EL. "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/data/MemberListProducer.java"
+			param2="27"
+			param3="31" />
+	</subitem>
+	<subitem
+            label="The observer method is notified whenever a member is created, removed, or updated. This allows us to refresh the list of members whenever they are needed. This is a good approach as it allows us to cache the list of members, but keep it up to date at the same time."
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/data/MemberListProducer.java"
+			param2="33"
+			param3="35" />
+	</subitem>
+	<subitem
+            label="JPA 2's criteria API is used to create a list of members sorted by name. You can try out the type safe criteria API as well by swapping the criteria statements as described."
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/data/MemberListProducer.java"
+			param2="37"
+			param3="47" />
+	</subitem>
+	
+  </item>
+
+  <item
+        skip="true"
+        title="MemberRegistration.java">
+     <description>
+    	 Let&apos;s now look at MemberRegistration, the class that allows us to create new members from the JSF page
+    </description>
+    <subitem
+            label="This bean requires transactions as it needs to write to the database. Making this an EJB gives us access to declarative transactions - much simpler than manual transaction control! "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/controller/MemberRegistration.java"
+			param2="17" />
+	</subitem>
+	<subitem
+            label="Stereotypes, such as @Model allow grouping of common functionality. Here we use the built in @Model stereotype to give us a request scoped, named bean."
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/controller/MemberRegistration.java"
+			param2="22" />
+	</subitem>
+	<subitem
+            label="Seam Solder, used in this project offers an injectable logger based on JBoss Logging. "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/controller/MemberRegistration.java"
+			param2="25"
+			param3="26" />
+	</subitem>
+	<subitem
+            label="An event is sent every time a member is updated. This allows other pieces of code (in this example the member list is refreshed) to react to changes in the member list without any coupling to this class."
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/controller/MemberRegistration.java"
+			param2="45" />
+	</subitem>
+		
+  </item>
+  
+  <item
+        skip="true"
+        title="Seam Solder">
+     <description>
+    	 Seam Solder is a swiss army knife for any CDI based application. 
+    	 It offers some basic additions to the CDI programming model (such as an injectable, type-safe, logger) 
+    	 as well as utilities for developing CDI extensions. 
+    	 You can read more on the <b>Solder project page</b>.
+    </description>
+    <command
+           required="false"
+           serialization="org.eclipse.ui.browser.openBrowser(url=http://seamframework.org/Seam3/Solder)"/> 
+  </item>
+  
+  <item
+        skip="true"
+        title="Resources.java">
+     <description>
+    	 Now, let's take a look at the Resources class, which provides resources such as the entity manager. CDI recommends using "resource producers", as we do in this example, to alias resources to CDI beans, allowing for a consistent style throughout our application:
+    </description>
+    <subitem
+            label="We use the 'resource producer' pattern, from CDI, to 'alias' the old fashioned @PersistenceContext injection of the entity manager to a CDI style injection. This allows us to use. "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/util/Resources.java"
+			param2="25"
+			param3="26" />
+	</subitem>
+	<subitem
+            label="If you want to define your own datasource, take a look at the JBoss AS Getting Started Guide"
+            skip="true">
+		<command
+           required="false"
+           serialization="org.eclipse.ui.browser.openBrowser(url=https://docs.jboss.org/author/display/AS7/Getting+Started+Guide)"/>
+	</subitem>
+	<subitem
+            label="or at the JBoss AS wiki."
+            skip="true">
+		<command
+           required="false"
+           serialization="org.eclipse.ui.browser.openBrowser(url=http://community.jboss.org/wiki/DataSourceConfigurationInAS7)"/>
+	</subitem>
+  </item>
+  
+  <item
+        skip="true"
+        title="JAX-RS">
+     <description>
+    	 Before we wrap up our tour of the kitchensink example application, 
+    	 let&apos;s take a look at how the JAX-RS endpoints are created. Firstly, {<b>JaxRSActivator</b>}}, 
+    	 which extends <b>Application</b> and is annotated with <b>@ApplicationPath</b>, 
+    	 is the Java EE 6 <b>no XML</b> approach to activating JAX-RS.
+    </description>
+  </item>
+  
+  <item
+        skip="true"
+        title="MemberResourceRESTService.java">
+     <description>
+    	 The real work goes in MemberResourceRESTService, which produces the endpoint:
+    </description>
+    <subitem
+            label="The @Path annotation tells JAX-RS that this class provides a REST endpoint mapped to rest/members (concatenating the path from the activator with the path for this endpoint). "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/MemberResourceRESTService.java"
+			param2="20" />
+	</subitem>
+	<subitem
+            label="JAX-RS endpoints are CDI enabled, and can use CDI-style injection. "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/MemberResourceRESTService.java"
+			param2="23"
+			param3="24" />
+	</subitem>
+	<subitem
+            label="The listAllMembers() method is called when the raw endpoint is accessed and offers up a list of endpoints. Notice that the object is automatically mapped to XML by JAXB. "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/MemberResourceRESTService.java"
+			param2="26"
+			param3="38" />
+	</subitem>
+	<subitem
+            label="The lookupMemberById() method is called when the endpoint is accessed with a member id parameter appended (for example rest/members/1). Again, the object is automatically mapped to XML by JAXB.  "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/main/java/org/jboss/as/quickstarts/kitchensink/rest/MemberResourceRESTService.java"
+			param2="40"
+			param3="45" />
+	</subitem>
+  </item>
+  <item
+        skip="true"
+        title="Run and deploy the application">
+     <description>
+    	 Right-click the jboss-as-helloworld project and select <b>Run As</b> &gt; <b>Run On Server</b> or click on the &quot;Click to Perform&quot; link below. 
+    </description>
+    <action
+		pluginId="org.jboss.tools.project.examples.cheatsheet"
+		class="org.jboss.tools.project.examples.cheatsheet.actions.RunOnServer"
+		param1="jboss-as-kitchensink"/> 
+  </item>
+  <item
+        skip="true"
+        title="Arquillian">
+     <description>
+    	 If you&apos;ve been following along with the Test Driven Development craze of the past few years, 
+    	 you&apos;re probably getting a bit nervous by now, wondering how on earth you are going to test your application. 
+    	 Lucky for you, the Arquillian project is here to help!
+		<br/><br/>
+		Arquillian provides all the boiler plate for running your test inside JBoss AS, 
+		allowing you to concentrate on testing your application. 
+		In order to do that, it utilizes Shrinkwrap, a fluent API for defining packaging, 
+		to create an archive to deploy. 
+		We'll go through the testcase, and how you configure Arquillian in just a moment, 
+		but first let's run the test.
+		
+    </description>
+  </item>
+  <item
+        skip="true"
+        title="Start Arquillian tests">
+    <description>
+    	Arquillian defines two modes, managed and remote. 
+    	The managed mode will take care of starting and stopping the server for you, 
+    	while the remote mode connects to an already running server.
+    	<br/><br/>
+    	The following action starts the test in the <b>remote</b> mode because you have started the server in the previous step. 
+		<br/>
+        Right-click the <b>jboss-as-kitchensink</b> project, select <b>Properties&gt;Maven</b> and 
+        enter <b>arq-jbossas-remote</b> to the <b>Active Maven Profile</b> field. 
+        After that, right-click the project and select <b>Run As&gt;JUnit test</b>.
+    </description>
+    <action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.LaunchJUnitTest"
+			param1="jboss-as-kitchensink" 
+			param2="arq-jbossas-remote"/> 
+  </item>
+  
+  <item
+        skip="true"
+        title="MemberRegistrationTest.java">
+    <description>
+    	So far so good, the test is running. But what does the test look like?
+    </description>
+    <subitem
+            label="@RunWith(Arquillian.class) tells JUnit to hand control over to Arquillian when executing tests."
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/test/java/org/jboss/as/quickstarts/kitchensink/test/MemberRegistrationTest.java"
+			param2="22" />
+	</subitem>
+	<subitem
+            label="The @Deployment annotation identifies the createTestArchive static method to Arquillian as the one to use to determine which resources and classes to deploy "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/test/java/org/jboss/as/quickstarts/kitchensink/test/MemberRegistrationTest.java"
+			param2="24" />
+	</subitem>
+	<subitem
+            label="We add just the classes needed for the test, no more "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/test/java/org/jboss/as/quickstarts/kitchensink/test/MemberRegistrationTest.java"
+			param2="27" />
+	</subitem>
+	<subitem
+            label="We also add persistence.xml as our test is going to use the database "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/test/java/org/jboss/as/quickstarts/kitchensink/test/MemberRegistrationTest.java"
+			param2="28" />
+	</subitem>
+	<subitem
+            label="Of course, we must add beans.xml to enable CDI "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/test/java/org/jboss/as/quickstarts/kitchensink/test/MemberRegistrationTest.java"
+			param2="29" />
+	</subitem>
+	<subitem
+            label="Arquillian allows us to inject beans into the test case "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/test/java/org/jboss/as/quickstarts/kitchensink/test/MemberRegistrationTest.java"
+			param2="32"
+			param3="36" />
+	</subitem>
+	<subitem
+            label="The test method works as you would expect - creates a new member, registers them, and then verifies that the member was created "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/test/java/org/jboss/as/quickstarts/kitchensink/test/MemberRegistrationTest.java"
+			param2="39"
+			param3="47" />
+	</subitem>
+	
+  </item>
+  
+  <item
+        skip="true"
+        title="arquillian.xml">
+    <description>
+    	As you can see, Arquillian has lived up to the promise - the test case is focused on what to test 
+    	(the @Deployment method) and how to test (the @Test method). 
+    	It&apos;s also worth noting that this isn&apos;t a simplistic unit test - this is a fully fledged integration
+    	 test that uses the database.
+		<br/><br/>
+		Now, let&apos;s look at how we configure Arquillian. 
+		First of all, let&apos;s take a look at <b>arquillian.xml</b> in <b>src/test/resources</b>.
+    </description>
+    <subitem
+            label="Arquillian deploys the test war to JBoss AS, and doesn't write it to disk. For debugging, it can be very useful to see exactly what is in your war, so Arquillian allows you to export the war when the tests runs "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/src/test/resources/arquillian.xml"
+			param2="9" />
+	</subitem>
+  </item>
+  
+    <item
+        skip="true"
+        title="pom.xml">
+    <description>
+    	Now, we need to look at how we select between containers in the pom.xml:
+    </description>
+    <subitem
+            label="The profile needs an id so we can activate from Eclipse or the command line "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/pom.xml"
+			param2="176" />
+	</subitem>
+	<subitem
+            label="Arquillian decides which container to use depending on your classpath. Here we define the managed JBoss AS container. "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/pom.xml"
+			param2="238"
+			param3="245" />
+	</subitem>
+	<subitem
+            label="Arquillian decides which container to use depending on your classpath. Here we define the remote JBoss AS container. "
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-kitchensink/pom.xml"
+			param2="285"
+			param3="292" />
+	</subitem>
+  </item>
+  <item
+        skip="true"
+        title="Arquillian project page">
+     <description>
+    	And that&apos;s it! As you can see Arquillian delivers simple and true testing. 
+    	You can concentrate on writing your test functionality, and run your tests in the same environment in which you will run your application.
+    	<br/><br/>
+    	Arquillian also offers other containers, allowing you to run your tests against Weld Embedded (super fast, but your enterprise services are mocked), GlassFish, and more.
+    	<br/><br/>
+    	More info on Arquillian you can find on the Arquillian project page.
+    </description>
+    <command
+           required="false"
+           serialization="org.eclipse.ui.browser.openBrowser(url=http://www.jboss.org/arquillian)"/>
+  </item>
+  
+  <item
+        skip="true"
+        title="Creating your own application ">
+     <description>
+    	What we didn&apos;t tell you about the <b>Kitchensink quickstart</b> is that it is generated from a Maven archetype. 
+    	Using this archetype offers you the perfect opportunity to generate your own project.
+    	<br/><br/>
+    	In order to perform that, you should select <b>Help&gt;JBoss Central</b> and click the <b>Java EE Web Project</b> wizard.
+    	<br/>
+    	You will get a brand new project with the same functionality as <b>kitchensink</b>, 
+    	but customized with your details.
+    </description>
+  </item>
+  
+</cheatsheet>
diff --git a/numberguess/cheatsheets/numberguess.xml b/numberguess/cheatsheets/numberguess.xml
new file mode 100644
index 0000000..0b06b10
--- /dev/null
+++ b/numberguess/cheatsheets/numberguess.xml
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8"?> 
+<cheatsheet title="CDI + JSF: Numberguess quickstart">
+  <intro>
+    <description>This quickstart shows you how to create and deploy a simple application to JBoss AS; the application does not persist any information. Information is displayed using a JSF view, and business logic is encapsulated in two CDI beans.
+</description>
+</intro>
+  <item
+        skip="true"
+        title="The numberguess example in depth">
+     <description>
+    	In the numberguess application you get 10 attempts to guess a number between 1 and 100. After each attempt, you&apos;re told whether your guess was too high or too low.
+<br/><br/>
+The numberguess example is comprised of a number of beans, configuration files and Facelets (JSF) views, packaged as a war module. Let&apos;s start by examining the configuration files.
+<br/><br/>
+All the configuration files for this example are located in <b>WEB-INF/</b>, 
+which can be found in the <b>src/main/webapp</b> directory of the example. 
+First, we have the JSF 2.0 version of <b>faces-config.xml</b>. 
+A standardized version of Facelets is the default view handler in JSF 2.0, 
+ so there&apos;s really nothing that we have to configure. 
+ JBoss AS goes above and beyond Java EE here, 
+ and will automatically configure JSF for you if you include this file. 
+ Thus, the configuration consists of only the root element.on consists of only the root.
+ </description>
+ 		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-numberguess/src/main/webapp/WEB-INF/faces-config.xml"
+			/>
+ </item>
+ <item
+        skip="true"
+        title="beans.xml">
+      <description>
+      There&apos;s also an empty beans.xml file, which tells JBoss AS to look for beans in this application and to activate the CDI.
+<br/><br/>
+Notice that we don&apos;t even need a web.xml!
+      </description>
+      <action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-numberguess/src/main/webapp/WEB-INF/beans.xml"
+			/>
+  </item>
+  
+  <item
+        skip="true"
+        title="home.xhtml">
+     <description>
+Let&apos;s take a look at the main JSF view, <b>src/main/webapp/home.xhtml</b>.
+    </description>
+    <subitem
+            label="There are a number of messages which can be sent to the user, 'Higher!' and 'Lower!'"
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-numberguess/src/main/webapp/home.xhtml"	
+			param2="20"
+			param3="24" />
+	</subitem>
+	<subitem
+            label="As the user guesses, the range of numbers they can guess gets smaller - this sentence changes to make sure they know the number range of a valid guess."
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-numberguess/src/main/webapp/home.xhtml"	
+			param2="29"
+			param3="32" />
+	</subitem>
+	<subitem
+            label="This input field is bound to a bean property using a value expression."
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-numberguess/src/main/webapp/home.xhtml"	
+			param2="38"
+			param3="42" />
+	</subitem>
+	<subitem
+            label="A validator binding is used to make sure the user doesn't accidentally input a number outside of the range in which they can guess - if the validator wasn't here, the user might use up a guess on an out of bounds number."
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-numberguess/src/main/webapp/home.xhtml"	
+			param2="42" />
+	</subitem>
+	<subitem
+            label="There must be a way for the user to send their guess to the server. Here we bind to an action method on the bean."
+            skip="true">
+		<action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-numberguess/src/main/webapp/home.xhtml"	
+			param2="43"
+			param3="45" />
+	</subitem>
+  </item>
+  
+  <item
+        skip="true"
+        title="Random.java">
+     <description>
+    	 The example consists of 4 classes, the first two of which are qualifiers. First, there is the
+<b>@Random qualifier</b>, used for injecting a random number:
+    </description>
+    <action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Random.java" />
+  </item>
+  
+  <item title="Qualifier">
+     <description>A <b>qualifier</b> is used to disambiguate between two beans both of which are eligible for injection based on their type. For more, see the Weld Reference Guide.</description>
+     <command
+           required="false"
+           serialization="org.eclipse.ui.browser.openBrowser(url=http://docs.jboss.org/weld/reference/latest/en-US/html/)"/>
+  </item> 
+  
+  <item
+        skip="true"
+        title="MaxNumber.java">
+     <description>
+    	 There is also the <b>@MaxNumber qualifier</b>, used for injecting the maximum number that can be injected:
+    </description>
+    <action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/MaxNumber.java" />
+  </item>
+  
+  <item
+        skip="true"
+        title="Generator.java">
+     <description>
+    	 The application-scoped <b>Generator</b> class is responsible for creating the random number, via a producer method. It also exposes the maximum possible number via a producer method.
+    	 <br/>
+    	 The Generator is application scoped, so we don't get a different random each time.
+    </description>
+    <action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Generator.java" 
+			param2="28" />
+  </item>
+  
+  <item
+        skip="true"
+        title="Game.java">
+     <description>
+        The final bean in the application is the session-scoped <b>Game</b> class. 
+    	 This is the primary entry point of the application. 
+    	 It&apos;s responsible for setting up or resetting the game, 
+    	 capturing and validating the user&apos;s guess and providing feedback to the user with a <b>FacesMessage</b>. 
+    	 We&apos;ve used the post-construct lifecycle method to initialize the game by retrieving a random number from the 
+    	 <b>@RandomInstance&lt;Integer&gt;</b> bean.
+<br/><br/>
+	You&apos;ll notice that we&apos;ve also added the <b>@Named</b> annotation to this class. 
+	This annotation is only required when you want to make the bean accessible to a JSF view via EL (i.e., #{game}).
+     </description>
+    <action
+			pluginId="org.jboss.tools.project.examples.cheatsheet"
+			class="org.jboss.tools.project.examples.cheatsheet.actions.OpenFileInEditor"
+			param1="/jboss-as-numberguess/src/main/java/org/jboss/as/quickstarts/numberguess/Game.java" 
+			param2="35"
+			param3="36" />
+  </item>
+  
+  <item
+        skip="true"
+        title="Run and deploy the application">
+     <description>
+    	 Right-click the <b>jboss-as-numberguess</b> project and select <b>Run As</b> &gt; <b>Run On Server</b> or click on the &quot;Click to Perform&quot; link below. 
+    </description>
+    <action
+		pluginId="org.jboss.tools.project.examples.cheatsheet"
+		class="org.jboss.tools.project.examples.cheatsheet.actions.RunOnServer"
+		param1="jboss-as-numberguess"/> 
+  </item>
+</cheatsheet>
-- 
1.7.1.msysgit.0

