Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install collective.gsa64

How to install collective.gsa64

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install collective.gsa64
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.0-beta4 Available View build log
1.0-beta3 Available View build log
1.0-beta2 Available View build log
1.0-beta1 Available View build log
Windows (64-bit)
1.0-beta4 Available View build log
1.0-beta3 Available View build log
1.0-beta2 Available View build log
1.0-beta1 Available View build log
Mac OS X (10.5+)
1.0-beta4 Available View build log
1.0-beta3 Available View build log
1.0-beta2 Available View build log
1.0-beta1 Available View build log
Linux (32-bit)
1.0-beta4 Available View build log
1.0-beta3 Available View build log
1.0-beta2 Available View build log
1.0-beta1 Available View build log
Linux (64-bit)
1.0-beta4 Available View build log
1.0-beta3 Available View build log
1.0-beta2 Available View build log
1.0-beta1 Available View build log
 
License
GPL
Lastest release
version 1.0-beta4 on Dec 1st, 2011

Overview

Plone integration for Google Search Appliance.

Compatible with Plone 4.

Installation

Use Plone's setup tool to install the profile: "Integration to Google Search Appliance".

Then visit the control panel to configure your appliance. Also in the control panel are various settings to customize the site integration.

Why?

This package exists to provide a light-weight integration between Plone and a Google Search Appliance service. Its philosophy is to let the appliance do the heavy lifting instead of Plone. The "64" postfix corresponds to the version of the search appliance software at the time of writing: 6.4.

There's an alternative in Matous Hora's collective.gsa package which takes a different approach and is in return a much more complex piece of software. The package also integrates more closely with Plone by patching into the default portal catalog.

The present package -- collective.gsa64 -- is about site search and just that.

Feed protocol implementation

The package comes with an implementation for the Feed Protocol API. When a content item for which search is enabled (use Plone's search control panel to configure) is created, modified or deleted, a feed is sent to the search appliance to update the status.

There are two modes of operation: web (implicitly enabled for a feed with the name "web") and url and metadata mode (any other name).

The metadata for the second mode is drawn directly from HTML using the plone.htmlhead content provider. As such this corresponds directly to the metadata which would be indexed using crawling.

You can enable include the standard Dublin Core metadata using the site control panel.

An example of a viewlet definition in ZCML that renders additional metadata:

<browser:viewlet
    name="my-metadata-viewlet"
    for=".content.ISomeContentType"
    manager="plone.app.layout.viewlets.interfaces.IHtmlHead"
    template="my_metadata_viewlet.pt"
    permission="zope2.View"
    />

Note that feed requests are issued after the browser request has ended and will not delay server response.

Search view

The setup script adds a Python Script object to the portal root with the id "search". This takes over the normal skin lookup and redirects the traversal to the @@gsa-search view.

You can enable or disable the search appliance results view (and operation in general) using the control panel.

The results view is by default generated using an included browser view with a template that generates markup similar to Plone's own search results view. However, it's also possible to have an XSLT transform applied directly to the XML result document and show this instead.

For custom projects, it may be necessary to subclass the default search view implementation. Here's an example of a modified query:

from collective.gsa64.browser import search

class SearchView(search.SearchView):
    def build_query(self):
        query = super(SearchView, self).build_query()

        # always include hits for "plone"
        query['q'] = '(%s) OR plone' % query['q']

        return query

It may be desirable to change the display of the individual search results. You can accomplish this by providing your own search templates and fill out the "result" METAL slot:

class SearchView(search.SearchView):
    template = ViewPageTemplateFile("templates/search.pt")

    @property
    def master_search_template(self):
        return super(SearchView, self).template

The templates/search.pt template:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
      lang="en"
      metal:use-macro="view/master_search_template/macros/master">

  <metal:result fill-slot="result">

    <h4 tal:content="structure result/heading" />

  </metal:result>

</html>

Each result object contains the following keys:

  • description: HTML document description
  • heading: HTML document title
  • url: Document's display URL
  • creator: DC creator value
  • normalized_content_type: Normalized Plone content type id
  • metadata: Dictionary that maps metadata keys to values
Content types filter

Plone's standard types not searched setting is applied to HTML output via a browser viewlet "meta-robots" which renders a noarchive meta tag for content types excluded from search.

Credits

This package was designed and developed by the following authors.

  • Malthe Borch
  • Mustapha Benali

Development was funded by Headnet.

History

1.0-beta4 (2011-11-30)

Features:

  • Added settings for client features:

    KeyMatch, related queries, filters, etc.

    These are available in the control panel. [mustapha]

Bugfixes:

  • Handle the case where the product is not installed. [mustapha]
  • Handle the case of empty description or heading. [mustapha]
  • Added browser layer to enable browser components through the setup. [mustapha]
1.0-beta3 (2011-01-10)
  • Recover from component lookup errors that result from trying to render HTML meta-tags for use as metadata.
  • Disable search result filtering (at least until we can provide an interface that presents the normal 'we have filtered your results' dialogue).
  • Ignore event handler if registry is unavailable (missing setup of plone.app.registry).
  • Fixed an issue where a checkPermission call would raise an exception because no interaction was established yet (for instance in a test setup).
1.0-beta2 (2010-12-20)
  • If an HTML meta-tag has no content attribute, drop it from the feed.
1.0-beta1 (2010-12-17)
  • Initial public release.

Subscribe to package updates

Last updated Dec 1st, 2011

Download Stats

Last month:2

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.