Personal tools
You are here: Home Products LiveSearchWidget

LiveSearchWidget

RSS Feed Category: Fields and widgets — Other products by this author
The LiveSearchWidget is a widget that can be used for a referencefield. This widget (in edit mode) will let you search for objects in a livesearch way that is very similar to the plone livesearch functionality.

Current release: LiveSearchWidget 1.1.2

Released 2007-09-10 — tested with Plone 3.0, Plone 2.5.1, Plone 2.5

plone3 fix

List all releases… Full release announcement…

Get LiveSearchWidget for All platforms (0 kB)

LiveSearchWidget-1.1.2.tar.gz

Experimental releases

Upcoming and alpha/beta/candidate releases

  • Alpha releases should only be used for testing and development.
  • Beta releases and Release Candidates are normally released for production testing, but should not be used on mission-critical sites.
  • Always install on a separate test server first, and make sure you have proper backups before installing.
LiveSearchWidget 1.0.0 (Unreleased)
first public release

Project Description

LiveSearchWidget
Project resources
This product contains The LiveSearchWidget
(see: http://www.goldmund-wyldebeast-wunderliebe.com/products)

Contents
--------
1.0 Introduction
 .1 Prerequisites
 .2 License
2.0 Installation
3.0 Known limitations
4.0 Example code

1.0 Introduction
----------------
The LiveSearchWidget is a widget that can be used for a referencefield.
This widget (in edit mode) will let you search for objects in a livesearch
way that is very similar to the plone livesearch functionality.

The search is performed using a standard catalog search, on the index
"SearchableText".

This widget was put together using exising code from plone's livesearch
together with a little bit from ATReferenceBrowserWidget code. By copying
the plone livesearch stuff, we think this widget will be quite solid on most
modern browsers.

1.1 Prerequisites
-----------------
* Plone 2.5 (???)
* InstallUtils (http://www.goldmund-wyldebeast-wunderliebe.com/products)
* Archetypes
* ATReferenceBrowserWidget

1.2 License
-----------
This product is distributed under the GPL license (see LICENSE.GPL)

The code that was copied and slightly modified from plone (livesearch)
is also redistributed under this GPL license

The code that was copied and slightly modified from ATReferenceBroswerWidget
is also redistributed under this GPL license

2.0 Installation
----------------
Install the product using the quick_installer.

3.0 Known limitations
---------------------
* field needs to be a referencefield
* field needs allowed_types property with only 1 element
  (e.g. allowed_types=('Document',) )
  NOTE: Make sure that it's really a tuple, and not just a string!!
  WRONG: allowed_types=('Document')
  GOOD:  allowed_types=('Document',)
* vocabulary not supported. This is something that needs some work. Suggestions
are more than welcome

workaround:
you can specify a 'extra_search_args' attribute in the widget, which can be a
method that returns a map of extra arguments (see example below)

4.0 Example code
----------------

This is a snippet which shows you how to use the LiveSearchWidget
It's quite straightforward as you can see:

*** snip ***

from Products.LiveSearchWidget.widgets.livesearchwidget import *

def getExtraArgs(self):

    """ return extra livesearch arguments """

    # search only one level underneath current object
    return {'path' : {'query' : '/'.join(self.getPhysicalPath()),
                      'depth' : 1,
                     }
           }

schema = ProfileSchema.copy() + Schema((

     ReferenceField('subscriptions_sms',
                    allowed_types=('Social Plan',),
                    relationship=SUBSCRIPTION_RELATION_SMS,
                    widget=LiveSearchWidget(label='Subscription SMS',
                                            extra_search_args='getExtraArgs',)
                    ),

))

*** snap ***


by Huub Bouma last modified 2008-02-10 22:27

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: