def __init__(self): self.closed = False self.xml_generator = XMLGen() self.xml_generator.initXml() self.xml_generator.openTag(b'collection', [[b'xmlns', b'http://www.loc.gov/MARC21/slim']]) # This is horrible. but refactoring all the code in the indico core would be just as bad. admin = User.find_first(is_admin=True) self.output_generator = outputGenerator(admin, self.xml_generator)
def _process(self): xmlgen = XMLGen() xmlgen.initXml() outgen = outputGenerator(session.user, xmlgen) xmlgen.openTag(b'marc:record', [ [b'xmlns:marc', b'http://www.loc.gov/MARC21/slim'], [b'xmlns:xsi', b'http://www.w3.org/2001/XMLSchema-instance'], [b'xsi:schemaLocation', b'http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd']]) outgen.confToXMLMarc21(self.event) xmlgen.closeTag(b'marc:record') return send_file('event-{}.marc.xml'.format(self.event.id), BytesIO(xmlgen.getXml()), 'application/xml')
def _process(self): from indico.legacy.common.xmlGen import XMLGen from indico.legacy.common.output import outputGenerator xmlgen = XMLGen() xmlgen.initXml() outgen = outputGenerator(self.getAW(), xmlgen) xmlgen.openTag('marc:record', [ ['xmlns:marc', 'http://www.loc.gov/MARC21/slim'], ['xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'], ['xsi:schemaLocation', 'http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd']]) outgen.confToXMLMarc21(self._conf) xmlgen.closeTag('marc:record') return send_file(u'event-{}.marc.xml'.format(self.event_new.id), StringIO(xmlgen.getXml()), 'XML')