import rating def fieldRow(name, value): row = '\n%s%s' %(name, value) return row def main(arguments, Headers={}, *args, **kwargs): recordId = arguments.get('recordId',[None])[0] if recordId.split(':')[0] in ['opc-uvt-nl']: metadata = parse(any.getStream(recordId, 'mods')) else: metadata = parse(any.getStream(recordId, 'metadata')) header = parse(any.getStream(recordId, 'header')) meta = parse(any.getStream(recordId, 'meta')) extra = parse(any.getStream(recordId, 'extra')) record = any.createRecord(metadata) mods = any.getMods(metadata) yield """
""" if ('title' in record): yield fieldRow('Title', record['title']) if ('authors' in record): yield fieldRow('Author(s)', record['authors']) if ('supervisors' in record): yield fieldRow('Supervisor(s)', record['supervisors']) if ('publisher' in record): yield fieldRow('Publisher', record['publisher']) if ('source' in record): yield fieldRow('Source', record['source']) if ('date' in record): yield fieldRow('Publication year', record['date']) if ('url' in record): value = '* %(url)s' %{'url':record['url']} yield fieldRow('URL', value) if ('keywords' in record): yield fieldRow('Keyword(s)', record['keywords']) if ('classification' in record): yield fieldRow('Classification', record['classification']) if ('abstract' in record): yield fieldRow('Abstract', record['abstract']) if ('issn' in record): yield fieldRow('ISSN', record['issn']) if ('isbn' in record): yield fieldRow('ISBN', record['isbn']) if ('genre' in record): yield fieldRow('Document type', record['genre']) yield """
""" # 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 '
' yield 'Current rating ' yield rating.showRating(recordId) yield '  ' yield rating.showCreateRating(Headers, recordId) yield '
' #### the following can be used for testing # 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 # extraRecord = escapeXml(tostring(extra, pretty_print = True)) # yield '

extra

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

metadata

' yield '
%s
' % metadataRecord #yield '