dataDrivenConfigurator

Description

The base utils allowing the data driven approach on a configurator. Even though it is possible to directly use the methods of the dataDrivenConfigurator, it is usually necessary to extend its capabilities to suit specific business needs, which can be done via the dataDrivenConfiguratorExtension.

Members


<static> isInited :boolean

Description

Flag indicating whether the Data Driven Configurator has been fully initialized. This is set to true after all dependent components have completed their initialization.

Details
boolean

0.0.1

In this reference, under dataDrivenConfigurator:

In this reference, under dataDrivenConfiguratorExtension:

Methods


<static> setConfiguration( configurationObject [, options ] )

Description

Sets the desired configuration. This method is very similar to configurator’s native setConfiguration, but it has several limitations, among them:

  • It can only define a single attribute at a time using primitive or part reference.
  • It cannot assign multiple attributes in one call.
  • It cannot use metadata queries.
  • The use of custom ID has not been tested.

Since 0.3.3, this method accepts an options object to define how the configuration should be set.

Parameters
Name Type Attributes Default Description
configurationObject object

A configuration object containing the attributes to set and their values

options object <optional>

Options as how the configuration should be set. Since 0.3.3

Name Type Attributes Default Description
repercussionConfigPropagationMode dataDrivenConfigurator.repercussionConfigPropagationMode <optional>
async

The way the repercussion configuration object should be propagated.

repercussionConfigDelayedPropagationModeDelay dataDrivenConfigurator.repercussionConfigDelayedPropagationModeDelay <optional>
1

Delay in milliseconds to apply when repercussionConfigPropagationMode is set to 'delayed'.

Details

0.0.1

In this reference, under dataDrivenConfigurator:

In this reference, under dataDrivenConfiguratorExtension: In Threekit's documentation:


<static> forgetLastValueDefinedByUserForAttributes( attributes )

Description

Makes the data driven configurator forget about the values defined by the user and thus assign default values to the attributes rather than the ones previously defined.

Parameters
Name Type Default Description
attributes Array.<object>

The list of attributes for which data driven should forget previous user defined values. If null, the values of all attributes will be forgotten.

Details

0.2.3

In this reference, under dataDrivenConfiguratorExtension:


<static> simulateSetConfiguration()

Description

This method is very similar to dataDrivenConfigurator.setConfiguration, but it does not set any configuration on the actual configurator:

  • It does not propagate the desired configuration.
  • It does not propagate any repercussion configuration.
Its purpose is to have the data driven configurator compute the status of the attributes, to allow gathering information about the current configuration, without actually setting it on the configurator. It is important to make sure to revert back to the initial configuration after using this method, as it will not be reverted automatically.
Details

0.0.29

In this reference, under dataDrivenConfigurator:

In this reference, under dataDrivenConfiguratorExtension:


<static> unload()

Description

Unloads everything related to the data driven.
If used in addition to the player’s native unload, the data driven code’s one should be called first.

Examples

			window.dataDrivenConfigurator.unload();
			player.unload();
Details

0.0.29

In this reference, under dataDrivenConfiguratorExtension:

In Threekit's documentation:


<static> getStatus() → {dataDrivenConfigurator.attributesStatus}

Description

Returns an object representing the status of the attributes and their values to be used to build and update a UI interacting with the configurator.

Details

0.0.1

In this reference, under dataDrivenConfiguratorExtension:

Type Definitions


repercussionConfigPropagationMode

Description

An string defining how the repercussion configuration object should be propagated.

Possible values:

  • delayed: data driven’s "setConfiguration" will await after the native "setConfiguration" is done and then return immediately without waiting for the repercussionConfig that is sent immediately after via a setTimeout.
  • async: data driven’s "setConfiguration" will await after the native "setConfiguration" is done and then return right after sending the repercussionConfig, without waiting for it to be done..
  • sync: data driven’s "setConfiguration" will await after the native "setConfiguration" is done and will also await the repercussionConfig to be done.
Details
string

0.0.1

In this reference, under dataDrivenConfigurator:


repercussionConfigDelayedPropagationModeDelay

Description

An number defining the delay, in milliseconds, after which the repercussion configuration object should be propagated.
Taken into account only when dataDrivenConfigurator.repercussionConfigPropagationMode is set to delayed.

Details
number

1

0.3.3

In this reference, under dataDrivenConfigurator:


attributesStatus

Description

An object representing the status of the attributes and their values, with other potential informations.

Properties
Name Type Attributes Description
validAttributesAndTheirValues Array.<object>

The list of all valid attributes, in the right order, each of them having the list of all the available values, one of them being indicated as selected.

attributes object

Keys for the propagated attributes, as defined in the _dataDrivenConfigurator_propagatedAttributeSorting metadata (for descriptive data) or defered once _dataDrivenConfigurator_skuHeaders metatada is defined (for exhaustive data), otherwise, will be empty.

skus object <optional>

All valid skus for the current configuration. This object is fed with a pair of key/value for each column listed in the _dataDrivenConfigurator_skuHeaders metadata. If that metadata is not set at all, the skus object will not be present.

Details
object

0.0.1

In this reference, under dataDrivenConfigurator:

In this reference, under dataDrivenConfiguratorExtension: In this reference, under metadata:

Events


dataDrivenConfiguratorIsInited

Description

Fired when the Data Driven Configurator has inited.

Properties
Name Type Description
detail object

A holder.

Name Type Description
version string

The version of the Data Driven Configurator code that has been inited.

Details
object

0.2.3

In this reference, under dataDrivenConfigurator:

In this reference, under dataDrivenConfiguratorExtension: