# $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 """
""" # mods = any.getMods(recordId) yield """ \n""" yield availability.main(record=record, recordId=recordId) ### 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} else: value = record[label] yield fieldRow(label, value) # yield """
Availability
view metadata
""" %recordId # url = any.createOpenURL(mods) # yield '

' # yield '%s' % (url, url) # yield '

' ### de volgende regel geeft een permission denied error ????? hangt ws. samem met javascript handleOpenUrl() #yield '

%s

' % url # yield '
' ### geen ratings # yield 'Current rating ' # yield rating.showRating(recordId) # yield '  ' # yield rating.showCreateRating(Headers, recordId) # # yield '
' #### the following can be used for testing # header = parse(any.getStream(recordId, 'header')) # meta = parse(any.getStream(recordId, 'meta')) # mods = any.getMods(recordId) # modsRecord = escapeXml(tostring(mods, pretty_print = True)) # yield '

mods

' # yield '
%s
' % modsRecord # headerRecord = escapeXml(tostring(header, pretty_print = True)) # yield '

header

' # yield '
%s
' % headerRecord # metaRecord = escapeXml(tostring(meta, pretty_print = True)) # yield '

meta

' # yield '
%s
' % metaRecord # extra = parse(any.getStream(recordId, 'extra')) # extraRecord = escapeXml(tostring(extra, pretty_print = True)) # yield '

extra

' # yield '
%s
' % extraRecord # metadata = any.getMetadata(recordId) # metadataRecord = escapeXml(tostring(metadata, pretty_print = True)) # yield '

metadata

' # yield '
%s
' % metadataRecord #yield '