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"])
def _batchDelete(sh, rows, batch): register_async.callWrapper( sh, rows, "noid_egg.batchDeleteIdentifier", noid_egg.batchDeleteIdentifier, [identifier for identifier, metadata in batch], )
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)
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"], )
def _batchCreate(sh, rows, batch): register_async.callWrapper(sh, rows, "noid_egg.batchSetElements", noid_egg.batchSetElements, batch)
def _delete(sh, rows, id, metadata): register_async.callWrapper(sh, rows, "noid_egg.deleteIdentifier", noid_egg.deleteIdentifier, id)
def _create(sh, rows, id, metadata): register_async.callWrapper(sh, rows, "noid_egg.setElements", noid_egg.setElements, id, metadata)