Service Registry 3.1 Administration Guide

Adding Predefined Queries

Service Registry includes several predefined queries, which appear in the Web Console Search form in the Select Predefined Query drop-down list. As an administrator, you can add new queries to the drop-down list that are specific to your installation of the Registry.

ProcedureTo Add a Predefined Query

  1. 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''
  2. 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.

  3. Change to the directory RegistryDomain-base/3.0/jaxr-ebxml.

  4. 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.

  5. 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.

      <AdhocQueryRef id="unique-identifier"/>
      <Parameter parameterName="$placeholder-name" datatype="string">
          <rim:LocalizedString xml:lang="en" charset="UTF-8" 
          <rim:LocalizedString xml:lang="fr" charset="UTF-8" 
          <rim:LocalizedString xml:lang="en" charset="UTF-8" 
          <rim:LocalizedString xml:lang="fr" charset="UTF-8" 

    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:Slot name="domain">

      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.

  6. Save and close the registry-browser-config.xml file.

  7. Follow the instructions in To Stop and Restart the Application Server Domain for the Registry.