Defining a synthetic enum property

This topic will explain how to create an enum kind property fully in synthetic.xml. In previous versions of the product(s) you needed to have a compiled Java Enum class on the classpath to define the values of the enumeration. Now you can add the following properties to the synthetic.xml file of your plugins / extensions:

<type ...>
  <property name="myEnum" kind="enum">

Now the UI will show a drop-down box with a choice of value-1 and value-2. And it will automatically be validated that the value entered is one of the choices.

Define Dynamic UI Fields Based on the Value of an enum Property

The following example synthetic.xml shows how we can further restrict enum values of an existing enum property and show only a subset of all properties (i.e. show only properties associated with selected enum value):

<type-modification type="some.Server">
    <property name="authenticationMethod" kind="enum"
              hidden="false" default="None">
            Use enum-values to additionally restrict possible authentication methods
            from [None, Basic, Ntlm, PAT, Oauth2] to [None, Basic, NTLM].

         Define hidden property with the name in the format `<enum_property_name>_DependentProperties`.
         It maps certain enum values to property fields that will be displayed when that value is selected.
         Other properties with the same category (in the example: `Authentication`) will be hidden.
    <property name="authenticationMethod_DependentProperties"
              default="Basic:username;password,PAT:apiToken" />