Browse Source

[oozie] Fix all the advanced properties of the actions

Romain Rigaux 11 years ago
parent
commit
841ff70

+ 10 - 10
apps/oozie/src/oozie/models2.py

@@ -359,7 +359,7 @@ class PigAction(Action):
           'name': 'archives',
           'name': 'archives',
           'label': _('Archives'),
           'label': _('Archives'),
           'value': [],
           'value': [],
-          'help_text': _('Archives uncompressed into the running directory.'),
+          'help_text': _('zip, tar and tgz/tar.gz uncompressed into the running directory.'),
           'type': ''
           'type': ''
      },
      },
      'job_properties': { 
      'job_properties': { 
@@ -444,7 +444,7 @@ class JavaAction(Action):
           'name': 'archives',
           'name': 'archives',
           'label': _('Archives'),
           'label': _('Archives'),
           'value': [],
           'value': [],
-          'help_text': _('Archives uncompressed into the running directory.'),
+          'help_text': _('zip, tar and tgz/tar.gz uncompressed into the running directory.'),
           'type': ''
           'type': ''
      },
      },
      'job_properties': { 
      'job_properties': { 
@@ -504,7 +504,7 @@ class HiveAction(Action):
           'name': 'archives',
           'name': 'archives',
           'label': _('Archives'),
           'label': _('Archives'),
           'value': [],
           'value': [],
-          'help_text': _('Archives uncompressed into the running directory.'),
+          'help_text': _('zip, tar and tgz/tar.gz uncompressed into the running directory.'),
           'type': ''
           'type': ''
      },
      },
      'job_properties': { 
      'job_properties': { 
@@ -579,7 +579,7 @@ class HiveServer2Action(Action):
           'name': 'archives',
           'name': 'archives',
           'label': _('Archives'),
           'label': _('Archives'),
           'value': [],
           'value': [],
-          'help_text': _('Archives uncompressed into the running directory.'),
+          'help_text': _('zip, tar and tgz/tar.gz uncompressed into the running directory.'),
           'type': ''
           'type': ''
      },
      },
      'job_properties': { 
      'job_properties': { 
@@ -671,7 +671,7 @@ class SqoopAction(Action):
           'name': 'archives',
           'name': 'archives',
           'label': _('Archives'),
           'label': _('Archives'),
           'value': [],
           'value': [],
-          'help_text': _('Archives uncompressed into the running directory.'),
+          'help_text': _('zip, tar and tgz/tar.gz uncompressed into the running directory.'),
           'type': ''
           'type': ''
      },
      },
      'job_properties': { 
      'job_properties': { 
@@ -724,7 +724,7 @@ class MapReduceAction(Action):
           'name': 'archives',
           'name': 'archives',
           'label': _('Archives'),
           'label': _('Archives'),
           'value': [],
           'value': [],
-          'help_text': _('Archives uncompressed into the running directory.'),
+          'help_text': _('zip, tar and tgz/tar.gz uncompressed into the running directory.'),
           'type': ''
           'type': ''
      },
      },
      'job_properties': { 
      'job_properties': { 
@@ -769,7 +769,7 @@ class ShellAction(Action):
           'name': 'arguments',
           'name': 'arguments',
           'label': _('Arguments'),
           'label': _('Arguments'),
           'value': [],
           'value': [],
-          'help_text': _('One command argument, e.g. -l, --help'),
+          'help_text': _('One arg, e.g. -l, --help'),
           'type': ''
           'type': ''
      },    
      },    
      'env_var': { 
      'env_var': { 
@@ -801,7 +801,7 @@ class ShellAction(Action):
           'name': 'archives',
           'name': 'archives',
           'label': _('Archives'),
           'label': _('Archives'),
           'value': [],
           'value': [],
-          'help_text': _('Archives uncompressed into the running directory.'),
+          'help_text': _('zip, tar and tgz/tar.gz uncompressed into the running directory.'),
           'type': ''
           'type': ''
      },
      },
      'job_properties': { 
      'job_properties': { 
@@ -853,7 +853,7 @@ class SshAction(Action):
           'name': 'arguments',
           'name': 'arguments',
           'label': _('Arguments'),
           'label': _('Arguments'),
           'value': [],
           'value': [],
-          'help_text': _('One command argument, e.g. -l, --help'),
+          'help_text': _('One arg, e.g. -l, --help'),
           'type': ''
           'type': ''
      },
      },
      'capture_output': { 
      'capture_output': { 
@@ -991,7 +991,7 @@ class StreamingAction(Action):
           'name': 'archives',
           'name': 'archives',
           'label': _('Archives'),
           'label': _('Archives'),
           'value': [],
           'value': [],
-          'help_text': _('Archives uncompressed into the running directory.')
+          'help_text': _('zip, tar and tgz/tar.gz uncompressed into the running directory.')
      },
      },
      'job_properties': { 
      'job_properties': { 
           'name': 'job_properties',
           'name': 'job_properties',

+ 1 - 1
apps/oozie/src/oozie/templates/editor/gen2/workflow-common.xml.mako

@@ -30,7 +30,7 @@
 <%def name="prepares(prepares)">
 <%def name="prepares(prepares)">
         % if prepares:
         % if prepares:
             <prepare>
             <prepare>
-                % for p in prepares:
+                % for p in sorted(prepares, key=lambda k: k['type']):
                   <%
                   <%
                     operation = p['type']
                     operation = p['type']
                     path = p['value']
                     path = p['value']

+ 7 - 5
apps/oozie/src/oozie/templates/editor/workflow_editor.mako

@@ -532,13 +532,14 @@ ${ commonheader(_("Workflow Editor"), "Oozie", user, "40px") | n,unicode }
     <em data-bind="visible: properties.job_properties().length == 0">${ _('No properties defined.') }</em>
     <em data-bind="visible: properties.job_properties().length == 0">${ _('No properties defined.') }</em>
 
 
     <h6>
     <h6>
-      <a class="pointer" data-bind="click: function(){ properties.archives.push({'name': ''});$(document).trigger('drawArrows') }">
+      <a class="pointer" data-bind="click: function(){ properties.archives.push(ko.mapping.fromJS({'name': ''})); $(document).trigger('drawArrows') }">
         ${ _('Archives') } <i class="fa fa-plus"></i>
         ${ _('Archives') } <i class="fa fa-plus"></i>
       </a>
       </a>
     </h6>
     </h6>
     <ul data-bind="visible: properties.archives().length > 0, foreach: properties.archives" class="unstyled">
     <ul data-bind="visible: properties.archives().length > 0, foreach: properties.archives" class="unstyled">
       <li>
       <li>
-        <input type="text" class="filechooser-input input-xlarge" data-bind="filechooser: name, filechooserOptions: globalFilechooserOptions, value: name, attr: { placeholder: $root.workflow_properties.archives.help_text }"/>
+        <input type="text" class="filechooser-input input-xlarge" data-bind="filechooser: name(), filechooserOptions: globalFilechooserOptions, value: name, attr: { placeholder: $root.workflow_properties.archives.help_text }"/>
+        <span data-bind='template: { name: "common-fs-link", data: { path: name(), with_label: false} }'></span>
         <a href="#" data-bind="click: function(){ $parent.properties.archives.remove(this); $(document).trigger('drawArrows') }">
         <a href="#" data-bind="click: function(){ $parent.properties.archives.remove(this); $(document).trigger('drawArrows') }">
           <i class="fa fa-minus"></i>
           <i class="fa fa-minus"></i>
         </a>
         </a>
@@ -557,7 +558,7 @@ ${ commonheader(_("Workflow Editor"), "Oozie", user, "40px") | n,unicode }
   </h6>
   </h6>
   <ul class="unstyled" data-bind="visible: properties.arguments().length > 0, foreach: properties.arguments">
   <ul class="unstyled" data-bind="visible: properties.arguments().length > 0, foreach: properties.arguments">
     <li>
     <li>
-      <input type="text" class="span11" data-bind="value: value"/>
+      <input type="text" class="input-medium" data-bind="value: value, attr: { placeholder: $root.workflow_properties.arguments.help_text }"/>
       <a href="#" data-bind="click: function(){ $parent.properties.arguments.remove(this); $(document).trigger('drawArrows') }">
       <a href="#" data-bind="click: function(){ $parent.properties.arguments.remove(this); $(document).trigger('drawArrows') }">
         <i class="fa fa-minus"></i>
         <i class="fa fa-minus"></i>
       </a>
       </a>
@@ -586,13 +587,14 @@ ${ commonheader(_("Workflow Editor"), "Oozie", user, "40px") | n,unicode }
 
 
 <script type="text/html" id="common-properties-files">
 <script type="text/html" id="common-properties-files">
   <h6>
   <h6>
-    <a class="pointer" data-bind="click: function(){ properties.files.push({'value': ''}); $(document).trigger('drawArrows') }">
+    <a class="pointer" data-bind="click: function(){ properties.files.push(ko.mapping.fromJS({'value': ''})); $(document).trigger('drawArrows') }">
       ${ _('Files') } <i class="fa fa-plus"></i>
       ${ _('Files') } <i class="fa fa-plus"></i>
     </a>
     </a>
   </h6>
   </h6>
   <ul class="unstyled" data-bind="foreach: properties.files">
   <ul class="unstyled" data-bind="foreach: properties.files">
     <li style="margin-bottom: 3px">
     <li style="margin-bottom: 3px">
       <input type="text" class="filechooser-input" data-bind="filechooser: value, filechooserOptions: globalFilechooserOptions"/>
       <input type="text" class="filechooser-input" data-bind="filechooser: value, filechooserOptions: globalFilechooserOptions"/>
+      <span data-bind='template: { name: "common-fs-link", data: { path: value(), with_label: false} }'></span>
       <a href="#" data-bind="click: function(){ $parent.properties.files.remove(this); $(document).trigger('drawArrows') }">
       <a href="#" data-bind="click: function(){ $parent.properties.files.remove(this); $(document).trigger('drawArrows') }">
         <i class="fa fa-minus"></i>
         <i class="fa fa-minus"></i>
       </a>
       </a>
@@ -667,7 +669,7 @@ ${ commonheader(_("Workflow Editor"), "Oozie", user, "40px") | n,unicode }
 
 
 
 
 <script type="text/html" id="param-fs-link">
 <script type="text/html" id="param-fs-link">
-  <!-- ko if: path.split('=', 2)[1] -->
+  <!-- ko if: path.split('=', 2)[1] && path.split('=', 2)[1].charAt(0) == '/' -->
     <a data-bind="attr: {href: '/filebrowser/view' + $data.path.split('=', 2)[1] }" target="_blank" title="${ _('Open') }">
     <a data-bind="attr: {href: '/filebrowser/view' + $data.path.split('=', 2)[1] }" target="_blank" title="${ _('Open') }">
       <i class="fa fa-external-link-square"></i>
       <i class="fa fa-external-link-square"></i>
     </a>
     </a>