Package edu.isi.karma.imp.json

Examples of edu.isi.karma.imp.json.JsonImport$FileObject


        topA.endArray().endObject();
      }

      topA.endArray();

      JsonImport ji = new JsonImport(x.toString(),
          "Nested Table 2", workspace, "UTF-8", -1);
      Worksheet w = ji.generateWorksheet();
      return w;
    } catch (JSONException e) {
      e.printStackTrace();
      return null;
    }
View Full Code Here


        ModelingConfiguration.setManualAlignment(true);
        File file = new File(getClass().getClassLoader().getResource("people.json").toURI());
        InputStream is = new FileInputStream(file);
        Reader reader = EncodingDetector.getInputStreamReader(is, EncodingDetector.detect(file));
    Object json = JSONUtil.createJson(reader);
    JsonImport imp = new JsonImport(json, "people.json", workspace, EncodingDetector.detect(file), 1000);
    worksheet = imp.generateWorksheet();
  }
View Full Code Here

      jsonAnnotation.put("hNodeId", hNodeId);
      jsonAnnotation.put("id", id);
      jsonAnnotation.put("cluster", new JSONObject(reqResponse));
           
     
      JsonImport obj  = new JsonImport(reqResponse, "cluster", workspace, "UTF-8", -1 );
 
      UpdateContainer c = new UpdateContainer();
     
      Worksheet ws = obj.generateWorksheet();
      ws.setJsonAnnotation(jsonAnnotation);
     
      if(worksheet.getJsonAnnotation() != null )
      {
        JSONObject jsonAnnotationCluster = new JSONObject (worksheet.getJsonAnnotation().toString());
View Full Code Here

        ids.add("1");
        try {
            InvocationManager invocatioManager = new InvocationManager(null, ids, urls, encoding);
            String json = invocatioManager.getServiceJson(includeInputAttributes);
      logger.debug(json);
            Import imp = new JsonImport(json, worksheetName, workspace, encoding, -1);

            Worksheet wsht = imp.generateWorksheet();
            c.add(new ImportServiceCommandPreferencesUpdate(serviceUrl, worksheetName));

            c.add(new WorksheetListUpdate());
            c.append(WorksheetUpdateFactory.createWorksheetHierarchicalAndCleaningResultsUpdates(wsht.getId(), SuperSelectionManager.DEFAULT_SELECTION));
            return c;
View Full Code Here

      Workspace workspace, String encoding, int maxNumLines)
      throws IOException {
    Worksheet worksheet;
    String contents = IOUtils.toString(is, encoding);
    JSONObject json = XML.toJSONObject(contents);
    JsonImport imp = new JsonImport(json, sourceName, workspace, encoding, maxNumLines);
    worksheet = imp.generateWorksheet();
    return worksheet;
  }
View Full Code Here

      Workspace workspace, String encoding, int maxNumLines)
      throws IOException {
    Worksheet worksheet;
    Reader reader = EncodingDetector.getInputStreamReader(is, encoding);
    Object json = JSONUtil.createJson(reader);
    JsonImport imp = new JsonImport(json, sourceName, workspace, encoding, maxNumLines);
    worksheet = imp.generateWorksheet();
    return worksheet;
  }
View Full Code Here

            fw.write(buffer, 0, length);
            }
          fw.close();
          buf.close();
         
      Import impJson = new JsonImport(new File(fileName), fName, workspace, "UTF-8", -1, null);
            Worksheet wsht = impJson.generateWorksheet();
//            Worksheet wsht2, wsht3;
            logger.info("Creating worksheet with json : " + wsht.getId());
            uc = new UpdateContainer();
            uc.add(new WorksheetListUpdate());
            uc.append(WorksheetUpdateFactory.createWorksheetHierarchicalAndCleaningResultsUpdates(wsht.getId(), SuperSelectionManager.DEFAULT_SELECTION));
View Full Code Here


  @Override
  protected Import createImport(Workspace workspace) {
    JSONArray tree = generateSelectTree(columnsJson, true);
    return new JsonImport(getFile(), getFile().getName(), workspace, encoding, maxNumLines, tree);
  }
View Full Code Here

    return new JsonImport(getFile(), getFile().getName(), workspace, encoding, maxNumLines, tree);
  }
 
  @Override
  protected Import createImport(Workspace workspace, int sampleSize) {
    return new JsonImport(getFile(), getFile().getName(), workspace, encoding, sampleSize, null);
  }
View Full Code Here

          TablePager pager = vWorksheet.getTopTablePager();
          generateRowsUsingPager(pager, vWorksheet, vWorksheet.getHeaderViewNodes(), fileWriter,"");
          fileWriter.close();

          if(importAsWorksheet) {
            JsonImport jsonImp = new JsonImport(new File(fileLocalPath), newWorksheetName, finalWorkspace, "utf-8", -1, null);
            jsonImp.generateWorksheet();
            newWSId = jsonImp.getWorksheet().getId();
            new WorksheetListUpdate().applyUpdate(vWorkspace);
          }


        } catch(Exception ie) {
View Full Code Here

TOP

Related Classes of edu.isi.karma.imp.json.JsonImport$FileObject

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.