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

Properties

public static string $export_filename_prefix

The base filename of the file to the exported

protected Member $member
protected WorkflowDefinition $workflowDefinition

Methods

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

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

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

SS_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

SS_HTTPResponse $response