Hosting Custom Widgets
From a hosting point of view, a custom widget consists of two types of files: the custom widget JSON file (explained in more detail in a later section) and the resource files.
The custom widget JSON file contains the metadata of a custom widget. It defines all the ingredients of a custom widget and references its resource files by their URLs. You need to upload the JSON file of your custom widget to SAP Analytics Cloud. For more information, refer to Uploading a Custom Widget to SAP Analytics Cloud.
The resource files are all the files of the custom widget that make it work properly, for example, JavaScript files, CSS files, HTML files, image files, and so on.
-
Your own HTTP Web server with HTTPS enabled.
The Web server acts as a simple repository of the resource files. The resource files are static, they aren’t processed or executed on the Web server. Recall that the custom widget JSON contains URL references that point to these resource files.
When a custom widget is rendered in a Web browser, the Custom Widget framework passes the URL of a resource file referenced in the custom widget JSON to the browser. The browser requests that resource file from the Web server. The Custom Widget framework poses no specific demands on the Web server in so far as a resource file should simply be served to any browser that requests the resource file by the appropriate URL. The Custom Widget framework doesn’t provide any authentication or authorization capabilities, session cookie support, and so on.
The resource files of a custom widget are requested from the Web server both when an analytic application or optimized story containing this custom widget is created (design time) and when the analytic application or optimized story containing this custom widget is viewed in the browser (runtime). Of course, any resource file related to the Builder and Styling Panel of a custom widget is requested only at design time.
The Web server can be either a public or a private (that is, company internal) Web server, as long as it serves the resource files as requested from a browser by the appropriate URL. A private Web server can be reached only from within the company and is useful for internal development of custom widgets. For internal development, you can run, for example, an Apache Web server or a node.js server with the module “http-server” on your local development system.
-
SAP Analytics Cloud.
To upload the resource files to SAP Analytics Cloud, you need to:-
In the JSON file, specify the file name beginning with a forward slash.
-
Compress your resource files to a ZIP file.
Then, after uploading the JSON file on SAP Analytics Cloud, a button Select File appears for you to upload your ZIP file.
-