Changeset 258


Ignore:
Timestamp:
Jan 5, 2010, 2:02:38 PM (14 years ago)
Author:
gav
Message:

Add a service to create bulk test data.

Location:
trunk/grails-app
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/AppCoreController.groovy

    r237 r258  
    77
    88    def personService
     9    def appConfigService
    910    def createDataService
    10     def appConfigService
     11    def createBulkDataService
    1112
    1213    def index = { redirect(action:start,params:params) }
     
    176177    }
    177178
     179    /**
     180    * Allow admin to create bulk test data.
     181    */
     182    @Secured(['ROLE_AppAdmin'])
     183    def createBulkTestData = {
     184        if(!createBulkDataService.create()) {
     185            flash.message = "Bulk test data could not be created."
     186            redirect(action: appAdmin)
     187            return
     188        }
     189
     190        // Success.
     191        flash.message = "Bulk test data created."
     192        redirect(action: appAdmin)
     193    }
     194
    178195} // end of class.
  • trunk/grails-app/services/CreateDataService.groovy

    r252 r258  
    454454        def taskGroupInstance
    455455
     456        //TaskGroup #1
    456457        taskGroupInstance = new TaskGroup(name:"Engineering Activites",
    457458                                                                            description:"Engineering daily activities")
    458459        saveAndTest(taskGroupInstance)
    459460
     461        //TaskGroup #2
    460462        taskGroupInstance = new TaskGroup(name:"Production Activites",
    461463                                                                            description:"Production daily activities")
    462464        saveAndTest(taskGroupInstance)
    463465
     466        //TaskGroup #3
    464467        taskGroupInstance = new TaskGroup(name:"New Projects",
    465468                                                                            description:" ")
  • trunk/grails-app/views/appCore/appAdmin.gsp

    r237 r258  
    5454                        </tr>
    5555
     56                        <g:if env="development">
     57                            <tr class="prop">
     58                                <td valign="top" class="name">
     59                                    <label>Test:</label>
     60                                </td>
     61                                <td valign="top" class="value">
     62                                    <g:link action="createBulkTestData">Bulk</g:link> - Create a large volume of test data.
     63                                </td>
     64                            </tr>
     65                        </g:if>
     66
    5667                    </tbody>
    5768                </table>
Note: See TracChangeset for help on using the changeset viewer.