Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 3 Next »

The Supersede utility uses configurable rules to specify file superseding and archiving behaviour.

Example

  "Rules": [
    {
      "Pattern": "(?<SheetNumber>.+) - (?<SheetName>.+) \\((?<Revision>.+)\\)",
      "Extensions": [ ".pdf" ],
      "Supersede": {
        "Enabled": true,
        "MatchFields": ["SheetNumber"],
        "RevisionField": "Revision",
        "Mode": "Move",
        "Path": "Archived"
      }
    }
  ]

Pattern

A Rule specifies a single Pattern that will be used to match files. This pattern is a regular expression.

Extensions

A Rule may optionally specify a set of file extensions to be matched. If one or more Extensions are specified then the utility will first match files to the listed extensions and then attempt to match the specified Pattern to the part of the filename without the extension.

Supersede

The Supersede object specifies the configuration for matching and archiving superseded files. Some properties can be omitted from the configuration in order to inherit values from any applicable higher level configuration.

Enabled

Specifies whether superseding is enabled for this rule.

Enabled is optional, if it isn’t specified then it’s value will be determined from any applicable higher level configuration.

MatchFields

Specifies which named captures from the Pattern are used to find superseded files.

If no MatchFields are specified then all named captures present in the Pattern will be used. If the Pattern does not contain any named captures then the utility will be unable to match any superseded files.

RevisionField

Specifies which named capture from the Pattern will be interpreted as a Revision in order to determine which files are current. If RevisionField is not specified, the utility will look for a named capture with the name Revision or Rev.

Mode

Specifies what to do with superseded files.

Value

Meaning

Move

Moves superseded files to the specified Path

Delete

Deletes superseded files

Mode is optional, if it isn’t specified then it’s value will be determined from any applicable higher level configuration.

Path

Specifies the folder where superseded files should be moved when Mode is Move.

Path is optional, if it isn’t specified then it’s value will be determined from any applicable higher level configuration.

PathBase

Specifies how a relative Path will be resolved.

Value

Meaning

Default

Resolves a relative Path from the superseding file’s location

Config

Resolves a relative Path from the folder containing the .supersede-config file

PathBase is optional, if not present then Default will be used.

PathBase is only relevant in a folder specific .supersed-config file. It has no meaning in an application Supersede.json configuration file.

  • No labels