Add search support in ContactManager for Guidewire core applications

Add code for the new InterpreterSpecialty field to the Gosu class ABContactAPISearchCriteria. This Gosu object is populated by the core application to pass a search criterion to ContactManager.

Before you begin

Complete Add search support to the ContactManager user interface.

About this task

For this example, the new field will be added to the search results that ContactManager sends back to the Guidewire core application. To add the field, you enter code for the field in the Gosu class ABContactAPISearchResult.

Procedure

  1. Add an entry for InterpreterSpecialty to the class ABContactAPISearchCriteria.
    1. In Guidewire Studio for ContactManager, navigate in the Project window to configuration > gsrc and then to gw.webservice.ab.ab1000.abcontactapi.
    2. Double-click ABContactAPISearchCriteria to open the class in the editor.
    3. Add the following variable definition to the list of variables at the beginning of the class.
      public var InterpreterSpecialty : String
    4. In the method toSearchCriteria, before :AllTagsRequired, add the following entry:
      :InterpreterSpecialty = this.InterpreterSpecialty,
  2. If you want the field to be added to the search results sent back to a Guidewire core application, add an entry for InterpreterSpecialty to the class ABContactAPISearchResult.
    1. Press Ctrl+N and enter ABContactAPISearchResult.
    2. Click the class with package gw.webservice.ab.ab1000.abcontactapi in the search results to open the class in the editor.
    3. Add the following variable definition to the list of variables at the beginning of the class.
      public var InterpreterSpecialty : String
    4. In the constructor construct(contact : ABContact), find the if statement block for ABPerson:
      if (contact typeis ABPerson) {
    5. After that if statement block, add a new if statement for ABInterpreter, as follows:
          // Search results for ABInterpreter
          if (contact typeis ABInterpreter) {
            this.InterpreterSpecialty = contact.InterpreterSpecialty
          }

What to do next

Configure the address book search interface in ContactManager