summaryrefslogtreecommitdiff
path: root/frontend
authorGiulio Cesare Solaroli <giulio.cesare@clipperz.com>2011-10-23 17:36:57 (UTC)
committer Giulio Cesare Solaroli <giulio.cesare@clipperz.com>2011-10-23 17:36:57 (UTC)
commit67455b069c4c9ec493f9cef76017e172a430a7d4 (patch) (unidiff)
tree0b287debfeeb0819b3df9dd02860cd84103e25b3 /frontend
parentb312e037ebba7c94abea9661bcf62c52b7d73fbf (diff)
downloadclipperz-67455b069c4c9ec493f9cef76017e172a430a7d4.zip
clipperz-67455b069c4c9ec493f9cef76017e172a430a7d4.tar.gz
clipperz-67455b069c4c9ec493f9cef76017e172a430a7d4.tar.bz2
Integration of PHP backend with /beta and /gamma front ends
Fixed PHP backend and /beta code to handle request and data format compatible with /gamma. At the moment adding/deleting/editing records seem to work fine.
Diffstat (limited to 'frontend') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/beta/js/Clipperz/PM/DataModel/Record.js7
-rw-r--r--frontend/beta/js/Clipperz/PM/Proxy.js3
-rwxr-xr-xfrontend/beta/js/Clipperz/PM/Proxy/Proxy.PHP.js262
-rw-r--r--frontend/gamma/html/index_template.html5
-rw-r--r--frontend/gamma/js/Clipperz/Async.js19
-rw-r--r--frontend/gamma/js/Clipperz/PM/Proxy.js2
6 files changed, 26 insertions, 272 deletions
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/Record.js b/frontend/beta/js/Clipperz/PM/DataModel/Record.js
index 270f2ae..ffb45de 100644
--- a/frontend/beta/js/Clipperz/PM/DataModel/Record.js
+++ b/frontend/beta/js/Clipperz/PM/DataModel/Record.js
@@ -186,204 +186,209 @@ Clipperz.PM.DataModel.Record.prototype = MochiKit.Base.update(null, {
186 return Clipperz.Base.serializeJSON(result); 186 return Clipperz.Base.serializeJSON(result);
187 }, 187 },
188 188
189 //------------------------------------------------------------------------- 189 //-------------------------------------------------------------------------
190 190
191 'shouldLoadData': function() { 191 'shouldLoadData': function() {
192 return this._shouldLoadData; 192 return this._shouldLoadData;
193 }, 193 },
194 194
195 'setShouldLoadData': function(aValue) { 195 'setShouldLoadData': function(aValue) {
196 this._shouldLoadData = aValue; 196 this._shouldLoadData = aValue;
197 }, 197 },
198 198
199 //------------------------------------------------------------------------- 199 //-------------------------------------------------------------------------
200 200
201 'shouldDecryptData': function() { 201 'shouldDecryptData': function() {
202 return this._shouldDecryptData; 202 return this._shouldDecryptData;
203 }, 203 },
204 204
205 'setShouldDecryptData': function(aValue) { 205 'setShouldDecryptData': function(aValue) {
206 this._shouldDecryptData = aValue; 206 this._shouldDecryptData = aValue;
207 }, 207 },
208 208
209 //------------------------------------------------------------------------- 209 //-------------------------------------------------------------------------
210 210
211 'shouldProcessData': function() { 211 'shouldProcessData': function() {
212 return this._shouldProcessData; 212 return this._shouldProcessData;
213 }, 213 },
214 214
215 'setShouldProcessData': function(aValue) { 215 'setShouldProcessData': function(aValue) {
216 this._shouldProcessData = aValue; 216 this._shouldProcessData = aValue;
217 }, 217 },
218 218
219 //------------------------------------------------------------------------- 219 //-------------------------------------------------------------------------
220 220
221 'loadData': function() { 221 'loadData': function() {
222 var result; 222 var result;
223 223
224//MochiKit.Logging.logDebug(">>> [" + (new Date()).valueOf() + "] Record.loadData - this: " + this); 224//MochiKit.Logging.logDebug(">>> [" + (new Date()).valueOf() + "] Record.loadData - this: " + this);
225 if (this.shouldLoadData()) { 225 if (this.shouldLoadData()) {
226 var deferredResult; 226 var deferredResult;
227 227
228 deferredResult = new MochiKit.Async.Deferred(); 228 deferredResult = new MochiKit.Async.Deferred();
229 deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'notify', 'loadingRecordData'); 229 deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'notify', 'loadingRecordData');
230 deferredResult.addCallback(MochiKit.Base.method(this.user().connection(), 'message'), 'getRecordDetail', {reference: this.reference()}); 230 deferredResult.addCallback(MochiKit.Base.method(this.user().connection(), 'message'), 'getRecordDetail', {reference: this.reference()});
231 deferredResult.addCallback(MochiKit.Base.method(this,'setServerData')); 231 deferredResult.addCallback(MochiKit.Base.method(this,'setServerData'));
232 deferredResult.callback(); 232 deferredResult.callback();
233 result = deferredResult; 233 result = deferredResult;
234 } else { 234 } else {
235 result = MochiKit.Async.succeed(this.serverData()); 235 result = MochiKit.Async.succeed(this.serverData());
236 } 236 }
237//MochiKit.Logging.logDebug("<<< [" + (new Date()).valueOf() + "] Record.loadData"); 237//MochiKit.Logging.logDebug("<<< [" + (new Date()).valueOf() + "] Record.loadData");
238 238
239 return result; 239 return result;
240 }, 240 },
241 241
242 //------------------------------------------------------------------------- 242 //-------------------------------------------------------------------------
243 243
244 'decryptData': function(anEncryptedData) { 244 'decryptData': function(anEncryptedData) {
245 var result; 245 var result;
246 246
247//MochiKit.Logging.logDebug(">>> [" + (new Date()).valueOf() + "] Record.decryptData - this: " + this + " (" + anEncryptedData + ")"); 247//MochiKit.Logging.logDebug(">>> [" + (new Date()).valueOf() + "] Record.decryptData - this: " + this + " (" + anEncryptedData + ")");
248 if (this.shouldDecryptData()) { 248 if (this.shouldDecryptData()) {
249 var deferredResult; 249 var deferredResult;
250 250
251 deferredResult = new MochiKit.Async.Deferred(); 251 deferredResult = new MochiKit.Async.Deferred();
252 deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'notify', 'decryptingRecordData'); 252 deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'notify', 'decryptingRecordData');
253 deferredResult.addCallback(Clipperz.PM.Crypto.deferredDecrypt, this.key(), anEncryptedData['data'], anEncryptedData['version']); 253 deferredResult.addCallback(Clipperz.PM.Crypto.deferredDecrypt, this.key(), anEncryptedData['data'], anEncryptedData['version']);
254 deferredResult.addCallback(function(anEncryptedData, someDecryptedValues) { 254 deferredResult.addCallback(function(anEncryptedData, someDecryptedValues) {
255 varresult; 255 varresult;
256 256
257 result = anEncryptedData; 257 result = anEncryptedData;
258 result['data'] = someDecryptedValues; 258 result['data'] = someDecryptedValues;
259 259
260 return result; 260 return result;
261 }, anEncryptedData); 261 }, anEncryptedData);
262 deferredResult.addCallback(MochiKit.Base.method(this, 'setDecryptedData')); 262 deferredResult.addCallback(MochiKit.Base.method(this, 'setDecryptedData'));
263 deferredResult.callback(); 263 deferredResult.callback();
264 264
265 result = deferredResult; 265 result = deferredResult;
266 } else { 266 } else {
267 result = MochiKit.Async.succeed(this.decryptedData()); 267 result = MochiKit.Async.succeed(this.decryptedData());
268 } 268 }
269//MochiKit.Logging.logDebug("<<< [" + (new Date()).valueOf() + "] Record.decryptData"); 269//MochiKit.Logging.logDebug("<<< [" + (new Date()).valueOf() + "] Record.decryptData");
270 270
271 return result; 271 return result;
272 }, 272 },
273 273
274 //------------------------------------------------------------------------- 274 //-------------------------------------------------------------------------
275 275
276 'processData': function(someValues) { 276 'processData': function(someValues) {
277//MochiKit.Logging.logDebug(">>> [" + (new Date()).valueOf() + "] Record.processData"); 277//MochiKit.Logging.logDebug(">>> [" + (new Date()).valueOf() + "] Record.processData");
278//MochiKit.Logging.logDebug("--- Record.processData: " + Clipperz.Base.serializeJSON(someValues)); 278//MochiKit.Logging.logDebug("--- Record.processData: " + Clipperz.Base.serializeJSON(someValues));
279 if (this.shouldProcessData()) { 279 if (this.shouldProcessData()) {
280 var currentVersionParameters; 280 var currentVersionParameters;
281 281
282console.log("Record.processData", someValues);
282 this.processDataToExtractLegacyValues(someValues['data']); 283 this.processDataToExtractLegacyValues(someValues['data']);
283 284
284 if (typeof(someValues['data']['notes']) != 'undefined') { 285 if (typeof(someValues['data']['notes']) != 'undefined') {
285 this.setNotes(someValues['data']['notes']); 286 this.setNotes(someValues['data']['notes']);
286 } 287 }
288
287 if (someValues['data']['currentVersionKey'] != null) { 289 if (someValues['data']['currentVersionKey'] != null) {
288 this.setCurrentVersionKey(someValues['data']['currentVersionKey']); 290 this.setCurrentVersionKey(someValues['data']['currentVersionKey']);
289 } else { 291 } else {
290 this.setCurrentVersionKey(this.key()); 292 this.setCurrentVersionKey(this.key());
291 } 293 }
292 294
293 currentVersionParameters = someValues['currentVersion']; 295 // currentVersionParameters = someValues['currentVersion'];
296 currentVersionParameters = someValues['versions'][someValues['currentVersion']];
297console.log("Record.processData - this.currentVersionKey()", this.currentVersionKey());
298console.log("Record.processData - currentVersionParameters", currentVersionParameters);
294 currentVersionParameters['key'] = this.currentVersionKey(); 299 currentVersionParameters['key'] = this.currentVersionKey();
295 this.setCurrentVersion(new Clipperz.PM.DataModel.RecordVersion(this, currentVersionParameters)); 300 this.setCurrentVersion(new Clipperz.PM.DataModel.RecordVersion(this, currentVersionParameters));
296 301
297 if (someValues['data']['directLogins'] != null) { 302 if (someValues['data']['directLogins'] != null) {
298 vardirectLoginReference; 303 vardirectLoginReference;
299 304
300 for (directLoginReference in someValues['data']['directLogins']) { 305 for (directLoginReference in someValues['data']['directLogins']) {
301 var directLogin; 306 var directLogin;
302 var directLoginParameters; 307 var directLoginParameters;
303 308
304 directLoginParameters = someValues['data']['directLogins'][directLoginReference]; 309 directLoginParameters = someValues['data']['directLogins'][directLoginReference];
305 directLoginParameters.record = this; 310 directLoginParameters.record = this;
306 directLoginParameters.reference = directLoginReference; 311 directLoginParameters.reference = directLoginReference;
307 312
308 directLogin = new Clipperz.PM.DataModel.DirectLogin(directLoginParameters); 313 directLogin = new Clipperz.PM.DataModel.DirectLogin(directLoginParameters);
309 this.addDirectLogin(directLogin, true); 314 this.addDirectLogin(directLogin, true);
310 } 315 }
311 } 316 }
312 this.setShouldProcessData(false); 317 this.setShouldProcessData(false);
313 } 318 }
314 319
315 Clipperz.NotificationCenter.notify(this, 'recordDataReady'); 320 Clipperz.NotificationCenter.notify(this, 'recordDataReady');
316//MochiKit.Logging.logDebug("<<< [" + (new Date()).valueOf() + "] Record.processData"); 321//MochiKit.Logging.logDebug("<<< [" + (new Date()).valueOf() + "] Record.processData");
317//MochiKit.Logging.logDebug("<<< Record.processData"); 322//MochiKit.Logging.logDebug("<<< Record.processData");
318 323
319 return this; 324 return this;
320 }, 325 },
321 326
322 //------------------------------------------------------------------------- 327 //-------------------------------------------------------------------------
323 328
324 'processDataToExtractLegacyValues': function(someValues) { 329 'processDataToExtractLegacyValues': function(someValues) {
325//MochiKit.Logging.logDebug(">>> Record.processDataToExtractLegacyValues"); 330//MochiKit.Logging.logDebug(">>> Record.processDataToExtractLegacyValues");
326 if (someValues['data'] != null) { 331 if (someValues['data'] != null) {
327 this.setNotes(someValues['data']); 332 this.setNotes(someValues['data']);
328 } 333 }
329 334
330 if ( 335 if (
331 (typeof(someValues['loginFormData']) != "undefined") 336 (typeof(someValues['loginFormData']) != "undefined")
332 &&(typeof(someValues['loginBindings'] != "undefined")) 337 &&(typeof(someValues['loginBindings'] != "undefined"))
333 &&(someValues['loginFormData'] != "") 338 &&(someValues['loginFormData'] != "")
334 &&(someValues['loginBindings'] != "") 339 &&(someValues['loginBindings'] != "")
335 ) { 340 ) {
336 vardirectLogin; 341 vardirectLogin;
337 342
338 directLogin = new Clipperz.PM.DataModel.DirectLogin({ 343 directLogin = new Clipperz.PM.DataModel.DirectLogin({
339 record:this, 344 record:this,
340 label:this.label() + Clipperz.PM.Strings['newDirectLoginLabelSuffix'], 345 label:this.label() + Clipperz.PM.Strings['newDirectLoginLabelSuffix'],
341 reference:Clipperz.Crypto.SHA.sha256(new Clipperz.ByteArray(this.label() + 346 reference:Clipperz.Crypto.SHA.sha256(new Clipperz.ByteArray(this.label() +
342 someValues['loginFormData'] + 347 someValues['loginFormData'] +
343 someValues['loginBindings'])).toHexString().substring(2), 348 someValues['loginBindings'])).toHexString().substring(2),
344 formData:Clipperz.Base.evalJSON(someValues['loginFormData']), 349 formData:Clipperz.Base.evalJSON(someValues['loginFormData']),
345 legacyBindingData:Clipperz.Base.evalJSON(someValues['loginBindings']), 350 legacyBindingData:Clipperz.Base.evalJSON(someValues['loginBindings']),
346 bookmarkletVersion:'0.1' 351 bookmarkletVersion:'0.1'
347 }); 352 });
348 this.addDirectLogin(directLogin, true); 353 this.addDirectLogin(directLogin, true);
349 } 354 }
350//MochiKit.Logging.logDebug("<<< Record.processDataToExtractLegacyValues"); 355//MochiKit.Logging.logDebug("<<< Record.processDataToExtractLegacyValues");
351 }, 356 },
352 357
353 //------------------------------------------------------------------------- 358 //-------------------------------------------------------------------------
354 359
355 'getReadyBeforeUpdatingVersionValues': function() { 360 'getReadyBeforeUpdatingVersionValues': function() {
356 }, 361 },
357 362
358 //------------------------------------------------------------------------- 363 //-------------------------------------------------------------------------
359 364
360 'addNewField': function() { 365 'addNewField': function() {
361 varnewField; 366 varnewField;
362 367
363//MochiKit.Logging.logDebug(">>> Record.addNewField - " + this); 368//MochiKit.Logging.logDebug(">>> Record.addNewField - " + this);
364 this.getReadyBeforeUpdatingVersionValues(); 369 this.getReadyBeforeUpdatingVersionValues();
365 newField = this.currentVersion().addNewField(); 370 newField = this.currentVersion().addNewField();
366 Clipperz.NotificationCenter.notify(this, 'recordUpdated'); 371 Clipperz.NotificationCenter.notify(this, 'recordUpdated');
367//MochiKit.Logging.logDebug("<<< Record.addNewField"); 372//MochiKit.Logging.logDebug("<<< Record.addNewField");
368 373
369 return newField; 374 return newField;
370 }, 375 },
371 376
372 //------------------------------------------------------------------------- 377 //-------------------------------------------------------------------------
373 378
374 'removeField': function(aField) { 379 'removeField': function(aField) {
375 this.getReadyBeforeUpdatingVersionValues(); 380 this.getReadyBeforeUpdatingVersionValues();
376 this.currentVersion().removeField(aField); 381 this.currentVersion().removeField(aField);
377 Clipperz.NotificationCenter.notify(this, 'recordUpdated'); 382 Clipperz.NotificationCenter.notify(this, 'recordUpdated');
378 }, 383 },
379 384
380 'removeEmptyFields': function() { 385 'removeEmptyFields': function() {
381 MochiKit.Iter.forEach(MochiKit.Base.values(this.currentVersion().fields()), MochiKit.Base.bind(function(aField) { 386 MochiKit.Iter.forEach(MochiKit.Base.values(this.currentVersion().fields()), MochiKit.Base.bind(function(aField) {
382 if (aField.isEmpty()) { 387 if (aField.isEmpty()) {
383 this.removeField(aField); 388 this.removeField(aField);
384 // this.currentVersion().removeField(aField); 389 // this.currentVersion().removeField(aField);
385 } 390 }
386 }, this)); 391 }, this));
387 }, 392 },
388 393
389 //------------------------------------------------------------------------- 394 //-------------------------------------------------------------------------
diff --git a/frontend/beta/js/Clipperz/PM/Proxy.js b/frontend/beta/js/Clipperz/PM/Proxy.js
index f476196..bec9195 100644
--- a/frontend/beta/js/Clipperz/PM/Proxy.js
+++ b/frontend/beta/js/Clipperz/PM/Proxy.js
@@ -23,148 +23,147 @@ refer to http://www.clipperz.com.
23 23
24*/ 24*/
25 25
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } 27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28 28
29//============================================================================= 29//=============================================================================
30 30
31Clipperz.PM.Proxy = function(args) { 31Clipperz.PM.Proxy = function(args) {
32 args = args || {}; 32 args = args || {};
33 33
34 this._shouldPayTolls = args.shouldPayTolls || false; 34 this._shouldPayTolls = args.shouldPayTolls || false;
35 35
36 this._tolls = { 36 this._tolls = {
37 'CONNECT':[], 37 'CONNECT':[],
38 'REGISTER':[], 38 'REGISTER':[],
39 'MESSAGE':[] 39 'MESSAGE':[]
40 }; 40 };
41 41
42 if (args.isDefault === true) { 42 if (args.isDefault === true) {
43 Clipperz.PM.Proxy.defaultProxy = this; 43 Clipperz.PM.Proxy.defaultProxy = this;
44 } 44 }
45 45
46 return this; 46 return this;
47} 47}
48 48
49Clipperz.PM.Proxy.prototype = MochiKit.Base.update(null, { 49Clipperz.PM.Proxy.prototype = MochiKit.Base.update(null, {
50 50
51 'toString': function() { 51 'toString': function() {
52 return "Clipperz.PM.Proxy"; 52 return "Clipperz.PM.Proxy";
53 }, 53 },
54 54
55 //========================================================================= 55 //=========================================================================
56 56
57 'shouldPayTolls': function() { 57 'shouldPayTolls': function() {
58 return this._shouldPayTolls; 58 return this._shouldPayTolls;
59 }, 59 },
60 60
61 //------------------------------------------------------------------------- 61 //-------------------------------------------------------------------------
62 62
63 'tolls': function() { 63 'tolls': function() {
64 return this._tolls; 64 return this._tolls;
65 }, 65 },
66 66
67 //------------------------------------------------------------------------- 67 //-------------------------------------------------------------------------
68 68
69 'payToll': function(aRequestType, someParameters) { 69 'payToll': function(aRequestType, someParameters) {
70 vardeferredResult; 70 vardeferredResult;
71 71
72//console.log(">>> Proxy.payToll", aRequestType, someParameters); 72//console.log(">>> Proxy.payToll", aRequestType, someParameters);
73 if (this.shouldPayTolls()) { 73 if (this.shouldPayTolls()) {
74 deferredResult = new MochiKit.Async.Deferred(); 74 deferredResult = new MochiKit.Async.Deferred();
75 75
76 if (this.tolls()[aRequestType].length == 0) { 76 if (this.tolls()[aRequestType].length == 0) {
77 deferredResult.addCallback(MochiKit.Base.method(this, 'sendMessage', 'knock', {requestType:aRequestType})); 77 deferredResult.addCallback(MochiKit.Base.method(this, 'sendMessage', 'knock', {requestType:aRequestType}));
78 deferredResult.addCallback(MochiKit.Base.method(this, 'setTollCallback')); 78 deferredResult.addCallback(MochiKit.Base.method(this, 'setTollCallback'));
79 } 79 }
80 deferredResult.addCallback(MochiKit.Base.method(this.tolls()[aRequestType], 'pop')); 80 deferredResult.addCallback(MochiKit.Base.method(this.tolls()[aRequestType], 'pop'));
81 deferredResult.addCallback(MochiKit.Base.methodcaller('deferredPay')); 81 deferredResult.addCallback(MochiKit.Base.methodcaller('deferredPay'));
82 deferredResult.addCallback(function(aToll) { 82 deferredResult.addCallback(function(aToll) {
83 var result; 83 var result;
84 84
85 result = { 85 result = {
86 parameters: someParameters, 86 parameters: someParameters,
87 toll: aToll 87 toll: aToll
88 } 88 }
89 89
90 return result; 90 return result;
91 }); 91 });
92 92
93 deferredResult.callback(); 93 deferredResult.callback();
94 } else { 94 } else {
95 deferredResult = MochiKit.Async.succeed({parameters:someParameters}); 95 deferredResult = MochiKit.Async.succeed({parameters:someParameters});
96 } 96 }
97//console.log("<<< Proxy.payToll"); 97//console.log("<<< Proxy.payToll");
98 98
99 return deferredResult; 99 return deferredResult;
100 }, 100 },
101 101
102 //------------------------------------------------------------------------- 102 //-------------------------------------------------------------------------
103 103
104 'addToll': function(aToll) { 104 'addToll': function(aToll) {
105//console.log(">>> Proxy.addToll", aToll); 105//console.log(">>> Proxy.addToll", aToll);
106 this.tolls()[aToll.requestType()].push(aToll); 106 this.tolls()[aToll.requestType()].push(aToll);
107//console.log("<<< Proxy.addToll"); 107//console.log("<<< Proxy.addToll");
108 }, 108 },
109 109
110 //========================================================================= 110 //=========================================================================
111 111
112 'setTollCallback': function(someParameters) { 112 'setTollCallback': function(someParameters) {
113//console.log(">>> Proxy.setTollCallback", someParameters); 113//console.log(">>> Proxy.setTollCallback", someParameters);
114 if (typeof(someParameters['toll']) != 'undefined') { 114 if (typeof(someParameters['toll']) != 'undefined') {
115//console.log("added a new toll", someParameters['toll']); 115//console.log("added a new toll", someParameters['toll']);
116 this.addToll(new Clipperz.PM.Toll(someParameters['toll'])); 116 this.addToll(new Clipperz.PM.Toll(someParameters['toll']));
117 } 117 }
118//console.log("<<< Proxy.setTallCallback", someParameters['result']); 118//console.log("<<< Proxy.setTallCallback", someParameters['result']);
119 //return someParameters['result']; 119 return someParameters['result'];
120 return someParameters;
121 }, 120 },
122 121
123 //========================================================================= 122 //=========================================================================
124 123
125 'registration': function (someParameters) { 124 'registration': function (someParameters) {
126 return this.processMessage('registration', someParameters, 'REGISTER'); 125 return this.processMessage('registration', someParameters, 'REGISTER');
127 }, 126 },
128 127
129 'handshake': function (someParameters) { 128 'handshake': function (someParameters) {
130 return this.processMessage('handshake', someParameters, 'CONNECT'); 129 return this.processMessage('handshake', someParameters, 'CONNECT');
131 }, 130 },
132 131
133 'message': function (someParameters) { 132 'message': function (someParameters) {
134 return this.processMessage('message', someParameters, 'MESSAGE'); 133 return this.processMessage('message', someParameters, 'MESSAGE');
135 }, 134 },
136 135
137 'logout': function (someParameters) { 136 'logout': function (someParameters) {
138 return this.processMessage('logout', someParameters, 'MESSAGE'); 137 return this.processMessage('logout', someParameters, 'MESSAGE');
139 }, 138 },
140 139
141 //========================================================================= 140 //=========================================================================
142 141
143 'processMessage': function (aFunctionName, someParameters, aRequestType) { 142 'processMessage': function (aFunctionName, someParameters, aRequestType) {
144 vardeferredResult; 143 vardeferredResult;
145 144
146 deferredResult = new MochiKit.Async.Deferred(); 145 deferredResult = new MochiKit.Async.Deferred();
147 deferredResult.addCallback(MochiKit.Base.method(this, 'payToll', aRequestType)); 146 deferredResult.addCallback(MochiKit.Base.method(this, 'payToll', aRequestType));
148 deferredResult.addCallback(MochiKit.Base.method(this, 'sendMessage', aFunctionName)); 147 deferredResult.addCallback(MochiKit.Base.method(this, 'sendMessage', aFunctionName));
149 deferredResult.addCallback(MochiKit.Base.method(this, 'setTollCallback')); 148 deferredResult.addCallback(MochiKit.Base.method(this, 'setTollCallback'));
150 deferredResult.callback(someParameters); 149 deferredResult.callback(someParameters);
151 150
152 return deferredResult; 151 return deferredResult;
153 }, 152 },
154 153
155 //========================================================================= 154 //=========================================================================
156 155
157 'sendMessage': function () { 156 'sendMessage': function () {
158 throw Clipperz.Base.exception.AbstractMethod; 157 throw Clipperz.Base.exception.AbstractMethod;
159 }, 158 },
160 159
161 //========================================================================= 160 //=========================================================================
162 161
163 'isReadOnly': function () { 162 'isReadOnly': function () {
164 return false; 163 return false;
165 }, 164 },
166 165
167 //========================================================================= 166 //=========================================================================
168 __syntaxFix__: "syntax fix" 167 __syntaxFix__: "syntax fix"
169 168
170}); 169});
diff --git a/frontend/beta/js/Clipperz/PM/Proxy/Proxy.PHP.js b/frontend/beta/js/Clipperz/PM/Proxy/Proxy.PHP.js
deleted file mode 100755
index 34a10c2..0000000
--- a/frontend/beta/js/Clipperz/PM/Proxy/Proxy.PHP.js
+++ b/dev/null
@@ -1,262 +0,0 @@
1/*
2
3Copyright 2008-2011 Clipperz Srl
4
5This file is part of Clipperz Community Edition.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please
8refer to http://www.clipperz.com.
9
10* Clipperz Community Edition is free software: you can redistribute
11 it and/or modify it under the terms of the GNU Affero General Public
12 License as published by the Free Software Foundation, either version
13 3 of the License, or (at your option) any later version.
14
15* Clipperz Community Edition is distributed in the hope that it will
16 be useful, but WITHOUT ANY WARRANTY; without even the implied
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details.
19
20* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see
22 <http://www.gnu.org/licenses/>.
23
24*/
25
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
28
29//=============================================================================
30
31Clipperz.PM.Proxy.PHP = function(args) {
32 Clipperz.PM.Proxy.PHP.superclass.constructor.call(this, args);
33/*
34 this._tolls = {
35 'CONNECT':[],
36 'REGISTER':[],
37 'MESSAGE':[]
38 };
39 */
40 return this;
41}
42
43YAHOO.extendX(Clipperz.PM.Proxy.PHP, Clipperz.PM.Proxy, {
44
45 'toString': function() {
46 return "Clipperz.PM.Proxy.PHP - " + this.args();
47 },
48
49 //=========================================================================
50/*
51 'tolls': function() {
52 return this._tolls;
53 },
54*/
55 //-------------------------------------------------------------------------
56/*
57 'payToll': function(aRequestType, someParameters) {
58 vardeferredResult;
59
60//MochiKit.Logging.logDebug(">>> Proxy.DWR.payToll: " + aRequestType);
61 if (this.tolls()[aRequestType].length > 0) {
62 deferredResult = MochiKit.Async.succeed(this.tolls()[aRequestType].pop());
63 } else {
64//MochiKit.Logging.logDebug("### " + aRequestType + " toll NOT immediately available; request queued.");
65 deferredResult = new MochiKit.Async.Deferred();
66 deferredResult.addCallback(function(someParameters) {
67 return new Clipperz.PM.Toll(someParameters['toll']);
68 })
69 com_clipperz_pm_Proxy.knock(Clipperz.Base.serializeJSON({requestType:aRequestType}), {
70 callback:MochiKit.Base.method(deferredResult, 'callback'),
71 errorHandler:MochiKit.Base.method(deferredResult, 'errback')
72 });
73 }
74
75 deferredResult.addCallback(function(aToll) {
76 return aToll.deferredPay();
77 });
78 deferredResult.addCallback(function(someParameters, aToll) {
79 var result;
80
81 result = {
82 parameters: someParameters,
83 toll: aToll
84 }
85
86 return result;
87 }, someParameters);
88
89 return deferredResult;
90 },
91*/
92 //-------------------------------------------------------------------------
93/*
94 'addToll': function(aToll) {
95 this.tolls()[aToll.requestType()].push(aToll);
96 },
97*/
98 //=========================================================================
99/*
100 'setTollCallback': function(someParameters) {
101//MochiKit.Logging.logDebug(">>> Proxy.DWR.setTollCallback");
102//MochiKit.Logging.logDebug("--- Proxy.DWR.setTollCallback - " + Clipperz.Base.serializeJSON(someParameters));
103 if (typeof(someParameters['toll']) != 'undefined') {
104 this.addToll(new Clipperz.PM.Toll(someParameters['toll']));
105 }
106 return someParameters['result'];
107 },
108*/
109 //=========================================================================
110
111 'registration': function(someParameters) {
112 return this.sendMessage('registration', someParameters, 'REGISTER');
113 },
114
115 //-------------------------------------------------------------------------
116
117 'handshake': function(someParameters) {
118/*
119 _s = "e8a2162f29aeaabb729f5625e9740edbf0cd80ac77c6b19ab951ed6c88443b8c";
120 _v = new Clipperz.Crypto.BigInt("955e2db0f7844aca372f5799e5f7e51b5866718493096908bd66abcf1d068108", 16);
121 _b = new Clipperz.Crypto.BigInt("5761e6c84d22ea3c5649de01702d60f674ccfe79238540eb34c61cd020230c53", 16);
122
123 _B = _v.add(Clipperz.Crypto.SRP.g().powerModule(_b, Clipperz.Crypto.SRP.n()));
124 _u = new Clipperz.Crypto.BigInt(Clipperz.PM.Crypto.encryptingFunctions.versions[someParameters.version].hash(new Clipperz.ByteArray(_B.asString(10))).toHexString(), 16);
125 _A = new Clipperz.Crypto.BigInt("3b3567ec33d73673552e960872eb154d091a2488915941038aef759236a27e64", 16);
126 _S = (_A.multiply(_v.powerModule(_u, Clipperz.Crypto.SRP.n()))).powerModule(_b, Clipperz.Crypto.SRP.n());
127 _K = Clipperz.PM.Crypto.encryptingFunctions.versions[someParameters.version].hash(new Clipperz.ByteArray(_S.asString(10))).toHexString().slice(2);
128 _M1 = Clipperz.PM.Crypto.encryptingFunctions.versions[someParameters.version].hash(new Clipperz.ByteArray(_A.asString(10) + _B.asString(10) + _K)).toHexString().slice(2);
129 _M2 = Clipperz.PM.Crypto.encryptingFunctions.versions[someParameters.version].hash(new Clipperz.ByteArray(_A.asString(10) + _M1 + _K)).toHexString().slice(2);
130
131 // MochiKit.Logging.logDebug("b = " + _b.asString(16));
132 // MochiKit.Logging.logDebug("v = " + _v.asString(16));
133 MochiKit.Logging.logDebug("B = " + _B.asString(16));
134 MochiKit.Logging.logDebug("u = " + _u.asString(16));
135 MochiKit.Logging.logDebug("S = " + _S.asString(16));
136 MochiKit.Logging.logDebug("K = " + _K);
137 MochiKit.Logging.logDebug("M1 = " + _M1);
138 MochiKit.Logging.logDebug("M2 = " + _M2);
139 // MochiKit.Logging.logDebug("someParameters.version: " + someParameters.version);
140 */
141 return this.sendMessage('handshake', someParameters, 'CONNECT');
142 },
143
144 //-------------------------------------------------------------------------
145
146 'message': function(someParameters) {
147 return this.sendMessage('message', someParameters, 'MESSAGE');
148 },
149
150 //-------------------------------------------------------------------------
151
152 'logout': function(someParameters) {
153//MochiKit.Logging.logDebug("=== Proxy.DWR.logout");
154 return this.sendMessage('logout', someParameters, 'MESSAGE');
155 },
156
157 //=========================================================================
158
159 'sendMessage': function(aFunctionName, someParameters, aRequestType) {
160/*
161 vardeferredResult;
162 var proxy;
163
164//MochiKit.Logging.logDebug(">>> Proxy.DWR.sendMessage - " + aFunctionName + " - " + aRequestType);
165 proxy = this;
166
167 deferredResult = new MochiKit.Async.Deferred();
168//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("x.1 Proxy.DWR.sendMessage - 1: " + res); return res;});
169 deferredResult.addCallback(MochiKit.Base.method(proxy, 'payToll'), aRequestType);
170//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("x.2 Proxy.DWR.sendMessage - 2: " + Clipperz.Base.serializeJSON(res)); return res;});
171 deferredResult.addCallback(MochiKit.Base.method(proxy, 'sendRemoteMessage'), aFunctionName);
172//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("x.3 Proxy.DWR.sendMessage - 3: " + res); return res;});
173//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("x.3 Proxy.DWR.sendMessage - 3: " + Clipperz.Base.serializeJSON(res)); return res;});
174 deferredResult.callback(someParameters);
175
176//MochiKit.Logging.logDebug("<<< Proxy.DWR.sendMessage");
177 return deferredResult;
178*/
179
180 // return this.sendRemoteMessage(aFunctionName, someParameters);
181
182
183 vardeferredResult;
184 var proxy;
185
186 proxy = this;
187
188 deferredResult = new MochiKit.Async.Deferred();
189 deferredResult.addCallback(MochiKit.Base.method(proxy, 'sendRemoteMessage'), aFunctionName);
190//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("x.3 Proxy.PHP.sendMessage - 3: " + res); return res;});
191//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("x.3 Proxy.PHP.sendMessage - 3.1: " + Clipperz.Base.serializeJSON(res)); return res;});
192
193 deferredResult.callback(someParameters);
194
195 return deferredResult;
196 },
197
198 //=========================================================================
199
200 'sendRemoteMessage': function(aFunctionName, someParameters) {
201/*
202 vardeferredResult;
203
204//MochiKit.Logging.logDebug(">>> Proxy.DWR.sendRemoteMessage('" + aFunctionName + "', " + Clipperz.Base.serializeJSON(someParameters) + ") - " + this);
205 deferredResult = new MochiKit.Async.Deferred();
206//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("Proxy.DWR.sendRemoteMessage - 1: " + res); return res;});
207 // deferredResult.addCallback(MochiKit.Base.method(this, 'setTollCallback'));
208//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("Proxy.DWR.sendRemoteMessage - 2: " + res); return res;});
209
210 com_clipperz_pm_Proxy[aFunctionName](Clipperz.Base.serializeJSON(someParameters), {
211 callback:MochiKit.Base.method(deferredResult, 'callback'),
212 errorHandler:MochiKit.Base.method(deferredResult, 'errback')
213 });
214//MochiKit.Logging.logDebug("<<< Proxy.PHP.sendRemoteMessage - result: " + deferredResult);
215
216 return deferredResult;
217*/
218
219 vardeferredResult;
220 var parameters;
221
222//MochiKit.Logging.logDebug(">>> Proxy.PHP.sendRemoteMessage('" + aFunctionName + "', " + Clipperz.Base.serializeJSON(someParameters) + ") - " + this);
223 parameters = {};
224 parameters['method'] = aFunctionName;
225 // parameters['version'] = someParameters['version'];
226 // parameters['message'] = someParameters['message'];
227 parameters['parameters'] = Clipperz.Base.serializeJSON(someParameters);
228//MochiKit.Logging.logDebug("--- Proxy.PHP.sendRemoteMessage('" + Clipperz.Base.serializeJSON(parameters) + ") - " + this);
229 deferredResult = new MochiKit.Async.Deferred();
230 deferredResult.addCallback(MochiKit.Async.doXHR, "./php/index.php", {
231 method:'POST',
232 sendContent:MochiKit.Base.queryString(parameters),
233 headers:{"Content-Type":"application/x-www-form-urlencoded"}
234 });
235//deferredResult.addCallback(function(res) {MochiKit.Logging.logDebug("Proxy.PHP.response - 2: " + res.responseText); return res;});
236//deferredResult.addErrback(function(res) {MochiKit.Logging.logDebug("Proxy.PHP.response - ERROR: " + res); return res;});
237 deferredResult.addCallback(MochiKit.Async.evalJSONRequest);
238 deferredResult.addCallback(function (someValues) {
239 if (someValues['result'] == 'EXCEPTION') {
240 throw someValues['message'];
241 }
242 return someValues;
243 })
244 deferredResult.callback();
245
246 return deferredResult;
247 },
248
249 //=========================================================================
250
251 'isReadOnly': function() {
252 return false;
253 },
254
255 //=========================================================================
256 __syntaxFix__: "syntax fix"
257
258});
259
260//=============================================================================
261
262//Clipperz.PM.Proxy.defaultProxy = new Clipperz.PM.Proxy.PHP("Proxy.PHP - async test");
diff --git a/frontend/gamma/html/index_template.html b/frontend/gamma/html/index_template.html
index 8cf838c..bedb243 100644
--- a/frontend/gamma/html/index_template.html
+++ b/frontend/gamma/html/index_template.html
@@ -1,62 +1,67 @@
1<html> 1<html>
2<head> 2<head>
3 <title>@page.title@</title> 3 <title>@page.title@</title>
4 <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 4 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5<!-- 5<!--
6@copyright@ 6@copyright@
7--> 7-->
8 8
9@css@ 9@css@
10 10
11 <link rel="shortcut icon" href="./clipperz.ico" /> 11 <link rel="shortcut icon" href="./clipperz.ico" />
12 12
13 <meta name="description" content="Login to your web accounts with just one click. Never type a password again! Use multiple complex passwords and forget them. A password manager that enhances your online security." /> 13 <meta name="description" content="Login to your web accounts with just one click. Never type a password again! Use multiple complex passwords and forget them. A password manager that enhances your online security." />
14 <meta name="keywords" content="password manager,gestor de contraseñas,gerenciador de senhas,Kennwortmanager,passwords,security,privacy,cryptography" /> 14 <meta name="keywords" content="password manager,gestor de contraseñas,gerenciador de senhas,Kennwortmanager,passwords,security,privacy,cryptography" />
15<script> 15<script>
16 Clipperz_IEisBroken = false; 16 Clipperz_IEisBroken = false;
17 Clipperz_normalizedNewLine = '\n'; 17 Clipperz_normalizedNewLine = '\n';
18 Clipperz_dumpUrl = "/dump/"; 18 Clipperz_dumpUrl = "/dump/";
19</script> 19</script>
20 20
21<!--[if IE]><script> 21<!--[if IE]><script>
22Clipperz_IEisBroken = true; 22Clipperz_IEisBroken = true;
23Clipperz_normalizedNewLine = '\x0d\x0a'; 23Clipperz_normalizedNewLine = '\x0d\x0a';
24</script><![endif]--> 24</script><![endif]-->
25 25
26@js_DEBUG@ 26@js_DEBUG@
27 27
28</head> 28</head>
29<body> 29<body>
30<div id="mainDiv"> 30<div id="mainDiv">
31 <div id="loading"> 31 <div id="loading">
32 <a href="http://www.clipperz.com" target="_blank"><div id="logo"></div></a> 32 <a href="http://www.clipperz.com" target="_blank"><div id="logo"></div></a>
33 <h5 class="clipperzPayoff">keep it to yourself!</h5> 33 <h5 class="clipperzPayoff">keep it to yourself!</h5>
34 <h2>loading ...</h2> 34 <h2>loading ...</h2>
35 </div> 35 </div>
36 36
37@js_INSTALL@ 37@js_INSTALL@
38 38
39</div> 39</div>
40<div id="applicationVersionType" class="@application.version.type@"></div> 40<div id="applicationVersionType" class="@application.version.type@"></div>
41 41
42<script>
43 Clipperz.PM.Proxy.defaultProxy = new Clipperz.PM.Proxy.JSON({'url':'@request.path@', 'shouldPayTolls':@should.pay.toll@});
44 /*offline_data_placeholder*/
45</script>
46
42<!-- --> 47<!-- -->
43<div id="javaScriptAlert"> 48<div id="javaScriptAlert">
44 <div class="mask"></div> 49 <div class="mask"></div>
45 <div class="message"> 50 <div class="message">
46 <div class="header"></div> 51 <div class="header"></div>
47 <div class="body"> 52 <div class="body">
48 <div class="alertLogo"></div> 53 <div class="alertLogo"></div>
49 <div class="alert"> 54 <div class="alert">
50 <h1>Attention!</h1> 55 <h1>Attention!</h1>
51 <p>If you can read this message, the chances are that your browser does not properly support JavaScript? or you have disabled this functionality yourself.</p> 56 <p>If you can read this message, the chances are that your browser does not properly support JavaScript? or you have disabled this functionality yourself.</p>
52 <h3>Javascript is required to access Clipperz.</h3> 57 <h3>Javascript is required to access Clipperz.</h3>
53 <h5>Please enable scripting or upgrade your browser.</h5> 58 <h5>Please enable scripting or upgrade your browser.</h5>
54 </div> 59 </div>
55 </div> 60 </div>
56 <div class="footer"></div> 61 <div class="footer"></div>
57 </div> 62 </div>
58</div> 63</div>
59<!-- --> 64<!-- -->
60 65
61</body> 66</body>
62</html> 67</html>
diff --git a/frontend/gamma/js/Clipperz/Async.js b/frontend/gamma/js/Clipperz/Async.js
index 7c9d783..97d8ecf 100644
--- a/frontend/gamma/js/Clipperz/Async.js
+++ b/frontend/gamma/js/Clipperz/Async.js
@@ -1,216 +1,222 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2011 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz Community Edition.
6Clipperz Community Edition is an online password manager. 6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 7For further information about its features and functionalities please
8refer to http://www.clipperz.com. 8refer to http://www.clipperz.com.
9 9
10* Clipperz Community Edition is free software: you can redistribute 10* Clipperz Community Edition is free software: you can redistribute
11 it and/or modify it under the terms of the GNU Affero General Public 11 it and/or modify it under the terms of the GNU Affero General Public
12 License as published by the Free Software Foundation, either version 12 License as published by the Free Software Foundation, either version
13 3 of the License, or (at your option) any later version. 13 3 of the License, or (at your option) any later version.
14 14
15* Clipperz Community Edition is distributed in the hope that it will 15* Clipperz Community Edition is distributed in the hope that it will
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 16 be useful, but WITHOUT ANY WARRANTY; without even the implied
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 18 See the GNU Affero General Public License for more details.
19 19
20* You should have received a copy of the GNU Affero General Public 20* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 21 License along with Clipperz Community Edition. If not, see
22 <http://www.gnu.org/licenses/>. 22 <http://www.gnu.org/licenses/>.
23 23
24*/ 24*/
25 25
26//Clipperz.Async = MochiKit.Async; 26//Clipperz.Async = MochiKit.Async;
27 27
28 28
29if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 29if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
30if (typeof(Clipperz.Async) == 'undefined') { Clipperz.Async = {}; } 30if (typeof(Clipperz.Async) == 'undefined') { Clipperz.Async = {}; }
31 31
32Clipperz.Async.VERSION = "0.1"; 32Clipperz.Async.VERSION = "0.1";
33Clipperz.Async.NAME = "Clipperz.Async"; 33Clipperz.Async.NAME = "Clipperz.Async";
34 34
35Clipperz.Async.Deferred = function(aName, args) { 35Clipperz.Async.Deferred = function(aName, args) {
36 args = args || {}; 36 args = args || {};
37 37
38 Clipperz.Async.Deferred.superclass.constructor.call(this, args.canceller); 38 Clipperz.Async.Deferred.superclass.constructor.call(this, args.canceller);
39 39
40 this._args = args; 40 this._args = args;
41 this._name = aName || "Anonymous deferred"; 41 this._name = aName || "Anonymous deferred";
42 this._count = 0; 42 this._count = 0;
43 this._shouldTrace = ((CLIPPERZ_DEFERRED_TRACING_ENABLED === true) || (args.trace === true)); 43 this._shouldTrace = ((CLIPPERZ_DEFERRED_TRACING_ENABLED === true) || (args.trace === true));
44 this._vars = null; 44 this._vars = null;
45 45
46 return this; 46 return this;
47} 47}
48 48
49//============================================================================= 49//=============================================================================
50 50
51Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, { 51Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
52 52
53 'name': function () { 53 'name': function () {
54 return this._name; 54 return this._name;
55 }, 55 },
56 56
57 'args': function () { 57 'args': function () {
58 return this._args; 58 return this._args;
59 }, 59 },
60 60
61 //----------------------------------------------------------------------------- 61 //-----------------------------------------------------------------------------
62 62
63 'callback': function (aValue) { 63 'callback': function (aValue) {
64 if (this._shouldTrace) { 64 if (this._shouldTrace) {
65 Clipperz.log("CALLBACK " + this._name, aValue); 65 //Clipperz.log("CALLBACK " + this._name, aValue);
66 console.log("CALLBACK " + this._name, aValue);
66 } 67 }
67 68
68 if (this.chained == false) { 69 if (this.chained == false) {
69 var message; 70 var message;
70 71
71 message = "ERROR [" + this._name + "]"; 72 message = "ERROR [" + this._name + "]";
72 this.addErrback(function(aResult) { 73 this.addErrback(function(aResult) {
73 if (! (aResult instanceof MochiKit.Async.CancelledError)) { 74 if (! (aResult instanceof MochiKit.Async.CancelledError)) {
74 Clipperz.log(message, aResult); 75 Clipperz.log(message, aResult);
75 } 76 }
76 return aResult; 77 return aResult;
77 }); 78 });
78 79
79 if (this._shouldTrace) { 80 if (this._shouldTrace) {
80 var resultMessage; 81 var resultMessage;
81 82
82 resultMessage = "RESULT " + this._name + " <=="; 83 resultMessage = "RESULT " + this._name + " <==";
83 // this.addCallback(function(aResult) { 84 // this.addCallback(function(aResult) {
84 Clipperz.Async.Deferred.superclass.addCallback.call(this, function(aResult) { 85 Clipperz.Async.Deferred.superclass.addCallback.call(this, function(aResult) {
85 Clipperz.log(resultMessage, aResult); 86 //Clipperz.log(resultMessage, aResult);
87 console.log(resultMessage, aResult);
86 88
87 return aResult; 89 return aResult;
88 }); 90 });
89 } 91 }
90 } 92 }
91 93
92 if (CLIPPERZ_DEFERRED_CALL_LOGGING_ENABLED === true) { 94 if (CLIPPERZ_DEFERRED_CALL_LOGGING_ENABLED === true) {
93 Clipperz.log("callback " + this._name, this); 95 Clipperz.log("callback " + this._name, this);
94 } 96 }
95 97
96 return Clipperz.Async.Deferred.superclass.callback.apply(this, arguments); 98 return Clipperz.Async.Deferred.superclass.callback.apply(this, arguments);
97 }, 99 },
98 100
99 //----------------------------------------------------------------------------- 101 //-----------------------------------------------------------------------------
100 102
101 'addCallback': function () { 103 'addCallback': function () {
102 var message; 104 var message;
103 105
104 if (this._shouldTrace) { 106 if (this._shouldTrace) {
105 this._count ++; 107 this._count ++;
106 message = "[" + this._count + "] " + this._name + " "; 108 message = "[" + this._count + "] " + this._name + " ";
107 // this.addBoth(function(aResult) {Clipperz.log(message + "-->", aResult); return aResult;}); 109 // this.addBoth(function(aResult) {Clipperz.log(message + "-->", aResult); return aResult;});
108 this.addCallbacks( 110 this.addCallbacks(
109 function(aResult) {Clipperz.log("-OK- " + message + "-->"/*, aResult*/); return aResult;}, 111 //function(aResult) {Clipperz.log("-OK- " + message + "-->"/*, aResult*/); return aResult;},
110 function(aResult) {Clipperz.log("FAIL " + message + "-->"/*, aResult*/); return aResult;} 112 function(aResult) {console.log("-OK- " + message + "-->"/*, aResult*/); return aResult;},
113 //function(aResult) {Clipperz.log("FAIL " + message + "-->"/*, aResult*/); return aResult;}
114 function(aResult) {console.log("FAIL " + message + "-->"/*, aResult*/); return aResult;}
111 ); 115 );
112 } 116 }
113 117
114 Clipperz.Async.Deferred.superclass.addCallback.apply(this, arguments); 118 Clipperz.Async.Deferred.superclass.addCallback.apply(this, arguments);
115 119
116 if (this._shouldTrace) { 120 if (this._shouldTrace) {
117 // this.addBoth(function(aResult) {Clipperz.log(message + "<--", aResult); return aResult;}); 121 // this.addBoth(function(aResult) {Clipperz.log(message + "<--", aResult); return aResult;});
118 this.addCallbacks( 122 this.addCallbacks(
119 function(aResult) {Clipperz.log("-OK- " + message + "<--", aResult); return aResult;}, 123 //function(aResult) {Clipperz.log("-OK- " + message + "<--", aResult); return aResult;},
120 function(aResult) {Clipperz.log("FAIL " + message + "<--", aResult); return aResult;} 124 function(aResult) {console.log("-OK- " + message + "<--", aResult); return aResult;},
125 //function(aResult) {Clipperz.log("FAIL " + message + "<--", aResult); return aResult;}
126 function(aResult) {console.log("FAIL " + message + "<--", aResult); return aResult;}
121 ); 127 );
122 } 128 }
123 }, 129 },
124 130
125 //============================================================================= 131 //=============================================================================
126 132
127 'addCallbackPass': function() { 133 'addCallbackPass': function() {
128 var passFunction; 134 var passFunction;
129 135
130 passFunction = MochiKit.Base.partial.apply(null, arguments); 136 passFunction = MochiKit.Base.partial.apply(null, arguments);
131 137
132 this.addCallback(function() { 138 this.addCallback(function() {
133 var result; 139 var result;
134 140
135 result = arguments[arguments.length -1]; 141 result = arguments[arguments.length -1];
136 passFunction(); 142 passFunction();
137 143
138 return result; 144 return result;
139 }); 145 });
140 }, 146 },
141 147
142 //----------------------------------------------------------------------------- 148 //-----------------------------------------------------------------------------
143 149
144 'addErrbackPass': function() { 150 'addErrbackPass': function() {
145 var passFunction; 151 var passFunction;
146 152
147 passFunction = MochiKit.Base.partial.apply(null, arguments); 153 passFunction = MochiKit.Base.partial.apply(null, arguments);
148 154
149 this.addErrback(function() { 155 this.addErrback(function() {
150 var result; 156 var result;
151 157
152 result = arguments[arguments.length -1]; 158 result = arguments[arguments.length -1];
153 passFunction(); 159 passFunction();
154 160
155 return result; 161 return result;
156 }); 162 });
157 }, 163 },
158 164
159 //----------------------------------------------------------------------------- 165 //-----------------------------------------------------------------------------
160 166
161 'addBothPass': function() { 167 'addBothPass': function() {
162 var passFunction; 168 var passFunction;
163 169
164 passFunction = MochiKit.Base.partial.apply(null, arguments); 170 passFunction = MochiKit.Base.partial.apply(null, arguments);
165 171
166 this.addBoth(function() { 172 this.addBoth(function() {
167 var result; 173 var result;
168 174
169 result = arguments[arguments.length -1]; 175 result = arguments[arguments.length -1];
170 passFunction(); 176 passFunction();
171 177
172 return result; 178 return result;
173 }); 179 });
174 }, 180 },
175 181
176 //----------------------------------------------------------------------------- 182 //-----------------------------------------------------------------------------
177 183
178 'addIf': function (aThenBlock, anElseBlock) { 184 'addIf': function (aThenBlock, anElseBlock) {
179 this.addCallback(MochiKit.Base.bind(function (aValue) { 185 this.addCallback(MochiKit.Base.bind(function (aValue) {
180 var deferredResult; 186 var deferredResult;
181 187
182 if (!MochiKit.Base.isUndefinedOrNull(aValue) && aValue) { 188 if (!MochiKit.Base.isUndefinedOrNull(aValue) && aValue) {
183 deferredResult = Clipperz.Async.callbacks(this._name + " <then>", aThenBlock, null, aValue); 189 deferredResult = Clipperz.Async.callbacks(this._name + " <then>", aThenBlock, null, aValue);
184 } else { 190 } else {
185 deferredResult = Clipperz.Async.callbacks(this._name + " <else>", anElseBlock, null, aValue); 191 deferredResult = Clipperz.Async.callbacks(this._name + " <else>", anElseBlock, null, aValue);
186 } 192 }
187 193
188 return deferredResult; 194 return deferredResult;
189 })) 195 }))
190 }, 196 },
191 197
192 //----------------------------------------------------------------------------- 198 //-----------------------------------------------------------------------------
193 199
194 'addMethod': function () { 200 'addMethod': function () {
195 this.addCallback(MochiKit.Base.method.apply(this, arguments)); 201 this.addCallback(MochiKit.Base.method.apply(this, arguments));
196 }, 202 },
197 203
198 //----------------------------------------------------------------------------- 204 //-----------------------------------------------------------------------------
199 205
200 'addMethodcaller': function () { 206 'addMethodcaller': function () {
201 this.addCallback(MochiKit.Base.methodcaller.apply(this, arguments)); 207 this.addCallback(MochiKit.Base.methodcaller.apply(this, arguments));
202 }, 208 },
203 209
204 //============================================================================= 210 //=============================================================================
205 211
206 'addLog': function (aLog) { 212 'addLog': function (aLog) {
207 if (CLIPPERZ_DEFERRED_LOGGING_ENABLED) { 213 if (CLIPPERZ_DEFERRED_LOGGING_ENABLED) {
208 this.addBothPass(function(res) {Clipperz.log(aLog + " ", res);}); 214 this.addBothPass(function(res) {Clipperz.log(aLog + " ", res);});
209 // this.addBothPass(function(res) {console.log(aLog + " ", res);}); 215 // this.addBothPass(function(res) {console.log(aLog + " ", res);});
210 } 216 }
211 }, 217 },
212 218
213 //============================================================================= 219 //=============================================================================
214 220
215 'acquireLock': function (aLock) { 221 'acquireLock': function (aLock) {
216 // this.addCallback(function (aResult) { 222 // this.addCallback(function (aResult) {
@@ -313,192 +319,193 @@ Clipperz.Async.DeferredSynchronizer = function(aName, someMethods) {
313 result = MochiKit.Async.fail(someResults); 319 result = MochiKit.Async.fail(someResults);
314 } 320 }
315 } else { 321 } else {
316 result = MochiKit.Async.fail(cancels[0]); 322 result = MochiKit.Async.fail(cancels[0]);
317 } 323 }
318 324
319 return result; 325 return result;
320 }/*, this._methodResults */); 326 }/*, this._methodResults */);
321 327
322 return this; 328 return this;
323} 329}
324 330
325MochiKit.Base.update(Clipperz.Async.DeferredSynchronizer.prototype, { 331MochiKit.Base.update(Clipperz.Async.DeferredSynchronizer.prototype, {
326 332
327 //----------------------------------------------------------------------------- 333 //-----------------------------------------------------------------------------
328 334
329 'name': function() { 335 'name': function() {
330 return this._name; 336 return this._name;
331 }, 337 },
332 338
333 //----------------------------------------------------------------------------- 339 //-----------------------------------------------------------------------------
334 340
335 'methods': function() { 341 'methods': function() {
336 return this._methods; 342 return this._methods;
337 }, 343 },
338 344
339 'methodResults': function() { 345 'methodResults': function() {
340 return this._methodResults; 346 return this._methodResults;
341 }, 347 },
342 348
343 //----------------------------------------------------------------------------- 349 //-----------------------------------------------------------------------------
344 350
345 'result': function() { 351 'result': function() {
346 return this._result; 352 return this._result;
347 }, 353 },
348 354
349 //----------------------------------------------------------------------------- 355 //-----------------------------------------------------------------------------
350 356
351 'numberOfMethodsDone':function() { 357 'numberOfMethodsDone':function() {
352 return this._numberOfMethodsDone; 358 return this._numberOfMethodsDone;
353 }, 359 },
354 360
355 'incrementNumberOfMethodsDone': function() { 361 'incrementNumberOfMethodsDone': function() {
356 this._numberOfMethodsDone ++; 362 this._numberOfMethodsDone ++;
357 }, 363 },
358 364
359 //----------------------------------------------------------------------------- 365 //-----------------------------------------------------------------------------
360 366
361 'run': function(args, aValue) { 367 'run': function(args, aValue) {
362 var deferredResults; 368 var deferredResults;
363 var i, c; 369 var i, c;
364 370
365 deferredResults = []; 371 deferredResults = [];
366 args = args || {}; 372 args = args || {};
367 373
368 c = this.methods().length; 374 c = this.methods().length;
369 for (i=0; i<c; i++) { 375 for (i=0; i<c; i++) {
370 var deferredResult; 376 var deferredResult;
371 varmethodCalls; 377 varmethodCalls;
372 var ii, cc; 378 var ii, cc;
373 379
374//console.log("TYPEOF", typeof(this.methods()[i])); 380//console.log("TYPEOF", typeof(this.methods()[i]));
375 if (typeof(this.methods()[i]) == 'function') { 381 if (typeof(this.methods()[i]) == 'function') {
376 methodCalls = [ this.methods()[i] ]; 382 methodCalls = [ this.methods()[i] ];
377 } else { 383 } else {
378 methodCalls = this.methods()[i]; 384 methodCalls = this.methods()[i];
379 } 385 }
380 386
381 cc = methodCalls.length; 387 cc = methodCalls.length;
382 deferredResult = new Clipperz.Async.Deferred("Clipperz.Async.DeferredSynchronizer.run => " + this.name() + "[" + i + "]", args); 388 deferredResult = new Clipperz.Async.Deferred("Clipperz.Async.DeferredSynchronizer.run => " + this.name() + "[" + i + "]", args);
383 for (ii=0; ii<cc; ii++) { 389 for (ii=0; ii<cc; ii++) {
384 deferredResult.addCallback(methodCalls[ii]); 390 deferredResult.addCallback(methodCalls[ii]);
385 } 391 }
386 deferredResult.addBoth(MochiKit.Base.method(this, 'handleMethodCallDone', i)); 392 deferredResult.addBoth(MochiKit.Base.method(this, 'handleMethodCallDone', i));
387 393
388 deferredResults.push(deferredResult); 394 deferredResults.push(deferredResult);
389 } 395 }
390 396
391 for (i=0; i<c; i++) { 397 for (i=0; i<c; i++) {
392 deferredResults[i].callback(aValue); 398 deferredResults[i].callback(aValue);
393 } 399 }
394 400
395 return this.result(); 401 return this.result();
396 }, 402 },
397 403
398 //----------------------------------------------------------------------------- 404 //-----------------------------------------------------------------------------
399 405
400 'handleMethodCallDone': function(anIndexValue, aResult) { 406 'handleMethodCallDone': function(anIndexValue, aResult) {
401 this.incrementNumberOfMethodsDone(); 407 this.incrementNumberOfMethodsDone();
402 this.methodResults()[anIndexValue] = aResult; 408 this.methodResults()[anIndexValue] = aResult;
403 409
404 if (this.numberOfMethodsDone() < this.methods().length) { 410 if (this.numberOfMethodsDone() < this.methods().length) {
405 //nothing to do here other than possibly log something 411 //nothing to do here other than possibly log something
406 } else if (this.numberOfMethodsDone() == this.methods().length) { 412 } else if (this.numberOfMethodsDone() == this.methods().length) {
407 this.result().callback(); 413 this.result().callback();
408 } else if (this.numberOfMethodsDone() > this.methods().length) { 414 } else if (this.numberOfMethodsDone() > this.methods().length) {
415 alert("Clipperz.Async.Deferred.handleMethodCallDone -> WTF!");
409 //WTF!!! :( 416 //WTF!!! :(
410 } 417 }
411 418
412 }, 419 },
413 420
414 //----------------------------------------------------------------------------- 421 //-----------------------------------------------------------------------------
415 422
416 __syntaxFix__: "syntax fix" 423 __syntaxFix__: "syntax fix"
417}); 424});
418 425
419//############################################################################# 426//#############################################################################
420 427
421MochiKit.Base.update(Clipperz.Async, { 428MochiKit.Base.update(Clipperz.Async, {
422 429
423 'callbacks': function (aName, someFunctions, someArguments, aCallbackValue) { 430 'callbacks': function (aName, someFunctions, someArguments, aCallbackValue) {
424 var deferredResult; 431 var deferredResult;
425 var i, c; 432 var i, c;
426 433
427 deferredResult = new Clipperz.Async.Deferred(aName, someArguments); 434 deferredResult = new Clipperz.Async.Deferred(aName, someArguments);
428 c = someFunctions.length; 435 c = someFunctions.length;
429 for (i=0; i<c; i++) { 436 for (i=0; i<c; i++) {
430 deferredResult.addCallback(someFunctions[i]); 437 deferredResult.addCallback(someFunctions[i]);
431 } 438 }
432 deferredResult.callback(aCallbackValue); 439 deferredResult.callback(aCallbackValue);
433 440
434 return deferredResult; 441 return deferredResult;
435 }, 442 },
436 443
437 //------------------------------------------------------------------------- 444 //-------------------------------------------------------------------------
438 445
439 'forkAndJoin': function (aName, someMethods, args) { 446 'forkAndJoin': function (aName, someMethods, args) {
440 return MochiKit.Base.partial(function (aName, someMethods, args, aValue) { 447 return MochiKit.Base.partial(function (aName, someMethods, args, aValue) {
441 var synchronizer; 448 var synchronizer;
442 varresult; 449 varresult;
443 450
444 args = args || {}; 451 args = args || {};
445 synchronizer = new Clipperz.Async.DeferredSynchronizer(aName, someMethods); 452 synchronizer = new Clipperz.Async.DeferredSynchronizer(aName, someMethods);
446 result = synchronizer.run(args, aValue); 453 result = synchronizer.run(args, aValue);
447 454
448 return result; 455 return result;
449 }, aName, someMethods, args); 456 }, aName, someMethods, args);
450 }, 457 },
451 458
452 //------------------------------------------------------------------------- 459 //-------------------------------------------------------------------------
453 460
454 'collectResults': function(aName, someRequests, args) { 461 'collectResults': function(aName, someRequests, args) {
455 return MochiKit.Base.partial(function(aName, someRequests, args, aValue) { 462 return MochiKit.Base.partial(function(aName, someRequests, args, aValue) {
456 var deferredResult; 463 var deferredResult;
457 var requestKeys; 464 var requestKeys;
458 var methods; 465 var methods;
459 466
460 requestKeys = MochiKit.Base.keys(someRequests); 467 requestKeys = MochiKit.Base.keys(someRequests);
461 methods = MochiKit.Base.values(someRequests); 468 methods = MochiKit.Base.values(someRequests);
462 469
463 deferredResult = new Clipperz.Async.Deferred(aName, args); 470 deferredResult = new Clipperz.Async.Deferred(aName, args);
464 deferredResult.addCallback(Clipperz.Async.forkAndJoin(aName + " [inner forkAndJoin]", methods, args)); 471 deferredResult.addCallback(Clipperz.Async.forkAndJoin(aName + " [inner forkAndJoin]", methods, args));
465 deferredResult.addBoth(function(someResults) { 472 deferredResult.addBoth(function(someResults) {
466 var returnFunction; 473 var returnFunction;
467 var results; 474 var results;
468 var i,c; 475 var i,c;
469 var result; 476 var result;
470 477
471 if (someResults instanceof MochiKit.Async.CancelledError) { 478 if (someResults instanceof MochiKit.Async.CancelledError) {
472 returnFunction = MochiKit.Async.fail; 479 returnFunction = MochiKit.Async.fail;
473 result = someResults; 480 result = someResults;
474 } else { 481 } else {
475 if (someResults instanceof Error) { 482 if (someResults instanceof Error) {
476 returnFunction = MochiKit.Async.fail; 483 returnFunction = MochiKit.Async.fail;
477 results = someResults['message']; 484 results = someResults['message'];
478 } else { 485 } else {
479 returnFunction = MochiKit.Async.succeed; 486 returnFunction = MochiKit.Async.succeed;
480 results = someResults; 487 results = someResults;
481 } 488 }
482 489
483 result = {}; 490 result = {};
484 491
485 c = requestKeys.length; 492 c = requestKeys.length;
486 for (i=0; i<c; i++) { 493 for (i=0; i<c; i++) {
487 result[requestKeys[i]] = results[i]; 494 result[requestKeys[i]] = results[i];
488 } 495 }
489 } 496 }
490 497
491 return returnFunction.call(null, result); 498 return returnFunction.call(null, result);
492 }); 499 });
493 deferredResult.callback(aValue); 500 deferredResult.callback(aValue);
494 501
495 return deferredResult; 502 return deferredResult;
496 }, aName, someRequests, args); 503 }, aName, someRequests, args);
497 }, 504 },
498 505
499 //------------------------------------------------------------------------- 506 //-------------------------------------------------------------------------
500 507
501 'collectAll': function (someDeferredObjects) { 508 'collectAll': function (someDeferredObjects) {
502 var deferredResult; 509 var deferredResult;
503 510
504 deferredResult = new MochiKit.Async.DeferredList(someDeferredObjects, false, false, false); 511 deferredResult = new MochiKit.Async.DeferredList(someDeferredObjects, false, false, false);
diff --git a/frontend/gamma/js/Clipperz/PM/Proxy.js b/frontend/gamma/js/Clipperz/PM/Proxy.js
index 190bffd..9817eac 100644
--- a/frontend/gamma/js/Clipperz/PM/Proxy.js
+++ b/frontend/gamma/js/Clipperz/PM/Proxy.js
@@ -49,121 +49,121 @@ Clipperz.PM.Proxy = function(args) {
49Clipperz.PM.Proxy.prototype = MochiKit.Base.update(null, { 49Clipperz.PM.Proxy.prototype = MochiKit.Base.update(null, {
50 50
51 'toString': function() { 51 'toString': function() {
52 return "Clipperz.PM.Proxy"; 52 return "Clipperz.PM.Proxy";
53 }, 53 },
54 54
55 //========================================================================= 55 //=========================================================================
56 56
57 'shouldPayTolls': function() { 57 'shouldPayTolls': function() {
58 return this._shouldPayTolls; 58 return this._shouldPayTolls;
59 }, 59 },
60 60
61 //------------------------------------------------------------------------- 61 //-------------------------------------------------------------------------
62 62
63 'tolls': function() { 63 'tolls': function() {
64 return this._tolls; 64 return this._tolls;
65 }, 65 },
66 66
67 //------------------------------------------------------------------------- 67 //-------------------------------------------------------------------------
68 68
69 'payToll': function(aRequestType, someParameters) { 69 'payToll': function(aRequestType, someParameters) {
70 vardeferredResult; 70 vardeferredResult;
71 71
72//console.log(">>> Proxy.payToll", aRequestType, someParameters); 72//console.log(">>> Proxy.payToll", aRequestType, someParameters);
73 if (this.shouldPayTolls()) { 73 if (this.shouldPayTolls()) {
74 deferredResult = new Clipperz.Async.Deferred("Proxy.payToll", {trace:false}); 74 deferredResult = new Clipperz.Async.Deferred("Proxy.payToll", {trace:false});
75 75
76 if (this.tolls()[aRequestType].length == 0) { 76 if (this.tolls()[aRequestType].length == 0) {
77 deferredResult.addMethod(this, 'sendMessage', 'knock', {requestType:aRequestType}); 77 deferredResult.addMethod(this, 'sendMessage', 'knock', {requestType:aRequestType});
78 deferredResult.addMethod(this, 'setTollCallback'); 78 deferredResult.addMethod(this, 'setTollCallback');
79 } 79 }
80 deferredResult.addMethod(this.tolls()[aRequestType], 'pop'); 80 deferredResult.addMethod(this.tolls()[aRequestType], 'pop');
81 deferredResult.addCallback(MochiKit.Base.methodcaller('deferredPay')); 81 deferredResult.addCallback(MochiKit.Base.methodcaller('deferredPay'));
82 deferredResult.addCallback(function(aToll) { 82 deferredResult.addCallback(function(aToll) {
83 var result; 83 var result;
84 84
85 result = { 85 result = {
86 parameters: someParameters, 86 parameters: someParameters,
87 toll: aToll 87 toll: aToll
88 } 88 }
89 89
90 return result; 90 return result;
91 }); 91 });
92 92
93 deferredResult.callback(); 93 deferredResult.callback();
94 } else { 94 } else {
95 deferredResult = MochiKit.Async.succeed({parameters:someParameters}); 95 deferredResult = MochiKit.Async.succeed({parameters:someParameters});
96 } 96 }
97//console.log("<<< Proxy.payToll"); 97//console.log("<<< Proxy.payToll");
98 98
99 return deferredResult; 99 return deferredResult;
100 }, 100 },
101 101
102 //------------------------------------------------------------------------- 102 //-------------------------------------------------------------------------
103 103
104 'addToll': function(aToll) { 104 'addToll': function(aToll) {
105//console.log(">>> Proxy.addToll", aToll); 105//console.log(">>> Proxy.addToll", aToll);
106 this.tolls()[aToll.requestType()].push(aToll); 106 this.tolls()[aToll.requestType()].push(aToll);
107//console.log("<<< Proxy.addToll"); 107//console.log("<<< Proxy.addToll");
108 }, 108 },
109 109
110 //========================================================================= 110 //=========================================================================
111 111
112 'setTollCallback': function(someParameters) { 112 'setTollCallback': function(someParameters) {
113//console.log(">>> Proxy.setTollCallback", someParameters); 113//console.log(">>> Proxy.setTollCallback", someParameters);
114 if (typeof(someParameters['toll']) != 'undefined') { 114 if (typeof(someParameters['toll']) != 'undefined') {
115//console.log("added a new toll", someParameters['toll']); 115//console.log("added a new toll", someParameters['toll']);
116 this.addToll(new Clipperz.PM.Toll(someParameters['toll'])); 116 this.addToll(new Clipperz.PM.Toll(someParameters['toll']));
117 } 117 }
118//console.log("<<< Proxy.setTallCallback", someParameters['result']); 118//console.log("<<< Proxy.setTallCallback", someParameters['result']);
119 return someParameters['result']; 119 return someParameters['result'];
120 }, 120 },
121 121
122 //========================================================================= 122 //=========================================================================
123 123
124 'registration': function (someParameters) { 124 'registration': function (someParameters) {
125 return this.processMessage('registration', someParameters, 'REGISTER'); 125 return this.processMessage('registration', someParameters, 'REGISTER');
126 }, 126 },
127 127
128 'handshake': function (someParameters) { 128 'handshake': function (someParameters) {
129 return this.processMessage('handshake', someParameters, 'CONNECT'); 129 return this.processMessage('handshake', someParameters, 'CONNECT');
130 }, 130 },
131 131
132 'message': function (someParameters) { 132 'message': function (someParameters) {
133 return this.processMessage('message', someParameters, 'MESSAGE'); 133 return this.processMessage('message', someParameters, 'MESSAGE');
134 }, 134 },
135 135
136 'logout': function (someParameters) { 136 'logout': function (someParameters) {
137 return this.processMessage('logout', someParameters, 'MESSAGE'); 137 return this.processMessage('logout', someParameters, 'MESSAGE');
138 }, 138 },
139 139
140 //========================================================================= 140 //=========================================================================
141 141
142 'processMessage': function (aFunctionName, someParameters, aRequestType) { 142 'processMessage': function (aFunctionName, someParameters, aRequestType) {
143 vardeferredResult; 143 vardeferredResult;
144 144
145 deferredResult = new Clipperz.Async.Deferred("Proxy.processMessage", {trace:false}); 145 deferredResult = new Clipperz.Async.Deferred("Proxy.processMessage", {trace:true});
146 deferredResult.addMethod(this, 'payToll', aRequestType); 146 deferredResult.addMethod(this, 'payToll', aRequestType);
147 deferredResult.addMethod(this, 'sendMessage', aFunctionName); 147 deferredResult.addMethod(this, 'sendMessage', aFunctionName);
148 deferredResult.addMethod(this, 'setTollCallback'); 148 deferredResult.addMethod(this, 'setTollCallback');
149 deferredResult.callback(someParameters); 149 deferredResult.callback(someParameters);
150 150
151 return deferredResult; 151 return deferredResult;
152 }, 152 },
153 153
154 //========================================================================= 154 //=========================================================================
155 155
156 'sendMessage': function () { 156 'sendMessage': function () {
157 throw Clipperz.Base.exception.AbstractMethod; 157 throw Clipperz.Base.exception.AbstractMethod;
158 }, 158 },
159 159
160 //========================================================================= 160 //=========================================================================
161 161
162 'isReadOnly': function () { 162 'isReadOnly': function () {
163 return false; 163 return false;
164 }, 164 },
165 165
166 //========================================================================= 166 //=========================================================================
167 __syntaxFix__: "syntax fix" 167 __syntaxFix__: "syntax fix"
168 168
169}); 169});