# $URL$ # $Id$ import paginate BASEURLJOURNALCOVERS = 'http://drcwww.uvt.nl/~place/elsevier/' import rating def renderSingleItem(index, link, metadata, recordId): record = any.createRecord(metadata) yield '' yield '%s.' % index if 'genre' in record: genre = record['genre'] else: genre = '' if 'abstract' in record: abstract = record['abstract'] else: abstract = '' yield '%s' % genre yield '%s' % ( link, record['title'] ) yield ' ' % (index, index) yield '' % index yield '' % index yield '
' % index yield escapeHtml(abstract) yield '
' # yield """ # ' if 'date' in record: date=record['date'] else: date='' if 'authors' in record: authors=record['authors'] else: authors='' yield '%s' % date yield '%s' % authors yield '' yield rating.showRating(recordId, imageSize='small') yield """ """ mods = any.getMods(metadata) url = any.createOpenURL(mods) coverUrl = getCoverUrlFor(record) if coverUrl: yield 'NO COVER AVAILABLE' %coverUrl else: yield '' if 'source' in record: source=record['source'] else: source='' yield '%s' %source id = 'td' + str(index) yield """ \n""" % {'url' : url, 'id' : id } def getCoverUrlFor(record): if 'issn' in record: return '%s/%s.gif' % (BASEURLJOURNALCOVERS, record['issn']) if 'isbn' in record: return 'http://syndetics.com/index.aspx?isbn=%s/sc.gif&client=univantilburg' % record['isbn'] def main(total=0, recordIds=[], bitMatrixRow=[], duration=0, cqlQuery=None, httpQuery='', arguments={}, path='', *args, **kwargs): language = path.startswith('/en/') and 'en' or 'nl' offset = int(arguments.get('offset', ['0'])[0]) lo, hi = offset + 1, min(offset + len(recordIds), total) yield """
""" yield {'nl':'Resultaten %s - %s van %d (%.5s seconden).', 'en': 'Results %s - %s of %d (%.5s seconds).'}[language] % (lo, hi, total, duration) yield """
""" yield paginate.main(offset, total, arguments=arguments, path=path, *args, **kwargs) yield """
""" index = offset for recordId in recordIds: ####### using the complete metadata record instead of only the mods part if recordId.split(':')[0] in ['opc-uvt-nl']: metadata = parse(any.getStream(recordId, 'mods')) else: metadata = parse(any.getStream(recordId, 'metadata')) link = 'page/recordview?' + urlencode({ 'recordId': recordId}) index += 1 yield renderSingleItem(index, link, metadata, recordId) yield """
""" yield paginate.main(offset, total, arguments=arguments, path=path, *args, **kwargs) yield """
"""