jsf.js_next_gen 4.0.0-beta-23 → 4.0.1-alpha.0
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/.nyc_output/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +1 -0
- package/.nyc_output/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +1 -0
- package/.nyc_output/processinfo/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +1 -0
- package/.nyc_output/processinfo/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/README.md +13 -21
- package/dist/docs/assets/main.js +56 -52
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/assets/style.css +23 -0
- package/dist/docs/functions/faces.ajax.addOnError.html +2 -0
- package/dist/docs/functions/faces.ajax.addOnEvent.html +2 -0
- package/dist/docs/functions/faces.push.close.html +4 -2
- package/dist/docs/functions/faces.push.init.html +19 -7
- package/dist/docs/functions/faces.push.open.html +4 -2
- package/dist/docs/functions/myfaces.ab.html +9 -4
- package/dist/docs/functions/myfaces.onDomReady.html +72 -0
- package/dist/docs/index.html +16 -18
- package/dist/docs/modules/myfaces.html +3 -1
- package/dist/docs/variables/myfaces.oam.html +2 -1
- package/dist/window/faces-development.js +2846 -2085
- 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 -1
- package/dist/window/faces.js +1 -1
- package/dist/window/faces.js.LICENSE.txt +17 -2
- package/dist/window/faces.js.br +0 -0
- package/dist/window/faces.js.gz +0 -0
- package/dist/window/faces.js.map +1 -1
- package/dist/window/jsf-development.js +2856 -2084
- 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 +1 -1
- package/dist/window/jsf.js.LICENSE.txt +17 -2
- 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 +19 -18
- package/plans for 4.0.1.txt +8 -0
- package/src/main/test.xml +23 -0
- package/src/main/typescript/@types/definitions/index.d.ts +19 -2
- package/src/main/typescript/api/_api.ts +68 -25
- package/src/main/typescript/api/jsf.ts +18 -0
- package/src/main/typescript/impl/AjaxImpl.ts +204 -100
- package/src/main/typescript/impl/PushImpl.ts +63 -38
- package/src/main/typescript/impl/core/Const.ts +56 -40
- package/src/main/typescript/impl/util/Assertions.ts +16 -8
- package/src/main/typescript/impl/util/AsyncRunnable.ts +85 -10
- package/src/main/typescript/impl/util/ExtDomQuery.ts +65 -54
- package/src/main/typescript/impl/util/FileUtils.ts +108 -0
- package/src/main/typescript/impl/util/HiddenInputBuilder.ts +93 -0
- package/src/main/typescript/impl/util/Lang.ts +91 -35
- package/src/main/typescript/impl/util/XhrQueueController.ts +112 -0
- package/src/main/typescript/impl/xhrCore/ErrorData.ts +15 -10
- package/src/main/typescript/impl/xhrCore/EventData.ts +3 -3
- package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +25 -11
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +78 -32
- package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +10 -10
- package/src/main/typescript/impl/xhrCore/Response.ts +66 -49
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +211 -138
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +92 -166
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +111 -120
- package/src/main/typescript/myfaces/OamSubmit.ts +30 -14
- package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +163 -27
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.ts +4 -4
- package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/blank.css +0 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.ts +921 -0
- package/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.ts +108 -0
- package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +111 -3
- package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +40 -1
- package/src/main/typescript/test/frameworkBase/_ext/shared/fixtures/jakarta.faces.resource/faces.js.jsf +0 -0
- package/src/main/typescript/test/impl/ImplTest.spec.ts +3 -3
- package/src/main/typescript/test/impl/ImplTest_23.spec.ts +3 -7
- package/src/main/typescript/test/myfaces/OnLoadSpec.ts +52 -0
- package/src/main/typescript/test/queue/AsynchronousProbe.ts +5 -5
- package/src/main/typescript/test/queue/AsynchronousQueueTest.spec.ts +4 -3
- package/src/main/typescript/test/xhrCore/EventTests.spec.ts +28 -22
- package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +5 -2
- package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +203 -0
- package/src/main/typescript/test/xhrCore/OamSubmitTest.spec.ts +177 -0
- package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +158 -17
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +320 -15
- package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +45 -4
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +374 -35
- package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +43 -9
- package/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.ts +109 -0
- package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +67 -49
- package/src/main/typescript/test.xml +6 -0
- package/src/main/typescript/tsconfig.json +1 -1
- package/src/test/resources/jsf-development.js +1 -1
- package/src/tmp/test.html +12 -88
- package/target/api/_api.js +63 -21
- package/target/api/_api.js.map +1 -1
- package/target/api/jsf.js +11 -0
- package/target/api/jsf.js.map +1 -1
- 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 +177 -81
- package/target/impl/AjaxImpl.js.map +1 -1
- package/target/impl/PushImpl.js +66 -35
- package/target/impl/PushImpl.js.map +1 -1
- package/target/impl/core/Const.js +54 -39
- package/target/impl/core/Const.js.map +1 -1
- package/target/impl/core/Context.js +10 -0
- package/target/impl/core/Context.js.map +1 -0
- package/target/impl/util/Assertions.js +12 -7
- package/target/impl/util/Assertions.js.map +1 -1
- package/target/impl/util/AsyncQueue.js.map +1 -1
- package/target/impl/util/AsyncRunnable.js +60 -0
- package/target/impl/util/AsyncRunnable.js.map +1 -1
- package/target/impl/util/ExtDomQuery.js +66 -48
- package/target/impl/util/ExtDomQuery.js.map +1 -1
- package/target/impl/util/FileUtils.js +97 -0
- package/target/impl/util/FileUtils.js.map +1 -0
- package/target/impl/util/HiddenElementBuilder.js +7 -0
- package/target/impl/util/HiddenElementBuilder.js.map +1 -0
- package/target/impl/util/HiddenInputBuilder.js +83 -0
- package/target/impl/util/HiddenInputBuilder.js.map +1 -0
- package/target/{types/index.js → impl/util/IAsyncRunnable.js} +11 -2
- package/target/impl/util/IAsyncRunnable.js.map +1 -0
- package/target/impl/util/Lang.js +81 -31
- package/target/impl/util/Lang.js.map +1 -1
- package/target/impl/util/URLCodec.js +77 -0
- package/target/impl/util/URLCodec.js.map +1 -0
- package/target/impl/util/XhrQueueController.js +107 -0
- package/target/impl/util/XhrQueueController.js.map +1 -0
- package/target/impl/xhrCore/ErrorData.js +10 -8
- package/target/impl/xhrCore/ErrorData.js.map +1 -1
- package/target/impl/xhrCore/EventData.js +2 -2
- package/target/impl/xhrCore/EventData.js.map +1 -1
- package/target/impl/xhrCore/RequestContext.js +11 -0
- package/target/impl/xhrCore/RequestContext.js.map +1 -0
- package/target/impl/xhrCore/RequestDataResolver.js +70 -23
- package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
- package/target/impl/xhrCore/ResonseDataResolver.js +9 -9
- package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
- package/target/impl/xhrCore/Response.js +44 -29
- package/target/impl/xhrCore/Response.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +187 -119
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +82 -156
- package/target/impl/xhrCore/XhrFormData.js.map +1 -1
- package/target/impl/xhrCore/XhrQueHandler.js +11 -0
- package/target/impl/xhrCore/XhrQueHandler.js.map +1 -0
- package/target/impl/xhrCore/XhrQueueController.js +62 -0
- package/target/impl/xhrCore/XhrQueueController.js.map +1 -0
- package/target/impl/xhrCore/XhrRequest.js +94 -106
- package/target/impl/xhrCore/XhrRequest.js.map +1 -1
- package/target/myfaces/OamSubmit.js +25 -14
- package/target/myfaces/OamSubmit.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +124 -23
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/ExtendedArrayTest.spec.js +76 -0
- package/target/test/frameworkBase/_ext/monadish/ExtendedArrayTest.spec.js.map +1 -0
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +4 -4
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js +925 -0
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js.map +1 -0
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js +112 -0
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js.map +1 -0
- package/target/test/frameworkBase/_ext/shared/StandardInits.js +103 -3
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +37 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
- package/target/test/impl/ImplTest.spec.js +2 -2
- package/target/test/impl/ImplTest.spec.js.map +1 -1
- package/target/test/impl/ImplTest_23.spec.js +2 -2
- package/target/test/impl/ImplTest_23.spec.js.map +1 -1
- package/target/test/myfaces/OnLoadSpec.js +57 -0
- package/target/test/myfaces/OnLoadSpec.js.map +1 -0
- package/target/test/queue/AsynchronousQueueTest.spec.js +3 -3
- package/target/test/queue/AsynchronousQueueTest.spec.js.map +1 -1
- package/target/test/xhrCore/EventTests.spec.js +26 -19
- package/target/test/xhrCore/EventTests.spec.js.map +1 -1
- package/target/test/xhrCore/FileUploadTest.spec.js +2 -1
- package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
- package/target/test/xhrCore/NamespacesRequestTest.spec.js +204 -0
- package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -0
- package/target/test/xhrCore/OamSubmitTest.spec.js +180 -0
- package/target/test/xhrCore/OamSubmitTest.spec.js.map +1 -0
- package/target/test/xhrCore/RequestParamsTest.spec.js +142 -10
- package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest.spec.js +288 -11
- package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest_23.spec.js +40 -2
- package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest.spec.js +315 -24
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +38 -8
- package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
- package/target/test/xhrCore/TobagoFileUploadTest.spec.js +128 -0
- package/target/test/xhrCore/TobagoFileUploadTest.spec.js.map +1 -0
- package/target/test/xhrCore/XhrFormDataTest.spec.js +57 -34
- package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
- package/target/test-classes/.gz +0 -0
- package/target/test-classes/com/example/jsfs_js_ts/JsfsJsTsApplicationTests.class +0 -0
- package/target/test-classes/fileuploadtest.html +24 -0
- package/target/test-classes/jsf-development.js +3559 -0
- package/target/test-classes/jsf-development.js.br +0 -0
- package/target/test-classes/jsf-development.js.gz +0 -0
- package/target/test-classes/jsf-development.js.map +1 -0
- package/target/test-classes/jsf.js +3 -0
- package/target/test-classes/jsf.js.br +0 -0
- package/target/test-classes/jsf.js.gz +0 -0
- package/tmp.xml +36 -0
- package/.nyc_output/2303b649-59d9-485c-9228-73b0ec8787a7.json +0 -1
- package/.nyc_output/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +0 -1
- package/.nyc_output/processinfo/2303b649-59d9-485c-9228-73b0ec8787a7.json +0 -1
- package/.nyc_output/processinfo/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +0 -1
- package/src/main/typescript/impl/util/AsyncQueue.ts +0 -133
- package/src/main/typescript/test/frameworkBase/_ext/monadish/StreamTest.spec.ts +0 -231
- package/target/types/index.js.map +0 -1
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {Config, DomQuery, DQ, Lang,
|
|
17
|
+
import {Config, DomQuery, DomQueryCollector, DQ, DQ$, Lang, XMLQuery} from "mona-dish";
|
|
18
18
|
import {Implementation} from "../AjaxImpl";
|
|
19
19
|
import {Assertions} from "../util/Assertions";
|
|
20
20
|
import {IResponseProcessor} from "./IResponseProcessor";
|
|
@@ -23,6 +23,7 @@ import {StateHolder} from "../core/ImplTypes";
|
|
|
23
23
|
import {EventData} from "./EventData";
|
|
24
24
|
|
|
25
25
|
import {
|
|
26
|
+
$faces,
|
|
26
27
|
$nsp,
|
|
27
28
|
APPLIED_CLIENT_WINDOW,
|
|
28
29
|
APPLIED_VST,
|
|
@@ -30,32 +31,42 @@ import {
|
|
|
30
31
|
ATTR_NAME,
|
|
31
32
|
ATTR_URL,
|
|
32
33
|
ATTR_VALUE,
|
|
34
|
+
DEFERRED_HEAD_INSERTS,
|
|
33
35
|
EMPTY_FUNC,
|
|
34
36
|
EMPTY_STR,
|
|
35
37
|
ERROR_MESSAGE,
|
|
36
38
|
ERROR_NAME,
|
|
37
|
-
|
|
39
|
+
HTML_TAG_BODY,
|
|
40
|
+
HTML_TAG_FORM,
|
|
41
|
+
HTML_TAG_HEAD,
|
|
42
|
+
HTML_TAG_LINK,
|
|
43
|
+
HTML_TAG_SCRIPT,
|
|
44
|
+
HTML_TAG_STYLE, IDENT_ALL, IDENT_NONE, NAMED_VIEWROOT,
|
|
38
45
|
ON_ERROR,
|
|
39
|
-
ON_EVENT,
|
|
40
|
-
|
|
46
|
+
ON_EVENT,
|
|
47
|
+
P_CLIENT_WINDOW,
|
|
48
|
+
P_EXECUTE,
|
|
49
|
+
P_AJAX_SOURCE,
|
|
50
|
+
P_RENDER,
|
|
51
|
+
P_RENDER_OVERRIDE,
|
|
41
52
|
P_VIEWSTATE,
|
|
42
|
-
|
|
43
|
-
|
|
53
|
+
NAMING_CONTAINER_ID,
|
|
54
|
+
RESPONSE_XML,
|
|
55
|
+
SEL_CLIENT_WINDOW_ELEM,
|
|
44
56
|
SEL_VIEWSTATE_ELEM,
|
|
45
57
|
SOURCE,
|
|
46
58
|
SUCCESS,
|
|
47
|
-
TAG_AFTER,
|
|
48
|
-
TAG_ATTR,
|
|
49
|
-
TAG_BEFORE,
|
|
50
|
-
TAG_BODY,
|
|
51
|
-
TAG_FORM,
|
|
52
|
-
TAG_HEAD,
|
|
53
59
|
UPDATE_ELEMS,
|
|
54
60
|
UPDATE_FORMS,
|
|
55
|
-
|
|
61
|
+
XML_TAG_AFTER,
|
|
62
|
+
XML_TAG_ATTR,
|
|
63
|
+
XML_TAG_BEFORE
|
|
56
64
|
} from "../core/Const";
|
|
65
|
+
import {ExtConfig, ExtDomQuery} from "../util/ExtDomQuery";
|
|
66
|
+
import {HiddenInputBuilder} from "../util/HiddenInputBuilder";
|
|
57
67
|
import trim = Lang.trim;
|
|
58
|
-
import {
|
|
68
|
+
import {ExtLang} from "../util/Lang";
|
|
69
|
+
import ofAssoc = ExtLang.ofAssoc;
|
|
59
70
|
|
|
60
71
|
|
|
61
72
|
/**
|
|
@@ -82,31 +93,38 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
82
93
|
* the data incoming must represent the html representation of the head itself one way or the other
|
|
83
94
|
*/
|
|
84
95
|
replaceHead(shadowDocument: XMLQuery | DQ) {
|
|
85
|
-
|
|
96
|
+
const shadowHead = shadowDocument.querySelectorAll(HTML_TAG_HEAD);
|
|
86
97
|
if (!shadowHead.isPresent()) {
|
|
87
98
|
return;
|
|
88
99
|
}
|
|
100
|
+
const head = ExtDomQuery.querySelectorAll(HTML_TAG_HEAD);
|
|
101
|
+
// full replace we delete everything
|
|
102
|
+
head.childNodes.delete();
|
|
103
|
+
this.addToHead(shadowHead);
|
|
104
|
+
//we copy the attributes as well (just in case myfaces introduces the id in head)
|
|
105
|
+
head.copyAttrs(shadowHead);
|
|
106
|
+
}
|
|
89
107
|
|
|
90
|
-
|
|
108
|
+
addToHead(shadowHead: XMLQuery | DQ) {
|
|
109
|
+
const mappedHeadData = new ExtDomQuery(shadowHead);
|
|
110
|
+
const scriptTags = [HTML_TAG_SCRIPT];
|
|
111
|
+
const nonExecutables = mappedHeadData.filter(item => scriptTags.indexOf(item.tagName.orElse("").value) == -1);
|
|
112
|
+
nonExecutables.runHeadInserts(true);
|
|
91
113
|
|
|
92
|
-
//
|
|
93
|
-
|
|
114
|
+
//incoming either the outer head tag or its children
|
|
115
|
+
const nodesToAdd = (shadowHead.tagName.value === "HEAD") ? shadowHead.childNodes : shadowHead;
|
|
116
|
+
// this is stored for "post" processing
|
|
117
|
+
// after the rest of the "physical build up", head before body
|
|
118
|
+
const scriptElements = nodesToAdd.stream
|
|
119
|
+
.filter(item => scriptTags.indexOf(item.tagName.orElse("").value) != -1).collect(new DomQueryCollector());
|
|
94
120
|
|
|
95
|
-
|
|
96
|
-
// eval means the scripts will get attached (eval script attach method)
|
|
97
|
-
// but this is done by DomQuery not in this code
|
|
98
|
-
this.storeForEval(shadowHead);
|
|
99
|
-
//incoming either the outer head tag or its childs
|
|
100
|
-
//shadowHead = (shadowHead.tagName.value === "HEAD") ? shadowHead.childNodes : shadowHead;
|
|
101
|
-
//this.addToHead(shadowHead);
|
|
121
|
+
this.addToHeadDeferred(scriptElements);
|
|
102
122
|
}
|
|
103
123
|
|
|
104
|
-
|
|
124
|
+
addToHeadDeferred(newElements: XMLQuery | DQ) {
|
|
105
125
|
this.internalContext.assign(DEFERRED_HEAD_INSERTS).value.push(newElements);
|
|
106
126
|
}
|
|
107
127
|
|
|
108
|
-
|
|
109
|
-
|
|
110
128
|
/**
|
|
111
129
|
* replaces the body in the expected manner
|
|
112
130
|
* which means the entire body content is refreshed
|
|
@@ -117,30 +135,30 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
117
135
|
*/
|
|
118
136
|
replaceBody(shadowDocument: XMLQuery | DQ) {
|
|
119
137
|
|
|
120
|
-
|
|
138
|
+
const shadowBody = shadowDocument.querySelectorAll(HTML_TAG_BODY);
|
|
121
139
|
if (!shadowBody.isPresent()) {
|
|
122
140
|
return;
|
|
123
141
|
}
|
|
124
142
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
let updateForms = resultingBody.querySelectorAll(TAG_FORM);
|
|
143
|
+
const shadowInnerHTML: string = <string>shadowBody.innerHTML;
|
|
144
|
+
const resultingBody = <DQ>ExtDomQuery.querySelectorAll(HTML_TAG_BODY);
|
|
145
|
+
const updateForms = resultingBody.querySelectorAll(HTML_TAG_FORM);
|
|
129
146
|
|
|
130
147
|
// main difference, we cannot replace the body itself, but only its content
|
|
131
|
-
// we need a separate step for post
|
|
132
|
-
|
|
133
|
-
|
|
148
|
+
// we need a separate step for post-processing the incoming
|
|
149
|
+
// attributes, like classes, styles etc...
|
|
150
|
+
(resultingBody.html(shadowInnerHTML) as DQ).copyAttrs(shadowBody);
|
|
151
|
+
this.externalContext.assign($nsp(P_RENDER_OVERRIDE)).value = "@all";
|
|
134
152
|
this.storeForPostProcessing(updateForms, resultingBody);
|
|
135
153
|
}
|
|
136
154
|
|
|
137
155
|
/**
|
|
138
|
-
* Leaf Tag eval... process whatever is in the
|
|
156
|
+
* Leaf Tag eval... process whatever is in the eval cdata block
|
|
139
157
|
*
|
|
140
158
|
* @param node the node to eval
|
|
141
159
|
*/
|
|
142
160
|
eval(node: XMLQuery) {
|
|
143
|
-
|
|
161
|
+
ExtDomQuery.globalEval(node.cDATAAsString);
|
|
144
162
|
}
|
|
145
163
|
|
|
146
164
|
/**
|
|
@@ -157,22 +175,22 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
157
175
|
* <error>
|
|
158
176
|
*/
|
|
159
177
|
|
|
160
|
-
|
|
161
|
-
mergedErrorData.assign(SOURCE).value = this.externalContext.getIf(
|
|
178
|
+
const mergedErrorData = new ExtConfig({});
|
|
179
|
+
mergedErrorData.assign(SOURCE).value = this.externalContext.getIf(P_AJAX_SOURCE).get(0).value;
|
|
162
180
|
mergedErrorData.assign(ERROR_NAME).value = node.querySelectorAll(ERROR_NAME).textContent(EMPTY_STR);
|
|
163
181
|
mergedErrorData.assign(ERROR_MESSAGE).value = node.querySelectorAll(ERROR_MESSAGE).cDATAAsString;
|
|
164
182
|
|
|
165
|
-
|
|
183
|
+
const hasResponseXML = this.internalContext.get(RESPONSE_XML).isPresent();
|
|
166
184
|
|
|
167
185
|
//we now store the response xml also in the error data for further details
|
|
168
186
|
mergedErrorData.assignIf(hasResponseXML, RESPONSE_XML).value = this.internalContext.getIf(RESPONSE_XML).value.get(0).value;
|
|
169
187
|
|
|
170
|
-
// error post
|
|
171
|
-
|
|
188
|
+
// error post-processing and enrichment (standard messages from keys)
|
|
189
|
+
const errorData = ErrorData.fromServerError(mergedErrorData);
|
|
172
190
|
|
|
173
|
-
// we now trigger an internally stored onError function which might be
|
|
174
|
-
// either we
|
|
175
|
-
//
|
|
191
|
+
// we now trigger an internally stored onError function which might be an attached to the context
|
|
192
|
+
// either we do not have an internal on error, or an on error has been based via params from the outside.
|
|
193
|
+
// In both cases they are attached to our contexts
|
|
176
194
|
|
|
177
195
|
this.triggerOnError(errorData);
|
|
178
196
|
Implementation.sendError(errorData);
|
|
@@ -186,7 +204,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
186
204
|
redirect(node: XMLQuery) {
|
|
187
205
|
Assertions.assertUrlExists(node);
|
|
188
206
|
|
|
189
|
-
|
|
207
|
+
const redirectUrl = trim(node.attr(ATTR_URL).value);
|
|
190
208
|
if (redirectUrl != EMPTY_STR) {
|
|
191
209
|
window.location.href = redirectUrl;
|
|
192
210
|
}
|
|
@@ -198,15 +216,15 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
198
216
|
* @param cdataBlock the cdata block with the new html code
|
|
199
217
|
*/
|
|
200
218
|
update(node: XMLQuery, cdataBlock: string) {
|
|
201
|
-
|
|
202
|
-
|
|
219
|
+
const result = ExtDomQuery.byId(node.id.value, true).outerHTML(cdataBlock, false, false);
|
|
220
|
+
const sourceForm = result?.firstParent(HTML_TAG_FORM).orElseLazy(() => result.byTagName(HTML_TAG_FORM, true));
|
|
203
221
|
if (sourceForm) {
|
|
204
222
|
this.storeForPostProcessing(sourceForm, result);
|
|
205
223
|
}
|
|
206
224
|
}
|
|
207
225
|
|
|
208
226
|
/**
|
|
209
|
-
* Delete handler, simply
|
|
227
|
+
* Delete handler, simply deletes the node referenced by the xml data
|
|
210
228
|
* @param node
|
|
211
229
|
*/
|
|
212
230
|
delete(node: XMLQuery) {
|
|
@@ -219,9 +237,9 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
219
237
|
* @param node
|
|
220
238
|
*/
|
|
221
239
|
attributes(node: XMLQuery) {
|
|
222
|
-
|
|
240
|
+
const elem = DQ.byId(node.id.value, true);
|
|
223
241
|
|
|
224
|
-
node.byTagName(
|
|
242
|
+
node.byTagName(XML_TAG_ATTR).each((item: XMLQuery) => {
|
|
225
243
|
elem.attr(item.attr(ATTR_NAME).value).value = item.attr(ATTR_VALUE).value;
|
|
226
244
|
});
|
|
227
245
|
}
|
|
@@ -242,17 +260,16 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
242
260
|
insert(node: XMLQuery) {
|
|
243
261
|
//let insertId = node.id; //not used atm
|
|
244
262
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
let insertNodes = DQ.fromMarkup(<any>node.cDATAAsString);
|
|
263
|
+
const before = node.attr(XML_TAG_BEFORE);
|
|
264
|
+
const after = node.attr(XML_TAG_AFTER);
|
|
265
|
+
const insertNodes = DQ.fromMarkup(<any>node.cDATAAsString);
|
|
249
266
|
|
|
250
267
|
if (before.isPresent()) {
|
|
251
268
|
DQ.byId(before.value, true).insertBefore(insertNodes);
|
|
252
269
|
this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);
|
|
253
270
|
}
|
|
254
271
|
if (after.isPresent()) {
|
|
255
|
-
|
|
272
|
+
const domQuery = DQ.byId(after.value, true);
|
|
256
273
|
domQuery.insertAfter(insertNodes);
|
|
257
274
|
|
|
258
275
|
this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);
|
|
@@ -264,13 +281,13 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
264
281
|
*
|
|
265
282
|
* @param node the node hosting the insert data
|
|
266
283
|
*/
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
284
|
+
insertWithSubTags(node: XMLQuery) {
|
|
285
|
+
const before = node.querySelectorAll(XML_TAG_BEFORE);
|
|
286
|
+
const after = node.querySelectorAll(XML_TAG_AFTER);
|
|
270
287
|
|
|
271
288
|
before.each(item => {
|
|
272
|
-
|
|
273
|
-
|
|
289
|
+
const insertId = item.attr(ATTR_ID);
|
|
290
|
+
const insertNodes = DQ.fromMarkup(<any>item.cDATAAsString);
|
|
274
291
|
if (insertId.isPresent()) {
|
|
275
292
|
DQ.byId(insertId.value, true).insertBefore(insertNodes);
|
|
276
293
|
this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);
|
|
@@ -278,8 +295,8 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
278
295
|
});
|
|
279
296
|
|
|
280
297
|
after.each(item => {
|
|
281
|
-
|
|
282
|
-
|
|
298
|
+
const insertId = item.attr(ATTR_ID);
|
|
299
|
+
const insertNodes = DQ.fromMarkup(<any>item.cDATAAsString);
|
|
283
300
|
if (insertId.isPresent()) {
|
|
284
301
|
DQ.byId(insertId.value, true).insertAfter(insertNodes);
|
|
285
302
|
this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);
|
|
@@ -289,12 +306,12 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
289
306
|
|
|
290
307
|
/**
|
|
291
308
|
* Process the viewState update, update the affected
|
|
292
|
-
* forms with their respective new
|
|
309
|
+
* forms with their respective new viewState values
|
|
293
310
|
*
|
|
294
311
|
*/
|
|
295
312
|
processViewState(node: XMLQuery): boolean {
|
|
296
313
|
if (ResponseProcessor.isViewStateNode(node)) {
|
|
297
|
-
|
|
314
|
+
const state = node.cDATAAsString;
|
|
298
315
|
this.internalContext.assign(APPLIED_VST, node.id.value).value = new StateHolder($nsp(node.id.value), state);
|
|
299
316
|
return true;
|
|
300
317
|
}
|
|
@@ -303,7 +320,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
303
320
|
|
|
304
321
|
processClientWindow(node: XMLQuery): boolean {
|
|
305
322
|
if (ResponseProcessor.isClientWindowNode(node)) {
|
|
306
|
-
|
|
323
|
+
const state = node.cDATAAsString;
|
|
307
324
|
this.internalContext.assign(APPLIED_CLIENT_WINDOW, node.id.value).value = new StateHolder($nsp(node.id.value), state);
|
|
308
325
|
return true;
|
|
309
326
|
}
|
|
@@ -314,11 +331,11 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
314
331
|
*/
|
|
315
332
|
globalEval() {
|
|
316
333
|
// phase one, if we have head inserts, we build up those before going into the script eval phase
|
|
317
|
-
let insertHeadElems = new
|
|
334
|
+
let insertHeadElems = new ExtDomQuery(...this.internalContext.getIf(DEFERRED_HEAD_INSERTS).value);
|
|
318
335
|
insertHeadElems.runHeadInserts(true);
|
|
319
336
|
|
|
320
337
|
// phase 2 we run a script eval on all updated elements in the body
|
|
321
|
-
let updateElems = new
|
|
338
|
+
let updateElems = new ExtDomQuery(...this.internalContext.getIf(UPDATE_ELEMS).value);
|
|
322
339
|
updateElems.runCss();
|
|
323
340
|
// phase 3, we do the same for the css
|
|
324
341
|
updateElems.runScripts();
|
|
@@ -331,63 +348,79 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
331
348
|
* as last lifecycle step, before going into the next request.
|
|
332
349
|
*/
|
|
333
350
|
fixViewStates() {
|
|
334
|
-
|
|
335
|
-
.
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
this.appendViewStateToForms(
|
|
342
|
-
})
|
|
351
|
+
ofAssoc(this.internalContext.getIf(APPLIED_VST).orElse({}).value)
|
|
352
|
+
.forEach(([, value]) => {
|
|
353
|
+
const namingContainerId = this.internalContext.getIf(NAMING_CONTAINER_ID);
|
|
354
|
+
const namedViewRoot = !!this.internalContext.getIf(NAMED_VIEWROOT).value
|
|
355
|
+
const affectedForms = this.getContainerForms(namingContainerId)
|
|
356
|
+
.filter(affectedForm => this.isInExecuteOrRender(affectedForm));
|
|
357
|
+
|
|
358
|
+
this.appendViewStateToForms(affectedForms, namedViewRoot, value.value, namingContainerId.orElse("").value);
|
|
359
|
+
})
|
|
343
360
|
}
|
|
344
361
|
|
|
362
|
+
|
|
363
|
+
|
|
345
364
|
/**
|
|
346
365
|
* same as with view states before applies the incoming client windows as last step after the rest of the processing
|
|
347
366
|
* is done.
|
|
348
367
|
*/
|
|
349
368
|
fixClientWindow() {
|
|
350
|
-
|
|
351
|
-
.
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
this.appendClientWindowToForms(
|
|
369
|
+
ofAssoc(this.internalContext.getIf(APPLIED_CLIENT_WINDOW).orElse({}).value)
|
|
370
|
+
.forEach(([, value]) => {
|
|
371
|
+
const namingContainerId = this.internalContext.getIf(NAMING_CONTAINER_ID);
|
|
372
|
+
const namedViewRoot = !!this.internalContext.getIf(NAMED_VIEWROOT).value;
|
|
373
|
+
const affectedForms = this.getContainerForms(namingContainerId)
|
|
374
|
+
.filter(affectedForm => this.isInExecuteOrRender(affectedForm));
|
|
375
|
+
|
|
376
|
+
this.appendClientWindowToForms(affectedForms, namedViewRoot, value.value, namingContainerId.orElse("").value);
|
|
358
377
|
});
|
|
359
378
|
}
|
|
360
379
|
|
|
380
|
+
updateNamedViewRootState() {
|
|
381
|
+
let partialId = this.internalContext.getIf(NAMING_CONTAINER_ID);
|
|
382
|
+
let namedViewRoot = this.internalContext.getIf(NAMED_VIEWROOT);
|
|
383
|
+
if(partialId.isPresent() &&
|
|
384
|
+
(namedViewRoot.isAbsent() ||
|
|
385
|
+
!namedViewRoot.value)) {
|
|
386
|
+
const SEP = $faces().separatorchar;
|
|
387
|
+
this.internalContext.assign(NAMED_VIEWROOT).value = (!!document.getElementById(partialId.value)) || DQ$(`input[name*='${$nsp(P_VIEWSTATE)}']`)
|
|
388
|
+
.filter(node => node.attr("name").value.indexOf(partialId.value + SEP) == 0).length > 0;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
361
392
|
/**
|
|
362
393
|
* all processing done we can close the request and send the appropriate events
|
|
363
394
|
*/
|
|
364
395
|
done() {
|
|
365
|
-
|
|
396
|
+
const eventData = EventData.createFromRequest(this.request.value, this.externalContext, SUCCESS);
|
|
366
397
|
|
|
367
398
|
//because some frameworks might decorate them over the context in the response
|
|
368
|
-
|
|
399
|
+
const eventHandler = this.externalContext.getIf(ON_EVENT).orElseLazy(() => this.internalContext.getIf(ON_EVENT).value).orElse(EMPTY_FUNC).value;
|
|
369
400
|
Implementation.sendEvent(eventData, eventHandler);
|
|
370
401
|
}
|
|
371
402
|
|
|
372
403
|
/**
|
|
373
|
-
* proper
|
|
404
|
+
* proper viewState -> form assignment
|
|
374
405
|
*
|
|
375
|
-
* @param forms the forms to append the
|
|
376
|
-
* @param viewState the final
|
|
406
|
+
* @param forms the forms to append the viewState to
|
|
407
|
+
* @param viewState the final viewState
|
|
408
|
+
* @param namingContainerId
|
|
377
409
|
*/
|
|
378
|
-
private appendViewStateToForms(forms: DQ, viewState: string) {
|
|
379
|
-
this.assignState(forms, $nsp(SEL_VIEWSTATE_ELEM), viewState);
|
|
410
|
+
private appendViewStateToForms(forms: DQ, namedViewRoot: boolean, viewState: string, namingContainerId = "") {
|
|
411
|
+
this.assignState(forms, $nsp(SEL_VIEWSTATE_ELEM), namedViewRoot, viewState, namingContainerId);
|
|
380
412
|
}
|
|
381
413
|
|
|
382
414
|
|
|
383
415
|
/**
|
|
384
|
-
* proper
|
|
416
|
+
* proper clientWindow -> form assignment
|
|
385
417
|
*
|
|
386
|
-
* @param forms the forms to append the
|
|
387
|
-
* @param clientWindow the final
|
|
418
|
+
* @param forms the forms to append the viewState to
|
|
419
|
+
* @param clientWindow the final viewState
|
|
420
|
+
* @param namingContainerId
|
|
388
421
|
*/
|
|
389
|
-
private appendClientWindowToForms(forms: DQ, clientWindow: string) {
|
|
390
|
-
this.assignState(forms, $nsp(SEL_CLIENT_WINDOW_ELEM), clientWindow);
|
|
422
|
+
private appendClientWindowToForms(forms: DQ, namedViewRoot: boolean, clientWindow: string, namingContainerId = "") {
|
|
423
|
+
this.assignState(forms, $nsp(SEL_CLIENT_WINDOW_ELEM), namedViewRoot, clientWindow, namingContainerId);
|
|
391
424
|
}
|
|
392
425
|
|
|
393
426
|
/**
|
|
@@ -395,44 +428,45 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
395
428
|
*
|
|
396
429
|
* @param forms the forms to append or change to
|
|
397
430
|
* @param selector the selector for the state
|
|
431
|
+
* @param namedViewRoot if set to true, the name is also prefixed
|
|
398
432
|
* @param state the state itself which needs to be assigned
|
|
399
433
|
*
|
|
434
|
+
* @param namingContainerId
|
|
400
435
|
* @private
|
|
401
436
|
*/
|
|
402
|
-
private assignState(forms: DQ,
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
437
|
+
private assignState(forms: DQ, selector: string, namedViewRoot: boolean, state: string, namingContainerId: string) {
|
|
438
|
+
/**
|
|
439
|
+
* creates the viewState or client window id element
|
|
440
|
+
* @param form
|
|
441
|
+
*/
|
|
442
|
+
const createAndAppendHiddenInput = (form: DomQuery) => {
|
|
443
|
+
return new HiddenInputBuilder(selector)
|
|
444
|
+
.withNamingContainerId(namingContainerId)
|
|
445
|
+
.withParent(form)
|
|
446
|
+
.withNamedViewRoot(namedViewRoot)
|
|
447
|
+
.build();
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
forms.each(form => {
|
|
451
|
+
const hiddenInput = form.querySelectorAll(selector)
|
|
452
|
+
.orElseLazy(() => createAndAppendHiddenInput(form));
|
|
453
|
+
hiddenInput.val = state;
|
|
408
454
|
});
|
|
409
455
|
}
|
|
410
456
|
|
|
411
457
|
/**
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
-
* @param parent, the parent node to attach the viewstate element to
|
|
415
|
-
* (usually a form node)
|
|
416
|
-
*/
|
|
417
|
-
private static newViewStateElement(parent: DQ): DQ {
|
|
418
|
-
let newViewState = DQ.fromMarkup($nsp(HTML_VIEWSTATE));
|
|
419
|
-
newViewState.appendTo(parent);
|
|
420
|
-
return newViewState;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
* Stores certain aspects of the dom for later post processing
|
|
458
|
+
* Stores certain aspects of the dom for later post-processing
|
|
425
459
|
*
|
|
426
460
|
* @param updateForms the update forms which should receive standardized internal jsf data
|
|
427
|
-
* @param
|
|
461
|
+
* @param toBeEvaluated the resulting elements which should be evaluated
|
|
428
462
|
*/
|
|
429
|
-
private storeForPostProcessing(updateForms: DQ,
|
|
463
|
+
private storeForPostProcessing(updateForms: DQ, toBeEvaluated: DQ) {
|
|
430
464
|
this.storeForUpdate(updateForms);
|
|
431
|
-
this.storeForEval(
|
|
465
|
+
this.storeForEval(toBeEvaluated);
|
|
432
466
|
}
|
|
433
467
|
|
|
434
468
|
/**
|
|
435
|
-
* helper to store a given form for the update post
|
|
469
|
+
* helper to store a given form for the update post-processing (viewState)
|
|
436
470
|
*
|
|
437
471
|
* @param updateForms the dom query object pointing to the forms which need to be updated
|
|
438
472
|
*/
|
|
@@ -443,28 +477,23 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
443
477
|
/**
|
|
444
478
|
* same for eval (js and css)
|
|
445
479
|
*
|
|
446
|
-
* @param
|
|
480
|
+
* @param toBeEvaluated
|
|
447
481
|
*/
|
|
448
|
-
private storeForEval(
|
|
449
|
-
this.internalContext.assign(UPDATE_ELEMS).value.push(
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
// head eval is always sticky
|
|
453
|
-
private storeForHeadEval(toBeEvaled: DQ, sticky) {
|
|
454
|
-
this.internalContext.assign(DEFERRED_HEAD_INSERTS).value.push(toBeEvaled);
|
|
482
|
+
private storeForEval(toBeEvaluated: DQ) {
|
|
483
|
+
this.internalContext.assign(UPDATE_ELEMS).value.push(toBeEvaluated);
|
|
455
484
|
}
|
|
456
485
|
|
|
457
486
|
/**
|
|
458
|
-
* check whether a given XMLQuery node is an explicit
|
|
487
|
+
* check whether a given XMLQuery node is an explicit viewState node
|
|
459
488
|
*
|
|
460
489
|
* @param node the node to check
|
|
461
|
-
* @returns
|
|
490
|
+
* @returns if it is a viewState node
|
|
462
491
|
*/
|
|
463
492
|
private static isViewStateNode(node: XMLQuery): boolean {
|
|
464
|
-
|
|
493
|
+
const SEP = $faces().separatorchar;
|
|
465
494
|
return "undefined" != typeof node?.id?.value && (node?.id?.value == $nsp(P_VIEWSTATE) ||
|
|
466
|
-
node?.id?.value?.indexOf([
|
|
467
|
-
node?.id?.value?.indexOf([$nsp(P_VIEWSTATE),
|
|
495
|
+
node?.id?.value?.indexOf([SEP, $nsp(P_VIEWSTATE)].join(EMPTY_STR)) != -1 ||
|
|
496
|
+
node?.id?.value?.indexOf([$nsp(P_VIEWSTATE), SEP].join(EMPTY_STR)) != -1);
|
|
468
497
|
}
|
|
469
498
|
|
|
470
499
|
/**
|
|
@@ -474,15 +503,59 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
474
503
|
* @returns true of it ii
|
|
475
504
|
*/
|
|
476
505
|
private static isClientWindowNode(node: XMLQuery): boolean {
|
|
477
|
-
|
|
506
|
+
const SEP = $faces().separatorchar;
|
|
478
507
|
return "undefined" != typeof node?.id?.value && (node?.id?.value == $nsp(P_CLIENT_WINDOW) ||
|
|
479
|
-
node?.id?.value?.indexOf([
|
|
480
|
-
node?.id?.value?.indexOf([$nsp(P_CLIENT_WINDOW),
|
|
508
|
+
node?.id?.value?.indexOf([SEP, $nsp(P_CLIENT_WINDOW)].join(EMPTY_STR)) != -1 ||
|
|
509
|
+
node?.id?.value?.indexOf([$nsp(P_CLIENT_WINDOW), SEP].join(EMPTY_STR)) != -1);
|
|
481
510
|
}
|
|
482
511
|
|
|
483
512
|
private triggerOnError(errorData: ErrorData) {
|
|
484
|
-
this.externalContext.getIf(ON_ERROR).
|
|
513
|
+
this.externalContext.getIf(ON_ERROR).orElseLazy(() => this.internalContext.getIf(ON_ERROR).value).orElse(EMPTY_FUNC).value(errorData);
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* filters the forms according to being member of the "execute" or "render" cycle
|
|
518
|
+
* @param affectedForm
|
|
519
|
+
* @private
|
|
520
|
+
*/
|
|
521
|
+
private isInExecuteOrRender(affectedForm) {
|
|
522
|
+
const executes = this.externalContext.getIf($nsp(P_EXECUTE)).orElse("@none").value.split(/\s+/gi);
|
|
523
|
+
const renders = this.externalContext.getIf(P_RENDER_OVERRIDE)
|
|
524
|
+
.orElseLazy(() => this.externalContext.getIf($nsp(P_RENDER)).value)
|
|
525
|
+
.orElse(IDENT_NONE).value.split(/\s+/gi);
|
|
526
|
+
const executeAndRenders = executes.concat(...renders);
|
|
527
|
+
return [...executeAndRenders].filter(nameOrId => {
|
|
528
|
+
if ([IDENT_ALL, IDENT_NONE].indexOf(nameOrId) != -1) {
|
|
529
|
+
return true;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
const NAME_OR_ID = this.getNameOrIdSelector(nameOrId);
|
|
533
|
+
//either the form directly is in execute or render or one of its children or one of its parents
|
|
534
|
+
return affectedForm.matchesSelector(NAME_OR_ID) ||
|
|
535
|
+
affectedForm.querySelectorAll(NAME_OR_ID).isPresent() ||
|
|
536
|
+
affectedForm.firstParent(NAME_OR_ID).isPresent();
|
|
537
|
+
}).length > 0;
|
|
485
538
|
}
|
|
486
539
|
|
|
540
|
+
/**
|
|
541
|
+
* gets all forms under a single naming container id
|
|
542
|
+
* @param namingContainerId
|
|
543
|
+
* @private
|
|
544
|
+
*/
|
|
545
|
+
private getContainerForms(namingContainerId: Config) {
|
|
546
|
+
if (namingContainerId.isPresent()) {
|
|
547
|
+
//naming container mode, all forms under naming container id must be processed
|
|
548
|
+
return DQ$(this.getNameOrIdSelector(namingContainerId.value))
|
|
549
|
+
// missing condition if the naming container is not present we have to
|
|
550
|
+
// use the body as fallback
|
|
551
|
+
.orElseLazy(() => DQ.byTagName(HTML_TAG_BODY))
|
|
552
|
+
.byTagName(HTML_TAG_FORM, true);
|
|
553
|
+
} else {
|
|
554
|
+
return DQ.byTagName(HTML_TAG_FORM);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
487
557
|
|
|
558
|
+
private getNameOrIdSelector(nameOrId) {
|
|
559
|
+
return `[id='${nameOrId}'], [name='${nameOrId}']`;
|
|
560
|
+
}
|
|
488
561
|
}
|