LDIF is an open source project powered by Assembla

Assembla offers free public and private SVN/Git repositories and project hosting with bug/issue tracking and collaboration tools.

Commit 436d3421e4242ab391ef48b4c453bcaed62e7490

User picture

Updated workbench back-end

Files Affected

 
867572666f0df0188612bd5199186553bd670e30436d3421e4242ab391ef48b4c453bcaed62e7490
44
 
44
 
45
  //TODO implement outputConfig.toXML
45
  //TODO implement outputConfig.toXML
46
  def toXML : xml.Node = {
46
  def toXML : xml.Node = {
47
    <intergrationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
47
    <integrationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
48
                     xsi:schemaLocation="http://www4.wiwiss.fu-berlin.de/ldif/ ../../xsd/IntegrationJob.xsd"
48
                     xsi:schemaLocation="http://www4.wiwiss.fu-berlin.de/ldif/ ../../xsd/IntegrationJob.xsd"
49
                     xmlns="http://www4.wiwiss.fu-berlin.de/ldif/">
49
                     xmlns="http://www4.wiwiss.fu-berlin.de/ldif/">
50
      {if (isAnySourceDefined){
50
      {if (isAnySourceDefined){
...
 
...
 
57
      {if (isSieveSpecDefined) <sieve>{sieveSpecDir}</sieve>}
57
      {if (isSieveSpecDefined) <sieve>{sieveSpecDir}</sieve>}
58
      {if (isAnyOutputDefined){
58
      {if (isAnyOutputDefined){
59
      <outputs>
59
      <outputs>
60
        {for (output <- outputs.outputs) yield { <output>{output.toString()}</output> } }
60
        {for (output <- outputs.outputs) yield { <output><file>todo</file></output> } }
61
      </outputs>}
61
      </outputs>}
62
      }
62
      }
63
      {if (isAnyPropertyDefined) <properties>{properties.getProperty("propertiesFile")}</properties>}
63
      {if (isAnyPropertyDefined) <properties>{properties.getProperty("propertiesFile")}</properties>}
64
      <runSchedule>{runSchedule}</runSchedule>
64
      <runSchedule>{runSchedule}</runSchedule>
65
    </intergrationJob>}
65
    </integrationJob>}
66
}
66
}
67
 
67
 
68
object IntegrationConfig {
68
object IntegrationConfig {
...
 
...
 
77
 
77
 
78
  def load = new ValidatingXMLReader(fromFile, schemaLocation)
78
  def load = new ValidatingXMLReader(fromFile, schemaLocation)
79
 
79
 
80
  def fromFile(configFile : File)  : IntegrationConfig = {
80
  def fromFile(file : File)  : IntegrationConfig =
81
    baseDir = configFile.getParent
81
    fromXML(XML.loadFile(file), file.getParent)
82
    xml = XML.loadFile(configFile)
82
 
 
 
83
  def fromString(xmlString : String, dir : String) =
 
 
84
    fromXML(XML.loadString(xmlString), dir)
 
 
85
 
 
 
86
  def fromXML(node : Node, dir : String) : IntegrationConfig = {
 
 
87
    xml = node
 
 
88
    baseDir = dir
83
 
89
 
84
    // Read in properties
90
    // Read in properties
85
    val propertiesFile = getFile("properties", baseDir)
91
    val propertiesFile = getFile("properties", baseDir)
867572666f0df0188612bd5199186553bd670e30436d3421e4242ab391ef48b4c453bcaed62e7490
26
import ldif.util.Identifier
26
import ldif.util.Identifier
27
import ldif.local.scheduler.{DataSource, ImportJob}
27
import ldif.local.scheduler.{DataSource, ImportJob}
28
import ldif.workbench.model.modules.dataSource.DataSourceTask
28
import ldif.workbench.model.modules.dataSource.DataSourceTask
 
 
29
import ldif.local.IntegrationJob
 
 
30
import ldif.config.IntegrationConfig
 
 
31
import ldif.workbench.model.modules.integration.IntegrationTask
29
 
32
 
30
class FileWorkspace(file: File) extends Workspace {
33
class FileWorkspace(file: File) extends Workspace {
31
  private val log = LoggerFactory.getLogger(getClass.getName)
34
  private val log = LoggerFactory.getLogger(getClass.getName)
...
 
...
 
65
    User().project.importModule.update(ImportTask(job))
68
    User().project.importModule.update(ImportTask(job))
66
  }
69
  }
67
 
70
 
 
 
71
  override def saveIntegrationJob(name: Identifier, xml: String, properties: String) {
 
 
72
    val integrationBaseDir = (file +("/"+ User().project.name +"/integration")).getCanonicalPath
 
 
73
    val config = IntegrationConfig.fromString(xml, integrationBaseDir)
 
 
74
    User().project.integrationModule.update(IntegrationTask(IntegrationJob(config)))
 
 
75
  }
 
 
76
 
68
  override def importImportJob(file: File) {
77
  override def importImportJob(file: File) {
69
    println(file.getCanonicalPath)
78
    println(file.getCanonicalPath)
70
    log.info(file.getCanonicalPath)
79
    log.info(file.getCanonicalPath)
867572666f0df0188612bd5199186553bd670e30436d3421e4242ab391ef48b4c453bcaed62e7490
24
 
24
 
25
 
25
 
26
case class IntegrationTask(job: IntegrationJob) extends ModuleTask {
26
case class IntegrationTask(job: IntegrationJob) extends ModuleTask {
27
  val name = Identifier("integrationJob_"+ System.currentTimeMillis())  //TODO add integration jobs identifier
27
  val name = Identifier("integrationJob")  //TODO add integration jobs identifier
28
}
28
}
867572666f0df0188612bd5199186553bd670e30436d3421e4242ab391ef48b4c453bcaed62e7490
44
 
44
 
45
  def saveImportJob(name: Identifier, xml : String)
45
  def saveImportJob(name: Identifier, xml : String)
46
 
46
 
 
 
47
  def saveIntegrationJob(name: Identifier, xml : String, properties : String)
 
 
48
 
47
  def importImportJob(file : File)
49
  def importImportJob(file : File)
48
}
50
}
867572666f0df0188612bd5199186553bd670e30436d3421e4242ab391ef48b4c453bcaed62e7490
59
//      importProjectFunction &
59
//      importProjectFunction &
60
//      exportProjectFunction &
60
//      exportProjectFunction &
61
      injectFunction("setCurrentProject", setCurrentProject _, 1) &
61
      injectFunction("setCurrentProject", setCurrentProject _, 1) &
62
      injectFunction("removeProject", removeProject _ , 1) &
62
      injectFunction("removeProject", removeProject _ , 0) &
 
 
63
      injectFunction("removeIntegrationJob", removeIntegrationJob _ , 0) &
63
      injectFunction("removeDataSource", removeDataSource _ , 1) &
64
      injectFunction("removeDataSource", removeDataSource _ , 1) &
64
      injectFunction("removeImportJob", removeImportJob _ , 1) &
65
      injectFunction("removeImportJob", removeImportJob _ , 1) &
65
      injectFunction("saveDataSource", saveDataSource _ , 2) &
66
      injectFunction("saveDataSource", saveDataSource _ , 2) &
66
      saveImportJobFunction &
67
      injectFunction("saveImportJob", saveImportJob _ , 2) &
67
      runSchedulerFunction &
68
      injectFunction("saveIntegrationJob", saveIntegrationJob _ , 2) &
68
      runIntegrationFunction
69
      injectFunction("runScheduler", runScheduler _ , 0) &
 
 
70
      injectFunction("runIntegration", runIntegration _ , 0)
69
  }
71
  }
70
 
72
 
71
  //TODO Fix - ajax calls are executed more times
73
  //TODO Fix - ajax calls are executed more times
...
 
...
 
77
    //Callback which executes the provided function
79
    //Callback which executes the provided function
78
    def callback(args: String): JsCmd = {
80
    def callback(args: String): JsCmd = {
79
      try {
81
      try {
80
        val params = args.split(',')
82
        val params =
 
 
83
          if (numberOfParams>0)
 
 
84
            args.split(',')
 
 
85
          else Array.empty[String]
81
        // check number of parameters
86
        // check number of parameters
82
        if (params.length != numberOfParams)
87
        if (params.length != numberOfParams)
83
          throw new Exception("Wrong number of parameters for function "+name+
88
          throw new Exception("Wrong number of parameters for function "+name+
...
 
...
 
103
  }
108
  }
104
 
109
 
105
  // JS Command which defines the setCurrentProject function
110
  // JS Command which defines the setCurrentProject function
106
  private def setCurrentProject(params : Array[String]) : JsCmd = {
111
  private def setCurrentProject(args : Array[String]) : JsCmd = {
107
    User().project = User().workspace.project(params(0))
112
    User().project = User().workspace.project(args(0))
108
    JSUtils.Empty
113
    JSUtils.Empty
109
  }
114
  }
110
 
115
 
111
  // JS Command which defines the removeDataSource function
116
  // JS Command which defines the removeDataSource function
112
  private def removeDataSource(params : Array[String]) : JsCmd = {
117
  private def removeDataSource(args : Array[String]) : JsCmd = {
113
    User().project.dataSourceModule.remove(params(0))
118
    User().project.dataSourceModule.remove(args(0))
114
    updateCmd
119
    updateCmd
115
  }
120
  }
116
 
121
 
117
  // JS Command which defines the removeImportJob function
122
  // JS Command which defines the removeImportJob function
118
  private def removeImportJob(params : Array[String]) : JsCmd = {
123
  private def removeImportJob(args : Array[String]) : JsCmd = {
119
    User().project.importModule.remove(params(0))
124
    User().project.importModule.remove(args(0))
120
    updateCmd
125
    updateCmd
121
  }
126
  }
122
 
127
 
123
  // JS Command which defines the removeProject function
128
  // JS Command which defines the removeProject function
124
  private def removeProject(params : Array[String]) : JsCmd = {
129
  private def removeProject(args : Array[String]) : JsCmd = {
125
    User().workspace.removeProject(params(0))
130
    User().workspace.removeProject(User().project.name)
126
    User().resetCurrentProject()
131
    User().resetCurrentProject()
127
    updateCmd
132
    updateCmd
128
  }
133
  }
129
 
134
 
 
 
135
  // JS Command which defines the removeIntegrationJob function
 
 
136
  private def removeIntegrationJob(args : Array[String]) : JsCmd = {
 
 
137
    User().project.integrationModule.remove("integrationJob")
 
 
138
    updateCmd
 
 
139
  }
 
 
140
 
130
  // JS Command which defines the saveDataSource function
141
  // JS Command which defines the saveDataSource function
131
  private def saveDataSource(params : Array[String]) : JsCmd = {
142
  private def saveDataSource(args : Array[String]) : JsCmd = {
132
    User().workspace.saveDataSource(params(0), params(1))
143
    User().workspace.saveDataSource(args(0), args(1))
133
    updateCmd &
144
    updateCmd
134
      JSUtils.Log("Updated dataSource: " + params(0))
 
 
135
  }
145
  }
136
 
146
 
137
  private def saveImportJobFunction : JsCmd = {
147
  // JS Command which defines the saveImportJob function
138
    def callback(args: String): JsCmd = {
148
  private def saveImportJob(args : Array[String]) : JsCmd = {
139
      try {
149
    User().workspace.saveImportJob(args(0), args(1))
140
        val Array(taskName, xml) = args.split(',')
150
    updateCmd
141
        User().workspace.saveImportJob(taskName, xml)
 
 
142
        updateCmd &
 
 
143
          JSUtils.Log("Updated importJob: " + taskName)
 
 
144
      } catch {
 
 
145
        case ex: Exception => Workspace.hideLoadingDialogCmd &
 
 
146
          JSUtils.Message(ex.getMessage.encJs)
 
 
147
      }
 
 
148
    }
 
 
149
    val ajaxCall = SHtml.ajaxCall(JsRaw("taskName + ',' + xml"), callback _)._2.cmd
 
 
150
    JsCmds.Function("saveImportJob", "taskName" :: "xml" :: Nil, ajaxCall)
 
 
151
  }
151
  }
152
 
152
 
153
  private def runIntegrationFunction : JsCmd = {
153
  // JS Command which defines the saveIntegrationJob function
154
    def callback(args: String): JsCmd = {
154
  private def saveIntegrationJob(args : Array[String]) : JsCmd = {
 
 
155
    User().workspace.saveIntegrationJob("integrationJob", args(0), args(1))
 
 
156
    updateCmd
 
 
157
  }
 
 
158
 
 
 
159
  // JS Command which defines the runIntegration function
 
 
160
  private def runIntegration(args : Array[String]) : JsCmd = {
155
      if (!runningIntegration) {
161
      if (!runningIntegration) {
156
        runningIntegration =true
162
        runningIntegration =true
157
        try {
163
        try {
...
 
...
 
167
        }
173
        }
168
      }
174
      }
169
      else JSUtils.Log("An other IntegrationJob is already running, please wait.")
175
      else JSUtils.Log("An other IntegrationJob is already running, please wait.")
170
    }
 
 
171
    val ajaxCall = SHtml.ajaxCall(JsRaw(""), callback _)._2.cmd
 
 
172
    JsCmds.Function("runIntegration", Nil, ajaxCall)
 
 
173
  }
176
  }
174
 
177
 
175
  private def runSchedulerFunction : JsCmd = {
178
  // JS Command which defines the runScheduler function
176
    def callback(args: String): JsCmd = {
179
  private def runScheduler(args : Array[String])  : JsCmd = {
177
      if (!runningScheduler)  {
180
      if (!runningScheduler)  {
178
        runningScheduler =true
181
        runningScheduler =true
179
        try {
182
        try {
180
          //MonitorServer.start(Consts.DefaultStatusMonitorrURI)
183
          //MonitorServer.start(Consts.DefaultStatusMonitorrURI)
181
          Scheduler(User().project.config).run()
184
          Scheduler(User().project.config).run()
182
          runningScheduler = false
185
          runningScheduler = false
183
          JSUtils.Empty
186
          JSUtils.Message("Scheduler execution completed")
184
        } catch {
187
        } catch {
185
          case ex: Exception => {
188
          case ex: Exception => {
186
            runningScheduler = false
189
            runningScheduler = false
...
 
...
 
189
        }
192
        }
190
      }
193
      }
191
      else JSUtils.Log("An other Scheduler is already running, please wait.")
194
      else JSUtils.Log("An other Scheduler is already running, please wait.")
192
    }
 
 
193
    val ajaxCall = SHtml.ajaxCall(JsRaw(""), callback _)._2.cmd
 
 
194
    JsCmds.Function("runIntegration", Nil, ajaxCall)
 
 
195
  }
195
  }
196
 
196
 
197
  /**
197
  /**
...
 
...
 
207
  /**
207
  /**
208
   * JS Command which defines the createProject function
208
   * JS Command which defines the createProject function
209
   */
209
   */
210
  private def createProject (params : Array[String]): JsCmd = {
210
  private def createProject (args : Array[String]): JsCmd = {
211
      User().workspace.createProject(params(0))
211
      User().workspace.createProject(args(0))
212
      updateCmd
212
      updateCmd
213
  }
213
  }
214
 
214
 
867572666f0df0188612bd5199186553bd670e30436d3421e4242ab391ef48b4c453bcaed62e7490
239
                <input type="text" name="mappings" class="text ui-widget-content ui-corner-all"/>
239
                <input type="text" name="mappings" class="text ui-widget-content ui-corner-all"/>
240
                <span class="help"></span><div style="clear: both;"></div>
240
                <span class="help"></span><div style="clear: both;"></div>
241
 
241
 
 
 
242
                <div class="input-label" style="width: 135px;">Sieve</div>
 
 
243
                <input type="text" name="sieve" class="text ui-widget-content ui-corner-all"/>
 
 
244
                <span class="help"></span><div style="clear: both;"></div>
 
 
245
 
242
                <!--
246
                <!--
243
                    <div class="input-label" style="width: 135px;">Properties</div>
247
                    <div class="input-label" style="width: 135px;">Properties</div>
244
                    <input type="text" name="properties" class="text ui-widget-content ui-corner-all"/>
248
                    <input type="text" name="properties" class="text ui-widget-content ui-corner-all"/>
867572666f0df0188612bd5199186553bd670e30436d3421e4242ab391ef48b4c453bcaed62e7490
400
 
400
 
401
                        var linkSpecifications = $("#integration-job-form-tabs-1 > form > input[name='linkSpecifications']").val();
401
                        var linkSpecifications = $("#integration-job-form-tabs-1 > form > input[name='linkSpecifications']").val();
402
                        var mappings = $("#integration-job-form-tabs-1 > form > input[name='mappings']").val();
402
                        var mappings = $("#integration-job-form-tabs-1 > form > input[name='mappings']").val();
 
 
403
                        var sieve = $("#integration-job-form-tabs-1 > form > input[name='sieve']").val();
403
                        var output = $("#integration-job-form-tabs-1 > form > input[name='output']").val();
404
                        var output = $("#integration-job-form-tabs-1 > form > input[name='output']").val();
404
                        var runSchedule = $("#integration-job-form-tabs-1 > form > select[name='runSchedule']").val();
405
                        var runSchedule = $("#integration-job-form-tabs-1 > form > select[name='runSchedule']").val();
405
 
406
 
...
 
...
 
410
                                errors.push('No file chosen.<br/>'); fields.push('file');
411
                                errors.push('No file chosen.<br/>'); fields.push('file');
411
                            }
412
                            }
412
                        } else {
413
                        } else {
413
                            if (!output) {
414
                            //TODO update mandatory fields
 
 
415
                           /* if (!output) {
414
                                errors.push('Output value is empty.<br/>'); fields.push('output');
416
                                errors.push('Output value is empty.<br/>'); fields.push('output');
415
                            }
417
                            }
416
                            if (!linkSpecifications) {
418
                            if (!linkSpecifications) {
...
 
...
 
418
                            }
420
                            }
419
                            if (!mappings) {
421
                            if (!mappings) {
420
                                errors.push('Mappings value is empty.<br/>'); fields.push('mappings');
422
                                errors.push('Mappings value is empty.<br/>'); fields.push('mappings');
421
                            }
423
                            }  */
422
                        }
424
                        }
423
 
425
 
424
                        if (errors.length > 0) {
426
                        if (errors.length > 0) {
...
 
...
 
445
                            xml.append($('<sources>'+sources+'</sources>'));
447
                            xml.append($('<sources>'+sources+'</sources>'));
446
                             */
448
                             */
447
 
449
 
448
                            xml.append($('<linkSpecifications>'+linkSpecifications+'</linkSpecifications>'));
450
                            // TODO implement this properly
449
                            xml.append($('<mappings>'+mappings+'</mappings>'));
451
                            if(linkSpecifications != '')
450
                            xml.append($('<output>'+output+'</output>'));
452
                                xml.append($('<linkSpecifications>'+linkSpecifications+'</linkSpecifications>'));
 
 
453
                            else xml.append($('<linkSpecifications>linkspecs</linkSpecifications>'));
 
 
454
                            if(mappings != '')
 
 
455
                                xml.append($('<mappings>'+mappings+'</mappings>'));
 
 
456
                            else xml.append($('<mappings>mappings</mappings>'));
 
 
457
                            if(sieve != '')
 
 
458
                                xml.append($('<sieve>'+sieve+'</sieve>'));
 
 
459
                            else xml.append($('<sieve>sieve</sieve>'));
 
 
460
                            xml.append($('<source>dumps</source>'));
 
 
461
                            xml.append($('<output><file>output/integrated.nq</file></output>'));
 
 
462
 
 
 
463
 
451
                            if (runSchedule != '')
464
                            if (runSchedule != '')
452
                                xml.append($('<runSchedule>'+runSchedule+'</runSchedule>'));
465
                                xml.append($('<runSchedule>'+runSchedule+'</runSchedule>'));
453
 
466
 
454
                            if (selectedTab == 1) {
467
                            if (selectedTab == 1) {
455
                                importIntegrationJob(projectName, file);
468
                                importIntegrationJob(projectName, file);
456
                            } else {
469
                            } else {
457
                                saveIntegrationJob(xml, projectName, propertiesString);
470
                                var xmlString = '<integrationJob>'+$(xml).html()+'</integrationJob>'
 
 
471
                                saveIntegrationJob(xmlString, propertiesString);
458
                            }
472
                            }
 
 
473
                            $(this).dialog("close");
 
 
474
                            loadingShow;
459
                        }
475
                        }
460
                    },
476
                    },
461
                    Cancel: function() {
477
                    Cancel: function() {
...
 
...
 
506
 
522
 
507
                            saveScheduler(xml, projectName, propertiesString);
523
                            saveScheduler(xml, projectName, propertiesString);
508
                        }
524
                        }
 
 
525
                        $(this).dialog("close");
 
 
526
                        loadingShow;
509
                    },
527
                    },
510
                    Cancel: function() {
528
                    Cancel: function() {
511
                        $(this).dialog("close");
529
                        $(this).dialog("close");
...
 
...
 
669
    $(ds_actions).addClass('actions');
687
    $(ds_actions).addClass('actions');
670
    $(ds_span).append(ds_actions);
688
    $(ds_span).append(ds_actions);
671
    addAction('ds_edit', 'Edit', "Edit integration job", "editIntegrationJob('" + projectName + "',"
+ p + ")", ds_actions, projectName, true);
689
    addAction('ds_edit', 'Edit', "Edit integration job", "editIntegrationJob('" + projectName + "',"
+ p + ")", ds_actions, projectName, true);
672
    addAction('delete', 'Remove', "Remove integration job ", "confirmDelete('removeIntegrationJob','" + projectName + "')", ds_actions, projectName, true);
690
    addAction('delete', 'Remove', "Remove integration job ", "confirmDelete('removeIntegrationJob','IntegrationJob')", ds_actions, projectName, true);
673
    addAction('run', 'Run', "Run integration job", "runIntegration('')", ds_actions, projectName, true);
691
    addAction('run', 'Run', "Run integration job", "runIntegration('')", ds_actions, projectName, true);
674
 
692
 
675
    addLeaf(jsonIntegrationJob.runSchedule, ds_li, 'Run schedule: ', 'refresh-schedule-icon');
693
    addLeaf(jsonIntegrationJob.runSchedule, ds_li, 'Run schedule: ', 'refresh-schedule-icon');
...
 
...
 
847
            addAction('integration_job', 'Integration Job', 'Add integration job', "createIntegrationJob('" +
project.name + "'," + p + ")", proj_actions, project.name, !integrationJobExists(p));
865
            addAction('integration_job', 'Integration Job', 'Add integration job', "createIntegrationJob('" +
project.name + "'," + p + ")", proj_actions, project.name, !integrationJobExists(p));
848
            //### addAction('schedule_job', 'Scheduler', 'Configure scheduler', "editScheduler('" + project.name +
"'," + p + ")", proj_actions, project.name, true);
866
            //### addAction('schedule_job', 'Scheduler', 'Configure scheduler', "editScheduler('" + project.name +
"'," + p + ")", proj_actions, project.name, true);
849
            addAction('export', 'Export','Export scheduler:
'+project.name,"exportProject('"+project.name+"')",proj_actions, project.name, true);
867
            addAction('export', 'Export','Export scheduler:
'+project.name,"exportProject('"+project.name+"')",proj_actions, project.name, true);
850
            addAction('delete', 'Remove', 'Remove scheduler: '+project.name, "confirmDelete('removeProject','"+project.name+"','')", proj_actions, '', true);
868
            addAction('delete', 'Remove', 'Remove scheduler: '+project.name, "confirmDelete('removeProject','"+project.name+"')", proj_actions, project.name, true);
851
             addAction('run', 'Run', "Run scheduler: "+project.name, "runScheduler('')", proj_actions, project.name, true); //##
869
             addAction('run', 'Run', "Run scheduler: "+project.name, "runScheduler('')", proj_actions, project.name, integrationJobExists(p));
852
 
870
 
853
            // display dataSource
871
            // display dataSource
854
            var dataSources = obj.workspace.project[p].scheduler.dataSources
872
            var dataSources = obj.workspace.project[p].scheduler.dataSources
...
 
...
 
895
                console.log("Evaluate "+action);
913
                console.log("Evaluate "+action);
896
                //saveOpenNodes(activeProject);
914
                //saveOpenNodes(activeProject);
897
                if (activeProject!=""){
915
                if (activeProject!=""){
898
                    console.log('Set current project: '+activeProject);
 
 
899
                    setCurrentProject(activeProject);}
916
                    setCurrentProject(activeProject);}
900
                $.globalEval(action);
917
                $.globalEval(action);
901
            })
918
            })
...
 
...
 
956
    // work-around : passing the action as string parameter -> the action would be invoked anyway
973
    // work-around : passing the action as string parameter -> the action would be invoked anyway
957
    switch (action)
974
    switch (action)
958
        {
975
        {
959
        case 'removeProject' :  removeProject(res);  break;
976
        case 'removeProject' :  removeProject();  break;
960
        case 'removeDataSource' :  removeDataSource(res);  break;
977
        case 'removeDataSource' :  removeDataSource(res);  break;
961
        case 'removeImportJob' :  removeImportJob(res);  break;
978
        case 'removeImportJob' :  removeImportJob(res);  break;
 
 
979
        case 'removeIntegrationJob' : removeIntegrationJob(); break;
962
        default : alert("Error: Action \'"+action+"\' not defined!");
980
        default : alert("Error: Action \'"+action+"\' not defined!");
963
        }
981
        }
964
}
982
}
...
 
...
 
1214
}
1232
}
1215
 
1233
 
1216
// init and display the proper delete confirm dialog
1234
// init and display the proper delete confirm dialog
1217
function confirmDelete(action,proj,res){
1235
function confirmDelete(action,res){
1218
    if (res === undefined)
1236
    $("#remove-form > span.resource").html(res);
1219
        res = ' Integration job';
 
 
1220
    $("#remove-form > span.ressource").html(proj+" "+res);
 
 
1221
    $("#remove-form").dialog({
1237
    $("#remove-form").dialog({
1222
                title: 'Remove',
1238
                title: 'Remove',
1223
                height: 180,
1239
                height: 180,
...
 
...
 
1227
                buttons: {
1243
                buttons: {
1228
                    "Yes, delete it": function() {
1244
                    "Yes, delete it": function() {
1229
                        $(this).dialog("close");
1245
                        $(this).dialog("close");
1230
                        callAction(action,proj,res);
1246
                        callAction(action,res);
1231
                    },
1247
                    },
1232
                    Cancel: function() {
1248
                    Cancel: function() {
1233
                        $(this).dialog("close");
1249
                        $(this).dialog("close");