Skip to content

Commit

Permalink
Merge branch 'ORCiD-integration' of github.com:IQSS/dataverse into OR…
Browse files Browse the repository at this point in the history
…CiD-integration
  • Loading branch information
michbarsinai committed Oct 18, 2016
2 parents ff88a7d + b2fc184 commit 692f1f1
Show file tree
Hide file tree
Showing 16 changed files with 374 additions and 141 deletions.
15 changes: 15 additions & 0 deletions doc/sphinx-guides/source/_static/api/dataverse-complete.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "Scientific Research",
"alias": "science",
"dataverseContacts": [
{
"contactEmail": "pi@example.edu"
},
{
"contactEmail": "student@example.edu"
}
],
"affiliation": "Scientific Research University",
"description": "We do all the science.",
"dataverseType": "LABORATORY"
}
9 changes: 9 additions & 0 deletions doc/sphinx-guides/source/_static/api/dataverse-minimal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "Scientific Research",
"alias": "science",
"dataverseContacts": [
{
"contactEmail": "pi@example.edu"
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>Harvard Dataverse</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="The Dataverse Project is an open source software application to share, cite and archive data. Dataverse provides a robust infrastructure for data stewards to host and archive data, while offering researchers an easy way to share and get credit for their data." />

<link type="image/png" rel="icon" href="https://cdn.rawgit.com/IQSS/dataverse/87cf58b5c3e8e01cf0f4891465df02334852eed3/src/main/webapp/resources/images/favicondataverse.png.xhtml" />

<link type="image/png" rel="image_src" href="https://cdn.rawgit.com/IQSS/dataverse/87cf58b5c3e8e01cf0f4891465df02334852eed3/src/main/webapp/resources/images/dataverseproject.png.xhtml" />

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css" />

<link rel="stylesheet" href="https://cdn.rawgit.com/IQSS/dataverse/87cf58b5c3e8e01cf0f4891465df02334852eed3/src/main/webapp/resources/css/fontcustom.css" />

<link rel="stylesheet" href="https://cdn.rawgit.com/IQSS/dataverse/87cf58b5c3e8e01cf0f4891465df02334852eed3/src/main/webapp/resources/css/socicon.css" />

<link rel="stylesheet" href="https://cdn.rawgit.com/IQSS/dataverse/87cf58b5c3e8e01cf0f4891465df02334852eed3/src/main/webapp/resources/css/structure.css" />

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>

<style type="text/css">
@font-face {
font-family: "fontcustom";
src: url("https://cdn.rawgit.com/IQSS/dataverse/87cf58b5c3e8e01cf0f4891465df02334852eed3/src/main/webapp/resources/fontcustom/fontcustom_0cdeefae934823416d24b6c2132ac702.eot");
src: url("https://cdn.rawgit.com/IQSS/dataverse/87cf58b5c3e8e01cf0f4891465df02334852eed3/src/main/webapp/resources/fontcustom/fontcustom_0cdeefae934823416d24b6c2132ac702.eot?#iefix") format("embedded-opentype"),
url("https://cdn.rawgit.com/IQSS/dataverse/87cf58b5c3e8e01cf0f4891465df02334852eed3/src/main/webapp/resources/fontcustom/fontcustom_0cdeefae934823416d24b6c2132ac702.woff") format("woff"),
url("https://cdn.rawgit.com/IQSS/dataverse/87cf58b5c3e8e01cf0f4891465df02334852eed3/src/main/webapp/resources/fontcustom/fontcustom_0cdeefae934823416d24b6c2132ac702.ttf") format("truetype"),
url("https://cdn.rawgit.com/IQSS/dataverse/87cf58b5c3e8e01cf0f4891465df02334852eed3/src/main/webapp/resources/fontcustom/fontcustom_0cdeefae934823416d24b6c2132ac702.svg#fontcustom") format("svg");
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: 'socicon';
src: url('https://cdn.rawgit.com/IQSS/dataverse/87cf58b5c3e8e01cf0f4891465df02334852eed3/src/main/webapp/resources/socicon-font/socicon-webfont.eot');
src: url('https://cdn.rawgit.com/IQSS/dataverse/87cf58b5c3e8e01cf0f4891465df02334852eed3/src/main/webapp/resources/socicon-font/socicon-webfont.eot?#iefix') format('embedded-opentype'),
url('https://cdn.rawgit.com/IQSS/dataverse/87cf58b5c3e8e01cf0f4891465df02334852eed3/src/main/webapp/resources/socicon-font/socicon-webfont.woff') format('woff'),
url('https://cdn.rawgit.com/IQSS/dataverse/87cf58b5c3e8e01cf0f4891465df02334852eed3/src/main/webapp/resources/socicon-font/socicon-webfont.woff2') format('woff2'),
url('https://cdn.rawgit.com/IQSS/dataverse/87cf58b5c3e8e01cf0f4891465df02334852eed3/src/main/webapp/resources/socicon-font/socicon-webfont.ttf') format('truetype'),
url('https://cdn.rawgit.com/IQSS/dataverse/87cf58b5c3e8e01cf0f4891465df02334852eed3/src/main/webapp/resources/socicon-font/socicon-webfont.svg#sociconregular') format('svg');
font-weight: normal;
font-style: normal;
text-transform: initial;
}

@media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face {
font-family: "fontcustom";
src: url("https://cdn.rawgit.com/IQSS/dataverse/87cf58b5c3e8e01cf0f4891465df02334852eed3/src/main/webapp/resources/fontcustom/fontcustom_0cdeefae934823416d24b6c2132ac702.svg#fontcustom") format("svg");
}
}
</style>
</head>
<body>
<div id="dataverse-header-block">
<!-- Navbar Panel -->
<nav id="navbarFixed" class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<span class="navbar-brand"><i id="icon-dataverse" class="icon-dataverse"></i> Dataverse</span>
</div>
<div class="collapse navbar-collapse" id="topNavBar">
<ul class="nav navbar-nav navbar-right">
<li>
&#160;
</li>
</ul>
</div>
</div>
</nav>

<!-- Header Panel -->
<div style="background:#F5F5F5;" class="container bg-muted" id="dataverseHeader">
<div class="dataverseHeaderBlock">
<div class="dataverseHeaderCell dataverseHeaderLogo">
<img alt="Harvard Dataverse" src="https://cdn.rawgit.com/IQSS/dataverse/87cf58b5c3e8e01cf0f4891465df02334852eed3/doc/sphinx-guides/source/_static/installation/files/etc/maintenance/HarvardShield_RGB.png"/>
</div>
<div class="dataverseHeaderCell dataverseHeaderName">
<span class="dataverseHeaderDataverseName" style="color:#000000;">Harvard Dataverse</span>
</div>
<div class="dataverseHeaderCell dataverseHeaderTagline">
<span style="color:#a51c30;">A collaboration with Harvard Library, Harvard University IT, and IQSS</span>
</div>
</div>
</div>
</div>
<div class="container" id="content">
<div class="jumbotron" style="margin-top:20px;">
<h2><em>We apologize for the service interruption.</em></h2>
<p>The Harvard Dataverse is currently undergoing maintenance. At this time both the application and APIs are not able to be used. However, the datasets stored in the Harvard Dataverse are fine and not impacted by this maintenance.</p>
<p>If you have any comments, questions or concerns, please reach out to support@dataverse.org.</p>
</div>
</div>
<div class="container" id="footer">
<div class="row">
<div class="col-sm-8 small">
<p>Developed at the <a href="http://www.iq.harvard.edu/" title="Institute for Quantitative Social Science" target="_blank">Institute for Quantitative Social Science</a> &#160;|&#160; Dataverse Project on <a href="https://twitter.com/dataverseorg" target="_blank" title="Dataverse Project on Twitter"><span class="socicon socicon-twitter" title="Dataverse Project on Twitter"></span></a> &#160;|&#160; Code available at <a href="https://github.com/IQSS/dataverse" target="_blank" title="Dataverse On GitHub"><span class="socicon socicon-github" title="Dataverse On GitHub"></span></a>
</p>
<p>Copyright &#169; 2016, The President &#38; Fellows of Harvard College | <a href="http://best-practices.dataverse.org/harvard-policies/harvard-privacy-policy.html" target="_blank">Privacy Policy</a>
</p>
</div>
<div class="col-sm-4 text-right">
<div class="poweredbylogo">
<span>Powered by</span>
<a href="http://dataverse.org/" title="The Dataverse Project" target="_blank"><img src="https://cdn.rawgit.com/IQSS/dataverse/87cf58b5c3e8e01cf0f4891465df02334852eed3/src/main/webapp/resources/images/dataverseproject_logo.jpg" alt="The Dataverse Project" /></a>
</div>
</div>
</div>
</div>
</body>
</html>
15 changes: 14 additions & 1 deletion doc/sphinx-guides/source/api/native-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,24 @@ Endpoints

Dataverses
~~~~~~~~~~~
Generates a new dataverse under ``$id``. Expects a json content describing the dataverse.
Generates a new dataverse under ``$id``. Expects a JSON content describing the dataverse, as in the example below.
If ``$id`` is omitted, a root dataverse is created. ``$id`` can either be a dataverse id (long) or a dataverse alias (more robust). ::

POST http://$SERVER/api/dataverses/$id?key=$apiKey

The following JSON example can be `downloaded <../_static/api/dataverse-complete.json>`_ and modified to create dataverses to suit your needs. The fields ``name``, ``alias``, and ``dataverseContacts`` are required. The controlled vocabulary for ``dataverseType`` is

- ``JOURNALS``
- ``LABORATORY``
- ``ORGANIZATIONS_INSTITUTIONS``
- ``RESEARCHERS``
- ``RESEARCH_GROUP``
- ``RESEARCH_PROJECTS``
- ``TEACHING_COURSES``
- ``UNCATEGORIZED``

.. literalinclude:: ../_static/api/dataverse-complete.json

View data about the dataverse identified by ``$id``. ``$id`` can be the id number of the dataverse, its alias, or the special value ``:root``. ::

GET http://$SERVER/api/dataverses/$id
Expand Down
7 changes: 7 additions & 0 deletions doc/sphinx-guides/source/installation/administration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ https://github.com/IQSS/dataverse/issues/2595 contains some information on enabl

There is a database table called ``actionlogrecord`` that captures events that may be of interest. See https://github.com/IQSS/dataverse/issues/2729 for more discussion around this table.

Maintenance
----------

When you have scheduled down time for your production servers, we provide a `sample maintenance page <../_static/installation/files/etc/maintenance/maintenance.xhtml>`_ for you to use. To download, right-click and select "Save Link As".

The maintenance page is intended to be a static page served by Apache to provide users with a nicer, more informative experience when the site is unavailable.

User Administration
-------------------

Expand Down
20 changes: 15 additions & 5 deletions doc/sphinx-guides/source/user/dataverse-management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ to manage the settings described in this guide.
Create a Dataverse (Within the "Root" Dataverse)
===================================================

Creating a dataverse is easy but first you must be a registered user (see Create Account).
Creating a dataverse is easy but first you must be a registered user (see :doc:`/user/account`).

#. Once you are logged in click on the "Add Data" button and in the dropdown menu select "New Dataverse".
#. Once on the "New Dataverse" page fill in the following fields:
Expand All @@ -22,7 +22,7 @@ Creating a dataverse is easy but first you must be a registered user (see Create
* **Affiliation**: Add any Affiliation that can be associated to this particular dataverse (e.g., project name, institute name, department name, journal name, etc). This is automatically filled out if you have added an affiliation for your user account.
* **Description**: Provide a description of this dataverse. This will display on the home page of your dataverse and in the search result list. The description field supports certain HTML tags (<a>, <b>, <blockquote>, <br>, <code>, <del>, <dd>, <dl>, <dt>, <em>, <hr>, <h1>-<h3>, <i>, <img>, <kbd>, <li>, <ol>, <p>, <pre>, <s>, <sup>, <sub>, <strong>, <strike>, <ul>).
* **Category**: Select a category that best describes the type of dataverse this will be. For example, if this is a dataverse for an individual researcher's datasets, select Researcher. If this is a dataverse for an institution, select Organization & Institution.
* **Choose the sets of Metadata Elements for datasets in this dataverse**: by default the metadata elements will be from the host dataverse that this new dataverse is created in. Dataverse offers metadata standards for multiple domains. To learn more about the metadata standards in Dataverse please check out the appendix (insert link here)
* **Choose the sets of Metadata Elements for datasets in this dataverse**: by default the metadata elements will be from the host dataverse that this new dataverse is created in. Dataverse offers metadata standards for multiple domains. To learn more about the metadata standards in Dataverse please check out the :doc:`/user/appendix`.
* **Select facets for this dataverse**: by default the facets that will appear on your dataverse landing page will be from the host dataverse that this new dataverse was created in. The facets are simply metadata fields that can be used to help others easily find dataverses and datasets within this dataverse. You can select as many facets as you would like.
#. Selected metadata elements are also used to pick which metadata fields you would like to use for creating templates for your datasets. Metadata fields can be hidden, or selected as required or optional. Once you have selected all the fields you would like to use, you can create your template(s) after you finish creating your dataverse.
#. Click "Create Dataverse" button and you're done!
Expand Down Expand Up @@ -92,19 +92,24 @@ Permissions
When you access a dataverse's permissions page, you will see there are three sections: Permissions, Users/Groups, and Roles.

|image2|

Clicking on Permissions will bring you to this page:

|image3|

By clicking on the Edit Access button, you are able to change the settings allowing no one or anyone to add either dataverses or datasets to a dataverse.

|image4|

The Edit Access pop up allows you to also select if someone adding a dataset to this dataverse should be allowed to publish it (Curator role) or if the dataset will be submitted to the administrator of this dataverse to be reviewed then published (Contributor role). These Access settings can be changed at any time.

Assign Role
-----------------------
You can also give access to a Dataverse user to allow them to access an unpublished dataverse as well as other roles. To do this, click on the Assign Roles to Users/Groups button in the Users/Groups section. You can also give multiple users the same role at one time.
You can also give access to a Dataverse user to allow them to access an unpublished dataverse as well as other roles. To do this, click on the Assign Roles to Users/Groups button in the Users/Groups section. You can also give multiple users the same role at one time. This roles can be removed at any time.

|image5|
|image6|
This roles can be removed at any time.

|image6|

.. _dataset-templates:

Expand Down Expand Up @@ -176,10 +181,15 @@ is made public, it can no longer be unpublished.

.. |image1| image:: ./img/Dataverse-Diagram.png
.. |image2| image:: ./img/dvperms1.png
:class: img-responsive
.. |image3| image:: ./img/dv2.png
:class: img-responsive
.. |image4| image:: ./img/dv3.png
:class: img-responsive
.. |image5| image:: ./img/dv4.png
:class: img-responsive
.. |image6| image:: ./img/dv5.png
:class: img-responsive



6 changes: 3 additions & 3 deletions scripts/installer/install
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ else
print TMPCMD $sql_command;
close TMPCMD;

my $psql_commandline = $psql_exec . "/psql -h " . $CONFIG_DEFAULTS{'POSTGRES_SERVER'} . " -U postgres -d postgres -f /tmp/pgcmd.$$.tmp >/dev/null 2>&1";
my $psql_commandline = $psql_admin_exec . "/psql -h " . $CONFIG_DEFAULTS{'POSTGRES_SERVER'} . " -U postgres -d postgres -f /tmp/pgcmd.$$.tmp >/dev/null 2>&1";

my $out = qx($psql_commandline 2>&1);
my $exitcode = $?;
Expand All @@ -829,8 +829,8 @@ else
print "\nCreating Postgres database:\n";

my $psql_command =
$psql_admin_exec
. "/createdb -h " . $CONFIG_DEFAULTS{'POSTGRES_SERVER'} . " -U postgres "
$psql_exec
. "/createdb -h " . $CONFIG_DEFAULTS{'POSTGRES_SERVER'} . " -U $CONFIG_DEFAULTS{'POSTGRES_USER'} "
. $CONFIG_DEFAULTS{'POSTGRES_DATABASE'}
. " --owner="
. $CONFIG_DEFAULTS{'POSTGRES_USER'};
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,25 @@ public Response addDataverse( String body, @PathParam("identifier") String paren
d = execCommand( new CreateDataverseCommand(d, createDataverseRequest(u), null, null) );
return createdResponse( "/dataverses/"+d.getAlias(), json(d) );
} catch ( WrappedResponse ww ) {
Throwable cause = ww.getCause();
StringBuilder sb = new StringBuilder();
while (cause.getCause() != null) {
cause = cause.getCause();
if (cause instanceof ConstraintViolationException) {
ConstraintViolationException constraintViolationException = (ConstraintViolationException) cause;
for (ConstraintViolation<?> violation : constraintViolationException.getConstraintViolations()) {
sb.append(" Invalid value: <<<").append(violation.getInvalidValue()).append(">>> for ")
.append(violation.getPropertyPath()).append(" at ")
.append(violation.getLeafBean()).append(" - ")
.append(violation.getMessage());
}
}
}
String error = sb.toString();
if (!error.isEmpty()) {
LOGGER.log(Level.INFO, error);
return ww.refineResponse(error);
}
return ww.getResponse();

} catch (EJBException ex) {
Expand Down
18 changes: 17 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/util/json/JsonParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ public void setLenient(boolean lenient) {
public Dataverse parseDataverse(JsonObject jobj) throws JsonParseException {
Dataverse dv = new Dataverse();

/**
* @todo Instead of this getMandatoryString method we should run the
* String through ConstraintValidator. See EMailValidatorTest and
* EMailValidator for examples. That way we can check not only if it's
* required or not but other bean validation rules such as "must match
* this regex".
*/
dv.setAlias(getMandatoryString(jobj, "alias"));
dv.setName(getMandatoryString(jobj, "name"));
dv.setDescription(jobj.getString("description", null));
Expand All @@ -102,7 +109,16 @@ public Dataverse parseDataverse(JsonObject jobj) throws JsonParseException {
dv.setDataverseTheme(theme);
theme.setDataverse(dv);
}


dv.setDataverseType(Dataverse.DataverseType.UNCATEGORIZED); // default
if (jobj.containsKey("dataverseType")) {
for (Dataverse.DataverseType dvtype : Dataverse.DataverseType.values()) {
if (dvtype.name().equals(jobj.getString("dataverseType"))) {
dv.setDataverseType(dvtype);
}
}
}

/* We decided that subject is not user set, but gotten from the subject of the dataverse's
datasets - leavig this code in for now, in case we need to go back to it at some point
Expand Down
Loading

0 comments on commit 692f1f1

Please sign in to comment.