Helix Core Extensions Developer Guide (2019.1)

Class Helix.Core.Server

Class methods

GetArchDirFileName(string) -> string

Gets the path to a file under the server extension archive directory.

Returns the path to the file in the server extension’s unpacked archive directory. This path is relative to the server.extensions.dir configurable.

GetArchiveFileInfo() -> string, number, string, number, string

Get information about the current file in the Archive() event

Returns:

string number string number string
name of the file the revision number of the file file type size of file digest of file

GetDataDirFileName(string) -> string

Gets the path to a file under the server extension data directory.

Returns:

Passed a file name argument, returns the path in which the server extension will store the files it creates.

GetGlobalConfigData() -> table

Gets the global config table.

Returns:

A table of the values the user provided when filling out the global server extension config.

GetInstanceConfigData() -> table

Gets the instance config table.

Returns:

A table of field names and sample values used during the instance configuration of an server extension. This should be information the server extension needs for this instance of itself. It is the responsibility of the server extension to validate and format this data. Field names must not contain whitespace.

GetVar(string) -> string

Returns:
The value of the requested server extension session variable. See Server extension session variables.

GlobalConfigFields() -> table

Gets the global configuration setup.

Returns:

A table of field names and sample values used during the global configuration of a server extension . This should be information the server extension needs for all instances of itself. It is the responsibility of the server extension to validate and format this data. Field names must not contain whitespace.

InstanceConfigFields() -> table

Gets the instance configuration setup

Returns:

A table of field names and sample values used during configuration of an instance of a server extension . This should be information the server extension needs to perform specific actions, such as the list of file paths to monitor. It is the responsibility of the server extension to validate and format this data. Field names must not contain whitespace.

InstanceConfigEvents() -> table

Server event registration. See Server extension callbacks.

Returns:

A table of events and parameters. The parameters are likely dependent on the data retrieved from the instance configuration.

log(table)

Accepts a table of user data and appends it to the log.json file in the server extension data directory as line-delimited JSON.

SetArchiveFileSys() -> FileSys

For archive server extensions, give the server a FileSys instance to use for accessing the archive content.

Returns:

The FileSys object.

SetClientMsg(string)

Sets the message to be sent to the user.