Search in sources :

Example 1 with CollectCodeListService

use of org.openforis.collect.service.CollectCodeListService in project collect by openforis.

the class CodeListManager method importCodeLists.

@Transactional
public void importCodeLists(CollectSurvey survey, InputStream is) throws CodeListImportException {
    int nextSystemId = codeListItemDao.nextSystemId();
    CollectCodeListService service = new CollectCodeListService();
    service.setCodeListManager(this);
    CodeListImporter binder = new CodeListImporter(service, nextSystemId);
    try {
        binder.importCodeLists(survey, is);
    } catch (IdmlParseException e) {
        throw new CodeListImportException(e);
    }
}
Also used : CodeListImporter(org.openforis.idm.metamodel.xml.CodeListImporter) CodeListImportException(org.openforis.collect.io.exception.CodeListImportException) CollectCodeListService(org.openforis.collect.service.CollectCodeListService) IdmlParseException(org.openforis.idm.metamodel.xml.IdmlParseException) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

CodeListImportException (org.openforis.collect.io.exception.CodeListImportException)1 CollectCodeListService (org.openforis.collect.service.CollectCodeListService)1 CodeListImporter (org.openforis.idm.metamodel.xml.CodeListImporter)1 IdmlParseException (org.openforis.idm.metamodel.xml.IdmlParseException)1 Transactional (org.springframework.transaction.annotation.Transactional)1