I have a custom library com.foo.library I would like to include as a dependency of a Fiori-like app I have built.
SAP Fiori Launchpad for Developers -> Best Practices for Launchpad Apps
Declare configuration information, like the location of icons, and library dependencies in the component.js configuration file
makes sense, adding my library as a dependency would look like
dependencies: {
libs: ["sap.m", "sap.ui.layout", "com.foo.library"],
components: []
},
with Fiori you have the constraint that you must use relative paths.
eg for my dependency to work it must be found at
/resources/com/foo/library
What are the steps for uploading a custom library into the ABAP SAPUI5 Repository and having it served with a relative path?
EDIT:
Currently i have the library loaded on Component.init using
sap.ui.getCore().loadLibrary("com.foo.library", "absolute path to library");
it works, however I want to set the library as a dependency
ComponentMetadata.prototype._loadDependencies = function() {
..
if (aLibraries) {
jQuery.each(aLibraries, function(i, sLib) {
jQuery.sap.log.info("Component "" + that.getName() +
sap.ui.getCore().loadLibrary(sLib);
});
}
from code above I can see there is no option to pass in a url when the component loads the library dependencies, so i am assuming that the library has to be found relative to the resources
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…