Package edu.isi.karma.controller.update

Examples of edu.isi.karma.controller.update.WorksheetListUpdate


    for(int i=0; i<updates.length(); i++) {
      String update = updates.getString(i);
      switch(update) {
        case "headers": uc.add(new WorksheetHeadersUpdate(worksheetId, sel));
                break;
        case "list": uc.add(new WorksheetListUpdate());
                break;
        case "data": uc.add(new WorksheetDataUpdate(worksheetId, sel));
                break;
        case "alignment":
        {
View Full Code Here


      glueNestedTable(oldws, workspace, ht, hnodes, factory);
    else
      glueTopLevel(oldws, workspace, hnodes, factory);
    try{
      UpdateContainer c =  new UpdateContainer();
      c.add(new WorksheetListUpdate());
      c.append(WorksheetUpdateFactory.createRegenerateWorksheetUpdates(oldws.getId(), getSuperSelection(oldws)));
      c.append(computeAlignmentAndSemanticTypesAndCreateUpdates(workspace));
      WorksheetUpdateFactory.detectSelectionStatusChange(worksheetId, workspace, this);
      return c;
    } catch (Exception e) {
View Full Code Here

          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) {
          logger.error("Error writing JSON to file: " + fileLocalPath);
          errorOnUpdate = "Error exporting to JSON";
        }
      }

      @Override
      public void generateJson(String prefix, PrintWriter pw,
          VWorkspace vWorkspace) {
        if(errorOnUpdate != null) {
          new ErrorUpdate(errorOnUpdate).generateJson(prefix, pw, vWorkspace);
        } else {
          JSONObject outputObject = new JSONObject();
          outputObject.put(JsonKeys.updateType.name(), "PublishJSONUpdate");
          outputObject.put(JsonKeys.fileUrl.name(), relFilename);
          outputObject.put(JsonKeys.worksheetId.name(), worksheetId);
          pw.println(outputObject.toString(4));
          pw.println(",");
          new InfoUpdate("Succesfully exported to JSON").generateJson(prefix, pw, vWorkspace);
          boolean showCleaningCharts = UIConfiguration.Instance().isD3ChartsEnabled();
          if(importAsWorksheet && newWSId != null) {
            pw.println(",");
            new WorksheetListUpdate().generateJson(prefix, pw, vWorkspace);
            pw.println(",");
            if (showCleaningCharts) {
              new WorksheetCleaningUpdate(newWSId, true, SuperSelectionManager.DEFAULT_SELECTION).generateJson(prefix, pw, vWorkspace);
              pw.println(",");
            }
View Full Code Here

          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) {
          logger.error("Error writing JSON to file: " + fileLocalPath);
View Full Code Here

          pw.println(",");
          new InfoUpdate("Succesfully exported to JSON").generateJson(prefix, pw, vWorkspace);
          boolean showCleaningCharts = UIConfiguration.Instance().isD3ChartsEnabled();
          if(importAsWorksheet && newWSId != null) {
            pw.println(",");
            new WorksheetListUpdate().generateJson(prefix, pw, vWorkspace);
            pw.println(",");
            if (showCleaningCharts) {
              new WorksheetCleaningUpdate(newWSId, true, SuperSelectionManager.DEFAULT_SELECTION).generateJson(prefix, pw, vWorkspace);
              pw.println(",");
            }
View Full Code Here

            Worksheet wsht = imp.generateWorksheet();
            if (hasRevisionId()) {
                Worksheet revisedWorksheet = workspace.getWorksheet(getRevisionId());
                wsht.setRevisedWorksheet(revisedWorksheet)
            }
            c.add(new WorksheetListUpdate());
            c.append(WorksheetUpdateFactory.createWorksheetHierarchicalAndCleaningResultsUpdates(wsht.getId(), SuperSelectionManager.DEFAULT_SELECTION));
        } catch (JSONException | IOException | KarmaException | NullPointerException | ClassNotFoundException e) {
            logger.error("Error occured while generating worksheet from " + getTitle() + "!", e);
            return new UpdateContainer(new ErrorUpdate(
                    "Error occured during import: " + e.getMessage()));
View Full Code Here

      final Worksheet wsht = imp.generateWorksheet();
      if (hasRevisionId()) {
        Worksheet revisedWorksheet = workspace.getWorksheet(getRevisionId());
        wsht.setRevisedWorksheet(revisedWorksheet)
      }
      uc.add(new WorksheetListUpdate());
      uc.append(WorksheetUpdateFactory.createWorksheetHierarchicalAndCleaningResultsUpdates(wsht.getId(), SuperSelectionManager.DEFAULT_SELECTION));
      if (savePreset) {
        uc.append(savePreset(workspace, wsht));
      }
    } catch (JSONException | IOException | KarmaException | NullPointerException | ClassNotFoundException e) {
View Full Code Here

TOP

Related Classes of edu.isi.karma.controller.update.WorksheetListUpdate

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.