Members
(constant) Config
Config contains config settings for user and test environments. The GlobalContext object determines which configuration to use at runtime. It will always select the 'user' config, except when process.env.NODE_ENV=test.
- Source:
(constant) Constants
Constants used throughout DART.
- Source:
(constant) OPTS
These are the options we pass to readdirp.
(constant) pluginTypes
pluginTypes describe the types of DART plugins.
- FormatReader reads files of a specific format. For example, TarReader reads tar files and FileSystemReader reads files directly from the file system.
- FormatWriter writes files in a specific format. For example, TarReader writes tar files and FileSystemReader writes files directly to the file system.
- NetworkClient sends (and possibly retrieves) files across a network. For example, S3Client can upload files to any service that implements the S3 REST API. FTPClient (when someone writes it) can upload files to an FTP server.
- Repository services can query different types of repositories. For example, an APTrust repository plugin can tell you the status of objects uploaded to APTrust. A Fedora plugin (if someone writes one) could do the same by talking to a Fedora REST service.
- Source:
(constant) tagsSetBySystem :Array.<string>
This is a list of BagIt tags that the system sets internally when it creates a bag.
- Source:
(constant) titleTags
This is a list of BagItProfile tags to check to try to find a meaningful title for this job. DART checks them in order and returns the first one that has a non-empty user-defined value.
- Source:
(constant) UIConstants
UIConstants define some commonly used FontAwesome icons.
- Source:
Methods
getLocale() → {string}
getLocale returns the user's current locale, or "en-US" if DART has no matching file for the user's actual locale.
This fixes bug https:* github.com/APTrust/dart/issues/516
This is actually a bug in y18n, which does not correctly fall back to language-only files. Creating file locales/en.json should cause any English locale to fall back to en.json if it doesn't have a specific territory file like en-IE or en-GB. However, in testing, fallback never works. Note that the os-locale package normalizes all locales to use dashes instead of underscores. So if system says locale is en_NZ, os-locale reports en-NZ.
Anyhoo, since resetting the locale using y18n.setLocale() does not load the specified locale file as expected, we have to set this right from the get-go.
When DART gets non-English translation files, we'll have to revisit this.
- Source:
loadBuiltInProfiles()
Load APTrust and DPN profiles in the local BagItProfile database if they are not already there.
- Source:
run()
Migration 20190130T190816Z adds the built-in BagIt profile for APTrust to the user's local BagItProfile database.
- Source:
run()
Migration 20190523194657Z adds the AppSetting "Bagging Directory", which is required for bagging. This tells DART where to put the bags it creates.
Note: This changes in a the migration of 2022-06-07, per user request. https://github.com/APTrust/dart/issues/520
- Source:
run()
Migration 20190523194657Z updates the APTrust BagIt profile to include manifestsAllowed and tagManifestsAllowed.
- Source:
run()
Migration 20200227T120404Z.js adds an empty BagIt profile.
- Source:
run()
Migration 20190130T190816Z removes the DPN BagIt profile. See https://github.com/APTrust/dart/issues/224
- Source:
run()
Migration 20200227T120404Z.js adds the BTR BagIt profile.
- Source:
run()
Migration 20200311T145456Z.js fixes the empty BagIt profile added in an earlier migration. This repaired empty profile:
- does not require any specific manifest algorithm
- does not require serialization
- permits additional serialization formats
- allows fetch.txt
- Source:
run()
Migration 20220429T182345Z.js fixes the BTR BagIt profile added in an earlier migration. This repaired profile includes a corrected BagIt-Profile-Info section.
- Source:
run()
Migration 20220607T12003744Z updates the AppSetting "Bagging Directory" so it's no longer hidden. This is per request in https://github.com/APTrust/dart/issues/520
- Source:
runAll()
This runs all migrations in the migrations directory.
Migrations allow us to add, remove, or change application settings, move and transform data and data structures, etc.
Each migration must export a function called 'run', and it will be run at startup.
Migrations will be run in order (0001.js, 0002.js, etc.) and run() will ALWAYS be called at startup. The run function should check an internal var called 'Migration_0001' (or whatver its name is) and should not re-run itself if it's been run before.
- Source:
tagsByFileAndName()
Sort tags by the label used in the Job metadata display.
- Source:
Type Definitions
filterFunction() → {boolean}
PersistentObjectFilter is a simple function for filtering object lists. It should take a single object as a parameter and return either true or false to indicate whether the object passes the filter.
Parameters:
Type | Description |
---|---|
Object |
- Source:
Example
function nameAndTitleFilter(obj) {
return obj.name.startsWith('A') && (obj.title === 'developer' || obj.title === 'manager');
}
PluginDefinition :Object
PluginDefinition contains information about what capabilities a plugin provides.
Properties:
Name | Type | Description |
---|---|---|
id |
string |
A UUID in string format that uniquely identifies this plugin. |
name |
string |
The name of this plugin. |
description |
string |
A human-readable description of this plugin. |
version |
string |
The version number of this plugin. E.g. 1.44 |
readsFormats |
Array.<string> |
The file extensions of the types of files this plugin can read. This applies only to plugins of type FormatReader. For example, a tar reader plugin may be able to read types ['.tar', '.tar.gz', '.tgz']. If your plugin is not a FormatReader, this property should be an empty array. Use all lowercase letters. |
writesFormats |
Array.<string> |
The file extensions of the types of files this plugin can write. This applies only to plugins of type FormatWriter. For example, a tar writer plugin may be able to read types ['.tar', '.tar.gz', '.tgz']. If your plugin is not a FormatWriter, this property should be an empty array. Use all lowercase letters. |
implementsProtocols |
Array.<string> |
The network protocols that this plugin implements. For example, an FTP plugin may implement ['ftp', 'sftp', 'ftps']. This applies only to plugins of type NetworkClient. If your plugin is not a NetworkClient, this should be an empty list. Use all lowercase letters. |
talksToRepository |
Array.<string> |
This describes what type of repository your plugin talks to. For example, 'fedora', 'aptrust', etc. This applies only to plugins of type Repository. If your plugin is not a Repository plugin, this should be empty. Use all lowercase letters. |
- Source: