From 0c1ff0ba20ac0bafcb5d181a10d5428930809310 Mon Sep 17 00:00:00 2001 From: Lawrence McAlpin Date: Fri, 23 Sep 2011 16:19:56 -0400 Subject: [PATCH] Missing documentation no longer missing --- conf/application.conf | 4 ++ documentation/manual/home.textile | 65 ++++++++++++++++++++++++++++++ lib/play-scaffold.jar | Bin 40368 -> 40368 bytes 3 files changed, 69 insertions(+) create mode 100644 conf/application.conf create mode 100644 documentation/manual/home.textile diff --git a/conf/application.conf b/conf/application.conf new file mode 100644 index 0000000..c532870 --- /dev/null +++ b/conf/application.conf @@ -0,0 +1,4 @@ +application.name=unittest +application.mode=dev +application.secret=test +db=mem diff --git a/documentation/manual/home.textile b/documentation/manual/home.textile new file mode 100644 index 0000000..e391221 --- /dev/null +++ b/documentation/manual/home.textile @@ -0,0 +1,65 @@ +h1. Play--Scaffold + +To use, reference the module from your application.conf: + +bc. + module.scaffold=C:/Path/To/Play/Modules/scaffold/ + +Then create your project: + +bc. + play new + +Actually, maybe you should create your project first, and then edit its application.conf. + +Now, add some JPA or Siena models. The model entities have to extend play.db.jpa.Model or siena.Model. + +Then run: + +bc. + play scaffold:gen + +Then launch your application: + +bc. + play run + +h2. Additional Options + +--with-layout: +Creates the main.html template layout file and an Application.index view which simply enumerates your controllers. Because these files already exist in the default Play! project, you usually need to use --overwrite to ensure they are written. If you don't want controllers and views to be written as well, use --exclude:~ to omit them. + +--with-login: +Requires you to use the secure module as well. This will cause generated controllers to be marked with the @With(Secure.class) annotation to require a login. It also creates a model called User, a default authentify implementation and, if --with-layout is specified, will add Login | Logout links to the Application.index home page. The User model extends play.db.jpa.Model. If you are using an alternative ORM, you are on your own (at this time.) + +--include=...: +Allows you to restrict controller and view scaffolding to the specified models. Allows a "~" wildcard. For example --include=a~s will only build a controller and views for models that begin with "a" and end with "s". + +--exclude=...: +Allows you to restrict controller and view scaffolding to the specified models. Allows a "~" wildcard. For example --exclude=a~s will only build a controller and views for models that DO NOT begin with "a" and end with "s". If both --include and --exclude are specified, --exclude has precedence. + +--overwrite +By default, we won't overwrite files if they already exist. This flag will instruct us to overwrite anything we are trying to generate, even if it exists already. + +h2. Model Annotations + +We try to infer as much information as possible from the model, but it could be useful to instruct the +scaffolding code to generate (or ignore) fields in a particular fashion. We allow you to use two annotations +to control this behavior: + +@NoScaffolding: this causes the scaffolding generator to ignore the annotated field + +@ViewScaffoldingOverride: this lets you define the FormElementType that you would like an annotated field to +be rendered as + +h2. KNOWN ISSUES + +ManyToOne dropdowns will show a (None) field if they are not flagged with the @Required annotation. On Play! +1.0, this binds to an empty model with a null id which will likely fail to save due to a TransientObjectException. +On Play! 1.1, this binds to a null field, which is what we would typically want. + +ManyToMany multiple selection boxes do not work on Play! 1.0. They do appear to work as expected on Play! 1.1. + +Because both of these issues work on Play! 1.1, no attempt will be made to correct them. Once Play! 1.1 is released +to production, no further attempt to preserve compatibility with Play! 1.0 will be made. + diff --git a/lib/play-scaffold.jar b/lib/play-scaffold.jar index 94842d9bbb04bbb2463fb0410144964e84a53801..b87779c5b58f712bf44fe0a59c53b7abd7ecc43d 100644 GIT binary patch delta 741 zcmdn6n`y&tCf)#VW)?065NHqnHIY|?xeZ8JYz9;B6hPEuK}N9XWE)09W}u?U1&kJ8 z@zsoGVEPH8wIEQP9oQ5oAwStLLkZRJ$?;6)VEr?hG(q|{A7!fJ12fzNEf~R!Mj;Id zV~ubfgrO^%#t721d74-|6PTeOsmKLZ?4s|hZ!$3>!G#_6yih?GL)afsqqF)k2u43pkN7|I!cA!?MfnIO*4$nj+cJEJ1M z73`i(Mft2?->;n`^Y{!i1H)-{1_t%X6RQD=mw^bPxJ=UqLaM9@=252!StF*=3wz>ll;N7#pDn$-9I@9Oh1_% z4W^x@#DUc>o)QM8|4f0X3!a(`mftxw5lqWY3kTEX(;)h;PRjxFU8ZM&>5bDLoi*yXaS~I zGn#?vCydsDKy`LtQ=o+WWWx+4RKq97Gns?c&t%dB(VLGl)$xHDZh{t!U`C^m286Lj zxDLY56-|RMriryPfz>ETDsq7tF3JuNk#^PHtY8sW?bRG$#%E(kW-!CtJQ<>9u4NlL zSVYZnktmpPIxGlkVB~R#;#V;)5OWNZ-a{D58Gj*al(U&2&d|v5g($AbZv{(jD#~XC z`+n^lna5|C85mBpGcc%6o>;B0c|rLDW6@nPq|nC{`xhPp}7xPi~xG0H(J9#XmWd4cJqN$y~J%_K-XJe%YX=37h-0n`1HgTVBY$+I$$P5-QJlHeLAz!!Q#_qLF|1Gr9Eat?4Lgy;?6I#A@=&s2?ncQG6%x{HwU6F HbZ#^Nqq0xm