CLASS z2ui5_cl_cc_debug_tool DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. CLASS-METHODS get_js RETURNING VALUE(result) TYPE string. PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS z2ui5_cl_cc_debug_tool IMPLEMENTATION. METHOD get_js. result = `` && |\n| && `if (!z2ui5.DebuggingTools) { sap.ui.define( "z2ui5/DebuggingTools" ,[` && |\n| && ` "sap/ui/core/Control",` && |\n| && ` "sap/ui/core/Fragment",` && |\n| && ` "sap/ui/model/json/JSONModel"` && |\n| && `], (Control, Fragment, JSONModel) => {` && |\n| && ` "use strict";` && |\n| && |\n| && ` return Control.extend("project1.control.DebuggingTools", {` && |\n| && ` metadata: {` && |\n| && ` properties: {` && |\n| && ` checkLoggingActive: {` && |\n| && ` type: "boolean",` && |\n| && ` defaultValue: ""` && |\n| && ` }` && |\n| && ` },` && |\n| && ` events: {` && |\n| && ` "finished": {` && |\n| && ` allowPreventDefault: true,` && |\n| && ` parameters: {},` && |\n| && ` }` && |\n| && ` }` && |\n| && ` },` && |\n| && |\n| && ` async show() {` && |\n| && |\n| && ` var oFragmentController = {` && |\n| && ` prettifyXml: function (sourceXml) {` && |\n| && ` var xmlDoc = new DOMParser().parseFromString(sourceXml, 'application/xml');` && |\n| && ` // describes how we want to modify the XML - indent everything` && |\n| && ` var sParse = unescape( '%3Cxsl%3Astylesheet%20xmlns%3Axsl%3D%22http%3A//www.w3.org/1999/XSL/Transform%22%3E%0A%20%20%3Cxsl%3Astrip-space%20elements%3D%22*%22/%3E%0A%20%20%3Cxsl%3Atemplate%20match%3D%22para%5Bconten` && `t-style%5D%5Bnot%28text%28%29%29%5` && `D%22%3E%0A%20%20%20%20%3Cxsl%3Avalue-of%20select%3D%22normalize-space%28.%29%22/%3E%0A%20%20%3C/xsl%3Atemplate%3E%0A%20%20%3Cxsl%3Atemplate%20match%3D%22node%28%29%7C@*%22%3E%0A%20%20%20%20%3Cxsl%3Acopy%3E%3Cxsl%3Aapply-templates%20select%3D%22node` && `%28%29%7C@*%22/%3E%3C/xsl%3Acopy%3E%0A%20%20%3C/xsl%3Atemplate%3E%0A%20%20%3Cxsl%3Aoutput%20indent%3D%22yes%22/%3E%0A%3C/xsl%3Astylesheet%3E' )` && |\n| && ` var xsltDoc = new DOMParser().parseFromString(sParse , 'application/xml');` && |\n| && ` ` && |\n| && ` var xsltProcessor = new XSLTProcessor(); ` && |\n| && ` xsltProcessor.importStylesheet(xsltDoc);` && |\n| && ` var resultDoc = xsltProcessor.transformToDocument(xmlDoc);` && |\n| && ` var resultXml = new XMLSerializer().serializeToString(resultDoc);` && |\n| && ` return resultXml.replace(/>/g, ">");` && |\n| && ` },` && |\n| && ` onItemSelect: function (oEvent) {` && |\n| && ` let selItem = oEvent.getSource().getSelectedItem();` && |\n| && ` ` && |\n| && ` if (selItem == 'MODEL') {` && |\n| && ` this.displayEditor( oEvent, JSON.stringify( sap?.z2ui5?.oView?.getModel()?.getData(), null, 3) , 'json' );` && |\n| && ` return;` && |\n| && ` }` && |\n| && ` if (selItem == 'VIEW') {` && |\n| && ` if( sap?.z2ui5?.oView?.mProperties?.viewContent !== undefined ) {` && |\n| && ` this.displayEditor( oEvent, this.prettifyXml( sap?.z2ui5?.oView?.mProperties?.viewContent ) , 'xml', this.prettifyXml( sap?.z2ui5?.oView?._xContent.outerHTML) );` && |\n| && ` } else {` && |\n| && ` this.displayEditor( oEvent, this.prettifyXml( sap.z2ui5.responseData.S_FRONT.PARAMS.S_VIEW.XML ), 'xml', this.prettifyXml( sap?.z2ui5?.oView?._xContent.outerHTML) );` && |\n| && ` }` && |\n| && ` return;` && |\n| && ` }` && |\n| && ` if (selItem == 'PLAIN') {` && |\n| && ` this.displayEditor( oEvent, JSON.stringify(sap.z2ui5.responseData, null, 3) , 'json' );` && |\n| && ` return;` && |\n| && ` }` && |\n| && ` if (selItem == 'REQUEST') {` && |\n| && ` this.displayEditor( oEvent, JSON.stringify(sap.z2ui5.oBody, null, 3) , 'json' );` && |\n| && ` return;` && |\n| && ` }` && |\n| && ` if (selItem == 'POPUP') {` && |\n| && ` this.displayEditor( oEvent, this.prettifyXml( sap?.z2ui5?.oResponse?.PARAMS?.S_POPUP?.XML ) , 'xml' );` && |\n| && ` return;` && |\n| && ` }` && |\n| && ` if (selItem == 'POPUP_MODEL') {` && |\n| && ` this.displayEditor( oEvent, JSON.stringify( sap.z2ui5.oViewPopup.getModel().getData(), null, 3) , 'json' );` && |\n| && ` return;` && |\n| && ` }` && |\n| && ` if (selItem == 'POPOVER') {` && |\n| && ` this.displayEditor( oEvent, sap?.z2ui5?.oResponse?.PARAMS?.S_POPOVER?.XML , 'xml' );` && |\n| && ` return;` && |\n| && ` }` && |\n| && ` if (selItem == 'POPOVER_MODEL') {` && |\n| && ` this.displayEditor( oEvent, JSON.stringify( sap?.z2ui5?.oViewPopover?.getModel( )?.getData( ) , null, 3) , 'json' );` && |\n| && ` return;` && |\n| && ` }` && |\n| && ` if (selItem == 'NEST1') {` && |\n| && ` this.displayEditor( oEvent, this.prettifyXml( sap?.z2ui5?.oViewNest?.mProperties?.viewContent ) , 'xml' , this.prettifyXml( sap?.z2ui5?.oViewNest?._xContent.outerHTML) );` && |\n| && ` return;` && |\n| && ` }` && |\n| && ` if (selItem == 'NEST1_MODEL') {` && |\n| && ` this.displayEditor( oEvent, JSON.stringify( sap?.z2ui5?.oViewNest?.getModel( )?.getData( ) , null, 3) , 'json' );` && |\n| && ` return;` && |\n| && ` }` && |\n| && ` if (selItem == 'NEST2') {` && |\n| && ` this.displayEditor( oEvent, this.prettifyXml( sap?.z2ui5?.oViewNest2?.mProperties?.viewContent ) , 'xml' , this.prettifyXml( sap?.z2ui5?.oViewNest2?._xContent.outerHTML) );` && |\n| && ` return;` && |\n| && ` }` && |\n| && ` if (selItem == 'NEST2_MODEL') {` && |\n| && ` this.displayEditor( oEvent, JSON.stringify( sap?.z2ui5?.oViewNest2?.getModel( )?.getData( ) , null, 3) , 'json' );` && |\n| && ` return;` && |\n| && ` }` && |\n| && ` if (selItem == 'SOURCE') {` && |\n| && ` let content= oEvent.getSource().getParent().getItems()[1].getItems()[0].getProperty( "content");` && |\n| && ` let url = window.location.origin + "/sap/bc/adt/oo/classes/" + sap.z2ui5.responseData.S_FRONT.APP + "/source/main";` && |\n| && * ` content = '