浏览代码

[oozie] Support submitting old format directly from the editor list

Romain Rigaux 10 年之前
父节点
当前提交
09f3765

+ 8 - 2
apps/oozie/src/oozie/templates/editor2/list_editor_bundles.mako

@@ -85,7 +85,7 @@ ${ layout.menubar(section='bundles', is_editor=True) }
           <!-- /ko -->
           <!-- /ko -->
           <!-- ko if: uuid() -->
           <!-- ko if: uuid() -->
             <a data-bind="attr: { 'href': '${ url('oozie:edit_bundle') }?bundle=' + id() }" data-row-selector="true"></a>
             <a data-bind="attr: { 'href': '${ url('oozie:edit_bundle') }?bundle=' + id() }" data-row-selector="true"></a>
-          <!-- /ko -->                     
+          <!-- /ko -->
         </td>
         </td>
         <td data-bind="text: name"></td>
         <td data-bind="text: name"></td>
         <td data-bind="text: description"></td>
         <td data-bind="text: description"></td>
@@ -169,7 +169,13 @@ ${ commonshare() | n,unicode }
     self.datatable = null;
     self.datatable = null;
 
 
     self.showSubmitPopup = function () {
     self.showSubmitPopup = function () {
-      $.get("/oozie/editor/bundle/submit/" + self.selectedJobs()[0].id(), {
+      if (self.selectedJobs()[0].uuid()) {
+        var base_url = "/oozie/editor/bundle/submit/";
+      } else {
+        var base_url = "/oozie/submit_bundle/";
+      }
+
+      $.get(base_url + self.selectedJobs()[0].id(), {
       }, function (data) {
       }, function (data) {
         $(document).trigger("showSubmitPopup", data);
         $(document).trigger("showSubmitPopup", data);
       }).fail(function (xhr, textStatus, errorThrown) {
       }).fail(function (xhr, textStatus, errorThrown) {

+ 8 - 2
apps/oozie/src/oozie/templates/editor2/list_editor_coordinators.mako

@@ -85,7 +85,7 @@ ${ layout.menubar(section='coordinators', is_editor=True) }
           <!-- /ko -->
           <!-- /ko -->
           <!-- ko if: uuid() -->
           <!-- ko if: uuid() -->
             <a data-bind="attr: { 'href': '${ url('oozie:edit_coordinator') }?coordinator=' + id() }" data-row-selector="true"></a>
             <a data-bind="attr: { 'href': '${ url('oozie:edit_coordinator') }?coordinator=' + id() }" data-row-selector="true"></a>
-          <!-- /ko -->                    
+          <!-- /ko -->
         </td>
         </td>
         <td data-bind="text: name"></td>
         <td data-bind="text: name"></td>
         <td data-bind="text: description"></td>
         <td data-bind="text: description"></td>
@@ -169,7 +169,13 @@ ${ commonshare() | n,unicode }
     self.datatable = null;
     self.datatable = null;
 
 
     self.showSubmitPopup = function () {
     self.showSubmitPopup = function () {
-      $.get("/oozie/editor/coordinator/submit/" + self.selectedJobs()[0].id(), {
+      if (self.selectedJobs()[0].uuid()) {
+        var base_url = "/oozie/editor/coordinator/submit/";
+      } else {
+        var base_url = "/oozie/submit_coordinator/";
+      }
+
+      $.get(base_url + self.selectedJobs()[0].id(), {
       }, function (data) {
       }, function (data) {
         $(document).trigger("showSubmitPopup", data);
         $(document).trigger("showSubmitPopup", data);
       }).fail(function (xhr, textStatus, errorThrown) {
       }).fail(function (xhr, textStatus, errorThrown) {

+ 8 - 2
apps/oozie/src/oozie/templates/editor2/list_editor_workflows.mako

@@ -80,7 +80,7 @@ ${ layout.menubar(section='workflows', is_editor=True) }
     <tbody data-bind="foreach: { data: jobs }">
     <tbody data-bind="foreach: { data: jobs }">
       <tr>
       <tr>
         <td data-bind="click: $root.handleSelect" class="center" style="cursor: default" data-row-selector-exclude="true">
         <td data-bind="click: $root.handleSelect" class="center" style="cursor: default" data-row-selector-exclude="true">
-          <div data-bind="css: { 'hueCheckbox': true, 'fa': true, 'fa-check': isSelected }" data-row-selector-exclude="true"></div>          
+          <div data-bind="css: { 'hueCheckbox': true, 'fa': true, 'fa-check': isSelected }" data-row-selector-exclude="true"></div>
           <!-- ko if: ! uuid() -->
           <!-- ko if: ! uuid() -->
             <a data-bind="attr: { 'href': '${ url('oozie:open_old_workflow') }?workflow=' + id() }" data-row-selector="true"></a>
             <a data-bind="attr: { 'href': '${ url('oozie:open_old_workflow') }?workflow=' + id() }" data-row-selector="true"></a>
           <!-- /ko -->
           <!-- /ko -->
@@ -170,7 +170,13 @@ ${ commonshare() | n,unicode }
     self.datatable = null;
     self.datatable = null;
 
 
     self.showSubmitPopup = function () {
     self.showSubmitPopup = function () {
-      $.get("/oozie/editor/workflow/submit/" + self.selectedJobs()[0].id(), {
+      if (self.selectedJobs()[0].uuid()) {
+        var base_url = "/oozie/editor/workflow/submit/";
+      } else {
+        var base_url = "/oozie/submit_workflow/";
+      }
+
+      $.get(base_url + self.selectedJobs()[0].id(), {
       }, function (data) {
       }, function (data) {
         $(document).trigger("showSubmitPopup", data);
         $(document).trigger("showSubmitPopup", data);
       }).fail(function (xhr, textStatus, errorThrown) {
       }).fail(function (xhr, textStatus, errorThrown) {