Difference between revisions of "OpenSearchPluginForRT"

From Request Tracker Wiki
Jump to navigation Jump to search
 
m (3 revisions imported)
 

Latest revision as of 16:15, 6 April 2016

Firefox 2 supports the OpenSearch architecture for search plugins (this is also reportedly supported by IE7).

Here is an example plugin that works with Firefox. It hooks into RT's Simple search:

Enter id numbers, queues by name, Owners by username and Requestors by email address. RT will look for anything else you enter in ticket bodies and attachments.

Searching the full text of every ticket can take a long time, but if you need to do it, you can search for any word in full ticket history for any word by typing fulltext:word.

RT will look for anything else you enter in ticket subjects.

Save this text to an XML file (e.g. rt.xml) and copy it to your Firefox search plugins directory and restart Firefox. Be sure and change "some.rt-server.com" to your server's name and add in any site prefix. Likewise, change "my.name@some.rt-server.com" to your email address and "My Name" to your name. Finally, if you use a different favicon than the default one, you may want to change it in the <Image> line.

<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
                       xmlns:moz="http://www.mozilla.org/2006/browser/search/">
  <ShortName>RT Search</ShortName>
  <Description>Search Request Tracker from Firefox</Description>
  <Url type="text/html" method="get" template="http://some.rt-server.com/Search/Simple.html?q={searchTerms}"/>
  <Contact>my.name@some.rt-server.com</Contact>
  <Image width="16" height="16">data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAB3RJTUUH1wkFCwsO8TgPWQAAAAlwSFlzAAALEgAACxIB0t1+/AAAAMVJREFUeNrtkWsRwyAQhIkTJOAgJwEJddA6AAl1kDqIhJNQCUhAwvWWPKZNmCb0d3fCkMzw7e0SY36Q9z6IMfKIUZph51zP1kpSA+9caDZgfTD9QsTNMCDAT++/RoezbJdmFcBJ41tr+x1FRAGXg8NbMXMB0bsKQ4Ml0dESdeWcVxjvgEvvKU1dV71Rng8CyONYDO43J2+9j38bEqS5LxNNOww1ySkDHELnJc2gO76h0wZL91FrpJTW+6gZdDWDgwGd+etDL7I6qxdht2L3AAAAAElFTkSuQmCC</Image>
  <Developer>My Name</Developer>
  <InputEncoding>UTF-8</InputEncoding>
  <moz:SearchForm>http://som.rt-server.com/Search/Build.html</moz:SearchForm>
</OpenSearchDescription>

Tested with RT 3.6.3 and Firefox 2.0.0.6 -- JoeCasadonte

Autodiscovery

Chrome and recent Firefox/IE can do search autodiscovery by having the above code served from the web server, and adding a link tag to the page header.

Save the above XML file as (say) ..../local/html/NoAuth/OpenSearch.xml

Create ..../local/html/Elements/Header as a copy of ..../share/html/Elements/Header and add this fragment near the other "link rel" definitions:


https://some.rt-server.com/NoAuth/OpenSearch.xml"
           title="RT" />


Restart Apache to get the Mason cache refreshed.