oo

Instance Settings YAML Configuration Reference

You can use an instance settings client extension to configure a wide variety of Liferay configurations. Each configuration is referenced by its PID (Persistent IDentity).

Use the client-extension.yaml file to define an instance settings client extension.

Usage Details

This client-extension.yaml file defines an instance settings client extension:

yoke-instance-settings:
    type: instanceSettings

YAML Properties

These properties are specific to instance settings client extensions:

| Name | Data Type | Default Value | Description | |:-|:-|:-|:-| | description | String | | The client extension’s description. | | name | String | (Derived) | The client extension’s name. | | pid | String | | The PID (Persistent IDentity) of the configured instance setting (from the currently supported instance settings PIDs.) |

Additional Properties

Instance settings client extensions are accompanied by additional properties which are defined by the schema for the PID (a Java class).

The schema PID is defined in the annotation property @Meta.OCD.id:

@Meta.OCD(
	id = "com.liferay.foo.FooConfiguration"
)

Configure this property in a client extension definition like this:

yoke-instance-settings:
    pid: com.liferay.foo.FooConfiguration
    type: instanceSettings

Below are examples of the types of properties in the schema classes and how to include them in the client extension definition.

Scalar Properties

Given the scalar schema property definition below, in this case an int (integer),

@Meta.AD(...)
public int invitationTokenExpirationTime();

Configure the invitationTokenExpirationTime client extension property as a scalar YAML property:

yoke-instance-settings:
    invitationTokenExpirationTime: 600
    pid: com.liferay.foo.FooConfiguration
    type: instanceSettings

Scalar properties include these data types:

  • int (integer)
  • short
  • long
  • byte
  • float (decimal number)
  • double (double-precision decimal number)
  • character
  • boolean
  • String

Array Property Example

Given the array schema property definition below,

@Meta.AD(...)
public String[] customTLDs();

Configure the customTLDs client extension property as a YAML array:

yoke-instance-settings:
    customTLDs:
        - "foo.net"
        - "*.other.com"
    pid: com.liferay.foo.FooConfiguration
    type: instanceSettings

LocalizedValuesMap Property Example

Given the LocalizedValuesMap schema property definition below,

@Meta.AD(...)
public LocalizedValuesMap invitationEmailBody();

Configure the invitationEmailBody client extension property as a YAML object, where each object key is a specific locale string:

yoke-instance-settings:
    invitationEmailBody:
        en_US: |
            <p>
                Follow the link below to set up your account:<br />
                <a href="[$CREATE_ACCOUNT_URL$]">Create Account</a>
                <br />
                <font size="-2">The link will expire after 3 days.</font>
            </p>
    pid: com.liferay.foo.FooConfiguration
    type: instanceSettings

Currently Supported Instance settings PIDs

Here are all of the PIDs that you can reference in an instance setting client extension, scoped by virtual instance or by site.

Virtual Instance Scoped PIDs:

These PIDs allow for the configuration of virtual instance-scoped settings.

Site Scoped PIDs:

These PIDs allow for the configuration of site-scoped settings.

Specifying site settings in this bare form sets the default for all sites in the virtual instance.