Skip to content

Commit

Permalink
Merge pull request #4362 from IQSS/develop
Browse files Browse the repository at this point in the history
v4.8.4
  • Loading branch information
kcondon authored Dec 5, 2017
2 parents 2c3f3a1 + ef7dce7 commit 708fb95
Show file tree
Hide file tree
Showing 38 changed files with 894 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"factoryAlias":"oauth2",
"title":"ORCID",
"subtitle":"",
"factoryData":"type: orcid | userEndpoint: https://api.sandbox.orcid.org/v2.0/{ORCID}/record | clientId: FIXME | clientSecret: FIXME",
"factoryData":"type: orcid | userEndpoint: https://api.sandbox.orcid.org/v2.0/{ORCID}/person | clientId: FIXME | clientSecret: FIXME",
"enabled":true
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"factoryAlias":"oauth2",
"title":"ORCID",
"subtitle":"",
"factoryData":"type: orcid | userEndpoint: https://api.orcid.org/v2.0/{ORCID}/record | clientId: FIXME | clientSecret: FIXME",
"factoryData":"type: orcid | userEndpoint: https://api.orcid.org/v2.0/{ORCID}/person | clientId: FIXME | clientSecret: FIXME",
"enabled":true
}
9 changes: 7 additions & 2 deletions doc/sphinx-guides/source/admin/metadataexport.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ Metadata Export
Automatic Exports
-----------------

Unlike in DVN v3, publishing a dataset in Dataverse 4 automaticalliy starts a metadata export job, that will run in the background, asynchronously. Once completed, it will make the dataset metadata exported and cached in all the supported formats (Dublin Core, Data Documentation Initiative (DDI), and native JSON). There is no need to run the export manually.
Publishing a dataset automatically starts a metadata export job, that will run in the background, asynchronously. Once completed, it will make the dataset metadata exported and cached in all the supported formats:

- Dublin Core
- Data Documentation Initiative (DDI)
- Schema.org JSON-LD
- native JSON (Dataverse-specific)

A scheduled timer job that runs nightly will attempt to export any published datasets that for whatever reason haven't been exported yet. This timer is activated automatically on the deployment, or restart, of the application. So, again, no need to start or configure it manually. (See the "Application Timers" section of this guide for more information)

Expand All @@ -28,4 +33,4 @@ Note, that creating, modifying, or re-exporting an OAI set will also attempt to
Export Failures
---------------

An export batch job, whether started via the API, or by the application timer, will leave a detailed log in your configured logs directory. This is the same location where your main Glassfish server.log is found. The name of the log file is ``export_[timestamp].log`` - for example, *export_2016-08-23T03-35-23.log*. The log will contain the numbers of datasets processed successfully and those for which metadata export failed, with some information on the failures detected. Please attach this log file if you need to contact Dataverse support about metadata export problems.
An export batch job, whether started via the API, or by the application timer, will leave a detailed log in your configured logs directory. This is the same location where your main Glassfish server.log is found. The name of the log file is ``export_[timestamp].log`` - for example, *export_2016-08-23T03-35-23.log*. The log will contain the numbers of datasets processed successfully and those for which metadata export failed, with some information on the failures detected. Please attach this log file if you need to contact Dataverse support about metadata export problems.
2 changes: 1 addition & 1 deletion doc/sphinx-guides/source/api/native-api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Delete the dataset whose id is passed::

GET http://$SERVER/api/datasets/export?exporter=ddi&persistentId=$persistentId

.. note:: Supported exporters (export formats) are ``ddi``, ``oai_ddi``, ``dcterms``, ``oai_dc``, and ``dataverse_json``.
.. note:: Supported exporters (export formats) are ``ddi``, ``oai_ddi``, ``dcterms``, ``oai_dc``, ``schema.org`` , and ``dataverse_json``.

|CORS| Lists all the file metadata, for the given dataset and version::

Expand Down
4 changes: 2 additions & 2 deletions doc/sphinx-guides/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
# built documents.
#
# The short X.Y version.
version = '4.8.3'
version = '4.8.4'
# The full version, including alpha/beta/rc tags.
release = '4.8.3'
release = '4.8.4'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
4 changes: 2 additions & 2 deletions doc/sphinx-guides/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Dataverse 4.8.3 Guides
Dataverse 4.8.4 Guides
======================

These guides are for the most recent version of Dataverse. For the guides for **version 4.8.2** please go `here <http://guides.dataverse.org/en/4.8.2/>`_.
These guides are for the most recent version of Dataverse. For the guides for **version 4.8.3** please go `here <http://guides.dataverse.org/en/4.8.3/>`_.

.. toctree::
:glob:
Expand Down
12 changes: 12 additions & 0 deletions doc/sphinx-guides/source/installation/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,13 @@ Once you have the location of your custom header HTML file, run this curl comman

``curl -X PUT -d '/var/www/dataverse/branding/custom-header.html' http://localhost:8080/api/admin/settings/:HeaderCustomizationFile``

If you have enabled a custom header or navbar logo, you might prefer to disable the theme of the root dataverse. You can do so by setting ``:DisableRootDataverseTheme`` to ``true`` like this:

``curl -X PUT -d 'true' http://localhost:8080/api/admin/settings/:DisableRootDataverseTheme``

Please note: Disabling the display of the root dataverse theme also disables your ability to edit it. Remember that dataverse owners can set their dataverses to "inherit theme" from the root. Those dataverses will continue to inherit the root dataverse theme (even though it no longer displays on the root). If you would like to edit the root dataverse theme in the future, you will have to re-enable it first.


Custom Footer
+++++++++++++

Expand Down Expand Up @@ -679,6 +686,11 @@ See :ref:`Branding Your Installation` above.

See :ref:`Branding Your Installation` above.

:DisableRootDataverseTheme
++++++++++++++++++++++++++

See :ref:`Branding Your Installation` above.

:FooterCustomizationFile
++++++++++++++++++++++++

Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx-guides/source/user/dataverse-management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Tip: The metadata fields you select as required will appear on the Create Datase
Theme
====================================================

The Theme feature provides you with a way to customize the look of your dataverse. You can decide either to use the customization from the dataverse above yours or upload your own image file. Supported image types are JPEG, TIFF, or PNG and should be no larger than 500 KB. The maximum display size for an image file in a dataverse's theme is 940 pixels wide by 120 pixels high. Additionally, you can select the colors for the header of your dataverse and the text that appears in your dataverse. You can also add a link to your personal website, the website for your organization or institution, your department, journal, etc.
The Theme feature provides you with a way to customize the look of your dataverse. You can decide either to use the theme from the dataverse containing your dataverse (even up to the root dataverse, AKA the homepage), or upload your own image file. Supported image types are JPEG, TIFF, or PNG and should be no larger than 500 KB. The maximum display size for an image file in a dataverse's theme is 940 pixels wide by 120 pixels high. Additionally, you can select the colors for the header of your dataverse and the text that appears in your dataverse. You can also add a link to your personal website, the website for your organization or institution, your department, journal, etc.

.. _dataverse-widgets:

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>edu.harvard.iq</groupId>
<artifactId>dataverse</artifactId>
<version>4.8.3</version>
<version>4.8.4</version>
<packaging>war</packaging>

<name>dataverse</name>
Expand Down
2 changes: 2 additions & 0 deletions scripts/database/upgrades/upgrade_v4.8.3_to_v4.8.4.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Google login has used 131 characters. 64 is not enough.
ALTER TABLE oauth2tokendata ALTER COLUMN accesstoken TYPE text;
11 changes: 7 additions & 4 deletions src/main/java/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -749,9 +749,9 @@ dataverse.results.cards.foundInMetadata=Found in Metadata Fields:
dataverse.results.cards.files.tabularData=Tabular Data
dataverse.results.solrIsDown=Please note: Due to an internal error, browsing and searching is not available.
dataverse.theme.title=Theme
dataverse.theme.inheritCustomization.title=Check this to use the existing theme.
dataverse.theme.inheritCustomization.label=Inherit Customization
dataverse.theme.inheritCustomization.checkbox=Inherit customization from {0}
dataverse.theme.inheritCustomization.title=For this dataverse, use the same theme as the parent dataverse.
dataverse.theme.inheritCustomization.label=Inherit Theme
dataverse.theme.inheritCustomization.checkbox=Inherit theme from {0}
dataverse.theme.logo=Logo
dataverse.theme.logo.tip=Supported image types are JPG, TIF, or PNG and should be no larger than 500 KB. The maximum display size for an image file in a dataverse's theme is 940 pixels wide by 120 pixels high.
dataverse.theme.logo.format=Logo Format
Expand Down Expand Up @@ -794,6 +794,7 @@ dataverse.theme.website.title=URL for your personal website, institution, or any
dataverse.theme.website.tip=The website will be linked behind the tagline. To have a website listed, you must also provide a tagline.
dataverse.theme.website.watermark=Your personal site, http://...
dataverse.theme.website.invalidMsg=Invalid URL.
dataverse.theme.disabled=The theme for the root dataverse has been administratively disabled with the :DisableRootDataverseTheme database setting.
dataverse.widgets.title=Widgets
dataverse.widgets.notPublished.why.header=Why Use Widgets?
dataverse.widgets.notPublished.why.reason1=Increases the web visibility of your data by allowing you to embed your dataverse and datasets into your personal or project website.
Expand Down Expand Up @@ -1106,6 +1107,7 @@ dataset.editBtn.itemLabel.deaccession=Deaccession Dataset
dataset.exportBtn=Export Metadata
dataset.exportBtn.itemLabel.ddi=DDI
dataset.exportBtn.itemLabel.dublinCore=Dublin Core
dataset.exportBtn.itemLabel.schemaDotOrg=Schema.org JSON-LD
dataset.exportBtn.itemLabel.json=JSON
metrics.title=Metrics
metrics.title.tip=View more metrics information
Expand Down Expand Up @@ -1340,7 +1342,8 @@ file.spss-savEncoding.current=Current Selection:
file.spss-porExtraLabels=Variable Labels
file.spss-porExtraLabels.title=Upload an additional text file with extra variable labels.
file.spss-porExtraLabels.selectToAddBtn=Select File to Add
file.ingestFailed=Tabular Data Ingest Failed
file.ingestFailed.header=Upload Completed with Errors
file.ingestFailed.message=Tabular data ingest failed.
file.explore.twoRavens=TwoRavens
file.map=Map
file.mapData=Map Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public String generateXML() {
if (author.getIdType() != null && author.getIdValue() != null && !author.getIdType().isEmpty() && !author.getIdValue().isEmpty() && author.getAffiliation() != null && !author.getAffiliation().getDisplayValue().isEmpty()) {

if (author.getIdType().equals("ORCID")) {
creatorsElement.append("<nameIdentifier schemeURI=\"http://orcid.org/\" nameIdentifierScheme=\"ORCID\">" + author.getIdValue() + "</nameIdentifier>");
creatorsElement.append("<nameIdentifier schemeURI=\"https://orcid.org/\" nameIdentifierScheme=\"ORCID\">" + author.getIdValue() + "</nameIdentifier>");
}
if (author.getIdType().equals("ISNI")) {
creatorsElement.append("<nameIdentifier schemeURI=\"http://isni.org/isni/\" nameIdentifierScheme=\"ISNI\">" + author.getIdValue() + "</nameIdentifier>");
Expand Down
69 changes: 42 additions & 27 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,13 @@
import edu.harvard.iq.dataverse.datasetutility.TwoRavensHelper;
import edu.harvard.iq.dataverse.datasetutility.WorldMapPermissionHelper;
import edu.harvard.iq.dataverse.engine.command.exception.IllegalCommandException;
import edu.harvard.iq.dataverse.engine.command.impl.GetLatestPublishedDatasetVersionCommand;
import edu.harvard.iq.dataverse.engine.command.impl.RequestRsyncScriptCommand;
import edu.harvard.iq.dataverse.engine.command.impl.PublishDatasetResult;
import edu.harvard.iq.dataverse.engine.command.impl.RestrictFileCommand;
import edu.harvard.iq.dataverse.engine.command.impl.ReturnDatasetToAuthorCommand;
import edu.harvard.iq.dataverse.engine.command.impl.SubmitDatasetForReviewCommand;
import edu.harvard.iq.dataverse.export.SchemaDotOrgExporter;
import java.util.Collections;

import javax.faces.event.AjaxBehaviorEvent;
Expand Down Expand Up @@ -3944,23 +3946,6 @@ public String getDescription() {
return workingVersion.getDescriptionPlainText();
}

/**
* dataset publication date unpublished datasets will return an empty
* string.
*
* @return String dataset publication date (dd MMM yyyy).
*/
public String getPublicationDate() {
assert (null != workingVersion);
if (DatasetVersion.VersionState.DRAFT == workingVersion.getVersionState()) {
return "";
}
Date rel_date = workingVersion.getReleaseTime();
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
String r = fmt.format(rel_date.getTime());
return r;
}

/**
* dataset authors
*
Expand All @@ -3971,16 +3956,6 @@ public List<String> getDatasetAuthors() {
return workingVersion.getDatasetAuthorNames();
}

/**
* dataset subjects
*
* @return array of String containing the subjects for a page
*/
public List<String> getDatasetSubjects() {
assert (null != workingVersion);
return workingVersion.getDatasetSubjects();
}

/**
* publisher (aka - name of root dataverse)
*
Expand Down Expand Up @@ -4066,4 +4041,44 @@ public List<DatasetField> getDatasetSummaryFields() {
return DatasetUtil.getDatasetSummaryFields(workingVersion, customFields);
}

Boolean thisLatestReleasedVersion = null;

public boolean isThisLatestReleasedVersion() {
if (thisLatestReleasedVersion != null) {
return thisLatestReleasedVersion;
}

if (!workingVersion.isPublished()) {
thisLatestReleasedVersion = false;
return false;
}

DatasetVersion latestPublishedVersion = null;
Command<DatasetVersion> cmd = new GetLatestPublishedDatasetVersionCommand(dvRequestService.getDataverseRequest(), dataset);
try {
latestPublishedVersion = commandEngine.submit(cmd);
} catch (Exception ex) {
// whatever...
}

thisLatestReleasedVersion = workingVersion.equals(latestPublishedVersion);

return thisLatestReleasedVersion;

}

public String getJsonLd() {
if (isThisLatestReleasedVersion()) {
ExportService instance = ExportService.getInstance(settingsService);
String jsonLd = instance.getExportAsString(dataset, SchemaDotOrgExporter.NAME);
if (jsonLd != null) {
logger.fine("Returning cached schema.org JSON-LD.");
return jsonLd;
} else {
logger.fine("No cached schema.org JSON-LD available. Going to the database.");
return workingVersion.getJsonLd();
}
}
return "";
}
}
Loading

0 comments on commit 708fb95

Please sign in to comment.