Defining customisations

Required

The DaSH 1.x DatastoreHelper class, providing static helper methods for customising datastore configurations, has been replaced with an IDatastoreConfigurator object. You need to make any calls to the DatastoreHelper methods on the configurator.

Optional

DaSH 2.0 introduces the concept of schemas when defining customisations. The migrated DatastoreHelper method calls can be performed as-is, with all customisations defined for the IConfigurableSchema.GLOBAL schema name. It is advisable to replace these calls with specific schema names, to allow more granular control over the datastore configuration.

All available methods include an option to define the schema name as the first parameter, e.g:

public IDatastoreConfigurator appendField(String storeName, CustomField field)
public IDatastoreConfigurator appendField(String schema, String storeName, CustomField field)

public IDatastoreConfigurator addConfiguration(String storeName, IMutableStore config)
public IDatastoreConfigurator addConfiguration(String schema, String storeName, IMutableStore config)

Additionally, customisation methods (adding new stores and references and modifying fields, references and store configurations) return the configurator object and therefore can be chained:

configurator
    .updateField(PnLDatastoreDescriptionConfig.SCHEMA, PNL_STORE_NAME, new CustomField(StoreFieldNames.TYPE).asKeyField())
    .insertField(PnLDatastoreDescriptionConfig.SCHEMA, PNL_STORE_NAME, DAILY, new CustomField(MONTHLY, ILiteralType.DOUBLE).asNullable())
    .insertField(PnLDatastoreDescriptionConfig.SCHEMA, PNL_STORE_NAME, MONTHLY, new CustomField(YEARLY, ILiteralType.DOUBLE).asNullable())
    .insertField(PnLDatastoreDescriptionConfig.SCHEMA, PNL_STORE_NAME, YEARLY, new CustomField(LIFETIME, ILiteralType.DOUBLE).asNullable());
search.js