public
Last active

SCN Search

  • Download Gist
x
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
 
noun_scnsearch_type = new CmdUtils.NounType( "scn search type",
["all" ,"library" ,"downloads","codesamples" ,"media", "forums","weblog", "wiki","help","ossnotes","teched"]);
 
 
 
 
CmdUtils.CreateCommand({
name: "scn-search",
description: "Search SCthis.typemapN",
takes: { query: noun_arb_text},
modifiers: {in: noun_scnsearch_type},
typemap: {"all":"sdn_all","library":"sdn_library","downloads":"sdn_downloads" ,"codesamples":"sdn_codesamples" ,"media":"sdn_media", "forums":"sdn_forums_rm" ,"weblog":"sdn_weblog","wiki":"sdn_wiki",
"help":"sdn_help", "ossnotes":"sdn_ossnotes", "teched":"sdn_teched_all"},
preview: function( pblock, query, modifiers) {
 
pblock.innerHTML = "Search SDN for : " + query.text ;
if (modifiers.in != null) {
pblock.innerHTML += " in "+ modifiers.in.text;
}
 
},
 
execute: function( query, modifiers) {
 
var url = "https://www.sdn.sap.com/irj/sdn/advancedsearch?query={QUERY}";
var urlString = url.replace("{QUERY}", query.text.replace(" ","+" ));
if (modifiers.in) {
urlString += "&cat=" + this.typemap[modifiers.in.text];
}
 
Utils.openUrlInBrowser(urlString);
}
})

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.