Package org.molgenis.framework.db

Examples of org.molgenis.framework.db.EntityImportReport


        String entityName = this.getFormScreen().getEntityClass().getSimpleName();

        EntitiesImporter entitiesImporter = this.getFormScreen().getCsvEntityImporter();
        entitiesImporter.setDatabase(db);

        EntityImportReport importReport = null;
        try
        {
          importReport = entitiesImporter.importEntities(csvReader, entityName, DatabaseAction.ADD);
        }
        finally
        {
          csvReader.close();
        }

        msg = new ScreenMessage("CSV UPLOAD SUCCESS: added " + importReport.getNrImported() + " rows", null,
            true);
        logger.debug("CSV UPLOAD SUCCESS: added " + importReport.getNrImported() + " rows");
        getFormScreen().getPager().resetFilters();
        getFormScreen().getPager().last(db);
      }
      catch (Exception e)
      {
View Full Code Here


      try
      {
        CsvReader csvReader = new CsvReader(request.getFile("filefor___csvdata"));
        String entityName = this.getFormScreen().getEntityClass().getSimpleName();

        EntityImportReport importReport = null;
        try
        {
          EntitiesImporter entityImporter = this.getFormScreen().getCsvEntityImporter();
          entityImporter.setDatabase(db);
          importReport = entityImporter.importEntities(csvReader, entityName, DatabaseAction.ADD);
        }
        finally
        {
          csvReader.close();
        }

        msg = new ScreenMessage("CSV UPLOAD SUCCESS: added " + importReport.getNrImported() + " rows", null,
            true);
        logger.debug("CSV UPLOAD SUCCESS: added " + importReport.getNrImported() + " rows");
        getFormScreen().getPager().resetFilters();
        getFormScreen().getPager().last(db);
      }
      catch (Exception e)
      {
View Full Code Here

TOP

Related Classes of org.molgenis.framework.db.EntityImportReport

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.