 
   getChannelConfig: =>
     "I'm empty"
-  run: =>
-    newForm = []
-    newChannel =
-      type: 'object'
-      properties: {}
-    channel = @channel()
-
-    _.each channel.application.resources, (resource) =>
-      resource.method = resource.httpMethod.toLocaleUpperCase()
-
-    newChannel.properties.endpoint =
-      type: 'string'
-      enum: _.map channel.application.resources, (resource) =>
-        "#{resource.method}-#{resource.url}"
-
-    newChannel.properties.url =
-      type: 'string'
-      required: true
-      enum: _.uniq _.pluck channel.application.resources, 'url'
-
-    newChannel.properties.method =
-      type: 'string'
-      required: true
-      enum: _.uniq _.pluck channel.application.resources, 'method'
-
-    form =
-      key: 'endpoint'
-      title: 'Endpoint'
-      titleMap: []
-
-    _.each channel.application.resources, (resource) =>
-      form.titleMap.push {value: "#{resource.method}-#{resource.url}", name: resource.displayName}
-
-    newForm.push form
-
-    _.each channel.application.resources, (resource) =>
-      newForm.push
-        type: "help"
-        helpvalue: "#{resource.method.toLocaleUpperCase()} #{resource.url}"
-        condition: "model.url === '#{resource.url}' && model.method === '#{resource.method}'"
-
-      _.each resource.params, (param) =>
-        newName = "#{@sanitizeParam param.name}"
-        newForm.push @convertFormParam param, resource.url, resource.method
-        newChannel.properties[newName] = @convertParam param
-
-    @writeOutput newChannel
-    @writeForm newForm
 
   convertParam: (param) =>
     resourceParam =


commander
  .version 0.1
  .option('-i, --infile [path]',  'Path to the channel file to input')
  .option('-o, --outfile [path]',  'Path to the channel file to output')
  .option('-f, --form [path]',  'Path to the schema form file to output')
  .option('-c, --channel-config [path]',  'Path to the channel-config file to output')
  .parse(process.argv);

commander.help() unless commander.infile?

converter = new ParseChannelSchemaToJSONSchema channel_infile: commander.infile?,
  messageSchemaFile: commander.outfile?
converter.run2()

    messageSchema

  getForm: (resources) =>
    form = [
      key: 'action'
      title: 'Action'
      titleMap: @getActionTitleMap resources
    ]

    resourceForms = _.flatten( _.map resources, @getFormFromResource )

    form.concat resourceForms

  getFormFromResource: (resource) =>
    form = [
      key: "#{resource.action}"
      notitle: true
      condition: "model.action === '#{resource.action}'"
    ]

    _.each resource.params, (param) =>
      form.push(@getFormFromParam resource.action, param)

    form

  getFormFromParam: (action, param) =>
    formParam =
      key: "#{action}.#{@sanitizeParam param.name}"
      title: "#{action}.#{@sanitizeParam param.name}"
      condition: "model.action === '#{action}'"
    if param.hidden?
      formParam.type = 'hidden'
      formParam.notitle = true

    formParam


  getActionTitleMap: (resources) =>
