Ignore:
Timestamp:
Mar 18, 2011, 4:06:07 PM (13 years ago)
Author:
work@…
Message:
  • config file stuff into it's page logic
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/generic/installation/SetupController.groovy

    r1651 r1653  
    5959                        println config.dataSource.dump()
    6060
    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 
    8261                        // define variables in the flow scope which is availabe
    8362                        // throughout the complete webflow also have a look at
     
    10079                        // define famfamfam icons
    10180                        flow.icons = [
    102                             'true'      : 'accept',
     81                            true        : 'accept',
    10382                                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())
    11883                        ]
    11984
     
    146111
    147112                                flow.page = 1
     113
     114                                // config
     115                                def configPath = new File("/etc/${meta(name: 'app.name')}/")
     116                                def configFile = new File("/etc/${meta(name: 'app.name')}/${grails.util.GrailsUtil.environment}.properties")
     117
     118                                // add configuration information to the flow scope
     119                                flow.configInfo = [
     120                                        path: configPath,
     121                                        pathExists: configPath.exists(),
     122                                        pathCanRead: configPath.canRead(),
     123                                        pathCanWrite: configPath.canWrite(),
     124                                        pathSummary: (configPath.exists() && configPath.canRead() && configPath.canWrite()),
     125                                        file: configFile,
     126                                        fileExists: configFile.exists(),
     127                                        fileCanRead: configFile.canRead(),
     128                                        fileCanWrite: configFile.canWrite(),
     129                                        fileSummary: (configFile.exists() && configFile.canRead() && configFile.canWrite())
     130                                ]
     131
    148132                                success()
    149133                        }
Note: See TracChangeset for help on using the changeset viewer.