Relativity Review Extensions provide you with the ability to customize user workflows in the document viewer. The process for developing an extension includes completing these tasks:
Use the detailed instructions on this page to learn more about implementing custom extensions.
This page contains the following information:
A Review Extension must be associated a Relativity application:
Use existing application - if you already have a Relativity application, you can associate your extension with it. You don't need to create a new application.
Create new application - for detailed instructions, see Create an application in Relativity on the Relativity Developers site.
You define the custom behavior for a Relativity Extension in an extension script. The Review Interface application retrieves and parses the extension script at startup. It acts as the entry point to your custom Relativity extension. You can divide your extension into multiple assets, such as JavaScript, HTML, CSS, and image files.
See the following sections for information about creating a script:
Extension scripts are JavaScript files that meet the following requirements:
The Review Interface application exposes an IExtensionParameters object that your extension script can access through the params
object. Your extension script can use the properties on this object to dynamically determine whether to register an extension. See Conditionally Registering Extensions.
The following sample code illustrates the general format for an extension script but it doesn't perform any actions.
(function (params) {
var config = {
id: "examplecompany.testextension",
name: "Example Company Test Extension",
};
return config;
})(params);
When you want to test or deploy your extension script, you need to upload it to your Relativity application as a resource file. For more information, see Resource files on the Relativity Documentation site.
Extension scripts commonly require other static assets, such as images, fonts, CSS, HTML, and other JavaScript files.
Use one of the following methods to host static files so they are available to your Review extension:
Host static files in a Relativity custom page
If your Relativity application already has a custom page, you can include static files in it. The Relativity platform hosts these files making them available to your extension via HTTP at runtime.
Add static files as application resource files
If your Relativity application doesn't have a custom page, you can upload these static assets as resource files. Add the prefix review to their file names.
Uploading resource files with the review prefix automatically results in them being hosted at the following endpoint for access by your extension:
https://<host>/Relativity/RelativityApplicationWebResourceFile/<application_guid>/<application_version>/<file_name>
For example, a file called review.sample.json
added to an application with the GUID cd441ba7-7d47-4626-aaf2-ebbbb2843271
and the version 1.2.3.4
is accessible at this endpoint:
https://<host>/Relativity/RelativityApplicationWebResourceFile/cd441ba7-7d47-4626-aaf2-ebbbb2843271/1.2.3.4/review.sample.json
Use a defensive development approach when implementing a Relativity Review extension:
Consider how your extension interact with other Relativity Review extensions. Avoid modifying the URL to store information for your extension. Additionally, don't rely on the URL to use a particular format or to contain any specific data.
Implement your Relativity Review extension to be resilient even when other extensions don't follow best practices.