Projects in StatWrap are collections of resources that are loosely grouped together.
The project list is something specific to the user of StatWrap. This is their personal collection of projects that they are interested in, and we do not anticipate that this list is something that is going to be shared with other users. As such, the data collected in the project list will include preferences of the user (e.g., if a project is a favorite
), as well as actions taken by the user (e.g., lastAccessed
).
Note that the path
is also considered something specific to the user. While a project path could be shared - a URL, a shared file server - we also have local projects that might get shipped around. The path
attribute will capture where the root of the project exists for this user.
The list of projects will be stored in the user's application data folder, in a file named .statwrap-projects.json
. The application data directory will be found using Electron's app.getPath('userData')
.
Item | Type | Description |
---|---|---|
id |
String | A unique identifier (UUID) generated by StatWrap when you created your project |
name |
String | The descriptive name of the project. This will default to part of the path where the project is located |
favorite |
bool | Has the user flagged this as one of their favorite projects. |
lastAccessed |
Date/Time[1] | The last date and time that the project was refreshed by the user within StatWrap. Used to populate the list of recent projects, and track recent changes the user may not have seen. |
path |
String | This will ideally be a URI that resolves to some location where the project contents are contained. StatWrap will assume this is a file path unless an explicit protocol is provided. Note that as of now, only file-based projects are supported. |
StatWrap approaches projects as having one higher-level container that serves as the base for the project. For most projects this will be a folder, but we will refer to it here as a "container" just to provide a more general name. Not everything must live in that container, it is just the unit of organization that StatTag uses. The project file then provides the metadata to describe the project, and can be shipped along with the project even if the recipient doesn't use StatWrap.
Note that for file-based assets, all paths will be stored relative to the project root. This will allow StatWrap to operate the same regardless of the exact URI for the root of the project. Internally, StatWrap will construct the fully qualified path when needed. When it converts paths to relative, it will normalize them to use POSIX separators (e.g., my\win\path would be my/win/path). Without this normalization, URI matching wouldn't work across OSes.
For each project, within the root of the project container, there will be a file called .statwrap-project.json
.
Item | Type | Description |
---|---|---|
formatVersion |
String | A version identifier for the format of the configuration file. This will help with backwards compatibility as changes to the format are made. |
id |
String | A unique identifier (UUID) generated by StatWrap when you created your project |
uri |
String | A URI to the root container. This is somewhat redundant, in that we need to know the path to get to the configuration file where this value is loaded, but it also provides an additional consistency check to detect if a project was moved. |
template |
Objecct | (Optional) If applicable, the StatWrap template that was used to create the project. If this is missing, null, or empty, it means we don't know what template was used to create the project - such as for an imported project. This object will contain id and version attributes. |
name |
String | The descriptive name of the project. This will default to part of the path where the project is located, but can be changed by the user. |
categories |
Array | An array of String values that represent the categories (tags) that have been assigned to the project |
assets |
Object | The root container asset as well as all children assets. The general structure of this object is documented in Assets |
description |
Object | An object that can contain description text (contentType = Markdown , content = {Description markdown} ), or a URI to an asset that contains the description (contentType = URI , uri = {Asset URI} ) |
notes |
Array | An array of Note Objects � |
people |
Array | An array of Person Objects � |
assetGroups |
Array | An array of Asset Group objects |
When StatWrap loads, it loads not just the list of the projects that the user has in their list, but it in turn iterates over every project and loads its configuration file.
Within each project configuration file StatWrap expects to find a collection of assets that it was previously aware of for the project. If this collection is not present or is empty, StatWrap will initialize it at that time by invoking AssetService.scan
[1] Date/Time types are Strings represented using the ISO 8601 Standard, e.g. "2020-04-21-T07:22Z"
.