eclipse-pass / main

Catch all repository against which issues of general, cross cutting topics are logged.
Apache License 2.0
4 stars 8 forks source link

Manually create Policy and Repository data #685

Closed rpoet-jh closed 1 year ago

rpoet-jh commented 1 year ago

We have manually loaded grants for dev and working group users. However, the stage pass still needs Policy and Repository data to be able to do the complete Submission workflow. We need to create at least one Policy and Repository that can be used with the grant created for the dev and working group users.

rpoet-jh commented 1 year ago

I execute the following on the EC2 instance in stage:

[
  {
    "op": "add",
    "path": "/repository",
    "value": {
      "id": "0",
      "type": "repository",
      "attributes": {
        "agreementText": "NON-EXCLUSIVE LICENSE FOR USE OF MATERIALS This non-exclusive license defines the terms for the deposit of Materials in all formats into the digital repository of materials collect
ed, preserved and made available through the Johns Hopkins Digital Repository, JScholarship. The Contributor hereby grants to Johns Hopkins a royalty free, non-exclusive worldwide license to use, re-use, di
splay, distribute, transmit, publish, re-publish or copy the Materials, either digitally or in print, or in any other medium, now or hereafter known, for the purpose of including the Materials hereby licens
ed in the collection of materials in the Johns Hopkins Digital Repository for educational use worldwide. In some cases, access to content may be restricted according to provisions established in negotiation
 with the copyright holder. This license shall not authorize the commercial use of the Materials by Johns Hopkins or any other person or organization, but such Materials shall be restricted to non-profit ed
ucational use. Persons may apply for commercial use by contacting the copyright holder. Copyright and any other intellectual property right in or to the Materials shall not be transferred by this agreement
and shall remain with the Contributor, or the Copyright holder if different from the Contributor. Other than this limited license, the Contributor or Copyright holder retains all rights, title, copyright an
d other interest in the images licensed. If the submission contains material for which the Contributor does not hold copyright, the Contributor represents that s/he has obtained the permission of the Copyri
ght owner to grant Johns Hopkins the rights required by this license, and that such third-party owned material is clearly identified and acknowledged within the text or content of the submission. If the sub
mission is based upon work that has been sponsored or supported by an agency or organization other than Johns Hopkins, the Contributor represents that s/he has fulfilled any right of review or other obligat
ions required by such contract or agreement. Johns Hopkins will not make any alteration, other than as allowed by this license, to your submission. This agreement embodies the entire agreement of the partie
s. No modification of this agreement shall be of any effect unless it is made in writing and signed by all of the parties to the agreement.",
        "integrationType": "full",
        "formSchema": "{\"id\":\"JScholarship\",\"schema\":{\"title\":\"Johns Hopkins - JScholarship <br><p class=\"lead text-muted\">Deposit requirements for JH\"s institutional repository JScholarship.</p
>\",\"type\":\"object\",\"properties\":{\"authors\":{\"title\":\"<div class=\"row\"><div class=\"col-6\">Author(s) <small class=\"text-muted\">(required)</small></div><div class=\"col-6 p-0\"></div></div>\"
,\"type\":\"array\",\"uniqueItems\":true,\"items\":{\"type\":\"object\",\"properties\":{\"author\":{\"type\":\"string\",\"fieldClass\":\"body-text col-6 pull-left pl-0\"}}}}}},\"options\":{\"fields\":{\"aut
hors\":{\"hidden\":false}}}}",
        "name": "JScholarship",
        "url": "https://jscholarship.library.jhu.edu/",
        "repositoryKey": "jscholarship",
        "schemas": [
          "https://eclipse-pass.github.io/metadata-schemas/jhu/jscholarship.json",
          "https://eclipse-pass.github.io/metadata-schemas/jhu/common.json"
        ]
      }
    }
  }
]

curl http://stage.internal.pass-core-api/data/ -u "pass_user:pass_pw" -X PATCH -H "content-type: application/vnd.api+json; ext=jsonpatch" -d "@stage_data_repo.json"

[
  {
    "op": "add",
    "path": "/policy",
    "value": {
      "id": "0",
      "type": "policy",
      "attributes": {
        "policyUrl": "https://provost.jhu.edu/about/open-access/",
        "description": "The university expects that every scholarly article produced by full-time faculty members be accessible in an open access repository. This can be achieved through deposits into exist
ing public access repositoryIds (such as PubMed Central, arXiv, etc.) and/or into Johns Hopkins institutional repository, JScholarship.",
        "title": "Johns Hopkins University (JHU) Open Access Policy"
      },
      "relationships": {
        "repositories": {
          "data": [
            {
              "id": "37441",
              "type": "repository"
            }
          ]
        }
      }
    }
  }
]

curl http://stage.internal.pass-core-api/data/ -u "pass_user:pass_pw" -X PATCH -H "content-type: application/vnd.api+json; ext=jsonpatch" -d "@stage_data_policy.json"

{
  "data": {
    "type": "funder",
    "id": "216",
    "relationships": {
      "policy": {
        "data": { "type": "policy", "id": "37442" }
      }
    }
  }
}
curl http://stage.internal.pass-core-api/data/funder/216 -u "pass_user:pass_pw" -X PATCH -H "content-type: application/vnd.api+json" -d @stage_data_patch_funder.json

The data files are in /home/passdemo/pass-stage-data