- Timestamp:
- Mar 18, 2011, 3:32:42 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/controllers/generic/installation/SetupController.groovy
r1648 r1651 3 3 import grails.plugins.springsecurity.Secured 4 4 import dbnp.authentication.SecUser 5 import org.codehaus.groovy.grails.commons.ConfigurationHolder 5 6 6 7 /** … … 53 54 if (pluginManager.getGrailsPlugin('grom')) "entering the WebFlow".grom() 54 55 56 // get configuration 57 def config = ConfigurationHolder.config 58 println config.dump() 59 println config.dataSource.dump() 60 61 def configPath = new File("/etc/${meta(name: 'app.name')}/") 62 if (configPath.exists()) { 63 println "path exists" 64 } else { 65 println "path does not exist" 66 } 67 68 if (configPath.canWrite()) { 69 println "path is writable" 70 } else { 71 println "path is not writable" 72 } 73 74 def configFile = new File("/etc/${meta(name: 'app.name')}/${grails.util.GrailsUtil.environment}.properties") 75 if (configFile.exists()) { 76 println "file exists" 77 } else { 78 println "file does not exist" 79 } 80 81 55 82 // define variables in the flow scope which is availabe 56 83 // throughout the complete webflow also have a look at … … 60 87 // wizard tabs. Also see common/_tabs.gsp for more information 61 88 flow.page = 0 89 //flow.config = ConfigurationHolder.config 62 90 flow.pages = [ 63 [title: ' Page One'],64 [title: ' Page Two'],91 [title: 'Configuration Location'], 92 [title: 'Database'], 65 93 [title: 'Page Three'], 66 94 [title: 'Page Four'], 67 95 [title: 'Done'] 68 96 ] 69 flow.cancel = true; 70 flow.quickSave = true; 97 flow.cancel = true 98 flow.quickSave = true 99 100 // define famfamfam icons 101 flow.icons = [ 102 'true' : 'accept', 103 false : 'cancel' 104 ] 105 106 // add configuration information to the flow scope 107 flow.configInfo = [ 108 path : configPath, 109 pathExists : configPath.exists(), 110 pathCanRead : configPath.canRead(), 111 pathCanWrite : configPath.canWrite(), 112 pathSummary : (configPath.exists() && configPath.canRead() && configPath.canWrite()), 113 file : configFile, 114 fileExists : configFile.exists(), 115 fileCanRead : configFile.canRead(), 116 fileCanWrite : configFile.canWrite(), 117 fileSummary : (configFile.exists() && configFile.canRead() && configFile.canWrite()) 118 ] 71 119 72 120 success() … … 87 135 success() 88 136 } 89 on("next").to " pageOne"137 on("next").to "configuration" 90 138 } 91 139 92 140 // first wizard page 93 pageOne{94 render(view: "_ page_one")95 onRender { 96 // Grom a development message 97 if (pluginManager.getGrailsPlugin('grom')) ".rendering the partial: pages/_ page_one.gsp".grom()141 configuration { 142 render(view: "_configuration_location") 143 onRender { 144 // Grom a development message 145 if (pluginManager.getGrailsPlugin('grom')) ".rendering the partial: pages/_database.gsp".grom() 98 146 99 147 flow.page = 1 … … 116 164 flow.page = 5 117 165 }.to "save" 166 on("toConfigurationPath").to "configurationPath" 167 on("toConfigurationFile").to "configurationFile" 118 168 } 119 169 120 170 // second wizard page 121 pageTwo{122 render(view: "_ page_two")171 database { 172 render(view: "_database") 123 173 onRender { 124 174 // Grom a development message
Note: See TracChangeset
for help on using the changeset viewer.