Using an extension to host JavaScript

Extensions can be used to host CustomControl and PageModule JavaScript.

Creating an extension

Extensions are defined in a spec.json file that is contained in the root of the extension archive file. The contents of this file are not important since the extension will simply contain JavaScript. The only value that needs to be filled in is the name property which is used to reference the JavaScript files contained in the extension.

Sample spec.json
{
	"name": "ExtensionName",
	"extensions": [
		{
			"perspective": "common",
			"features": [
				{
					"id" : "Report JS"
				}
			]
		}
	]
}

Arrange your code in a directory structure like so:

/ExtensionName/
	spec.json
	module1.js
	module2.js
	...

Use zip to create ExtensionName.zip from the ExtensionName directory.

Uploading an extension

  1. Click "Manage"

  2. Click "Customization"

  3. Click the "Extensions" tab and then click the "Upload extension" button. Select the extension zip file in the dialog that appears.

  4. The uploaded extension will appear in the list and the modules contained inside will be accessible using the URL prefix v1/ext/ExtensionName/

  5. Example of referencing "module1" in extension "ExtensionName"