mirror of
https://github.com/abap2UI5/abap2UI5.git
synced 2025-04-29 15:36:21 +08:00
Update generation UI (#1471)
* update setup * update * Update abaplint.jsonc * Update abaplint.jsonc
This commit is contained in:
parent
e0cb6990f2
commit
7b47b3bba9
17
app/package-lock.json
generated
17
app/package-lock.json
generated
|
@ -8,6 +8,7 @@
|
|||
"name": "z2ui5",
|
||||
"version": "0.0.1",
|
||||
"devDependencies": {
|
||||
"@abaplint/cli": "^2.113.17",
|
||||
"@sap/ui5-builder-webide-extension": "^1.1.9",
|
||||
"@sap/ux-ui5-tooling": "1",
|
||||
"@ui5/cli": "^3.0.0",
|
||||
|
@ -17,6 +18,22 @@
|
|||
"ui5-task-zipper": "^3.1.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@abaplint/cli": {
|
||||
"version": "2.113.17",
|
||||
"resolved": "https://registry.npmjs.org/@abaplint/cli/-/cli-2.113.17.tgz",
|
||||
"integrity": "sha512-++3AXVlGr/AKOsHnClqFMJsRLuirke3FuxHhm+48HeA57pecy0JMoAIQEZF+w0V+wQWcIYx4AFaAeiE4J6LZ8g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"abaplint": "abaplint"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/larshp"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/runtime": {
|
||||
"version": "7.25.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.6.tgz",
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
],
|
||||
"main": "webapp/index.html",
|
||||
"devDependencies": {
|
||||
"@abaplint/cli": "^2.113.17",
|
||||
"@sap/ui5-builder-webide-extension": "^1.1.9",
|
||||
"@sap/ux-ui5-tooling": "1",
|
||||
"@ui5/cli": "^3.0.0",
|
||||
|
@ -30,6 +31,7 @@
|
|||
"undeploy": "cf undeploy z2ui5 --delete-services --delete-service-keys --delete-service-brokers",
|
||||
"deploy-test": "npm run build && fiori deploy --config ui5-deploy.yaml --testMode true",
|
||||
"build:cf": "ui5 build preload --clean-dest --config ui5-deploy.yaml --include-task=generateCachebusterInfo",
|
||||
"transform": "node trans/trans2abap.js && abaplint --fix ./trans/abaplint.jsonc",
|
||||
"build:mta": "rimraf resources mta_archives && mbt build"
|
||||
},
|
||||
"sapuxLayer": "CUSTOMER_BASE"
|
||||
|
|
|
@ -6,7 +6,7 @@ module.exports = function(className, description) {
|
|||
<VSEOCLASS>
|
||||
<CLSNAME>${className.toUpperCase()}</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>${className.toUpperCase()}</DESCRIPT>
|
||||
<DESCRIPT>${className.toUpperCase()} (generated)</DESCRIPT>
|
||||
<STATE>1</STATE>
|
||||
<CLSCCINCL>X</CLSCCINCL>
|
||||
<FIXPT>X</FIXPT>
|
||||
|
|
358
app/trans/abaplint.jsonc
Normal file
358
app/trans/abaplint.jsonc
Normal file
|
@ -0,0 +1,358 @@
|
|||
{
|
||||
"global": {
|
||||
"files": "/../../src/01/99/**/*.*"
|
||||
},
|
||||
"dependencies": [
|
||||
{
|
||||
"url": "https://github.com/abapedia/steampunk-2305-api-intersect-702",
|
||||
"folder": "/deps",
|
||||
"files": "/src/**/*.*"
|
||||
}
|
||||
],
|
||||
"syntax": {
|
||||
"version": "v750",
|
||||
"errorNamespace": "."
|
||||
},
|
||||
"rules": {
|
||||
"7bit_ascii": true,
|
||||
"abapdoc": false,
|
||||
"sql_value_conversion" : true,
|
||||
"select_single_full_key" : true,
|
||||
"strict_sql" : true,
|
||||
"easy_to_find_messages" : true,
|
||||
"fully_type_itabs" : true,
|
||||
"align_parameters": false,
|
||||
"smim_consistency": true,
|
||||
"allowed_object_naming": true,
|
||||
"allowed_object_types": {
|
||||
"allowed": [
|
||||
"CLAS",
|
||||
"DEVC",
|
||||
"INTF",
|
||||
"TABL",
|
||||
]
|
||||
},
|
||||
"ambiguous_statement": true,
|
||||
"avoid_use": {
|
||||
"severity": "Error",
|
||||
"skipQuickFix": false,
|
||||
"define": true,
|
||||
"statics": true,
|
||||
"defaultKey": true,
|
||||
"break": true,
|
||||
"testSeams": true,
|
||||
"describeLines": true,
|
||||
"exportToMemory": true,
|
||||
"exportToDatabase": true
|
||||
},
|
||||
"begin_end_names": true,
|
||||
"align_pseudo_comments" : true,
|
||||
"dynpro_checks" : true,
|
||||
"empty_event" : true,
|
||||
"invalid_table_index" : true,
|
||||
"macro_naming" : true,
|
||||
"prefer_pragmas" : true,
|
||||
"add_test_attributes" : true,
|
||||
"implicit_start_of_selection" : true,
|
||||
"reduce_procedural_code" : true,
|
||||
"tables_declared_locally" : true,
|
||||
"unused_macros" : true,
|
||||
"align_type_expressions" : true,
|
||||
"no_prefixes" : false,
|
||||
"begin_single_include": true,
|
||||
"call_transaction_authority_check": true,
|
||||
"cds_comment_style": true,
|
||||
"cds_legacy_view": true,
|
||||
"cds_parser_error": true,
|
||||
"chain_mainly_declarations": true,
|
||||
"change_if_to_case": true,
|
||||
"check_abstract": true,
|
||||
"check_comments": true,
|
||||
"check_ddic": true,
|
||||
"check_include": true,
|
||||
"check_subrc": true,
|
||||
"check_syntax": true,
|
||||
"check_text_elements": true,
|
||||
"check_transformation_exists": true,
|
||||
"class_attribute_names": true,
|
||||
"classic_exceptions_overlap": true,
|
||||
"cloud_types": true,
|
||||
"colon_missing_space": true,
|
||||
"commented_code": false,
|
||||
"constant_classes": true,
|
||||
"constructor_visibility_public": true,
|
||||
"contains_tab": true,
|
||||
"cyclic_oo": false,
|
||||
"cyclomatic_complexity": {
|
||||
"exclude": [],
|
||||
"severity": "Error",
|
||||
"max": 8
|
||||
},
|
||||
"dangerous_statement": {
|
||||
"exclude": [],
|
||||
"severity": "Error",
|
||||
"execSQL": true,
|
||||
"kernelCall": true,
|
||||
"systemCall": true,
|
||||
"insertReport": true,
|
||||
"generateDynpro": true,
|
||||
"generateReport": true,
|
||||
"generateSubroutine": true,
|
||||
"deleteReport": true,
|
||||
"deleteTextpool": true,
|
||||
"deleteDynpro": true,
|
||||
"exportDynpro": true,
|
||||
"dynamicSQL": true
|
||||
},
|
||||
"db_operation_in_loop": true,
|
||||
"definitions_top": false,
|
||||
"description_empty": true,
|
||||
"double_space": true,
|
||||
"downport": true,
|
||||
"empty_line_in_statement": true,
|
||||
"empty_statement": true,
|
||||
"empty_structure": {
|
||||
"loop": false,
|
||||
"if": true,
|
||||
"while": true,
|
||||
"case": true,
|
||||
"select": true,
|
||||
"do": true,
|
||||
"at": true,
|
||||
"try": true,
|
||||
"when": false
|
||||
},
|
||||
"exit_or_check": true,
|
||||
"expand_macros": true,
|
||||
"exporting": true,
|
||||
"forbidden_identifier": true,
|
||||
"forbidden_pseudo_and_pragma": {
|
||||
"exclude": [],
|
||||
"severity": "Error",
|
||||
"pseudo": [],
|
||||
"pragmas": [],
|
||||
"ignoreGlobalClassDefinition": false,
|
||||
"ignoreGlobalInterface": false
|
||||
},
|
||||
"form_tables_obsolete": true,
|
||||
"fully_type_constants": {
|
||||
"checkData": true
|
||||
},
|
||||
"function_module_recommendations": true,
|
||||
"functional_writing": {
|
||||
"ignoreExceptions": true
|
||||
},
|
||||
"global_class": true,
|
||||
"identical_conditions": true,
|
||||
"identical_contents": true,
|
||||
"identical_descriptions": true,
|
||||
"identical_form_names": true,
|
||||
"if_in_if": true,
|
||||
"implement_methods": true,
|
||||
"in_statement_indentation": false,
|
||||
"indentation": true,
|
||||
"inline_data_old_versions": true,
|
||||
"intf_referencing_clas": false,
|
||||
"keep_single_parameter_on_one_line": false,
|
||||
"keyword_case": false,
|
||||
"line_break_multiple_parameters": false,
|
||||
"line_break_style": true,
|
||||
"line_length": false,
|
||||
"line_only_punc": false,
|
||||
"local_class_naming": false,
|
||||
"local_testclass_consistency": true,
|
||||
"local_variable_names": false,
|
||||
"main_file_contents": true,
|
||||
"many_parentheses": true,
|
||||
"max_one_method_parameter_per_line": true,
|
||||
"max_one_statement": true,
|
||||
"message_exists": true,
|
||||
"method_implemented_twice": true,
|
||||
"method_length": {
|
||||
"exclude": [],
|
||||
"severity": "Error",
|
||||
"statements": 100,
|
||||
"errorWhenEmpty": false,
|
||||
"ignoreTestClasses": true,
|
||||
"checkForms": true
|
||||
},
|
||||
"method_overwrites_builtin": {
|
||||
"exclude": [ "z2ui5_cl_xml_view" ],
|
||||
"severity": "Error"
|
||||
},
|
||||
"method_parameter_names": false,
|
||||
"mix_returning": false,
|
||||
"modify_only_own_db_tables": {
|
||||
"reportDynamic": true,
|
||||
"ownTables": "^[yz]"
|
||||
},
|
||||
"msag_consistency": true,
|
||||
"names_no_dash": true,
|
||||
"nesting": {
|
||||
"depth": 5
|
||||
},
|
||||
"newline_between_methods": true,
|
||||
"no_aliases": true,
|
||||
"no_chained_assignment": true,
|
||||
"no_external_form_calls": true,
|
||||
"no_inline_in_optional_branches": false,
|
||||
"no_public_attributes": false,
|
||||
"no_yoda_conditions": true,
|
||||
"nrob_consistency": true,
|
||||
"object_naming": {
|
||||
"exclude": [],
|
||||
"severity": "Error",
|
||||
"patternKind": "required",
|
||||
"ignoreNames": [],
|
||||
"ignorePatterns": [],
|
||||
"clas": "^Z2UI5_C(L|X)",
|
||||
"intf": "^Z2UI5_IF",
|
||||
"prog": "^Z",
|
||||
"fugr": "^Z",
|
||||
"tabl": "^Z",
|
||||
"ttyp": "^Z",
|
||||
"dtel": "^Z",
|
||||
"doma": "^Z",
|
||||
"msag": "^Z",
|
||||
"tran": "^Z",
|
||||
"enqu": "^EZ",
|
||||
"auth": "^Z",
|
||||
"pinf": "^Z",
|
||||
"idoc": "^Z",
|
||||
"xslt": "^Z",
|
||||
"ssfo": "^Z",
|
||||
"ssst": "^Z",
|
||||
"shlp": "^Z"
|
||||
},
|
||||
"obsolete_statement": true,
|
||||
"omit_parameter_name": true,
|
||||
"omit_preceding_zeros": true,
|
||||
"omit_receiving": true,
|
||||
"parser_702_chaining": true,
|
||||
"parser_error": true,
|
||||
"parser_missing_space": true,
|
||||
"pragma_style": true,
|
||||
"prefer_corresponding": true,
|
||||
"prefer_inline": true,
|
||||
"prefer_is_not": true,
|
||||
"prefer_raise_exception_new": true,
|
||||
"prefer_returning_to_exporting": true,
|
||||
"prefer_xsdbool": true,
|
||||
"preferred_compare_operator": true,
|
||||
"prefix_is_current_class": {
|
||||
"severity": "Warning"
|
||||
},
|
||||
"reduce_string_templates": true,
|
||||
"release_idoc": true,
|
||||
"remove_descriptions": {
|
||||
"exclude": [],
|
||||
"severity": "Error",
|
||||
"ignoreExceptions": false,
|
||||
"ignoreWorkflow": false
|
||||
},
|
||||
"rfc_error_handling": true,
|
||||
"select_add_order_by": false,
|
||||
"select_performance": true,
|
||||
"selection_screen_naming": true,
|
||||
"sequential_blank": {
|
||||
"severity": "Warning"
|
||||
},
|
||||
"short_case": true,
|
||||
"sicf_consistency": true,
|
||||
"slow_parameter_passing": true,
|
||||
"space_before_colon": true,
|
||||
"space_before_dot": true,
|
||||
"sql_escape_host_variables": true,
|
||||
"start_at_tab": false,
|
||||
"static_call_via_instance": {
|
||||
"allowInTestclassIncludes": false
|
||||
},
|
||||
"superclass_final": true,
|
||||
"superfluous_value": true,
|
||||
"sy_modification": true,
|
||||
"tabl_enhancement_category": true,
|
||||
"try_without_catch": true,
|
||||
"type_form_parameters": true,
|
||||
"types_naming": false,
|
||||
"uncaught_exception": true,
|
||||
"unknown_types": true,
|
||||
"unnecessary_chaining": true,
|
||||
"unnecessary_pragma": true,
|
||||
"unnecessary_return": true,
|
||||
"unreachable_code": true,
|
||||
"unsecure_fae": true,
|
||||
"unused_ddic": true,
|
||||
"unused_methods": true,
|
||||
"unused_types": true,
|
||||
"unused_variables": {
|
||||
"severity": "Error",
|
||||
"skipNames": ["lv_dummy"]
|
||||
},
|
||||
"use_bool_expression": true,
|
||||
"use_class_based_exceptions": true,
|
||||
"use_line_exists": true,
|
||||
"use_new": true,
|
||||
"when_others_last": true,
|
||||
"whitespace_end": false,
|
||||
"xml_consistency": true,
|
||||
"forbidden_void_type": {
|
||||
"check": [
|
||||
"^boole_d$",
|
||||
"^char10$",
|
||||
"^char12$",
|
||||
"^char2$",
|
||||
"^char20$",
|
||||
"^char30$",
|
||||
"^char4$",
|
||||
"^char50$",
|
||||
"^char70$",
|
||||
"^cl_abap_syst",
|
||||
"^cl_aff_",
|
||||
"^cl_aucv_test_runner_abstract$",
|
||||
"^cl_aucv_test_runner_standard$",
|
||||
"^cl_aunit_assert$",
|
||||
"^cl_axt_dbtable$",
|
||||
"^cl_blue_wb_utility$",
|
||||
"^cl_oo_source$",
|
||||
"^/ui2/cl_$",
|
||||
"^/ui2/cl_",
|
||||
"^cl_saunit_internal_result$",
|
||||
"^cl_srvd_wb_object_data$",
|
||||
"^cl_wb_object_operator_factory$",
|
||||
"^cl_wer_const$",
|
||||
"^cl_xco_",
|
||||
"^cx_aff_",
|
||||
"^cx_wb_object_operation_error$",
|
||||
"^cx_xco_",
|
||||
"^flag$",
|
||||
"^i18_a_langiso2$",
|
||||
"^if_adt_lock_handle$",
|
||||
"^if_aff_",
|
||||
"^if_satc_ci_variant_access$",
|
||||
"^if_saunit_internal_result$",
|
||||
"^if_saunit_internal_result_type$",
|
||||
"^if_srvd_types$",
|
||||
"^if_wb_adt_plugin_resource_co$",
|
||||
"^if_wb_object_data_selection_co$",
|
||||
"^if_wb_object_operator$",
|
||||
"^if_xco_",
|
||||
"^int4$",
|
||||
"^numc2$",
|
||||
"^sabp_t_tadir_keys$",
|
||||
"^sap_bool$",
|
||||
"^srcsystem$",
|
||||
"^stringtab$",
|
||||
"^sychar01$",
|
||||
"^sychar10$",
|
||||
"^sychar70$",
|
||||
"^sydatum$",
|
||||
"^sylangu$",
|
||||
"^syst_title$",
|
||||
"^syuzeit$",
|
||||
"^xubname$",
|
||||
"^feld$",
|
||||
"^abap_boolean$",
|
||||
]
|
||||
},
|
||||
}
|
||||
}
|
|
@ -54,7 +54,7 @@ function generateClassName(filePath) {
|
|||
fileName.splice(1, 1); // Remove the middle part
|
||||
}
|
||||
const folderPath = parts.map(part => part.substring(0, 4)).join('_').toLowerCase();
|
||||
return `z2ui5_cl_app_${fileName.join('_')}`;
|
||||
return `z2ui5_cl_app_${fileName.join('_').toLowerCase()}`;
|
||||
}
|
||||
|
||||
// Function to recursively get all files in a directory
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
"commented_code": false,
|
||||
"constant_classes": true,
|
||||
"constructor_visibility_public": true,
|
||||
"contains_tab": false,
|
||||
"contains_tab": true,
|
||||
"cyclic_oo": false,
|
||||
"cyclomatic_complexity": {
|
||||
"exclude": [],
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -5,7 +5,7 @@
|
|||
<VSEOCLASS>
|
||||
<CLSNAME>Z2UI5_CL_APP_APP_JS</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>Z2UI5_CL_APP_APP_JS</DESCRIPT>
|
||||
<DESCRIPT>Z2UI5_CL_APP_APP_JS (generated)</DESCRIPT>
|
||||
<STATE>1</STATE>
|
||||
<CLSCCINCL>X</CLSCCINCL>
|
||||
<FIXPT>X</FIXPT>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CLASS z2ui5_cl_app_App_xml DEFINITION
|
||||
CLASS z2ui5_cl_app_app_xml DEFINITION
|
||||
PUBLIC
|
||||
FINAL
|
||||
CREATE PUBLIC .
|
||||
|
@ -14,11 +14,11 @@ CLASS z2ui5_cl_app_App_xml DEFINITION
|
|||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS z2ui5_cl_app_App_xml IMPLEMENTATION.
|
||||
CLASS z2ui5_cl_app_app_xml IMPLEMENTATION.
|
||||
|
||||
METHOD get.
|
||||
|
||||
result = `<mvc:View controllerName="z2ui5.controller.App"` &&
|
||||
result = `<mvc:View controllerName="z2ui5.controller.App"` &&
|
||||
` xmlns:html="http://www.w3.org/1999/xhtml"` &&
|
||||
` xmlns:mvc="sap.ui.core.mvc" displayBlock="true"` &&
|
||||
` xmlns="sap.m">` &&
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<VSEOCLASS>
|
||||
<CLSNAME>Z2UI5_CL_APP_APP_XML</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>Z2UI5_CL_APP_APP_XML</DESCRIPT>
|
||||
<DESCRIPT>Z2UI5_CL_APP_APP_XML (generated)</DESCRIPT>
|
||||
<STATE>1</STATE>
|
||||
<CLSCCINCL>X</CLSCCINCL>
|
||||
<FIXPT>X</FIXPT>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CLASS z2ui5_cl_app_Component_js DEFINITION
|
||||
CLASS z2ui5_cl_app_component_js DEFINITION
|
||||
PUBLIC
|
||||
FINAL
|
||||
CREATE PUBLIC .
|
||||
|
@ -14,71 +14,71 @@ CLASS z2ui5_cl_app_Component_js DEFINITION
|
|||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS z2ui5_cl_app_Component_js IMPLEMENTATION.
|
||||
CLASS z2ui5_cl_app_component_js IMPLEMENTATION.
|
||||
|
||||
METHOD get.
|
||||
|
||||
result = `sap.ui.define(["sap/ui/core/UIComponent", "z2ui5/model/models",` && |\n| &&
|
||||
` "z2ui5/cc/DebugTool","z2ui5/cc/Server", "sap/base/Log","sap/ui/VersionInfo"` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` ], function (UIComponent, models, DebugTool, Server, Log, VersionInfo) {` && |\n| &&
|
||||
` return UIComponent.extend("z2ui5.Component", {` && |\n| &&
|
||||
` metadata: {` && |\n| &&
|
||||
` manifest: "json"` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` init: async function () {` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` UIComponent.prototype.init.apply(this, arguments);` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` this.getRouter().initialize();` && |\n| &&
|
||||
` z2ui5.oRouter = this.getRouter();` && |\n| &&
|
||||
` this.setModel(models.createDeviceModel(), "device");` && |\n| &&
|
||||
` this._oLogger = Log.getLogger("abap2UI5");` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` z2ui5.oConfig = {};` && |\n| &&
|
||||
` z2ui5.oConfig.ComponentData = this.getComponentData();` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` z2ui5.oLaunchpadService = await this.getService("ShellUIService");` && |\n| &&
|
||||
` } catch (e) {}` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` let oVersionInfo = await VersionInfo.load();` && |\n| &&
|
||||
` z2ui5.oConfig.UI5VersionInfo = {` && |\n| &&
|
||||
` version : oVersionInfo.version,` && |\n| &&
|
||||
` buildTimestamp : oVersionInfo.buildTimestamp,` && |\n| &&
|
||||
` gav : oVersionInfo.gav,` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` if (/iPad|iPhone/.test(navigator.platform)) {` && |\n| &&
|
||||
` window.addEventListener("__pagehide", this.__pagehide.bind(this));` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` window.addEventListener("__beforeunload", this.__beforeunload.bind(this));` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` document.addEventListener("keydown", function (zEvent) {` && |\n| &&
|
||||
` if (zEvent?.key === "F12") {` && |\n| &&
|
||||
` new z2ui5.cc.DebugTool().show();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` __beforeunload: function () {` && |\n| &&
|
||||
` window.removeEventListener("__beforeunload", this.__beforeunload.bind(this));` && |\n| &&
|
||||
` this.destroy();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` __pagehide: function () {` && |\n| &&
|
||||
` window.removeEventListener("__pagehide", this.__pagehide.bind(this));` && |\n| &&
|
||||
` this.destroy();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` exit: function () {` && |\n| &&
|
||||
` Server.endSession();` && |\n| &&
|
||||
` if (UIComponent.prototype.exit)` && |\n| &&
|
||||
` UIComponent.prototype.exit.apply(this, arguments);` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
`});` && |\n| &&
|
||||
`` && |\n| &&
|
||||
result = `sap.ui.define(["sap/ui/core/UIComponent", "z2ui5/model/models",` && |\n| &&
|
||||
` "z2ui5/cc/DebugTool","z2ui5/cc/Server", "sap/base/Log","sap/ui/VersionInfo"` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` ], function (UIComponent, models, DebugTool, Server, Log, VersionInfo) {` && |\n| &&
|
||||
` return UIComponent.extend("z2ui5.Component", {` && |\n| &&
|
||||
` metadata: {` && |\n| &&
|
||||
` manifest: "json"` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` init: async function () {` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` UIComponent.prototype.init.apply(this, arguments);` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` this.getRouter().initialize();` && |\n| &&
|
||||
` z2ui5.oRouter = this.getRouter();` && |\n| &&
|
||||
` this.setModel(models.createDeviceModel(), "device");` && |\n| &&
|
||||
` this._oLogger = Log.getLogger("abap2UI5");` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` z2ui5.oConfig = {};` && |\n| &&
|
||||
` z2ui5.oConfig.ComponentData = this.getComponentData();` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` z2ui5.oLaunchpadService = await this.getService("ShellUIService");` && |\n| &&
|
||||
` } catch (e) {}` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` let oVersionInfo = await VersionInfo.load();` && |\n| &&
|
||||
` z2ui5.oConfig.UI5VersionInfo = {` && |\n| &&
|
||||
` version : oVersionInfo.version,` && |\n| &&
|
||||
` buildTimestamp : oVersionInfo.buildTimestamp,` && |\n| &&
|
||||
` gav : oVersionInfo.gav,` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` if (/iPad|iPhone/.test(navigator.platform)) {` && |\n| &&
|
||||
` window.addEventListener("__pagehide", this.__pagehide.bind(this));` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` window.addEventListener("__beforeunload", this.__beforeunload.bind(this));` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` document.addEventListener("keydown", function (zEvent) {` && |\n| &&
|
||||
` if (zEvent?.key === "F12") {` && |\n| &&
|
||||
` new z2ui5.cc.DebugTool().show();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` __beforeunload: function () {` && |\n| &&
|
||||
` window.removeEventListener("__beforeunload", this.__beforeunload.bind(this));` && |\n| &&
|
||||
` this.destroy();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` __pagehide: function () {` && |\n| &&
|
||||
` window.removeEventListener("__pagehide", this.__pagehide.bind(this));` && |\n| &&
|
||||
` this.destroy();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` exit: function () {` && |\n| &&
|
||||
` Server.endSession();` && |\n| &&
|
||||
` if (UIComponent.prototype.exit)` && |\n| &&
|
||||
` UIComponent.prototype.exit.apply(this, arguments);` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
`});` && |\n| &&
|
||||
`` && |\n| &&
|
||||
``.
|
||||
|
||||
ENDMETHOD.
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<VSEOCLASS>
|
||||
<CLSNAME>Z2UI5_CL_APP_COMPONENT_JS</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>Z2UI5_CL_APP_COMPONENT_JS</DESCRIPT>
|
||||
<DESCRIPT>Z2UI5_CL_APP_COMPONENT_JS (generated)</DESCRIPT>
|
||||
<STATE>1</STATE>
|
||||
<CLSCCINCL>X</CLSCCINCL>
|
||||
<FIXPT>X</FIXPT>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CLASS z2ui5_cl_app_DebugTool_js DEFINITION
|
||||
CLASS z2ui5_cl_app_debugtool_js DEFINITION
|
||||
PUBLIC
|
||||
FINAL
|
||||
CREATE PUBLIC .
|
||||
|
@ -14,152 +14,152 @@ CLASS z2ui5_cl_app_DebugTool_js DEFINITION
|
|||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS z2ui5_cl_app_DebugTool_js IMPLEMENTATION.
|
||||
CLASS z2ui5_cl_app_debugtool_js IMPLEMENTATION.
|
||||
|
||||
METHOD get.
|
||||
|
||||
result = `sap.ui.define(["sap/ui/core/Control", "sap/ui/core/Fragment", "sap/ui/model/json/JSONModel"], (Control, Fragment, JSONModel) => {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` return Control.extend("z2ui5.cc.DebugTool", {` && |\n| &&
|
||||
`` && |\n| &&
|
||||
`prettifyXml: function(sourceXml) {` && |\n| &&
|
||||
` const xmlDoc = new DOMParser().parseFromString(sourceXml, 'application/xml');` && |\n| &&
|
||||
` var sParse = ``<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">` && |\n| &&
|
||||
` <xsl:strip-space elements="*" />` && |\n| &&
|
||||
` <xsl:template match="para[content-style][not(text())]">` && |\n| &&
|
||||
` <xsl:value-of select="normalize-space(.)" />` && |\n| &&
|
||||
` </xsl:template>` && |\n| &&
|
||||
` <xsl:template match="node()|@*">` && |\n| &&
|
||||
` <xsl:copy>` && |\n| &&
|
||||
` <xsl:apply-templates select="node()|@*" />` && |\n| &&
|
||||
` </xsl:copy>` && |\n| &&
|
||||
` </xsl:template>` && |\n| &&
|
||||
` <xsl:output indent="yes" />` && |\n| &&
|
||||
` </xsl:stylesheet>``;` && |\n| &&
|
||||
` sParse = sParse.replace(/>/g, unescape("%3E")).replace(/</g, unescape("%3C"));` && |\n| &&
|
||||
` const xsltDoc = new DOMParser().parseFromString(sParse, 'application/xml');` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` const xsltProcessor = new XSLTProcessor();` && |\n| &&
|
||||
` xsltProcessor.importStylesheet(xsltDoc);` && |\n| &&
|
||||
` const resultDoc = xsltProcessor.transformToDocument(xmlDoc);` && |\n| &&
|
||||
` const resultXml = new XMLSerializer().serializeToString(resultDoc);` && |\n| &&
|
||||
` return resultXml.replace(/>/g, ">").replace(/</g, "<");` && |\n| &&
|
||||
` }, onItemSelect: function (oEvent) {` && |\n| &&
|
||||
` const selItem = oEvent.getSource().getSelectedKey();` && |\n| &&
|
||||
` const oView = z2ui5?.oView;` && |\n| &&
|
||||
` const oResponse = z2ui5?.oResponse;` && |\n| &&
|
||||
` const displayEditor = this.displayEditor.bind(this);` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` switch (selItem) {` && |\n| &&
|
||||
` case 'CONFIG':` && |\n| &&
|
||||
` displayEditor(oEvent, JSON.stringify(z2ui5.oConfig, null, 3), 'json');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'MODEL':` && |\n| &&
|
||||
` displayEditor(oEvent, JSON.stringify(oView?.getModel()?.getData(), null, 3), 'json');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'VIEW':` && |\n| &&
|
||||
` const viewContent = oView?.mProperties?.viewContent || z2ui5.responseData.S_FRONT.PARAMS.S_VIEW.XML;` && |\n| &&
|
||||
` displayEditor(oEvent, this.prettifyXml(viewContent), 'xml', this.prettifyXml(oView?._xContent.outerHTML));` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'PLAIN':` && |\n| &&
|
||||
` displayEditor(oEvent, JSON.stringify(z2ui5.responseData, null, 3), 'json');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'REQUEST':` && |\n| &&
|
||||
` displayEditor(oEvent, JSON.stringify(z2ui5.oBody, null, 3), 'json');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'POPUP':` && |\n| &&
|
||||
` displayEditor(oEvent, this.prettifyXml(oResponse?.PARAMS?.S_POPUP?.XML), 'xml');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'POPUP_MODEL':` && |\n| &&
|
||||
` displayEditor(oEvent, JSON.stringify(z2ui5.oViewPopup.getModel().getData(), null, 3), 'json');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'POPOVER':` && |\n| &&
|
||||
` displayEditor(oEvent, oResponse?.PARAMS?.S_POPOVER?.XML, 'xml');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'POPOVER_MODEL':` && |\n| &&
|
||||
` displayEditor(oEvent, JSON.stringify(z2ui5?.oViewPopover?.getModel()?.getData(), null, 3), 'json');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'NEST1':` && |\n| &&
|
||||
` displayEditor(oEvent, this.prettifyXml(z2ui5?.oViewNest?.mProperties?.viewContent), 'xml', this.prettifyXml(z2ui5?.oViewNest?._xContent.outerHTML));` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'NEST1_MODEL':` && |\n| &&
|
||||
` displayEditor(oEvent, JSON.stringify(z2ui5?.oViewNest?.getModel()?.getData(), null, 3), 'json');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'NEST2':` && |\n| &&
|
||||
` displayEditor(oEvent, this.prettifyXml(z2ui5?.oViewNest2?.mProperties?.viewContent), 'xml', this.prettifyXml(z2ui5?.oViewNest2?._xContent.outerHTML));` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'NEST2_MODEL':` && |\n| &&
|
||||
` displayEditor(oEvent, JSON.stringify(z2ui5?.oViewNest2?.getModel()?.getData(), null, 3), 'json');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'SOURCE':` && |\n| &&
|
||||
` const parent = oEvent.getSource().getParent();` && |\n| &&
|
||||
` const contentControl = parent.getContent()[2].getItems()[0];` && |\n| &&
|
||||
` const url = ``${window.location.origin}/sap/bc/adt/oo/classes/${z2ui5.responseData.S_FRONT.APP}/source/main``;` && |\n| &&
|
||||
` const content = atob('PGlmcmFtZSBpZD0idGVzdCIgc3JjPSInICsgdXJsICsgJyIgaGVpZ2h0PSI4MDBweCIgd2lkdGg9IjEyMDBweCIgLz4=').replace("' + url + '", url);` && |\n| &&
|
||||
` contentControl.setProperty("content", content);` && |\n| &&
|
||||
` const modelData = oEvent.getSource().getModel().oData;` && |\n| &&
|
||||
` modelData.editor_visible = false;` && |\n| &&
|
||||
` modelData.source_visible = true;` && |\n| &&
|
||||
` oEvent.getSource().getModel().refresh();` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` displayEditor: function (oEvent, content, type, xcontent = "") {` && |\n| &&
|
||||
` const modelData = oEvent.getSource().getModel().oData;` && |\n| &&
|
||||
` modelData.editor_visible = true;` && |\n| &&
|
||||
` modelData.source_visible = false;` && |\n| &&
|
||||
` modelData.isTemplating = content.includes("xmlns:template");` && |\n| &&
|
||||
` modelData.value = content;` && |\n| &&
|
||||
` modelData.previousValue = content;` && |\n| &&
|
||||
` modelData.xContent = xcontent;` && |\n| &&
|
||||
` modelData.type = type;` && |\n| &&
|
||||
` oEvent.getSource().getModel().refresh();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` onTemplatingPress: function (oEvent) {` && |\n| &&
|
||||
` const modelData = oEvent.getSource().getModel().oData;` && |\n| &&
|
||||
` modelData.value = oEvent.getSource().getPressed() ? modelData.xContent : modelData.previousValue;` && |\n| &&
|
||||
` oEvent.getSource().getModel().refresh();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` onClose: function () {` && |\n| &&
|
||||
` this.oDialog.close();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` async show() {` && |\n| &&
|
||||
` if (!this.oDialog) {` && |\n| &&
|
||||
` this.oDialog = await Fragment.load({` && |\n| &&
|
||||
` name: "z2ui5.cc.DebugTool",` && |\n| &&
|
||||
` controller: this,` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` const value = JSON.stringify(z2ui5.responseData, null, 3);` && |\n| &&
|
||||
` const oData = {` && |\n| &&
|
||||
` type: 'json',` && |\n| &&
|
||||
` source_visible: false,` && |\n| &&
|
||||
` editor_visible: true,` && |\n| &&
|
||||
` value: value,` && |\n| &&
|
||||
` xContent: '',` && |\n| &&
|
||||
` previousValue: value,` && |\n| &&
|
||||
` isTemplating: false,` && |\n| &&
|
||||
` templatingSource: false,` && |\n| &&
|
||||
` activeNest1: z2ui5?.oViewNest?.mProperties?.viewContent !== undefined,` && |\n| &&
|
||||
` activeNest2: z2ui5?.oViewNest2?.mProperties?.viewContent !== undefined,` && |\n| &&
|
||||
` activePopup: z2ui5?.oResponse?.PARAMS?.S_POPUP?.XML !== undefined,` && |\n| &&
|
||||
` activePopover: z2ui5?.oResponse?.PARAMS?.S_POPOVER?.XML !== undefined,` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
` const oModel = new JSONModel(oData);` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` this.oDialog.addStyleClass('dbg-ltr');` && |\n| &&
|
||||
` this.oDialog.setModel(oModel);` && |\n| &&
|
||||
` this.oDialog.open();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
`});` && |\n| &&
|
||||
`` && |\n| &&
|
||||
result = `sap.ui.define(["sap/ui/core/Control", "sap/ui/core/Fragment", "sap/ui/model/json/JSONModel"], (Control, Fragment, JSONModel) => {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` return Control.extend("z2ui5.cc.DebugTool", {` && |\n| &&
|
||||
`` && |\n| &&
|
||||
`prettifyXml: function(sourceXml) {` && |\n| &&
|
||||
` const xmlDoc = new DOMParser().parseFromString(sourceXml, 'application/xml');` && |\n| &&
|
||||
` var sParse = ``<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">` && |\n| &&
|
||||
` <xsl:strip-space elements="*" />` && |\n| &&
|
||||
` <xsl:template match="para[content-style][not(text())]">` && |\n| &&
|
||||
` <xsl:value-of select="normalize-space(.)" />` && |\n| &&
|
||||
` </xsl:template>` && |\n| &&
|
||||
` <xsl:template match="node()|@*">` && |\n| &&
|
||||
` <xsl:copy>` && |\n| &&
|
||||
` <xsl:apply-templates select="node()|@*" />` && |\n| &&
|
||||
` </xsl:copy>` && |\n| &&
|
||||
` </xsl:template>` && |\n| &&
|
||||
` <xsl:output indent="yes" />` && |\n| &&
|
||||
` </xsl:stylesheet>``;` && |\n| &&
|
||||
` sParse = sParse.replace(/>/g, unescape("%3E")).replace(/</g, unescape("%3C"));` && |\n| &&
|
||||
` const xsltDoc = new DOMParser().parseFromString(sParse, 'application/xml');` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` const xsltProcessor = new XSLTProcessor();` && |\n| &&
|
||||
` xsltProcessor.importStylesheet(xsltDoc);` && |\n| &&
|
||||
` const resultDoc = xsltProcessor.transformToDocument(xmlDoc);` && |\n| &&
|
||||
` const resultXml = new XMLSerializer().serializeToString(resultDoc);` && |\n| &&
|
||||
` return resultXml.replace(/>/g, ">").replace(/</g, "<");` && |\n| &&
|
||||
` }, onItemSelect: function (oEvent) {` && |\n| &&
|
||||
` const selItem = oEvent.getSource().getSelectedKey();` && |\n| &&
|
||||
` const oView = z2ui5?.oView;` && |\n| &&
|
||||
` const oResponse = z2ui5?.oResponse;` && |\n| &&
|
||||
` const displayEditor = this.displayEditor.bind(this);` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` switch (selItem) {` && |\n| &&
|
||||
` case 'CONFIG':` && |\n| &&
|
||||
` displayEditor(oEvent, JSON.stringify(z2ui5.oConfig, null, 3), 'json');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'MODEL':` && |\n| &&
|
||||
` displayEditor(oEvent, JSON.stringify(oView?.getModel()?.getData(), null, 3), 'json');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'VIEW':` && |\n| &&
|
||||
` const viewContent = oView?.mProperties?.viewContent || z2ui5.responseData.S_FRONT.PARAMS.S_VIEW.XML;` && |\n| &&
|
||||
` displayEditor(oEvent, this.prettifyXml(viewContent), 'xml', this.prettifyXml(oView?._xContent.outerHTML));` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'PLAIN':` && |\n| &&
|
||||
` displayEditor(oEvent, JSON.stringify(z2ui5.responseData, null, 3), 'json');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'REQUEST':` && |\n| &&
|
||||
` displayEditor(oEvent, JSON.stringify(z2ui5.oBody, null, 3), 'json');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'POPUP':` && |\n| &&
|
||||
` displayEditor(oEvent, this.prettifyXml(oResponse?.PARAMS?.S_POPUP?.XML), 'xml');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'POPUP_MODEL':` && |\n| &&
|
||||
` displayEditor(oEvent, JSON.stringify(z2ui5.oViewPopup.getModel().getData(), null, 3), 'json');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'POPOVER':` && |\n| &&
|
||||
` displayEditor(oEvent, oResponse?.PARAMS?.S_POPOVER?.XML, 'xml');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'POPOVER_MODEL':` && |\n| &&
|
||||
` displayEditor(oEvent, JSON.stringify(z2ui5?.oViewPopover?.getModel()?.getData(), null, 3), 'json');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'NEST1':` && |\n| &&
|
||||
` displayEditor(oEvent, this.prettifyXml(z2ui5?.oViewNest?.mProperties?.viewContent), 'xml', this.prettifyXml(z2ui5?.oViewNest?._xContent.outerHTML));` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'NEST1_MODEL':` && |\n| &&
|
||||
` displayEditor(oEvent, JSON.stringify(z2ui5?.oViewNest?.getModel()?.getData(), null, 3), 'json');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'NEST2':` && |\n| &&
|
||||
` displayEditor(oEvent, this.prettifyXml(z2ui5?.oViewNest2?.mProperties?.viewContent), 'xml', this.prettifyXml(z2ui5?.oViewNest2?._xContent.outerHTML));` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'NEST2_MODEL':` && |\n| &&
|
||||
` displayEditor(oEvent, JSON.stringify(z2ui5?.oViewNest2?.getModel()?.getData(), null, 3), 'json');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'SOURCE':` && |\n| &&
|
||||
` const parent = oEvent.getSource().getParent();` && |\n| &&
|
||||
` const contentControl = parent.getContent()[2].getItems()[0];` && |\n| &&
|
||||
` const url = ``${window.location.origin}/sap/bc/adt/oo/classes/${z2ui5.responseData.S_FRONT.APP}/source/main``;` && |\n| &&
|
||||
` const content = atob('PGlmcmFtZSBpZD0idGVzdCIgc3JjPSInICsgdXJsICsgJyIgaGVpZ2h0PSI4MDBweCIgd2lkdGg9IjEyMDBweCIgLz4=').replace("' + url + '", url);` && |\n| &&
|
||||
` contentControl.setProperty("content", content);` && |\n| &&
|
||||
` const modelData = oEvent.getSource().getModel().oData;` && |\n| &&
|
||||
` modelData.editor_visible = false;` && |\n| &&
|
||||
` modelData.source_visible = true;` && |\n| &&
|
||||
` oEvent.getSource().getModel().refresh();` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` displayEditor: function (oEvent, content, type, xcontent = "") {` && |\n| &&
|
||||
` const modelData = oEvent.getSource().getModel().oData;` && |\n| &&
|
||||
` modelData.editor_visible = true;` && |\n| &&
|
||||
` modelData.source_visible = false;` && |\n| &&
|
||||
` modelData.isTemplating = content.includes("xmlns:template");` && |\n| &&
|
||||
` modelData.value = content;` && |\n| &&
|
||||
` modelData.previousValue = content;` && |\n| &&
|
||||
` modelData.xContent = xcontent;` && |\n| &&
|
||||
` modelData.type = type;` && |\n| &&
|
||||
` oEvent.getSource().getModel().refresh();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` onTemplatingPress: function (oEvent) {` && |\n| &&
|
||||
` const modelData = oEvent.getSource().getModel().oData;` && |\n| &&
|
||||
` modelData.value = oEvent.getSource().getPressed() ? modelData.xContent : modelData.previousValue;` && |\n| &&
|
||||
` oEvent.getSource().getModel().refresh();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` onClose: function () {` && |\n| &&
|
||||
` this.oDialog.close();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` async show() {` && |\n| &&
|
||||
` if (!this.oDialog) {` && |\n| &&
|
||||
` this.oDialog = await Fragment.load({` && |\n| &&
|
||||
` name: "z2ui5.cc.DebugTool",` && |\n| &&
|
||||
` controller: this,` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` const value = JSON.stringify(z2ui5.responseData, null, 3);` && |\n| &&
|
||||
` const oData = {` && |\n| &&
|
||||
` type: 'json',` && |\n| &&
|
||||
` source_visible: false,` && |\n| &&
|
||||
` editor_visible: true,` && |\n| &&
|
||||
` value: value,` && |\n| &&
|
||||
` xContent: '',` && |\n| &&
|
||||
` previousValue: value,` && |\n| &&
|
||||
` isTemplating: false,` && |\n| &&
|
||||
` templatingSource: false,` && |\n| &&
|
||||
` activeNest1: z2ui5?.oViewNest?.mProperties?.viewContent !== undefined,` && |\n| &&
|
||||
` activeNest2: z2ui5?.oViewNest2?.mProperties?.viewContent !== undefined,` && |\n| &&
|
||||
` activePopup: z2ui5?.oResponse?.PARAMS?.S_POPUP?.XML !== undefined,` && |\n| &&
|
||||
` activePopover: z2ui5?.oResponse?.PARAMS?.S_POPOVER?.XML !== undefined,` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
` const oModel = new JSONModel(oData);` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` this.oDialog.addStyleClass('dbg-ltr');` && |\n| &&
|
||||
` this.oDialog.setModel(oModel);` && |\n| &&
|
||||
` this.oDialog.open();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
`});` && |\n| &&
|
||||
`` && |\n| &&
|
||||
``.
|
||||
|
||||
ENDMETHOD.
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<VSEOCLASS>
|
||||
<CLSNAME>Z2UI5_CL_APP_DEBUGTOOL_JS</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>Z2UI5_CL_APP_DEBUGTOOL_JS</DESCRIPT>
|
||||
<DESCRIPT>Z2UI5_CL_APP_DEBUGTOOL_JS (generated)</DESCRIPT>
|
||||
<STATE>1</STATE>
|
||||
<CLSCCINCL>X</CLSCCINCL>
|
||||
<FIXPT>X</FIXPT>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CLASS z2ui5_cl_app_DebugTool_xml DEFINITION
|
||||
CLASS z2ui5_cl_app_debugtool_xml DEFINITION
|
||||
PUBLIC
|
||||
FINAL
|
||||
CREATE PUBLIC .
|
||||
|
@ -14,11 +14,11 @@ CLASS z2ui5_cl_app_DebugTool_xml DEFINITION
|
|||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS z2ui5_cl_app_DebugTool_xml IMPLEMENTATION.
|
||||
CLASS z2ui5_cl_app_debugtool_xml IMPLEMENTATION.
|
||||
|
||||
METHOD get.
|
||||
|
||||
result = `<core:FragmentDefinition` &&
|
||||
result = `<core:FragmentDefinition` &&
|
||||
` xmlns="sap.m"` &&
|
||||
` xmlns:mvc="sap.ui.core.mvc"` &&
|
||||
` xmlns:core="sap.ui.core"` &&
|
||||
|
@ -34,15 +34,15 @@ CLASS z2ui5_cl_app_DebugTool_xml IMPLEMENTATION.
|
|||
` select="onItemSelect"` &&
|
||||
` >` &&
|
||||
` <items>` &&
|
||||
` <IconTabFilter` &&
|
||||
` <IconTabFilter` &&
|
||||
` text="Config"` &&
|
||||
` key="CONFIG"` &&
|
||||
` enabled="true"` &&
|
||||
` enabled="true"` &&
|
||||
` />` &&
|
||||
` <IconTabFilter` &&
|
||||
` text="Previous Request"` &&
|
||||
` key="REQUEST"` &&
|
||||
` enabled="true"` &&
|
||||
` enabled="true"` &&
|
||||
` />` &&
|
||||
` <IconTabFilter` &&
|
||||
` text="Response"` &&
|
||||
|
@ -63,47 +63,47 @@ CLASS z2ui5_cl_app_DebugTool_xml IMPLEMENTATION.
|
|||
` <IconTabFilter` &&
|
||||
` text="Popup"` &&
|
||||
` key="POPUP"` &&
|
||||
` enabled="{/activePopup}"` &&
|
||||
` enabled="{/activePopup}"` &&
|
||||
` />` &&
|
||||
` <IconTabFilter` &&
|
||||
` text="Popup Model"` &&
|
||||
` key="POPUP_MODEL"` &&
|
||||
` enabled="{/activePopup}"` &&
|
||||
` enabled="{/activePopup}"` &&
|
||||
` />` &&
|
||||
` <IconTabFilter` &&
|
||||
` text="Popover"` &&
|
||||
` key="POPOVER"` &&
|
||||
` enabled="{/activePopover}"` &&
|
||||
` enabled="{/activePopover}"` &&
|
||||
` />` &&
|
||||
` <IconTabFilter` &&
|
||||
` text="Popover Model"` &&
|
||||
` key="POPOVER_MODEL"` &&
|
||||
` enabled="{/activePopover}"` &&
|
||||
` enabled="{/activePopover}"` &&
|
||||
` />` &&
|
||||
` <IconTabFilter` &&
|
||||
` text="Nest1"` &&
|
||||
` key="NEST1"` &&
|
||||
` enabled="{/activeNest1}"` &&
|
||||
` enabled="{/activeNest1}"` &&
|
||||
` />` &&
|
||||
` <IconTabFilter` &&
|
||||
` text="Nest1 Model"` &&
|
||||
` key="NEST1_MODEL"` &&
|
||||
` enabled="{/activeNest1}"` &&
|
||||
` enabled="{/activeNest1}"` &&
|
||||
` />` &&
|
||||
` <IconTabFilter` &&
|
||||
` text="Nest2"` &&
|
||||
` key="NEST2"` &&
|
||||
` enabled="{/activeNest2}"` &&
|
||||
` enabled="{/activeNest2}"` &&
|
||||
` />` &&
|
||||
` <IconTabFilter` &&
|
||||
` text="Nest2 Model"` &&
|
||||
` key="NEST2_MODEL"` &&
|
||||
` enabled="{/activeNest2}"` &&
|
||||
` enabled="{/activeNest2}"` &&
|
||||
` />` &&
|
||||
` </items>` &&
|
||||
` </IconTabHeader>` &&
|
||||
` <VBox>` &&
|
||||
` <ToggleButton text="Source XML after Templating" visible="{/isTemplating}" pressed="{/templatingSource}" press="onTemplatingPress" />` &&
|
||||
` <VBox>` &&
|
||||
` <ToggleButton text="Source XML after Templating" visible="{/isTemplating}" pressed="{/templatingSource}" press="onTemplatingPress" />` &&
|
||||
` <ce:CodeEditor` &&
|
||||
` type="{/type}"` &&
|
||||
` value="{/value}"` &&
|
||||
|
@ -111,9 +111,9 @@ CLASS z2ui5_cl_app_DebugTool_xml IMPLEMENTATION.
|
|||
` width="10000px"` &&
|
||||
` visible="{/editor_visible}"` &&
|
||||
` /></VBox>` &&
|
||||
` <VBox visible="{/source_visible}">` &&
|
||||
` <core:HTML/>` &&
|
||||
` </VBox>` &&
|
||||
` <VBox visible="{/source_visible}">` &&
|
||||
` <core:HTML/>` &&
|
||||
` </VBox>` &&
|
||||
` <endButton>` &&
|
||||
` <Button` &&
|
||||
` text="Close"` &&
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<VSEOCLASS>
|
||||
<CLSNAME>Z2UI5_CL_APP_DEBUGTOOL_XML</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>Z2UI5_CL_APP_DEBUGTOOL_XML</DESCRIPT>
|
||||
<DESCRIPT>Z2UI5_CL_APP_DEBUGTOOL_XML (generated)</DESCRIPT>
|
||||
<STATE>1</STATE>
|
||||
<CLSCCINCL>X</CLSCCINCL>
|
||||
<FIXPT>X</FIXPT>
|
||||
|
|
|
@ -18,7 +18,7 @@ CLASS z2ui5_cl_app_index_html IMPLEMENTATION.
|
|||
|
||||
METHOD get.
|
||||
|
||||
result = `<!DOCTYPE html>` &&
|
||||
result = `<!DOCTYPE html>` &&
|
||||
`<html lang="en">` &&
|
||||
`<head>` &&
|
||||
` <meta charset="UTF-8">` &&
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<VSEOCLASS>
|
||||
<CLSNAME>Z2UI5_CL_APP_INDEX_HTML</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>Z2UI5_CL_APP_INDEX_HTML</DESCRIPT>
|
||||
<DESCRIPT>Z2UI5_CL_APP_INDEX_HTML (generated)</DESCRIPT>
|
||||
<STATE>1</STATE>
|
||||
<CLSCCINCL>X</CLSCCINCL>
|
||||
<FIXPT>X</FIXPT>
|
||||
|
|
|
@ -18,7 +18,7 @@ CLASS z2ui5_cl_app_manifest_json IMPLEMENTATION.
|
|||
|
||||
METHOD get.
|
||||
|
||||
result = `{` &&
|
||||
result = `{` &&
|
||||
` "_version": "1.65.0",` &&
|
||||
` "sap.app": {` &&
|
||||
` "id": "z2ui5",` &&
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<VSEOCLASS>
|
||||
<CLSNAME>Z2UI5_CL_APP_MANIFEST_JSON</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>Z2UI5_CL_APP_MANIFEST_JSON</DESCRIPT>
|
||||
<DESCRIPT>Z2UI5_CL_APP_MANIFEST_JSON (generated)</DESCRIPT>
|
||||
<STATE>1</STATE>
|
||||
<CLSCCINCL>X</CLSCCINCL>
|
||||
<FIXPT>X</FIXPT>
|
||||
|
|
|
@ -18,25 +18,25 @@ CLASS z2ui5_cl_app_models_js IMPLEMENTATION.
|
|||
|
||||
METHOD get.
|
||||
|
||||
result = `sap.ui.define([` && |\n| &&
|
||||
` "sap/ui/model/json/JSONModel",` && |\n| &&
|
||||
` "sap/ui/Device"` && |\n| &&
|
||||
`],` && |\n| &&
|
||||
`function (JSONModel, Device) {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` return {` && |\n| &&
|
||||
` /**` && |\n| &&
|
||||
` * Provides runtime info for the device the UI5 app is running on as JSONModel` && |\n| &&
|
||||
` */` && |\n| &&
|
||||
` createDeviceModel: function () {` && |\n| &&
|
||||
` var oModel = new JSONModel(Device);` && |\n| &&
|
||||
` oModel.setDefaultBindingMode("OneWay");` && |\n| &&
|
||||
` return oModel;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
`` && |\n| &&
|
||||
`});` && |\n| &&
|
||||
result = `sap.ui.define([` && |\n| &&
|
||||
` "sap/ui/model/json/JSONModel",` && |\n| &&
|
||||
` "sap/ui/Device"` && |\n| &&
|
||||
`],` && |\n| &&
|
||||
`function (JSONModel, Device) {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` return {` && |\n| &&
|
||||
` /**` && |\n| &&
|
||||
` * Provides runtime info for the device the UI5 app is running on as JSONModel` && |\n| &&
|
||||
` */` && |\n| &&
|
||||
` createDeviceModel: function () {` && |\n| &&
|
||||
` var oModel = new JSONModel(Device);` && |\n| &&
|
||||
` oModel.setDefaultBindingMode("OneWay");` && |\n| &&
|
||||
` return oModel;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
`` && |\n| &&
|
||||
`});` && |\n| &&
|
||||
``.
|
||||
|
||||
ENDMETHOD.
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<VSEOCLASS>
|
||||
<CLSNAME>Z2UI5_CL_APP_MODELS_JS</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>Z2UI5_CL_APP_MODELS_JS</DESCRIPT>
|
||||
<DESCRIPT>Z2UI5_CL_APP_MODELS_JS (generated)</DESCRIPT>
|
||||
<STATE>1</STATE>
|
||||
<CLSCCINCL>X</CLSCCINCL>
|
||||
<FIXPT>X</FIXPT>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CLASS z2ui5_cl_app_Server_js DEFINITION
|
||||
CLASS z2ui5_cl_app_server_js DEFINITION
|
||||
PUBLIC
|
||||
FINAL
|
||||
CREATE PUBLIC .
|
||||
|
@ -14,157 +14,157 @@ CLASS z2ui5_cl_app_Server_js DEFINITION
|
|||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS z2ui5_cl_app_Server_js IMPLEMENTATION.
|
||||
CLASS z2ui5_cl_app_server_js IMPLEMENTATION.
|
||||
|
||||
METHOD get.
|
||||
|
||||
result = `sap.ui.define(["sap/ui/core/BusyIndicator","sap/m/MessageBox"` && |\n| &&
|
||||
`],` && |\n| &&
|
||||
` function (BusyIndicator, MessageBox) {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` return {` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` endSession: function () {` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` if (z2ui5.contextId) {` && |\n| &&
|
||||
` fetch(z2ui5.oConfig.pathname, {` && |\n| &&
|
||||
` method: 'HEAD',` && |\n| &&
|
||||
` keepalive: true,` && |\n| &&
|
||||
` headers: {` && |\n| &&
|
||||
` 'sap-terminate': 'session',` && |\n| &&
|
||||
` 'sap-contextid': z2ui5.contextId,` && |\n| &&
|
||||
` 'sap-contextid-accept': 'header'` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` delete z2ui5.contextId;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` Roundtrip() {` && |\n| &&
|
||||
` z2ui5.checkTimerActive = false;` && |\n| &&
|
||||
` z2ui5.checkNestAfter = false;` && |\n| &&
|
||||
` z2ui5.checkNestAfter2 = false;` && |\n| &&
|
||||
` let event = (args) => {` && |\n| &&
|
||||
` if (args != undefined) {` && |\n| &&
|
||||
` return args[0][0];` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` z2ui5.oBody ??= {};` && |\n| &&
|
||||
` z2ui5.oBody.S_FRONT = {` && |\n| &&
|
||||
` ID: z2ui5?.oBody?.ID,` && |\n| &&
|
||||
` CONFIG: z2ui5.oConfig,` && |\n| &&
|
||||
` XX: z2ui5?.oBody?.XX,` && |\n| &&
|
||||
` ORIGIN: window.location.origin,` && |\n| &&
|
||||
` PATHNAME: window.location.pathname,` && |\n| &&
|
||||
` SEARCH: (z2ui5.search) ? z2ui5.search : window.location.search,` && |\n| &&
|
||||
` VIEW: z2ui5.oBody?.VIEWNAME,` && |\n| &&
|
||||
` EVENT: event(z2ui5.oBody?.ARGUMENTS),` && |\n| &&
|
||||
` HASH: window.location.hash,` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
` if (z2ui5.oBody?.ARGUMENTS != undefined) {` && |\n| &&
|
||||
` if (z2ui5.oBody?.ARGUMENTS.length > 0) {` && |\n| &&
|
||||
` z2ui5.oBody?.ARGUMENTS.shift();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.oBody.S_FRONT.T_EVENT_ARG = z2ui5.oBody?.ARGUMENTS;` && |\n| &&
|
||||
` delete z2ui5.oBody.ID;` && |\n| &&
|
||||
` delete z2ui5.oBody?.VIEWNAME;` && |\n| &&
|
||||
` delete z2ui5.oBody?.S_FRONT.XX;` && |\n| &&
|
||||
` delete z2ui5.oBody?.ARGUMENTS;` && |\n| &&
|
||||
` if (!z2ui5.oBody.S_FRONT.T_EVENT_ARG) {` && |\n| &&
|
||||
` delete z2ui5.oBody.S_FRONT.T_EVENT_ARG;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (z2ui5.oBody.S_FRONT.T_EVENT_ARG) {` && |\n| &&
|
||||
` if (z2ui5.oBody.S_FRONT.T_EVENT_ARG.length == 0) {` && |\n| &&
|
||||
` delete z2ui5.oBody.S_FRONT.T_EVENT_ARG;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (z2ui5.oBody.S_FRONT.T_STARTUP_PARAMETERS == undefined) {` && |\n| &&
|
||||
` delete z2ui5.oBody.S_FRONT.T_STARTUP_PARAMETERS;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (z2ui5.oBody.S_FRONT.SEARCH == '') {` && |\n| &&
|
||||
` delete z2ui5.oBody.S_FRONT.SEARCH;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (!z2ui5.oBody.XX) {` && |\n| &&
|
||||
` delete z2ui5.oBody.XX;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` this.readHttp();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` async readHttp() {` && |\n| &&
|
||||
` const response = await fetch(z2ui5.oConfig.pathname, {` && |\n| &&
|
||||
` method: 'POST',` && |\n| &&
|
||||
` headers: {` && |\n| &&
|
||||
` 'Content-Type': 'application/json',` && |\n| &&
|
||||
` 'sap-contextid-accept': 'header',` && |\n| &&
|
||||
` 'sap-contextid': z2ui5.contextId` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` body: JSON.stringify(z2ui5.oBody)` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` z2ui5.contextId = response.headers.get("sap-contextid");` && |\n| &&
|
||||
` if (!response.ok) {` && |\n| &&
|
||||
` const responseText = await response.text();` && |\n| &&
|
||||
` this.responseError(responseText);` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` const responseData = await response.json();` && |\n| &&
|
||||
` z2ui5.responseData = responseData;` && |\n| &&
|
||||
` this.responseSuccess({` && |\n| &&
|
||||
` ID: responseData.S_FRONT.ID,` && |\n| &&
|
||||
` PARAMS: responseData.S_FRONT.PARAMS,` && |\n| &&
|
||||
` OVIEWMODEL: responseData.MODEL,` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` async responseSuccess(response) {` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` z2ui5.oResponse = response;` && |\n| &&
|
||||
` if (z2ui5.oResponse.PARAMS?.S_VIEW?.CHECK_DESTROY) {` && |\n| &&
|
||||
` z2ui5.oController.ViewDestroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ; if (z2ui5.oResponse.PARAMS?.S_FOLLOW_UP_ACTION?.CUSTOM_JS) {` && |\n| &&
|
||||
` setTimeout(() => {` && |\n| &&
|
||||
` let mParams = z2ui5.oResponse?.PARAMS.S_FOLLOW_UP_ACTION.CUSTOM_JS.split("'");` && |\n| &&
|
||||
` let mParamsEF = mParams.filter((val, index) => index % 2)` && |\n| &&
|
||||
` if (mParamsEF.length) {` && |\n| &&
|
||||
` z2ui5.oController.eF.apply(undefined, mParamsEF);` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` Function("return " + mParams[0])();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }, 100);` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
` z2ui5.oController.showMessage('S_MSG_TOAST', z2ui5.oResponse.PARAMS);` && |\n| &&
|
||||
` z2ui5.oController.showMessage('S_MSG_BOX', z2ui5.oResponse.PARAMS);` && |\n| &&
|
||||
` if (z2ui5.oResponse.PARAMS?.S_VIEW?.XML) {` && |\n| &&
|
||||
` if (z2ui5.oResponse.PARAMS?.S_VIEW?.XML !== '') {` && |\n| &&
|
||||
` z2ui5.oController.ViewDestroy();` && |\n| &&
|
||||
` await z2ui5.oController.displayView(z2ui5.oResponse.PARAMS.S_VIEW.XML, z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.oController.updateModelIfRequired('S_VIEW', z2ui5.oView);` && |\n| &&
|
||||
` z2ui5.oController.updateModelIfRequired('S_VIEW_NEST', z2ui5.oViewNest);` && |\n| &&
|
||||
` z2ui5.oController.updateModelIfRequired('S_VIEW_NEST2', z2ui5.oViewNest2);` && |\n| &&
|
||||
` z2ui5.oController.updateModelIfRequired('S_POPUP', z2ui5.oViewPopup);` && |\n| &&
|
||||
` z2ui5.oController.updateModelIfRequired('S_POPOVER', z2ui5.oViewPopover);` && |\n| &&
|
||||
` z2ui5.oController.onAfterRendering();` && |\n| &&
|
||||
` } catch (e) {` && |\n| &&
|
||||
` BusyIndicator.hide();` && |\n| &&
|
||||
` if (e.message.includes("openui5")) {` && |\n| &&
|
||||
` if (e.message.includes("script load error")) {` && |\n| &&
|
||||
` z2ui5.oController.checkSDKcompatibility(e)` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` MessageBox.error(e.toLocaleString());` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` responseError(response) {` && |\n| &&
|
||||
` document.write(response);` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
result = `sap.ui.define(["sap/ui/core/BusyIndicator","sap/m/MessageBox"` && |\n| &&
|
||||
`],` && |\n| &&
|
||||
` function (BusyIndicator, MessageBox) {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` return {` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` endSession: function () {` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` if (z2ui5.contextId) {` && |\n| &&
|
||||
` fetch(z2ui5.oConfig.pathname, {` && |\n| &&
|
||||
` method: 'HEAD',` && |\n| &&
|
||||
` keepalive: true,` && |\n| &&
|
||||
` headers: {` && |\n| &&
|
||||
` 'sap-terminate': 'session',` && |\n| &&
|
||||
` 'sap-contextid': z2ui5.contextId,` && |\n| &&
|
||||
` 'sap-contextid-accept': 'header'` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` delete z2ui5.contextId;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` Roundtrip() {` && |\n| &&
|
||||
` z2ui5.checkTimerActive = false;` && |\n| &&
|
||||
` z2ui5.checkNestAfter = false;` && |\n| &&
|
||||
` z2ui5.checkNestAfter2 = false;` && |\n| &&
|
||||
` let event = (args) => {` && |\n| &&
|
||||
` if (args != undefined) {` && |\n| &&
|
||||
` return args[0][0];` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` z2ui5.oBody ??= {};` && |\n| &&
|
||||
` z2ui5.oBody.S_FRONT = {` && |\n| &&
|
||||
` ID: z2ui5?.oBody?.ID,` && |\n| &&
|
||||
` CONFIG: z2ui5.oConfig,` && |\n| &&
|
||||
` XX: z2ui5?.oBody?.XX,` && |\n| &&
|
||||
` ORIGIN: window.location.origin,` && |\n| &&
|
||||
` PATHNAME: window.location.pathname,` && |\n| &&
|
||||
` SEARCH: (z2ui5.search) ? z2ui5.search : window.location.search,` && |\n| &&
|
||||
` VIEW: z2ui5.oBody?.VIEWNAME,` && |\n| &&
|
||||
` EVENT: event(z2ui5.oBody?.ARGUMENTS),` && |\n| &&
|
||||
` HASH: window.location.hash,` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
` if (z2ui5.oBody?.ARGUMENTS != undefined) {` && |\n| &&
|
||||
` if (z2ui5.oBody?.ARGUMENTS.length > 0) {` && |\n| &&
|
||||
` z2ui5.oBody?.ARGUMENTS.shift();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.oBody.S_FRONT.T_EVENT_ARG = z2ui5.oBody?.ARGUMENTS;` && |\n| &&
|
||||
` delete z2ui5.oBody.ID;` && |\n| &&
|
||||
` delete z2ui5.oBody?.VIEWNAME;` && |\n| &&
|
||||
` delete z2ui5.oBody?.S_FRONT.XX;` && |\n| &&
|
||||
` delete z2ui5.oBody?.ARGUMENTS;` && |\n| &&
|
||||
` if (!z2ui5.oBody.S_FRONT.T_EVENT_ARG) {` && |\n| &&
|
||||
` delete z2ui5.oBody.S_FRONT.T_EVENT_ARG;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (z2ui5.oBody.S_FRONT.T_EVENT_ARG) {` && |\n| &&
|
||||
` if (z2ui5.oBody.S_FRONT.T_EVENT_ARG.length == 0) {` && |\n| &&
|
||||
` delete z2ui5.oBody.S_FRONT.T_EVENT_ARG;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (z2ui5.oBody.S_FRONT.T_STARTUP_PARAMETERS == undefined) {` && |\n| &&
|
||||
` delete z2ui5.oBody.S_FRONT.T_STARTUP_PARAMETERS;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (z2ui5.oBody.S_FRONT.SEARCH == '') {` && |\n| &&
|
||||
` delete z2ui5.oBody.S_FRONT.SEARCH;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (!z2ui5.oBody.XX) {` && |\n| &&
|
||||
` delete z2ui5.oBody.XX;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` this.readHttp();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` async readHttp() {` && |\n| &&
|
||||
` const response = await fetch(z2ui5.oConfig.pathname, {` && |\n| &&
|
||||
` method: 'POST',` && |\n| &&
|
||||
` headers: {` && |\n| &&
|
||||
` 'Content-Type': 'application/json',` && |\n| &&
|
||||
` 'sap-contextid-accept': 'header',` && |\n| &&
|
||||
` 'sap-contextid': z2ui5.contextId` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` body: JSON.stringify(z2ui5.oBody)` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` z2ui5.contextId = response.headers.get("sap-contextid");` && |\n| &&
|
||||
` if (!response.ok) {` && |\n| &&
|
||||
` const responseText = await response.text();` && |\n| &&
|
||||
` this.responseError(responseText);` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` const responseData = await response.json();` && |\n| &&
|
||||
` z2ui5.responseData = responseData;` && |\n| &&
|
||||
` this.responseSuccess({` && |\n| &&
|
||||
` ID: responseData.S_FRONT.ID,` && |\n| &&
|
||||
` PARAMS: responseData.S_FRONT.PARAMS,` && |\n| &&
|
||||
` OVIEWMODEL: responseData.MODEL,` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` async responseSuccess(response) {` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` z2ui5.oResponse = response;` && |\n| &&
|
||||
` if (z2ui5.oResponse.PARAMS?.S_VIEW?.CHECK_DESTROY) {` && |\n| &&
|
||||
` z2ui5.oController.ViewDestroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ; if (z2ui5.oResponse.PARAMS?.S_FOLLOW_UP_ACTION?.CUSTOM_JS) {` && |\n| &&
|
||||
` setTimeout(() => {` && |\n| &&
|
||||
` let mParams = z2ui5.oResponse?.PARAMS.S_FOLLOW_UP_ACTION.CUSTOM_JS.split("'");` && |\n| &&
|
||||
` let mParamsEF = mParams.filter((val, index) => index % 2)` && |\n| &&
|
||||
` if (mParamsEF.length) {` && |\n| &&
|
||||
` z2ui5.oController.eF.apply(undefined, mParamsEF);` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` Function("return " + mParams[0])();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }, 100);` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
` z2ui5.oController.showMessage('S_MSG_TOAST', z2ui5.oResponse.PARAMS);` && |\n| &&
|
||||
` z2ui5.oController.showMessage('S_MSG_BOX', z2ui5.oResponse.PARAMS);` && |\n| &&
|
||||
` if (z2ui5.oResponse.PARAMS?.S_VIEW?.XML) {` && |\n| &&
|
||||
` if (z2ui5.oResponse.PARAMS?.S_VIEW?.XML !== '') {` && |\n| &&
|
||||
` z2ui5.oController.ViewDestroy();` && |\n| &&
|
||||
` await z2ui5.oController.displayView(z2ui5.oResponse.PARAMS.S_VIEW.XML, z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.oController.updateModelIfRequired('S_VIEW', z2ui5.oView);` && |\n| &&
|
||||
` z2ui5.oController.updateModelIfRequired('S_VIEW_NEST', z2ui5.oViewNest);` && |\n| &&
|
||||
` z2ui5.oController.updateModelIfRequired('S_VIEW_NEST2', z2ui5.oViewNest2);` && |\n| &&
|
||||
` z2ui5.oController.updateModelIfRequired('S_POPUP', z2ui5.oViewPopup);` && |\n| &&
|
||||
` z2ui5.oController.updateModelIfRequired('S_POPOVER', z2ui5.oViewPopover);` && |\n| &&
|
||||
` z2ui5.oController.onAfterRendering();` && |\n| &&
|
||||
` } catch (e) {` && |\n| &&
|
||||
` BusyIndicator.hide();` && |\n| &&
|
||||
` if (e.message.includes("openui5")) {` && |\n| &&
|
||||
` if (e.message.includes("script load error")) {` && |\n| &&
|
||||
` z2ui5.oController.checkSDKcompatibility(e)` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` MessageBox.error(e.toLocaleString());` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` responseError(response) {` && |\n| &&
|
||||
` document.write(response);` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` };` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
``.
|
||||
|
||||
ENDMETHOD.
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<VSEOCLASS>
|
||||
<CLSNAME>Z2UI5_CL_APP_SERVER_JS</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>Z2UI5_CL_APP_SERVER_JS</DESCRIPT>
|
||||
<DESCRIPT>Z2UI5_CL_APP_SERVER_JS (generated)</DESCRIPT>
|
||||
<STATE>1</STATE>
|
||||
<CLSCCINCL>X</CLSCCINCL>
|
||||
<FIXPT>X</FIXPT>
|
||||
|
|
|
@ -18,7 +18,7 @@ CLASS z2ui5_cl_app_style_css IMPLEMENTATION.
|
|||
|
||||
METHOD get.
|
||||
|
||||
result = `/* Enter your custom styles here */` && |\n| &&
|
||||
result = `/* Enter your custom styles here */` && |\n| &&
|
||||
``.
|
||||
|
||||
ENDMETHOD.
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<VSEOCLASS>
|
||||
<CLSNAME>Z2UI5_CL_APP_STYLE_CSS</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>Z2UI5_CL_APP_STYLE_CSS</DESCRIPT>
|
||||
<DESCRIPT>Z2UI5_CL_APP_STYLE_CSS (generated)</DESCRIPT>
|
||||
<STATE>1</STATE>
|
||||
<CLSCCINCL>X</CLSCCINCL>
|
||||
<FIXPT>X</FIXPT>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CLASS z2ui5_cl_app_View1_js DEFINITION
|
||||
CLASS z2ui5_cl_app_view1_js DEFINITION
|
||||
PUBLIC
|
||||
FINAL
|
||||
CREATE PUBLIC .
|
||||
|
@ -14,478 +14,478 @@ CLASS z2ui5_cl_app_View1_js DEFINITION
|
|||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS z2ui5_cl_app_View1_js IMPLEMENTATION.
|
||||
CLASS z2ui5_cl_app_view1_js IMPLEMENTATION.
|
||||
|
||||
METHOD get.
|
||||
|
||||
result = `sap.ui.define(["sap/ui/core/mvc/Controller", "sap/ui/core/mvc/XMLView", "sap/ui/model/json/JSONModel",` && |\n| &&
|
||||
` "sap/ui/core/BusyIndicator", "sap/m/MessageBox", "sap/m/MessageToast", "sap/ui/core/Fragment", "sap/m/BusyDialog",` && |\n| &&
|
||||
` "sap/ui/VersionInfo", "z2ui5/cc/Server",` && |\n| &&
|
||||
` ],` && |\n| &&
|
||||
` function(Controller, XMLView, JSONModel, BusyIndicator, MessageBox, MessageToast, Fragment, mBusyDialog, VersionInfo,` && |\n| &&
|
||||
` Server ) {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
` return Controller.extend("z2ui5.controller.View1", {` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` onInit (){` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` z2ui5.oRouter.attachRouteMatched(function(oEvent) {` && |\n| &&
|
||||
` z2ui5.checkInit = true;` && |\n| &&
|
||||
` Server.Roundtrip();` && |\n| &&
|
||||
` }, this);` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` async onAfterRendering() {` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` if (!z2ui5.oResponse){` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` if (!z2ui5.oResponse.PARAMS) {` && |\n| &&
|
||||
` BusyIndicator.hide();` && |\n| &&
|
||||
` z2ui5.isBusy = false;` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` const {S_POPUP, S_VIEW_NEST, S_VIEW_NEST2, S_POPOVER} = z2ui5.oResponse.PARAMS;` && |\n| &&
|
||||
` if (S_POPUP?.CHECK_DESTROY) {` && |\n| &&
|
||||
` z2ui5.oController.PopupDestroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (S_POPOVER?.CHECK_DESTROY) {` && |\n| &&
|
||||
` z2ui5.oController.PopoverDestroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (S_POPUP?.XML) {` && |\n| &&
|
||||
` z2ui5.oController.PopupDestroy();` && |\n| &&
|
||||
` await this.displayFragment(S_POPUP.XML, 'oViewPopup');` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (!z2ui5.checkNestAfter) {` && |\n| &&
|
||||
` if (S_VIEW_NEST?.XML) {` && |\n| &&
|
||||
` z2ui5.oController.NestViewDestroy();` && |\n| &&
|
||||
` await this.displayNestedView(S_VIEW_NEST.XML, 'oViewNest', 'S_VIEW_NEST');` && |\n| &&
|
||||
` z2ui5.checkNestAfter = true;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (!z2ui5.checkNestAfter2) {` && |\n| &&
|
||||
` if (S_VIEW_NEST2?.XML) {` && |\n| &&
|
||||
` z2ui5.oController.NestViewDestroy2();` && |\n| &&
|
||||
` await this.displayNestedView2(S_VIEW_NEST2.XML, 'oViewNest2', 'S_VIEW_NEST2');` && |\n| &&
|
||||
` z2ui5.checkNestAfter2 = true;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (S_POPOVER?.XML) {` && |\n| &&
|
||||
` await this.displayPopover(S_POPOVER.XML, 'oViewPopover', S_POPOVER.OPEN_BY_ID);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` BusyIndicator.hide();` && |\n| &&
|
||||
` z2ui5.isBusy = false;` && |\n| &&
|
||||
` z2ui5.onAfterRendering.forEach(item => {` && |\n| &&
|
||||
` if (item !== undefined) {` && |\n| &&
|
||||
` item();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` )` && |\n| &&
|
||||
` } catch (e) {` && |\n| &&
|
||||
` BusyIndicator.hide();` && |\n| &&
|
||||
` z2ui5.isBusy = false;` && |\n| &&
|
||||
` MessageBox.error(e.toLocaleString(), {` && |\n| &&
|
||||
` title: "Unexpected Error Occured - App Terminated",` && |\n| &&
|
||||
` actions: [],` && |\n| &&
|
||||
` onClose: () => {` && |\n| &&
|
||||
` new mBusyDialog({` && |\n| &&
|
||||
` text: "Please Restart the App"` && |\n| &&
|
||||
` }).open();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` })` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` async displayFragment(xml, viewProp) {` && |\n| &&
|
||||
` let oview_model = new JSONModel(z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` const oFragment = await Fragment.load({` && |\n| &&
|
||||
` definition: xml,` && |\n| &&
|
||||
` controller: z2ui5.oControllerPopup,` && |\n| &&
|
||||
` id: "popupId"` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` oFragment.setModel(oview_model);` && |\n| &&
|
||||
` z2ui5[viewProp] = oFragment;` && |\n| &&
|
||||
` z2ui5[viewProp].Fragment = Fragment;` && |\n| &&
|
||||
` oFragment.open();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` async displayPopover(xml, viewProp, openById) {` && |\n| &&
|
||||
` sap.ui.require(["sap/ui/core/Element"], async function(Element) {` && |\n| &&
|
||||
` const oFragment = await Fragment.load({` && |\n| &&
|
||||
` definition: xml,` && |\n| &&
|
||||
` controller: z2ui5.oControllerPopover,` && |\n| &&
|
||||
` id: "popoverId"` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` let oview_model = new JSONModel(z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` oFragment.setModel(oview_model);` && |\n| &&
|
||||
` z2ui5[viewProp] = oFragment;` && |\n| &&
|
||||
` z2ui5[viewProp].Fragment = Fragment;` && |\n| &&
|
||||
` let oControl = {};` && |\n| &&
|
||||
` if (z2ui5.oView?.byId(openById)) {` && |\n| &&
|
||||
` oControl = z2ui5.oView.byId(openById);` && |\n| &&
|
||||
` } else if (z2ui5.oViewPopup?.Fragment.byId('popupId', openById)) {` && |\n| &&
|
||||
` oControl = z2ui5.oViewPopup.Fragment.byId('popupId', openById);` && |\n| &&
|
||||
` } else if (z2ui5.oViewNest?.byId(openById)) {` && |\n| &&
|
||||
` oControl = z2ui5.oViewNest.byId(openById);` && |\n| &&
|
||||
` } else if (z2ui5.oViewNest2?.byId(openById)) {` && |\n| &&
|
||||
` oControl = z2ui5.oViewNest2.byId(openById);` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` if (sapUiCore.byId(openById)) {` && |\n| &&
|
||||
` // oControl = sapUiCore.byId(openById);` && |\n| &&
|
||||
` oControl = Element.getElementById(openById);` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` oControl = null;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` oFragment.openBy(oControl);` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` async displayNestedView(xml, viewProp, viewNestId) {` && |\n| &&
|
||||
` let oview_model = new JSONModel(z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` const oView = await XMLView.create({` && |\n| &&
|
||||
` definition: xml,` && |\n| &&
|
||||
` controller: z2ui5.oControllerNest,` && |\n| &&
|
||||
` preprocessors: {` && |\n| &&
|
||||
` xml: {` && |\n| &&
|
||||
` models: {` && |\n| &&
|
||||
` template: oview_model` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` oView.setModel(oview_model);` && |\n| &&
|
||||
` let oParent = z2ui5.oView.byId(z2ui5.oResponse.PARAMS[viewNestId].ID);` && |\n| &&
|
||||
` if (oParent) {` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` oParent[z2ui5.oResponse.PARAMS[viewNestId].METHOD_DESTROY]();` && |\n| &&
|
||||
` } catch {}` && |\n| &&
|
||||
` oParent[z2ui5.oResponse.PARAMS[viewNestId].METHOD_INSERT](oView);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5[viewProp] = oView;` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` async displayNestedView2(xml, viewProp, viewNestId) {` && |\n| &&
|
||||
` let oview_model = new JSONModel(z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` const oView = await XMLView.create({` && |\n| &&
|
||||
` definition: xml,` && |\n| &&
|
||||
` controller: z2ui5.oControllerNest2,` && |\n| &&
|
||||
` preprocessors: {` && |\n| &&
|
||||
` xml: {` && |\n| &&
|
||||
` models: {` && |\n| &&
|
||||
` template: oview_model` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` oView.setModel(oview_model);` && |\n| &&
|
||||
` let oParent = z2ui5.oView.byId(z2ui5.oResponse.PARAMS[viewNestId].ID);` && |\n| &&
|
||||
` if (oParent) {` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` oParent[z2ui5.oResponse.PARAMS[viewNestId].METHOD_DESTROY]();` && |\n| &&
|
||||
` } catch {}` && |\n| &&
|
||||
` oParent[z2ui5.oResponse.PARAMS[viewNestId].METHOD_INSERT](oView);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5[viewProp] = oView;` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` PopupDestroy() {` && |\n| &&
|
||||
` if (!z2ui5.oViewPopup) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (z2ui5.oViewPopup.close) {` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` z2ui5.oViewPopup.close();` && |\n| &&
|
||||
` } catch {}` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.oViewPopup.destroy();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` PopoverDestroy() {` && |\n| &&
|
||||
` if (!z2ui5.oViewPopover) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (z2ui5.oViewPopover.close) {` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` z2ui5.oViewPopover.close();` && |\n| &&
|
||||
` } catch {}` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.oViewPopover.destroy();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` NestViewDestroy() {` && |\n| &&
|
||||
` if (!z2ui5.oViewNest) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.oViewNest.destroy();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` NestViewDestroy2() {` && |\n| &&
|
||||
` if (!z2ui5.oViewNest2) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.oViewNest2.destroy();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` ViewDestroy() {` && |\n| &&
|
||||
` if (!z2ui5.oView) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.oView.destroy();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` eF(...args) {` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` z2ui5.onBeforeEventFrontend.forEach(item => {` && |\n| &&
|
||||
` if (item !== undefined) {` && |\n| &&
|
||||
` item(args);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` )` && |\n| &&
|
||||
` let oCrossAppNavigator;` && |\n| &&
|
||||
` switch (args[0]) {` && |\n| &&
|
||||
` case 'SET_SIZE_LIMIT':` && |\n| &&
|
||||
` switch (args[2]) {` && |\n| &&
|
||||
` case 'MAIN':` && |\n| &&
|
||||
` z2ui5.oView.getModel().setSizeLimit(parseInt(args[1]));` && |\n| &&
|
||||
` z2ui5.oView.getModel().refresh(true);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'NEST':` && |\n| &&
|
||||
` z2ui5.oViewNest.getModel().setSizeLimit(parseInt(args[1]));` && |\n| &&
|
||||
` z2ui5.oViewNest.getModel().refresh(true);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'NEST2':` && |\n| &&
|
||||
` z2ui5.oViewNest2.getModel().setSizeLimit(parseInt(args[1]));` && |\n| &&
|
||||
` z2ui5.oViewNest2.getModel().refresh(true);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'POPUP':` && |\n| &&
|
||||
` z2ui5.oPopup.getModel().setSizeLimit(parseInt(args[1]));` && |\n| &&
|
||||
` z2ui5.oPopup.getModel().refresh(true);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'POPOVER':` && |\n| &&
|
||||
` z2ui5.oPopover.getModel().setSizeLimit(parseInt(args[1]));` && |\n| &&
|
||||
` z2ui5.oPopover.getModel().refresh(true);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'DOWNLOAD_B64_FILE':` && |\n| &&
|
||||
` var a = document.createElement("a");` && |\n| &&
|
||||
` a.href = args[1];` && |\n| &&
|
||||
` a.download = args[2];` && |\n| &&
|
||||
` a.click();` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'CROSS_APP_NAV_TO_PREV_APP':` && |\n| &&
|
||||
` // oCrossAppNavigator = Container.getService("CrossApplicationNavigation");` && |\n| &&
|
||||
` oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");` && |\n| &&
|
||||
` oCrossAppNavigator.backToPreviousApp();` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'CROSS_APP_NAV_TO_EXT':` && |\n| &&
|
||||
` // oCrossAppNavigator = Container.getService("CrossApplicationNavigation");` && |\n| &&
|
||||
` oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");` && |\n| &&
|
||||
` const hash = (oCrossAppNavigator.hrefForExternal({` && |\n| &&
|
||||
` target: args[1],` && |\n| &&
|
||||
` params: args[2]` && |\n| &&
|
||||
` })) || "";` && |\n| &&
|
||||
` if (args[3] === 'EXT') {` && |\n| &&
|
||||
` let url = window.location.href.split('#')[0] + hash;` && |\n| &&
|
||||
` //todo` && |\n| &&
|
||||
` //URLHelper.redirect(url, true);` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` oCrossAppNavigator.toExternal({` && |\n| &&
|
||||
` target: {` && |\n| &&
|
||||
` shellHash: hash` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'LOCATION_RELOAD':` && |\n| &&
|
||||
` window.location = args[1];` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'OPEN_NEW_TAB':` && |\n| &&
|
||||
` window.open(args[1], '_blank');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'POPUP_CLOSE':` && |\n| &&
|
||||
` z2ui5.oController.PopupDestroy();` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'POPOVER_CLOSE':` && |\n| &&
|
||||
` z2ui5.oController.PopoverDestroy();` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'NAV_CONTAINER_TO':` && |\n| &&
|
||||
` var navCon = z2ui5.oView.byId(args[1]);` && |\n| &&
|
||||
` var navConTo = z2ui5.oView.byId(args[2]);` && |\n| &&
|
||||
` navCon.to(navConTo);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'NEST_NAV_CONTAINER_TO':` && |\n| &&
|
||||
` navCon = z2ui5.oViewNest.byId(args[1]);` && |\n| &&
|
||||
` navConTo = z2ui5.oViewNest.byId(args[2]);` && |\n| &&
|
||||
` navCon.to(navConTo);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'NEST2_NAV_CONTAINER_TO':` && |\n| &&
|
||||
` navCon = z2ui5.oViewNest2.byId(args[1]);` && |\n| &&
|
||||
` navConTo = z2ui5.oViewNest2.byId(args[2]);` && |\n| &&
|
||||
` navCon.to(navConTo);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'POPUP_NAV_CONTAINER_TO':` && |\n| &&
|
||||
` navCon = Fragment.byId("popupId", args[1]);` && |\n| &&
|
||||
` navConTo = Fragment.byId("popupId", args[2]);` && |\n| &&
|
||||
` navCon.to(navConTo);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` eB(...args) {` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` // var oRouter = sap.ui.core.UIComponent.getRouterFor(this);` && |\n| &&
|
||||
` //debugger;` && |\n| &&
|
||||
` // z2ui5.oRouter.navTo("RouteView2");` && |\n| &&
|
||||
` // return;` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` if (!window.navigator.onLine) {` && |\n| &&
|
||||
` MessageBox.alert('No internet connection! Please reconnect to the server and try again.');` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (z2ui5.isBusy == true) {` && |\n| &&
|
||||
` if (!args[0][2]) {` && |\n| &&
|
||||
` let oBusyDialog = new mBusyDialog();` && |\n| &&
|
||||
` oBusyDialog.open();` && |\n| &&
|
||||
` setTimeout( (oBusyDialog) => {` && |\n| &&
|
||||
` oBusyDialog.close()` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` , 100, oBusyDialog);` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.isBusy = true;` && |\n| &&
|
||||
` BusyIndicator.show();` && |\n| &&
|
||||
` z2ui5.oBody = {};` && |\n| &&
|
||||
` if (args[0][3]) {` && |\n| &&
|
||||
` z2ui5.oBody.XX = z2ui5.oView.getModel().getData().XX;` && |\n| &&
|
||||
` z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| &&
|
||||
` } else if (z2ui5.oController == this) {` && |\n| &&
|
||||
` z2ui5.oBody.XX = z2ui5.oView.getModel().getData().XX;` && |\n| &&
|
||||
` z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| &&
|
||||
` } else if (z2ui5.oControllerPopup == this) {` && |\n| &&
|
||||
` if (z2ui5.oViewPopup) {` && |\n| &&
|
||||
` z2ui5.oBody.XX = z2ui5.oViewPopup.getModel().getData().XX;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| &&
|
||||
` } else if (z2ui5.oControllerPopover == this) {` && |\n| &&
|
||||
` z2ui5.oBody.XX = z2ui5.oViewPopover.getModel().getData().XX;` && |\n| &&
|
||||
` z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| &&
|
||||
` } else if (z2ui5.oControllerNest == this) {` && |\n| &&
|
||||
` z2ui5.oBody.XX = z2ui5.oViewNest.getModel().getData().XX;` && |\n| &&
|
||||
` z2ui5.oBody.VIEWNAME = 'NEST';` && |\n| &&
|
||||
` } else if (z2ui5.oControllerNest2 == this) {` && |\n| &&
|
||||
` z2ui5.oBody.XX = z2ui5.oViewNest2.getModel().getData().XX;` && |\n| &&
|
||||
` z2ui5.oBody.VIEWNAME = 'NEST2';` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.onBeforeRoundtrip.forEach(item => {` && |\n| &&
|
||||
` if (item !== undefined) {` && |\n| &&
|
||||
` item();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` )` && |\n| &&
|
||||
` if (args[0][1]) {` && |\n| &&
|
||||
` z2ui5.oController.ViewDestroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.oBody.ID = z2ui5.oResponse.ID;` && |\n| &&
|
||||
` z2ui5.oBody.ARGUMENTS = args;` && |\n| &&
|
||||
` z2ui5.oBody.ARGUMENTS.forEach( (item, i) => {` && |\n| &&
|
||||
` if (i == 0) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (typeof item === 'object') {` && |\n| &&
|
||||
` z2ui5.oBody.ARGUMENTS[i] = JSON.stringify(item);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` );` && |\n| &&
|
||||
` z2ui5.oResponseOld = z2ui5.oResponse;` && |\n| &&
|
||||
` Server.Roundtrip();` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` updateModelIfRequired(paramKey, oView) {` && |\n| &&
|
||||
` if (z2ui5.oResponse.PARAMS == undefined) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (z2ui5.oResponse.PARAMS[paramKey]?.CHECK_UPDATE_MODEL) {` && |\n| &&
|
||||
` let model = new JSONModel(z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` if (oView) {` && |\n| &&
|
||||
` oView.setModel(model);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` async checkSDKcompatibility(err) {` && |\n| &&
|
||||
` let oCurrentVersionInfo = await VersionInfo.load();` && |\n| &&
|
||||
` var ui5_sdk = oCurrentVersionInfo.gav.includes('com.sap.ui5') ? true : false;` && |\n| &&
|
||||
` if (!ui5_sdk) {` && |\n| &&
|
||||
` if (err) {` && |\n| &&
|
||||
` MessageBox.error("openui5 SDK is loaded, module: " + err._modules + " is not availabe in openui5");` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ;MessageBox.error(err.toLocaleString());` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` showMessage(msgType, params) {` && |\n| &&
|
||||
` if (params == undefined) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (params[msgType]?.TEXT !== undefined) {` && |\n| &&
|
||||
` if (msgType === 'S_MSG_TOAST') {` && |\n| &&
|
||||
` MessageToast.show(params[msgType].TEXT, {` && |\n| &&
|
||||
` duration: params[msgType].DURATION ? parseInt(params[msgType].DURATION) : 3000,` && |\n| &&
|
||||
` width: params[msgType].WIDTH ? params[msgType].WIDTH : '15em',` && |\n| &&
|
||||
` onClose: params[msgType].ONCLOSE ? params[msgType].ONCLOSE : null,` && |\n| &&
|
||||
` autoClose: params[msgType].AUTOCLOSE ? true : false,` && |\n| &&
|
||||
` animationTimingFunction: params[msgType].ANIMATIONTIMINGFUNCTION ? params[msgType].ANIMATIONTIMINGFUNCTION : 'ease',` && |\n| &&
|
||||
` animationDuration: params[msgType].ANIMATIONDURATION ? parseInt(params[msgType].ANIMATIONDURATION) : 1000,` && |\n| &&
|
||||
` closeonBrowserNavigation: params[msgType].CLOSEONBROWSERNAVIGATION ? true : false` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` if (params[msgType].CLASS) {` && |\n| &&
|
||||
` let mtoast = {};` && |\n| &&
|
||||
` mtoast = document.getElementsByClassName("sapMMessageToast")[0];` && |\n| &&
|
||||
` if (mtoast) {` && |\n| &&
|
||||
` mtoast.classList.add(params[msgType].CLASS);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ;` && |\n| &&
|
||||
` } else if (msgType === 'S_MSG_BOX') {` && |\n| &&
|
||||
` if (params[msgType].TYPE) {` && |\n| &&
|
||||
` MessageBox[params[msgType].TYPE](params[msgType].TEXT);` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` MessageBox.show(params[msgType].TEXT, {` && |\n| &&
|
||||
` styleClass: params[msgType].STYLECLASS ? params[msgType].STYLECLASS : '',` && |\n| &&
|
||||
` title: params[msgType].TITLE ? params[msgType].TITLE : '',` && |\n| &&
|
||||
` onClose: params[msgType].ONCLOSE ? Function("sAction", "return " + params[msgType].ONCLOSE) : null,` && |\n| &&
|
||||
` actions: params[msgType].ACTIONS ? params[msgType].ACTIONS : 'OK',` && |\n| &&
|
||||
` emphasizedAction: params[msgType].EMPHASIZEDACTION ? params[msgType].EMPHASIZEDACTION : 'OK',` && |\n| &&
|
||||
` initialFocus: params[msgType].INITIALFOCUS ? params[msgType].INITIALFOCUS : null,` && |\n| &&
|
||||
` textDirection: params[msgType].TEXTDIRECTION ? params[msgType].TEXTDIRECTION : 'Inherit',` && |\n| &&
|
||||
` icon: params[msgType].ICON ? params[msgType].ICON : 'NONE',` && |\n| &&
|
||||
` details: params[msgType].DETAILS ? params[msgType].DETAILS : '',` && |\n| &&
|
||||
` closeOnNavigation: params[msgType].CLOSEONNAVIGATION ? true : false` && |\n| &&
|
||||
` })` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` setApp(oApp) {` && |\n| &&
|
||||
` this._oApp = oApp;` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` async displayView(xml, viewModel) {` && |\n| &&
|
||||
` let oview_model = new JSONModel(viewModel);` && |\n| &&
|
||||
` z2ui5.oView = await XMLView.create({` && |\n| &&
|
||||
` definition: xml,` && |\n| &&
|
||||
` models: oview_model,` && |\n| &&
|
||||
` controller: z2ui5.oController,` && |\n| &&
|
||||
` id: 'mainView',` && |\n| &&
|
||||
` preprocessors: {` && |\n| &&
|
||||
` xml: {` && |\n| &&
|
||||
` models: {` && |\n| &&
|
||||
` template: oview_model` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` z2ui5.oView.setModel(z2ui5.oDeviceModel, "device");` && |\n| &&
|
||||
` this._oApp.removeAllPages();` && |\n| &&
|
||||
` this._oApp.insertPage(z2ui5.oView);` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` })` && |\n| &&
|
||||
`});` && |\n| &&
|
||||
result = `sap.ui.define(["sap/ui/core/mvc/Controller", "sap/ui/core/mvc/XMLView", "sap/ui/model/json/JSONModel",` && |\n| &&
|
||||
` "sap/ui/core/BusyIndicator", "sap/m/MessageBox", "sap/m/MessageToast", "sap/ui/core/Fragment", "sap/m/BusyDialog",` && |\n| &&
|
||||
` "sap/ui/VersionInfo", "z2ui5/cc/Server",` && |\n| &&
|
||||
` ],` && |\n| &&
|
||||
` function(Controller, XMLView, JSONModel, BusyIndicator, MessageBox, MessageToast, Fragment, mBusyDialog, VersionInfo,` && |\n| &&
|
||||
` Server ) {` && |\n| &&
|
||||
` "use strict";` && |\n| &&
|
||||
` return Controller.extend("z2ui5.controller.View1", {` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` onInit (){` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` z2ui5.oRouter.attachRouteMatched(function(oEvent) {` && |\n| &&
|
||||
` z2ui5.checkInit = true;` && |\n| &&
|
||||
` Server.Roundtrip();` && |\n| &&
|
||||
` }, this);` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` async onAfterRendering() {` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` if (!z2ui5.oResponse){` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` if (!z2ui5.oResponse.PARAMS) {` && |\n| &&
|
||||
` BusyIndicator.hide();` && |\n| &&
|
||||
` z2ui5.isBusy = false;` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` const {S_POPUP, S_VIEW_NEST, S_VIEW_NEST2, S_POPOVER} = z2ui5.oResponse.PARAMS;` && |\n| &&
|
||||
` if (S_POPUP?.CHECK_DESTROY) {` && |\n| &&
|
||||
` z2ui5.oController.PopupDestroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (S_POPOVER?.CHECK_DESTROY) {` && |\n| &&
|
||||
` z2ui5.oController.PopoverDestroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (S_POPUP?.XML) {` && |\n| &&
|
||||
` z2ui5.oController.PopupDestroy();` && |\n| &&
|
||||
` await this.displayFragment(S_POPUP.XML, 'oViewPopup');` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (!z2ui5.checkNestAfter) {` && |\n| &&
|
||||
` if (S_VIEW_NEST?.XML) {` && |\n| &&
|
||||
` z2ui5.oController.NestViewDestroy();` && |\n| &&
|
||||
` await this.displayNestedView(S_VIEW_NEST.XML, 'oViewNest', 'S_VIEW_NEST');` && |\n| &&
|
||||
` z2ui5.checkNestAfter = true;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (!z2ui5.checkNestAfter2) {` && |\n| &&
|
||||
` if (S_VIEW_NEST2?.XML) {` && |\n| &&
|
||||
` z2ui5.oController.NestViewDestroy2();` && |\n| &&
|
||||
` await this.displayNestedView2(S_VIEW_NEST2.XML, 'oViewNest2', 'S_VIEW_NEST2');` && |\n| &&
|
||||
` z2ui5.checkNestAfter2 = true;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (S_POPOVER?.XML) {` && |\n| &&
|
||||
` await this.displayPopover(S_POPOVER.XML, 'oViewPopover', S_POPOVER.OPEN_BY_ID);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` BusyIndicator.hide();` && |\n| &&
|
||||
` z2ui5.isBusy = false;` && |\n| &&
|
||||
` z2ui5.onAfterRendering.forEach(item => {` && |\n| &&
|
||||
` if (item !== undefined) {` && |\n| &&
|
||||
` item();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` )` && |\n| &&
|
||||
` } catch (e) {` && |\n| &&
|
||||
` BusyIndicator.hide();` && |\n| &&
|
||||
` z2ui5.isBusy = false;` && |\n| &&
|
||||
` MessageBox.error(e.toLocaleString(), {` && |\n| &&
|
||||
` title: "Unexpected Error Occured - App Terminated",` && |\n| &&
|
||||
` actions: [],` && |\n| &&
|
||||
` onClose: () => {` && |\n| &&
|
||||
` new mBusyDialog({` && |\n| &&
|
||||
` text: "Please Restart the App"` && |\n| &&
|
||||
` }).open();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` })` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` async displayFragment(xml, viewProp) {` && |\n| &&
|
||||
` let oview_model = new JSONModel(z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` const oFragment = await Fragment.load({` && |\n| &&
|
||||
` definition: xml,` && |\n| &&
|
||||
` controller: z2ui5.oControllerPopup,` && |\n| &&
|
||||
` id: "popupId"` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` oFragment.setModel(oview_model);` && |\n| &&
|
||||
` z2ui5[viewProp] = oFragment;` && |\n| &&
|
||||
` z2ui5[viewProp].Fragment = Fragment;` && |\n| &&
|
||||
` oFragment.open();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` async displayPopover(xml, viewProp, openById) {` && |\n| &&
|
||||
` sap.ui.require(["sap/ui/core/Element"], async function(Element) {` && |\n| &&
|
||||
` const oFragment = await Fragment.load({` && |\n| &&
|
||||
` definition: xml,` && |\n| &&
|
||||
` controller: z2ui5.oControllerPopover,` && |\n| &&
|
||||
` id: "popoverId"` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` let oview_model = new JSONModel(z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` oFragment.setModel(oview_model);` && |\n| &&
|
||||
` z2ui5[viewProp] = oFragment;` && |\n| &&
|
||||
` z2ui5[viewProp].Fragment = Fragment;` && |\n| &&
|
||||
` let oControl = {};` && |\n| &&
|
||||
` if (z2ui5.oView?.byId(openById)) {` && |\n| &&
|
||||
` oControl = z2ui5.oView.byId(openById);` && |\n| &&
|
||||
` } else if (z2ui5.oViewPopup?.Fragment.byId('popupId', openById)) {` && |\n| &&
|
||||
` oControl = z2ui5.oViewPopup.Fragment.byId('popupId', openById);` && |\n| &&
|
||||
` } else if (z2ui5.oViewNest?.byId(openById)) {` && |\n| &&
|
||||
` oControl = z2ui5.oViewNest.byId(openById);` && |\n| &&
|
||||
` } else if (z2ui5.oViewNest2?.byId(openById)) {` && |\n| &&
|
||||
` oControl = z2ui5.oViewNest2.byId(openById);` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` if (sapUiCore.byId(openById)) {` && |\n| &&
|
||||
` // oControl = sapUiCore.byId(openById);` && |\n| &&
|
||||
` oControl = Element.getElementById(openById);` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` oControl = null;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` oFragment.openBy(oControl);` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` async displayNestedView(xml, viewProp, viewNestId) {` && |\n| &&
|
||||
` let oview_model = new JSONModel(z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` const oView = await XMLView.create({` && |\n| &&
|
||||
` definition: xml,` && |\n| &&
|
||||
` controller: z2ui5.oControllerNest,` && |\n| &&
|
||||
` preprocessors: {` && |\n| &&
|
||||
` xml: {` && |\n| &&
|
||||
` models: {` && |\n| &&
|
||||
` template: oview_model` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` oView.setModel(oview_model);` && |\n| &&
|
||||
` let oParent = z2ui5.oView.byId(z2ui5.oResponse.PARAMS[viewNestId].ID);` && |\n| &&
|
||||
` if (oParent) {` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` oParent[z2ui5.oResponse.PARAMS[viewNestId].METHOD_DESTROY]();` && |\n| &&
|
||||
` } catch {}` && |\n| &&
|
||||
` oParent[z2ui5.oResponse.PARAMS[viewNestId].METHOD_INSERT](oView);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5[viewProp] = oView;` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` async displayNestedView2(xml, viewProp, viewNestId) {` && |\n| &&
|
||||
` let oview_model = new JSONModel(z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` const oView = await XMLView.create({` && |\n| &&
|
||||
` definition: xml,` && |\n| &&
|
||||
` controller: z2ui5.oControllerNest2,` && |\n| &&
|
||||
` preprocessors: {` && |\n| &&
|
||||
` xml: {` && |\n| &&
|
||||
` models: {` && |\n| &&
|
||||
` template: oview_model` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` oView.setModel(oview_model);` && |\n| &&
|
||||
` let oParent = z2ui5.oView.byId(z2ui5.oResponse.PARAMS[viewNestId].ID);` && |\n| &&
|
||||
` if (oParent) {` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` oParent[z2ui5.oResponse.PARAMS[viewNestId].METHOD_DESTROY]();` && |\n| &&
|
||||
` } catch {}` && |\n| &&
|
||||
` oParent[z2ui5.oResponse.PARAMS[viewNestId].METHOD_INSERT](oView);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5[viewProp] = oView;` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` PopupDestroy() {` && |\n| &&
|
||||
` if (!z2ui5.oViewPopup) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (z2ui5.oViewPopup.close) {` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` z2ui5.oViewPopup.close();` && |\n| &&
|
||||
` } catch {}` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.oViewPopup.destroy();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` PopoverDestroy() {` && |\n| &&
|
||||
` if (!z2ui5.oViewPopover) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (z2ui5.oViewPopover.close) {` && |\n| &&
|
||||
` try {` && |\n| &&
|
||||
` z2ui5.oViewPopover.close();` && |\n| &&
|
||||
` } catch {}` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.oViewPopover.destroy();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` NestViewDestroy() {` && |\n| &&
|
||||
` if (!z2ui5.oViewNest) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.oViewNest.destroy();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` NestViewDestroy2() {` && |\n| &&
|
||||
` if (!z2ui5.oViewNest2) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.oViewNest2.destroy();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` ViewDestroy() {` && |\n| &&
|
||||
` if (!z2ui5.oView) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.oView.destroy();` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` eF(...args) {` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` z2ui5.onBeforeEventFrontend.forEach(item => {` && |\n| &&
|
||||
` if (item !== undefined) {` && |\n| &&
|
||||
` item(args);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` )` && |\n| &&
|
||||
` let oCrossAppNavigator;` && |\n| &&
|
||||
` switch (args[0]) {` && |\n| &&
|
||||
` case 'SET_SIZE_LIMIT':` && |\n| &&
|
||||
` switch (args[2]) {` && |\n| &&
|
||||
` case 'MAIN':` && |\n| &&
|
||||
` z2ui5.oView.getModel().setSizeLimit(parseInt(args[1]));` && |\n| &&
|
||||
` z2ui5.oView.getModel().refresh(true);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'NEST':` && |\n| &&
|
||||
` z2ui5.oViewNest.getModel().setSizeLimit(parseInt(args[1]));` && |\n| &&
|
||||
` z2ui5.oViewNest.getModel().refresh(true);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'NEST2':` && |\n| &&
|
||||
` z2ui5.oViewNest2.getModel().setSizeLimit(parseInt(args[1]));` && |\n| &&
|
||||
` z2ui5.oViewNest2.getModel().refresh(true);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'POPUP':` && |\n| &&
|
||||
` z2ui5.oPopup.getModel().setSizeLimit(parseInt(args[1]));` && |\n| &&
|
||||
` z2ui5.oPopup.getModel().refresh(true);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'POPOVER':` && |\n| &&
|
||||
` z2ui5.oPopover.getModel().setSizeLimit(parseInt(args[1]));` && |\n| &&
|
||||
` z2ui5.oPopover.getModel().refresh(true);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'DOWNLOAD_B64_FILE':` && |\n| &&
|
||||
` var a = document.createElement("a");` && |\n| &&
|
||||
` a.href = args[1];` && |\n| &&
|
||||
` a.download = args[2];` && |\n| &&
|
||||
` a.click();` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'CROSS_APP_NAV_TO_PREV_APP':` && |\n| &&
|
||||
` // oCrossAppNavigator = Container.getService("CrossApplicationNavigation");` && |\n| &&
|
||||
` oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");` && |\n| &&
|
||||
` oCrossAppNavigator.backToPreviousApp();` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'CROSS_APP_NAV_TO_EXT':` && |\n| &&
|
||||
` // oCrossAppNavigator = Container.getService("CrossApplicationNavigation");` && |\n| &&
|
||||
` oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");` && |\n| &&
|
||||
` const hash = (oCrossAppNavigator.hrefForExternal({` && |\n| &&
|
||||
` target: args[1],` && |\n| &&
|
||||
` params: args[2]` && |\n| &&
|
||||
` })) || "";` && |\n| &&
|
||||
` if (args[3] === 'EXT') {` && |\n| &&
|
||||
` let url = window.location.href.split('#')[0] + hash;` && |\n| &&
|
||||
` //todo` && |\n| &&
|
||||
` //URLHelper.redirect(url, true);` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` oCrossAppNavigator.toExternal({` && |\n| &&
|
||||
` target: {` && |\n| &&
|
||||
` shellHash: hash` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'LOCATION_RELOAD':` && |\n| &&
|
||||
` window.location = args[1];` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'OPEN_NEW_TAB':` && |\n| &&
|
||||
` window.open(args[1], '_blank');` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'POPUP_CLOSE':` && |\n| &&
|
||||
` z2ui5.oController.PopupDestroy();` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'POPOVER_CLOSE':` && |\n| &&
|
||||
` z2ui5.oController.PopoverDestroy();` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'NAV_CONTAINER_TO':` && |\n| &&
|
||||
` var navCon = z2ui5.oView.byId(args[1]);` && |\n| &&
|
||||
` var navConTo = z2ui5.oView.byId(args[2]);` && |\n| &&
|
||||
` navCon.to(navConTo);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'NEST_NAV_CONTAINER_TO':` && |\n| &&
|
||||
` navCon = z2ui5.oViewNest.byId(args[1]);` && |\n| &&
|
||||
` navConTo = z2ui5.oViewNest.byId(args[2]);` && |\n| &&
|
||||
` navCon.to(navConTo);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'NEST2_NAV_CONTAINER_TO':` && |\n| &&
|
||||
` navCon = z2ui5.oViewNest2.byId(args[1]);` && |\n| &&
|
||||
` navConTo = z2ui5.oViewNest2.byId(args[2]);` && |\n| &&
|
||||
` navCon.to(navConTo);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` case 'POPUP_NAV_CONTAINER_TO':` && |\n| &&
|
||||
` navCon = Fragment.byId("popupId", args[1]);` && |\n| &&
|
||||
` navConTo = Fragment.byId("popupId", args[2]);` && |\n| &&
|
||||
` navCon.to(navConTo);` && |\n| &&
|
||||
` break;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` eB(...args) {` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` // var oRouter = sap.ui.core.UIComponent.getRouterFor(this);` && |\n| &&
|
||||
` //debugger;` && |\n| &&
|
||||
` // z2ui5.oRouter.navTo("RouteView2");` && |\n| &&
|
||||
` // return;` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` if (!window.navigator.onLine) {` && |\n| &&
|
||||
` MessageBox.alert('No internet connection! Please reconnect to the server and try again.');` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (z2ui5.isBusy == true) {` && |\n| &&
|
||||
` if (!args[0][2]) {` && |\n| &&
|
||||
` let oBusyDialog = new mBusyDialog();` && |\n| &&
|
||||
` oBusyDialog.open();` && |\n| &&
|
||||
` setTimeout( (oBusyDialog) => {` && |\n| &&
|
||||
` oBusyDialog.close()` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` , 100, oBusyDialog);` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.isBusy = true;` && |\n| &&
|
||||
` BusyIndicator.show();` && |\n| &&
|
||||
` z2ui5.oBody = {};` && |\n| &&
|
||||
` if (args[0][3]) {` && |\n| &&
|
||||
` z2ui5.oBody.XX = z2ui5.oView.getModel().getData().XX;` && |\n| &&
|
||||
` z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| &&
|
||||
` } else if (z2ui5.oController == this) {` && |\n| &&
|
||||
` z2ui5.oBody.XX = z2ui5.oView.getModel().getData().XX;` && |\n| &&
|
||||
` z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| &&
|
||||
` } else if (z2ui5.oControllerPopup == this) {` && |\n| &&
|
||||
` if (z2ui5.oViewPopup) {` && |\n| &&
|
||||
` z2ui5.oBody.XX = z2ui5.oViewPopup.getModel().getData().XX;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| &&
|
||||
` } else if (z2ui5.oControllerPopover == this) {` && |\n| &&
|
||||
` z2ui5.oBody.XX = z2ui5.oViewPopover.getModel().getData().XX;` && |\n| &&
|
||||
` z2ui5.oBody.VIEWNAME = 'MAIN';` && |\n| &&
|
||||
` } else if (z2ui5.oControllerNest == this) {` && |\n| &&
|
||||
` z2ui5.oBody.XX = z2ui5.oViewNest.getModel().getData().XX;` && |\n| &&
|
||||
` z2ui5.oBody.VIEWNAME = 'NEST';` && |\n| &&
|
||||
` } else if (z2ui5.oControllerNest2 == this) {` && |\n| &&
|
||||
` z2ui5.oBody.XX = z2ui5.oViewNest2.getModel().getData().XX;` && |\n| &&
|
||||
` z2ui5.oBody.VIEWNAME = 'NEST2';` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.onBeforeRoundtrip.forEach(item => {` && |\n| &&
|
||||
` if (item !== undefined) {` && |\n| &&
|
||||
` item();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` )` && |\n| &&
|
||||
` if (args[0][1]) {` && |\n| &&
|
||||
` z2ui5.oController.ViewDestroy();` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` z2ui5.oBody.ID = z2ui5.oResponse.ID;` && |\n| &&
|
||||
` z2ui5.oBody.ARGUMENTS = args;` && |\n| &&
|
||||
` z2ui5.oBody.ARGUMENTS.forEach( (item, i) => {` && |\n| &&
|
||||
` if (i == 0) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (typeof item === 'object') {` && |\n| &&
|
||||
` z2ui5.oBody.ARGUMENTS[i] = JSON.stringify(item);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` );` && |\n| &&
|
||||
` z2ui5.oResponseOld = z2ui5.oResponse;` && |\n| &&
|
||||
` Server.Roundtrip();` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
`` && |\n| &&
|
||||
` updateModelIfRequired(paramKey, oView) {` && |\n| &&
|
||||
` if (z2ui5.oResponse.PARAMS == undefined) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (z2ui5.oResponse.PARAMS[paramKey]?.CHECK_UPDATE_MODEL) {` && |\n| &&
|
||||
` let model = new JSONModel(z2ui5.oResponse.OVIEWMODEL);` && |\n| &&
|
||||
` if (oView) {` && |\n| &&
|
||||
` oView.setModel(model);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` async checkSDKcompatibility(err) {` && |\n| &&
|
||||
` let oCurrentVersionInfo = await VersionInfo.load();` && |\n| &&
|
||||
` var ui5_sdk = oCurrentVersionInfo.gav.includes('com.sap.ui5') ? true : false;` && |\n| &&
|
||||
` if (!ui5_sdk) {` && |\n| &&
|
||||
` if (err) {` && |\n| &&
|
||||
` MessageBox.error("openui5 SDK is loaded, module: " + err._modules + " is not availabe in openui5");` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ;MessageBox.error(err.toLocaleString());` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` showMessage(msgType, params) {` && |\n| &&
|
||||
` if (params == undefined) {` && |\n| &&
|
||||
` return;` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` if (params[msgType]?.TEXT !== undefined) {` && |\n| &&
|
||||
` if (msgType === 'S_MSG_TOAST') {` && |\n| &&
|
||||
` MessageToast.show(params[msgType].TEXT, {` && |\n| &&
|
||||
` duration: params[msgType].DURATION ? parseInt(params[msgType].DURATION) : 3000,` && |\n| &&
|
||||
` width: params[msgType].WIDTH ? params[msgType].WIDTH : '15em',` && |\n| &&
|
||||
` onClose: params[msgType].ONCLOSE ? params[msgType].ONCLOSE : null,` && |\n| &&
|
||||
` autoClose: params[msgType].AUTOCLOSE ? true : false,` && |\n| &&
|
||||
` animationTimingFunction: params[msgType].ANIMATIONTIMINGFUNCTION ? params[msgType].ANIMATIONTIMINGFUNCTION : 'ease',` && |\n| &&
|
||||
` animationDuration: params[msgType].ANIMATIONDURATION ? parseInt(params[msgType].ANIMATIONDURATION) : 1000,` && |\n| &&
|
||||
` closeonBrowserNavigation: params[msgType].CLOSEONBROWSERNAVIGATION ? true : false` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` if (params[msgType].CLASS) {` && |\n| &&
|
||||
` let mtoast = {};` && |\n| &&
|
||||
` mtoast = document.getElementsByClassName("sapMMessageToast")[0];` && |\n| &&
|
||||
` if (mtoast) {` && |\n| &&
|
||||
` mtoast.classList.add(params[msgType].CLASS);` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` ;` && |\n| &&
|
||||
` } else if (msgType === 'S_MSG_BOX') {` && |\n| &&
|
||||
` if (params[msgType].TYPE) {` && |\n| &&
|
||||
` MessageBox[params[msgType].TYPE](params[msgType].TEXT);` && |\n| &&
|
||||
` } else {` && |\n| &&
|
||||
` MessageBox.show(params[msgType].TEXT, {` && |\n| &&
|
||||
` styleClass: params[msgType].STYLECLASS ? params[msgType].STYLECLASS : '',` && |\n| &&
|
||||
` title: params[msgType].TITLE ? params[msgType].TITLE : '',` && |\n| &&
|
||||
` onClose: params[msgType].ONCLOSE ? Function("sAction", "return " + params[msgType].ONCLOSE) : null,` && |\n| &&
|
||||
` actions: params[msgType].ACTIONS ? params[msgType].ACTIONS : 'OK',` && |\n| &&
|
||||
` emphasizedAction: params[msgType].EMPHASIZEDACTION ? params[msgType].EMPHASIZEDACTION : 'OK',` && |\n| &&
|
||||
` initialFocus: params[msgType].INITIALFOCUS ? params[msgType].INITIALFOCUS : null,` && |\n| &&
|
||||
` textDirection: params[msgType].TEXTDIRECTION ? params[msgType].TEXTDIRECTION : 'Inherit',` && |\n| &&
|
||||
` icon: params[msgType].ICON ? params[msgType].ICON : 'NONE',` && |\n| &&
|
||||
` details: params[msgType].DETAILS ? params[msgType].DETAILS : '',` && |\n| &&
|
||||
` closeOnNavigation: params[msgType].CLOSEONNAVIGATION ? true : false` && |\n| &&
|
||||
` })` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` setApp(oApp) {` && |\n| &&
|
||||
` this._oApp = oApp;` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` async displayView(xml, viewModel) {` && |\n| &&
|
||||
` let oview_model = new JSONModel(viewModel);` && |\n| &&
|
||||
` z2ui5.oView = await XMLView.create({` && |\n| &&
|
||||
` definition: xml,` && |\n| &&
|
||||
` models: oview_model,` && |\n| &&
|
||||
` controller: z2ui5.oController,` && |\n| &&
|
||||
` id: 'mainView',` && |\n| &&
|
||||
` preprocessors: {` && |\n| &&
|
||||
` xml: {` && |\n| &&
|
||||
` models: {` && |\n| &&
|
||||
` template: oview_model` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` }` && |\n| &&
|
||||
` });` && |\n| &&
|
||||
` z2ui5.oView.setModel(z2ui5.oDeviceModel, "device");` && |\n| &&
|
||||
` this._oApp.removeAllPages();` && |\n| &&
|
||||
` this._oApp.insertPage(z2ui5.oView);` && |\n| &&
|
||||
` },` && |\n| &&
|
||||
` })` && |\n| &&
|
||||
`});` && |\n| &&
|
||||
``.
|
||||
|
||||
ENDMETHOD.
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<VSEOCLASS>
|
||||
<CLSNAME>Z2UI5_CL_APP_VIEW1_JS</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>Z2UI5_CL_APP_VIEW1_JS</DESCRIPT>
|
||||
<DESCRIPT>Z2UI5_CL_APP_VIEW1_JS (generated)</DESCRIPT>
|
||||
<STATE>1</STATE>
|
||||
<CLSCCINCL>X</CLSCCINCL>
|
||||
<FIXPT>X</FIXPT>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CLASS z2ui5_cl_app_View1_xml DEFINITION
|
||||
CLASS z2ui5_cl_app_view1_xml DEFINITION
|
||||
PUBLIC
|
||||
FINAL
|
||||
CREATE PUBLIC .
|
||||
|
@ -14,11 +14,11 @@ CLASS z2ui5_cl_app_View1_xml DEFINITION
|
|||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS z2ui5_cl_app_View1_xml IMPLEMENTATION.
|
||||
CLASS z2ui5_cl_app_view1_xml IMPLEMENTATION.
|
||||
|
||||
METHOD get.
|
||||
|
||||
result = `<mvc:View controllerName="z2ui5.controller.View1"` &&
|
||||
result = `<mvc:View controllerName="z2ui5.controller.View1"` &&
|
||||
` xmlns:mvc="sap.ui.core.mvc" displayBlock="true"` &&
|
||||
` xmlns="sap.m">` &&
|
||||
`</mvc:View>` &&
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<VSEOCLASS>
|
||||
<CLSNAME>Z2UI5_CL_APP_VIEW1_XML</CLSNAME>
|
||||
<LANGU>E</LANGU>
|
||||
<DESCRIPT>Z2UI5_CL_APP_VIEW1_XML</DESCRIPT>
|
||||
<DESCRIPT>Z2UI5_CL_APP_VIEW1_XML (generated)</DESCRIPT>
|
||||
<STATE>1</STATE>
|
||||
<CLSCCINCL>X</CLSCCINCL>
|
||||
<FIXPT>X</FIXPT>
|
||||
|
|
Loading…
Reference in New Issue
Block a user