Skip to main content

Interface: GlobalPropertyTemplateEditor

A class for interacting with Global Property Templates, in a very similar way to Bundles.

Extends​

Methods​

addEventListener()​

addEventListener<K>(event, listener): void

Add an event listener to be notified of changes to the editor state.

Type Parameters​

K​

K extends "conditional-global-properties-changed" | "global-properties-mandatory-changed"

Parameters​

event​

K

listener​

(event) => void

Returns​

void


getClient()​

getClient(): SpiffCommerceClient

Returns​

SpiffCommerceClient

Inherited from​

GlobalPropertyStateOwner.getClient


getGlobalProperties()​

getGlobalProperties(): Promise<GlobalPropertyHandle[]>

Get a handle to the global properties available within the connected template.

Returns​

Promise<GlobalPropertyHandle[]>


getGlobalPropertyConfiguration()​

getGlobalPropertyConfiguration(): GlobalPropertyConfiguration | undefined

Returns​

GlobalPropertyConfiguration | undefined

Inherited from​

GlobalPropertyStateOwner.getGlobalPropertyConfiguration


getGlobalPropertyStateManager()​

getGlobalPropertyStateManager(): GlobalPropertyStateManager

Returns​

GlobalPropertyStateManager

Inherited from​

GlobalPropertyStateOwner.getGlobalPropertyStateManager


getProductExperience()​

getProductExperience(handle): WorkflowExperience

Retrieves the WorkflowExperience for the provided runtime handle.

Parameters​

handle​

string

Returns​

WorkflowExperience


getWorkflowExperiences()​

getWorkflowExperiences(): WorkflowExperience[]

Returns​

WorkflowExperience[]

Inherited from​

GlobalPropertyStateOwner.getWorkflowExperiences


loadProduct()​

loadProduct(product, workflowId): Promise<string>

Loads a product into this editor, acting as a local-only WorkflowExperience.

Parameters​

product​

Product

workflowId​

string

Returns​

Promise<string>

an ID string that can be used for further interaction with this product via the editor.


removeEventListener()​

removeEventListener<K>(event, listener): void

Remove a previously added event listener from this editor.

Type Parameters​

K​

K extends "conditional-global-properties-changed" | "global-properties-mandatory-changed"

Parameters​

event​

K

listener​

(event) => void

Returns​

void


save()​

save(): Promise<void>

Applies the current state of the editor to the connected template.

Returns​

Promise<void>


selectProduct()​

selectProduct(handle): Promise<void>

Displays this product in the preview, removing any others that may be currently loaded.

Parameters​

handle​

string

The ID that was returned from GlobalPropertyTemplateEditor.loadProduct().

Returns​

Promise<void>


setAutoUpdateEnabled()​

setAutoUpdateEnabled(enabled): void

If you disable auto-updates, you must call GlobalPropertyTemplateEditor.save() to update the connected template.

Parameters​

enabled​

boolean

Returns​

void


setPreviewService()​

setPreviewService(previewService): Promise<void>

Updates the preview service used to display the currently selected product. If the editor already has a workflow experience, it will be injected if the preview service is valid.

Parameters​

previewService​

ThreeDPreviewService | undefined

Returns​

Promise<void>


unloadProduct()​

unloadProduct(handle): Promise<void>

Frees any data loaded via GlobalPropertyTemplateEditor.loadProduct().

Parameters​

handle​

string

The ID that was returned from GlobalPropertyTemplateEditor.loadProduct().

Returns​

Promise<void>