def convert_metajson(metajson, output_format):
    if output_format == constants.FORMAT_METAJSON or output_format == constants.FORMAT_HTML:
        return metajson

    elif output_format == constants.FORMAT_OPENURL:
        return openurl_crosswalk.metajson_to_openurl(metajson)

    elif output_format == constants.FORMAT_OPENURLCOINS:
        return openurl_crosswalk.metajson_to_openurlcoins(metajson)

    elif output_format == constants.FORMAT_REPEC:
        return repec_crosswalk.metajson_to_repec(metajson)

    elif output_format == constants.FORMAT_MODS:
        return mods_crosswalk.metajson_to_mods_xmletree(metajson)

    elif output_format == constants.FORMAT_BIBTEX:
        return bibtex_crosswalk.metajson_to_bibtex_entry(metajson)

    elif output_format == constants.FORMAT_OAI_DC:
        return oai_dc_crosswalk.metajson_to_oai_dc_xmletree(metajson)

    elif output_format == constants.FORMAT_METS:
        return mets_crosswalk.metajson_to_mets_xmletree(metajson)

    else:
        logging.error("convert_metajson : ERROR Not managed format: {}".format(output_format))
def cite(metajson_document, style, format):
    if format == "html":
        result = openurl_crosswalk.metajson_to_openurlcoins(metajson_document)

    if style == constants.STYLE_MLA:
        result = (result[0], result[1] + mla_style.cite(metajson_document, format))
    return result
Example #3
0
def convert_metajson(metajson, output_format):
    if output_format == constants.FORMAT_METAJSON or output_format == constants.FORMAT_HTML:
        return metajson

    elif output_format == constants.FORMAT_OPENURL:
        return openurl_crosswalk.metajson_to_openurl(metajson)

    elif output_format == constants.FORMAT_OPENURLCOINS:
        return openurl_crosswalk.metajson_to_openurlcoins(metajson)

    elif output_format == constants.FORMAT_REPEC:
        return repec_crosswalk.metajson_to_repec(metajson)

    elif output_format == constants.FORMAT_MODS:
        return mods_crosswalk.metajson_to_mods_xmletree(metajson)

    elif output_format == constants.FORMAT_BIBTEX:
        return bibtex_crosswalk.metajson_to_bibtex_entry(metajson)

    elif output_format == constants.FORMAT_OAI_DC:
        return oai_dc_crosswalk.metajson_to_oai_dc_xmletree(metajson)

    elif output_format == constants.FORMAT_METS:
        return mets_crosswalk.metajson_to_mets_xmletree(metajson)

    else:
        logging.error("convert_metajson : ERROR Not managed format: {}".format(output_format))
Example #4
0
def cite(metajson_document, style, format):
    if format == "html":
        result = openurl_crosswalk.metajson_to_openurlcoins(metajson_document)
    else:
        result = ["", ""]

    if style == constants.STYLE_MLA:
        result = result[1] + mla_style.cite(metajson_document, format)
    return result