Main Content

File Attachments in Modelscape Review Editor

This example shows how to attach files to reviews using the Review Editor app in the Modescape™ Review Environment (MRE).

You can attach documents to the Review Editor app. These documents include recommendations for improvement or evidence of model performance reports outside the Review Editor app. Use the app to attach files such as detailed model validation documents and scripts supporting such documents. By default, the Review Editor attaches the files to the project or model repository. You can also use the tools in the package to store the attachments in a network folder. This example explains how to use these tools, extend them, and customize them.


Use Custom Repositories

Attachments repositories are subclasses of the (abstract) base class. The constructor of a subclass must accept a Review object as input and implement the following methods:

  • upload — Upload selected file to the file repository.

  • exists — Check whether a file already exists in the repository.

  • download — Retrieve a file from the repository.

The implementation must be on the MATLAB path.

For an example, see the network folder repository:


Configure Attachment Repositories

Use MATLAB settings to point the MRE to the correct file repository class. Display the current active value of this setting.

s = settings;
ans = 

The default value is If your custom repository file, myRepository, is in the /+mre/+custom/ folder on the MATLAB path, then point the MRE to it. = "mre.custom.myRepository";

Querying the active value of the setting returns mre.custom.myRepository. Reset the the value of this setting. =;

Use Network Folder Repository

You can also define other MATLAB settings and use them for configuring project repositories. Review Editor contains a repository definition for storing attachments to a network folder. Use this repository.

s = settings; = "";

Set the network folder to which Review Editor must copy the files. To ensure each model gets a unique folder, this repository saves the files to a folder with the name //some/network/folder/name, where name is the string that the ModelName method of the Modelscape Review class returns. = "//some/network/folder/name";