ARDI User Content Framework

The User Content Framework (or UCF) is a common pattern found in a number of ARDI addons, including our Reporting, Infographics and Function addons.

It's a very basic method of providing custom content in an ARDI addon.

The Base Folder

In any UCF-based addon, you add new items (be they reports, displays or API functions), you'll have a base folder.

Normally, this will be found in your ARDI site folder, along side all of your media-files and settings.

The actual folder name will vary depending on the addon, but you'll find a couple of examples below…

AddonFolder Name
ReportListReports
InfographicsDisplays
FunctionListFunctions

As an example, if you installed ARDI onto a Windows system in C:\ARDI, you'll find the reports for the 'default' database at…

 C:\ARDI\web\sites\default\reports

Content In Each Folder

Under that folder, you'll find any shared resource files (ie. Python libraries, images, settings etc.).

You'll also find a sub-folder for each piece of content you add to the system. For example, the Reporting addon will have a folder for every report, the Infographics addon will have a folder for every display.

Although they are technically supported, for compatibility reasons we suggest that the folder names don't contain any spaces and are lower-case. This helps avoid issues should an ARDI server ever migrate from Windows to Linux platforms.

Note: Sub-folders with a leading underscore (_) symbol are ignored.

Identification

Inside the folder for each item is an info.txt or info.json file that describes the specific piece of content.

At a minimum, this file will include the name of the content (ie. the human-readable name of the report or display) and the folder it should appear in when users browse through the user-interface.

In many cases, you can split your content into sub-folders using the '/' character.

You can also assign a single piece of content to multiple folders by using a vertical bar (|) to split different folder names.

For example…

 Daily Reports

The content appears in the 'Daily Reports' folder

 Daily Reports/Technical

The content appears in the 'Technical' folder, which is inside 'Daily Reports'

  Daily Reports|Control Reports

The content appears in both the 'Daily Reports' folder and the 'Control Reports' folder.

Content

Along-side the info file, put the content itself. This type of content varies depending on the addon - Infographics will usually require a Javascript file called generate.js, reports will have a Python script called report.py.

Why Use This System

At first glance, this system seems very basic. And you'd be right.

But this was a deliberate choice. By being very simple, it's extremely flexible and highly compatible with a range of hardware, software and workflow options.

Advantages include…

  • No special infrastructure (databases, services, etc) are required,
  • Content can be created in a wide variety of simple tools,
  • Editing can be performed via text-based methods such as SSH,
  • Content can be backed up along-side the rest of your ARDI database,
  • Content is compatible with a wide variety of version-management tools,
  • The folder location can be overridden, allowing you to share a common set of content on network drives or cloud-synced storage.