예제 #1
0
 def _create_marcxml_record(obj, eng):
     from inspire.dojson.hepnames import hepnames2marc
     from inspire.dojson.utils import legacy_export_as_marc
     obj.extra_data["marcxml"] = legacy_export_as_marc(
         hepnames2marc.do(obj.data)
     )
     obj.log.info("Produced MarcXML: \n {}".format(
         obj.extra_data["marcxml"])
     )
예제 #2
0
파일: views.py 프로젝트: jma/inspire-next
def marcxml_filter(record):
    from inspire.dojson.hep import hep2marc
    from inspire.dojson.hepnames import hepnames2marc
    from inspire.dojson.utils import legacy_export_as_marc

    collections = [collection["primary"] for collection in record["collections"]]

    if "HEP" in collections:
        return legacy_export_as_marc(hep2marc.do(record))
    elif "HEPNAMES" in collections:
        return legacy_export_as_marc(hepnames2marc.do(record))