• Jump To … +
    app.litcoffee csv.litcoffee config.litcoffee contents.litcoffee publish.litcoffee revise.litcoffee transform.litcoffee main.litcoffee rdb.litcoffee config.litcoffee contents.litcoffee publish.litcoffee revise.litcoffee transform.litcoffee columntip.litcoffee cursor.litcoffee rdfbadge.litcoffee wizard.litcoffee score.litcoffee config.litcoffee csv.litcoffee oracle.litcoffee rdb.litcoffee rdf.litcoffee sml.litcoffee transform.litcoffee underscore.litcoffee
  • ¶

    The transformation service

    Adapter for both the CSV and database transformation backend.

    'use strict'
    
    angular.module 'r2rDesignerApp'
      .factory 'Transform', ($http, _) ->
    
        host = 'http://localhost:3000'
        transformApi = host + '/api/v1/transform'
    
        {
          dumpdb: (mapping) ->
            if mapping?
              $http.post transformApi + '/dump-db', {
                mapping: mapping
              }
                .then (res) ->
                  transformApi + res.data
    
          dumpcsv: (mapping) ->
            if mapping?
              $http.post transformApi + '/dump-csv', {
                mapping: mapping
              }
                .then (res) ->
                  transformApi + res.data
    
          publish: (to, mapping) ->
            if to? and mapping?
              api = transformApi + '/publish/' + to
              $http.post api, { mapping: mapping }
        }