jsf.js_next_gen 4.0.0-RC.1 → 4.0.0-RC.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/docs/assets/main.js +1 -1
  2. package/dist/docs/functions/faces.push.init.html +5 -1
  3. package/dist/docs/functions/myfaces.ab.html +2 -2
  4. package/dist/window/faces-development.js +403 -141
  5. package/dist/window/faces-development.js.br +0 -0
  6. package/dist/window/faces-development.js.gz +0 -0
  7. package/dist/window/faces-development.js.map +1 -1
  8. package/dist/window/faces.js +1 -1
  9. package/dist/window/faces.js.br +0 -0
  10. package/dist/window/faces.js.gz +0 -0
  11. package/dist/window/faces.js.map +1 -1
  12. package/dist/window/jsf-development.js +414 -141
  13. package/dist/window/jsf-development.js.br +0 -0
  14. package/dist/window/jsf-development.js.gz +0 -0
  15. package/dist/window/jsf-development.js.map +1 -1
  16. package/dist/window/jsf.js +1 -1
  17. package/dist/window/jsf.js.br +0 -0
  18. package/dist/window/jsf.js.gz +0 -0
  19. package/dist/window/jsf.js.map +1 -1
  20. package/package.json +11 -11
  21. package/src/main/typescript/@types/definitions/index.d.ts +17 -2
  22. package/src/main/typescript/api/_api.ts +4 -2
  23. package/src/main/typescript/api/jsf.ts +18 -0
  24. package/src/main/typescript/impl/AjaxImpl.ts +22 -2
  25. package/src/main/typescript/impl/PushImpl.ts +38 -12
  26. package/src/main/typescript/impl/core/Const.ts +9 -5
  27. package/src/main/typescript/impl/util/Assertions.ts +14 -6
  28. package/src/main/typescript/impl/util/AsyncQueue.ts +1 -1
  29. package/src/main/typescript/impl/util/ExtDomQuery.ts +4 -1
  30. package/src/main/typescript/impl/util/Lang.ts +3 -3
  31. package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +8 -1
  32. package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +13 -3
  33. package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +1 -1
  34. package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +92 -30
  35. package/src/main/typescript/impl/xhrCore/XhrFormData.ts +24 -12
  36. package/src/main/typescript/myfaces/OamSubmit.ts +15 -10
  37. package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +1 -1
  38. package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +40 -1
  39. package/src/main/typescript/test/xhrCore/OamSubmitTest.spec.ts +177 -0
  40. package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +237 -8
  41. package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +174 -10
  42. package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +8 -6
  43. package/src/main/typescript/test.xml +6 -0
  44. package/target/api/_api.js +3 -2
  45. package/target/api/_api.js.map +1 -1
  46. package/target/api/jsf.js +11 -0
  47. package/target/api/jsf.js.map +1 -1
  48. package/target/impl/AjaxImpl.js +18 -0
  49. package/target/impl/AjaxImpl.js.map +1 -1
  50. package/target/impl/PushImpl.js +44 -14
  51. package/target/impl/PushImpl.js.map +1 -1
  52. package/target/impl/core/Const.js +10 -8
  53. package/target/impl/core/Const.js.map +1 -1
  54. package/target/impl/util/Assertions.js +11 -6
  55. package/target/impl/util/Assertions.js.map +1 -1
  56. package/target/impl/util/AsyncQueue.js.map +1 -1
  57. package/target/impl/util/ExtDomQuery.js +3 -0
  58. package/target/impl/util/ExtDomQuery.js.map +1 -1
  59. package/target/impl/util/Lang.js +3 -3
  60. package/target/impl/util/Lang.js.map +1 -1
  61. package/target/impl/xhrCore/RequestDataResolver.js +11 -2
  62. package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
  63. package/target/impl/xhrCore/ResonseDataResolver.js +1 -1
  64. package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
  65. package/target/impl/xhrCore/ResponseProcessor.js +85 -24
  66. package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
  67. package/target/impl/xhrCore/XhrFormData.js +18 -7
  68. package/target/impl/xhrCore/XhrFormData.js.map +1 -1
  69. package/target/myfaces/OamSubmit.js +13 -11
  70. package/target/myfaces/OamSubmit.js.map +1 -1
  71. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +1 -1
  72. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
  73. package/target/test/frameworkBase/_ext/shared/XmlResponses.js +37 -1
  74. package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
  75. package/target/test/xhrCore/OamSubmitTest.spec.js +180 -0
  76. package/target/test/xhrCore/OamSubmitTest.spec.js.map +1 -0
  77. package/target/test/xhrCore/RequestTest.spec.js +214 -7
  78. package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
  79. package/target/test/xhrCore/ResponseTest.spec.js +139 -8
  80. package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
  81. package/target/test/xhrCore/ResponseTest23.spec.js +5 -5
  82. package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
  83. package/target/classes/com/example/jsfs_js_ts/DecoratedFacesJS.class +0 -0
  84. package/target/classes/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.class +0 -0
  85. package/target/classes/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.class +0 -0
  86. package/target/classes/com/example/jsfs_js_ts/FacesJSMappingDecorator.class +0 -0
  87. package/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +0 -4
  88. package/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +0 -4
  89. package/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst +0 -1
  90. package/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst +0 -1
  91. package/target/surefire-reports/TEST-com.example.jsfs_js_ts.JsfsJsTsApplicationTests.xml +0 -78
  92. package/target/surefire-reports/com.example.jsfs_js_ts.JsfsJsTsApplicationTests.txt +0 -7
  93. package/target/test-classes/.gz +0 -0
  94. package/target/test-classes/com/example/jsfs_js_ts/JsfsJsTsApplicationTests.class +0 -0
  95. package/target/test-classes/fileuploadtest.html +0 -24
  96. package/target/test-classes/jsf-development.js +0 -3559
  97. package/target/test-classes/jsf-development.js.br +0 -0
  98. package/target/test-classes/jsf-development.js.gz +0 -0
  99. package/target/test-classes/jsf-development.js.map +0 -1
  100. package/target/test-classes/jsf.js +0 -3
  101. package/target/test-classes/jsf.js.br +0 -0
  102. package/target/test-classes/jsf.js.gz +0 -0
@@ -39,8 +39,10 @@ let issueStdReq = function (element) {
39
39
  faces.ajax.request(element, null, {
40
40
  execute: "input_1",
41
41
  render: "@form",
42
- pass1: "pass1",
43
- pass2: "pass2"
42
+ params: {
43
+ pass1: "pass1",
44
+ pass2: "pass2"
45
+ }
44
46
  });
45
47
  };
46
48
  /**
@@ -103,7 +105,6 @@ describe('Tests on the xhr core when it starts to call the request', function ()
103
105
  });
104
106
 
105
107
  it('it must have the pass through values properly passed', function (done) {
106
-
107
108
  let send = sinon.spy(XMLHttpRequest.prototype, "send");
108
109
  try {
109
110
  let element = DomQuery.byId("input_2").getAsElem(0).value;
@@ -135,6 +136,35 @@ describe('Tests on the xhr core when it starts to call the request', function ()
135
136
  done();
136
137
  });
137
138
 
139
+ it('it must handle resetValues properly', function (done) {
140
+ let send = sinon.spy(XMLHttpRequest.prototype, "send");
141
+ try {
142
+ let element = DomQuery.byId("input_2").getAsElem(0).value;
143
+ faces.ajax.request(element, null, {
144
+ execute: "input_1",
145
+ resetValues: true,
146
+ render: "@form",
147
+ params: {
148
+ pass1: "pass1",
149
+ pass2: "pass2"
150
+ }
151
+ });
152
+
153
+ expect(send.called).to.be.true;
154
+ let argsVal: any = send.args[0][0];
155
+ let arsArr = argsVal.split("&");
156
+ let resultsMap = {};
157
+ for (let val of arsArr) {
158
+ let keyVal = val.split("=");
159
+ resultsMap[keyVal[0]] = keyVal[1];
160
+ }
161
+ expect(resultsMap["jakarta.faces.partial.resetValues"]).to.eq("true");
162
+ } finally {
163
+ send.restore();
164
+ }
165
+ done();
166
+ });
167
+
138
168
  it('it must have the proper target type', function (done) {
139
169
  let send = sinon.spy(XMLHttpRequest.prototype, "send");
140
170
  try {
@@ -196,16 +226,24 @@ describe('Tests after core when it hits response', function () {
196
226
  faces.ajax.request(element, null, {
197
227
  execute: "input_1",
198
228
  render: "@form",
199
- pass1: "pass1",
200
- pass2: "pass2",
229
+ params: {
230
+ pass1: "pass1",
231
+ pass2: "pass2"
232
+ },
233
+ message: "Hello World",
201
234
  onevent: (evt: any) => {
202
235
  localCnt++;
203
236
  }
204
237
  });
205
238
 
206
239
  let xhrReq = this.requests[0];
240
+ let requestBody = xhrReq.requestBody.split("&");
207
241
 
208
242
  xhrReq.respond(200, {'Content-Type': 'text/xml'}, STD_XML);
243
+ expect(requestBody.indexOf("pass1=pass1")).not.to.eq(-1);
244
+ expect(requestBody.indexOf("pass2=pass2")).not.to.eq(-1);
245
+ expect(requestBody.indexOf("message=Hello%20World")).not.to.eq(-1);
246
+
209
247
  expect(this.jsfAjaxResponse.callCount).to.eq(1);
210
248
  //success ommitted due to fake response
211
249
  expect(globalCnt == 3).to.eq(true);
@@ -220,7 +258,8 @@ describe('Tests after core when it hits response', function () {
220
258
 
221
259
  });
222
260
 
223
- it('it must have called request and the pass through values must be properly transferred into the context', function (done) {
261
+ it('it must have called request and the pass through values must be properly transferred ' +
262
+ 'into the context, via the old non spec conform behavior', function (done) {
224
263
  let send = sinon.spy(XMLHttpRequest.prototype, "send");
225
264
  let globalCnt = 0;
226
265
  let localCnt = 0;
@@ -273,6 +312,67 @@ describe('Tests after core when it hits response', function () {
273
312
  xhrReq.respond(200, {'Content-Type': 'text/xml'}, STD_XML);
274
313
 
275
314
 
315
+ } catch (e) {
316
+ console.error(e);
317
+
318
+ } finally {
319
+ send.restore();
320
+ }
321
+ });
322
+
323
+ it('it must have allow array key value pairs as passthroughs', function (done) {
324
+ let send = sinon.spy(XMLHttpRequest.prototype, "send");
325
+ let globalCnt = 0;
326
+ let localCnt = 0;
327
+ let xhrReq = null;
328
+
329
+ try {
330
+ let element = DomQuery.byId("input_2").getAsElem(0).value;
331
+ faces.ajax.addOnEvent(() => {
332
+ globalCnt++;
333
+ });
334
+
335
+
336
+ faces.ajax.request(element, null, {
337
+ execute: "input_1",
338
+ render: "@form",
339
+ params: [["pass1", "pass1"],
340
+ ["pass2", "pass2"]],
341
+
342
+ onevent: (evt: any) => {
343
+ localCnt++;
344
+ if (evt.status == COMPLETE) {
345
+ expect(!!xhrReq.responseXML).to.be.true;
346
+ }
347
+ if (evt.status == SUCCESS) {
348
+ expect(this.jsfAjaxResponse.callCount).to.eq(1);
349
+
350
+ expect(this.jsfAjaxResponse.firstCall.args[0] instanceof XMLHttpRequest).to.be.true;
351
+ let lastArg = this.jsfAjaxResponse.firstCall.args[1];
352
+ expect(lastArg.onevent != null).to.be.true;
353
+ expect(lastArg.onevent instanceof Function).to.be.true;
354
+ expect(!!lastArg.onError).to.be.false;
355
+ expect(lastArg.pass1 == "pass1").to.be.true;
356
+ expect(lastArg.pass2 == "pass2").to.be.true;
357
+ expect(!!lastArg[P_PARTIAL_SOURCE]).to.be.true;
358
+ expect(!!lastArg[P_AJAX]).to.be.true;
359
+ expect(!!lastArg[P_EXECUTE]).to.be.true;
360
+ expect(!!lastArg[P_RENDER]).to.be.true;
361
+
362
+ expect(this.jsfAjaxResponse.firstCall.args.length).to.eq(2);
363
+
364
+ expect(globalCnt == 2).to.eq(true); //local before global
365
+ expect(localCnt == 3).to.eq(true);
366
+
367
+ done();
368
+ }
369
+ }
370
+ });
371
+
372
+ xhrReq = this.requests[0];
373
+ xhrReq.responsetype = "text/xml";
374
+ xhrReq.respond(200, {'Content-Type': 'text/xml'}, STD_XML);
375
+
276
376
 
277
377
  } catch (e) {
278
378
  console.error(e);
@@ -282,6 +382,68 @@ describe('Tests after core when it hits response', function () {
282
382
  }
283
383
  });
284
384
 
385
+ it('it must have called request and the pass through values must be properly transferred into the context', function (done) {
386
+ let send = sinon.spy(XMLHttpRequest.prototype, "send");
387
+ let globalCnt = 0;
388
+ let localCnt = 0;
389
+ let xhrReq = null;
390
+
391
+ try {
392
+ let element = DomQuery.byId("input_2").getAsElem(0).value;
393
+ faces.ajax.addOnEvent(() => {
394
+ globalCnt++;
395
+ });
396
+
397
+
398
+ faces.ajax.request(element, null, {
399
+ execute: "input_1",
400
+ render: "@form",
401
+ params: {
402
+ pass1: "pass1",
403
+ pass2: "pass2",
404
+ },
405
+ onevent: (evt: any) => {
406
+ localCnt++;
407
+ if (evt.status == COMPLETE) {
408
+ expect(!!xhrReq.responseXML).to.be.true;
409
+ }
410
+ if (evt.status == SUCCESS) {
411
+ expect(this.jsfAjaxResponse.callCount).to.eq(1);
412
+
413
+ expect(this.jsfAjaxResponse.firstCall.args[0] instanceof XMLHttpRequest).to.be.true;
414
+ let lastArg = this.jsfAjaxResponse.firstCall.args[1];
415
+ expect(lastArg.onevent != null).to.be.true;
416
+ expect(lastArg.onevent instanceof Function).to.be.true;
417
+ expect(!!lastArg.onError).to.be.false;
418
+ expect(lastArg.pass1 == "pass1").to.be.true;
419
+ expect(lastArg.pass2 == "pass2").to.be.true;
420
+ expect(!!lastArg[P_PARTIAL_SOURCE]).to.be.true;
421
+ expect(!!lastArg[P_AJAX]).to.be.true;
422
+ expect(!!lastArg[P_EXECUTE]).to.be.true;
423
+ expect(!!lastArg[P_RENDER]).to.be.true;
424
+
425
+ expect(this.jsfAjaxResponse.firstCall.args.length).to.eq(2);
426
+
427
+ expect(globalCnt == 2).to.eq(true); //local before global
428
+ expect(localCnt == 3).to.eq(true);
429
+
430
+ done();
431
+ }
432
+ }
433
+ });
434
+
435
+ xhrReq = this.requests[0];
436
+ xhrReq.responsetype = "text/xml";
437
+ xhrReq.respond(200, {'Content-Type': 'text/xml'}, STD_XML);
438
+
439
+
440
+ } catch (e) {
441
+ console.error(e);
442
+
443
+ } finally {
444
+ send.restore();
445
+ }
446
+ });
285
447
 
286
448
 
287
449
  it('it must have called onError in the error case', function (done) {
@@ -296,8 +458,10 @@ describe('Tests after core when it hits response', function () {
296
458
  faces.ajax.request(element, null, {
297
459
  execute: "input_1",
298
460
  render: "@form",
299
- pass1: "pass1",
300
- pass2: "pass2",
461
+ params: {
462
+ pass1: "pass1",
463
+ pass2: "pass2",
464
+ },
301
465
  onerror: (error: any) => {
302
466
  expect(error.type).to.eq("error");
303
467
  expect(!!error.status).to.eq(true);
@@ -327,5 +491,70 @@ describe('Tests after core when it hits response', function () {
327
491
  }
328
492
 
329
493
  });
494
+
495
+ // We can cover this TCK issue in a simple code unit test, the case is simple enough
496
+ it("must throw an error on invalid delays (MYFACES-4499, TCK_ISSUE320IT )", (done) => {
497
+
498
+ let element = DomQuery.byId("input_2").getAsElem(0).value;
499
+ try {
500
+ faces.ajax.request(element, null, {
501
+ execute: "input_1",
502
+ render: "@form",
503
+ delay: NaN,
504
+ params: {
505
+ pass1: "pass1",
506
+ pass2: "pass2",
507
+ }
508
+ });
509
+ } catch (e) {
510
+ expect(e.message.indexOf("NaN") > 0).to.eq(true, "Invalid NaN in message");
511
+ done();
512
+ return;
513
+ }
514
+ done("Expecting a client error to be thrown")
515
+ });
516
+
517
+ it("must throw an error on invalid delays (MYFACES-4499, TCK_ISSUE320IT ) - 2", (done) => {
518
+
519
+ let element = DomQuery.byId("input_2").getAsElem(0).value;
520
+ try {
521
+ faces.ajax.request(element, null, {
522
+ execute: "input_1",
523
+ render: "@form",
524
+ delay: -1,
525
+ params: {
526
+ pass1: "pass1",
527
+ pass2: "pass2",
528
+ }
529
+ });
530
+ } catch (e) {
531
+ expect(e.message.indexOf("-1") > 0).to
532
+ .eq(true, "Invalid integer value in message");
533
+ done();
534
+ return;
535
+ }
536
+ done("Expecting a client error to be thrown")
537
+ });
538
+ it("must throw an error on invalid delays (MYFACES-4499, TCK_ISSUE320IT ) - 3", (done) => {
539
+
540
+ let element = DomQuery.byId("input_2").getAsElem(0).value;
541
+ try {
542
+ faces.ajax.request(element, null, {
543
+ execute: "input_1",
544
+ render: "@form",
545
+ delay: "booga",
546
+ params: {
547
+ pass1: "pass1",
548
+ pass2: "pass2",
549
+ }
550
+ });
551
+ } catch (e) {
552
+ expect(e.message.indexOf("booga") > 0).to.be
553
+ .eq(true, "Invalid string value in message");
554
+ done();
555
+ return;
556
+ }
557
+ done("Expecting a client error to be thrown")
558
+ });
330
559
  });
331
560
 
@@ -21,9 +21,9 @@ import * as sinon from "sinon";
21
21
 
22
22
  import {XmlResponses} from "../frameworkBase/_ext/shared/XmlResponses";
23
23
  import {expect} from "chai";
24
- import {DomQuery, DQ} from "mona-dish";
24
+ import {DomQuery, DQ, DQ$} from "mona-dish";
25
25
  import protocolPage = StandardInits.protocolPage;
26
- import exp from "constants";
26
+
27
27
 
28
28
  declare var faces: any;
29
29
  declare var Implementation: any;
@@ -199,7 +199,7 @@ describe('Tests of the various aspects of the response protocol functionality',
199
199
  "embedded scripts must be executed").to.be.true;
200
200
  });
201
201
 
202
- it("must have a viewstate update to be peformed", function () {
202
+ it("must have a viewState update to be performed", function () {
203
203
  DQ.byId("cmd_viewstate").click();
204
204
 
205
205
  this.respond(XmlResponses.VIEWSTATE_1);
@@ -253,10 +253,9 @@ describe('Tests of the various aspects of the response protocol functionality',
253
253
  </partial-response>`);
254
254
 
255
255
 
256
- expect(DQ.byId("jakarta.faces.ViewState").isAbsent()).to.be.false;
256
+ expect(DQ$("[name='jakarta.faces.ViewState']").isPresent()).to.be.true;
257
257
 
258
- expect((<HTMLInputElement>document.getElementById("jakarta.faces.ViewState")).value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
259
- expect(DQ.byId("jakarta.faces.ViewState").inputValue.value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
258
+ expect(DQ$("[name='jakarta.faces.ViewState']").val == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
260
259
  });
261
260
 
262
261
 
@@ -290,10 +289,10 @@ describe('Tests of the various aspects of the response protocol functionality',
290
289
  </partial-response>`);
291
290
 
292
291
 
293
- expect(DQ.byId("jakarta.faces.ViewState").isAbsent()).to.be.false;
292
+ expect(DQ$("[name='jakarta.faces.ViewState']").isAbsent()).to.be.false;
294
293
 
295
- expect((<HTMLInputElement>document.getElementById("jakarta.faces.ViewState")).value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
296
- expect(DQ.byId("jakarta.faces.ViewState").inputValue.value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
294
+ expect((<HTMLInputElement>document.getElementsByName("jakarta.faces.ViewState")[0]).value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
295
+ expect(DQ$("[name='jakarta.faces.ViewState']").inputValue.value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
297
296
  });
298
297
 
299
298
 
@@ -410,7 +409,29 @@ describe('Tests of the various aspects of the response protocol functionality',
410
409
  // this.respond("debugger; document.getElementById('resource_area_1').innerHTML = 'true3'", {'Content-Type': 'text/javascript'});
411
410
  let headHTML = document.head.innerHTML;
412
411
  expect(headHTML.indexOf("../../../xhrCore/fixtures/addedViewHead3.js")).not.eq(-1);
413
- expect(headHTML.indexOf("rel=\"../../../xhrCore/fixtures/addedViewHead2.css\"")).not.eq(-1);
412
+ expect(headHTML.indexOf("href=\"../../../xhrCore/fixtures/addedViewHead2.css\"")).not.eq(-1);
413
+ expect(DQ$("head link[rel='stylesheet'][href='../../../xhrCore/fixtures/addedViewHead2.css']").length).to.eq(1);
414
+ setTimeout(() => {
415
+ let evalAreaHtml = DQ.byId('resource_area_1').innerHTML;
416
+ //last one must be the last item, order must be preserved
417
+ expect(evalAreaHtml).to.eq("booga");
418
+ done();
419
+ }, 800)
420
+
421
+ })
422
+
423
+
424
+ it("head replacement must work (https://issues.apache.org/jira/browse/MYFACES-4498 and TCK Issue 4345IT)", function(done) {
425
+
426
+ DQ.byId("cmd_complex_resource2").click();
427
+ this.respond(XmlResponses.HEAD_REPLACE);
428
+ let headHTML = document.head.innerHTML;
429
+
430
+ //failing now, no elements in the html head after respond!!!
431
+ expect(headHTML.indexOf("href=\"../../../xhrCore/fixtures/addedViewHead2.css\"")).not.eq(-1);
432
+ expect(DQ$("head link[rel='stylesheet'][href='../../../xhrCore/fixtures/addedViewHead2.css']").length).to.eq(1);
433
+
434
+ expect(headHTML.indexOf("../../../xhrCore/fixtures/addedViewHead3.js")).not.eq(-1);
414
435
  setTimeout(() => {
415
436
  let evalAreaHtml = DQ.byId('resource_area_1').innerHTML;
416
437
  //last one must be the last item, order must be preserved
@@ -420,4 +441,147 @@ describe('Tests of the various aspects of the response protocol functionality',
420
441
 
421
442
  })
422
443
 
444
+
445
+ it("complex head replacement must work", function(done) {
446
+
447
+ DQ.byId("cmd_complex_resource2").click();
448
+ this.respond(XmlResponses.HEAD_REPLACE2);
449
+ let headHTML = document.head.innerHTML;
450
+
451
+ //failing now, no elements in the html head after respond!!!
452
+ expect(headHTML.indexOf("href=\"../../../xhrCore/fixtures/addedViewHead2.css\"")).not.eq(-1);
453
+ expect(DQ$("head link[rel='stylesheet'][href='../../../xhrCore/fixtures/addedViewHead2.css']").length).to.eq(1);
454
+
455
+ let metas = DQ$("head meta");
456
+ expect(metas.length).to.eq(5);
457
+ expect(metas.get(0).attr("charSet").value == "UTF-8");
458
+ expect(metas.get(4).attr("author").value == "Whoever");
459
+
460
+ expect(headHTML.indexOf("../../../xhrCore/fixtures/addedViewHead3.js")).not.eq(-1);
461
+ setTimeout(() => {
462
+ let evalAreaHtml = DQ.byId('resource_area_1').innerHTML;
463
+ //last one must be the last item, order must be preserved
464
+ expect(evalAreaHtml).to.eq("booga");
465
+ done();
466
+ }, 800)
467
+
468
+ })
469
+ const INNER_HTML_MULIT_VIEW = `
470
+ <div id="viewroot_1">
471
+ <form id="viewroot_1:form1">
472
+ <button type="submit" id="submit_1"></button>
473
+ <input type="hidden" id="viewroot_1:form1:jakarta.faces.ViewState:1" name="jakarta.faces.ViewState" value="booga"></input>
474
+ </form>
475
+ <form id="viewroot_1:form2">
476
+ <button type="submit" id="submit_2"></button>
477
+ </form>
478
+ </div>
479
+
480
+ <div id="viewroot_2">
481
+ <form id="viewroot_2:form1">
482
+ <button type="submit" id="submit_2"></button>
483
+ </form>
484
+ </div>
485
+ `;
486
+ it("must handle multiple view roots", function (done) {
487
+
488
+
489
+ const RESPONSE_1 = `<?xml version="1.0" encoding="UTF-8"?>
490
+ <partial-response id='viewroot_1'>
491
+ <changes>
492
+ <update id='viewroot_1:jakarta.faces.ViewState:1'><![CDATA[updatedVST]]></update>
493
+ </changes>
494
+ </partial-response>`
495
+
496
+ window.document.body.innerHTML = INNER_HTML_MULIT_VIEW;
497
+
498
+ faces.ajax.request(window.document.getElementById("submit_1"), null, {
499
+ "javax.faces.behavior.event": "change",
500
+ execute: "submit_1",
501
+ render: "viewroot_1:form1"
502
+ });
503
+ this.respond(RESPONSE_1);
504
+ expect(DQ$("#viewroot_1\\:form2 [name='jakarta.faces.ViewState']").isAbsent()).to.be.true;
505
+ expect(DQ$("#viewroot_1\\:form1 [name='jakarta.faces.ViewState']").isPresent()).to.be.true;
506
+ expect(DQ$("#viewroot_1\\:form1 [name='jakarta.faces.ViewState']").val).to.be.eq("updatedVST");
507
+
508
+ done();
509
+ })
510
+
511
+ it("must handle multiple view roots multi forms", function (done) {
512
+ const RESPONSE_1 = `<?xml version="1.0" encoding="UTF-8"?>
513
+ <partial-response id='viewroot_1'>
514
+ <changes>
515
+ <update id='viewroot_1:jakarta.faces.ViewState:1'><![CDATA[updatedVST]]></update>
516
+ </changes>
517
+ </partial-response>`
518
+
519
+ window.document.body.innerHTML = INNER_HTML_MULIT_VIEW;
520
+
521
+ faces.ajax.request(window.document.getElementById("submit_1"), null, {
522
+ "javax.faces.behavior.event": "change",
523
+ execute: "submit_1",
524
+ render: "viewroot_1:form1 submit_2"
525
+ });
526
+ this.respond(RESPONSE_1);
527
+ expect(DQ$("#viewroot_1\\:form2 [name='jakarta.faces.ViewState']").isPresent()).to.be.true;
528
+ expect(DQ$("#viewroot_1\\:form1 [name='jakarta.faces.ViewState']").isPresent()).to.be.true;
529
+ expect(DQ$("#viewroot_2\\:form1\\:form1 [name='jakarta.faces.ViewState']").isAbsent()).to.be.true;
530
+
531
+ expect(faces.getViewState(DQ$("#viewroot_1\\:form2").getAsElem(0).value)).to.be.eq("jakarta.faces.ViewState=updatedVST");
532
+ expect(faces.getViewState("viewroot_1:form1")).to.be.eq("jakarta.faces.ViewState=updatedVST");
533
+
534
+ done();
535
+ })
536
+
537
+
538
+ it("must handle multiple view roots with ClientWindow ids", function (done) {
539
+
540
+
541
+ const RESPONSE_1 = `<?xml version="1.0" encoding="UTF-8"?>
542
+ <partial-response id='viewroot_1'>
543
+ <changes>
544
+ <update id='viewroot_1:jakarta.faces.ClientWindow:1'><![CDATA[updatedViewId]]></update>
545
+ </changes>
546
+ </partial-response>`
547
+
548
+ window.document.body.innerHTML = INNER_HTML_MULIT_VIEW;
549
+
550
+ faces.ajax.request(window.document.getElementById("submit_1"), null, {
551
+ "javax.faces.behavior.event": "change",
552
+ execute: "submit_1",
553
+ render: "viewroot_1:form1"
554
+ });
555
+ this.respond(RESPONSE_1);
556
+ expect(DQ$("#viewroot_1\\:form2 [name='jakarta.faces.ClientWindow']").isAbsent()).to.be.true;
557
+ expect(DQ$("#viewroot_1\\:form1 [name='jakarta.faces.ClientWindow']").isPresent()).to.be.true;
558
+ expect(DQ$("#viewroot_1\\:form1 [name='jakarta.faces.ClientWindow']").val).to.be.eq("updatedViewId");
559
+
560
+ done();
561
+ })
562
+
563
+ it("must handle multiple view roots multi forms with ClientWindow ids", function (done) {
564
+ const RESPONSE_1 = `<?xml version="1.0" encoding="UTF-8"?>
565
+ <partial-response id='viewroot_1'>
566
+ <changes>
567
+ <update id='viewroot_1:jakarta.faces.ClientWindow:1'><![CDATA[updatedViewId]]></update>
568
+ </changes>
569
+ </partial-response>`
570
+
571
+ window.document.body.innerHTML = INNER_HTML_MULIT_VIEW;
572
+
573
+ faces.ajax.request(window.document.getElementById("submit_1"), null, {
574
+ "javax.faces.behavior.event": "change",
575
+ execute: "submit_1",
576
+ render: "viewroot_1:form1 submit_2"
577
+ });
578
+ this.respond(RESPONSE_1);
579
+ expect(DQ$("#viewroot_1\\:form2 [name='jakarta.faces.ClientWindow']").isPresent()).to.be.true;
580
+ expect(DQ$("#viewroot_1\\:form1 [name='jakarta.faces.ClientWindow']").isPresent()).to.be.true;
581
+ expect(DQ$("#viewroot_2\\:form1\\:form1 [name='jakarta.faces.ClientWindow']").isAbsent()).to.be.true;
582
+ expect(DQ$("#viewroot_1\\:form2 [name='jakarta.faces.ClientWindow']").val).to.be.eq("updatedViewId");
583
+ expect(DQ$("#viewroot_1\\:form1 [name='jakarta.faces.ClientWindow']").val).to.be.eq("updatedViewId");
584
+
585
+ done();
586
+ })
423
587
  });
@@ -22,7 +22,7 @@ import * as sinon from "sinon";
22
22
  import {XmlResponses} from "../frameworkBase/_ext/shared/XmlResponses";
23
23
  import {expect} from "chai";
24
24
  import protocolPage = StandardInits.protocolPage;
25
- import {DQ} from "mona-dish";
25
+ import {DQ, DQ$} from "mona-dish";
26
26
  import {$nsp} from "../../impl/core/Const";
27
27
 
28
28
 
@@ -254,10 +254,10 @@ describe('Tests of the various aspects of the response protocol functionality',
254
254
  </partial-response>`);
255
255
 
256
256
 
257
- expect(DQ.byId("javax.faces.ViewState").isAbsent()).to.be.false;
257
+ expect(DQ$("[name='javax.faces.ViewState']").isAbsent()).to.be.false;
258
258
 
259
259
  expect((<HTMLInputElement>document.getElementsByName("javax.faces.ViewState")[0]).value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
260
- expect(DQ.byId("javax.faces.ViewState").inputValue.value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
260
+ expect(DQ$("[name='javax.faces.ViewState']").val == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
261
261
  });
262
262
 
263
263
 
@@ -291,10 +291,10 @@ describe('Tests of the various aspects of the response protocol functionality',
291
291
  </partial-response>`);
292
292
 
293
293
 
294
- expect(DQ.byId("javax.faces.ViewState").isAbsent()).to.be.false;
294
+ expect(DQ$("[name='javax.faces.ViewState']").isAbsent()).to.be.false;
295
295
 
296
- expect((<HTMLInputElement>document.getElementById("javax.faces.ViewState")).value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
297
- expect(DQ.byId("javax.faces.ViewState").inputValue.value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
296
+ expect((<HTMLInputElement>document.getElementsByName("javax.faces.ViewState")[0]).value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
297
+ expect(DQ$("[name='javax.faces.ViewState']").inputValue.value == "RTUyRDI0NzE4QzAxM0E5RDAwMDAwMDVD").to.be.true;
298
298
  });
299
299
 
300
300
 
@@ -357,6 +357,8 @@ describe('Tests of the various aspects of the response protocol functionality',
357
357
  expect(DQ.byId("j_id__v_0:javax.faces.ClientWindow:1").isAbsent()).to.be.false;
358
358
  });
359
359
 
360
+
361
+
360
362
 
361
363
 
362
364
  });
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <partial-response id='viewroot_1'>
3
+ <changes>
4
+ <update id='viewroot_1:jakarta.faces.ViewState:1'><![[updatedVST]]></update>
5
+ </changes>
6
+ </partial-response>
@@ -194,12 +194,13 @@ var faces;
194
194
  * @param channel the channel name/id
195
195
  * @param onopen The function to be invoked when the web socket is opened.
196
196
  * @param onmessage The function to be invoked when a message is received.
197
+ * @param onerror The function to be invoked when an error occurs.
197
198
  * @param onclose The function to be invoked when the web socket is closed.
198
199
  * @param behaviors functions which are invoked whenever a message is received
199
200
  * @param autoConnect Whether or not to automatically open the socket. Defaults to <code>false</code>.
200
201
  */
201
- function init(socketClientId, url, channel, onopen, onmessage, onclose, behaviors, autoConnect) {
202
- PushImpl_1.PushImpl.init(socketClientId, url, channel, onopen, onmessage, onclose, behaviors, autoConnect);
202
+ function init(socketClientId, url, channel, onopen, onmessage, onerror, onclose, behaviors, autoConnect) {
203
+ PushImpl_1.PushImpl.init(socketClientId, url, channel, onopen, onmessage, onerror, onclose, behaviors, autoConnect);
203
204
  }
204
205
  push.init = init;
205
206
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"_api.js","sourceRoot":"","sources":["../../src/main/typescript/api/_api.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,+CAAgD;AAChD,+CAA0C;AAC1C,oDAAiD;AACjD,8CAA+F;AAI/F,4EAA4E;AAC5E,yBAAyB;AACzB,IAAc,KAAK,CAqNlB;AArND,WAAc,KAAK;IAGf;;;;;;;;;;OAUG;IACQ,iBAAW,GAAG,MAAM,CAAC;IAChC;;;;;;;OAOG;IACQ,iBAAW,GAAG,CAAC,CAAC;IAE3B;;OAEG;IACQ,mBAAa,GAAW,gBAAgB,EAAE,CAAC;IAEtD,qCAAqC;IACrC;;OAEG;IACQ,iBAAW,GAAW,oDAAoD,CAAC;IACtF,0CAA0C;IAE1C;;;;;;;;;;;;;;OAcG;IACH,SAAgB,eAAe;QAC3B,OAAO,yBAAc,CAAC,eAAe,EAAE,CAAC;IAC5C,CAAC;IAFe,qBAAe,kBAE9B,CAAA;IAED;;;;;;;OAOG;IACH,SAAgB,YAAY,CAAC,WAA6B;QACtD,OAAO,yBAAc,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IACpD,CAAC;IAFe,kBAAY,eAE3B,CAAA;IAED;;;;OAIG;IACH,SAAgB,eAAe,CAAC,QAA2B;QACvD,OAAO,yBAAc,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;IACpD,CAAC;IAFe,qBAAe,kBAE9B,CAAA;IAED,0BAA0B;IAC1B,SAAS,gBAAgB;QACrB,MAAM,GAAG,GAAG,8CAA8C,CAAC;QAC3D,qGAAqG;QACrG,mGAAmG;QACnG,iEAAiE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AAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,mCAAI,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACvE,CAAC;IAZe,UAAE,KAYjB,CAAA;IAED;;OAEG;IACU,WAAG,GAAG,eAAI,CAAC;AAC5B,CAAC,EA/Ba,OAAO,GAAP,eAAO,KAAP,eAAO,QA+BpB"}
package/target/api/jsf.js CHANGED
@@ -28,6 +28,17 @@ if (!(window === null || window === void 0 ? void 0 : window.jsf)) {
28
28
  window['jsf'] = (_a = window === null || window === void 0 ? void 0 : window.jsf) !== null && _a !== void 0 ? _a : faces;
29
29
  window.jsf.specversion = 230000;
30
30
  delete window.jsf.contextpath;
31
+ let faces4Init = faces.push.init;
32
+ /*
33
+ * we shim back the breaking api change from 3.0 to 4.0
34
+ * onerror is gone
35
+ */
36
+ faces.push.init = (socketClientId, url, channel, onopen, onmessage,
37
+ // no on error api change for 4.0
38
+ //onerror: Function,
39
+ onclose, behaviors, autoConnect) => {
40
+ faces4Init(socketClientId, url, channel, onopen, onmessage, null, onclose, behaviors, autoConnect);
41
+ };
31
42
  }
32
43
  if (!((_b = window === null || window === void 0 ? void 0 : window.myfaces) === null || _b === void 0 ? void 0 : _b.ab)) {
33
44
  const myfaces = require("./_api").myfaces;
@@ -1 +1 @@
1
- {"version":3,"file":"jsf.js","sourceRoot":"","sources":["../../src/main/typescript/api/jsf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,YAAY,CAAC;;;;AACb;;;;;GAKG;AACH,IAAG,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAA,EAAE;IACb,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC;IACrC,MAAc,CAAC,KAAK,CAAC,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,mC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