Changeset 358 for trunk/grails-app
- Timestamp:
- Feb 16, 2010, 9:01:07 AM (15 years ago)
- Location:
- trunk/grails-app
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/grails-app/conf/Config.groovy
r353 r358 59 59 rollingFile name:"appLog", 60 60 file:"${logDirectory}/${appName}.log".toString(), 61 maxFileSize:' 1MB',61 maxFileSize:'300kB', 62 62 maxBackupIndex:0, 63 63 layout:pattern(conversionPattern: '%d{[EEE, dd-MMM-yyyy @ HH:mm:ss.SSS]} [%t] %-5p %c %x - %m%n') -
trunk/grails-app/controllers/AppCoreController.groovy
r318 r358 1 1 import org.codehaus.groovy.grails.plugins.springsecurity.Secured 2 import org.codehaus.groovy.grails.commons.* 2 3 3 4 /** … … 193 194 } 194 195 196 /** 197 * Render the application log file. 198 */ 199 @Secured(['ROLE_AppAdmin']) 200 def appLog = { 201 def file = new File(ConfigurationHolder.config.log4j.appenders.appLog.file) 202 203 // Success. 204 [log: file.text] 205 } 206 195 207 } // end of class. -
trunk/grails-app/controllers/SectionDetailedController.groovy
r298 r358 3 3 @Secured(['ROLE_AppAdmin', 'ROLE_Manager', 'ROLE_AssetManager']) 4 4 class SectionDetailedController extends BaseController { 5 6 def sectionService 5 7 6 8 // the delete, save and update actions only accept POST requests … … 29 31 @Secured(['ROLE_AppAdmin']) 30 32 def delete = { 31 def sectionInstance = Section.get( params.id ) 32 if(sectionInstance) { 33 try { 34 sectionInstance.delete(flush:true) 35 flash.message = "Section ${params.id} deleted" 36 redirect(action:list) 37 } 38 catch(org.springframework.dao.DataIntegrityViolationException e) { 39 flash.message = "Section ${params.id} could not be deleted" 40 redirect(action:show,id:params.id) 41 } 33 def result = sectionService.delete(params) 34 35 if(!result.error) { 36 flash.message = g.message(code: "default.delete.success", args: ["Section", params.id]) 37 redirect(action:list) 38 return 42 39 } 43 else { 44 flash.message = "Section not found with id ${params.id}" 40 41 flash.errorMessage = g.message(code: result.error.code, args: result.error.args) 42 43 if(result.error.code == "default.not.found") { 45 44 redirect(action:list) 45 return 46 46 } 47 48 redirect(action:show, id: params.id) 47 49 } 48 50 -
trunk/grails-app/views/appCore/appAdmin.gsp
r264 r358 17 17 <table> 18 18 <tbody> 19 20 <tr class="prop"> 21 <td valign="top" class="name"> 22 <label>Log:</label> 23 </td> 24 <td valign="top" class="value"> 25 <g:link action="appLog">View</g:link> - The application log file. 26 </td> 27 </tr> 19 28 20 29 <tr class="prop">
Note: See TracChangeset
for help on using the changeset viewer.