Giter Site home page Giter Site logo

drishti-forms-migrator's Introduction

##Drishti Content Migrator Service

Build Status

This is a service that has a scheduled batch job that runs and converts the data from the no sql db to relational db

The following are the dependencies to run this project:

###How to run: Once the code is checkout-out you can

  • To build the project and run all the tests:
$./gradlew build
  • To start the application(via code base) and batch job :
$./gradlew run
  • To clean the db and run migrations :
$./gradlew cleandb migrations

###Rest Endpoint

There is also a rest endpoint where we can post the payload directly to http://localhost:8080/form

Ex, POST http://localhost:8080/form with the sample JSON data :

{
     "anmId": "demo1",
     "instanceId": "404-id",
     "entityId": "abc-id",
     "formName": "foo-form",
     "formInstance": {
         "form_data_definition_version": "1",
         "form": {
             "bind_type": "mother",
             "default_bind_path": "/model/instance/",
             "fields": [
                 {
                     "name": "id",
                     "value": "404-d",
                     "source": "mother.id"
                 },
                 {
                     "name": "closeReason",
                     "value": "its really critical",
                     "source": "mother.closeReason"
                 },
                 {
                     "name": "deathDate",
                     "value": "2013-08-11",
                     "source": "mother.deathDate"
                 }
             ]
         }
     },
     "clientVersion": "1378970016595",
     "serverVersion": "1378970226852",
     "formDataDefinitionVersion": "1"
 }

This request would create a row in the corresponding table

###Project Util

There is a ruby utility that will generate the java class and the corresponding migration script for a given sample form data.

This utility can be run when there is any new forms that needs to be added.

The sample json file that contains the form sample is place under util/samples directory

Once the sample json is placed, you can run

$ruby generator.rb

This will create java class file into util/generated/classes folder and migration script into util/generated/migrations folder

drishti-forms-migrator's People

Contributors

eneyed avatar thirunar avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.