Minimum search criteria error messages

The ValidateABContactSearchCriteriaPluginImpl class extends ValidateABContactSearchCriteriaPluginBase. This class uses the TooLooseContactSearchCriteriaException message definitions to pass locale and country specific error messages to the calling application. In the base configuration, these messages are display keys in the display.properties file.

To see this file, open Guidewire Studio for ContactManager. Navigate in the Project window to configuration > config > Localizations > Resource Bundle 'display' and double-click display.properties to open this file in the editor.

In the file, if you press Ctrl+F and search for TooLooseContactSearchCriteriaException, you see the set of display keys defined for this exception. For example:

Java.TooLooseContactSearchCriteriaException.ABCompany.AU.ja_JP = 
  Please specify one of the following\: Name (phonetic), Name, Tax ID, Postcode, or City and State

The display keys are grouped first by entity type, ABCompany, ABContact, ABPerson, and ABPlace. In each set, there are display keys for the countries Australia (AU), Canada (CA), Germany (DE), France (FR), Great Britain (GB), Japan (JP), and the United States (US). For each country, there is a display key for one locale, ja_JP.

Note: You can add display keys for additional countries, locales, and entity types. If you add additional country or locale display keys, be sure to add them for all entity types, which in the base configuration are ABCompany, ABContact, ABPerson, and ABPlace.

This classification of messages enables ContactManager to return different contact search error messages based on country and locale. For example, a ClaimCenter user searches for a MedicalCareOrg, a Company subtype, located in the United States. The user has previously set the locale to ja_JP (Japan). ContactManager determines that there are not enough search criteria to find a company in that country and locale, and sends an exception message defined by the following display key:

Java.TooLooseContactSearchCriteriaException.ABCompany.US.ja_JP = 
  Please specify one of the following\: Name (phonetic), Name, Tax ID, Zip Code, or City and State
Note: Each entity has one display key that does not specify a country or locale. This display key is a default in case the country or locale is not specified. Additionally, the display keys that have only a country and no locale are the default display keys for all locales that are not defined. In the base configuration, the only locale for which a message is defined is ja_JP.