sap.ui.define([
"sap/ui/core/UIComponent",
"sap/ui/Device",
"launchpad/timeout/launchpadtimeout/model/models"
], function (UIComponent, Device, models) {
"use strict";
return UIComponent.extend("launchpad.timeout.launchpadtimeout.Component", {
metadata: {
manifest: "json"
},
/**
* The component is initialized by UI5 automatically during the startup of the app and calls the init method once.
* @public
* @override
*/
init: function () {
// call the base component's init function
UIComponent.prototype.init.apply(this, arguments);
// enable routing
this.getRouter().initialize();
// set the device model
this.setModel(models.createDeviceModel(), "device");
// make a request to the server every 15 minutes
setInterval(function () {
//Get the SAP Cloud Platform Sub-Account
var href = $(this).attr('origin');
var split1 = href.split("-"); // split by -
var secondSubString = split1[1]; // all characters AFTER the first -
var split2 = secondSubString.split("."); // split by .
var subAccount = split2[0]; // all characters BEFORE the first .
jQuery.ajax({
type: "HEAD",
cache: false,
crossDomain: true,
uri: "https://flpnwc-" + subAccount + ".dispatcher.hana.ondemand.com/sap/fiori/launchpadtimeout/Component-preload.js"
}).done(
function (result) {
jQuery.sap.log.debug("pingServer", "Successfully pinged the server to extend the session");
}
).fail(
function () {
jQuery.sap.log.error("pingServer", "failed to ping the server to extend the session");
}
);
}, 900000); //15 minutes
}
});
});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
10 | |
7 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |