Demos of IBM® OpenSearch library

The ibm_opensearch/data/demos directory use the OpenSearch compliant search capabilities present in several remote websites listed below.

For these files to work properly, several setup steps must be performed as outlined below:

  1. The OpenSearch Description Document for those sites must reside in the 'ibm_opensearch/data/demos/resources' directory. For each of the links below, right-click on the link, select "Save Link As..." or "Save Target As..." (depending on your browser), and save the file to the given filename and location indicated. Be sure to select "All Files" or "XML File" for the file type to ensure the file is saved correctly.

  2. Setup a proxy to allow the demo pages (while running in a client-side browser) to access the remote services. The client-side browser restricts XHR requests to the same domain as the page originated from (called the same-origin policy), which means that accessing the remote search services must be routed through a proxy. The AjaxProxy feature of the WebSphere Featurepack for Web 2.0 is the best option and the following steps can be used to setup these demos with the AjaxProxy:

    1. In Eclipse, click File->Import. In the Web folder, click 'WAR File', the Next.
    2. On the following screen, for the WAR File, find the AjaxProxy.war file installed as part of the Feature Pack. Fill in your desired project name in the next box. For 'Target Runtime', select 'none'. Check the box next to 'Add project to EAR'. Click Finish. A new project will be created with the indicated name with the AjaxProxy files already setup.
    3. Copy the entire dojo/, dojox/, dijit/, and ibm_opensearch/ folders into the newly created WebContent folder in the new proxy project.
    4. Find the proxy-config.xml file within the newly created project. It should reside in WebContent/WEB-INF. Ensure that the following two lines exist as part of the proxy mappings:
      <proxy:mapping contextpath="/http/*"/>
      <proxy:mapping contextpath="/https/*"/>
      
    5. Modify the OpenSearch Description Documents that were downloaded previously to force the search endpoints to utilize the local proxy. For example, where a search endpoint might previously have been "www.intertwingly.net/blog/?q={searchTerms}", change the value to "/<projectName>/proxy/http/www.intertwingly.net/blog/?q={searchTerms}". Search endpoints are described by <URL> elements in the Opensearch Description Document.
    6. Right click on the EAR project that was created (should be <projectName>EAR) and click 'Export...'. Under J2EE, select 'EAR file'. Select the destination filename and click Finish. This EAR can now be deployed on your application server.

After following these steps and deploying the EAR on a Websphere Application Server, the demo files can be viewed within the directory with the following URL:

http://<hostname>:<port>/<projectName>/dojo/ibm_opensearch/data/demos/
For example:
http://localhost:9081/AjaxProxy/dojo/ibm_opensearch/data/demos/demo_OpenSearchStore_shutterpoint_rss.html