Previous Topic: Example Script Use in a Search DefinitionNext Topic: Configuring the Search Parameter Layout


Install a New Search

This involves the following steps:

  1. Load the SP into the database

    Use any database tool or the CA DataMinder RunScript function.

    If using RunScript, modify the SQL file to conform to RunScript requirements. Specifically, if supporting both Oracle and MSSQL you must prefix the code with the appropriate database identifier, <ORACLE> or <MSSQL>, and terminate it with a semicolon.

    For Oracle, line terminators in PL/SQL must be escaped with a backslash unless the SQL is included using the RunScript EXEC_NATIVESCRIPT command. For example:

    RETURN MyCursor;	would become	RETURN MyCursor\;
    

    The syntax for the RunScript function is:

    wgninfra -localexec wigan/schema/Schema RunScript MyEmailSearch.sql
    
  2. Load the search definition file

    In the iConsole:

    1. Browse to the Manage Searches screen and click Install Search .
    2. Locate and install the XML file that contains the search definition. This adds the default searches to the Unpublished folder of the Manage Searches screen, ready for testing.

      Note: During installation, the search definition XML is validated against an XML schema document 'SearchDefinition.xsd'. The XML schema document is in the \Web\schemas subfolder in the CA DataMinder installation folder. In addition to validating that the correct elements and attributes are specified, the schema also applies constraints to some attributes. For example, the length of the search label attribute is limited to 64 chararacters. Search definitions that fail validation are not installed.

      Note: The embedded JavaScript in a search definition can be error-prone. Because JavaScript is an interpreted language, errors only manifest themselves at runtime. To reduce the possibility of errors in script, you can configure the iConsole to validate the script when the search definition is installed. This feature is normally turned off because it imposes an unnecessary overhead when installing production search definitions, but it is useful when developing new searches. To enable JavaScript validation, set the ValidateSearchJavascript registry value in the WebService hive to 'true'. Advanced users may want to alter the JavaScript compiler options using the SearchJavascriptValidationOptions registry value (the default is '/warn:3 /fast-'). Details about these registry values are outside the scope of this guide.

  3. Copy any help files and script files for the search onto each front-end Web server

    If required, copy the .html and .gif help files to the location specified by the help and help_icon attributes in the XML search definition file. Typically, you have separate help pages for the search screen and search results screen.

    Copy the script files to the \Web\scripts folder

    Do this on each front-end Web server.

  4. Test and publish the new search

    In the iConsole:

    1. Browse to the Administer Searches, Searches screen and click Test to test the parameters in the search definition.
    2. Click the Actions drop-down for the search and select Edit to see the properties page for the search. This page contains all the parameters defined for the search.
    3. Select Run to test the execution of the search stored procedure.
    4. When testing is complete, return to the Administer Searches, Searches page.
    5. Click the Actions drop-down for the search and select Publish to make the searches available to all users logged on to the CMS.