Skip to content

Commit

Permalink
Merge branch 'develop' into 5253-metrics-block-ui #5253
Browse files Browse the repository at this point in the history
  • Loading branch information
pdurbin committed Jul 22, 2019
2 parents b94e54d + aa4d314 commit e63cf5f
Show file tree
Hide file tree
Showing 55 changed files with 336 additions and 268 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: java
jdk:
- oraclejdk8
- openjdk8
script: mvn -DcompilerArgument=-Xlint:unchecked test -P all-unit-tests
after_success: mvn jacoco:report coveralls:report
5 changes: 0 additions & 5 deletions doc/release-notes/2202-improved-file-detection.md

This file was deleted.

4 changes: 0 additions & 4 deletions doc/release-notes/3575-usernames.md

This file was deleted.

1 change: 0 additions & 1 deletion doc/release-notes/4660-custom-analytics-config.md

This file was deleted.

2 changes: 0 additions & 2 deletions doc/release-notes/4690-custom-s3-url.md

This file was deleted.

10 changes: 0 additions & 10 deletions doc/release-notes/4980-upgrades-across-versions.md

This file was deleted.

1 change: 0 additions & 1 deletion doc/release-notes/5011-search-by-dataverse-alias.md

This file was deleted.

15 changes: 0 additions & 15 deletions doc/release-notes/5323-saved-original-size

This file was deleted.

7 changes: 0 additions & 7 deletions doc/release-notes/5478-refactor-swift-properties.md

This file was deleted.

3 changes: 0 additions & 3 deletions doc/release-notes/5565-file-folder-names.md

This file was deleted.

1 change: 0 additions & 1 deletion doc/release-notes/5584-dataset-page-solr.md

This file was deleted.

4 changes: 0 additions & 4 deletions doc/release-notes/5589-broken-error-pages.md

This file was deleted.

1 change: 0 additions & 1 deletion doc/release-notes/5649-upgrade-postgresql.md

This file was deleted.

6 changes: 6 additions & 0 deletions doc/release-notes/5687-invalid-notifications.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The following needs to be added to the release notes and/or upgrade instructions:

In making this fix we discovered that notifications created prior to 2018 may have been invalidated. With this release we advise that these older notifications are deleted from the database. The following query can be used for this purpose:

delete from usernotification where date_part('year', senddate) < 2018;

4 changes: 4 additions & 0 deletions doc/release-notes/5766-citation-tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Update citation metadata block
curl http://localhost:8080/api/admin/datasetfield/load -X POST --data-binary @citation.tsv -H "Content-type: text/tab-separated-values"

Run ReExportall to update the citation metadata block to remove an errant tab: http://guides.dataverse.org/en/4.16/admin/metadataexport.html?highlight=export#batch-exports-through-the-api
1 change: 1 addition & 0 deletions doc/release-notes/5967-custom-analytics-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update your custom analytics code to include CDATA sections, inside the `script` tags, around the javascript code. We have updated the documentation and sample analytics code snippet provided in [Installation Guide > Configuration > Web Analytics Code](http://guides.dataverse.org/en/latest/installation/config.html#web-analytics-code) to fix a bug that broke the rendering of the 403 and 500 custom error pgs (#5967).
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=YOUR ACCOUNT CODE"></script>
<script>
//<![CDATA[
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date()); gtag('config', 'YOUR ACCOUNT CODE');
</script>
<script>

window.addEventListener("load", enableAnalyticsEventCapture, false);

function enableAnalyticsEventCapture() {
Expand Down Expand Up @@ -145,4 +145,5 @@
label = label.substring(label.indexOf('/dataverse/') + 11, index).split(/[?#]/)[0];
return(label);
}
//]]>
</script>
43 changes: 34 additions & 9 deletions doc/sphinx-guides/source/developers/documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,41 @@ Documentation
Quick Fix
-----------

If you find a typo or a small error in the documentation you can easily fix it using GitHub.
If you find a typo or a small error in the documentation you can fix it using GitHub's online web editor. Generally speaking, we will be following https://help.github.com/en/articles/editing-files-in-another-users-repository

- Fork the repository
- Go to [your GitHub username]/dataverse/doc/sphinx-guides/source and access the file you would like to fix
- Switch to the branch that is currently under development
- Click the Edit button in the upper-right corner and fix the error
- Submit a pull request
- Navigate to https://github.com/IQSS/dataverse/tree/develop/doc/sphinx-guides/source where you will see folders for each of the guides:

- `admin`_
- `api`_
- `developers`_
- `installation`_
- `user`_

- Find the file you want to edit under one of the folders above.
- Click the pencil icon in the upper-right corner. If this is your first contribution to Dataverse, the hover text over the pencil icon will say "Fork this project and edit this file".
- Make changes to the file and preview them.
- In the **Commit changes** box, enter a description of the changes you have made and click **Propose file change**.
- Under the **Write** tab, delete the long welcome message and write a few words about what you fixed.
- Click **Create Pull Request**.

That's it! Thank you for your contribution! Your pull request will be added manually to the main Dataverse project board at https://github.com/orgs/IQSS/projects/2 and will go through code review and QA before it is merged into the "develop" branch. Along the way, developers might suggest changes or make them on your behalf. Once your pull request has been merged you will be listed as a contributor at https://github.com/IQSS/dataverse/graphs/contributors

Please see https://github.com/IQSS/dataverse/pull/5857 for an example of a quick fix that was merged (the "Files changed" tab shows how a typo was fixed).

If you would like to read more about the Dataverse project's use of GitHub, please see the :doc:`version-control` section. For bug fixes and features we request that you create an issue before making a pull request but this is not at all necessary for quick fixes to the documentation.

.. _admin: https://github.com/IQSS/dataverse/tree/develop/doc/sphinx-guides/source/admin
.. _api: https://github.com/IQSS/dataverse/tree/develop/doc/sphinx-guides/source/api
.. _developers: https://github.com/IQSS/dataverse/tree/develop/doc/sphinx-guides/source/developers
.. _installation: https://github.com/IQSS/dataverse/tree/develop/doc/sphinx-guides/source/installation
.. _user: https://github.com/IQSS/dataverse/tree/develop/doc/sphinx-guides/source/user

Other Changes (Sphinx)
----------------------

The documentation for Dataverse was written using Sphinx (http://sphinx-doc.org/).
If you are interested in suggesting changes or updates we recommend that you create
the html files using Sphinx locally and the submit a pull request through GitHub. Here are the instructions on how to proceed:
the html files using Sphinx locally and then submit a pull request through GitHub. Here are the instructions on how to proceed:


Installing Sphinx
Expand Down Expand Up @@ -50,7 +71,11 @@ Using Sphinx

First, you will need to make a fork of the dataverse repository in GitHub. Then, you will need to make a clone of your fork so you can manipulate the files outside GitHub.

To edit the existing documentation go to ~/dataverse/doc/sphinx-guides/source directory inside your clone. There, you will find the .rst files that correspond to the guides in the dataverse page (http://guides.dataverse.org/en/latest/user/index.html). Now, using your preferred text editor, open and edit these files, or create new .rst files and edit the others accordingly.
To edit the existing documentation:

- Create a branch (refer to http://guides.dataverse.org/en/latest/developers/version-control.html > *Create a New Branch off the develop Branch*) to record the changes you are about to perform.
- Go to ~/dataverse/doc/sphinx-guides/source directory inside your clone. There, you will find the .rst files that correspond to the guides in the dataverse page (http://guides.dataverse.org/en/latest/).
- Using your preferred text editor, open and edit the necessary files, or create new ones.

Once you are done, open a terminal and change directories to ~/dataverse/doc/sphinx-guides . Then, run the following commands:

Expand All @@ -61,7 +86,7 @@ Once you are done, open a terminal and change directories to ~/dataverse/doc/sph
After sphinx is done processing the files you should notice that the html folder in ~/dataverse/doc/sphinx-guides/build directory has been updated.
You can click on the files in the html folder to preview the changes.

Now you can make a commit with the changes to your own fork in GitHub and submit a pull request to the dataverse repository.
Now you can make a commit with the changes to your own fork in GitHub and submit a pull request to the original (upstream) dataverse repository.

Table of Contents
-----------------
Expand Down
2 changes: 2 additions & 0 deletions doc/sphinx-guides/source/installation/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -634,11 +634,13 @@ Create your own ``analytics-code.html`` file using the analytics code snippet pr
<!-- Global Site Tag (gtag.js) - Google Analytics -->
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=YOUR-ACCOUNT-CODE"></script>
<script>
//<![CDATA[
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'YOUR-ACCOUNT-CODE');
//]]>
</script>
**IMPORTANT:** Note the "async" attribute in the first script line above. In the documentation provided by Google, its value is left blank (as in ``<script async src="...">``). It must be set as in the example above (``<script async="async" src="...">``), otherwise it may cause problems with some browsers.
Expand Down
4 changes: 2 additions & 2 deletions scripts/api/data/metadatablocks/citation.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
publication Related Publication Publications that use the data from this Dataset. none 28 FALSE FALSE TRUE FALSE TRUE FALSE citation http://purl.org/dc/terms/isReferencedBy
publicationCitation Citation The full bibliographic citation for this related publication. textbox 29 #VALUE TRUE FALSE FALSE FALSE TRUE FALSE publication citation http://purl.org/dc/terms/bibliographicCitation
publicationIDType ID Type The type of digital identifier used for this publication (e.g., Digital Object Identifier (DOI)). text 30 #VALUE: TRUE TRUE FALSE FALSE TRUE FALSE publication citation http://purl.org/spar/datacite/ResourceIdentifierScheme
publicationIDNumber ID Number The identifier for the selected ID type. text 31 #VALUE TRUE FALSE FALSE FALSE TRUE FALSE publication citation http://purl.org/spar/datacite/ResourceIdentifier
publicationIDNumber ID Number The identifier for the selected ID type. text 31 #VALUE TRUE FALSE FALSE FALSE TRUE FALSE publication citation http://purl.org/spar/datacite/ResourceIdentifier
publicationURL URL Link to the publication web page (e.g., journal article page, archive record page, or other). Enter full URL, starting with http:// url 32 <a href="#VALUE" target="_blank">#VALUE</a> FALSE FALSE FALSE FALSE FALSE FALSE publication citation https://schema.org/distribution
notesText Notes Additional important information about the Dataset. textbox 33 FALSE FALSE FALSE FALSE TRUE FALSE citation
language Language Language of the Dataset text 34 TRUE TRUE TRUE TRUE FALSE FALSE citation http://purl.org/dc/terms/language
Expand Down Expand Up @@ -95,7 +95,7 @@
subject Social Sciences D11 12
subject Other D12 13
publicationIDType ark 0
publicationIDType arXiv 1 arxiv
publicationIDType arXiv 1
publicationIDType bibcode 2
publicationIDType doi 3
publicationIDType ean13 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public String inactiveDataset(String doi) {

public static void main(String[] args) throws Exception {
String doi = "10.5072/DVN/274533";
DataCiteRESTfullClient client = new DataCiteRESTfullClient("https://mds.test.datacite.org", "DATACITE.HARVARD", "DVNapitest");
DataCiteRESTfullClient client = new DataCiteRESTfullClient("https://mds.test.datacite.org", "DATACITE_TEST_USERNAME", "DATACITE_TEST_PASSWORD");
// System.out.println(client.getUrl(doi));
// System.out.println(client.getMetadata(doi));
// System.out.println(client.postMetadata(readAndClose("C:/Users/luopc/Desktop/datacite.xml", "utf-8")));
Expand Down
36 changes: 26 additions & 10 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
import edu.harvard.iq.dataverse.search.SearchFields;
import edu.harvard.iq.dataverse.search.SearchServiceBean;
import edu.harvard.iq.dataverse.search.SearchUtil;
import edu.harvard.iq.dataverse.search.SolrClientService;
import java.util.Comparator;
import java.util.TimeZone;
import javax.servlet.http.HttpServletRequest;
Expand Down Expand Up @@ -212,6 +213,8 @@ public enum DisplayMode {
PrivateUrlServiceBean privateUrlService;
@EJB
ExternalToolServiceBean externalToolService;
@EJB
SolrClientService solrClientService;
@Inject
DataverseRequestServiceBean dvRequestService;
@Inject
Expand Down Expand Up @@ -725,7 +728,7 @@ public boolean isThisVersionSearchable() {
QueryResponse queryResponse = null;

try {
queryResponse = getSolrServer().query(solrQuery);
queryResponse = solrClientService.getSolrClient().query(solrQuery);
} catch (Exception ex) {
logger.fine("Solr exception: " + ex.getLocalizedMessage());
// solr maybe down/some error may have occurred...
Expand Down Expand Up @@ -840,7 +843,7 @@ public Set<Long> getFileIdsInVersionFromSolr(Long datasetVersionId, String patte
Set<Long> resultIds = new HashSet<>();

try {
queryResponse = getSolrServer().query(solrQuery);
queryResponse = solrClientService.getSolrClient().query(solrQuery);
} catch (HttpSolrClient.RemoteSolrException ex) {
logger.fine("Remote Solr Exception: " + ex.getLocalizedMessage());
String msg = ex.getLocalizedMessage();
Expand All @@ -858,7 +861,7 @@ public Set<Long> getFileIdsInVersionFromSolr(Long datasetVersionId, String patte
logger.fine("Solr query (trying again): " + solrQuery);

try {
queryResponse = getSolrServer().query(solrQuery);
queryResponse = solrClientService.getSolrClient().query(solrQuery);
} catch (Exception ex) {
logger.warning("Caught a Solr exception (again!): " + ex.getLocalizedMessage());
return resultIds;
Expand Down Expand Up @@ -4828,6 +4831,25 @@ public void setPrivateUrlJustCreatedToFalse() {
privateUrlWasJustCreated = false;
}

public boolean isShowLinkingPopup() {
return showLinkingPopup;
}

public void setShowLinkingPopup(boolean showLinkingPopup) {
this.showLinkingPopup = showLinkingPopup;
}

private boolean showLinkingPopup = false;

//

/*
public void setSelectedGroup(ExplicitGroup selectedGroup) {
setShowDeletePopup(true);
this.selectedGroup = selectedGroup;
}
*/

public void createPrivateUrl() {
try {
PrivateUrl createdPrivateUrl = commandEngine.submit(new CreatePrivateUrlCommand(dvRequestService.getDataverseRequest(), dataset));
Expand Down Expand Up @@ -5131,13 +5153,7 @@ public void archiveVersion(Long id) {
}
}
}

private SolrClient solrServer = null;

private SolrClient getSolrServer () {
return searchService.getSolrServer();
}


private static Date getFileDateToCompare(FileMetadata fileMetadata) {
DataFile datafile = fileMetadata.getDataFile();

Expand Down
Loading

0 comments on commit e63cf5f

Please sign in to comment.