Package edu.isi.karma.imp

Examples of edu.isi.karma.imp.Import


        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


 
  private Worksheet generateWorksheetFromDelimitedStream(String sourceName, InputStream is,
      Workspace workspace, String encoding, int maxNumLines) throws IOException,
      KarmaException, ClassNotFoundException {
    Worksheet worksheet;
    Import fileImport = new CSVImport(1, 2, ',', '\"', encoding, maxNumLines,
        sourceName, is, workspace, null);

    worksheet = fileImport.generateWorksheet();
    return worksheet;
  }
View Full Code Here

            fw.write(buffer, 0, length);
            }
          fw.close();
          buf.close();
          logger.info("Created : " + fileName + " by worksheet Id : " this.worksheetId) ;
          Import impCSV = new CSVFileImport(1, 2, ',', ' ', "UTF-8", -1, new File(fileName), workspace, null);
          Worksheet wsht = impCSV.generateWorksheet();
          uc = new UpdateContainer();
            uc.append(WorksheetUpdateFactory.createWorksheetHierarchicalAndCleaningResultsUpdates(wsht.getId(), SuperSelectionManager.DEFAULT_SELECTION));
            new File(fileName).delete();

        } catch (Exception e1) {
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

        if (!csvFiles.isEmpty()) {
            for (File csvFile : csvFiles) {


                try {
                    Import imp = new CSVFileImport(1, 2, ',', '"', encoding, maxNumLines,
                        csvFile, workspace, null);
                    Worksheet wsht = imp.generateWorksheet();

                    if (hasRevisionId()) {
                        Worksheet revisedWorksheet = workspace.getWorksheet(getRevisionId());
                        wsht.setRevisedWorksheet(revisedWorksheet);
                    }
View Full Code Here

    @Override
    public UpdateContainer doIt(Workspace workspace) throws CommandException {
        UpdateContainer c = new UpdateContainer();

        try {
          Import imp = createImport(workspace);
            Worksheet wsht = imp.generateWorksheet();
            if (hasRevisionId()) {
                Worksheet revisedWorksheet = workspace.getWorksheet(getRevisionId());
                wsht.setRevisedWorksheet(revisedWorksheet)
            }
            c.add(new WorksheetListUpdate());
View Full Code Here

    boolean filter = Boolean.parseBoolean(request.getParameter("filter"));
    UpdateContainer uc = new UpdateContainer(new ImportPropertiesUpdate(getFile(), encoding, maxNumLines, id));
    if (!filter)
      return uc;
    final Workspace workspace = WorkspaceManager.getInstance().createWorkspace();
    Import imp = createImport(workspace, 1000);
    try {
      final Worksheet worksheet = imp.generateWorksheet();           
      uc.add(new AbstractUpdate() {       
        @Override
        public void generateJson(String prefix, PrintWriter pw,
            VWorkspace vWorkspace) {
          JSONObject response = new JSONObject();
View Full Code Here

 
  @Override
  public UpdateContainer doIt(Workspace workspace) throws CommandException {
    UpdateContainer uc = new UpdateContainer();
    try {
      Import imp = createImport(workspace);
      final Worksheet wsht = imp.generateWorksheet();
      if (hasRevisionId()) {
        Worksheet revisedWorksheet = workspace.getWorksheet(getRevisionId());
        wsht.setRevisedWorksheet(revisedWorksheet)
      }
      uc.add(new WorksheetListUpdate());
View Full Code Here

TOP

Related Classes of edu.isi.karma.imp.Import

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.