GithubHelp home page GithubHelp logo

apache-daffodil's Introduction

Apache-Daffodil

Description

This policy provides a way to build a REST API on top of the Apache Daffodil application.

Incubation Page for Application: https://daffodil.apache.org/

Definition From Apache Page: "The Data Format Description Language (DFDL) is a specification, developed by the Open Grid Forum, capable of describing many data formats, including both textual and binary, scientific and numeric, legacy and modern, commercial record-oriented, and many industry and military standards. It defines a language that is a subset of W3C XML schema to describe the logical format of the data, and annotations within the schema to describe the physical representation.

Daffodil is an open source implementation of the DFDL specification that uses these DFDL schemas to parse fixed format data into an infoset, which is most commonly represented as either XML or JSON. This allows the use of well-established XML or JSON technologies and libraries to consume, inspect, and manipulate fixed format data in existing solutions. Daffodil is also capable of the reverse by serializing or “unparsing” an XML or JSON infoset back to the original data format."

Potential Next Steps

  • Build a filter that implements Apache Daffodil directly in the API Gateway.
  • Enable dynamic schmea/file delivery.

Prerequisites

  • Apache Daffodil: To make this policy work, you need to install the Apache Daffodil RPM on the server that is running the API Gateway. The user running the API Gateway will need access to the underlying application once installed, and the directories where the sample files and schema are stored.

Daffodil Policy

This policy was built with the intent of being a framework for utilizing Apache Daffodil within the Axway API Gateway.

  • Starting Filter Placeholder - Not Required: This is an Extract REST Attributes filter. It is not required for this policy, but I often use it as the starting filter for policies, as it should always pass and has value for making additional attributes available if required.

  • Grab File/Stream to Be Transformed: This filter is a placeholder for how we grab the file to be transformed. For this policy I am using the sample files for Apache Daffodil that are stored in the src repository and reading them from the system directory using the Execute Command process and a Linux "cat" to read and return the file. The filter uses the "file" query params value passed in to select the file name, enabling this to be a REST based solution. This would allow a seperate process to create and drop the files in the directory you are calling that could be transformed. The file could also be the payload of the message, and the next filter would just reference the content.body attribute instead.

  • Set Data to be Transformed: This Set Attribute filter stores the file in a variable to ensure it can be handled as a string.

  • Parse Input Against Schema via CLI RPM Call: This Execute Command filter calls the underlying Apache Daffodil RPM with the file and schema being provided by dynamic REST Attributes to reference these files on the command line. A sample request and schema are stored in the /src file of this github repo. This type of REST-ification of command line utilities can be used to securely expose any CLI application. For example openssl certificate generation. This filter will return the result of the transformed file.

  • Respond with Original File and Transformation and Reflect: This sets a response that shows the origianl file and the transformation.

For questions or comments: [email protected]

apache-daffodil's People

Contributors

dwille-axway 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.