cancel
Showing results for 
Search instead for 
Did you mean: 

UI5 FLP/Shell-Plugin: Load custom libs and components dependencies

11-18-2020 12:15 PM
1508 views 3 comments
SAP Managed Tags
Subscribe

Hi Experts,

I created a shell plugin to add a button in the header of the Fiori Launchpad.

When I press this button, a popup opens. In this popup a container is rendered, which shows another "normal" UI5 application inplace.

In this plugin I use dependencies to other (custom) libraries and to the application to be displayed inplace.

In a normal UI5 application I define the dependencies in the manifest.json, so that when the app is initially loaded, the correct paths to the dependencies are resolved.

"dependencies": {
   "minUI5Version": "1.71",
    "libs": {
        "sap.ui.core": {},
        "sap.m": {},
        "my.custom.library": {}
    },
    "components" : {
        "my.custom.component": {}
    }
}

In case of a shell plugin, however, these seem to be unresolved. So when I want to access a resource, the SCP looks for this file in the wrong directory.

Log-dbg.js:456 2020-11-18 10:53:23.770090 failed to load 'my/custom/libray/library-preload.js' (failed to load 'my/custom/libray/library-preload.js' from https://sapui5.hana.ondemand.com/1.82.5/resources/my/custom/libray/library-preload.js: script load error), falling back to library-preload.json -  

The actual path should be the one defined in the Service Cockpit of the SCP:

/sap/fiori/mycustomlib/my/custom/libray/library-preload.js

As a workaround you can register these paths manually.

jQuery.sap.registerResourcePath("my/custom/libray", "/sap/fiori/mycustomlib"); 
jQuery.sap.registerResourcePath("my/custom/component", "/sap/fiori/mycustomcomp"); <br>

However, since we want to provide this plugin generically for the SCP and on-premise, this is unfortunately not a solution for us.

Has anyone here already had a similar problem?

Thanks!

Accepted Solutions (0)

Answers (0)