jsf.js_next_gen 1.0.0-beta-20 → 4.0.0-RC.1
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.
- package/.mocharc.json +2 -1
- package/.nyc_output/2303b649-59d9-485c-9228-73b0ec8787a7.json +1 -0
- package/.nyc_output/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +1 -0
- package/.nyc_output/processinfo/2303b649-59d9-485c-9228-73b0ec8787a7.json +1 -0
- package/.nyc_output/processinfo/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -0
- package/.nycrc +2 -1
- package/README.md +78 -24
- package/dist/docs/assets/highlight.css +21 -0
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/assets/style.css +34 -2
- package/dist/docs/functions/{jsf.ajax.addOnError.html → faces.ajax.addOnError.html} +15 -13
- package/dist/docs/functions/{jsf.ajax.addOnEvent.html → faces.ajax.addOnEvent.html} +15 -13
- package/dist/docs/functions/{jsf.ajax.request.html → faces.ajax.request.html} +15 -13
- package/dist/docs/functions/{jsf.ajax.response.html → faces.ajax.response.html} +15 -13
- package/dist/docs/functions/{jsf.getClientWindow.html → faces.getClientWindow.html} +17 -14
- package/dist/docs/functions/{jsf.getProjectStage.html → faces.getProjectStage.html} +18 -15
- package/dist/docs/functions/{jsf.getViewState.html → faces.getViewState.html} +18 -15
- package/dist/docs/functions/{jsf.push.close.html → faces.push.close.html} +15 -13
- package/dist/docs/functions/{jsf.push.init.html → faces.push.init.html} +29 -19
- package/dist/docs/functions/{jsf.push.open.html → faces.push.open.html} +15 -13
- package/dist/docs/functions/{jsf.util.chain.html → faces.util.chain.html} +12 -10
- package/dist/docs/functions/myfaces.ab.html +10 -8
- package/dist/docs/index.html +71 -29
- package/dist/docs/modules/{jsf.ajax.html → faces.ajax.html} +18 -16
- package/dist/docs/modules/faces.html +75 -0
- package/dist/docs/modules/{jsf.push.html → faces.push.html} +16 -14
- package/dist/docs/modules/{jsf.util.html → faces.util.html} +12 -10
- package/dist/docs/modules/myfaces.html +8 -6
- package/dist/docs/modules.html +9 -7
- package/dist/docs/variables/faces.contextpath.html +57 -0
- package/dist/docs/variables/{jsf.implversion.html → faces.implversion.html} +17 -14
- package/dist/docs/variables/{jsf.separatorchar.html → faces.separatorchar.html} +18 -15
- package/dist/docs/variables/faces.specversion.html +64 -0
- package/dist/docs/variables/myfaces.oam.html +8 -6
- package/dist/window/faces-development.js +7688 -0
- package/dist/window/faces-development.js.br +0 -0
- package/dist/window/faces-development.js.gz +0 -0
- package/dist/window/faces-development.js.map +1 -0
- package/dist/window/faces.js +3 -0
- package/dist/window/faces.js.LICENSE.txt +87 -0
- package/dist/window/faces.js.br +0 -0
- package/dist/window/faces.js.gz +0 -0
- package/dist/window/faces.js.map +1 -0
- package/dist/window/jsf-development.js +3011 -2963
- package/dist/window/jsf-development.js.br +0 -0
- package/dist/window/jsf-development.js.gz +0 -0
- package/dist/window/jsf-development.js.map +1 -1
- package/dist/window/jsf.js +2 -1
- package/dist/window/jsf.js.LICENSE.txt +87 -0
- package/dist/window/jsf.js.br +0 -0
- package/dist/window/jsf.js.gz +0 -0
- package/dist/window/jsf.js.map +1 -1
- package/package.json +12 -12
- package/pom.xml +14 -0
- package/src/main/java/com/example/jsfs_js_ts/DecoratedFacesJS.java +94 -0
- package/src/main/java/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.java +54 -0
- package/src/main/java/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.java +57 -0
- package/src/main/java/com/example/jsfs_js_ts/FacesJSMappingDecorator.java +138 -0
- package/src/main/typescript/@types/definitions/index.d.ts +147 -0
- package/src/main/typescript/api/{Jsf.ts → _api.ts} +61 -49
- package/src/main/typescript/api/faces.ts +44 -0
- package/src/main/typescript/api/jsf.ts +43 -0
- package/src/main/typescript/impl/AjaxImpl.ts +39 -42
- package/src/main/typescript/impl/PushImpl.ts +27 -30
- package/src/main/typescript/impl/core/Const.ts +38 -16
- package/src/main/typescript/impl/core/ImplTypes.ts +1 -1
- package/src/main/typescript/impl/i18n/Messages.ts +2 -2
- package/src/main/typescript/impl/util/Assertions.ts +3 -3
- package/src/main/typescript/impl/util/AsyncQueue.ts +1 -1
- package/src/main/typescript/impl/util/AsyncRunnable.ts +5 -5
- package/src/main/typescript/impl/util/ExtDomQuery.ts +200 -48
- package/src/main/typescript/impl/util/IListener.ts +1 -1
- package/src/main/typescript/impl/util/Lang.ts +25 -25
- package/src/main/typescript/impl/xhrCore/ErrorData.ts +2 -3
- package/src/main/typescript/impl/xhrCore/EventData.ts +4 -3
- package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +19 -11
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +15 -14
- package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +15 -11
- package/src/main/typescript/impl/xhrCore/Response.ts +30 -24
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +69 -49
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +9 -7
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +76 -60
- package/src/main/typescript/myfaces/OamSubmit.ts +12 -15
- package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +277 -65
- package/src/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/StreamTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/test.js +1 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/test2.js +1 -0
- package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +75 -30
- package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +44 -4
- package/src/main/typescript/test/impl/ImplTest.spec.ts +18 -22
- package/src/main/typescript/test/impl/ImplTest_23.spec.ts +129 -0
- package/src/main/typescript/test/impl/SeparatorCharsTest.spec.ts +7 -6
- package/src/main/typescript/test/myfaces/OamSubmit.spec.ts +15 -24
- package/src/main/typescript/test/queue/AsynchronousProbe.ts +1 -1
- package/src/main/typescript/test/queue/AsynchronousQueueTest.spec.ts +4 -4
- package/src/main/typescript/test/xhrCore/EventTests.spec.ts +15 -23
- package/src/main/typescript/test/xhrCore/FakeWebsocket.ts +3 -3
- package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +7 -32
- package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +16 -37
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +17 -16
- package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +364 -0
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +102 -47
- package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +362 -0
- package/src/main/typescript/test/xhrCore/ShadowDomTest.spec.ts +6 -9
- package/src/main/typescript/test/xhrCore/WebsocketTest.ts +15 -15
- package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +3 -3
- package/{target/main/typescript/impl/util/AsyncRunnable.js → src/main/typescript/test/xhrCore/fixtures/addedViewHead1.js} +4 -6
- package/src/main/typescript/test/xhrCore/fixtures/addedViewHead2.css +18 -0
- package/src/main/typescript/test/xhrCore/fixtures/addedViewHead2.js +16 -0
- package/src/main/typescript/test/xhrCore/fixtures/addedViewHead3.js +16 -0
- package/src/main/typescript/test/xhrCore/fixtures/nonce_script.js +16 -0
- package/src/main/typescript/tsconfig-typedoc.json +17 -1
- package/src/main/typescript/tsconfig.json +23 -5
- package/src/test/resources/jsf-development.js +1 -1
- package/src/test.html +75 -0
- package/src/tmp/test.html +92 -0
- package/target/api/{Jsf.js → _api.js} +68 -70
- package/target/api/_api.js.map +1 -0
- package/target/api/faces.js +45 -0
- package/target/api/faces.js.map +1 -0
- package/target/api/jsf.js +45 -0
- package/target/api/jsf.js.map +1 -0
- package/target/classes/com/example/jsfs_js_ts/DecoratedFacesJS.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/FacesJSMappingDecorator.class +0 -0
- package/target/impl/AjaxImpl.js +85 -93
- package/target/impl/AjaxImpl.js.map +1 -1
- package/target/impl/PushImpl.js +63 -64
- package/target/impl/PushImpl.js.map +1 -1
- package/target/impl/core/Const.js +38 -19
- package/target/impl/core/Const.js.map +1 -1
- package/target/impl/core/ImplTypes.js +10 -15
- package/target/impl/core/ImplTypes.js.map +1 -1
- package/target/impl/i18n/Messages.js +5 -6
- package/target/impl/i18n/Messages.js.map +1 -1
- package/target/impl/util/Assertions.js +12 -21
- package/target/impl/util/Assertions.js.map +1 -1
- package/target/impl/util/AsyncQueue.js +28 -36
- package/target/impl/util/AsyncQueue.js.map +1 -1
- package/target/impl/util/AsyncRunnable.js +1 -1
- package/target/impl/util/ExtDomQuery.js +235 -138
- package/target/impl/util/ExtDomQuery.js.map +1 -1
- package/target/impl/util/Lang.js +43 -50
- package/target/impl/util/Lang.js.map +1 -1
- package/target/impl/xhrCore/ErrorData.js +37 -62
- package/target/impl/xhrCore/ErrorData.js.map +1 -1
- package/target/impl/xhrCore/EventData.js +12 -14
- package/target/impl/xhrCore/EventData.js.map +1 -1
- package/target/impl/xhrCore/RequestDataResolver.js +27 -29
- package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
- package/target/impl/xhrCore/ResonseDataResolver.js +25 -23
- package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
- package/target/impl/xhrCore/Response.js +40 -36
- package/target/impl/xhrCore/Response.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +165 -167
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +75 -103
- package/target/impl/xhrCore/XhrFormData.js.map +1 -1
- package/target/impl/xhrCore/XhrRequest.js +160 -145
- package/target/impl/xhrCore/XhrRequest.js.map +1 -1
- package/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +4 -0
- package/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +4 -0
- package/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst +1 -0
- package/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst +1 -0
- package/target/myfaces/OamSubmit.js +32 -20
- package/target/myfaces/OamSubmit.js.map +1 -1
- package/target/surefire-reports/TEST-com.example.jsfs_js_ts.JsfsJsTsApplicationTests.xml +78 -0
- package/target/surefire-reports/com.example.jsfs_js_ts.JsfsJsTsApplicationTests.txt +7 -0
- package/target/test/frameworkBase/LangTest.spec.js +46 -32
- package/target/test/frameworkBase/LangTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +372 -134
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js +46 -32
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js +25 -34
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js +9 -9
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +32 -32
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js +51 -49
- package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/StandardInits.js +277 -124
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +199 -18
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
- package/target/test/impl/ImplTest.spec.js +45 -33
- package/target/test/impl/ImplTest.spec.js.map +1 -1
- package/target/test/impl/ImplTest_23.spec.js +133 -0
- package/target/test/impl/ImplTest_23.spec.js.map +1 -0
- package/target/test/impl/SeparatorCharsTest.spec.js +22 -20
- package/target/test/impl/SeparatorCharsTest.spec.js.map +1 -1
- package/target/test/myfaces/OamSubmit.spec.js +35 -42
- package/target/test/myfaces/OamSubmit.spec.js.map +1 -1
- package/target/test/queue/AsynchronousProbe.js +24 -30
- package/target/test/queue/AsynchronousProbe.js.map +1 -1
- package/target/test/queue/AsynchronousQueueTest.spec.js +40 -71
- package/target/test/queue/AsynchronousQueueTest.spec.js.map +1 -1
- package/target/test/xhrCore/EventTests.spec.js +47 -83
- package/target/test/xhrCore/EventTests.spec.js.map +1 -1
- package/target/test/xhrCore/FakeWebsocket.js +15 -17
- package/target/test/xhrCore/FakeWebsocket.js.map +1 -1
- package/target/test/xhrCore/FileUploadTest.spec.js +50 -91
- package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestParamsTest.spec.js +49 -98
- package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest.spec.js +84 -120
- package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
- package/target/test/{typescript/xhrCore/RequestTest.js → xhrCore/RequestTest_23.spec.js} +142 -127
- package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -0
- package/target/test/xhrCore/ResponseTest.spec.js +183 -105
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +312 -0
- package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -0
- package/target/test/xhrCore/ShadowDomTest.spec.js +33 -66
- package/target/test/xhrCore/ShadowDomTest.spec.js.map +1 -1
- package/target/test/xhrCore/WebsocketTest.js +64 -97
- package/target/test/xhrCore/WebsocketTest.js.map +1 -1
- package/target/test/xhrCore/XhrFormDataTest.spec.js +42 -16
- package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
- package/target/test-classes/jsf-development.js +452 -3674
- package/target/test-classes/jsf.js +1 -1
- package/target/test-classes/jsf.js.br +0 -0
- package/target/test-classes/jsf.js.gz +0 -0
- package/webpack.config.js +7 -4
- package/webpack.config.js.map +1 -1
- package/webpack.config.ts +23 -4
- package/dist/docs/modules/jsf.html +0 -71
- package/dist/docs/variables/jsf.specversion.html +0 -52
- package/integrationdeploy.cmd +0 -4
- package/integrationsdeploy.sh +0 -5
- package/remap.js +0 -44
- package/remap.js.map +0 -1
- package/src/main/java/com/example/jsfs_js_ts/JsfsJsTsApplication.java +0 -12
- package/src/main/types/typedefs.d.ts +0 -66
- package/target/api/Jsf.js.map +0 -1
- package/target/classes/com/example/jsfs_js_ts/JsfsJsTsApplication.class +0 -0
- package/target/impl/util/ListenerQueue.js +0 -3
- package/target/impl/util/ListenerQueue.js.map +0 -1
- package/target/main/typescript/api/Jsf.js +0 -258
- package/target/main/typescript/api/Jsf.js.map +0 -1
- package/target/main/typescript/impl/AjaxImpl.js +0 -569
- package/target/main/typescript/impl/AjaxImpl.js.map +0 -1
- package/target/main/typescript/impl/PushImpl.js +0 -215
- package/target/main/typescript/impl/PushImpl.js.map +0 -1
- package/target/main/typescript/impl/core/Const.js +0 -135
- package/target/main/typescript/impl/core/Const.js.map +0 -1
- package/target/main/typescript/impl/core/ImplTypes.js +0 -43
- package/target/main/typescript/impl/core/ImplTypes.js.map +0 -1
- package/target/main/typescript/impl/i18n/Messages.js +0 -114
- package/target/main/typescript/impl/i18n/Messages.js.map +0 -1
- package/target/main/typescript/impl/util/Assertions.js +0 -90
- package/target/main/typescript/impl/util/Assertions.js.map +0 -1
- package/target/main/typescript/impl/util/AsyncQueue.js +0 -104
- package/target/main/typescript/impl/util/AsyncQueue.js.map +0 -1
- package/target/main/typescript/impl/util/AsyncRunnable.js.map +0 -1
- package/target/main/typescript/impl/util/ExtDomQuery.js +0 -129
- package/target/main/typescript/impl/util/ExtDomQuery.js.map +0 -1
- package/target/main/typescript/impl/util/Lang.js +0 -215
- package/target/main/typescript/impl/util/Lang.js.map +0 -1
- package/target/main/typescript/impl/util/ListenerQueue.js +0 -3
- package/target/main/typescript/impl/util/ListenerQueue.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/ErrorData.js +0 -89
- package/target/main/typescript/impl/xhrCore/ErrorData.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/EventData.js +0 -30
- package/target/main/typescript/impl/xhrCore/EventData.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/IResponseProcessor.js +0 -3
- package/target/main/typescript/impl/xhrCore/IResponseProcessor.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/RequestDataResolver.js +0 -143
- package/target/main/typescript/impl/xhrCore/RequestDataResolver.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/ResonseDataResolver.js +0 -103
- package/target/main/typescript/impl/xhrCore/ResonseDataResolver.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/Response.js +0 -167
- package/target/main/typescript/impl/xhrCore/Response.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/ResponseProcessor.js +0 -368
- package/target/main/typescript/impl/xhrCore/ResponseProcessor.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/XhrFormData.js +0 -272
- package/target/main/typescript/impl/xhrCore/XhrFormData.js.map +0 -1
- package/target/main/typescript/impl/xhrCore/XhrRequest.js +0 -281
- package/target/main/typescript/impl/xhrCore/XhrRequest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.js +0 -293
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/LangTest.js +0 -89
- package/target/test/frameworkBase/_ext/monadish/LangTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/MappingTest.js +0 -39
- package/target/test/frameworkBase/_ext/monadish/MappingTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/MonadTest.js +0 -155
- package/target/test/frameworkBase/_ext/monadish/MonadTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/StreamTest.js +0 -176
- package/target/test/frameworkBase/_ext/monadish/StreamTest.js.map +0 -1
- package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.js +0 -1
- package/target/test/frameworkBase/_ext/monadish/XmlQueryTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/LangTest.js +0 -112
- package/target/test/typescript/frameworkBase/LangTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/DomQueryTest.js +0 -293
- package/target/test/typescript/frameworkBase/_ext/monadish/DomQueryTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/LangTest.js +0 -89
- package/target/test/typescript/frameworkBase/_ext/monadish/LangTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingProbes.js +0 -115
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingProbes.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingTest.js +0 -39
- package/target/test/typescript/frameworkBase/_ext/monadish/MappingTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/MonadTest.js +0 -155
- package/target/test/typescript/frameworkBase/_ext/monadish/MonadTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/StreamTest.js +0 -176
- package/target/test/typescript/frameworkBase/_ext/monadish/StreamTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/XmlQueryTest.js +0 -1
- package/target/test/typescript/frameworkBase/_ext/monadish/XmlQueryTest.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/shared/StandardInits.js +0 -264
- package/target/test/typescript/frameworkBase/_ext/shared/StandardInits.js.map +0 -1
- package/target/test/typescript/frameworkBase/_ext/shared/XmlResponses.js +0 -23
- package/target/test/typescript/frameworkBase/_ext/shared/XmlResponses.js.map +0 -1
- package/target/test/typescript/impl/ImplTest.js +0 -98
- package/target/test/typescript/impl/ImplTest.js.map +0 -1
- package/target/test/typescript/impl/SeparatorCharsTest.js +0 -72
- package/target/test/typescript/impl/SeparatorCharsTest.js.map +0 -1
- package/target/test/typescript/queue/AsynchronousProbe.js +0 -99
- package/target/test/typescript/queue/AsynchronousProbe.js.map +0 -1
- package/target/test/typescript/queue/AsynchronousQueueTest.js +0 -130
- package/target/test/typescript/queue/AsynchronousQueueTest.js.map +0 -1
- package/target/test/typescript/xhrCore/EventTests.js +0 -155
- package/target/test/typescript/xhrCore/EventTests.js.map +0 -1
- package/target/test/typescript/xhrCore/FakeWebsocket.js +0 -25
- package/target/test/typescript/xhrCore/FakeWebsocket.js.map +0 -1
- package/target/test/typescript/xhrCore/FileUploadTest.js +0 -166
- package/target/test/typescript/xhrCore/FileUploadTest.js.map +0 -1
- package/target/test/typescript/xhrCore/RequestParamsTest.js +0 -151
- package/target/test/typescript/xhrCore/RequestParamsTest.js.map +0 -1
- package/target/test/typescript/xhrCore/RequestTest.js.map +0 -1
- package/target/test/typescript/xhrCore/ResponseTest.js +0 -257
- package/target/test/typescript/xhrCore/ResponseTest.js.map +0 -1
- package/target/test/typescript/xhrCore/ShadowDomTest.js +0 -122
- package/target/test/typescript/xhrCore/ShadowDomTest.js.map +0 -1
- package/target/test/typescript/xhrCore/WebsocketTest.js +0 -182
- package/target/test/typescript/xhrCore/WebsocketTest.js.map +0 -1
- package/target/test/typescript/xhrCore/XhrFormDataTest.js +0 -58
- package/target/test/typescript/xhrCore/XhrFormDataTest.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
} from "../core/Const";
|
|
28
28
|
import {XhrFormData} from "./XhrFormData";
|
|
29
29
|
import {ExtLang} from "../util/Lang";
|
|
30
|
-
import {
|
|
30
|
+
import {ExtConfig, ExtDomQuery} from "../util/ExtDomQuery";
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Resolver functions for various aspects of the request data
|
|
@@ -37,7 +37,7 @@ import {ExtDomquery} from "../util/ExtDomQuery";
|
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
|
-
* resolves the event handlers
|
|
40
|
+
* resolves the event handlers lazily
|
|
41
41
|
* so that if some decoration happens in between we can deal with it
|
|
42
42
|
*
|
|
43
43
|
* @param requestContext
|
|
@@ -95,12 +95,12 @@ export function resolveDelay(options: Config): number {
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
/**
|
|
98
|
-
* resolves the window
|
|
98
|
+
* resolves the window-id from various sources
|
|
99
99
|
*
|
|
100
100
|
* @param options
|
|
101
101
|
*/
|
|
102
102
|
export function resolveWindowId(options: Config) {
|
|
103
|
-
return options?.value?.windowId ??
|
|
103
|
+
return options?.value?.windowId ?? ExtDomQuery.windowId;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
/**
|
|
@@ -108,19 +108,20 @@ export function resolveWindowId(options: Config) {
|
|
|
108
108
|
* browser save event resolution
|
|
109
109
|
* @param evt the event object
|
|
110
110
|
* (with a fallback for ie events if none is present)
|
|
111
|
+
* @deprecated soon will be removed
|
|
111
112
|
*/
|
|
112
113
|
export function getEventTarget(evt: Event): Element {
|
|
113
|
-
//ie6 and 7 fallback
|
|
114
|
+
// ie6 and 7 fallback
|
|
114
115
|
let finalEvent = evt;
|
|
115
|
-
|
|
116
|
+
/*
|
|
116
117
|
* evt source is defined in the jsf events
|
|
117
|
-
* seems like some component authors use our code
|
|
118
|
+
* seems like some component authors use our code,
|
|
118
119
|
* so we add it here see also
|
|
119
120
|
* https://issues.apache.org/jira/browse/MYFACES-2458
|
|
120
121
|
* not entirely a bug but makes sense to add this
|
|
121
|
-
* behavior. I
|
|
122
|
+
* behavior. I don´t use it that way but nevertheless it
|
|
122
123
|
* does not break anything so why not
|
|
123
|
-
|
|
124
|
+
*/
|
|
124
125
|
let t = finalEvent?.srcElement ?? finalEvent?.target ?? (<any>finalEvent)?.source;
|
|
125
126
|
while ((t) && (t.nodeType != 1)) {
|
|
126
127
|
t = t.parentNode;
|
|
@@ -131,7 +132,7 @@ export function getEventTarget(evt: Event): Element {
|
|
|
131
132
|
/**
|
|
132
133
|
* resolves a bunch of default values
|
|
133
134
|
* which can be further processed from the given
|
|
134
|
-
* call parameters of
|
|
135
|
+
* call parameters of faces.ajax.request
|
|
135
136
|
*
|
|
136
137
|
* @param event
|
|
137
138
|
* @param opts
|
|
@@ -140,10 +141,10 @@ export function getEventTarget(evt: Event): Element {
|
|
|
140
141
|
export function resolveDefaults(event: Event, opts: any = {}, el: Element | string = null) {
|
|
141
142
|
//deep copy the options, so that further transformations to not backfire into the callers
|
|
142
143
|
const resolvedEvent = event,
|
|
143
|
-
options = new
|
|
144
|
+
options = new ExtConfig(opts).deepCopy,
|
|
144
145
|
elem = DQ.byId(el || <Element>resolvedEvent.target, true),
|
|
145
|
-
elementId = elem.id.value, requestCtx = new
|
|
146
|
-
internalCtx = new
|
|
146
|
+
elementId = elem.id.value, requestCtx = new ExtConfig({}),
|
|
147
|
+
internalCtx = new ExtConfig({}), windowId = resolveWindowId(options),
|
|
147
148
|
isResetValues = true === options.value?.resetValues;
|
|
148
149
|
|
|
149
150
|
return {resolvedEvent, options, elem, elementId, requestCtx, internalCtx, windowId, isResetValues};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -19,6 +19,7 @@ import {Config, Optional, XMLQuery} from "mona-dish";
|
|
|
19
19
|
import {Assertions} from "../util/Assertions";
|
|
20
20
|
import {DQ} from "mona-dish";
|
|
21
21
|
import {
|
|
22
|
+
$nsp,
|
|
22
23
|
CTX_PARAM_MF_INTERNAL,
|
|
23
24
|
CTX_PARAM_SRC_CTL_ID,
|
|
24
25
|
CTX_PARAM_SRC_FRM_ID,
|
|
@@ -26,8 +27,10 @@ import {
|
|
|
26
27
|
SOURCE,
|
|
27
28
|
TAG_FORM,
|
|
28
29
|
UPDATE_ELEMS,
|
|
29
|
-
UPDATE_FORMS
|
|
30
|
+
UPDATE_FORMS,
|
|
31
|
+
DEFERRED_HEAD_INSERTS
|
|
30
32
|
} from "../core/Const";
|
|
33
|
+
import {ExtConfig} from "../util/ExtDomQuery";
|
|
31
34
|
|
|
32
35
|
/**
|
|
33
36
|
* Resolver functions for various aspects of the response data
|
|
@@ -42,19 +45,19 @@ import {
|
|
|
42
45
|
*
|
|
43
46
|
* @param request the request hosting the responseXML
|
|
44
47
|
*
|
|
45
|
-
* Throws an error in case of non
|
|
48
|
+
* Throws an error in case of non-existent or wrong xml data
|
|
46
49
|
*
|
|
47
50
|
*/
|
|
48
51
|
export function resolveResponseXML(request: Config): XMLQuery {
|
|
49
|
-
let ret = new XMLQuery(request.getIf(SEL_RESPONSE_XML).value);
|
|
52
|
+
let ret = new XMLQuery($nsp(request.getIf(SEL_RESPONSE_XML).value));
|
|
50
53
|
Assertions.assertValidXMLResponse(ret);
|
|
51
54
|
|
|
52
55
|
return ret;
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
/**
|
|
56
|
-
* Splits the incoming
|
|
57
|
-
* in an internal and an external
|
|
59
|
+
* Splits the incoming pass-through context apart
|
|
60
|
+
* in an internal and an external normalized context
|
|
58
61
|
* the internal one is just for our internal processing
|
|
59
62
|
*
|
|
60
63
|
* @param context the root context as associative array
|
|
@@ -64,25 +67,26 @@ export function resolveContexts(context: { [p: string]: any }): any {
|
|
|
64
67
|
* we split the context apart into the external one and
|
|
65
68
|
* some internal values
|
|
66
69
|
*/
|
|
67
|
-
let externalContext =
|
|
70
|
+
let externalContext = ExtConfig.fromNullable(context);
|
|
68
71
|
let internalContext = externalContext.getIf(CTX_PARAM_MF_INTERNAL);
|
|
69
72
|
if (!internalContext.isPresent()) {
|
|
70
|
-
internalContext =
|
|
73
|
+
internalContext = ExtConfig.fromNullable({});
|
|
71
74
|
}
|
|
72
75
|
|
|
73
76
|
/**
|
|
74
77
|
* prepare storage for some deferred operations
|
|
75
78
|
*/
|
|
79
|
+
internalContext.assign(DEFERRED_HEAD_INSERTS).value = [];
|
|
76
80
|
internalContext.assign(UPDATE_FORMS).value = [];
|
|
77
81
|
internalContext.assign(UPDATE_ELEMS).value = [];
|
|
78
82
|
return {externalContext, internalContext};
|
|
79
83
|
}
|
|
80
84
|
|
|
81
85
|
/**
|
|
82
|
-
* fetches the source element out of our
|
|
86
|
+
* fetches the source element out of our contexts
|
|
83
87
|
*
|
|
84
|
-
* @param context the external context which
|
|
85
|
-
* @param internalContext internal
|
|
88
|
+
* @param context the external context which should host the source id
|
|
89
|
+
* @param internalContext internal pass-through fall back
|
|
86
90
|
*
|
|
87
91
|
*/
|
|
88
92
|
export function resolveSourceElement(context: Config, internalContext: Config): DQ {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import {DQ, XMLQuery} from "mona-dish";
|
|
18
18
|
import {ResponseProcessor} from "./ResponseProcessor";
|
|
19
19
|
|
|
20
20
|
import {IResponseProcessor} from "./IResponseProcessor";
|
|
21
21
|
import {
|
|
22
|
+
$nsp,
|
|
22
23
|
CMD_ATTRIBUTES,
|
|
23
24
|
CMD_CHANGES,
|
|
24
25
|
CMD_DELETE,
|
|
@@ -27,7 +28,7 @@ import {
|
|
|
27
28
|
CMD_EXTENSION,
|
|
28
29
|
CMD_INSERT,
|
|
29
30
|
CMD_REDIRECT,
|
|
30
|
-
CMD_UPDATE,
|
|
31
|
+
CMD_UPDATE, P_RESOURCE,
|
|
31
32
|
P_VIEWBODY,
|
|
32
33
|
P_VIEWHEAD,
|
|
33
34
|
P_VIEWROOT,
|
|
@@ -38,6 +39,7 @@ import {
|
|
|
38
39
|
TAG_BEFORE
|
|
39
40
|
} from "../core/Const";
|
|
40
41
|
import {resolveContexts, resolveResponseXML} from "./ResonseDataResolver";
|
|
42
|
+
import {ExtConfig} from "../util/ExtDomQuery";
|
|
41
43
|
|
|
42
44
|
|
|
43
45
|
|
|
@@ -45,8 +47,8 @@ export module Response {
|
|
|
45
47
|
|
|
46
48
|
|
|
47
49
|
/**
|
|
48
|
-
* Standardized
|
|
49
|
-
* this one is called straight from
|
|
50
|
+
* Standardized faces.ts response
|
|
51
|
+
* this one is called straight from faces.ts.response
|
|
50
52
|
*
|
|
51
53
|
* The processing follows the spec by going for the responseXML
|
|
52
54
|
* and processing its tags
|
|
@@ -57,23 +59,23 @@ export module Response {
|
|
|
57
59
|
*/
|
|
58
60
|
export function processResponse(request: XMLHttpRequest, context: Context) {
|
|
59
61
|
|
|
60
|
-
let req =
|
|
62
|
+
let req = ExtConfig.fromNullable(request);
|
|
61
63
|
let {externalContext, internalContext} = resolveContexts(context);
|
|
62
64
|
let responseXML: XMLQuery = resolveResponseXML(req);
|
|
63
65
|
let responseProcessor = new ResponseProcessor(req, externalContext, internalContext);
|
|
64
66
|
|
|
65
67
|
internalContext.assign(RESPONSE_XML).value = responseXML;
|
|
66
68
|
|
|
67
|
-
//we now process the partial tags, or in none given raise an error
|
|
69
|
+
// we now process the partial tags, or in none given raise an error
|
|
68
70
|
responseXML.querySelectorAll(RESP_PARTIAL)
|
|
69
71
|
.each(item => processPartialTag(<XMLQuery>item, responseProcessor, internalContext));
|
|
70
72
|
|
|
71
|
-
//
|
|
72
|
-
//
|
|
73
|
-
//to wait until the document has caught up before
|
|
74
|
-
//doing any
|
|
75
|
-
//
|
|
76
|
-
//we maybe drop this deferred assignment in the future, but myfaces did it until now
|
|
73
|
+
// We now process the viewStates, client windows and the elements to be evaluated are delayed.
|
|
74
|
+
// The reason for this is that often it is better
|
|
75
|
+
// to wait until the document has caught up before
|
|
76
|
+
// doing any evaluations even on embedded scripts.
|
|
77
|
+
// Usually this does not matter, the client window comes in almost last always anyway
|
|
78
|
+
// we maybe drop this deferred assignment in the future, but myfaces did it until now.
|
|
77
79
|
responseProcessor.fixViewStates();
|
|
78
80
|
responseProcessor.fixClientWindow();
|
|
79
81
|
responseProcessor.globalEval();
|
|
@@ -89,7 +91,7 @@ export module Response {
|
|
|
89
91
|
internalContext.assign(PARTIAL_ID).value = node.id;
|
|
90
92
|
const SEL_SUB_TAGS = [CMD_ERROR, CMD_REDIRECT, CMD_CHANGES].join(",");
|
|
91
93
|
|
|
92
|
-
//now we can process the main operations
|
|
94
|
+
// now we can process the main operations
|
|
93
95
|
node.querySelectorAll(SEL_SUB_TAGS).each((node: XMLQuery) => {
|
|
94
96
|
switch (node.tagName.value) {
|
|
95
97
|
case CMD_ERROR:
|
|
@@ -107,10 +109,10 @@ export module Response {
|
|
|
107
109
|
}
|
|
108
110
|
|
|
109
111
|
let processInsert = function (responseProcessor: IResponseProcessor, node: XMLQuery) {
|
|
110
|
-
//path1 insert after as child tags
|
|
112
|
+
// path1 insert after as child tags
|
|
111
113
|
if(node.querySelectorAll([TAG_BEFORE, TAG_AFTER].join(",")).length) {
|
|
112
|
-
responseProcessor.
|
|
113
|
-
} else { //insert before after with id
|
|
114
|
+
responseProcessor.insertWithSubTags(node);
|
|
115
|
+
} else { // insert before after with id
|
|
114
116
|
responseProcessor.insert(node);
|
|
115
117
|
}
|
|
116
118
|
|
|
@@ -169,14 +171,14 @@ export module Response {
|
|
|
169
171
|
|
|
170
172
|
/**
|
|
171
173
|
* branch tag update. drill further down into the updates
|
|
172
|
-
* special case
|
|
173
|
-
* and the
|
|
174
|
+
* special case viewState in that case it is a leaf
|
|
175
|
+
* and the viewState must be processed
|
|
174
176
|
*
|
|
175
177
|
* @param node
|
|
176
178
|
* @param responseProcessor
|
|
177
179
|
*/
|
|
178
180
|
function processUpdateTag(node: XMLQuery, responseProcessor: IResponseProcessor) {
|
|
179
|
-
//early state storing, if no state we perform a normal update cycle
|
|
181
|
+
// early state storing, if no state we perform a normal update cycle
|
|
180
182
|
if (!storeState(responseProcessor, node)) {
|
|
181
183
|
handleElementUpdate(node, responseProcessor);
|
|
182
184
|
}
|
|
@@ -191,19 +193,23 @@ export module Response {
|
|
|
191
193
|
function handleElementUpdate(node: XMLQuery, responseProcessor: IResponseProcessor) {
|
|
192
194
|
let cdataBlock = node.cDATAAsString;
|
|
193
195
|
switch (node.id.value) {
|
|
194
|
-
case P_VIEWROOT :
|
|
196
|
+
case $nsp(P_VIEWROOT) :
|
|
195
197
|
responseProcessor.replaceViewRoot(DQ.fromMarkup(cdataBlock.substring(cdataBlock.indexOf("<html"))));
|
|
196
198
|
break;
|
|
197
199
|
|
|
198
|
-
case P_VIEWHEAD:
|
|
200
|
+
case $nsp(P_VIEWHEAD):
|
|
199
201
|
responseProcessor.replaceHead(DQ.fromMarkup(cdataBlock));
|
|
200
202
|
break;
|
|
201
203
|
|
|
202
|
-
case P_VIEWBODY:
|
|
204
|
+
case $nsp(P_VIEWBODY):
|
|
203
205
|
responseProcessor.replaceBody(DQ.fromMarkup(cdataBlock));
|
|
204
206
|
break;
|
|
205
207
|
|
|
206
|
-
|
|
208
|
+
case $nsp(P_RESOURCE):
|
|
209
|
+
responseProcessor.addToHead(DQ.fromMarkup(cdataBlock))
|
|
210
|
+
break;
|
|
211
|
+
|
|
212
|
+
default:// htmlItem replacement
|
|
207
213
|
responseProcessor.update(node, cdataBlock);
|
|
208
214
|
break;
|
|
209
215
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -23,6 +23,7 @@ import {StateHolder} from "../core/ImplTypes";
|
|
|
23
23
|
import {EventData} from "./EventData";
|
|
24
24
|
|
|
25
25
|
import {
|
|
26
|
+
$nsp,
|
|
26
27
|
APPLIED_CLIENT_WINDOW,
|
|
27
28
|
APPLIED_VST,
|
|
28
29
|
ATTR_ID,
|
|
@@ -50,10 +51,12 @@ import {
|
|
|
50
51
|
TAG_FORM,
|
|
51
52
|
TAG_HEAD,
|
|
52
53
|
UPDATE_ELEMS,
|
|
53
|
-
UPDATE_FORMS
|
|
54
|
+
UPDATE_FORMS,
|
|
55
|
+
DEFERRED_HEAD_INSERTS
|
|
54
56
|
} from "../core/Const";
|
|
55
57
|
import trim = Lang.trim;
|
|
56
|
-
import {
|
|
58
|
+
import {ExtConfig, ExtDomQuery} from "../util/ExtDomQuery";
|
|
59
|
+
|
|
57
60
|
|
|
58
61
|
/**
|
|
59
62
|
* Response processor
|
|
@@ -84,7 +87,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
84
87
|
return;
|
|
85
88
|
}
|
|
86
89
|
|
|
87
|
-
let oldHead =
|
|
90
|
+
let oldHead = ExtDomQuery.querySelectorAll(TAG_HEAD);
|
|
88
91
|
|
|
89
92
|
//delete all to avoid script and style overlays
|
|
90
93
|
oldHead.querySelectorAll(SEL_SCRIPTS_STYLES).delete();
|
|
@@ -93,8 +96,17 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
93
96
|
// eval means the scripts will get attached (eval script attach method)
|
|
94
97
|
// but this is done by DomQuery not in this code
|
|
95
98
|
this.storeForEval(shadowHead);
|
|
99
|
+
//incoming either the outer head tag or its children
|
|
100
|
+
//shadowHead = (shadowHead.tagName.value === "HEAD") ? shadowHead.childNodes : shadowHead;
|
|
101
|
+
//this.addToHead(shadowHead);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
addToHead(newElements: XMLQuery | DQ) {
|
|
105
|
+
this.internalContext.assign(DEFERRED_HEAD_INSERTS).value.push(newElements);
|
|
96
106
|
}
|
|
97
107
|
|
|
108
|
+
|
|
109
|
+
|
|
98
110
|
/**
|
|
99
111
|
* replaces the body in the expected manner
|
|
100
112
|
* which means the entire body content is refreshed
|
|
@@ -112,23 +124,24 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
112
124
|
|
|
113
125
|
let shadowInnerHTML: string = <string>shadowBody.html().value;
|
|
114
126
|
|
|
115
|
-
let resultingBody = <DQ>
|
|
127
|
+
let resultingBody = <DQ>ExtDomQuery.querySelectorAll(TAG_BODY).html(shadowInnerHTML);
|
|
116
128
|
let updateForms = resultingBody.querySelectorAll(TAG_FORM);
|
|
117
129
|
|
|
118
130
|
// main difference, we cannot replace the body itself, but only its content
|
|
119
|
-
// we need a separate step for post
|
|
131
|
+
// we need a separate step for post-processing the incoming
|
|
132
|
+
// attributes, like classes, styles etc...
|
|
120
133
|
resultingBody.copyAttrs(shadowBody);
|
|
121
134
|
|
|
122
135
|
this.storeForPostProcessing(updateForms, resultingBody);
|
|
123
136
|
}
|
|
124
137
|
|
|
125
138
|
/**
|
|
126
|
-
* Leaf Tag eval... process whatever is in the
|
|
139
|
+
* Leaf Tag eval... process whatever is in the eval cdata block
|
|
127
140
|
*
|
|
128
141
|
* @param node the node to eval
|
|
129
142
|
*/
|
|
130
143
|
eval(node: XMLQuery) {
|
|
131
|
-
|
|
144
|
+
ExtDomQuery.globalEval(node.cDATAAsString);
|
|
132
145
|
}
|
|
133
146
|
|
|
134
147
|
/**
|
|
@@ -145,7 +158,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
145
158
|
* <error>
|
|
146
159
|
*/
|
|
147
160
|
|
|
148
|
-
let mergedErrorData = new
|
|
161
|
+
let mergedErrorData = new ExtConfig({});
|
|
149
162
|
mergedErrorData.assign(SOURCE).value = this.externalContext.getIf(P_PARTIAL_SOURCE).get(0).value;
|
|
150
163
|
mergedErrorData.assign(ERROR_NAME).value = node.querySelectorAll(ERROR_NAME).textContent(EMPTY_STR);
|
|
151
164
|
mergedErrorData.assign(ERROR_MESSAGE).value = node.querySelectorAll(ERROR_MESSAGE).cDATAAsString;
|
|
@@ -155,12 +168,12 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
155
168
|
//we now store the response xml also in the error data for further details
|
|
156
169
|
mergedErrorData.assignIf(hasResponseXML, RESPONSE_XML).value = this.internalContext.getIf(RESPONSE_XML).value.get(0).value;
|
|
157
170
|
|
|
158
|
-
// error post
|
|
171
|
+
// error post-processing and enrichment (standard messages from keys)
|
|
159
172
|
let errorData = ErrorData.fromServerError(mergedErrorData);
|
|
160
173
|
|
|
161
|
-
// we now trigger an internally stored onError function which might be
|
|
162
|
-
// either we
|
|
163
|
-
//
|
|
174
|
+
// we now trigger an internally stored onError function which might be an attached to the context
|
|
175
|
+
// either we do not have an internal on error, or an on error has been based via params from the outside.
|
|
176
|
+
// In both cases they are attached to our contexts
|
|
164
177
|
|
|
165
178
|
this.triggerOnError(errorData);
|
|
166
179
|
Implementation.sendError(errorData);
|
|
@@ -176,7 +189,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
176
189
|
|
|
177
190
|
let redirectUrl = trim(node.attr(ATTR_URL).value);
|
|
178
191
|
if (redirectUrl != EMPTY_STR) {
|
|
179
|
-
|
|
192
|
+
window.location.href = redirectUrl;
|
|
180
193
|
}
|
|
181
194
|
}
|
|
182
195
|
|
|
@@ -186,7 +199,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
186
199
|
* @param cdataBlock the cdata block with the new html code
|
|
187
200
|
*/
|
|
188
201
|
update(node: XMLQuery, cdataBlock: string) {
|
|
189
|
-
let result =
|
|
202
|
+
let result = ExtDomQuery.byId(node.id.value, true).outerHTML(cdataBlock, false, false);
|
|
190
203
|
let sourceForm = result?.parents(TAG_FORM).orElseLazy(() => result.byTagName(TAG_FORM, true));
|
|
191
204
|
if (sourceForm) {
|
|
192
205
|
this.storeForPostProcessing(sourceForm, result);
|
|
@@ -194,7 +207,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
194
207
|
}
|
|
195
208
|
|
|
196
209
|
/**
|
|
197
|
-
* Delete handler, simply
|
|
210
|
+
* Delete handler, simply deletes the node referenced by the xml data
|
|
198
211
|
* @param node
|
|
199
212
|
*/
|
|
200
213
|
delete(node: XMLQuery) {
|
|
@@ -252,7 +265,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
252
265
|
*
|
|
253
266
|
* @param node the node hosting the insert data
|
|
254
267
|
*/
|
|
255
|
-
|
|
268
|
+
insertWithSubTags(node: XMLQuery) {
|
|
256
269
|
let before = node.querySelectorAll(TAG_BEFORE);
|
|
257
270
|
let after = node.querySelectorAll(TAG_AFTER);
|
|
258
271
|
|
|
@@ -277,13 +290,13 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
277
290
|
|
|
278
291
|
/**
|
|
279
292
|
* Process the viewState update, update the affected
|
|
280
|
-
* forms with their respective new
|
|
293
|
+
* forms with their respective new viewState values
|
|
281
294
|
*
|
|
282
295
|
*/
|
|
283
296
|
processViewState(node: XMLQuery): boolean {
|
|
284
297
|
if (ResponseProcessor.isViewStateNode(node)) {
|
|
285
298
|
let state = node.cDATAAsString;
|
|
286
|
-
this.internalContext.assign(APPLIED_VST, node.id.value).value = new StateHolder(node.id.value, state);
|
|
299
|
+
this.internalContext.assign(APPLIED_VST, node.id.value).value = new StateHolder($nsp(node.id.value), state);
|
|
287
300
|
return true;
|
|
288
301
|
}
|
|
289
302
|
return false;
|
|
@@ -292,7 +305,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
292
305
|
processClientWindow(node: XMLQuery): boolean {
|
|
293
306
|
if (ResponseProcessor.isClientWindowNode(node)) {
|
|
294
307
|
let state = node.cDATAAsString;
|
|
295
|
-
this.internalContext.assign(APPLIED_CLIENT_WINDOW, node.id.value).value = new StateHolder(node.id.value, state);
|
|
308
|
+
this.internalContext.assign(APPLIED_CLIENT_WINDOW, node.id.value).value = new StateHolder($nsp(node.id.value), state);
|
|
296
309
|
return true;
|
|
297
310
|
}
|
|
298
311
|
}
|
|
@@ -301,8 +314,14 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
301
314
|
* generic global eval which runs the embedded css and scripts
|
|
302
315
|
*/
|
|
303
316
|
globalEval() {
|
|
304
|
-
|
|
317
|
+
// phase one, if we have head inserts, we build up those before going into the script eval phase
|
|
318
|
+
let insertHeadElems = new ExtDomQuery(...this.internalContext.getIf(DEFERRED_HEAD_INSERTS).value);
|
|
319
|
+
insertHeadElems.runHeadInserts(true);
|
|
320
|
+
|
|
321
|
+
// phase 2 we run a script eval on all updated elements in the body
|
|
322
|
+
let updateElems = new ExtDomQuery(...this.internalContext.getIf(UPDATE_ELEMS).value);
|
|
305
323
|
updateElems.runCss();
|
|
324
|
+
// phase 3, we do the same for the css
|
|
306
325
|
updateElems.runScripts();
|
|
307
326
|
}
|
|
308
327
|
|
|
@@ -352,24 +371,24 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
352
371
|
}
|
|
353
372
|
|
|
354
373
|
/**
|
|
355
|
-
* proper
|
|
374
|
+
* proper viewState -> form assignment
|
|
356
375
|
*
|
|
357
|
-
* @param forms the forms to append the
|
|
358
|
-
* @param viewState the final
|
|
376
|
+
* @param forms the forms to append the viewState to
|
|
377
|
+
* @param viewState the final viewState
|
|
359
378
|
*/
|
|
360
379
|
private appendViewStateToForms(forms: DQ, viewState: string) {
|
|
361
|
-
this.assignState(forms, SEL_VIEWSTATE_ELEM, viewState);
|
|
380
|
+
this.assignState(forms, $nsp(SEL_VIEWSTATE_ELEM), viewState);
|
|
362
381
|
}
|
|
363
382
|
|
|
364
383
|
|
|
365
384
|
/**
|
|
366
|
-
* proper
|
|
385
|
+
* proper clientWindow -> form assignment
|
|
367
386
|
*
|
|
368
|
-
* @param forms the forms to append the
|
|
369
|
-
* @param clientWindow the final
|
|
387
|
+
* @param forms the forms to append the viewState to
|
|
388
|
+
* @param clientWindow the final viewState
|
|
370
389
|
*/
|
|
371
390
|
private appendClientWindowToForms(forms: DQ, clientWindow: string) {
|
|
372
|
-
this.assignState(forms, SEL_CLIENT_WINDOW_ELEM, clientWindow);
|
|
391
|
+
this.assignState(forms, $nsp(SEL_CLIENT_WINDOW_ELEM), clientWindow);
|
|
373
392
|
}
|
|
374
393
|
|
|
375
394
|
/**
|
|
@@ -393,28 +412,28 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
393
412
|
/**
|
|
394
413
|
* Helper to Create a new JSF ViewState Element
|
|
395
414
|
*
|
|
396
|
-
* @param parent, the parent node to attach the
|
|
415
|
+
* @param parent, the parent node to attach the viewState element to
|
|
397
416
|
* (usually a form node)
|
|
398
417
|
*/
|
|
399
418
|
private static newViewStateElement(parent: DQ): DQ {
|
|
400
|
-
let newViewState = DQ.fromMarkup(HTML_VIEWSTATE);
|
|
419
|
+
let newViewState = DQ.fromMarkup($nsp(HTML_VIEWSTATE));
|
|
401
420
|
newViewState.appendTo(parent);
|
|
402
421
|
return newViewState;
|
|
403
422
|
}
|
|
404
423
|
|
|
405
424
|
/**
|
|
406
|
-
* Stores certain aspects of the dom for later post
|
|
425
|
+
* Stores certain aspects of the dom for later post-processing
|
|
407
426
|
*
|
|
408
427
|
* @param updateForms the update forms which should receive standardized internal jsf data
|
|
409
|
-
* @param
|
|
428
|
+
* @param toBeEvaluated the resulting elements which should be evaluated
|
|
410
429
|
*/
|
|
411
|
-
private storeForPostProcessing(updateForms: DQ,
|
|
430
|
+
private storeForPostProcessing(updateForms: DQ, toBeEvaluated: DQ) {
|
|
412
431
|
this.storeForUpdate(updateForms);
|
|
413
|
-
this.storeForEval(
|
|
432
|
+
this.storeForEval(toBeEvaluated);
|
|
414
433
|
}
|
|
415
434
|
|
|
416
435
|
/**
|
|
417
|
-
* helper to store a given form for the update post
|
|
436
|
+
* helper to store a given form for the update post-processing (viewState)
|
|
418
437
|
*
|
|
419
438
|
* @param updateForms the dom query object pointing to the forms which need to be updated
|
|
420
439
|
*/
|
|
@@ -425,23 +444,23 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
425
444
|
/**
|
|
426
445
|
* same for eval (js and css)
|
|
427
446
|
*
|
|
428
|
-
* @param
|
|
447
|
+
* @param toBeEvaluated
|
|
429
448
|
*/
|
|
430
|
-
private storeForEval(
|
|
431
|
-
this.internalContext.assign(UPDATE_ELEMS).value.push(
|
|
449
|
+
private storeForEval(toBeEvaluated: DQ) {
|
|
450
|
+
this.internalContext.assign(UPDATE_ELEMS).value.push(toBeEvaluated);
|
|
432
451
|
}
|
|
433
452
|
|
|
434
453
|
/**
|
|
435
|
-
* check whether a given XMLQuery node is an explicit
|
|
454
|
+
* check whether a given XMLQuery node is an explicit viewState node
|
|
436
455
|
*
|
|
437
456
|
* @param node the node to check
|
|
438
|
-
* @returns
|
|
457
|
+
* @returns if it is a viewState node
|
|
439
458
|
*/
|
|
440
459
|
private static isViewStateNode(node: XMLQuery): boolean {
|
|
441
|
-
let separatorChar = (
|
|
442
|
-
return "undefined" != typeof node?.id?.value && (node?.id?.value == P_VIEWSTATE ||
|
|
443
|
-
node?.id?.value?.indexOf([separatorChar, P_VIEWSTATE].join(EMPTY_STR)) != -1 ||
|
|
444
|
-
node?.id?.value?.indexOf([P_VIEWSTATE, separatorChar].join(EMPTY_STR)) != -1);
|
|
460
|
+
let separatorChar = (window?.faces ?? window?.jsf).separatorchar;
|
|
461
|
+
return "undefined" != typeof node?.id?.value && (node?.id?.value == $nsp(P_VIEWSTATE) ||
|
|
462
|
+
node?.id?.value?.indexOf([separatorChar, $nsp(P_VIEWSTATE)].join(EMPTY_STR)) != -1 ||
|
|
463
|
+
node?.id?.value?.indexOf([$nsp(P_VIEWSTATE), separatorChar].join(EMPTY_STR)) != -1);
|
|
445
464
|
}
|
|
446
465
|
|
|
447
466
|
/**
|
|
@@ -451,14 +470,15 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
451
470
|
* @returns true of it ii
|
|
452
471
|
*/
|
|
453
472
|
private static isClientWindowNode(node: XMLQuery): boolean {
|
|
454
|
-
let separatorChar = (
|
|
455
|
-
return "undefined" != typeof node?.id?.value && (node?.id?.value == P_CLIENT_WINDOW ||
|
|
456
|
-
node?.id?.value?.indexOf([separatorChar, P_CLIENT_WINDOW].join(EMPTY_STR)) != -1 ||
|
|
457
|
-
node?.id?.value?.indexOf([P_CLIENT_WINDOW, separatorChar].join(EMPTY_STR)) != -1);
|
|
473
|
+
let separatorChar = (window?.faces ?? window?.jsf).separatorchar;
|
|
474
|
+
return "undefined" != typeof node?.id?.value && (node?.id?.value == $nsp(P_CLIENT_WINDOW) ||
|
|
475
|
+
node?.id?.value?.indexOf([separatorChar, $nsp(P_CLIENT_WINDOW)].join(EMPTY_STR)) != -1 ||
|
|
476
|
+
node?.id?.value?.indexOf([$nsp(P_CLIENT_WINDOW), separatorChar].join(EMPTY_STR)) != -1);
|
|
458
477
|
}
|
|
459
478
|
|
|
460
479
|
private triggerOnError(errorData: ErrorData) {
|
|
461
480
|
this.externalContext.getIf(ON_ERROR).orElse(this.internalContext.getIf(ON_ERROR).value).orElse(EMPTY_FUNC).value(errorData);
|
|
462
481
|
}
|
|
463
482
|
|
|
483
|
+
|
|
464
484
|
}
|