瀏覽代碼

HUE-3308 [oozie] Display the selected Java program in the document action

Romain Rigaux 9 年之前
父節點
當前提交
d61b94e

+ 1 - 1
apps/oozie/src/oozie/static/oozie/js/workflow-editor.ko.js

@@ -549,7 +549,7 @@ var WorkflowEditorViewModel = function (layout_json, workflow_json, credentials_
 
   self.getDocumentById = function (type, uuid) {
     var _query = null;
-    if (type == 'java') {
+    if (type.indexOf('java') != -1) {
       data = self.javaQueries();
     } else {
       data = self.hiveQueries();

+ 18 - 6
apps/oozie/src/oozie/templates/editor2/common_workflow.mako

@@ -1035,7 +1035,7 @@
       <div data-bind="visible: ! $parent.ooziePropertiesExpanded()" class="nowrap">
         <!-- ko if: $root.getDocumentById(type(), properties.uuid()) -->
         <!-- ko with: $root.getDocumentById(type(), properties.uuid()) -->
-          <select data-bind="options: $root.javaQueries, optionsText: 'name', optionsValue: 'uuid', value: $parent.properties.uuid, select2Version4:{ placeholder: '${ _ko('Hive query name...')}'}"></select>
+          <select data-bind="options: $root.javaQueries, optionsText: 'name', optionsValue: 'uuid', value: $parent.properties.uuid, select2Version4:{ placeholder: '${ _ko('Java program name...')}'}"></select>
           <a href="#" data-bind="attr: { href: absoluteUrl() }" target="_blank" title="${ _('Open') }">
             <i class="fa fa-external-link-square"></i>
           </a>
@@ -1059,15 +1059,27 @@
       </ul>
       <div class="tab-content">
         <div class="tab-pane active" data-bind="attr: { id: 'properties-' + id() }">
-          <span data-bind="text: $root.workflow_properties.jdbc_url.label"></span>
-          <input type="text" data-bind="value: properties.jdbc_url, attr: { placeholder: $root.workflow_properties.jdbc_url.help_text }" />
+          <h6>
+            <a class="pointer" data-bind="click: function(){ properties.java_opts.push({'value': ''}); }">
+              <span data-bind="text: $root.workflow_properties.java_opts.label"></span> <i class="fa fa-plus"></i>
+            </a>
+          </h6>
+          <ul class="unstyled" data-bind="foreach: properties.java_opts">
+            <li>
+              <input type="text" data-bind="value: value, attr: { placeholder: $root.workflow_properties.java_opts.help_text }" class="input-xlarge"/>
+              <a href="#" data-bind="click: function(){ $parent.properties.java_opts.remove(this); }">
+                <i class="fa fa-minus"></i>
+              </a>
+            </li>
+          </ul>
+
+          <span data-bind="text: $root.workflow_properties.capture_output.label"></span>
+          <input type="checkbox" data-bind="checked: properties.capture_output" />
           <br/>
-          <span data-bind="text: $root.workflow_properties.password.label"></span>
-          <input type="text" data-bind="value: properties.password, attr: { placeholder: $root.workflow_properties.password.help_text }" />
           <br/>
+
           <span data-bind="template: { name: 'common-action-properties' }"></span>
           <br/>
-          <br/>
         </div>
 
         <div class="tab-pane" data-bind="attr: { id: 'sla-' + id() }">

+ 2 - 2
apps/oozie/src/oozie/views/editor2.py

@@ -219,11 +219,11 @@ def save_workflow(request):
     Document.objects.link(workflow_doc, owner=workflow_doc.owner, name=workflow_doc.name, description=workflow_doc.description, extra='workflow2')
 
   # Excludes all the sub-workflow and Hive dependencies. Contains list of history and coordinator dependencies.
-  workflow_doc.dependencies = workflow_doc.dependencies.exclude(Q(is_history=False) & Q(type__in=['oozie-workflow2', 'query-hive']))
+  workflow_doc.dependencies = workflow_doc.dependencies.exclude(Q(is_history=False) & Q(type__in=['oozie-workflow2', 'query-hive', 'query-java']))
 
   dependencies = \
       [node['properties']['workflow'] for node in workflow['nodes'] if node['type'] == 'subworkflow-widget'] + \
-      [node['properties']['uuid'] for node in workflow['nodes'] if node['type'] == 'hive-document-widget']
+      [node['properties']['uuid'] for node in workflow['nodes'] if 'document-widget' in node['type']]
   if dependencies:
     dependency_docs = Document2.objects.filter(uuid__in=dependencies)
     workflow_doc.dependencies.add(*dependency_docs)