Git Product home page Git Product logo

eno-ws's Introduction

Eno-WS : Questionnaire Generator REST Web Service

Introduction

Eno is a tool that generates survey questionnaires starting from their formal description in DDI.

Due to its modular design, Eno can create questionnaires in different formats from the same DDI description. Currently, Eno generates XForms web questionnaires that can be executed on Orbeon Forms Runner. PDF questionnaires is under development.

This project uses the prior Eno architecture of folders from the ENO GitHub Project v1.0.0 and performs the same actions within a REST Web Service.

Principles:

The generation of XForms forms is performed using a number of XSLT transformations from a DDI input file that is sent to the main URL of the service.

The main URL to call (POST) is http://localhost:8080/eno-ws/api/eno/ddi2xforms and takes one arguments in the body :

  • ddi : the input DDI description to be processed.

The response element will contain the result of the process, which can be:

  • Success case: The output Xforms result
  • Error case: The error message

Others endpoints (working progress) :

http://localhost:8080/eno-ws/api/eno/ddi2fo

http://localhost:8080/eno-ws/api/eno/ddi2pdf

Getting Started

From war file :

From code source :

A dependency to eno-core is required from maven central or from a local build of eno-core.

Subsequently, those additional steps are required in order to build eno:

git pull https://github.com/InseeFr/Eno.git 
pushd Eno
mvn install && mvn install -DskipTests && mvn install:install-file -Dfile=target/eno-core-1.0.0.jar -DgroupId=fr.insee -DartifactId=eno-core -Dversion=1.0.0 -Dpackaging=jar
popd

The first build of the project must be a maven clean install skipping tests. This will download the pom.xml dependencies to initialize the project:

  • Saxon HE 9.X or higher (The XSLT and XQuery Processor), see also : Saxon
  • RestAssured : used in the JUnit tests
  • Log4j : used to log the service
    • The log directory has to be defined in log4j.properties in src/main/resources.
  • All Jersey related dependencies

After this first build and having the application running on your container, you should be able to perform unit tests by building the project without skipping tests.

Usage :

curl -X POST "http://localhost:8080/api/eno/ddi2xforms" -H "accept: application/xml" -H "content-type: application/xml" -d "<?xml version=\"1.0\" encoding=\"UTF-8\"?><DDIInstance .... </DDIInstance>"

Swagger UI :

The main URL to call is http://localhost:8080/eno-ws

Example :

In the Eno project resources, you can find an example of a questionnaire (specified in the DDI format) named simpsons.xml

DDI example : DDI Simpsons Questionnaire XForms expected : [XForms Simpsons Questionnaire] (https://github.com/InseeFr/Eno/blob/master/questionnaires/simpsons/xforms/v1/simpsons-form.xhtml)

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.