Package edu.isi.karma.controller.history

Examples of edu.isi.karma.controller.history.HistoryJSONEditor


    final Worksheet worksheet = workspace.getWorksheet(worksheetId);
    UpdateContainer c = new UpdateContainer();
   
    try {
      JSONArray historyJson  = extractHistoryFromModel(workspace, c);
      HistoryJSONEditor editor = new HistoryJSONEditor(new JSONArray(historyJson.toString()), workspace, worksheetId);
      if (null == historyJson || historyJson.length() == 0) {
        return new UpdateContainer(new ErrorUpdate("No history found in R2RML Model!"));
      }
      WorksheetCommandHistoryExecutor histExecutor = new WorksheetCommandHistoryExecutor(
          worksheetId, workspace);
      AlignmentManager alignMgr = AlignmentManager.Instance();
      Alignment alignment = alignMgr.getAlignment(workspace.getId(), worksheetId);
      if (override || alignment == null || alignment.GetTreeRoot() == null) {
        String alignmentId = alignMgr.constructAlignmentId(workspace.getId(), worksheetId);
        alignMgr.removeAlignment(alignmentId);
        alignMgr.getAlignmentOrCreateIt(workspace.getId(), worksheetId, workspace.getOntologyManager());
        editor.deleteExistingTransformationCommands();
        historyJson = editor.getHistoryJSON();
      }
      else {
        editor.deleteExistingTransformationAndModelingCommands();
        historyJson = editor.getHistoryJSON();
      }
      System.out.println(editor.getHistoryJSON().toString(4));
      UpdateContainer hc = histExecutor.executeAllCommands(historyJson);
      if(hc != null) {
        hc.removeUpdateByClass(HistoryAddCommandUpdate.class);
        hc.removeUpdateByClass(InfoUpdate.class);
        hc.removeUpdateByClass(ErrorUpdate.class);
View Full Code Here

TOP

Related Classes of edu.isi.karma.controller.history.HistoryJSONEditor

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.