Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Labels:None
-
Environment:WinXP on Intel
Description
I worked on the scaffolding templates and added some more features.
Would be nice, if the new features - or some of them - could be added to the current grails scaffolding templates.
Should be eben possible just to replace the templates?
Content:
=========
A. changes to the templates
B. usage
C. constraint examples
A. changes to the templates:
============================
general:
-many-to-many now works including deletion of depending side
-domains in packages possible
-output XHTML conform (exception is datepicker)
-improved CSS usage for easier customization
-enums with i18n support
-proper HTML encoding including messages
controller:
-list with automatic filter and sort
-Message text optimized
-list as Default View after create and edit (instead of show)
-using getComposite as primary key for legacy db
-choose and addTO for associating existing objects (instead of just new ones)
create and edit:
-g:form with controller-name
-use constraint editable, to show / hide property
show:
-Constraints display and password
-optional output of "subElement"s for referencesDomains
-linked output of strings with constraint "url"
-formatted output of dates (via constraints attribute dateFormat, default is
"dd.mm.YYYY")
-constraints attribute numberformat und numberFormatName
-output checkbox for booleans
list:
-improved sorting (not just via ID of referencedDomains)
-filter added
-icons Show, Edit, Delete
-more than 6 columns possible
-ID-column not required any more
-constraints display, password and listable
-constraints attribute cssStyle
-view also used for associating existing objects
-formatted output of dates (via constraints attribute dateFormat, default is
"dd.mm.YYYY")
-constraints attribute numberformat und numberFormatName
-output checkbox for booleans
-right aligned output of numbers
-linked output (to show view) of referencedDomains
-linked output of strings with constraint "url"
-some class attributes for css customization
-integrated tag for error messages
-optional integration of searchable plugin
(if installed and configured, input and button will be rendered in list view)
-i18n for all messages
-improvements according to some open JIRAs
-list view without records show message instead of empty table
renderEditor.template:
-constraints attribute cssStyle
-sorted output of 1:n
-constraint isRadio
-some class attributes for css customization
-assoziation of existing 1:n and n:m objekts
-select only for range < 50, else textfield, to avoid memory error
-render enum as select or radio
B. usage
============================
1. "grails create-app" or use existing app (backup before!!!)
2. "grails install-templates"
3. "grails create-controller Base" (create the required empty BaseController)
5. install templates from zip
5.a copy artifacts and scaffolding src/templates
5.b copy main.css and search.css to web-app/css
5.c copy main.gsp to grails-app/views/layouts
6. create domain classes or use existing ones
(for existing ones add methods with "TODO"s in template DomainClass.groovy,
especially in getDefaultOrder() the TODO must be replaced)
7. grails generate-all
8. grails run-app
C. constraint examples:
============================
static constraints = {
name(blank:false, nullable:false, size:1..100, attributes:[cssStyle:"width:400px;"])
x(range:1..200, unique:'y')
y(range:1..200, unique:'x')
example1(nullable:true, default:null, range:0..30, attributes:[listable:false])
example2(editable:false)
example3(attributes:[isRadio:true, listable:false])
example4(editable: false, url:true, attributes:[listable:false])
example5(password:true, blank:false, nullable:false, size:1..32)
owner(attributes:[subElement:"groups"])
lastLogin(attributes:[dateFormat:"dd.MM.yyyy HH:mm", precision:"minute", years:"$
"])
lastLogout(attributes:[dateFormatName:"myFormats.mySpecialLogoutFormat"])
numberOfXY(attributes:numberFormat:"###,##0")
numberOfZ(attributes:[numberFormatName:"myFormats.mySpecialFormatZ"])
id(display:false)
}
If you want these changes integrated please attach a patch for review