Como incluir pesquisa via Google no BVS-Site

De Wiki.bireme.org/pt
Ir para: navegação, pesquisa
  1. Customizar a XSL que cria a caixa de pesquisa [1]
  2. Gravar o componente de pesquisa na área administrativa para gerar novo código com as opções de pesquisa
  3. Adicionar na instância a pasta htdocs/google/ que realiza a pesquisa no Google e Google Scholar (copiar essa pasta de alguma instância que possui a opção de pesquisa no Google)
  4. Copiar a imagem google/logo.gif para htdocs/image/common/engine/google/

Exemplo de customização (feita na BVS SMS-SP)

[1] htdocs/xsl/public/components/metasearch.xsl

   <xsl:template match="metasearch">
        <div id="search">
            <h3>
                <span><xsl:value-of select="text[@id = 'search_title']" /></span>
            </h3>
            <form name="searchForm" action="#" method="post" onsubmit="return(executeSearch());">
                <input type="hidden" name="lang"   value="{$lang}" />
                <input type="hidden" name="_charset_"  value="" />
                <input type="hidden" name="view"  value="BOX" />
                <input type="text" id="textEntry1" name="expression" class="expression midium defaultValue" value="{text[@id = 
                'search_entryWords']}" onfocus="clearDefault('textEntry1', 'expression midium'); this.value= 
                (this.value=='{text[@id = 'search_entryWords']}')? '' : this.value" onBlur="clearDefault('textEntry1', 'expression 
                midium defaultValue'); this.value= (this.value=='')? '{text[@id = 'search_entryWords']}' : this.value" />
		<div id="search00" style="display: inline;">
                    <input type="submit" value="{text[@id = 'search_submit']}" name="submit" class="submit" />
                </div>
		<div class="searchItens">
                    <span><xsl:value-of select="text[@id = 'search_method']" />:</span>
                    <input type="radio" name="engine" checked="checked" value="metaiah" id="engine_metaiah" onClick=
                    "showhideFormLayers('search00','','hide');showhideFormLayers('search01','','show');" /> <label for=
                    "engine_metaiah"><xsl:apply-templates select="text[@id ='search_freeSearch']" /></label>
                    <input type="radio" name="engine" value="google" id="engine_google" onClick=
                    "showhideFormLayers('search00','','hide');showhideFormLayers('search01','','show');" /> <label for=
                    "engine_google">google</label>
                </div>
            </form>
            <div id="searchDecs">
                <a href="../php/decsws.php"><xsl:value-of select="text[@id = 'decs_mesh']"/></a>
            </div>
	</div>
	<!-- div AJAX search result -->
        <div id="searchResult" style="display: none;">
            <div class="portletTools">
                <a href="#" onclick="javascript:executeSearch();"><img class="portletRefresh" src="../image/common/refresh.png" 
                border="0" alt="refresh"/></a><a href="#" onclick="portletClose('searchResult');"><img class="portletClose" src=
                "../image/common/close.png" border="0" alt="close"/></a>
            </div>
            <h3>
                <span><xsl:value-of select="text[@id = 'search_results']"/></span>
            </h3>
            <div id="result">
                <xsl:comment>result div</xsl:comment>
            </div>
        </div>
    </xsl:template>

OBS: Essa customização está contemplada em ambientes Linux. Em sistemas Windows, somente a pesquisa via Google irá funcionar.