Commit 131452c4 authored by Alexandra Rogova's avatar Alexandra Rogova

union storage test

parent f8e8422e
...@@ -2,10 +2,11 @@ ...@@ -2,10 +2,11 @@
<html> <html>
<head> <head>
<title>Jio parser test</title> <title>Jio parser test</title>
<script src="../jio/external/rsvp-2.0.4.js"></script> <script src="../jio/external/rsvp-2.0.4.js"></script>
<script src="../jio/dist/jio-latest.js"></script> <script src="../jio/dist/jio-latest.js"></script>
<script src="../renderjs/dist/renderjs-latest.js"></script> <script src="../renderjs/dist/renderjs-latest.js"></script>
<script src="jio.my_parser_storage.js"></script> <script src="jio.my_parser_storage.js"></script>
<script src="jio.my_union_storage.js"></script>
<script src="jio-parser-test.js"></script> <script src="jio-parser-test.js"></script>
</head> </head>
<body> <body>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
.ready(function(){ .ready(function(){
var gadget = this; var gadget = this;
gadget.test_storage = jIO.createJIO({ var tmp = {
type : "my_parser", type : "my_parser",
document_id : "doc_id", document_id : "doc_id",
attachment_id :"att_id", attachment_id :"att_id",
...@@ -17,9 +17,55 @@ ...@@ -17,9 +17,55 @@
type : "indexeddb", type : "indexeddb",
database : "test" database : "test"
} }
}
gadget.test_storage_1 = jIO.createJIO(tmp);
gadget.test_storage_2 = jIO.createJIO({
type :"my_parser",
document_id : "doc_id",
attachment_id : "att2_id",
parser : "rss",
sub_storage : {
type : "indexeddb",
database : "test"
}
});
gadget.union_test = jIO.createJIO({
type : 'union',
"storage_list": [
tmp
]
}); });
console.log(gadget.union_test);
console.log(gadget.union_test.addSubStorage);
/*return gadget.test_storage_1.put("doc_id", {})
.push(function(){
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.status == 200 && xmlhttp.readyState == 4){
return gadget.test_storage_1.putAttachment("doc_id", "att_id", new Blob([xmlhttp.responseText], {type: "text/xml"}))
.push (function(){
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.status == 200 && xmlhttp.readyState == 4){
return gadget.test_storage_2.putAttachment("doc_id", "att2_id", new Blob([xmlhttp.responseText], {type: "text/xml"}));
}
}
xmlhttp.open("GET", "./test-files/allemandfacile.rss", true);
xmlhttp.send();
})
}
}
xmlhttp.open("GET", "./test-files/vivelessvt.rss", true);
xmlhttp.send();
});*/
return gadget.test_storage.put("doc_id", {}) /*return gadget.test_storage_1.put("doc_id", {})
.push (function(){ .push (function(){
var xmlhttp = new XMLHttpRequest(); var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() { xmlhttp.onreadystatechange = function() {
...@@ -49,7 +95,7 @@ ...@@ -49,7 +95,7 @@
} }
xmlhttp.open("GET", "./test-files/vivelessvt.rss", true); xmlhttp.open("GET", "./test-files/vivelessvt.rss", true);
xmlhttp.send(); xmlhttp.send();
}); });*/
}); });
}(window, RSVP, rJS, jIO)); }(window, RSVP, rJS, jIO));
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