Source

Texa / grails-app / services / ImportXMLService.groovy

import grails.converters.XML
import java.io.FileInputStream

class ImportXMLService {

    boolean transactional = true

    def importFirmService
    def importClientService
    def importProjectService
    def importTodoListsService

    def importFromFile(String pathAndFilename) {

        def accountXML = XML.parse(new FileInputStream(pathAndFilename), "UTF-8")

    
        importFirmService.importXML(accountXML.firm)
        importClientService.importXML(accountXML.clients)
        importProjectService.importXML(accountXML.projects)
    
        importTodoListsService.importXML(accountXML.projects)

    }
}