Create an implementation of the contact configuration plugin

Complete the step Creating entities that define the new subtypes before you perform this step.

Create an implementation of the IContactConfigPlugin interface based on ContactConfigPlugin.gs in the gw.plugin.contact.impl package. Your implementation maps the new AccountContactRole subtype to the new PolicyContactRole subtype.

Implement Contact Configuration plugin

Procedure

  1. In Studio, type CTRL+N, enter ContactConfigPlugin, and double-click to open gw.plugin.contact.impl.ContactConfigPlugin.
  2. Select all the text except for the package name in ContactConfigPlugin.gs and copy it to the clipboard.
  3. Navigate to the gw.plugin.contact.impl package in configuration > gsrc.
  4. Right-click impl and select New Gosu Class.
  5. In the New Gosu Class dialog, enter ContactConfigPlugin_mine in the Name field, then click OK.
  6. Remove the class declaration, then paste the contents of the clipboard at the end of the file.
  7. Change the class name from ContactConfigPlugin to ContactConfigPlugin_mine.
  8. Add the following code to protected property get DefaultConfigs:
    new ContactConfig(true, {TC_COMPANY, TC_PERSON}, typekey.AccountContactRole.get("AuditContact_Ext"),
                              {typekey.PolicyContactRole.get("PolicyAuditContact_Ext")})
    • The first argument indicates whether the contact type is enabled.
    • If you want the contact role to only be a person, then use {TC_PERSON}; or if only a company, use {TC_PERSON}.
    • The third and fourth arguments map AuditContact to PolicyAuditContact. If there are additional policy contact roles that map to AuditContact, add the roles to this line.
    • If you create a role that only exists at the account level, then omit the fourth argument.

What to do next

Update plugin registry

Update plugin registry

Before you begin

Implement Contact Configuration plugin

Procedure

  1. In Studio, navigate to configuration > config > Plugins > registry and open IContactConfigPlugin.gwp.
  2. In IContactConfigPlugin.gwp, in the Gosu Class field enter the name of your plugin. If you are following this example, the plugin name is ContactConfigPlugin_mine.

What to do next

Add display key and entity name