Back to index

plone3  3.1.7
Functions | Variables
livesearch_reply Namespace Reference

Functions

def quotestring
def quote_bad_chars
def write

Variables

tuple ploneUtils = getToolByName(context, 'plone_utils')
tuple portal_url = getToolByName(context, 'portal_url')
 pretty_title_or_id = ploneUtils.pretty_title_or_id
tuple plone_view = context.restrictedTraverse('@@plone')
tuple portalProperties = getToolByName(context, 'portal_properties')
tuple siteProperties = getattr(portalProperties, 'site_properties', None)
list useViewAction = []
 USE_ICON = True
 USE_RANKING = False
int MAX_TITLE = 29
int MAX_DESCRIPTION = 93
 catalog = context.portal_catalog
tuple friendly_types = ploneUtils.getUserFriendlyTypes()
tuple q = q.replace(char, ' ')
 q = re.compile(r'[*\?-+]+').sub(' ', q)
tuple r = q.split()
tuple searchterms = url_quote_plus(r)
tuple site_encoding = context.plone_utils.getSiteEncoding()
tuple path = getNavigationRoot(context)
tuple results = catalog(SearchableText=r, portal_type=friendly_types, path=path)
string searchterm_query = '?searchterm=%s'
 RESPONSE = context.REQUEST.RESPONSE
tuple legend_livesearch = _('legend_livesearch', default='LiveSearch ↓')
tuple label_no_results_found = _('label_no_results_found', default='No matching results found.')
tuple label_advanced_search = _('label_advanced_search', default='Advanced Search…')
tuple label_show_all = _('label_show_all', default='Show all…')
tuple ts = getToolByName(context, 'translation_service')
list output = []
tuple icon = plone_view.getIcon(result)
tuple itemUrl = result.getURL()
tuple full_title = safe_unicode(pretty_title_or_id(result))
string display_title = ''
tuple heading_search_results = _('heading_search_results', default='Search results…')

Function Documentation

Definition at line 43 of file livesearch_reply.py.

00043 
00044 def quote_bad_chars(s):
00045     bad_chars = ["(", ")"]
00046     for char in bad_chars:
00047         s = s.replace(char, quotestring(char))
00048     return s
00049 
00050 # for now we just do a full search to prove a point, this is not the
00051 # way to do this in the future, we'd use a in-memory probability based
00052 # result set.
00053 # convert queries to zctextindex
00054 
00055 # XXX really if it contains + * ? or -
00056 # it will not be right since the catalog ignores all non-word
00057 # characters equally like
00058 # so we don't even attept to make that right.
00059 # But we strip these and these so that the catalog does
# not interpret them as metachars

Here is the call graph for this function:

Definition at line 40 of file livesearch_reply.py.

00040 
00041 def quotestring(s):
00042     return '"%s"' % s

Here is the caller graph for this function:

Definition at line 90 of file livesearch_reply.py.

00090 
00091 def write(s):
00092     output.append(safe_unicode(s))
00093 

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

livesearch_reply.catalog = context.portal_catalog

Definition at line 36 of file livesearch_reply.py.

Definition at line 126 of file livesearch_reply.py.

tuple livesearch_reply.friendly_types = ploneUtils.getUserFriendlyTypes()

Definition at line 38 of file livesearch_reply.py.

tuple livesearch_reply.full_title = safe_unicode(pretty_title_or_id(result))

Definition at line 124 of file livesearch_reply.py.

Definition at line 84 of file livesearch_reply.py.

tuple livesearch_reply.icon = plone_view.getIcon(result)

Definition at line 112 of file livesearch_reply.py.

tuple livesearch_reply.itemUrl = result.getURL()

Definition at line 113 of file livesearch_reply.py.

tuple livesearch_reply.label_advanced_search = _('label_advanced_search', default='Advanced Search…')

Definition at line 83 of file livesearch_reply.py.

tuple livesearch_reply.label_no_results_found = _('label_no_results_found', default='No matching results found.')

Definition at line 82 of file livesearch_reply.py.

tuple livesearch_reply.label_show_all = _('label_show_all', default='Show all…')

Definition at line 84 of file livesearch_reply.py.

tuple livesearch_reply.legend_livesearch = _('legend_livesearch', default='LiveSearch ↓')

Definition at line 81 of file livesearch_reply.py.

Definition at line 33 of file livesearch_reply.py.

Definition at line 32 of file livesearch_reply.py.

Definition at line 88 of file livesearch_reply.py.

tuple livesearch_reply.path = getNavigationRoot(context)

Definition at line 70 of file livesearch_reply.py.

tuple livesearch_reply.plone_view = context.restrictedTraverse('@@plone')

Definition at line 21 of file livesearch_reply.py.

tuple livesearch_reply.ploneUtils = getToolByName(context, 'plone_utils')

Definition at line 18 of file livesearch_reply.py.

tuple livesearch_reply.portal_url = getToolByName(context, 'portal_url')

Definition at line 19 of file livesearch_reply.py.

tuple livesearch_reply.portalProperties = getToolByName(context, 'portal_properties')

Definition at line 23 of file livesearch_reply.py.

livesearch_reply.pretty_title_or_id = ploneUtils.pretty_title_or_id

Definition at line 20 of file livesearch_reply.py.

tuple livesearch_reply.q = q.replace(char, ' ')

q = re.compile(r'[*\?-+]+').sub(' ', q)

Definition at line 62 of file livesearch_reply.py.

tuple livesearch_reply.r = q.split()

Definition at line 63 of file livesearch_reply.py.

livesearch_reply.RESPONSE = context.REQUEST.RESPONSE

Definition at line 75 of file livesearch_reply.py.

tuple livesearch_reply.results = catalog(SearchableText=r, portal_type=friendly_types, path=path)

Definition at line 71 of file livesearch_reply.py.

string livesearch_reply.searchterm_query = '?searchterm=%s'

Definition at line 73 of file livesearch_reply.py.

tuple livesearch_reply.searchterms = url_quote_plus(r)

Definition at line 66 of file livesearch_reply.py.

tuple livesearch_reply.site_encoding = context.plone_utils.getSiteEncoding()

Definition at line 68 of file livesearch_reply.py.

tuple livesearch_reply.siteProperties = getattr(portalProperties, 'site_properties', None)

Definition at line 24 of file livesearch_reply.py.

tuple livesearch_reply.ts = getToolByName(context, 'translation_service')

Definition at line 86 of file livesearch_reply.py.

Definition at line 30 of file livesearch_reply.py.

Definition at line 31 of file livesearch_reply.py.

Definition at line 25 of file livesearch_reply.py.