# $Id$ # $URL$ import rating, availability def fieldRow(name, value): row = '\n%s%s' %(name, value) return row def main(arguments, Headers={}, *args, **kwargs): recordId = arguments.get('recordId',[None])[0] record = any.createRecord(recordId) yield """
UvT Search Engine beta
""" # mods = any.getMods(recordId) yield """ \n""" yield """ """ ### getOrder() is method of Record() from bzv.record ### order is a dictionary; keys: numbers and values: field labels order = any.getOrder() ### sort the numbers order.keys().sort() for key in order.keys(): label = order[key] if label in record: if label == 'URL(s)': for url in record['URL(s)']: label = 'URL' value = '* %(url)s' %{'url':url} elif label == 'Dataset': value = '* %(url)s' %{'url':record['Dataset']} else: value = record[label] yield fieldRow(label, value) yield """
Availability """ yield availability.main(record=record, recordId=recordId) yield """
""" %recordId yield """
"""