Implementing QuickJumpCommandRef commands
To implement the QuickJumpCommandRef navigation
command type, subclass QuickJumpCommand
or one of its existing subclasses. See the following sections for details:
Subclass |
Section |
|---|---|
|
|
|
Navigation Commands with an Explicit Parameter (Including Search) |
|
|
|
All QuickJumpCommand
subclasses must define a constructor that takes a single parameter—the
command name—as a String.
Navigation commands with one or more static parameters
To perform simple navigation to a page
that accepts one or more parameters (which are always the same for a
given command), subclass StaticNavigationCommand.
The class constructor must call the super
constructor, which takes the following arguments:
- The command name (which you pass into your subclass's constructor)
- The target location's ID
Your subclass implementation must override the getLocationArgumentTypes and getLocationArguments methods to
provide the required parameters for the target location.
It is possible to create a no-parameter
implementation by subclassing StaticNavigationCommand.
However, Guidewire recommends that you use the StaticNavigationCommandRef command
type instead as it reduces the number of extraneous classes needed. See
Implementing StaticNavigationCommandRef commands for details.
Navigation commands with an explicit parameter (including search)
To create a command that performs simple
navigation to a page that accepts a single user parameter, subclass ParameterizedNavigationCommand.
The constructor takes the same two arguments as StaticNavigationCommand. Your
subclass must override the getParameterSuggestions
method, which provides the list of auto-complete suggestions for the
parameter. It must also override the getParameter
method, which creates or fetches the actual parameter object given the
user's final input.
Subclasses of ParameterizedNavigationCommand
must also implement getCommandDisplaySuffix.
PolicyCenter displays the command in the QuickJump box as part of the auto-complete list (before the user has entered the entire command). Therefore, PolicyCenter displays the command name followed by the command display suffix. This is typically some indication of what the parameter is, for example bean name or policy number.
Navigation commands with an inferred parameter
To implement a command that
navigates to a page that accepts a single parameter, with the parameter
based on the user's current location, subclass ContextualNavigationCommand. The
constructor takes the same two arguments as StaticNavigationCommand, plus
two additional arguments:
- The name of a PCF variable. If this variable exists on the user's current location, Guidewire Studio™ makes the command available and uses the value of the variable as the parameter to the target location.
- The type of the variable.
Guidewire recommends that you use the
ContextualNavigationCommandRef command type instead of
subclassing ContextualNavigationCommand. See Implementing ContextualNavigationCommandRef commands for details.
Navigation to an entity-viewing page
For commands that navigate to a page that simply displays information about some entity, subclass EntityViewCommand. The constructor takes the following arguments:
- The name of the command (which you pass into your subclass's constructor)
- The type of the entity
- A property on the entity to use in matching the user's input (and providing auto-complete suggestions)
- The permission key that determines whether the user has permission to know the entity exists (This is typically a “view” permission.)
- The target location's ID
Subclasses must override handleEntityNotFound to specify
behavior on incomplete or incorrect user input. A typical implementation
simply throws a UserDisplayableException.
Subclasses must also implement getCommandDisplaySuffix,
which behaves in the fashion described previously in Implementing QuickJumpCommandRef commands.
By default, parameter suggestions and
parameter matching use a query that finds all entities of the appropriate
type in which the specified property starts with the user's input. If
this query is too inefficient, the subclass can override getQueryProcessor (for auto-complete)
and findEntity (for parameter
matching). If you do not want some users to see the command, then the
subclass must also override the isPermitted
method.
By default, the auto-complete list displays
each suggested parameter completion as the name of the command followed
by the value of the matched parameter. Subclasses can override getFullDisplay to change this
behavior. However, the suggested name must not stray too far from the
default, as it does not change what appears in the QuickJump box after a user selects
the suggestion. Entity view commands automatically chain to any appropriate
contextual navigation command (for example, “Claim <claim #>
Financials”).
