Javascript Data Request Form: Difference between revisions
EvanKroske (talk | contribs) (Added server-side modification to plan of action) |
EvanKroske (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
My goal is to create a Javascript API for accessing OpenDAP metadata and an intuitive, Javascript-based data-request construction form. | My goal is to create a Javascript API for accessing OpenDAP metadata and an intuitive, Javascript-based data-request construction form. | ||
'''Please note:''' | '''Please note:''' This is a proposal for a Google Summer of Code project. It was not implemented. | ||
== Plan of action == | == Plan of action == |
Latest revision as of 18:45, 12 February 2016
My goal is to create a Javascript API for accessing OpenDAP metadata and an intuitive, Javascript-based data-request construction form.
Please note: This is a proposal for a Google Summer of Code project. It was not implemented.
Plan of action
- Create API for accessing geographical and time data with Javascript by modifying existing BES module or adding a new one
- Create Javascript library for easily accessing OpenDAP metadata
- Write asynchronous metadata retrieval interface
- Write metadata parser
- Write JSON emitter
- Create data request form constructor using metadata bridge
- Write basic form constructor to build simple but clear HTML forms
- Add more advanced form controls (maps, timelines, etc.) for more capable browsers
Execution path
- User requests data-request form
- Server sends simple HTML page with form-generation Javascript
- Javascript requests DDS and DAS for selected data
- Javascript parses DDS and DAS to generate HTML form
- User requests data through form
- Server returns user-selected data
Application structure
Form generator
Public interface
The public interface gives developers a dead-simple interface to create data-specific request forms.
createDataRequestForm({"url" : "http://test.com/data.gz", "containerID" : "requestform"});
Generator
The heart of the form generator transforms the JSON-encoded DAS and DDS into an interactive HTML form.
var generator = createFormGenerator();
var form = generator.generateForm(dasData, ddsData);
document.appendChild(form);
DAS/DDS Javascript API
Public interface
The public interface allows developers to easily fetch JSON-encoded DAS and DDS data from a data source.
var dasData = fetchDAS("http://test.com/data.gz");
var ddsData = fetchDDS("http://test.com/data.gz");
HTTP request generator
This critical piece will handle fetching the raw DAS or DDS data from the server.
var rawDASData = fetch({"url" : "http://test.com/data.gz.das", "callback" : onDataReceived});
DAS parser
The DAS parser will convert the raw DAS data into a Javascript-accessible JSON object.
var dasParser = createDASParser();
var dasData = dasParser.parse(rawDASData);
DDS parser
Like the DAS parser, the DDS parser will translate a raw DDS string into a JSON object.
var ddsParser = createDDSParser();
var ddsData = ddsParser.parse(rawDDSData);