class WorkflowDefinitionExporter (View source)

Allows workflow definitions to be exported from one SilverStripe install, ready for import into another.

YAML is used for export as it's native to SilverStripe's config system and we're using WorkflowTemplate for some of the import-specific heavy lifting, which is already heavily predicated on YAML.

- If workflow-def is created badly, the "update template definition" logic, sometimes doesn't work

Traits

Provides extensions to this object to integrate it with standard config API methods.

Config options

export_filename_prefix string

The base filename of the file to the exported

Properties

protected Member $member
protected WorkflowDefinition $workflowDefinition

Methods

public static 
config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).

public
mixed
uninherited(string $name)

Gets the uninherited value for the given config option

public
void
__construct(number $definitionID)

No description

public
setMember(Member $member)

No description

public
getDefinition()

No description

public
string
export()

Runs the export

public
void
format(ArrayData $templateData)

Format the exported data as YAML.

public
number
getExportSize(string $str)

Returns the size of the current export in bytes.

public
ExportMetaData()

Generate template vars for metadata

public
sendFile(array $filedata)

Prompt the client for file download.

Details

static Config_ForClass config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).

Return Value

Config_ForClass

mixed uninherited(string $name)

Gets the uninherited value for the given config option

Parameters

string $name

Return Value

mixed

void __construct(number $definitionID)

No description

Parameters

number $definitionID

Return Value

void

setMember(Member $member)

No description

Parameters

Member $member

WorkflowDefinition getDefinition()

No description

Return Value

WorkflowDefinition

string export()

Runs the export

Return Value

string $template

Exceptions

Exception

void format(ArrayData $templateData)

Format the exported data as YAML.

Parameters

ArrayData $templateData

Return Value

void

number getExportSize(string $str)

Returns the size of the current export in bytes.

Used for pushing data to the browser to prompt for download

Parameters

string $str

Return Value

number $bytes

ArrayData ExportMetaData()

Generate template vars for metadata

Return Value

ArrayData

HTTPResponse sendFile(array $filedata)

Prompt the client for file download.

We're "overriding" SS_HTTPRequest::send_file() for more robust cross-browser support

Parameters

array $filedata

Return Value

HTTPResponse $response