drilldownFieldNames = { 'drilldown.norm.date.year': {'en':'Year', 'nl':'Jaar'}, 'drilldown.norm.date.decennium': {'en':'Decennium', 'nl':'Decennium'}, 'drilldown.norm.date.centennium': {'en':'Centennium', 'nl':'Centennium'}, 'drilldown.norm.name.oneinitial': {'en':'Name', 'nl':'Naam'}, 'drilldown.norm.name.lastname': {'en':'Top 10 Names', 'nl':'Top 10 Namen'}, 'drilldown.meta.repository.id': {'en':'Repository', 'nl':'Repository'}, 'drilldown.meta.repository.repositoryGroupId': {'en':'Source', 'nl':'Bron'}, 'drilldown.mods.classification': {'en':'Classification', 'nl':'Classificatie'}, 'drilldown.mods.genre': {'en':'Genre', 'nl':'Genre'}, 'drilldown.mods.language.languageTerm': {'en':'Language', 'nl':'Taal'}, 'drilldown.mods.relatedItem.titleInfo.title': {'en':'Journal/series', 'nl':'Tijdschrift/reeks'}, 'drilldown.mods.subject.topic': {'en':'Subject', 'nl':'Onderwerp'} } drilldownFields = [ #####(field, number, sorted)##### ##### number == 0: all items? don't understand how number works; nothing is done with number #('drilldown.mods.name.namePart', 20, False), #('drilldown.norm.name.oneinitial', 20, False), ('drilldown.meta.repository.id', 10, False), ('drilldown.meta.repository.repositoryGroupId', 10, False), ('drilldown.mods.classification', 10, False), ('drilldown.mods.genre', 0, False), ('drilldown.mods.language.languageTerm', 10, False), ('drilldown.mods.relatedItem.titleInfo.title', 10, False), ('drilldown.mods.subject.topic', 10, False) ] def fieldAndTermSplit(fieldAndTerm): return fieldAndTerm.split(':', 1) def fieldAndTermJoin(field, term): return '%s:%s' % (field, term) def shrink(aString, maxLength=160): if len(aString) > maxLength: return aString[:maxLength] + '...' return aString def createDrilldownQuery(drilldownArgs, httpQuery): newArguments = [('query', httpQuery)] for existing in drilldownArgs: newArguments.append(('drilldown', existing)) return urlencode(newArguments) def main(hits, httpQuery, arguments, path='', *args, **kwargs): language = path.startswith('/en/') and 'en' or 'nl' yield '
%s
' % {'nl':'Geselecteerde facetten', 'en':'Selected Facets'}[language] yield '%s
' % label yield '%s
' % label yield '