AsyncSchemaLocationToSchemaExperienceResolverRegistrationApi

Type: Class

An API object to register schema experiences with for the asynchronous schema experience resolver.

Methods

Name Description
addOperations

Add Operations which then become globally available.

registrationApi.addOperations({
	exampleOperation: {
		label: "t__Example operation",
		steps: [
			{
				type: "operations/do-nothing"
			}
		]
	}
});

  Arguments
# Name Type Description
1. operationsByName Object<String | Operation>

The Operations to add, keyed by name.

addSchemaExperienceModule

Add a schema experience module which can then be used to add schema experience configuration.

Example: Add a new schema experience module which extends preexisting modules.

registrationApi.addSchemaExperienceModule('new-sx-module', ['base-sx-module', 'metadata-sx-module']);

  Arguments
# Name Type Description
1. moduleName String

The name for the new module.

2. dependencies Array<String>

The names of all schema experience modules to be extended by the new module, and/or to depend upon.

  Returns

Type: ModuleConfigurator

The new schema experience module.

defineAndRegisterSchemaExperience

Define and register a schema experience for a given schema and matching schema location(s).

Example: Define and register a schema experience using a new schema experience module which is bundled together with others in a schema experience (shell).

registrationApi.addSchemaExperienceModule('new-sx-module', ['base-sx-module', 'metadata-sx-module']);
registrationApi.addSchemaExperienceModule('recipe-sx-shell', ['new-sx-module', 'base-sx-module', 'metadata-sx-module']);
registrationApi.defineAndRegisterSchemaExperience(
	'assets/schemas/recipe-sx-shell.json',
	['urn:fontoxml:training:delicious:recipe.xsd']
	['recipe-sx-shell']
);

Example: Define and register a schema experience, combining a preexisting schema experience (shell) with a new schema experience module.

registrationApi.addSchemaExperienceModule('new-sx-module', ['base-sx-module', 'metadata-sx-module']);
registrationApi.defineAndRegisterSchemaExperience(
	'assets/schemas/preexisting-sx-shell.json',
	['urn:fontoxml:example:preexisting.xsd']
	['preexisting-sx-shell', 'new-sx-module']
);

  Arguments
# Name Type Description
1. schemaDataPath String

Path to the compiled schema for which the schema experience is defined, usually in the form of 'assets/schemas/example-sx-shell.json'.

2. schemaLocations Array<String>

Schema locations on which to apply the schema experience. See SchemaLocationToSchemaExperienceResolver for information on how documents are matched against schema locations.

3. moduleNames Array<String>

Names of modules on which to depend, usually a schema experience (shell) and/or schema experience modules.

Was this page helpful?