Configuring database search criteria in Gosu
In the base PolicyCenter configuration, Guidewire provides Gosu classes to configure database search for a number of entity types. The following table lists some entity types for which users can search and the Gosu classes that you modify to configure the user interface for that type of search.
|
Entity type to search |
Gosu search criteria class |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Guidewire also provides a Gosu enhancement that you can use to configure searches for Contact objects.
gw.plugin.Contact.ContactSearchCriteriaEnhancement.gsx
To improve contact search, Guidewire adds fields to the Contact entity as denormalization fields from the Address entity. These fields include:
CityDenormCountryPostalCodeDenormState
See also
Adding a new optional search field to a Gosu class search
To expand the search capabilities of a Gosu search criteria class with additional optional search criteria, you do the following general tasks:
- Declare the variable in the Gosu class definition file.
- Add a field in the PCF file that maps to that variable.
- Incorporate the variable into the query defined within the Gosu search object class definition file.
Add an optional search field to a Gosu class search
About this task
The following example adds a new field to the Activity Search PCF, and
then incorporates the field into the query in
ActivitySearchCriteria.
Procedure
- Open ActivitySearchCriteria.gs for editing in Guidewire Studio.
-
Navigate to the definitions of search criteria.
In the base configuration, these definitions look like the following lines.
var _policyNumber : String as PolicyNumber var _accountNumber : String as AccountNumber var _overdueNow : Boolean as OverdueNow var _activityStatus : ActivityStatus as SearchedActivityStatus var _priority : Priority as SearchedPriority var _assignedUser : User as SearchedAssignedUser -
Add the following line at the end of this list.
var _recurring : Boolean as Recurring -
Add a display key for the
Recurringfield label:- Navigate in the Project window to and double-click display.properties to open this file in the editor.
-
Find the display key entries that begin with
Web.ActivitySearch,and add the following line.Web.ActivitySearch.Recurring = Recurring
-
Add a widget for the new search field to the user interface.
-
Open
ActivitySearchDVfor editing in Studio. - Add an Input widget in the optional section directly under the Overdue Now field.
-
Enter the following values for this widget in the
Properties
area at the bottom of the screen.
editable
true
id
Recurring
label
displaykey.Web.ActivitySearch.Recurring
required
false
value
searchCriteria.Recurring
PolicyCenter defines variable
searchCriteriafor this PCF file under Required Variables. To see the definition of this variable, select the entire DetailViewPanel and then select the Required Variables tab. You see the following variable definition in the base configuration.name
searchCriteriatype
gw.activity.ActivitySearchCriteria -
Open
-
Add the new search field to the search query.
- Open ActivitySearchCriteria.gs for editing.
-
Add the following code to the list of
ifstatements in themakeQueryfunction.if (Recurring != null) { query.compare("Recurring",Equals , Recurring) }
- Stop and restart the application server.
-
If your installation does not include a recurring activity, create
one:
- Open a currently active policy.
- Select New Activity from the Actions menu, set Recurring to Yes, and redo the search.
-
Test your search screen by doing the following:
- Open PolicyCenter and navigate to the screen.
- Perform an activity search, setting Recurring to Yes.
Adding an optional search field to a virtual entity search
To expand the search capabilities of a virtual search entity type with additional optional search criteria, you need to do the following general tasks. In the following instructions, replace Entity with the entity type that you need to modify.
- Extend the EntitySearchCriteria object and add your search field to it as an extension column. For example, add a column to the Entity
SearchCriteriaextension (EntitySearchCriteria.etx). - Add widgets for the additional search criteria fields to the search screen PCF file.
- Modify Entity
SearchCriteriaEnhancement.gsxby adding the new search criteria.
The following table lists PolicyCenter files and tasks that you use in modifying a search that uses virtual entities.
File |
Task |
|---|---|
search-config.xml |
Add a |
EntitySearchScreen.pcf |
Examine the values of the following properties. These properties determine the classes and methods that you need to modify. SearchPanel: Properties criteriaName: searchCriteria searchCriteria: new EntitySearchCriteria() search: searchCriteria.performSearch() If the search screen supports multiple entity types, you see a range input widget similar to the following one. The value property determines the classes and methods that you need to modify. SearchFor: Properties value: searchCriteria.SearchObjectType This PCF file also contains fields for all searchable criteria. Add your new search fields to this file. |
EntitySearchCriteria.eti |
Base configuration data model definitions for standard fields on the EntitySearchCriteria object. You cannot modify this base configuration file. |
EntitySearchCriteria.etx |
Base configuration enhancement fields on the EntitySearchCriteria object. Modify this file and add your new search configuration criteria. |
Entity |
Modify the search method. |
