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''
Write down the unique identifiers of the AdhocQuery object and of any placeholders in the SQL statement, or copy and paste them into a file.
Change to the directory RegistryDomain-base/3.0/jaxr-ebxml.
Open the file registry-browser-config.xml in a text editor.
Make a copy of the original file so that you can back out your changes if you need to.
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.