diff --git a/scripts/forge_html5_5_mins.asciidoc b/scripts/forge_html5_5_mins.asciidoc index e6f12fc..85e4052 100644 --- a/scripts/forge_html5_5_mins.asciidoc +++ b/scripts/forge_html5_5_mins.asciidoc @@ -4,14 +4,11 @@ Zero to HTML5 app Prerequisites ------------- -* JBDS 7 setup +* JBDS 8 (Beta 2) setup * JBoss EAP 6.x server available in JBDS * Forge launched in JBDS *Cmd + 4* * Switch to JBoss perspective - -Once forge is started ---------------------- -* `set ACCEPT_DEFAULTS true` in Forge to make it a bit less verbose +* Open the Forge Console Create an app ------------- @@ -20,16 +17,16 @@ This section of the script creates a new app from scratch from Forge, imports it 1. In the forge console, create a new Project - new-project --named rhsessions --topLevelPackage com.redhat.sessions + project-new --named rhsessions --topLevelPackage com.redhat.sessions 2. Now, we'll add some capabilities - Servlet, CDI, JPA, Bean Validation, JAX-RS - servlet setup; beans setup; persistence setup --provider HIBERNATE --container JBOSS_EAP6; validation setup --provider JAVA_EE; rest setup + servlet-setup; cdi-setup; jpa-setup --provider Hibernate --container JBOSS_EAP6; constraint-setup; rest-setup; 3. Now let's add some entities - entity --named Attendee - entity --named Session + jpa-new-entity --named Attendee + jpa-new-entity --named Session 4. Now, we want to add some Bean Validation constraints. You should end up with field definitions like these. @@ -37,7 +34,7 @@ This section of the script creates a new app from scratch from Forge, imports it In `Session`: + [source,java] ---------------------------------------------------------------------------- +---- @Size(message = "Must be > 20 and < 1000", min = 20, max = 1000) private String description; @@ -48,7 +45,7 @@ This section of the script creates a new app from scratch from Forge, imports it @OneToMany private Collection speakers = new ArrayList(); --------------------------------------------------------------------------- +---- + Now generate getters and setters. + @@ -57,30 +54,21 @@ Take a copy of the name field from Session, and paste into Attendee In `Attendee`: + [source,java] --------------------------------------------------------------------------- +---- @NotNull @Size(message = "Must be > 5 and < 50", min = 5, max = 50) private String name; --------------------------------------------------------------------------- +---- + Now generate getters and setters. -+ -6. Scaffold endpoints for the entity. - - cd ~~ - rest endpoint-from-entity --contentType application/json com.redhat.sessions.model.* - -7. Open up JAX-RS REST Web Services, and locate `GET /rest/session`. Right click on it, and choose *Run As -> Run On Server*. In the Web Service Tester, click the *Play* button, and show the result - -Add HTML5 Mobile view ---------------------- -1. Setup HTML5 scaffolding - scaffold-x setup --scaffoldType angularjs +Add HTML5 Mobile view with REST resources +----------------------------------------- -2. Generate the CRUD +1. Generate the RESTful CRUD with an AngularJS frontend and a JAX-RS backend. - scaffold-x from src/main/java/com/redhat/sessions/model/* + scaffold-generate --provider AngularJS --targets com.redhat.sessions.model.* +2. Open up JAX-RS REST Web Services, and locate `GET /rest/sessions`. Right click on it, and choose *Run As -> Run On Server*. In the Web Service Tester, click the *Play* button, and show the result