Browse Source

[jobsub] Fix terminology: rename `workflow' to `design'

This change touches the name of the models and DB tables.
You'll need to clear out the DB and run `syncdb' again.
bc Wong 13 years ago
parent
commit
37dcef856e

+ 9 - 9
apps/jobsub/src/jobsub/forms.py

@@ -27,10 +27,10 @@ LOG = logging.getLogger(__name__)
 # This aligns with what Oozie accepts as a workflow name
 _OOZIE_WORKFLOW_NAME_REGEX = '^([a-zA-Z_]([\-_a-zA-Z0-9])*){1,39}$'
 
-class WorkflowForm(forms.ModelForm):
-  """Used for specifying a workflow"""
+class WorkflowDesignForm(forms.ModelForm):
+  """Used for specifying a design"""
   class Meta:
-    model = models.OozieWorkflow
+    model = models.OozieDesign
     exclude = ('root_action', 'owner')
 
   name = forms.RegexField(
@@ -87,16 +87,16 @@ _ACTION_TYPE_TO_FORM_CLS = {
 }
 
 
-def workflow_form_by_type(action_type):
+def design_form_by_type(action_type):
   cls = _ACTION_TYPE_TO_FORM_CLS[action_type]
-  return MultiForm(wf=WorkflowForm, action=cls)
+  return MultiForm(wf=WorkflowDesignForm, action=cls)
 
-def workflow_form_by_instance(wf_obj, data=None):
-  action_obj = wf_obj.get_root_action()
+def design_form_by_instance(design_obj, data=None):
+  action_obj = design_obj.get_root_action()
   cls = _ACTION_TYPE_TO_FORM_CLS[action_obj.action_type]
 
-  instances = dict(wf=wf_obj, action=action_obj)
+  instances = dict(wf=design_obj, action=action_obj)
 
-  res = MultiForm(wf=WorkflowForm, action=cls)
+  res = MultiForm(wf=WorkflowDesignForm, action=cls)
   res.bind(data=data, instances=instances)
   return res

+ 20 - 20
apps/jobsub/src/jobsub/migrations/0002_auto__add_ooziestreamingaction__add_oozieaction__add_oozieworkflow__ad.py

@@ -24,7 +24,7 @@ from django.db import models
 from django.db.utils import DatabaseError
 
 from desktop.lib.django_db_util import remove_content_type
-from jobsub.models import JobDesign, OozieJavaAction, OozieStreamingAction, OozieWorkflow
+from jobsub.models import JobDesign, OozieJavaAction, OozieStreamingAction, OozieDesign
 
 LOG = logging.getLogger(__name__)
 
@@ -50,8 +50,8 @@ class Migration(SchemaMigration):
         ))
         db.send_create_signal('jobsub', ['OozieAction'])
 
-        # Adding model 'OozieWorkflow'
-        db.create_table('jobsub_oozieworkflow', (
+        # Adding model 'OozieDesign'
+        db.create_table('jobsub_ooziedesign', (
             ('description', self.gf('django.db.models.fields.CharField')(max_length=1024, blank=True)),
             ('last_modified', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
             ('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
@@ -59,13 +59,13 @@ class Migration(SchemaMigration):
             ('root_action', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['jobsub.OozieAction'])),
             ('name', self.gf('django.db.models.fields.CharField')(max_length=64)),
         ))
-        db.send_create_signal('jobsub', ['OozieWorkflow'])
+        db.send_create_signal('jobsub', ['OozieDesign'])
 
         # Adding model 'JobHistory'
         db.create_table('jobsub_jobhistory', (
             ('owner', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
             ('submission_date', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)),
-            ('workflow', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['jobsub.OozieWorkflow'])),
+            ('design', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['jobsub.OozieDesign'])),
             ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
             ('job_id', self.gf('django.db.models.fields.CharField')(max_length=128)),
         ))
@@ -121,8 +121,8 @@ class Migration(SchemaMigration):
         # Deleting model 'OozieAction'
         db.delete_table('jobsub_oozieaction')
 
-        # Deleting model 'OozieWorkflow'
-        db.delete_table('jobsub_oozieworkflow')
+        # Deleting model 'OozieDesign'
+        db.delete_table('jobsub_ooziedesign')
 
         # Deleting model 'JobHistory'
         db.delete_table('jobsub_jobhistory')
@@ -196,7 +196,7 @@ class Migration(SchemaMigration):
             'job_id': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
             'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
             'submission_date': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
-            'workflow': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['jobsub.OozieWorkflow']"})
+            'design': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['jobsub.OozieDesign']"})
         },
         'jobsub.oozieaction': {
             'Meta': {'object_name': 'OozieAction'},
@@ -231,8 +231,8 @@ class Migration(SchemaMigration):
             'oozieaction_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['jobsub.OozieAction']", 'unique': 'True', 'primary_key': 'True'}),
             'reducer': ('django.db.models.fields.CharField', [], {'max_length': '512'})
         },
-        'jobsub.oozieworkflow': {
-            'Meta': {'object_name': 'OozieWorkflow'},
+        'jobsub.ooziedesign': {
+            'Meta': {'object_name': 'OozieDesign'},
             'description': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'blank': 'True'}),
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
             'last_modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
@@ -279,11 +279,11 @@ def job_design_migration_for_jar(jd):
                            args=data['arguments'])
   action.save()
 
-  wf = OozieWorkflow(owner=jd.owner,
-                     name=jd.name + ' (incomplete)',
-                     description=jd.description,
-                     root_action=action)
-  wf.save()
+  design = OozieDesign(owner=jd.owner,
+                       name=jd.name + ' (incomplete)',
+                       description=jd.description,
+                       root_action=action)
+  design.save()
 
 
 def job_design_migration_for_streaming(jd):
@@ -316,9 +316,9 @@ def job_design_migration_for_streaming(jd):
                                 job_properties=properties)
   action.save()
 
-  wf = OozieWorkflow(owner=jd.owner,
-                     name=jd.name,
-                     description=jd.description,
-                     root_action=action)
-  wf.save()
+  design = OozieDesign(owner=jd.owner,
+                       name=jd.name,
+                       description=jd.description,
+                       root_action=action)
+  design.save()
 

+ 5 - 4
apps/jobsub/src/jobsub/models.py

@@ -90,7 +90,7 @@ PATH_MAX = 512
 class OozieAction(models.Model):
   """
   The OozieAction model is an abstract base class. All concrete actions
-  derive from it. And it provides something for the OozieWorkflow to
+  derive from it. And it provides something for the OozieDesign to
   reference. See
   https://docs.djangoproject.com/en/dev/topics/db/models/#multi-table-inheritance
   """
@@ -115,9 +115,10 @@ class OozieAction(models.Model):
     bind_parameters(self, mapping, self.PARAM_FIELDS)
 
 
-class OozieWorkflow(models.Model):
+class OozieDesign(models.Model):
   """
-  Contains information on MapReduce job types
+  Contains information about all (Oozie) designs. Specific action info are
+  stored in the Oozie*Action models.
   """
   # Generic stuff
   owner = models.ForeignKey(User)
@@ -238,4 +239,4 @@ class JobHistory(models.Model):
   owner = models.ForeignKey(User)
   submission_date = models.DateTimeField(auto_now=True)
   job_id = models.CharField(max_length=128)
-  workflow = models.ForeignKey(OozieWorkflow)
+  design = models.ForeignKey(OozieDesign)

+ 11 - 11
apps/jobsub/src/jobsub/submit.py

@@ -16,7 +16,7 @@
 # limitations under the License.
 
 """
-Handle workflow submission.
+Handle design submission.
 """
 
 import errno
@@ -34,16 +34,16 @@ LOG = logging.getLogger(__name__)
 
 class Submission(object):
   """Represents one submission"""
-  def __init__(self, wf_obj, fs):
-    self._wf_obj = wf_obj
-    self._username = wf_obj.owner.username
-    self._action = wf_obj.get_root_action()
+  def __init__(self, design_obj, fs):
+    self._design_obj = design_obj
+    self._username = design_obj.owner.username
+    self._action = design_obj.get_root_action()
     self._fs = fs
     self._job_id = None       # The oozie workflow instance id
 
   def __unicode__(self):
     res = "Submission for job design '%s' (id %s, owner %s)" % \
-        (self._wf_obj.name, self._wf_obj.id, self._username)
+        (self._design_obj.name, self._design_obj.id, self._username)
     if self.job_id:
       res += " -- " + self.job_id
     return res
@@ -101,7 +101,7 @@ class Submission(object):
   def _copy_files(self, wf_dir, wf_xml):
     """
     Copy the files over to the deployment directory. This should run as the
-    workflow owner.
+    design owner.
     """
     xml_path = self._fs.join(wf_dir, 'workflow.xml')
     self._fs.create(xml_path, overwrite=True, permission=0644, data=wf_xml)
@@ -124,9 +124,9 @@ class Submission(object):
 
   def _generate_workflow_xml(self, namenode):
     """Return a string that is the workflow.xml of this workflow"""
-    action_type = self._wf_obj.root_action.action_type
+    action_type = self._design_obj.root_action.action_type
     data = {
-      'wf': self._wf_obj,
+      'design': self._design_obj,
       'nameNode': namenode,
     }
 
@@ -181,7 +181,7 @@ class Submission(object):
     # We could have collision with usernames. But there's no good separator.
     # Hope people don't create crazy usernames.
     return self._fs.join(conf.REMOTE_DATA_DIR.get(),
-                         "_%s_-design-%s" % (self._username, self._wf_obj.id))
+                         "_%s_-design-%s" % (self._username, self._design_obj.id))
 
 
   def remove_deployment_dir(self):
@@ -193,4 +193,4 @@ class Submission(object):
     except Exception, ex:
       LOG.warn("Failed to clean up workflow deployment directory for "
                "%s (owner %s). Caused by: %s",
-               self._wf_obj.name, self._wf_obj.owner.username, ex)
+               self._design_obj.name, self._design_obj.owner.username, ex)

+ 19 - 19
apps/jobsub/src/jobsub/templates/list_designs.mako

@@ -51,30 +51,30 @@ ${layout.menubar(section='designs')}
             </tr>
         </thead>
         <tbody>
-            %for wf in workflows:
+            %for design in designs:
                 <tr>
-                    <td>${wf.owner.username}</td>
-                    <td>${wf.name}</td>
-                    <td>${wf.root_action.action_type}</td>
-                    <td>${wf.description}</td>
-                    <td nowrap="nowrap">${wf.last_modified.strftime('%c')}</td>
+                    <td>${design.owner.username}</td>
+                    <td>${design.name}</td>
+                    <td>${design.root_action.action_type}</td>
+                    <td>${design.description}</td>
+                    <td nowrap="nowrap">${design.last_modified.strftime('%c')}</td>
                     <td nowrap="nowrap" class="pull-right">
                       %if currentuser.is_superuser:
-                        %if currentuser.username == wf.owner.username:
-                          <a title="Edit ${wf.name}" class="btn small"
-                              href="${ url('jobsub.views.edit_design', wf_id=wf.id) }">Edit</a>
-                          <a title="Submit ${wf.name}" class="btn small submitConfirmation"
-                              alt="Submit ${wf.name} to the cluster"
+                        %if currentuser.username == design.owner.username:
+                          <a title="Edit ${design.name}" class="btn small"
+                              href="${ url('jobsub.views.edit_design', design_id=design.id) }">Edit</a>
+                          <a title="Submit ${design.name}" class="btn small submitConfirmation"
+                              alt="Submit ${design.name} to the cluster"
                               href="javascript:void(0)"
-                              data-param-url="${ url('jobsub.views.get_design_params', wf_id=wf.id) }"
-                              data-submit-url="${ url('jobsub.views.submit_design', wf_id=wf.id) }">Submit</a>
+                              data-param-url="${ url('jobsub.views.get_design_params', design_id=design.id) }"
+                              data-submit-url="${ url('jobsub.views.submit_design', design_id=design.id) }">Submit</a>
                         %endif
-                        <a title="Delete ${wf.name}" class="btn small deleteConfirmation"
-                            alt="Are you sure you want to delete ${wf.name}?"
+                        <a title="Delete ${design.name}" class="btn small deleteConfirmation"
+                            alt="Are you sure you want to delete ${design.name}?"
                             href="javascript:void(0)"
-                            data-confirmation-url="${ url('jobsub.views.delete_design', wf_id=wf.id) }">Delete</a>
+                            data-confirmation-url="${ url('jobsub.views.delete_design', design_id=design.id) }">Delete</a>
                       %endif
-                      <a title="Clone ${wf.name}" class="btn small" href="${ url('jobsub.views.clone_design', wf_id=wf.id) }">Clone</a>
+                      <a title="Clone ${design.name}" class="btn small" href="${ url('jobsub.views.clone_design', design_id=design.id) }">Clone</a>
                     </td>
                 </tr>
             %endfor
@@ -97,8 +97,8 @@ ${layout.menubar(section='designs')}
             </fieldset>
         </div>
         <div class="modal-footer">
-            <input id="submitBtn" type="submit" class="btn primary" value="Yes"/>
-            <a href="#" class="btn secondary hideModal">No</a>
+            <input id="submitBtn" type="submit" class="btn primary" value="Submit"/>
+            <a href="#" class="btn secondary hideModal">Cancel</a>
         </div>
 	</form>
 </div>

+ 1 - 1
apps/jobsub/src/jobsub/templates/list_history.mako

@@ -48,7 +48,7 @@ ${layout.menubar(section='history')}
         </thead>
         <tbody>
             %for record in history:
-                <% wf = record.workflow %>
+                <% wf = record.design %>
                 <tr>
                     <td><a href="${url('jobsub.views.oozie_job', jobid=record.job_id)}">${record.job_id}</a></td>
                     <td>${record.owner.username}</td>

+ 2 - 2
apps/jobsub/src/jobsub/templates/workflow-java.xml.mako

@@ -21,12 +21,12 @@ except ImportError:
     import simplejson as json
 %>
 <%
-    java = wf.get_root_action()
+    java = design.get_root_action()
     properties = json.loads(java.job_properties)
     files = json.loads(java.files)
     archives = json.loads(java.archives)
 %>
-<workflow-app xmlns="uri:oozie:workflow:0.2" name="${wf.name}">
+<workflow-app xmlns="uri:oozie:workflow:0.2" name="${design.name}">
     <start to="root-node"/>
     <action name="root-node">
         <java>

+ 2 - 2
apps/jobsub/src/jobsub/templates/workflow-mapreduce.xml.mako

@@ -22,12 +22,12 @@ except ImportError:
 
 %>
 <%
-    mapreduce = wf.get_root_action()
+    mapreduce = design.get_root_action()
     properties = json.loads(mapreduce.job_properties)
     files = json.loads(mapreduce.files)
     archives = json.loads(mapreduce.archives)
 %>
-<workflow-app xmlns="uri:oozie:workflow:0.2" name="${wf.name}">
+<workflow-app xmlns="uri:oozie:workflow:0.2" name="${design.name}">
     <start to="root-node"/>
     <action name="root-node">
         <map-reduce>

+ 2 - 2
apps/jobsub/src/jobsub/templates/workflow-streaming.xml.mako

@@ -22,12 +22,12 @@ except ImportError:
 
 %>
 <%
-    streaming = wf.get_root_action()
+    streaming = design.get_root_action()
     properties = json.loads(streaming.job_properties)
     files = json.loads(streaming.files)
     archives = json.loads(streaming.archives)
 %>
-<workflow-app xmlns="uri:oozie:workflow:0.2" name="${wf.name}">
+<workflow-app xmlns="uri:oozie:workflow:0.2" name="${design.name}">
     <start to="root-node"/>
     <action name="root-node">
         <map-reduce>

+ 5 - 5
apps/jobsub/src/jobsub/urls.py

@@ -25,11 +25,11 @@ urlpatterns = patterns(
 
   url(r'^list_designs$', 'views.list_designs'),
   url(r'^new_design/(?P<action_type>\w+)$', 'views.new_design'),
-  url(r'^delete_design/(?P<wf_id>\d+)$', 'views.delete_design'),
-  url(r'^edit_design/(?P<wf_id>\d+)$', 'views.edit_design'),
-  url(r'^clone_design/(?P<wf_id>\d+)$', 'views.clone_design'),
-  url(r'^submit_design/(?P<wf_id>\d+)$', 'views.submit_design'),
-  url(r'^design_parameters/(?P<wf_id>\d+)$', 'views.get_design_params'),
+  url(r'^delete_design/(?P<design_id>\d+)$', 'views.delete_design'),
+  url(r'^edit_design/(?P<design_id>\d+)$', 'views.edit_design'),
+  url(r'^clone_design/(?P<design_id>\d+)$', 'views.clone_design'),
+  url(r'^submit_design/(?P<design_id>\d+)$', 'views.submit_design'),
+  url(r'^design_parameters/(?P<design_id>\d+)$', 'views.get_design_params'),
 
   url(r'^job/(?P<jobid>[-\w]+)$', 'views.oozie_job'),
   url(r'^list_history$', 'views.list_history'),

+ 47 - 53
apps/jobsub/src/jobsub/views.py

@@ -56,10 +56,10 @@ def oozie_job(request, jobid):
   design_link = None
   try:
     history_record = models.JobHistory.objects.get(job_id=jobid)
-    design = history_record.workflow
+    design = history_record.design
     if design.owner == request.user:
       design_link = urlresolvers.reverse(jobsub.views.edit_design,
-                                         kwargs={'wf_id': design.id})
+                                         kwargs={'design_id': design.id})
   except models.JobHistory.DoesNotExist, ex:
     pass
 
@@ -86,7 +86,7 @@ def list_history(request):
 
 
 def new_design(request, action_type):
-  form = jobsub.forms.workflow_form_by_type(action_type)
+  form = jobsub.forms.design_form_by_type(action_type)
 
   if request.method == 'POST':
     form.bind(request.POST)
@@ -96,10 +96,10 @@ def new_design(request, action_type):
       action.action_type = action_type
       action.save()
 
-      workflow = form.wf.save(commit=False)
-      workflow.root_action = action
-      workflow.owner = request.user
-      workflow.save()
+      design = form.wf.save(commit=False)
+      design.root_action = action
+      design.owner = request.user
+      design.save()
 
       return redirect(urlresolvers.reverse(list_designs))
   else:
@@ -125,9 +125,9 @@ def list_designs(request):
   List all workflow designs. Result sorted by last modification time.
   Query params:
     owner       - Substring filter by owner field 
-    name        - Substring filter by workflow name field
+    name        - Substring filter by design name field
   '''
-  data = models.OozieWorkflow.objects
+  data = models.OozieDesign.objects
   owner = request.GET.get("owner", '')
   name = request.GET.get('name', '')
   if owner:
@@ -137,22 +137,22 @@ def list_designs(request):
   data = data.order_by('-last_modified')
 
   return render("list_designs.mako", request, {
-    'workflows': list(data),
+    'designs': list(data),
     'currentuser':request.user,
     'owner': owner,
     'name': name,
   })
 
 
-def _get_design(wf_id):
-  """Raise PopupException if workflow doesn't exist"""
+def _get_design(design_id):
+  """Raise PopupException if design doesn't exist"""
   try:
-    return models.OozieWorkflow.objects.get(pk=wf_id)
-  except models.OozieWorkflow.DoesNotExist:
+    return models.OozieDesign.objects.get(pk=design_id)
+  except models.OozieDesign.DoesNotExist:
     raise PopupException("Job design not found")
 
 def _check_permission(request, owner_name, error_msg, allow_root=False):
-  """Raise PopupException if user doesn't have permission to modify the workflow"""
+  """Raise PopupException if user doesn't have permission to modify the design"""
   if request.user.username != owner_name:
     if allow_root and request.user.is_superuser:
       return
@@ -160,65 +160,65 @@ def _check_permission(request, owner_name, error_msg, allow_root=False):
     raise PopupException("Permission denied. You are not the owner.")
 
 
-def delete_design(request, wf_id):
+def delete_design(request, design_id):
   if request.method == 'POST':
     try:
-      wf_obj = _get_design(wf_id)
-      _check_permission(request, wf_obj.owner.username,
-                        "Access denied: delete workflow %s" % (wf_id,),
+      design_obj = _get_design(design_id)
+      _check_permission(request, design_obj.owner.username,
+                        "Access denied: delete design %s" % (design_id,),
                         allow_root=True)
-      wf_obj.root_action.delete()
-      wf_obj.delete()
+      design_obj.root_action.delete()
+      design_obj.delete()
 
-      submit.Submission(wf_obj, request.fs).remove_deployment_dir()
-    except models.OozieWorkflow.DoesNotExist:
-      LOG.error("Trying to delete non-existent workflow (id %s)" % (wf_id,))
+      submit.Submission(design_obj, request.fs).remove_deployment_dir()
+    except models.OozieDesign.DoesNotExist:
+      LOG.error("Trying to delete non-existent design (id %s)" % (design_id,))
       raise PopupException("Workflow not found")
 
   return redirect(urlresolvers.reverse(list_designs))
 
 
-def edit_design(request, wf_id):
-  wf_obj = _get_design(wf_id)
-  _check_permission(request, wf_obj.owner.username,
-                    "Access denied: edit workflow %s" % (wf_id,))
+def edit_design(request, design_id):
+  design_obj = _get_design(design_id)
+  _check_permission(request, design_obj.owner.username,
+                    "Access denied: edit design %s" % (design_id,))
 
   if request.method == 'POST':
-    form = jobsub.forms.workflow_form_by_instance(wf_obj, request.POST)
+    form = jobsub.forms.design_form_by_instance(design_obj, request.POST)
     if form.is_valid():
       form.action.save()
       form.wf.save()
       return redirect(urlresolvers.reverse(list_designs))
   else:
-    form = jobsub.forms.workflow_form_by_instance(wf_obj)
+    form = jobsub.forms.design_form_by_instance(design_obj)
 
   return _render_design_edit(request,
                                form,
-                               wf_obj.root_action.action_type,
+                               design_obj.root_action.action_type,
                                _STD_PROPERTIES_JSON)
 
 
-def clone_design(request, wf_id):
-  wf_obj = _get_design(wf_id)
-  clone = wf_obj.clone(request.user)
-  return redirect(urlresolvers.reverse(edit_design, kwargs={'wf_id': clone.id}))
+def clone_design(request, design_id):
+  design_obj = _get_design(design_id)
+  clone = design_obj.clone(request.user)
+  return redirect(urlresolvers.reverse(edit_design, kwargs={'design_id': clone.id}))
 
 
-def get_design_params(request, wf_id):
+def get_design_params(request, design_id):
   """
   Return the parameters found in the design as a json dictionary of
     { param_key : label }
   This expects an ajax call.
   """
-  wf_obj = _get_design(wf_id)
-  _check_permission(request, wf_obj.owner.username,
-                    "Access denied: workflow parameters %s" % (wf_id,))
-  params = wf_obj.find_parameters()
+  design_obj = _get_design(design_id)
+  _check_permission(request, design_obj.owner.username,
+                    "Access denied: design parameters %s" % (design_id,))
+  params = design_obj.find_parameters()
   params_with_labels = dict((p, p.upper()) for p in params)
   return render('dont_care_for_ajax', request, { 'params': params_with_labels })
 
 
-def submit_design(request, wf_id):
+def submit_design(request, design_id):
   """
   Submit a workflow to Oozie.
   The POST data should contain parameter values.
@@ -226,32 +226,26 @@ def submit_design(request, wf_id):
   if request.method != 'POST':
     raise PopupException('Please use a POST request to submit a design.')
 
-  wf_obj = _get_design(wf_id)
-  _check_permission(request, wf_obj.owner.username,
-                    "Access denied: submit workflow %s" % (wf_id,))
+  design_obj = _get_design(design_id)
+  _check_permission(request, design_obj.owner.username,
+                    "Access denied: submit design %s" % (design_id,))
 
   # Expect the parameter mapping in the POST data
   param_mapping = request.POST
-  wf_obj.bind_parameters(request.POST)
+  design_obj.bind_parameters(request.POST)
 
-  submission = submit.Submission(wf_obj, request.fs)
+  submission = submit.Submission(design_obj, request.fs)
   jobid = submission.run()
 
   # Save the submission record
   job_record = models.JobHistory(owner=request.user,
                                  job_id=jobid,
-                                 workflow=wf_obj)
+                                 design=design_obj)
   job_record.save()
 
   # Show oozie job info
   return redirect(urlresolvers.reverse(oozie_job, kwargs={'jobid': jobid}))
 
-  parameters = wf_obj.find_parameters()
-  return render('parameterize.mako', request, {
-      'workflow_id': wf_id,
-      'params': parameters
-  })
-
 
 
 # See http://wiki.apache.org/hadoop/JobConfFile