From db8ca376ed53698ec30e281c692664c97efe9466 Mon Sep 17 00:00:00 2001 From: Stephen Kraffmiller Date: Mon, 22 Feb 2016 08:52:05 -0500 Subject: [PATCH 1/7] #2833 Add custom text to Publish Popup --- scripts/api/setup-optional-publish-terms.sh | 8 ++++++++ .../harvard/iq/dataverse/DOIEZIdServiceBean.java | 6 ++++++ .../java/edu/harvard/iq/dataverse/DatasetPage.java | 13 +++++++++++++ .../iq/dataverse/settings/SettingsServiceBean.java | 12 +++++++++++- src/main/webapp/dataset.xhtml | 9 +++++++++ 5 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 scripts/api/setup-optional-publish-terms.sh diff --git a/scripts/api/setup-optional-publish-terms.sh b/scripts/api/setup-optional-publish-terms.sh new file mode 100644 index 00000000000..dc1e879ba68 --- /dev/null +++ b/scripts/api/setup-optional-publish-terms.sh @@ -0,0 +1,8 @@ +#!/bin/bash + + +SERVER=http://localhost:8080/api + +echo "- Enabling Publish Popup Custom Text" +curl -s -X PUT -d true "$SERVER/admin/settings/:DatasetPublishPopupCustomTextOnAllVersions" +curl -s -X PUT -d "Deposit License Requirements" "$SERVER/admin/settings/:DatasetPublishPopupCustomText" \ No newline at end of file diff --git a/src/main/java/edu/harvard/iq/dataverse/DOIEZIdServiceBean.java b/src/main/java/edu/harvard/iq/dataverse/DOIEZIdServiceBean.java index fb1ad692d7c..b2ff280c7c6 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DOIEZIdServiceBean.java +++ b/src/main/java/edu/harvard/iq/dataverse/DOIEZIdServiceBean.java @@ -61,6 +61,11 @@ public String createIdentifier(Dataset dataset) { String identifier = getIdentifierFromDataset(dataset); HashMap metadata = getMetadataFromStudyForCreateIndicator(dataset); metadata.put("_status", "reserved"); + System.out.print("baseURLString " + baseURLString); + System.out.print("USERNAME " + USERNAME); + System.out.print("PASSWORD " + PASSWORD); + System.out.print("identifier " + identifier); + System.out.print("metadata " + metadata); try { retString = ezidService.createIdentifier(identifier, metadata); logger.log(Level.FINE, "create DOI identifier retString : " + retString); @@ -70,6 +75,7 @@ public String createIdentifier(Dataset dataset) { logger.log(Level.WARNING, "localized message {0}", e.getLocalizedMessage()); logger.log(Level.WARNING, "cause", e.getCause()); logger.log(Level.WARNING, "message {0}", e.getMessage()); + return "Identifier not created " + e.getLocalizedMessage(); } return retString; diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java b/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java index c631f0f63fb..f7fd21735f1 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java +++ b/src/main/java/edu/harvard/iq/dataverse/DatasetPage.java @@ -3132,6 +3132,19 @@ public void downloadCitationRIS(FileMetadata fileMetadata) { } } + + public String getDatasetPublishCustomText(){ + String datasetPublishCustomText = settingsService.getValueForKey(SettingsServiceBean.Key.DatasetPublishPopupCustomText); + if( datasetPublishCustomText!= null && !datasetPublishCustomText.isEmpty()){ + return datasetPublishCustomText; + + } + return ""; + } + + public Boolean isDatasetPublishPopupCustomTextOnAllVersions(){ + return settingsService.isTrueForKey(SettingsServiceBean.Key.DatasetPublishPopupCustomTextOnAllVersions, false); + } public String getDataExploreURL() { String TwoRavensUrl = settingsService.getValueForKey(SettingsServiceBean.Key.TwoRavensUrl); diff --git a/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java b/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java index 219b7e5ec31..9b8470754b4 100644 --- a/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java +++ b/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java @@ -193,7 +193,17 @@ public enum Key { Explore World Map Button Default is false; */ - GeoconnectViewMaps; + GeoconnectViewMaps, + /** + The message added to a popup upon dataset publish + * + */ + DatasetPublishPopupCustomText, + /* + Whether to display the publish text for every published version + */ + DatasetPublishPopupCustomTextOnAllVersions; + @Override public String toString() { return ":" + name(); diff --git a/src/main/webapp/dataset.xhtml b/src/main/webapp/dataset.xhtml index 3dd81184cf7..7af75a1c42f 100755 --- a/src/main/webapp/dataset.xhtml +++ b/src/main/webapp/dataset.xhtml @@ -1262,6 +1262,9 @@ #{bundle['dataset.unregistered.tip']}

+ + #{DatasetPage.datasetPublishCustomText} +

#{bundle['dataset.publish.tip']}

@@ -1284,6 +1287,9 @@

+ + #{DatasetPage.datasetPublishCustomText} +

#{bundle['dataset.publishBoth.tip']}

@@ -1297,6 +1303,9 @@

#{bundle['dataset.republish.tip']}

+ + #{DatasetPage.datasetPublishCustomText} +

#{bundle['dataset.selectVersionNumber']} From 5b6625c8ff9201a8033cecc1e93421e729f16dfd Mon Sep 17 00:00:00 2001 From: Michael Heppler Date: Mon, 22 Feb 2016 15:25:43 -0500 Subject: [PATCH 2/7] Styled custom text for Publish Dataset popup on the Dataset pg. [ref #2833] --- src/main/webapp/dataset.xhtml | 8 ++++---- src/main/webapp/resources/css/structure.css | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/webapp/dataset.xhtml b/src/main/webapp/dataset.xhtml index 7af75a1c42f..2a7a91ced45 100755 --- a/src/main/webapp/dataset.xhtml +++ b/src/main/webapp/dataset.xhtml @@ -1256,18 +1256,18 @@ - +

#{bundle['dataset.unregistered.tip']}

- - #{DatasetPage.datasetPublishCustomText} -

#{bundle['dataset.publish.tip']}

+
+ +
diff --git a/src/main/webapp/resources/css/structure.css b/src/main/webapp/resources/css/structure.css index f7b525ab863..66d33dfd77e 100644 --- a/src/main/webapp/resources/css/structure.css +++ b/src/main/webapp/resources/css/structure.css @@ -283,6 +283,8 @@ ul.IdPSelectDropDown > .disabled > a:hover, ul.IdPSelectDropDown > .disabled > a /* -------- USER -------- */ #terms-agreement-block {max-height:200px; margin-bottom: .5em; padding: 12px; overflow-y:scroll; box-shadow:none; background-image: none; background-color: #f5f5f5;} +#terms-agreement-block h1, #terms-agreement-block h2, #terms-agreement-block h3, +#terms-agreement-block h4, #terms-agreement-block h5, #terms-agreement-block h6 {margin-top:0;} div[id$='notifications'].ui-tabs-panel div.table-container {display:table;} div[id$='notifications'].ui-tabs-panel div.notification-item {display:table-row;} div[id$='notifications'].ui-tabs-panel div.notification-item-cell {display:table-cell; border-bottom:1px solid #DDDDDD; padding:5px;} From 75c8565fa2c9d1143f17b42a58d2fdd6e2fb6219 Mon Sep 17 00:00:00 2001 From: Stephen Kraffmiller Date: Wed, 24 Feb 2016 12:58:05 -0500 Subject: [PATCH 3/7] #2833 Remove debug code --- .../java/edu/harvard/iq/dataverse/DOIEZIdServiceBean.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/DOIEZIdServiceBean.java b/src/main/java/edu/harvard/iq/dataverse/DOIEZIdServiceBean.java index b2ff280c7c6..fb1ad692d7c 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DOIEZIdServiceBean.java +++ b/src/main/java/edu/harvard/iq/dataverse/DOIEZIdServiceBean.java @@ -61,11 +61,6 @@ public String createIdentifier(Dataset dataset) { String identifier = getIdentifierFromDataset(dataset); HashMap metadata = getMetadataFromStudyForCreateIndicator(dataset); metadata.put("_status", "reserved"); - System.out.print("baseURLString " + baseURLString); - System.out.print("USERNAME " + USERNAME); - System.out.print("PASSWORD " + PASSWORD); - System.out.print("identifier " + identifier); - System.out.print("metadata " + metadata); try { retString = ezidService.createIdentifier(identifier, metadata); logger.log(Level.FINE, "create DOI identifier retString : " + retString); @@ -75,7 +70,6 @@ public String createIdentifier(Dataset dataset) { logger.log(Level.WARNING, "localized message {0}", e.getLocalizedMessage()); logger.log(Level.WARNING, "cause", e.getCause()); logger.log(Level.WARNING, "message {0}", e.getMessage()); - return "Identifier not created " + e.getLocalizedMessage(); } return retString; From 449c4d0365a97b8657f60d26185643580e5b00b8 Mon Sep 17 00:00:00 2001 From: Stephen Kraffmiller Date: Wed, 24 Feb 2016 13:10:18 -0500 Subject: [PATCH 4/7] Update config.rst --- doc/sphinx-guides/source/installation/config.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/sphinx-guides/source/installation/config.rst b/doc/sphinx-guides/source/installation/config.rst index 98d7e89fd9e..fa5e9c0f124 100644 --- a/doc/sphinx-guides/source/installation/config.rst +++ b/doc/sphinx-guides/source/installation/config.rst @@ -377,6 +377,21 @@ Set ``GeoconnectViewMaps`` to true to allow a user to view existing maps. This b ``curl -X PUT -d true http://localhost:8080/api/admin/settings/:GeoconnectViewMaps`` +:DatasetPublishPopupCustomText +++++++++++++++++++++++++++++++ + +Set custom text a user will view when publishing a dataset. + +``curl -X PUT -d "Deposit License Requirements" http://localhost:8080/api/admin/settings/:DatasetPublishPopupCustomText`` + +:DatasetPublishPopupCustomTextOnAllVersions ++++++++++++++++++++++++++++++++++++++++++++ + + +``curl -X PUT -d true http://localhost:8080/api/admin/settings/:DatasetPublishPopupCustomTextOnAllVersions`` + + + :SearchHighlightFragmentSize ++++++++++++++++++++++++++++ From 01adfd1fae806093bcf138354d5254e9c65a4d55 Mon Sep 17 00:00:00 2001 From: Stephen Kraffmiller Date: Wed, 24 Feb 2016 13:12:08 -0500 Subject: [PATCH 5/7] #2833 Add settings information for Custom Publishing Text --- doc/sphinx-guides/source/installation/config.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/sphinx-guides/source/installation/config.rst b/doc/sphinx-guides/source/installation/config.rst index fa5e9c0f124..31722d92085 100644 --- a/doc/sphinx-guides/source/installation/config.rst +++ b/doc/sphinx-guides/source/installation/config.rst @@ -387,11 +387,10 @@ Set custom text a user will view when publishing a dataset. :DatasetPublishPopupCustomTextOnAllVersions +++++++++++++++++++++++++++++++++++++++++++ +Set whether a user will see the custom text when publishing all versions of a dataset ``curl -X PUT -d true http://localhost:8080/api/admin/settings/:DatasetPublishPopupCustomTextOnAllVersions`` - - :SearchHighlightFragmentSize ++++++++++++++++++++++++++++ From 1789c2dcdd64e127c1dafa820882b19917de0afd Mon Sep 17 00:00:00 2001 From: Stephen Kraffmiller Date: Wed, 24 Feb 2016 17:20:53 -0500 Subject: [PATCH 6/7] #2833 Add terms block formatting to subsequent publish events if applicable --- src/main/webapp/dataset.xhtml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/webapp/dataset.xhtml b/src/main/webapp/dataset.xhtml index 2a7a91ced45..4c377f3266a 100755 --- a/src/main/webapp/dataset.xhtml +++ b/src/main/webapp/dataset.xhtml @@ -1287,9 +1287,9 @@

- - #{DatasetPage.datasetPublishCustomText} - +
+ +

#{bundle['dataset.publishBoth.tip']}

@@ -1303,9 +1303,9 @@

#{bundle['dataset.republish.tip']}

- - #{DatasetPage.datasetPublishCustomText} - +
+ +

#{bundle['dataset.selectVersionNumber']} From bd5941b80c85b6a9c0f9ccea522de78e6cb8f336 Mon Sep 17 00:00:00 2001 From: Michael Heppler Date: Mon, 29 Feb 2016 13:48:58 -0500 Subject: [PATCH 7/7] Fixed scroll bar issue with Publish Dataset popups on dataset pg. [ref #2833] --- src/main/webapp/dataset.xhtml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/dataset.xhtml b/src/main/webapp/dataset.xhtml index 4c377f3266a..3491e516531 100755 --- a/src/main/webapp/dataset.xhtml +++ b/src/main/webapp/dataset.xhtml @@ -1256,7 +1256,7 @@ - +

#{bundle['dataset.unregistered.tip']} @@ -1274,7 +1274,7 @@

- +

#{bundle['dataset.unregistered.tip']} @@ -1299,7 +1299,7 @@ - +

#{bundle['dataset.republish.tip']}