Skip to content

Alias Update

Antonia Elek edited this page Feb 4, 2020 · 6 revisions

Alias Update enables batch set or update of vault structure items' aliases. Aliases are generated from structure item names that are optionally transformed (eq. changed casing, remove non-alphanumeric characters etc).

For example, if using PascalCase name transformation, and name template Class.{ObjectType}.{Class}, class Other document will be assigned alias Class.Document.OtherDOcument.

M-Files structure elements that can be updated this way:

  • classes
  • object types
  • value lists
  • user groups
  • named access control lists
  • property definitions
  • workflows
  • workflow states
  • workflow transitions

Configuration

Configuration file defines which aliases will be updated and how. It consists of four main elements:

  • Vault defines M-Files connection parameters
  • AliasUpdateBehaviour defines how aliases will be updated for each item: whether any existing alias will be overwritten, or if the new alias will be appended to existing ones, or no alias will be added if any already exist for that item
  • AliasTemplates defines templates for alias name of each structure item type. These templates support placeholders that are dynamically resolved (optionally transformed) into structure item name.
  • ItemNameTransform defines how item name will be transformed in generated alias.

Below is an example configuration file that updates all aliases in Sample Vault on local M-Files server.

{
  "Vault": {
    "VaultName": "Sample Vault",
    "LoginType": "MFiles",
    "Username": "test",
    "Password": "test"
  },
  "ItemNameTransform": {
    "RemoveNonAlphaNumericChars": true,
    "RemoveWhiteSpace": true,
    "RemoveAccents": true,
    "Casing": "PascalCase"
  },
  "AliasUpdateBehaviour": "Overwrite",
  "AliasTemplates": {
    "Class": "Class.{Class}",
    "UserGroup": "UG.{UserGroup}",
    "ObjectType": "OT.{ObjectType}",
    "ValueList": "VL.{ValueList}",
    "PropertyDef": "PD.{PropertyDef}",
    "Workflow": "WF.{Workflow}",
    "State": "WS.{Workflow}.{State}",
    "StateTransition": "ST.{Workflow}.{StateTransition}",
    "NamedACL": "NACL.{NamedACL}"
  }
}

Each of the four configuration parts and their properties are further explained below.

Vault

Configuration part that defines connection to M-Files vault. Note that the login account used to connect to the vault should have administrative rights in order to be able to change aliases. Following properties are available.

Property Type Required Default Value
VaultName string Yes
LoginType one of:
MFiles
Windows
Yes MFiles
Domain string No
Username string No
Password string No
Protocol one of:
TcpIp
LocalProcedureCall
Spx
Https
No TcpIp
NetworkAddress string No localhost
Port int No 2266
LocalComputerName string No
EncryptedConnection bool No No

AliasUpdateBehaviour

Defines which aliases will be updated. One of Overwrite, Append, SetIfEmpty.

Overwrite is destructive behaviour, it will overwrite any existing aliases, Append will append generated alias to any existing (won't add duplicate alias if it already exists), whereas SetIfEmpty will set alias only if no other alias is already present for the given item.

AliasTemplates

Name templates for each structure item alias. Placeholders in these templates are dynamically resolved to each item name and then transformed using the rules in ItemNameTransform.

Property Type Required Available placeholders
Class string No {Class}
{ObjectType}
UserGroup string No {UserGroup}
ObjectType string No {ObjectType}
ValueList string No {ValueList}
PropertyDef string No {PropertyDef}
Workflow string No {Workflow}
State string No {Workflow}
{State}
StateTransition string No {Workflow}
{StateTransition}
NamedACL string No {NamedACL}

ItemNameTransform

Configuration part that defines how the item name will be transformed in generated alias.

Property Type Required
RemoveNonAlphaNumericChars bool Yes
RemoveWhiteSpace bool Yes
RemoveAccents bool Yes
Casing one of:
Original
UpperCase
LowerCase
PascalCase
CamelCase
HypenCase
SnakeCase
Yes
Clone this wiki locally
You can’t perform that action at this time.