Skip to content

Commit

Permalink
Merge pull request #3 from IQSS/develop
Browse files Browse the repository at this point in the history
Merge upstream changes to 2043-split-gb-table branch
  • Loading branch information
mdmADA authored May 21, 2019
2 parents 0f71cc0 + aa59755 commit b8d1fbd
Show file tree
Hide file tree
Showing 38 changed files with 536 additions and 125 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ If you are interested in working on the main Dataverse code, great! Before you s

Please read http://guides.dataverse.org/en/latest/developers/version-control.html to understand how we use the "git flow" model of development and how we will encourage you to create a GitHub issue (if it doesn't exist already) to associate with your pull request. That page also includes tips on making a pull request.

After making your pull request, your goal should be to help it advance through our kanban board at https://waffle.io/IQSS/dataverse . If no one has moved your pull request to the code review column in a timely manner, please reach out. Thanks!
After making your pull request, your goal should be to help it advance through our kanban board at https://github.com/orgs/IQSS/projects/2 . If no one has moved your pull request to the code review column in a timely manner, please reach out. Thanks!

[dataverse-community Google Group]: https://groups.google.com/group/dataverse-community
[Community Call]: https://dataverse.org/community-calls
Expand Down
2 changes: 1 addition & 1 deletion PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Welcome! New contributors should at least glance at [CONTRIBUTING.md](/CONTRIBUT

## Related Issues

- connects to #ISSUE_NUMBER: ISSUE_TITLE
- #ISSUE_NUMBER: ISSUE_TITLE

## Pull Request Checklist

Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Dataverse®
===============

Dataverse is an [open source][] web application for sharing, citing, analyzing, and preserving research data (developed by the [Data Science and Products team](http://www.iq.harvard.edu/people/people/data-science-products) at the [Institute for Quantitative Social Science](http://iq.harvard.edu/) and the [Dataverse community][]).
Dataverse is an [open source][] software platform for sharing, finding, citing, and preserving research data (developed by the [Data Science and Products team](http://www.iq.harvard.edu/people/people/data-science-products) at the [Institute for Quantitative Social Science](http://iq.harvard.edu/) and the [Dataverse community][]).

[dataverse.org][] is our home on the web and shows a map of Dataverse installations around the world, a list of [features][], [integrations][] that have been made possible through [REST APIs][], our development [roadmap][], and more.

Expand All @@ -17,8 +17,6 @@ Dataverse is a trademark of President and Fellows of Harvard College and is regi

[![Dataverse Project logo](src/main/webapp/resources/images/dataverseproject_logo.jpg?raw=true "Dataverse Project")](http://dataverse.org)

[![Waffle.io - Columns and their card count](https://badge.waffle.io/IQSS/dataverse.svg?columns=all)](https://waffle.io/IQSS/dataverse)

[![Build Status](https://travis-ci.org/IQSS/dataverse.svg?branch=develop)](https://travis-ci.org/IQSS/dataverse) [![Coverage Status](https://coveralls.io/repos/IQSS/dataverse/badge.svg?branch=develop&service=github)](https://coveralls.io/github/IQSS/dataverse?branch=develop)

[dataverse.org]: https://dataverse.org
Expand Down
4 changes: 4 additions & 0 deletions doc/release-notes/3575-usernames.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* In an effort to prevent accidental duplicate accounts, user spoofing, or other username-based confusion, this release introduces a database constraint that no longer allows usernames that are exactly the same but use different capitalization, e.g. Bob11 vs. bob11. You may need to do some cleanup before upgrading to deal with existing usernames like this.
* To check whether you have any usernames like this that need cleaning up, run the case insensitive duplicate queries from our [Useful Queries doc](https://docs.google.com/document/d/1-Y_iUduSxdDNeK1yiGUxe7t-Md7Fy965jp4o4m1XEoE/edit?usp=sharing "Useful Queries doc").
* Once you identify the usernames that need cleaning up, you should use either [Merge User Accounts](http://guides.dataverse.org/en/latest/api/native-api.html#merge-user-accounts) (if it’s the same person) or [Change User Identifier](http://guides.dataverse.org/en/latest/api/native-api.html#change-user-identifier) (if they are different people).
* After the cleanup you can safely upgrade without issue.
2 changes: 1 addition & 1 deletion doc/sphinx-guides/source/admin/dataverses-datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,5 @@ As a superuser, click "Update Current Version" when publishing. (This option is
Diagnose Constraint Violations Issues in Datasets
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

To identifiy invalid data values in specific datasets (if, for example, an attempt to edit a dataset results in a ConstraintViolationException in the server log), or to check all the datasets in the Dataverse for constraint violations, see :ref:`Dataset Validation <dataset-validation-api>` in the :doc:`/api/native-api` section of the User Guide.
To identify invalid data values in specific datasets (if, for example, an attempt to edit a dataset results in a ConstraintViolationException in the server log), or to check all the datasets in the Dataverse for constraint violations, see :ref:`Dataset Validation <dataset-validation-api>` in the :doc:`/api/native-api` section of the User Guide.

24 changes: 23 additions & 1 deletion doc/sphinx-guides/source/api/dataaccess.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,18 @@ It returns a zipped bundle that contains the data in the following formats:
* Data (Variable) metadata record, in DDI XML;
* File citation, in Endnote and RIS formats.


Parameters:
~~~~~~~~~~~
none.

``fileMetadataId``

============== ===========
Value Description
============== ===========
ID Exports file with specific file metadata ``ID``.
============== ===========


Data Variable Metadata Access
-----------------------------
Expand Down Expand Up @@ -177,6 +186,19 @@ Example:
</dataDscr>
</codeBook>
Parameters:
~~~~~~~~~~~

``fileMetadataId``

============== ===========
Value Description
============== ===========
ID Exports file with specific file metadata ``ID``. For example for data file with id 6 and file metadata id 2: ``curl 'http://localhost:8080/api/access/datafile/6/metadata/ddi?fileMetadataId=2'``
============== ===========


More information on DDI is available in the :doc:`/user/tabulardataingest/ingestprocess` section of the User Guide.

Advanced options/Parameters:
Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx-guides/source/developers/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ For the Dataverse development roadmap, please see https://dataverse.org/goals-ro
Kanban Board
------------

You can get a sense of what's currently in flight (in dev, in QA, etc.) by looking at https://waffle.io/IQSS/dataverse
You can get a sense of what's currently in flight (in dev, in QA, etc.) by looking at https://github.com/orgs/IQSS/projects/2

Issue Tracker
-------------
Expand Down
15 changes: 2 additions & 13 deletions doc/sphinx-guides/source/developers/making-releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Making Releases
.. contents:: |toctitle|
:local:

Use the number of the milestone with a "v" in front for the relase tag. For example: ``v4.6.2``.
Use the number of the milestone with a "v" in front for the release tag. For example: ``v4.6.2``.

Create the release GitHub issue and branch
------------------------------------------
Expand All @@ -32,18 +32,7 @@ Add the version being released to the lists in the following two files:

Here's an example commit where three of the four files above were updated at once: https://github.com/IQSS/dataverse/commit/99e23f96ec362ac2f524cb5cd80ca375fa13f196

2. Save the EJB Database Create Script
======================================

Save the script ``domains/domain1/generated/ejb/dataverse/dataverse_VDCNet-ejbPU_createDDL.jdbc`` created by EJB during the deployment of the release candidate. **Important:** add semicolons to the ends of the SQL commands in the EJB-generated file (see below)! Save the resulting file as ``scripts/database/create/create_v{VERSION_TAG}.sql`` using the version number tag for the release. For example:

.. code-block:: none
sed 's/$/;/' dataverse_VDCNet-ejbPU_createDDL.jdbc > scripts/database/create/create_v4.10.sql
(We are saving the script above to support the new experimental process for updating the database across multiple versions; see ``scripts/database/README_upgrade_across_versions.txt`` for more information.)

3. Check in the Changes Above...
2. Check in the Changes Above...
================================

... into the release branch, make a pull request and merge the release branch into develop.
Expand Down
6 changes: 3 additions & 3 deletions doc/sphinx-guides/source/developers/version-control.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ For guidance on which issue to work on, please ask! Also, see https://github.com

Let's say you want to tackle https://github.com/IQSS/dataverse/issues/3728 which points out a typo in a page of Dataverse's documentation.

If you tell us your GitHub username we are happy to add you to the "read only" team at https://github.com/orgs/IQSS/teams/dataverse-readonly/members so that we can assign the issue to you while you're working on it. You can also tell us if you'd like to be added to the `Dataverse Community Contributors spreadsheet <https://docs.google.com/spreadsheets/d/1o9DD-MQ0WkrYaEFTD5rF_NtyL8aUISgURsAXSL7Budk/edit?usp=sharing>`_ and the `Dev Efforts by the Dataverse Community spreadsheet <https://groups.google.com/d/msg/dataverse-community/X2diSWYll0w/ikp1TGcfBgAJ>`_.
If you tell us your GitHub username we are happy to add you to the "read only" team at https://github.com/orgs/IQSS/teams/dataverse-readonly/members so that we can assign the issue to you while you're working on it. You can also tell us if you'd like to be added to the `Dataverse Community Contributors spreadsheet <https://docs.google.com/spreadsheets/d/1o9DD-MQ0WkrYaEFTD5rF_NtyL8aUISgURsAXSL7Budk/edit?usp=sharing>`_.

Create a New Branch off the develop Branch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -82,14 +82,14 @@ Push your feature branch to your fork of Dataverse. Your git command may look so
Make a Pull Request
~~~~~~~~~~~~~~~~~~~

Make a pull request to get approval to merge your changes into the develop branch. Feedback on the pull request template we use is welcome! The "connects to #3728" syntax is important because it's used at https://waffle.io/IQSS/dataverse to associate pull requests with issues.
Make a pull request to get approval to merge your changes into the develop branch. Feedback on the pull request template we use is welcome!

Here's an example of a pull request for issue #3728: https://github.com/IQSS/dataverse/pull/3827

Make Sure Your Pull Request Has Been Advanced to Code Review
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Now that you've made your pull request, your goal is to make sure it appears in the "Code Review" column at https://waffle.io/IQSS/dataverse
Now that you've made your pull request, your goal is to make sure it appears in the "Code Review" column at https://github.com/orgs/IQSS/projects/2

Look at https://github.com/IQSS/dataverse/blob/master/CONTRIBUTING.md for various ways to reach out to developers who have enough access to the GitHub repo to move your issue and pull request to the "Code Review" column.

Expand Down
90 changes: 84 additions & 6 deletions doc/sphinx-guides/source/installation/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,84 @@ Once you have the location of your custom CSS file, run this curl command to add

``curl -X PUT -d '/var/www/dataverse/branding/custom-stylesheet.css' http://localhost:8080/api/admin/settings/:StyleCustomizationFile``

.. _i18n:

Internationalization
--------------------

Dataverse is being translated into multiple languages by the Dataverse community! Please see below for how to help with this effort!

Adding Multiple Languages to the Dropdown in the Header
++++++++++++++++++++++++++++++++++++++++++++++++++++++++

The presence of the :ref:`:Languages` database setting adds a dropdown in the header for multiple languages. For example to add English and French to the dropdown:

``curl http://localhost:8080/api/admin/settings/:Languages -X PUT -d '[{"locale":"en","title":"English"},{"locale":"fr","title":"Français"}]'``

Configuring the "lang" Directory
++++++++++++++++++++++++++++++++

Translations for Dataverse are stored in "properties" files in a directory on disk (e.g. ``/home/glassfish/langBundles``) that you specify with the :ref:`dataverse.lang.directory` ``dataverse.lang.directory`` JVM option, like this:

``./asadmin create-jvm-options '-Ddataverse.lang.directory=/home/glassfish/langBundles'``

Go ahead and create the directory you specified.

``mkdir /home/glassfish/langBundles``

Creating a languages.zip File
+++++++++++++++++++++++++++++

Dataverse provides and API endpoint for adding languages using a zip file.

First, clone the "dataverse-language-packs" git repo.

``git clone https://github.com/GlobalDataverseCommunityConsortium/dataverse-language-packs.git``

Take a look at https://github.com/GlobalDataverseCommunityConsortium/dataverse-language-packs/branches to see if the version of Dataverse you're running has translations.

Change to the directory for the git repo you just cloned.

``cd dataverse-language-packs``

Switch (``git checkout``) to the branch based on Dataverse version you are running. The branch "dataverse-v4.13" is used in the example below.

``export BRANCH_NAME=dataverse-v4.13``

``git checkout $BRANCH_NAME``

Create a "languages" directory in "/tmp".

``mkdir /tmp/languages``

Copy the properties files into the "languages" directory

``cp -R en_US/*.properties /tmp/languages``

``cp -R fr_CA/*.properties /tmp/languages``

Create the zip file

``cd /tmp/languages``

``zip languages.zip *.properties``

Load the languages.zip file into Dataverse
++++++++++++++++++++++++++++++++++++++++++

Now that you have a "languages.zip" file, you can load it into Dataverse with the command below.

``curl http://localhost:8080/api/admin/datasetfield/loadpropertyfiles -X POST --upload-file /tmp/languages/languages.zip -H "Content-Type: application/zip"``

Click on the languages using the drop down in the header to try them out.

How to Help Translate Dataverse Into Your Language
++++++++++++++++++++++++++++++++++++++++++++++++++

Please join the `dataverse-internationalization-wg`_ mailing list and contribute to https://github.com/GlobalDataverseCommunityConsortium/dataverse-language-packs to help translate Dataverse into various languages!

.. _dataverse-internationalization-wg: https://groups.google.com/forum/#!forum/dataverse-internationalization-wg

.. _Web-Analytics-Code:

Web Analytics Code
Expand Down Expand Up @@ -897,13 +975,13 @@ This JVM option is only relevant if you plan to run multiple Glassfish servers f
dataverse.lang.directory
++++++++++++++++++++++++

This JVM option is used to configure the path where all the language specific property files are to be stored. If this option is set then the english property file must be present in the path along with any other language property file. You can download language property files from https://github.com/GlobalDataverseCommunityConsortium/dataverse-language-packs
This JVM option is used to configure the path where all the language specific property files are to be stored. If this option is set then the English property file must be present in the path along with any other language property file. You can download language property files from https://github.com/GlobalDataverseCommunityConsortium/dataverse-language-packs

``./asadmin create-jvm-options '-Ddataverse.lang.directory=PATH_LOCATION_HERE'``

If this value is not set, by default, a Dataverse installation will read the English language property files from the Java Application.

See also the ``:Languages`` setting below.
See also :ref:`i18n`.

dataverse.files.hide-schema-dot-org-download-urls
+++++++++++++++++++++++++++++++++++++++++++++++++
Expand Down Expand Up @@ -1633,15 +1711,15 @@ Sets the path where the raw Make Data Count logs are stored before being process

``curl -X PUT -d '/usr/local/glassfish4/glassfish/domains/domain1/logs' http://localhost:8080/api/admin/settings/:MDCLogPath``

.. _:Languages:

:Languages
++++++++++

Sets which languages should be available. If there is more than one, a dropdown is displayed
in the header. This should be formated as a JSON array as shown below.

``curl http://localhost:8080/api/admin/settings/:Languages -X PUT -d '[{ "locale":"en", "title":"English"}, { "locale":"fr", "title":"Français"}]'``
in the header.

See also the ``dataverse.lang.directory`` JVM option above.
See :ref:`i18n` for a curl example and related settings.

:InheritParentRoleAssignments
+++++++++++++++++++++++++++++
Expand Down
1 change: 1 addition & 0 deletions scripts/database/reference_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ INSERT INTO guestbook(
-- gets an answer. See also https://github.com/IQSS/dataverse/issues/2598#issuecomment-158219334
CREATE UNIQUE INDEX dataverse_alias_unique_idx on dataverse (LOWER(alias));
CREATE UNIQUE INDEX index_authenticateduser_lower_email ON authenticateduser (lower(email));
CREATE UNIQUE INDEX index_authenticateduser_lower_useridentifier ON authenticateduser (lower(useridentifier));
-- this field has been removed from builtinuser; CREATE UNIQUE INDEX index_builtinuser_lower_email ON builtinuser (lower(email));

--Edit Dataset: Investigate and correct multiple draft issue: https://github.com/IQSS/dataverse/issues/2132
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/ValidationMessages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ user.lastName=Please enter your last name.
user.invalidEmail=Please enter a valid email address.
user.enterUsername=Please enter a username.
user.usernameLength=Username must be between 2 and 60 characters.
user.illegalCharacters=Found an illegal character(s). Valid characters are a-Z, 0-9, '_', '-', and '.'."
user.illegalCharacters=Found an illegal character(s). Valid characters are a-Z, 0-9, '_', '-', and '.'.

user.enterNickname=Please enter a nickname.
user.nicknameLength=Nickname must be at most 30 characters.
Expand Down Expand Up @@ -46,4 +46,4 @@ password.retype=The new password is blank: re-type it again.
password.current=Please enter your current password.
password.validate=Password reset page default email message.
guestbook.name=Enter a name for the guestbook
guestbook.name=Enter a name for the guestbook
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class ConfigureFragmentBean implements java.io.Serializable{
private Long fileId = null;
private ExternalToolHandler toolHandler = null;
private String messageApi = "";
private Long fileMetadataId = null;

@EJB
DataFileServiceBean datafileService;
Expand Down Expand Up @@ -95,7 +96,7 @@ public ExternalToolHandler getConfigurePopupToolHandler() {
}


toolHandler = new ExternalToolHandler(tool, datafileService.find(fileId), apiToken);
toolHandler = new ExternalToolHandler(tool, datafileService.find(fileId), apiToken, datafileService.findFileMetadata(fileMetadataId));

return toolHandler;
}
Expand All @@ -116,8 +117,10 @@ public void generateApiToken() {

}

public void setConfigureFileId(Long setFileId) {
public void setConfigureIds(Long setFileId, Long setFileMetadataId) {

fileId = setFileId;
fileMetadataId = setFileMetadataId;
}

public String getMessageApi() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/edu/harvard/iq/dataverse/DatasetVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -1853,7 +1853,7 @@ public String getJsonLd() {
} else {
if (FileUtil.isPubliclyDownloadable(fileMetadata)) {
String nullDownloadType = null;
fileObject.add("contentUrl", dataverseSiteUrl + FileUtil.getFileDownloadUrlPath(nullDownloadType, fileMetadata.getDataFile().getId(), false));
fileObject.add("contentUrl", dataverseSiteUrl + FileUtil.getFileDownloadUrlPath(nullDownloadType, fileMetadata.getDataFile().getId(), false, fileMetadata.getId()));
}
}
fileArray.add(fileObject);
Expand Down
Loading

0 comments on commit b8d1fbd

Please sign in to comment.