Use the Web Console to publish an AdhocQuery object to the Registry.
The name and description you specify for the query will appear in the drop-down list of predefined queries. In the SQL statement for the query, specify placeholders for user-supplied data by enclosing them in pairs of single quotes, as follows:
select * from registryobject where id = ''$lid''
Make a note of the unique identifier of the AdhocQuery object and of any placeholders in the SQL statement.
Change to the directory RegistryDomain-base/3.0/jaxr-ebxml.
Open the file registry-browser-config.xml in a text editor.
Add an entry to the registry-browser-config.xml file, using the following format. Specify a Parameter element for each placeholder in the SQL statement.
<Query> <AdhocQueryRef id="unique_identifier"/> <Parameter parameterName="$placeholder_name" datatype="string"> <rim:Name> <rim:LocalizedString xml:lang="en" charset="UTF-8" value="parameter_name_in_en_locale"/> <rim:LocalizedString xml:lang="fr" charset="UTF-8" value="parameter_name_in_fr_locale"/> </rim:Name> <rim:Description> <rim:LocalizedString xml:lang="en" charset="UTF-8" value="parameter_description_in_en_locale"/> <rim:LocalizedString xml:lang="fr" charset="UTF-8" value="parameter_description_in_fr_locale"/> </rim:Description> </Parameter> ... </Query>
The unique_identifier is the unique identifier of the AdhocQuery object.
The parameterName attribute value for each parameter must come from a placeholder in the SQL statement for the query.
The datatype attribute can have any of the following values:
string: The parameter appears as a text field in the Search form.
taxonomyElement: The parameter appears as a drop-down list in the Search form. If you specify a taxonomyElement data type, the Name and Description elements must be followed by a SlotList element that looks like this:
<rim:SlotList> <rim:Slot name="domain"> <rim:ValueList> <rim:Value> classification_scheme_or_concept_id </rim:Value> </rim:ValueList> </rim:Slot> </rim:SlotList>
The classification_scheme_or_concept_id is the unique identifier of the classification scheme or concept whose concepts (or subconcepts) must appear in the drop-down list. You must publish the classification scheme if it does not already exist in the registry.
The slot name must be "domain".
boolean: The parameter appears as a checkbox in the Search form.
If the datatype is string or boolean, you can also add a defaultValue attribute to the Parameter element to specify a default value to appear in the Search form.
Specify localized string values for each parameter name and description for any locales you support. The parameter_name in the current locale appears as the label of the parameter in the Search form.
Use the existing entries in the registry-browser-config.xml file as a reference.
Save and close the registry-browser-config.xml file.
Follow the instructions in To Stop and Restart the Application Server Domain for the Registry.