Ubiquity and Tahiti: Together At Last!

Posted in: Technical Track

Almost everyone and their mum has been twittering about (or from) Mozilla Labs’ newest creation, Ubiquity. You can get a quick introduction of this firefox extension via their blog post, which has a video tour.

Well, after playing around with the simple stock commands (email, wikipedia search, twittering), I decided it was time for a handy Oracle search function. I emerged from my cave with a pretty basic Ubiquity command that will search the tahiti documentation, and optionally search the documentation for a specific version of Oracle from 9iR2 onward. Right now it will simply take you to the Oracle search results page. If I find that Oracle is providing an API to the tahiti search engine, I may enhance it to include results in the Ubiquity preview pane.

You can load the command in your Ubiquity-enabled browser by visiting this page. Ubiquity users should already see the notice at the top of the page to subscribe to this command. You can view the source code at the end of this post.

Once the command is loaded, open Ubiquity via the hotkeys (alt+space or ctrl+space by default) and type something like “tahiti create database”, then hit Enter. This will take you to the tahiti search results page for “create database” for all versions. If you know you just want the results for 10gR2, type “tahiti create database in 10gR2” and you’ll be taken directly to those results. Supported versions are 9iR2, 10gR1, 10gR2 and 11gR1. If you leave out the revision (Rn), it will assume the latest revision for that version (e.g. 10g = 10gR2).

Here is a screenshot of some serious ubiquitous action:
Screenshot of Ubiquity and Tahiti command

Here is the source code:

CmdUtils.CreateCommand({
  name: "tahiti",
  homepage: "https://www.pythian.com/",
  author: { name: "Don Seiler", email: "[email protected]"},
  license: "GPLv2",
  description: "Executes search of Oracle RDBMS documentation.",
  help: "Specify search terms and version (9iR2, 10gR1, 10gR2, 11gR1).  If no version is specified, or specified version is not recognized, all version will be searched.  Specifying a version without a revision will default to the latest revision.",
  takes: {"search term": noun_arb_text},
  modifiers: {in: noun_arb_text},

  preview: function( pblock, term, mods ) {
    var msg = 'Searches tahiti in {$in} for "{$term}".';
    var subs = {term: term.text, in: mods.in.text};

    pblock.innerHTML = CmdUtils.renderTemplate( msg, subs );
  },

  execute: function( term, mods) {
    var searchterm = term.text || CmdUtils.getTextSelection();
    var urlDefault = "https://www.oracle.com/pls/db102/print_hit_summary?search_string={TERM}";
    var url9iR2 = "https://www.oracle.com/pls/db92/db92.drilldown?word={TERM}";
    var url10gR1 = "https://www.oracle.com/pls/db10g/search?word={TERM}";
    var url10gR2 = "https://www.oracle.com/pls/db102/search?word={TERM}";
    var url11gR1 = "https://www.oracle.com/pls/db111/search?word={TERM}";

    var version = mods.in.text || '';
    version = version.toLowerCase();

    var url = '';
    switch(version) {
      case '9i':
      case '9ir2':
        url = url9iR2;
        break;
      case '10gr1':
        url = url10gR1;
        break;
      case '10g':
      case '10gr2':
        url = url10gR2;
        break;
      case '11g':
      case '11gr1':
        url = url11gR1;
        break;
      default:
        url = urlDefault; // Default to all version tahiti search
    }

    url = url.replace("{TERM}", searchterm);
    Utils.openUrlInBrowser(url);
  }
})
email
Want to talk with an expert? Schedule a call with our team to get the conversation started.

About the Author

Oracle database administrator for The Pythian Group, headquartered in Ottawa, Ontario, Canada. I am located in Manitowoc, Wisconsin, USA. OCP 10gR2 DBA

4 Comments. Leave new

BTW, the 8.1.7 documentation is available via http://www.oracle.com/pls/tahiti/drilldown?word=...

>If I find that Oracle is providing an API to the tahiti search engine

What API do you need? Something more than the RSS format that Eddie is using?

John

Reply

Exactly. Is RSS available for 10g/9i/8i?

I’ll look into adding 8.1.7 doc support.

Reply
Ubiquity for Oracle « Oraexplorer’s Blog
January 13, 2009 9:03 pm

[…] second one “tahiti” is from Don Seiler at the Pythian group. This one has no preview. Thus upon pressing “Enter”, it will redirect to […]

Reply
Let’s Explore Oracle Together » Ubiquity for Oracle
January 14, 2009 11:16 am

[…] second one “tahiti” is from Don Seiler at the Pythian group. This one has no preview. Thus upon pressing “Enter”, it will redirect to […]

Reply

Leave a Reply

Your email address will not be published. Required fields are marked *