|
|
GrailsProjectPlugin
Grails 400 Utils as a Standard Grails Plugin.
Introduction
This page details how to install and use the Grails 400 Utilities via a standard Grails plugin.
Details
Steps to create a Grails project and generate Grails domain classes from System i files
- Note: These directions assumes Grails has already been installed and configured to your PC
- From DOS:
- Change to a working directory to which a Grails project will be created
- > cd \grailswork
- Create a grails project
- > grails create-app yourprojname
- Change the directory to the newly generated Grails project
- > cd \grailswork\yourprojname
- Install the System i Grails Domain Tool plugin
- > grails install-plugin http://grails400utils.googlecode.com/files/grails-systemitools-0.2.zip
- Use the plugin to reverse-engineer a 400 file into a Grails domain
- > grails build-systemi-grails-domain
- this will prompt for ip, user, password, library, file, and domainName
- optionally, you could type the arguments in the command string space delimited:
- > grails build-systemi-grails-domain 172.16.1.4 denoncourt secret mylib custmast Customer
- If you get a stack trace, run the following and it should work on a second try:
- > grails clean
- I'm not sure why this happens but it should be fixed in a subsequent release
- You will get a message "be sure to modify grails-app/conf/DataSource.groovy to specify your System i settings" and then list the code such as (but with your info):
dataSource {
pooled = true
url = "jdbc:as400://yourip/yourlib"
driverClassName = "com.ibm.as400.access.AS400JDBCDriver"
username = "yourusername"
password = "yourpassword"
dialect = org.hibernate.dialect.DB2400Dialect.class
}- paste/replace that dataSource code over the dataSource specified within the development section, you should see the following in your DataSource.groovy file:
development {
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop','update'
url = "jdbc:hsqldb:mem:devDB"
}
}- > grails generate-all yourGrailsDomainName
- Note, to handle legacy data, the System i Grails Domain generator also replaced the default Grails controller and page view templates.
- > grails run-app
Sign in to add a comment
