Ignore:
Timestamp:
Feb 26, 2010, 12:26:29 PM (7 years ago)
Author:
tabma
Message:
  • added Template chooser, used in the properties page
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/controllers/dbnp/importer/ImporterController.groovy

    r203 r215  
    2222import org.apache.poi.hssf.usermodel.HSSFCell
    2323import org.apache.poi.ss.usermodel.DataFormatter
     24import dbnp.studycapturing.Template
    2425
    2526class ImporterController {
     
    2930     * Default page
    3031     **/
    31     def index = { }
     32    def index = {
     33        [templates:Template.list()]
     34    }
    3235
    3336    /**
     
    4750
    4851        session.header = header
     52        session.importtemplate_id = params.template_id
    4953
    5054        render (view:"step1", model:[header:header, datamatrix:datamatrix])
     
    5256    }
    5357
     58    /**
     59    * User has assigned all entities to the columns and continues to the next step (assigning properties to columns)
     60    *
     61    * @param entity list of entities
     62    * @return properties page
     63    */
    5464    def savepreview = {
    5565        def entities  = request.getParameterValues("entity")
    5666
    57         render(view:"step2", model:[entities:entities, header:session.header])
     67        // currently only one template is used for all entities
     68        // TODO: show template fields per entity
     69       
     70        def templates = Template.get(session.importtemplate_id)
     71
     72        render(view:"step2", model:[entities:entities, header:session.header, templates:templates])
    5873    }
    5974}
Note: See TracChangeset for help on using the changeset viewer.