jsf.js_next_gen 4.0.5-beta.3 → 4.0.5-beta.4
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/dist/docs/functions/myfaces.ab.html +1 -1
- package/dist/window/faces-development.js +131 -131
- package/dist/window/faces-development.js.map +1 -1
- package/dist/window/faces.js +1 -1
- package/dist/window/faces.js.map +1 -1
- package/dist/window/jsf-development.js +131 -131
- package/dist/window/jsf-development.js.map +1 -1
- package/dist/window/jsf.js +1 -1
- package/dist/window/jsf.js.map +1 -1
- package/package.json +2 -2
- package/src/main/typescript/api/_api.ts +1 -1
- package/src/main/typescript/impl/AjaxImpl.ts +30 -30
- package/src/main/typescript/impl/xhrCore/ErrorData.ts +1 -1
- package/src/main/typescript/impl/xhrCore/Response.ts +1 -1
- package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +0 -1
- package/src/main/typescript/test/xhrCore/OamSubmitTest.spec.ts +2 -2
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +4 -4
- package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +1 -1
- package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +18 -18
- package/target/api/_api.js +1 -1
- package/target/impl/AjaxImpl.js +13 -13
- package/target/impl/AjaxImpl.js.map +1 -1
- package/target/impl/xhrCore/ErrorData.js +1 -1
- package/target/impl/xhrCore/ErrorData.js.map +1 -1
- package/target/impl/xhrCore/Response.js +3 -3
- package/target/impl/xhrCore/Response.js.map +1 -1
- package/target/impl/xhrCore/ResponseDataResolver.js +104 -0
- package/target/impl/xhrCore/ResponseDataResolver.js.map +1 -0
- package/target/test/xhrCore/FileUploadTest.spec.js +0 -1
- package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
- package/target/test/xhrCore/OamSubmitTest.spec.js +1 -1
- package/target/test/xhrCore/OamSubmitTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest.spec.js +4 -4
- package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest_23.spec.js +1 -1
- package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +15 -15
- package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
- /package/src/main/typescript/impl/xhrCore/{ResonseDataResolver.ts → ResponseDataResolver.ts} +0 -0
|
@@ -7,5 +7,5 @@ Code provided by Thomas Andraschko</p>
|
|
|
7
7
|
</div></li><li><span><span class="tsd-kind-parameter">execute</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>execute list as passed down in faces.ajax.request</p>
|
|
8
8
|
</div></li><li><span><span class="tsd-kind-parameter">render</span>: <span class="tsd-signature-type">string</span></span><div class="tsd-comment tsd-typography"><p>the render list as string</p>
|
|
9
9
|
</div></li><li><span><span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-type">Options</span><span class="tsd-signature-symbol"> = {}</span></span><div class="tsd-comment tsd-typography"><p>the options which need to be merged in</p>
|
|
10
|
-
</div></li><li><span><span class="tsd-kind-parameter">userParameters</span>: <span class="tsd-signature-type">Options</span><span class="tsd-signature-symbol"> = {}</span></span><div class="tsd-comment tsd-typography"><p>a set of user parameters which go into the final options under params, they can
|
|
10
|
+
</div></li><li><span><span class="tsd-kind-parameter">userParameters</span>: <span class="tsd-signature-type">Options</span><span class="tsd-signature-symbol"> = {}</span></span><div class="tsd-comment tsd-typography"><p>a set of user parameters which go into the final options under params, they can override whatever is passed via options</p>
|
|
11
11
|
</div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></div></li></ul></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" aria-hidden="true"><use href="../assets/icons.svg#icon-chevronDown"></use></svg><h3>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html">jsf.js_next_gen</a><ul class="tsd-small-nested-navigation" id="tsd-nav-container"><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -4202,7 +4202,7 @@ var myfaces;
|
|
|
4202
4202
|
* @param execute execute list as passed down in faces.ajax.request
|
|
4203
4203
|
* @param render the render list as string
|
|
4204
4204
|
* @param options the options which need to be merged in
|
|
4205
|
-
* @param userParameters a set of user parameters which go into the final options under params, they can
|
|
4205
|
+
* @param userParameters a set of user parameters which go into the final options under params, they can override whatever is passed via options
|
|
4206
4206
|
*/
|
|
4207
4207
|
function ab(source, event, eventName, execute, render, options = {}, userParameters = {}) {
|
|
4208
4208
|
var _a, _b;
|
|
@@ -4366,43 +4366,43 @@ var Implementation;
|
|
|
4366
4366
|
Small internal explanation, this code is optimized for readability
|
|
4367
4367
|
and cuts off a ton of old legacy code.
|
|
4368
4368
|
Aka older browsers are not supported anymore.
|
|
4369
|
-
We use a self written helper library to keep the number of
|
|
4369
|
+
We use a self written helper library to keep the number of external
|
|
4370
4370
|
code dependencies down.
|
|
4371
4371
|
The library is called mona-dish and started as a small sideproject of mine
|
|
4372
4372
|
it provides following
|
|
4373
|
-
|
|
4373
|
+
|
|
4374
4374
|
a) Monad like structures for querying because this keeps the code denser and adds abstractions
|
|
4375
4375
|
that always was the strong point of jQuery, and it still is better in this regard than what ecmascript provides
|
|
4376
|
-
|
|
4376
|
+
|
|
4377
4377
|
c) A neutral json like configuration which allows assignments of arbitrary values with reduce code which then can be
|
|
4378
4378
|
transformed into different data representations
|
|
4379
|
-
|
|
4379
|
+
|
|
4380
4380
|
examples:
|
|
4381
4381
|
internalCtx.assign(MYPARAM, CTX_PARAM_SRC_FRM_ID).value = form.id.value;
|
|
4382
4382
|
passes a value into context.MYPARAM.CTX_PARAM_SRC_FRM_ID
|
|
4383
|
-
|
|
4383
|
+
|
|
4384
4384
|
basically an abbreviation for
|
|
4385
|
-
|
|
4385
|
+
|
|
4386
4386
|
internalCtxt[MYPARAM] = internalCtxt?.[MYPARAM] ? internalCtxt[MYPARAM] : {};
|
|
4387
4387
|
internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = internalCtxt?.[MYPARAM][CTX_PARAM_SRC_FRM_ID] ? internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] : {};
|
|
4388
4388
|
internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = form.id.value;
|
|
4389
|
-
|
|
4390
|
-
|
|
4389
|
+
|
|
4390
|
+
|
|
4391
4391
|
internalCtx.assign(condition, MYPARAM, CTX_PARAM_SRC_FRM_ID).value = form.id.value;
|
|
4392
4392
|
passes a value into context.MYPARAM.CTX_PARAM_SRC_FRM_ID if condition === true otherwise it is ignored
|
|
4393
|
-
|
|
4393
|
+
|
|
4394
4394
|
abbreviates:
|
|
4395
4395
|
if(condition) {
|
|
4396
4396
|
internalCtxt[MYPARAM] = internalCtxt?.[MYPARAM] ? internalCtxt[MYPARAM] : {};
|
|
4397
4397
|
internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = internalCtxt?.[MYPARAM][CTX_PARAM_SRC_FRM_ID] ? internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] : {};
|
|
4398
4398
|
internalCtxt[MYPARAM][CTX_PARAM_SRC_FRM_ID] = form.id.value;
|
|
4399
4399
|
}
|
|
4400
|
-
|
|
4401
|
-
|
|
4400
|
+
|
|
4401
|
+
|
|
4402
4402
|
d) Optional constructs, while under heavy debate we only use them lightly where the api requires it from mona-dish
|
|
4403
|
-
|
|
4403
|
+
|
|
4404
4404
|
Note the inclusion of this library uses a reduced build which only includes the part of it, which we really use
|
|
4405
|
-
|
|
4405
|
+
|
|
4406
4406
|
*/
|
|
4407
4407
|
const trim = mona_dish_1.Lang.trim;
|
|
4408
4408
|
const getMessage = Lang_1.ExtLang.getMessage;
|
|
@@ -6793,7 +6793,7 @@ var ErrorType;
|
|
|
6793
6793
|
(function (ErrorType) {
|
|
6794
6794
|
ErrorType["SERVER_ERROR"] = "serverError";
|
|
6795
6795
|
ErrorType["HTTP_ERROR"] = "httpError";
|
|
6796
|
-
ErrorType["CLIENT_ERROR"] = "
|
|
6796
|
+
ErrorType["CLIENT_ERROR"] = "clientError";
|
|
6797
6797
|
ErrorType["TIMEOUT"] = "timeout";
|
|
6798
6798
|
})(ErrorType || (exports.ErrorType = ErrorType = {}));
|
|
6799
6799
|
/**
|
|
@@ -7110,119 +7110,6 @@ function resolveDefaults(event, opts, el = null) {
|
|
|
7110
7110
|
}
|
|
7111
7111
|
|
|
7112
7112
|
|
|
7113
|
-
/***/ },
|
|
7114
|
-
|
|
7115
|
-
/***/ "./src/main/typescript/impl/xhrCore/ResonseDataResolver.ts"
|
|
7116
|
-
/*!*****************************************************************!*\
|
|
7117
|
-
!*** ./src/main/typescript/impl/xhrCore/ResonseDataResolver.ts ***!
|
|
7118
|
-
\*****************************************************************/
|
|
7119
|
-
(__unused_webpack_module, exports, __webpack_require__) {
|
|
7120
|
-
|
|
7121
|
-
|
|
7122
|
-
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
7123
|
-
* contributor license agreements. See the NOTICE file distributed with
|
|
7124
|
-
* this work for additional information regarding copyright ownership.
|
|
7125
|
-
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
7126
|
-
* (the "License"); you may not use this file except in compliance with
|
|
7127
|
-
* the License. You may obtain a copy of the License at
|
|
7128
|
-
*
|
|
7129
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7130
|
-
*
|
|
7131
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
7132
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
7133
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
7134
|
-
* See the License for the specific language governing permissions and
|
|
7135
|
-
* limitations under the License.
|
|
7136
|
-
*/
|
|
7137
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7138
|
-
exports.resolveResponseXML = resolveResponseXML;
|
|
7139
|
-
exports.resolveContexts = resolveContexts;
|
|
7140
|
-
exports.resolveSourceElement = resolveSourceElement;
|
|
7141
|
-
exports.resolveSourceForm = resolveSourceForm;
|
|
7142
|
-
const mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
|
|
7143
|
-
const Assertions_1 = __webpack_require__(/*! ../util/Assertions */ "./src/main/typescript/impl/util/Assertions.ts");
|
|
7144
|
-
const mona_dish_2 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
|
|
7145
|
-
const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
|
|
7146
|
-
const ExtDomQuery_1 = __webpack_require__(/*! ../util/ExtDomQuery */ "./src/main/typescript/impl/util/ExtDomQuery.ts");
|
|
7147
|
-
/**
|
|
7148
|
-
* Resolver functions for various aspects of the response data
|
|
7149
|
-
*
|
|
7150
|
-
* stateless because it might be called from various
|
|
7151
|
-
* parts of the response classes
|
|
7152
|
-
*/
|
|
7153
|
-
/**
|
|
7154
|
-
* fetches the response XML
|
|
7155
|
-
* as XML Query object
|
|
7156
|
-
*
|
|
7157
|
-
* @param request the request hosting the responseXML
|
|
7158
|
-
*
|
|
7159
|
-
* Throws an error in case of non-existent or wrong xml data
|
|
7160
|
-
*
|
|
7161
|
-
*/
|
|
7162
|
-
function resolveResponseXML(request) {
|
|
7163
|
-
let ret = new mona_dish_1.XMLQuery((0, Const_1.$nsp)(request.getIf(Const_1.SEL_RESPONSE_XML).value));
|
|
7164
|
-
Assertions_1.Assertions.assertValidXMLResponse(ret);
|
|
7165
|
-
return ret;
|
|
7166
|
-
}
|
|
7167
|
-
/**
|
|
7168
|
-
* Splits the incoming pass-through context apart
|
|
7169
|
-
* in an internal and an external normalized context
|
|
7170
|
-
* the internal one is just for our internal processing
|
|
7171
|
-
*
|
|
7172
|
-
* @param context the root context as associative array
|
|
7173
|
-
*/
|
|
7174
|
-
function resolveContexts(context) {
|
|
7175
|
-
/**
|
|
7176
|
-
* we split the context apart into the external one and
|
|
7177
|
-
* some internal values
|
|
7178
|
-
*/
|
|
7179
|
-
let externalContext = ExtDomQuery_1.ExtConfig.fromNullable(context);
|
|
7180
|
-
let internalContext = externalContext.getIf(Const_1.CTX_PARAM_MF_INTERNAL);
|
|
7181
|
-
if (!internalContext.isPresent()) {
|
|
7182
|
-
internalContext = ExtDomQuery_1.ExtConfig.fromNullable({});
|
|
7183
|
-
}
|
|
7184
|
-
/**
|
|
7185
|
-
* prepare storage for some deferred operations
|
|
7186
|
-
*/
|
|
7187
|
-
internalContext.assign(Const_1.DEFERRED_HEAD_INSERTS).value = [];
|
|
7188
|
-
internalContext.assign(Const_1.UPDATE_FORMS).value = [];
|
|
7189
|
-
internalContext.assign(Const_1.UPDATE_ELEMS).value = [];
|
|
7190
|
-
return { externalContext, internalContext };
|
|
7191
|
-
}
|
|
7192
|
-
/**
|
|
7193
|
-
* fetches the source element out of our contexts
|
|
7194
|
-
*
|
|
7195
|
-
* @param context the external context which should host the source id
|
|
7196
|
-
* @param internalContext internal pass-through fall back
|
|
7197
|
-
*
|
|
7198
|
-
*/
|
|
7199
|
-
function resolveSourceElement(context, internalContext) {
|
|
7200
|
-
let elemId = resolveSourceElementId(context, internalContext);
|
|
7201
|
-
return mona_dish_2.DQ.byId(elemId.value, true);
|
|
7202
|
-
}
|
|
7203
|
-
/**
|
|
7204
|
-
* fetches the source form if it still exists
|
|
7205
|
-
* also embedded forms and parent forms are taken into consideration
|
|
7206
|
-
* as fallbacks
|
|
7207
|
-
*
|
|
7208
|
-
* @param internalContext
|
|
7209
|
-
* @param elem
|
|
7210
|
-
*/
|
|
7211
|
-
function resolveSourceForm(internalContext, elem) {
|
|
7212
|
-
let sourceFormId = internalContext.getIf(Const_1.CTX_PARAM_SRC_FRM_ID);
|
|
7213
|
-
let sourceForm = new mona_dish_2.DQ(sourceFormId.isPresent() ? document.forms[sourceFormId.value] : null);
|
|
7214
|
-
sourceForm = sourceForm.orElseLazy(() => elem.firstParent(Const_1.HTML_TAG_FORM))
|
|
7215
|
-
.orElseLazy(() => elem.querySelectorAll(Const_1.HTML_TAG_FORM))
|
|
7216
|
-
.orElseLazy(() => mona_dish_2.DQ.querySelectorAll(Const_1.HTML_TAG_FORM));
|
|
7217
|
-
return sourceForm;
|
|
7218
|
-
}
|
|
7219
|
-
function resolveSourceElementId(context, internalContext) {
|
|
7220
|
-
//?internal context?? used to be external one
|
|
7221
|
-
return internalContext.getIf(Const_1.CTX_PARAM_SRC_CTL_ID)
|
|
7222
|
-
.orElseLazy(() => context.getIf(Const_1.SOURCE, "id").value);
|
|
7223
|
-
}
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
7113
|
/***/ },
|
|
7227
7114
|
|
|
7228
7115
|
/***/ "./src/main/typescript/impl/xhrCore/Response.ts"
|
|
@@ -7252,7 +7139,7 @@ exports.Response = void 0;
|
|
|
7252
7139
|
const mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
|
|
7253
7140
|
const ResponseProcessor_1 = __webpack_require__(/*! ./ResponseProcessor */ "./src/main/typescript/impl/xhrCore/ResponseProcessor.ts");
|
|
7254
7141
|
const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
|
|
7255
|
-
const
|
|
7142
|
+
const ResponseDataResolver_1 = __webpack_require__(/*! ./ResponseDataResolver */ "./src/main/typescript/impl/xhrCore/ResponseDataResolver.ts");
|
|
7256
7143
|
const ExtDomQuery_1 = __webpack_require__(/*! ../util/ExtDomQuery */ "./src/main/typescript/impl/util/ExtDomQuery.ts");
|
|
7257
7144
|
var Response;
|
|
7258
7145
|
(function (Response) {
|
|
@@ -7269,8 +7156,8 @@ var Response;
|
|
|
7269
7156
|
*/
|
|
7270
7157
|
function processResponse(request, context) {
|
|
7271
7158
|
let req = ExtDomQuery_1.ExtConfig.fromNullable(request);
|
|
7272
|
-
let { externalContext, internalContext } = (0,
|
|
7273
|
-
let responseXML = (0,
|
|
7159
|
+
let { externalContext, internalContext } = (0, ResponseDataResolver_1.resolveContexts)(context);
|
|
7160
|
+
let responseXML = (0, ResponseDataResolver_1.resolveResponseXML)(req);
|
|
7274
7161
|
let responseProcessor = new ResponseProcessor_1.ResponseProcessor(req, externalContext, internalContext);
|
|
7275
7162
|
internalContext.assign(Const_1.RESPONSE_XML).value = responseXML;
|
|
7276
7163
|
// we now process the partial tags, or in none given raise an error
|
|
@@ -7418,6 +7305,119 @@ var Response;
|
|
|
7418
7305
|
})(Response || (exports.Response = Response = {}));
|
|
7419
7306
|
|
|
7420
7307
|
|
|
7308
|
+
/***/ },
|
|
7309
|
+
|
|
7310
|
+
/***/ "./src/main/typescript/impl/xhrCore/ResponseDataResolver.ts"
|
|
7311
|
+
/*!******************************************************************!*\
|
|
7312
|
+
!*** ./src/main/typescript/impl/xhrCore/ResponseDataResolver.ts ***!
|
|
7313
|
+
\******************************************************************/
|
|
7314
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
7315
|
+
|
|
7316
|
+
|
|
7317
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
7318
|
+
* contributor license agreements. See the NOTICE file distributed with
|
|
7319
|
+
* this work for additional information regarding copyright ownership.
|
|
7320
|
+
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
7321
|
+
* (the "License"); you may not use this file except in compliance with
|
|
7322
|
+
* the License. You may obtain a copy of the License at
|
|
7323
|
+
*
|
|
7324
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
7325
|
+
*
|
|
7326
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
7327
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
7328
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
7329
|
+
* See the License for the specific language governing permissions and
|
|
7330
|
+
* limitations under the License.
|
|
7331
|
+
*/
|
|
7332
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
7333
|
+
exports.resolveResponseXML = resolveResponseXML;
|
|
7334
|
+
exports.resolveContexts = resolveContexts;
|
|
7335
|
+
exports.resolveSourceElement = resolveSourceElement;
|
|
7336
|
+
exports.resolveSourceForm = resolveSourceForm;
|
|
7337
|
+
const mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
|
|
7338
|
+
const Assertions_1 = __webpack_require__(/*! ../util/Assertions */ "./src/main/typescript/impl/util/Assertions.ts");
|
|
7339
|
+
const mona_dish_2 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
|
|
7340
|
+
const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
|
|
7341
|
+
const ExtDomQuery_1 = __webpack_require__(/*! ../util/ExtDomQuery */ "./src/main/typescript/impl/util/ExtDomQuery.ts");
|
|
7342
|
+
/**
|
|
7343
|
+
* Resolver functions for various aspects of the response data
|
|
7344
|
+
*
|
|
7345
|
+
* stateless because it might be called from various
|
|
7346
|
+
* parts of the response classes
|
|
7347
|
+
*/
|
|
7348
|
+
/**
|
|
7349
|
+
* fetches the response XML
|
|
7350
|
+
* as XML Query object
|
|
7351
|
+
*
|
|
7352
|
+
* @param request the request hosting the responseXML
|
|
7353
|
+
*
|
|
7354
|
+
* Throws an error in case of non-existent or wrong xml data
|
|
7355
|
+
*
|
|
7356
|
+
*/
|
|
7357
|
+
function resolveResponseXML(request) {
|
|
7358
|
+
let ret = new mona_dish_1.XMLQuery((0, Const_1.$nsp)(request.getIf(Const_1.SEL_RESPONSE_XML).value));
|
|
7359
|
+
Assertions_1.Assertions.assertValidXMLResponse(ret);
|
|
7360
|
+
return ret;
|
|
7361
|
+
}
|
|
7362
|
+
/**
|
|
7363
|
+
* Splits the incoming pass-through context apart
|
|
7364
|
+
* in an internal and an external normalized context
|
|
7365
|
+
* the internal one is just for our internal processing
|
|
7366
|
+
*
|
|
7367
|
+
* @param context the root context as associative array
|
|
7368
|
+
*/
|
|
7369
|
+
function resolveContexts(context) {
|
|
7370
|
+
/**
|
|
7371
|
+
* we split the context apart into the external one and
|
|
7372
|
+
* some internal values
|
|
7373
|
+
*/
|
|
7374
|
+
let externalContext = ExtDomQuery_1.ExtConfig.fromNullable(context);
|
|
7375
|
+
let internalContext = externalContext.getIf(Const_1.CTX_PARAM_MF_INTERNAL);
|
|
7376
|
+
if (!internalContext.isPresent()) {
|
|
7377
|
+
internalContext = ExtDomQuery_1.ExtConfig.fromNullable({});
|
|
7378
|
+
}
|
|
7379
|
+
/**
|
|
7380
|
+
* prepare storage for some deferred operations
|
|
7381
|
+
*/
|
|
7382
|
+
internalContext.assign(Const_1.DEFERRED_HEAD_INSERTS).value = [];
|
|
7383
|
+
internalContext.assign(Const_1.UPDATE_FORMS).value = [];
|
|
7384
|
+
internalContext.assign(Const_1.UPDATE_ELEMS).value = [];
|
|
7385
|
+
return { externalContext, internalContext };
|
|
7386
|
+
}
|
|
7387
|
+
/**
|
|
7388
|
+
* fetches the source element out of our contexts
|
|
7389
|
+
*
|
|
7390
|
+
* @param context the external context which should host the source id
|
|
7391
|
+
* @param internalContext internal pass-through fall back
|
|
7392
|
+
*
|
|
7393
|
+
*/
|
|
7394
|
+
function resolveSourceElement(context, internalContext) {
|
|
7395
|
+
let elemId = resolveSourceElementId(context, internalContext);
|
|
7396
|
+
return mona_dish_2.DQ.byId(elemId.value, true);
|
|
7397
|
+
}
|
|
7398
|
+
/**
|
|
7399
|
+
* fetches the source form if it still exists
|
|
7400
|
+
* also embedded forms and parent forms are taken into consideration
|
|
7401
|
+
* as fallbacks
|
|
7402
|
+
*
|
|
7403
|
+
* @param internalContext
|
|
7404
|
+
* @param elem
|
|
7405
|
+
*/
|
|
7406
|
+
function resolveSourceForm(internalContext, elem) {
|
|
7407
|
+
let sourceFormId = internalContext.getIf(Const_1.CTX_PARAM_SRC_FRM_ID);
|
|
7408
|
+
let sourceForm = new mona_dish_2.DQ(sourceFormId.isPresent() ? document.forms[sourceFormId.value] : null);
|
|
7409
|
+
sourceForm = sourceForm.orElseLazy(() => elem.firstParent(Const_1.HTML_TAG_FORM))
|
|
7410
|
+
.orElseLazy(() => elem.querySelectorAll(Const_1.HTML_TAG_FORM))
|
|
7411
|
+
.orElseLazy(() => mona_dish_2.DQ.querySelectorAll(Const_1.HTML_TAG_FORM));
|
|
7412
|
+
return sourceForm;
|
|
7413
|
+
}
|
|
7414
|
+
function resolveSourceElementId(context, internalContext) {
|
|
7415
|
+
//?internal context?? used to be external one
|
|
7416
|
+
return internalContext.getIf(Const_1.CTX_PARAM_SRC_CTL_ID)
|
|
7417
|
+
.orElseLazy(() => context.getIf(Const_1.SOURCE, "id").value);
|
|
7418
|
+
}
|
|
7419
|
+
|
|
7420
|
+
|
|
7421
7421
|
/***/ },
|
|
7422
7422
|
|
|
7423
7423
|
/***/ "./src/main/typescript/impl/xhrCore/ResponseProcessor.ts"
|