Commit 6c1b3828 authored by Roque Porchetto's avatar Roque Porchetto

Embulk ingestion script.

parent 6463376b
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<title>INGESTION ACCESS</title>
<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<!-- custom script
<script src="gadget_global.js" type="text/javascript"></script> -->
<script src="gadget_erp5_ingestion_access.js" type="text/javascript"></script>
</head>
<body>
<form name='download'>
<input type="submit" value="Download script for ingestion" />
<span style="margin-left:30px" > RUN COMMAND: <b style="margin-left:10px" > push <i>my-data-set</i> </b> </span>
</form>
</body>
</html>
\ No newline at end of file
/*global window, rJS, RSVP, URI */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, document, RSVP, rJS,
XMLHttpRequest, location, console) {
"use strict";
function download(context, evt) {
//<a href="path/to/file" download>Click here to download</a>
//Content-Type: application/octet-stream
//Content-Disposition: attachment; filename="picture.png"
var link = document.createElement('a');
link.download = "ingestion_tool.zip";
link.href = "https://softinst75195.host.vifib.net/erp5/data_stream_module/embulk_ingestion_script/getData";
link.click();
//var url = "https://softinst75195.host.vifib.net/erp5/data_stream_module/embulk_download_script/getData";
//window.location.replace(url);
}
rJS(window)
.allowPublicAcquisition('setFillStyle', function () {
return {
height: '100%',
width: '100%'
};
})
.declareJob('download', function (evt) {
return download(this, evt);
})
.declareMethod("render", function () {
return this;
})
.onEvent('submit', function (evt) {
if (evt.target.name === 'download') {
return this.download(evt);
} else {
throw new Error('Unknown form');
}
});
}(window, document, RSVP, rJS,
XMLHttpRequest, location, console));
\ No newline at end of file
......@@ -19,9 +19,8 @@
data-gadget-scope="form_view"
data-gadget-sandbox="public">
</div>
<!--
<div style="margin-top: 40px;"> </div>
<div>
IT'S SUPPOSSED TO SHOW THE JSON META DATA HERE
</div>
-->
</body>
</html>
\ No newline at end of file
......@@ -238,7 +238,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>959.7955.3350.30600</string> </value>
<value> <string>960.12782.56737.61064</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>1493828363.3</float>
<float>1498050190.02</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -18,6 +18,11 @@
</head>
<body>
<div style="margin-top:20px" data-gadget-url="gadget_erp5_ingestion_access.html"
data-gadget-scope="ingestion_access"
data-gadget-sandbox="public">
</div>
<div class="title-red" style="margin-top: 40px;"> </div>
<div data-gadget-url="gadget_erp5_pt_form_list.html"
data-gadget-scope="form_list"
data-gadget-sandbox="public">
......
......@@ -80,6 +80,12 @@
]]
}
});
})
.push(function () {
return gadget.getDeclaredGadget("ingestion_access");
})
.push(function (my_gadget) {
return my_gadget.render();
});
});
}(window, rJS));
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment