NameFormatter class
PolicyCenter displays read-only name information in various screens. It uses class gw.name.NameFormatter to manage and format these read-only strings.
The NameFormatter class is used to convert
Contact names to strings for globalization. If you change, add,
or delete name columns of the Contact entity or its subentities,
you must also update this class.
NameFormatter to convert names
used in ABContact and subentities of ABContact to
strings for globalization.Additionally, if you add a new region definition, you might need to update the internalFormat method of this class, which uses fields defined in the NameOwnerFieldId class.
The class contains several different versions of the format method with different signatures, for example:
- The following version of the format method formats a name as
text and includes all fields that are used for the current region. This case is
the common one. This method has the following
signature:
public function format(name : ContactNameFields, delimiter : String) : String { _filter = \ fieldId : NameOwnerFieldId -> { return true } return internalFormat(name, delimiter) } - The following version of the format method formats a name as
text and includes only the specified set of fields from the current region. This
method has the following signature:
public function format(name : ContactNameFields, delimiter : String, fields : Set<NameOwnerFieldId>) : String { _filter = \ fieldId : NameOwnerFieldId -> { return fields.contains(fieldId) } return internalFormat(name, delimiter) }
The parameters for these methods have the following meanings:
|
Parameter |
Description |
|---|---|
|
name |
The |
|
delimiter |
The delimiter that separates elements of the name, typically
|
|
fields |
The set of |
PolicyCenter modal PCF file
The following PolicyCenter modal PCF file uses NameFormatter:
GlobalPersonNameInputSetsets the followingValuefor theNamefield:new gw.api.name.NameFormatter().format(nameOwner.PersonName, " ")
The following PolicyCenter Gosu class and Gosu enhancements call
NameFormatter:
gw.contact.AbstractContactResult.gs
gw.plugin.contact.impl.ContactEnhancement.gsx
gw.plugin.contact.impl.ContactKanjiEnhancement.gsx
The following PolicyCenter display names call
NameFormatter to return Contact names:
displaynames/CommercialDriver.enreturns:new NameFormatter().format( person, " ", NameOwnerFieldId.DISPLAY_NAME_FIELDS)displaynames/Company.enreturns:new NameFormatter().format(contact, " ")
displaynames/Contact.enreturns one of the following, based onContactsubtype:new NameFormatter().format( person, " ", NameOwnerFieldId.DISPLAY_NAME_FIELDS) new NameFormatter().format(contact, " ")displaynames/Place.enreturns:new NameFormatter().format(contact, " ")
displaynames/PolicyContactRole.enreturns one of the following, based onContactsubtype:new NameFormatter().format( person, " ", NameOwnerFieldId.DISPLAY_NAME_FIELDS) new NameFormatter().format(contact, " ")
ContactManager modal PCF file
The following ContactManager modal PCF file uses NameFormatter:
GlobalPersonNameInputSetsets the followingValuefor theNamefield:new gw.api.name.NameFormatter().format( nameOwner.PersonName, " ")
The following ContactManager display names call NameFormatter to
return ABContact names:
displaynames/ABCompany.enreturns:new NameFormatter().format(contact, " ")
displaynames/ABContact.enreturns one of the following, based onABContactsubtype:new NameFormatter().format( person, " ", NameOwnerFieldId.DISPLAY_NAME_FIELDS) new NameFormatter().format(contact, " ")displaynames/ABPlace.enreturns:new NameFormatter().format(contact, " ")
See also
