Commit 8569c867 authored by Sebastien Robin's avatar Sebastien Robin

rename applicationname to application_name

parent d7efabc2
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
// so {type:'dummyall3tries',a:'b'} differs from // so {type:'dummyall3tries',a:'b'} differs from
// {type:'dummyall3tries',c:'d'}. // {type:'dummyall3tries',c:'d'}.
that.specToStore = function () { that.specToStore = function () {
return {"applicationname": spec.applicationname}; return {"application_name": spec.application_name};
}; };
priv.doJob = function (command,if_ok_return) { priv.doJob = function (command,if_ok_return) {
......
...@@ -23,8 +23,8 @@ var newDAVStorage = function ( spec, my ) { ...@@ -23,8 +23,8 @@ var newDAVStorage = function ( spec, my ) {
priv.username = spec.username || ''; priv.username = spec.username || '';
priv.secured_username = priv.convertSlashes(priv.username); priv.secured_username = priv.convertSlashes(priv.username);
priv.applicationname = spec.applicationname || 'untitled'; priv.application_name = spec.application_name || 'untitled';
priv.secured_applicationname = priv.convertSlashes(priv.applicationname); priv.secured_application_name = priv.convertSlashes(priv.application_name);
priv.url = spec.url || ''; priv.url = spec.url || '';
priv.password = spec.password || ''; // TODO : is it secured ? priv.password = spec.password || ''; // TODO : is it secured ?
...@@ -32,7 +32,7 @@ var newDAVStorage = function ( spec, my ) { ...@@ -32,7 +32,7 @@ var newDAVStorage = function ( spec, my ) {
that.serialized = function() { that.serialized = function() {
var o = super_serialized(); var o = super_serialized();
o.username = priv.username; o.username = priv.username;
o.applicationname = priv.applicationname; o.application_name = priv.application_name;
o.url = priv.url; o.url = priv.url;
o.password = priv.password; // TODO : not realy secured... o.password = priv.password; // TODO : not realy secured...
return o; return o;
...@@ -82,7 +82,7 @@ var newDAVStorage = function ( spec, my ) { ...@@ -82,7 +82,7 @@ var newDAVStorage = function ( spec, my ) {
$.ajax ( { $.ajax ( {
url: priv.url + '/' + url: priv.url + '/' +
priv.secured_username + '/' + priv.secured_username + '/' +
priv.secured_applicationname + '/' + priv.secured_application_name + '/' +
secured_docid + '?_=' + Date.now(), // to make url unique! secured_docid + '?_=' + Date.now(), // to make url unique!
// and avoid chrome PUT on cache ! // and avoid chrome PUT on cache !
type: type, type: type,
...@@ -127,7 +127,7 @@ var newDAVStorage = function ( spec, my ) { ...@@ -127,7 +127,7 @@ var newDAVStorage = function ( spec, my ) {
$.ajax ( { $.ajax ( {
url: priv.url + '/' + url: priv.url + '/' +
priv.secured_username + '/' + priv.secured_username + '/' +
priv.secured_applicationname + '/' + priv.secured_application_name + '/' +
secured_docid + '?_=' + Date.now(), secured_docid + '?_=' + Date.now(),
type: "GET", type: "GET",
async: true, async: true,
...@@ -163,7 +163,7 @@ var newDAVStorage = function ( spec, my ) { ...@@ -163,7 +163,7 @@ var newDAVStorage = function ( spec, my ) {
$.ajax ( { $.ajax ( {
url: priv.url + '/' + url: priv.url + '/' +
priv.secured_username + '/' + priv.secured_username + '/' +
priv.secured_applicationname + '/' + priv.secured_application_name + '/' +
secured_docid + '?_=' + Date.now(), secured_docid + '?_=' + Date.now(),
type: "PROPFIND", type: "PROPFIND",
async: true, async: true,
...@@ -217,7 +217,7 @@ var newDAVStorage = function ( spec, my ) { ...@@ -217,7 +217,7 @@ var newDAVStorage = function ( spec, my ) {
$.ajax ( { $.ajax ( {
url: priv.url + '/' + url: priv.url + '/' +
priv.secured_username + '/' + priv.secured_username + '/' +
priv.secured_applicationname + '/' + priv.secured_application_name + '/' +
priv.secureDocId(file.id) + '?_=' + Date.now(), priv.secureDocId(file.id) + '?_=' + Date.now(),
type: "GET", type: "GET",
async: true, async: true,
...@@ -245,7 +245,7 @@ var newDAVStorage = function ( spec, my ) { ...@@ -245,7 +245,7 @@ var newDAVStorage = function ( spec, my ) {
$.ajax ( { $.ajax ( {
url: priv.url + '/' + url: priv.url + '/' +
priv.secured_username + '/' + priv.secured_username + '/' +
priv.secured_applicationname + '/' + '?_=' + Date.now(), priv.secured_application_name + '/' + '?_=' + Date.now(),
async: true, async: true,
type: 'PROPFIND', type: 'PROPFIND',
dataType: 'xml', dataType: 'xml',
...@@ -341,7 +341,7 @@ var newDAVStorage = function ( spec, my ) { ...@@ -341,7 +341,7 @@ var newDAVStorage = function ( spec, my ) {
$.ajax ( { $.ajax ( {
url: priv.url + '/' + url: priv.url + '/' +
priv.secured_username + '/' + priv.secured_username + '/' +
priv.secured_applicationname + '/' + priv.secured_application_name + '/' +
secured_docid + '?_=' + Date.now(), secured_docid + '?_=' + Date.now(),
type: "DELETE", type: "DELETE",
async: true, async: true,
......
...@@ -28,10 +28,10 @@ var newLocalStorage = function (spec, my) { ...@@ -28,10 +28,10 @@ var newLocalStorage = function (spec, my) {
// attributes // attributes
priv.username = spec.username || ''; priv.username = spec.username || '';
priv.applicationname = spec.applicationname || 'untitled'; priv.application_name = spec.application_name || 'untitled';
priv.localpath = 'jio/localstorage/' + priv.localpath = 'jio/localstorage/' +
priv.username + '/' + priv.applicationname; priv.username + '/' + priv.application_name;
// ==================== Tools ==================== // ==================== Tools ====================
/** /**
...@@ -75,7 +75,7 @@ var newLocalStorage = function (spec, my) { ...@@ -75,7 +75,7 @@ var newLocalStorage = function (spec, my) {
// ===================== overrides ====================== // ===================== overrides ======================
that.specToStore = function () { that.specToStore = function () {
return { return {
"applicationname": priv.applicationname, "application_name": priv.application_name,
"username": priv.username "username": priv.username
}; };
}; };
......
...@@ -15,7 +15,7 @@ var jioNamespace = (function(spec) { ...@@ -15,7 +15,7 @@ var jioNamespace = (function(spec) {
* - {object} spec.storage: A storage description * - {object} spec.storage: A storage description
* - {string} spec.storage.type: The storage type * - {string} spec.storage.type: The storage type
* - {string} spec.storage.username: The user name * - {string} spec.storage.username: The user name
* - {string} spec.storage.applicationname: The application name * - {string} spec.storage.application_name: The application name
* @return {object} The new Jio instance. * @return {object} The new Jio instance.
*/ */
Object.defineProperty(that,"newJio",{ Object.defineProperty(that,"newJio",{
......
...@@ -725,7 +725,7 @@ test ("Restore old Jio", function() { ...@@ -725,7 +725,7 @@ test ("Restore old Jio", function() {
o.jio = JIO.newJio({ o.jio = JIO.newJio({
"type": "dummyall3tries", "type": "dummyall3tries",
"applicationname": "jiotests" "application_name": "jiotests"
}); });
o.jio_id = o.jio.getId(); o.jio_id = o.jio.getId();
...@@ -737,7 +737,7 @@ test ("Restore old Jio", function() { ...@@ -737,7 +737,7 @@ test ("Restore old Jio", function() {
o.jio = JIO.newJio({ o.jio = JIO.newJio({
"type": "dummyallok", "type": "dummyallok",
"applicationname": "jiotests" "application_name": "jiotests"
}); });
o.waitUntilAJobExists(30000); // timeout 30 sec o.waitUntilAJobExists(30000); // timeout 30 sec
o.testLastJobLabel("put", "Job restored"); o.testLastJobLabel("put", "Job restored");
...@@ -758,7 +758,7 @@ test ("Post", function(){ ...@@ -758,7 +758,7 @@ test ("Post", function(){
o.jio = JIO.newJio({ o.jio = JIO.newJio({
"type": "local", "type": "local",
"username": "upost", "username": "upost",
"applicationname": "apost" "application_name": "apost"
}); });
// post without id // post without id
...@@ -796,7 +796,7 @@ test ("Put", function(){ ...@@ -796,7 +796,7 @@ test ("Put", function(){
o.jio = JIO.newJio({ o.jio = JIO.newJio({
"type": "local", "type": "local",
"username": "uput", "username": "uput",
"applicationname": "aput" "application_name": "aput"
}); });
// put without id // put without id
...@@ -846,7 +846,7 @@ test ("PutAttachment", function(){ ...@@ -846,7 +846,7 @@ test ("PutAttachment", function(){
o.jio = JIO.newJio({ o.jio = JIO.newJio({
"type": "local", "type": "local",
"username": "uputattmt", "username": "uputattmt",
"applicationname": "aputattmt" "application_name": "aputattmt"
}); });
// putAttachment without doc id // putAttachment without doc id
...@@ -943,7 +943,7 @@ test ("Get", function(){ ...@@ -943,7 +943,7 @@ test ("Get", function(){
o.jio = JIO.newJio({ o.jio = JIO.newJio({
"type": "local", "type": "local",
"username": "uget", "username": "uget",
"applicationname": "aget" "application_name": "aget"
}); });
// get inexistent document // get inexistent document
...@@ -1000,7 +1000,7 @@ test ("Remove", function(){ ...@@ -1000,7 +1000,7 @@ test ("Remove", function(){
o.jio = JIO.newJio({ o.jio = JIO.newJio({
"type": "local", "type": "local",
"username": "uremove", "username": "uremove",
"applicationname": "aremove" "application_name": "aremove"
}); });
// remove inexistent document // remove inexistent document
...@@ -1063,7 +1063,7 @@ test ("AllDocs", function(){ ...@@ -1063,7 +1063,7 @@ test ("AllDocs", function(){
o.jio = JIO.newJio({ o.jio = JIO.newJio({
"type": "local", "type": "local",
"username": "ualldocs", "username": "ualldocs",
"applicationname": "aalldocs" "application_name": "aalldocs"
}); });
// alldocs // alldocs
...@@ -1087,7 +1087,7 @@ test ("Post", function(){ ...@@ -1087,7 +1087,7 @@ test ("Post", function(){
"sub_storage": { "sub_storage": {
"type": "local", "type": "local",
"username": "urevpost", "username": "urevpost",
"applicationname": "arevpost" "application_name": "arevpost"
} }
}); });
...@@ -1159,7 +1159,7 @@ test ("Put", function(){ ...@@ -1159,7 +1159,7 @@ test ("Put", function(){
"sub_storage": { "sub_storage": {
"type": "local", "type": "local",
"username": "urevput", "username": "urevput",
"applicationname": "arevput" "application_name": "arevput"
} }
}); });
...@@ -1218,7 +1218,7 @@ test ("Get", function(){ ...@@ -1218,7 +1218,7 @@ test ("Get", function(){
"sub_storage": { "sub_storage": {
"type": "local", "type": "local",
"username": "urevget", "username": "urevget",
"applicationname": "arevget" "application_name": "arevget"
} }
}); });
o.localpath = "jio/localstorage/urevget/arevget"; o.localpath = "jio/localstorage/urevget/arevget";
...@@ -1372,7 +1372,7 @@ test ("Remove", function(){ ...@@ -1372,7 +1372,7 @@ test ("Remove", function(){
"sub_storage": { "sub_storage": {
"type": "local", "type": "local",
"username": "urevrem", "username": "urevrem",
"applicationname": "arevrem" "application_name": "arevrem"
} }
}); });
o.localpath = "jio/localstorage/urevrem/arevrem"; o.localpath = "jio/localstorage/urevrem/arevrem";
...@@ -1575,7 +1575,7 @@ test ("Scenario", function(){ ...@@ -1575,7 +1575,7 @@ test ("Scenario", function(){
"sub_storage": { "sub_storage": {
"type": "local", "type": "local",
"username": "usam1", "username": "usam1",
"applicationname": "asam1" "application_name": "asam1"
} }
}); });
o.localpath = "jio/localstorage/usam1/asam1"; o.localpath = "jio/localstorage/usam1/asam1";
...@@ -1601,7 +1601,7 @@ test ("Scenario", function(){ ...@@ -1601,7 +1601,7 @@ test ("Scenario", function(){
"sub_storage": { "sub_storage": {
"type": "local", "type": "local",
"username": "usam1", "username": "usam1",
"applicationname": "asam1" "application_name": "asam1"
} }
}); });
o.localpath = "jio/localstorage/usam1/asam1"; o.localpath = "jio/localstorage/usam1/asam1";
...@@ -1658,7 +1658,7 @@ test ("Scenario", function(){ ...@@ -1658,7 +1658,7 @@ test ("Scenario", function(){
"sub_storage": { "sub_storage": {
"type": "local", "type": "local",
"username": "usam1", "username": "usam1",
"applicationname": "asam1" "application_name": "asam1"
} }
}); });
o.localpath = "jio/localstorage/usam1/asam1"; o.localpath = "jio/localstorage/usam1/asam1";
...@@ -1752,7 +1752,7 @@ test ('Document load', function () { ...@@ -1752,7 +1752,7 @@ test ('Document load', function () {
o.jio = JIO.newJio({type:'dav',username:'davload', o.jio = JIO.newJio({type:'dav',username:'davload',
password:'checkpwd', password:'checkpwd',
url:'https://ca-davstorage:8080', url:'https://ca-davstorage:8080',
applicationname:'jiotests'}); application_name:'jiotests'});
// note: http errno: // note: http errno:
// 200 OK // 200 OK
// 201 Created // 201 Created
...@@ -1817,7 +1817,7 @@ test ('Document save', function () { ...@@ -1817,7 +1817,7 @@ test ('Document save', function () {
o.jio = JIO.newJio({type:'dav',username:'davsave', o.jio = JIO.newJio({type:'dav',username:'davsave',
password:'checkpwd', password:'checkpwd',
url:'https://ca-davstorage:8080', url:'https://ca-davstorage:8080',
applicationname:'jiotests'}); application_name:'jiotests'});
// note: http errno: // note: http errno:
// 200 OK // 200 OK
// 201 Created // 201 Created
...@@ -1884,7 +1884,7 @@ test ('Get Document List', function () { ...@@ -1884,7 +1884,7 @@ test ('Get Document List', function () {
o.jio = JIO.newJio({type:'dav',username:'davlist', o.jio = JIO.newJio({type:'dav',username:'davlist',
password:'checkpwd', password:'checkpwd',
url:'https://ca-davstorage:8080', url:'https://ca-davstorage:8080',
applicationname:'jiotests'}); application_name:'jiotests'});
o.mytest('fail to get list',true,undefined,404); o.mytest('fail to get list',true,undefined,404);
o.mytest('getting list',true,[{ o.mytest('getting list',true,[{
id:'file',key:'file', id:'file',key:'file',
...@@ -1949,7 +1949,7 @@ test ('Remove document', function () { ...@@ -1949,7 +1949,7 @@ test ('Remove document', function () {
o.jio = JIO.newJio({type:'dav',username:'davremove', o.jio = JIO.newJio({type:'dav',username:'davremove',
password:'checkpwd', password:'checkpwd',
url:'https://ca-davstorage:8080', url:'https://ca-davstorage:8080',
applicationname:'jiotests'}); application_name:'jiotests'});
o.mytest('remove document',{ok:true,id:'file'},204); o.mytest('remove document',{ok:true,id:'file'},204);
o.mytest('remove an already removed document',404,404); o.mytest('remove an already removed document',404,404);
...@@ -2247,7 +2247,7 @@ test ('Document save' , function () { ...@@ -2247,7 +2247,7 @@ test ('Document save' , function () {
password:'mypwd', password:'mypwd',
storage:{type:'local', storage:{type:'local',
username:'cryptsavelocal', username:'cryptsavelocal',
applicationname:'jiotests'}}); application_name:'jiotests'}});
o.f = function (err,val) { o.f = function (err,val) {
if (err) { if (err) {
err = err.status; err = err.status;
...@@ -2282,7 +2282,7 @@ test ('Document load' , function () { ...@@ -2282,7 +2282,7 @@ test ('Document load' , function () {
password:'mypwd', password:'mypwd',
storage:{type:'local', storage:{type:'local',
username:'cryptloadlocal', username:'cryptloadlocal',
applicationname:'jiotests'}}); application_name:'jiotests'}});
o.f = function (err,val) { o.f = function (err,val) {
deepEqual (err || val,{ deepEqual (err || val,{
_id:'testload',content:'contentoftest', _id:'testload',content:'contentoftest',
...@@ -2312,7 +2312,7 @@ test ('Get Document List', function () { ...@@ -2312,7 +2312,7 @@ test ('Get Document List', function () {
password:'mypwd', password:'mypwd',
storage:{type:'local', storage:{type:'local',
username:'cryptgetlistlocal', username:'cryptgetlistlocal',
applicationname:'jiotests'}}); application_name:'jiotests'}});
o.f = function (err,val) { o.f = function (err,val) {
deepEqual (err || objectifyDocumentArray(val.rows), deepEqual (err || objectifyDocumentArray(val.rows),
objectifyDocumentArray(o.doc_list),'Getting list'); objectifyDocumentArray(o.doc_list),'Getting list');
...@@ -2367,7 +2367,7 @@ test ('Remove document', function () { ...@@ -2367,7 +2367,7 @@ test ('Remove document', function () {
password:'mypwd', password:'mypwd',
storage:{type:'local', storage:{type:'local',
username:'cryptremovelocal', username:'cryptremovelocal',
applicationname:'jiotests'}}); application_name:'jiotests'}});
o.f = function (err,val) { o.f = function (err,val) {
deepEqual (err || val,{ok:true,id:'file'},'Document remove'); deepEqual (err || val,{ok:true,id:'file'},'Document remove');
}; };
...@@ -2413,7 +2413,7 @@ test ('Simple methods', function () { ...@@ -2413,7 +2413,7 @@ test ('Simple methods', function () {
username:'methods', username:'methods',
storage:{type:'local', storage:{type:'local',
username:'conflictmethods', username:'conflictmethods',
applicationname:'jiotests'}}); application_name:'jiotests'}});
// PUT // PUT
o.spy({ok:true,id:'file.doc',rev:'1'},'saving "file.doc".'); o.spy({ok:true,id:'file.doc',rev:'1'},'saving "file.doc".');
o.jio.put({_id:'file.doc',content:'content1'},function (err,val) { o.jio.put({_id:'file.doc',content:'content1'},function (err,val) {
...@@ -2588,7 +2588,7 @@ test ('Revision Conflict', function() { ...@@ -2588,7 +2588,7 @@ test ('Revision Conflict', function() {
}; };
o.sub_storage_spec = {type:'local', o.sub_storage_spec = {type:'local',
username:'revisionconflict', username:'revisionconflict',
applicationname:'jiotests'} application_name:'jiotests'}
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
o.jio = JIO.newJio({type:'conflictmanager', o.jio = JIO.newJio({type:'conflictmanager',
storage:o.sub_storage_spec}); storage:o.sub_storage_spec});
...@@ -2752,7 +2752,7 @@ test ('Conflict in a conflict solving', function () { ...@@ -2752,7 +2752,7 @@ test ('Conflict in a conflict solving', function () {
}; };
o.sub_storage_spec = {type:'local', o.sub_storage_spec = {type:'local',
username:'conflictconflict', username:'conflictconflict',
applicationname:'jiotests'} application_name:'jiotests'}
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
o.jio = JIO.newJio({type:'conflictmanager', o.jio = JIO.newJio({type:'conflictmanager',
storage:o.sub_storage_spec}); storage:o.sub_storage_spec});
...@@ -2939,7 +2939,7 @@ test ('Remove revision conflict', function () { ...@@ -2939,7 +2939,7 @@ test ('Remove revision conflict', function () {
}; };
o.sub_storage_spec = {type:'local', o.sub_storage_spec = {type:'local',
username:'removeconflict', username:'removeconflict',
applicationname:'jiotests'} application_name:'jiotests'}
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
o.jio = JIO.newJio({type:'conflictmanager', o.jio = JIO.newJio({type:'conflictmanager',
storage:o.sub_storage_spec}); storage:o.sub_storage_spec});
...@@ -3169,7 +3169,7 @@ test ('Load Revisions', function () { ...@@ -3169,7 +3169,7 @@ test ('Load Revisions', function () {
o.tick = basic_tick_function; o.tick = basic_tick_function;
o.sub_storage_spec = {type:'local', o.sub_storage_spec = {type:'local',
username:'loadrevisions', username:'loadrevisions',
applicationname:'jiotests'} application_name:'jiotests'}
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
o.jio = JIO.newJio({type:'conflictmanager', o.jio = JIO.newJio({type:'conflictmanager',
storage:o.sub_storage_spec}); storage:o.sub_storage_spec});
...@@ -3190,7 +3190,7 @@ test ('Get revision List', function () { ...@@ -3190,7 +3190,7 @@ test ('Get revision List', function () {
o.tick = basic_tick_function; o.tick = basic_tick_function;
o.sub_storage_spec = {type:'local', o.sub_storage_spec = {type:'local',
username:'getrevisionlist', username:'getrevisionlist',
applicationname:'jiotests'} application_name:'jiotests'}
o.rev = {}; o.rev = {};
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
o.jio = JIO.newJio({type:'conflictmanager', o.jio = JIO.newJio({type:'conflictmanager',
......
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