Exemplo n.º 1
0
def _delete(sh, rows, doi, metadata):
    # We can't actually delete a DOI, so we do the next best thing...
    register_async.callWrapper(sh, rows, "datacite.setTargetUrl",
                               _setTargetUrl, doi,
                               "http://datacite.org/invalidDOI",
                               metadata["_d"])
    register_async.callWrapper(sh, rows, "datacite.deactivate",
                               datacite.deactivate, doi[4:], metadata["_d"])
Exemplo n.º 2
0
def _batchDelete(sh, rows, batch):
    register_async.callWrapper(
        sh,
        rows,
        "noid_egg.batchDeleteIdentifier",
        noid_egg.batchDeleteIdentifier,
        [identifier for identifier, metadata in batch],
    )
Exemplo n.º 3
0
def _update(sh, rows, id, metadata):
    m = register_async.callWrapper(sh, rows, "noid_egg.getElements",
                                   noid_egg.getElements, id)
    if m == None: m = {}
    for k, v in metadata.items():
        if m.get(k) == v:
            del m[k]
        else:
            m[k] = v
    for k in m.keys():
        if k not in metadata: m[k] = ""
    if len(m) > 0:
        register_async.callWrapper(sh, rows, "noid_egg.setElements",
                                   noid_egg.setElements, id, m)
Exemplo n.º 4
0
def _overwrite(sh, rows, doi, metadata):
    register_async.callWrapper(
        sh,
        rows,
        "datacite.uploadMetadata",
        _uploadMetadata,
        doi,
        metadata,
        metadata["_d"],
    )
    register_async.callWrapper(
        sh,
        rows,
        "datacite.setTargetUrl",
        _setTargetUrl,
        doi,
        metadata["_t"],
        metadata["_d"],
    )
    if metadata.get("_is", "public") != "public" or metadata.get(
            "_x", "yes") != "yes":
        register_async.callWrapper(
            sh,
            rows,
            "datacite.deactivate",
            datacite.deactivate,
            doi[4:],
            metadata["_d"],
        )
Exemplo n.º 5
0
def _batchCreate(sh, rows, batch):
    register_async.callWrapper(sh, rows, "noid_egg.batchSetElements",
                               noid_egg.batchSetElements, batch)
Exemplo n.º 6
0
def _delete(sh, rows, id, metadata):
    register_async.callWrapper(sh, rows, "noid_egg.deleteIdentifier",
                               noid_egg.deleteIdentifier, id)
Exemplo n.º 7
0
def _create(sh, rows, id, metadata):
    register_async.callWrapper(sh, rows, "noid_egg.setElements",
                               noid_egg.setElements, id, metadata)