import searchform, resultlist, drilldown websiteConfig = configs['website'] def main(headers={}, arguments={}, *args, **kwargs): httpQuery = arguments.get('query', [''])[0] httpQuery = escapeHtml(httpQuery) arguments['query'][0] = httpQuery logger.debug('httpQuery: "' + httpQuery +'"') messageOfTheDay = websiteConfig.get('messageOfTheDay', section = 'userFeedback') sortBy = sortDescending = None sortKeys = arguments.get('sortKeys', [''])[0] if not sortKeys: sortKeys = any.configuration().get('defaultSortKeys', None) if sortKeys: sortBy, ignored, sortDescending = sortKeys.split(',') sortDescending = sortDescending == '1' drilldownArguments = arguments.get('drilldown', []) ### parsetree wordt doorgegeven aan search engine via de call executeCQL ### cqlQuery is de serialisatie die gebruikt wordt voor RSS # logger.debug('httpQuery: '+httpQuery) # logger.debug('drilldownArguments:\n' + prpt.pformat(drilldownArguments)) parsetree, cqlQuery = any.parseQuery(httpQuery, drilldownArguments) t0 = time() offset = int(arguments.get('offset', ['0'])[0]) ### De start en stop argumenten bepalen het begin en eind record welke worden teruggegeven. ### De +10 in de stop is dus de batchgrootte. total, recordIds = any.executeCQL(cqlAbstractSyntaxTree=parsetree, start=offset, stop=offset+10, sortBy=sortBy, sortDescending=sortDescending) bitMatrixRow = any.bitMatrixRow(cqlAbstractSyntaxTree=parsetree) duration = time() - t0 yield """
""" yield """
%s
""" %messageOfTheDay yield searchform.main(arguments=arguments, *args, **kwargs) rssLink = '%s/rss?%s' % (any.configuration().get('host', ''), urlencode({'query': cqlQuery})) yield """
""" % rssLink yield 'rss' % rssLink yield """
""" yield resultlist.main(total=total, recordIds=recordIds, bitMatrixRow=bitMatrixRow, duration=duration, cqlQuery=cqlQuery, httpQuery=httpQuery, arguments=arguments, *args, **kwargs) yield """
"""