Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/Proxy') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.DataStore.js | 4 | ||||
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Test.js | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.DataStore.js b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.DataStore.js index 326022c..b806cb7 100644 --- a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.DataStore.js +++ b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.DataStore.js | |||
@@ -268,33 +268,33 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, { | |||
268 | result = { | 268 | result = { |
269 | toll: this.getTollForRequestType(someParameters['requestType']) | 269 | toll: this.getTollForRequestType(someParameters['requestType']) |
270 | } | 270 | } |
271 | 271 | ||
272 | return result; | 272 | return result; |
273 | }, | 273 | }, |
274 | 274 | ||
275 | //------------------------------------------------------------------------- | 275 | //------------------------------------------------------------------------- |
276 | 276 | ||
277 | '_registration': function(aConnection, someParameters) { | 277 | '_registration': function(aConnection, someParameters) { |
278 | if (this.isReadOnly() == false) { | 278 | if (this.isReadOnly() == false) { |
279 | if (typeof(this.data()['users'][someParameters['credentials']['C']]) == 'undefined') { | 279 | if (typeof(this.data()['users'][someParameters['credentials']['C']]) == 'undefined') { |
280 | this.data()['users'][someParameters['credentials']['C']] = { | 280 | this.data()['users'][someParameters['credentials']['C']] = { |
281 | 's': someParameters['credentials']['s'], | 281 | 's': someParameters['credentials']['s'], |
282 | 'v': someParameters['credentials']['v'], | 282 | 'v': someParameters['credentials']['v'], |
283 | 'version':someParameters['credentials']['version'], | 283 | 'version':someParameters['credentials']['version'], |
284 | 'lock': Clipperz.Crypto.Base.generateRandomSeed(), | 284 | // 'lock': Clipperz.Crypto.Base.generateRandomSeed(), |
285 | 'userDetails': someParameters['user']['header'], | 285 | 'userDetails': someParameters['user']['header'], |
286 | 'statistics': someParameters['user']['statistics'], | 286 | 'statistics': someParameters['user']['statistics'], |
287 | 'userDetailsVersion':someParameters['user']['version'], | 287 | 'userDetailsVersion':someParameters['user']['version'], |
288 | 'records':{} | 288 | 'records':{} |
289 | } | 289 | } |
290 | } else { | 290 | } else { |
291 | throw "user already exists"; | 291 | throw "user already exists"; |
292 | } | 292 | } |
293 | } else { | 293 | } else { |
294 | throw Clipperz.PM.Proxy.Offline.DataStore.exception.ReadOnly; | 294 | throw Clipperz.PM.Proxy.Offline.DataStore.exception.ReadOnly; |
295 | } | 295 | } |
296 | 296 | ||
297 | result = { | 297 | result = { |
298 | result: { | 298 | result: { |
299 | 'lock': this.data()['users'][someParameters['credentials']['C']]['lock'], | 299 | 'lock': this.data()['users'][someParameters['credentials']['C']]['lock'], |
300 | 'result':'done' | 300 | 'result':'done' |
@@ -556,33 +556,33 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, { | |||
556 | result['lock'] = this.userData()['lock']; | 556 | result['lock'] = this.userData()['lock']; |
557 | result['result'] = 'done'; | 557 | result['result'] = 'done'; |
558 | } else { | 558 | } else { |
559 | throw Clipperz.PM.Proxy.Offline.DataStore.exception.ReadOnly; | 559 | throw Clipperz.PM.Proxy.Offline.DataStore.exception.ReadOnly; |
560 | } | 560 | } |
561 | */ //===================================================================== | 561 | */ //===================================================================== |
562 | } else if (someParameters.message == 'saveChanges') { | 562 | } else if (someParameters.message == 'saveChanges') { |
563 | if (this.isReadOnly() == false) { | 563 | if (this.isReadOnly() == false) { |
564 | var i, c; | 564 | var i, c; |
565 | 565 | ||
566 | if (aConnection['userData']['lock']!= someParameters['parameters']['user']['lock']) { | 566 | if (aConnection['userData']['lock']!= someParameters['parameters']['user']['lock']) { |
567 | throw "the lock attribute is not processed correctly" | 567 | throw "the lock attribute is not processed correctly" |
568 | } | 568 | } |
569 | 569 | ||
570 | aConnection['userData']['userDetails'] = someParameters['parameters']['user']['header']; | 570 | aConnection['userData']['userDetails'] = someParameters['parameters']['user']['header']; |
571 | aConnection['userData']['statistics'] = someParameters['parameters']['user']['statistics']; | 571 | aConnection['userData']['statistics'] = someParameters['parameters']['user']['statistics']; |
572 | aConnection['userData']['userDetailsVersions']= someParameters['parameters']['user']['version']; | 572 | aConnection['userData']['userDetailsVersion']= someParameters['parameters']['user']['version']; |
573 | 573 | ||
574 | c = someParameters['parameters']['records']['updated'].length; | 574 | c = someParameters['parameters']['records']['updated'].length; |
575 | for (i=0; i<c; i++) { | 575 | for (i=0; i<c; i++) { |
576 | var currentRecord; | 576 | var currentRecord; |
577 | var currentRecordData; | 577 | var currentRecordData; |
578 | 578 | ||
579 | currentRecordData = someParameters['parameters']['records']['updated'][i]; | 579 | currentRecordData = someParameters['parameters']['records']['updated'][i]; |
580 | currentRecord = aConnection['userData']['records'][currentRecordData['record']['reference']]; | 580 | currentRecord = aConnection['userData']['records'][currentRecordData['record']['reference']]; |
581 | 581 | ||
582 | if ( | 582 | if ( |
583 | (typeof(aConnection['userData']['records'][currentRecordData['record']['reference']]) == 'undefined') | 583 | (typeof(aConnection['userData']['records'][currentRecordData['record']['reference']]) == 'undefined') |
584 | && | 584 | && |
585 | (typeof(currentRecordData['currentRecordVersion']) == 'undefined') | 585 | (typeof(currentRecordData['currentRecordVersion']) == 'undefined') |
586 | ) { | 586 | ) { |
587 | throw "Record added without a recordVersion"; | 587 | throw "Record added without a recordVersion"; |
588 | } | 588 | } |
diff --git a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Test.js b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Test.js index d459726..1a860c5 100644 --- a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Test.js +++ b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Test.js | |||
@@ -130,27 +130,32 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Test, Clipperz.PM.Proxy.Offline, { | |||
130 | } catch(exception) { | 130 | } catch(exception) { |
131 | throw "Proxy.Test.sentMessage[" + expectedRequest.name + "]: " + exception; | 131 | throw "Proxy.Test.sentMessage[" + expectedRequest.name + "]: " + exception; |
132 | } | 132 | } |
133 | } | 133 | } |
134 | }, | 134 | }, |
135 | 135 | ||
136 | //========================================================================= | 136 | //========================================================================= |
137 | 137 | ||
138 | 'sendMessage': function(aFunctionName, someParameters) { | 138 | 'sendMessage': function(aFunctionName, someParameters) { |
139 | var result; | 139 | var result; |
140 | 140 | ||
141 | if (this.isExpectingRequests() == false) { | 141 | if (this.isExpectingRequests() == false) { |
142 | // throw Clipperz.PM.Connection.exception.UnexpectedRequest; | 142 | // throw Clipperz.PM.Connection.exception.UnexpectedRequest; |
143 | Clipperz.log("UNEXPECTED REQUEST " + aFunctionName /* + ": " + Clipperz.Base.serializeJSON(someParameters) */); | 143 | Clipperz.log("UNEXPECTED REQUEST " + aFunctionName /* + ": " + Clipperz.Base.serializeJSON(someParameters) */); |
144 | this.unexpectedRequests().push({'functionName':aFunctionName, 'someParameters': someParameters}); | 144 | this.unexpectedRequests().push({'functionName':aFunctionName, 'someParameters': someParameters}); |
145 | }; | 145 | }; |
146 | //if (aFunctionName == 'knock') { | ||
147 | //console.log(">>> send message - " + aFunctionName, someParameters); | ||
148 | //} else { | ||
149 | //console.log(">>> SEND MESSAGE - " + aFunctionName + " [" + someParameters['parameters']['message'] + "]", someParameters['parameters']['parameters']); | ||
150 | //} | ||
146 | this.checkRequest(aFunctionName, someParameters); | 151 | this.checkRequest(aFunctionName, someParameters); |
147 | result = Clipperz.PM.Proxy.Test.superclass.sendMessage.call(this, aFunctionName, someParameters); | 152 | result = Clipperz.PM.Proxy.Test.superclass.sendMessage.call(this, aFunctionName, someParameters); |
148 | 153 | ||
149 | return result; | 154 | return result; |
150 | }, | 155 | }, |
151 | 156 | ||
152 | //========================================================================= | 157 | //========================================================================= |
153 | __syntaxFix__: "syntax fix" | 158 | __syntaxFix__: "syntax fix" |
154 | 159 | ||
155 | }); | 160 | }); |
156 | 161 | ||