stratos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dakshika Jayathilaka <daksh...@wso2.com>
Subject [Discuss] JSON based form builder for Stratos Console App
Date Mon, 03 Nov 2014 17:31:08 GMT
Hi All,

In new Stratos implementation Rukmal came up with an idea of
auto-generating forms based on JSON[1]. I'm trying to extend it for current
apache stratos console app.

*Why JSON based form generator*

Apache stratos use JSONs for definitions and other related services. There
are two major concerns on introducing JSON based form generator.

   - *Enhance End-user user experience(UX): *
      - Currently we are adding plain JSON via textarea and there is no
      visual representation or validation on it. If we implement this users can
      use form based view including JSON validation. Still advance
users can use
      raw JSON option.


   - *To maintain developer friendly backend:*
      - Apache stratos is *community based project *and most developers are
      focusing on backend functions instead of frontend UI. If we
implement easy
      way without hard coded forms, developers may love to integrate new
      functionality to UI without much hesitation. IMO its really good to keep
      alive UI and other functionalities.


We kept JSON specifications on separate file and generate UI forms using
form-generator logic. Also we defined our own JSON spec for this. After
analyzing the logic and concept i think we can use more generalized method
instead of defining our own specifications.

Stratos REST endpoint already having XML Schema validation and we can
implement similar concept on UI form/JSON implementation. In that case JSON
Schema[2] is a good alternative.

*What is JSON Schema*

JSON Schema specifies a JSON-based format to define the structure of JSON
data for validation, documentation, and interaction control. Its based on
the concepts from XML Schema (XSD), but is JSON-based. The JSON data schema
can be used to validate JSON data. As in XSD, the same
serialization/deserialization tools can be used both for the schema and
data. The schema is self-describing. [7]

JSON Schema is an Internet Draft, currently version 4. [3]

*Why JSON Schema*

1. Since we already have XSD we can simply match our JSON based form
implementation with this. [3]
2. Can use for validation [4] without writing filed base js validation.
3. Widely used [5]
4. No need to maintain separate documentation on stratos end and eliminate
documentation burden.
5. Easy to generate schema using JSON [6]

 AFAIK this will help to stratos in many ways. I have attached sample JSON
Schema for partition definition & screenshot of new form based UXD
(005_JSONbasedform.png).

Any comments/suggestions are highly appreciated.

[1]
https://github.com/rukmal/Stratos-UI/blob/master/controllers/forms/form_generator.jag
[2] http://json-schema.org/
[3] http://json-schema.org/latest/json-schema-core.html
[4] http://json-schema.org/latest/json-schema-validation.html
[5] http://json-schema.org/implementations.html
[6] http://www.jsonschema.net/
[7] http://en.wikipedia.org/wiki/JSON#JSON_Schema


Thank you,

Bst Regards,

*Dakshika Jayathilaka *
Software Engineer
WSO2, Inc.
lean.enterprise.middleware
0771100911

Mime
View raw message