import rating
namespaceMap = {
'mods':"http://www.loc.gov/mods/v3",
'extra':"http://meresco.com/namespace/fields/extra",
'meta':"http://meresco.com/namespace/harvester/meta",
}
def xpath(node, path):
result = node.xpath(path, namespaceMap)
return result and result[0] or ''
def main(arguments, Headers={}, *args, **kwargs):
recordId = arguments.get('recordId',[None])[0]
metadata = parse(any.getStream(recordId, 'metadata'))
mods = xpath(metadata, '//mods:mods')
title = xpath(mods, 'mods:titleInfo/mods:title/text()')
yield """
\n'
yield '
%s
\n' % title
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
modsRecord = escapeXml(tostring(mods, pretty_print = True))
yield '
%s
' % modsRecord
yield '
Current rating '
yield rating.showRating(recordId)
yield '
\n'
yield '
'
yield rating.showCreateRating(Headers, recordId)
yield '
'
yield '
'
#yield '