31 Validate and Test Search Metadata

This chapter describes how to validate and test search metadata.

This chapter includes the following sections:

31.1 Introduction to Validating and Testing Search Metadata

Search metadata is dependent on view object metadata, which is used in such areas as title, body expression, and searchable attributes. However, changes made to the view object metadata are not automatically reflected in the search metadata. To identify those changes, you must validate the search metadata by using the Validate button in the Search page of the Oracle JDeveloper overview editor for Oracle Enterprise Crawl and Search Framework (ECSF).

Testing the searchable objects ensures that they can be registered in the Oracle Fusion Applications database without issues.

31.2 About Validating the Search Metadata

To make sure that you are creating correct and valid search metadata on view object metadata, you must validate the metadata before applying changes. When you run validation on the search metadata, ECSF checks for the following:

  • Table and alias of the primary table exists in the view object.

  • Title, body, and keywords expressions are valid.

  • Search extension is valid.

  • Search attributes are valid, and all the search attributes exist in the view object.

  • Search actions are valid:

    • Search action names are unique.

    • Default action exists. Warning is displayed when it does not exist.

    • Title expression is valid.

  • Search facets are valid:

    • Facet name is unique.

31.2.1 How to Validate Search Metadata

Use the Search navigation tab of the overview editor in JDeveloper, shown in Figure 29-3, to validate search metadata. If you identify any errors (changes to the view object metadata that are not reflected in the search metadata), you must manually fix them.

To validate search metadata through the Validate button, do the following:

  1. In the overview editor, select the Search navigation tab.
  2. Click the Validate button.

    If validation errors occur, the Search Validation Results dialog, shown in Figure 31-1, appears.

    Figure 31-1 Search Validations Dialog

    Explained in the surrounding text.

    The dialog shows a list of validation errors.

  3. Click OK when you finish viewing the errors.

31.3 Testing Searchable Objects Through a Web Browser

Before you register searchable objects in the Oracle Fusion Applications database, you should test the searchable objects by testing the Config Feed, Control Feed, and Data Feed.

ECSF prohibits multiple feeds per searchable object, so after achieving the desired results for the Config Feed, Control Feed, and Data Feed, you must reset the state of the feeds.

31.3.1 Perform Prerequisite Steps

Before you begin testing searchable objects, do the following:

  1. Set the following Java option in the Run configuration dialog to test the searchable objects through a web browser: -Doracle.ecsf.crawl.mode.debug=true. For more information, see How to Modify the Run Configuration of the View-Controller Project.
  2. Set up ECSF security. For information, see Configuring ECSF Security .
  3. Create searchable objects. For information, see Creating Searchable Objects.
  4. Run the ECSF feed servlet. For information, see How to Run the ECSF Feed Servlet.

31.3.2 How to Run the ECSF Feed Servlet

Running the ECSF feed servlet in debug mode provides the servlet access to HTTP GET, the method that allows you to input URLs with arguments directly into the browser.

The web.xml file is automatically updated with the ECSF feed servlet, feed servlet mapping, and filter mappings as shown in Example 31-1 when the ECSF Runtime Server library is added to the project.

To ensure that the ECSF feed servlet runs properly, do the following:

  1. Set the Application Navigator to display the Java archive (JAR) files and libraries by clicking the Navigator Display Options button in the Projects panel and selecting Show Libraries, as shown in Figure 31-2.

    Figure 31-2 Navigator Display Options

    Explained in the surrounding text.
  2. In the Application Navigator, expand the ECSF Runtime Server library.
  3. Expand the oracle.ecsf.feed package.
  4. Right-click the SearchFeedServlet.class file and select Run to start the Integrated WebLogic Server instance. A browser opens to the following feed URL:

    http://localhost:7101/approot/searchfeedservlet/%2A

    Note:

    The web page is an RSS feed. Depending on the browser you use, you may not be able to view the contents of the web page. If you cannot view the RSS feed, navigate to View > Source in the browser to view the feed.

    You can click the Terminate (red square) button to stop the ECSF feed servlet.

Example 31-1 ECSF Feed Servlet, Feed Servlet Mapping, and Filter Mappings

<servlet>
        <servlet-name>SearchFeedServlet</servlet-name>
        <servlet-class>oracle.ecsf.feed.SearchFeedServlet</servlet-class>
    </servlet>
<servlet-mapping>
        <servlet-name>SearchFeedServlet</servlet-name>
        <url-pattern>/searchfeedservlet/*</url-pattern>
    </servlet-mapping>
<filter-mapping>
        <filter-name>JpsFilter</filter-name>
        <servlet-name>SearchFeedServlet</servlet-name>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
    </filter-mapping>
<filter-mapping>
        <filter-name>ServletADFFilter</filter-name>
        <servlet-name>SearchFeedServlet</servlet-name>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>REQUEST</dispatcher>
    </filter-mapping>

31.3.3 How to Test the Config Feed

To test the Config Feed, run the ECSF feed servlet with a modified URL.

  1. Change the feed URL http://localhost:7101/approot/searchfeedservlet/%2A by:
    • Replacing localhost with the server name of the IP address.

    • Replacing %2A with the fully qualified name of the view object, including the package path.

    • Appending /ConfigFeed to the end of the URL.

    For example, if JDeveloper is running on the Linux server wlsserver.com, and the fully qualified package path of EmpVO is oracle.ecsf.EmpVO (case-sensitive), the resulting Config Feed URL would be http://wlsserver.com:8988/approot/searchfeedservlet/oracle.ecsf.EmpVO/ConfigFeed.

  2. Refresh the web page.

    The resulting RSS feed, the Config Feed, should resemble the feed in Example 31-2.

    If the RSS feed does not appear, then either the runtime server is not set up properly or the path to the view object is incorrect. The URL is case-sensitive.

    If no attribute exists for the <securityAttribute> tag, you must mark at least one searchable attribute as a Secure Attribute. For information, see About Making View Objects Searchable.

  3. After adding the metadata, make sure to restart the Integrated WebLogic Server instance.

Example 31-2 Sample Results of the Config Feed

- <rsscrawler xmlns="http://xmlns.example.com/search/rsscrawlerconfig">
 
<feedLocation>http://localhost:8988/approot/searchfeedservlet/runtime.EmpView/ControlFeed</feedLocation> 
  <feedType>controlFeed</feedType> 
  <errorFeedLocation>/tmp</errorFeedLocation> 
  <securityType>attributeBased</securityType> 
  <securityAttribute name="DEPTNO" grant="true" /> 
  </rsscrawler>

31.3.4 How to Test the Control Feed

To test the Control Feed, run the ECSF feed servlet with a modified URL.

  1. Locate the URL provided in the <feedLocation> tag of the Config Feed. For information, see How to Test the Config Feed.

    In the Config Feed shown in Example 31-2, the URL is http://localhost:8988/approot/searchfeedservlet/runtime.EmpView/ControlFeed.

  2. Change the feed URL by replacing localhost with the server name of the IP address.

    For example, if JDeveloper is running on the Linux server example.com, the resulting Control Feed URL would be http://example.com:8988/approot/searchfeedservlet/runtime.EmpView/ControlFeed.

  3. Refresh the web page.
  4. At the login screen, enter the username and password.

    The resulting RSS feed, the Control Feed, should resemble the feed in Example 31-3.

Example 31-3 Sample Results of the Control Feed

  <?xml version="1.0" encoding="UTF-8" ?> 
- <rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0">
- <channel>
  <title>Control feed for ECSF</title> 

<link>http://example.com:8988/approot/searchfeedservlet/runtime.EmpView/ControlFeed</link> 
  <description>Control feed for Enterprise Crawl and Search Framework</description> 
  <lastBuildDate>2008-04-06T19:20:08.159Z</lastBuildDate> 
- <channelDesc xmlns="http://xmlns.example.com/orarss">
  <feedType>control</feedType> 
  </channelDesc>
- <item>
- <link>
- <![CDATA[ 
http://example.com:8988/approot/searchfeedservlet/runtime.EmpView/DataFeed?tableName=Emp&workUnitStart=AAHz%2BdADeAAA07UAAA&workUnitEnd=AAHz%2BdADeAAA07UAAV&type=ROWID
  ]]> 
  </link>
  </item>
  </channel>
  </rss>

31.3.5 How to Test the Data Feed

To test the Data Feed, run the ECSF feed servlet with a modified URL.

  1. Locate the URL provided in the <link> tag under the <item> tag of the Control Feed. For information, see How to Test the Control Feed.

    In the Control Feed shown in Example 31-3, the URL is http://example.com:8988/approot/searchfeedservlet/runtime.EmpView/DataFeed?tableName=Emp&workUnitStart=AAHz%2BdADeAAA07UAAA&workUnitEnd=AAHz%2BdADeAAA07UAAV&type=ROWID.

  2. Refresh the web page with the URL.
  3. At the login screen, enter the username and password.

    The resulting RSS feed, the Data Feed, should resemble the feed in Example 31-4.

Example 31-4 Sample Results of the Data Feed

  <?xml version="1.0" encoding="UTF-8" ?> 
- <rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0">
- <channel>
  <title>RSS for Oracle Applications Search</title> 

<link>http://example.com:8988/approot/searchfeedservlet/runtime.EmpView/DataFeed</link> 
  <description>RSS for Oracle Applications Search</description> 
  <lastBuildDate>2008-04-06T19:36:08.950Z</lastBuildDate> 
- <channelDesc xmlns="http://xmlns.example.com/orarss">
  <feedType>incremental</feedType> 
  </channelDesc>
- <item>
- <link>
- <![CDATA[ 
http://ecsf.example.com/search/runtime.EmpView?EMPNO=7839
  ]]> 
  </link>
- <title>
- <![CDATA[ 
KING: 5000
  ]]> 
  </title>
- <itemDesc xmlns="http://xmlns.example.com/orarss">
- <documentMetadata>
- <accessURL>
- <![CDATA[ 
http://example.com/EmpNo=7839
  ]]> 
  </accessURL>
- <keywords>
- <![CDATA[ 
Employee department job salary data  KING
  ]]> 
  </keywords>
- <summary>
- <![CDATA[ 
KING 1981-11-17T00:00:00.000Z 
  ]]> 
  </summary>
  <language>en</language> 
- <docAttr name="ENAME">
- <![CDATA[ 
KING
  ]]> 
  </docAttr>
- <docAttr name="CITY_ID">
- <![CDATA[ 
2
  ]]> 
  </docAttr>
- <docAttr name="STATE_ID">
- <![CDATA[ 
1
  ]]> 
  </docAttr>
  </documentMetadata>
- <documentAcl>
  <securityAttr name="DEPTNO">NO_SECURITY</securityAttr> 
  </documentAcl>
- <documentInfo>
  <status>STATUS_OK_FOR_INDEX</status> 
  </documentInfo>
- <documentContent>
- <content type="text/plain">
- <![CDATA[ 
Identification Number: 10.7839  
  ]]> 
  </content>
- <contentLink type="text/html">
- <![CDATA[ 
http://example.com:8988/approot/searchfeedservlet/runtime.EmpView/Attachment?schemaName=null&tableName=runtime.EmpView&columnName=Attachment&keyCount=1&keyName0=EMPNO&keyValue0=7839
  ]]> 
  </contentLink>
  </documentContent>
  </itemDesc>
  </item>

31.3.6 How to Reset the State of the Feeds

Resetting the feed for the searchable object recrawls the object. Reset the state of the feeds by modifying the Config Feed URL.

  1. Recall the Config Feed URL of the searchable object. For information, see How to Test the Config Feed.
  2. Append ?forceInitialCrawl=true to the Config Feed URL, for example, http://example.com:8988/approot/searchfeedservlet/runtime.EmpView/ConfigFeed?forceInitialCrawl=true
  3. Paste the resulting URL in your browser and refresh the web page.