4 Hosting Custom Widgets
From a hosting point of view, a custom widget consists of two types of les: the custom widget JSON le
(explained in more detail in a later section) and the resource les.
The custom widget JSON le contains the metadata of a custom widget. It denes all the ingredients of a
custom widget and references its resource les by their URLs.
The resource les are all the les of the custom widget that make it work properly, for example, JavaScript les,
CSS les, HTML les, image les, and so on.
To host a custom widget, you need two locations on which these les are distributed:
● An SAP Analytics Cloud instance, on which you upload the custom widget JSON le of the custom widget
(see chapter Adding a Custom Widget to Analytics Designer [page 9]).
● An HTTP Web server with HTTPS enabled, on which you upload the resource les. The Web server acts as a
simple repository of the resource les. The resource les 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
les.
When a custom widget is rendered in a Web browser, the Custom Widget framework passes the URL of a
resource le referenced in the custom widget JSON to the browser. The browser requests that resource le
from the Web server. The Custom Widget framework poses no specic demands on the Web server in so far as
a resource le should simply be served to any browser that requests the resource le by the appropriate URL.
The Custom Widget framework doesn’t provide any authentication or authorization capabilities, session cookie
support, and so on.
The resource les of a custom widget are requested from the Web server both while creating an analytic
application containing this custom widget in analytics designer (design time) and while running the analytic
application containing this custom widget in the browser (runtime). Of course, any resource le 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 les 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.
Note
● The SAP Analytics Cloud instance never connects to the Web server to request resource les. It is
always the browser that requests resource les.
● When you save an analytic application in analytics designer on the SAP Analytics Cloud instance, only a
reference to the custom widget is saved with the analytic application. Specically, it is a reference to
the custom widget JSON of the custom widget on the SAP Analytics Cloud instance. Analytic
applications never store resource les of custom widgets with them.
6
PUBLIC
SAP Analytics Cloud Custom Widget Developer Guide
Hosting Custom Widgets