Skip to Content
avatar image
Former Member

How to load SAPUI5 App resources from Launch Pad (not HCP)

Hello,

I have my app deployed in HANA server and in the relative launch pad,

The app loads images and local resources from my project folders perfectly fine , when the app is launched from a direct url or in a web ide.

When the same is launched from fiori launch pad , to access the resources a different relative path is needed, it can be constructed by jQuery.sap.getModulePath("myAppName");

for example:

var sRootPath = jQuery.sap.getModulePath("myCustomApp");

var initConfigPath = sRootPath + "/res/config.json";


and then access that file the way you prefer (also a simple Ajax GET)
as answered here: https://archive.sap.com/discussions/message/16603498#16603498

But this approach does not work if the LaunchPad is served by an onPremise HANA server ( so not the Cloud version);
in this scenario URLs pointing to resources like CSS, contain some dynamic ID and look like:
http://sapgwgwq.myclientsociety.com:8080/sap/bc/ui5_ui5/sap/zhchappscockpit/~A806223978F756GNEBF537E84E553247~C/cmd/css/style.css

I am able to access my local resources using an URL like that, but hardcoding the ~A806223978F756GNEBF537E84E553247~C part

Is there a way to retrieve this generated string?

or at least, wich is the right way (that works every time for sure) to access local resources of any kind in every enviroment?

It should be an easy task of every web application, but I cannot find someone that knows how to do it in SAPUI5.

Please Help!!!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers