-
Book Overview & Buying
-
Table Of Contents
Grails 1.1 Web Application Development
By :
After our brief detour into the rich world of Grails support for Hibernate Criteria querying, it is time to get back to the application. To recap, we have modified our domain model to handle version history for uploaded files, and have updated the HomeController to use Criteria to retrieve the list of files, given the new domain structure.
We now have two scenarios for file upload:
Posting a new file
Posting a new version of an existing file
To handle the new case, posting a new version of an existing file, we need a new action to load the Post File page. Add the following action to the FileController:
def newVersion = {
def model = [file: new FileVersion(), fileId: params.id]
render( view: 'create', model: model )
}
By specifying the create view for the newVersion action, we are able to reuse the create.gsp file to render the Post File page for both scenarios. Notice that we have added a new parameter to the view model: fileId. This contains...
Change the font size
Change margin width
Change background colour