Instructions can be found here : http://forge.jboss.org/docs/using/
AG Controller scaffolding needs some features only available in a branch : Clone this repo :
https://github.com/sebastienblanc/aerogear-controller
and check out this branch :
git checkout AEROGEAR-1006
and build:
mvn clean install
To go faster and avoid typing too much commands you can use a forge script, copy/paste the following in a text file and save it as scaffold.fsh (or whatever name you want)
new-project --named scaffoldtester;
persistence setup --provider HIBERNATE --container JBOSS_AS7;
validation setup --provider JAVA_EE;
entity --named Customer;
field string --named firstName;
field temporal --type DATE --named dateOfBirth;
entity --named DiscountVoucher;
field string --named voucherCode;
entity --named StoreOrder;
field string --named product;
field int --named amount;
constraint Min --onProperty amount --min 1;
constraint Max --onProperty amount --max 50;
field string --named remarks;
constraint Size --onProperty remarks --max 100;
field manyToOne --named customer --fieldType com.example.scaffoldtester.model.Customer.java;
field oneToOne --named voucher --fieldType com.example.scaffoldtester.model.DiscountVoucher.java;
@/*cd ../Customer.java*/;
@/*field oneToMany --named orders --fieldType com.example.scaffoldtester.model.StoreOrder.java*/;
rest setup --activatorType WEB_XML;
rest endpoint-from-entity --contentType application/json com.example.scaffoldtester.model.*;
scaffold setup --scaffoldType html5-aerogear;
scaffold from-entity com.example.scaffoldtester.model.*;
Please feel free after a first test to change the values, names, relations but try to keep consistent in the package naming (remember COC)
forge
Once in the Forge Shell type (forge is part of the command to type) :
forge git-plugin git://github.com/sebastienblanc/scaffold-html5 --ref ag-controller
run scaffold.fsh
Just press enter for each prompt (defaults are okay)
mvn clean install
Enjoy !