From dc15682a27a59df38425f3dd261d90ce6d9fdaef Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Wed, 10 Aug 2011 12:38:03 +0100 Subject: [PATCH] changed name of getMapped*4 functions to create*IfNotExistsFor --- node/db/API.js | 4 ++-- node/db/AuthorManager.js | 2 +- node/db/GroupManager.js | 2 +- node/handler/APIHandler.js | 4 ++-- static/tests.html | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/node/db/API.js b/node/db/API.js index 54652035..3fcaafeb 100644 --- a/node/db/API.js +++ b/node/db/API.js @@ -31,7 +31,7 @@ var async = require("async"); /**********************/ exports.createGroup = groupManager.createGroup; -exports.getMappedGroup4 = groupManager.getMappedGroup4; +exports.createGroupIfNotExistsFor = groupManager.createGroupIfNotExistsFor; exports.deleteGroup = groupManager.deleteGroup; exports.listPads = groupManager.listPads; exports.createGroupPad = groupManager.createGroupPad; @@ -41,7 +41,7 @@ exports.createGroupPad = groupManager.createGroupPad; /**********************/ exports.createAuthor = authorManager.createAuthor; -exports.getMappedAuthor4 = authorManager.getMappedAuthor4; +exports.createAuthorIfNotExistsFor = authorManager.createAuthorIfNotExistsFor; /**********************/ /**SESSION FUNCTIONS***/ diff --git a/node/db/AuthorManager.js b/node/db/AuthorManager.js index 5354d48e..f93ebb68 100644 --- a/node/db/AuthorManager.js +++ b/node/db/AuthorManager.js @@ -52,7 +52,7 @@ exports.getAuthor4Token = function (token, callback) * @param {String} token The mapper * @param {Function} callback callback (err, author) */ -exports.getMappedAuthor4 = function (authorMapper, name, callback) +exports.createAuthorIfNotExistsFor = function (authorMapper, name, callback) { mapAuthorWithDBKey("mapper2author", authorMapper, function(err, author) { diff --git a/node/db/GroupManager.js b/node/db/GroupManager.js index 10e73ed1..0d4ed7f1 100644 --- a/node/db/GroupManager.js +++ b/node/db/GroupManager.js @@ -71,7 +71,7 @@ exports.createGroup = function(callback) ); } -exports.getMappedGroup4 = function(groupMapper, callback) +exports.createGroupIfNotExistsFor = function(groupMapper, callback) { //ensure mapper is optional if(typeof groupMapper != "string") diff --git a/node/handler/APIHandler.js b/node/handler/APIHandler.js index ba378a9a..d41d6b4a 100644 --- a/node/handler/APIHandler.js +++ b/node/handler/APIHandler.js @@ -36,13 +36,13 @@ catch(e) //a list of all functions var functions = { "createGroup" : [], - "getMappedGroup4" : ["groupMapper"], + "createGroupIfNotExistsFor" : ["groupMapper"], // "deleteGroup" : ["groupID"], "listPads" : ["groupID"], "createPad" : ["padID", "text"], "createGroupPad" : ["groupID", "padName", "text"], "createAuthor" : ["name"], - "getMappedAuthor4" : ["authorMapper" , "name"], + "createAuthorIfNotExistsFor" : ["authorMapper" , "name"], "createSession" : ["groupID", "authorID", "validUntil"], // "deleteSession" : ["sessionID"], "getSessionInfo" : ["sessionID"], diff --git a/static/tests.html b/static/tests.html index 58dea0ff..855d1ca4 100644 --- a/static/tests.html +++ b/static/tests.html @@ -140,12 +140,12 @@
createGroup()
-
createMappedGroup4(groupMapper)
+
createGroupIfNotExistsFor(groupMapper)
listPads(groupID)
createPad(padID,text)
createGroupPad(groupID,padName,text)
createAuthor(name)
-
getMappedAuthor4(authorMapper,name)
+
createAuthorIfNotExistsFor(authorMapper,name)
createSession(groupID,authorID,validUntil)
deleteSession(sessionID)
getSessionInfo(sessionID)