示例#1
0
文件: views.py 项目: ini-bdds/minid
def create_ark(creator, title, created, test):
    print "Creating ARK"
    if test:
        print "Using test EZID namespace"
        client = EZIDClient(app.config["TEST_EZID_SERVER"],
            app.config["TEST_EZID_USERNAME"],
            app.config["TEST_EZID_PASSWORD"],
            app.config["TEST_EZID_SCHEME"],
            app.config["TEST_EZID_SHOULDER"])
    else:
        client = EZIDClient(app.config["EZID_SERVER"], 
            app.config["EZID_USERNAME"], 
            app.config["EZID_PASSWORD"], 
            app.config["EZID_SCHEME"], 
            app.config["EZID_SHOULDER"])
   
    if title is None: 
        title = ""
    #data = {"erc.who" : creator, "erc.what" : title, "erc.when" : str(created)} 
    data= {"_profile" : "datacite", "datacite.creator" : creator, "datacite.title" :  title, 
            "datacite.publicationyear" : str(created.year),
            "datacite.publisher": "BD2K Minid"}#, "datacite.resourcetype" : "dataset"}
   
    response = client.mint_identifier(data)
    print "minted %s" % app.config["HOSTNAME"] 
    data ["_target"] = "%s/%s" % (app.config["LANDING_PAGE"], response["identifier"])
    client.update_identifier(response["identifier"], data)
    return response["identifier"]
示例#2
0
def create_ark(creator, created, title):
    print "Creating ARK"
    client = EZIDClient(app.config["EZID_SERVER"], app.config["EZID_USERNAME"],
                        app.config["EZID_PASSWORD"], app.config["EZID_SCHEME"],
                        app.config["EZID_SHOULDER"])

    data = {"erc.who": creator, "erc.what": title, "erc.when": created}

    response = client.mint_identifier(data)
    print "minted %s" % app.config["HOSTNAME"]
    data["_target"] = "%s/%s" % (app.config["LANDING_PAGE"],
                                 response["identifier"])
    client.update_identifier(response["identifier"], data)
    return response["identifier"]
示例#3
0
文件: views.py 项目: ianwdunlop/minid
def create_ark(creator, created, title):
    print "Creating ARK"
    client = EZIDClient(app.config["EZID_SERVER"], 
            app.config["EZID_USERNAME"], 
            app.config["EZID_PASSWORD"], 
            app.config["EZID_SCHEME"], 
            app.config["EZID_SHOULDER"])
    
    data = {"erc.who" : creator, "erc.what" : title, "erc.when" : created }

    response = client.mint_identifier(data)
    print "minted %s" % app.config["HOSTNAME"] 
    data ["_target"] = "%s/%s" % (app.config["LANDING_PAGE"], response["identifier"])
    client.update_identifier(response["identifier"], data)
    return response["identifier"]
示例#4
0
文件: views.py 项目: madduri/minid
def create_ark(creator, title, created, test):
    print("Creating ARK")
    if test:
        print("Using test EZID namespace")
        client = EZIDClient(app.config["TEST_EZID_SERVER"],
                            app.config["TEST_EZID_USERNAME"],
                            app.config["TEST_EZID_PASSWORD"],
                            app.config["TEST_EZID_SCHEME"],
                            app.config["TEST_EZID_SHOULDER"])
    else:
        client = EZIDClient(app.config["EZID_SERVER"],
                            app.config["EZID_USERNAME"],
                            app.config["EZID_PASSWORD"],
                            app.config["EZID_SCHEME"],
                            app.config["EZID_SHOULDER"])

    if title is None:
        title = ""
    #data = {"erc.who" : creator, "erc.what" : title, "erc.when" : str(created)}
    data = {
        "_profile": "datacite",
        "datacite.creator": creator,
        "datacite.title": title,
        "datacite.publicationyear": str(created.year),
        "datacite.publisher": "BD2K Minid"
    }  #, "datacite.resourcetype" : "dataset"}

    response = client.mint_identifier(data)
    print("minted %s" % app.config["HOSTNAME"])
    data["_target"] = "%s/%s" % (app.config["LANDING_PAGE"],
                                 response["identifier"])
    client.update_identifier(response["identifier"], data)
    return response["identifier"]