Created
November 12, 2008 20:30
-
-
Save garyhodgson/24256 to your computer and use it in GitHub Desktop.
Ubiquity command to search Oracle documentation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Ubiquity command to search Oracle documentation | |
*/ | |
CmdUtils.CreateCommand({ | |
name: "oracle", | |
author: { | |
name: "Gary Hodgson", | |
homepage: "http://www.garyhodgson.com/", | |
email: "contact@garyhodgson.com" | |
}, | |
contributors: ["Don Seiler"], | |
license: "MPL", | |
icon: "http://www.google.com/s2/favicons?domain=www.oracle.com", | |
description: "Executes search of Oracle RDBMS documentation.", | |
releaseinfo: { | |
1 : "(10 Sep 2008) Initial Release. Based on the Tahiti command by <a href=\"http://www.pythian.com/blogs/1187/ubiquity-and-tahiti-together-at-last\">Don Seiler</a>" | |
}, | |
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: new CmdUtils.NounType( "Version", ["9iR2", "10gR1", "10gR2", "11gR1", "All"])}, | |
preview: function( pblock, term, mods ) { | |
var msg = "Searches Oracle (${loc}) for '${term}'"; | |
var subs = {term: term.text, loc: mods.in.text||"All"}; | |
pblock.innerHTML = CmdUtils.renderTemplate( msg, subs ); | |
}, | |
execute: function( term, mods) { | |
var VersMap= { | |
"9IR2":"/pls/db92/db92.drilldown?word=", | |
"10GR1":"/pls/db10g/search?word=", | |
"10GR2":"/pls/db102/search?word=", | |
"11GR1":"/pls/db111/search?word=", | |
"ALL":"/pls/db102/print_hit_summary?search_string=", | |
}; | |
h='http://www.oracle.com'; | |
vers=(mods.in.text) ? mods.in.text.toUpperCase() : "ALL"; | |
p=VersMap[vers] || VersMap["ALL"]; | |
cp=h+p+encodeURIComponent(term.text); | |
Utils.openUrlInBrowser(cp,null); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment