Custom Installation Name, Optional Use as DDI Distributor#7661
Custom Installation Name, Optional Use as DDI Distributor#7661kcondon merged 24 commits intoIQSS:developfrom
Conversation
just committing to record the code I tried to @Inject - did this and tried just a static private String, but both result in null pointer exceptions. The Provider<String> suggests it will dynamically get new values, but the javadocs does say something about checking at the start to see if the property exists (which it doesn't for DbSettingsConfigSource?)
in DDI export stdyDcr - only use installation name if there is no distributor defined in metadata
|
|
||
| Custom Homepage | ||
| ++++++++++++++++ | ||
| +++++++++++++++ |
There was a problem hiding this comment.
FWIW: I think my rst plugin is catching these now. I just added the two entries at the bottom.
|
Thanks @qqmyers. Just a quick question - for documentation purposes, if an installation chooses update the setting, will they need to run reexportall to realize the changes? |
|
@djbrooke - good catch - added notes in the docs. |
src/main/java/edu/harvard/iq/dataverse/export/ddi/DdiExportUtil.java
Outdated
Show resolved
Hide resolved
src/main/java/edu/harvard/iq/dataverse/branding/BrandingUtil.java
Outdated
Show resolved
Hide resolved
| public Map<String, String> getProperties() { | ||
| // if the cache is at least XX number of seconds old, update before serving data. | ||
| if (lastUpdate == null || Instant.now().minus(Duration.ofSeconds(60)).isBefore(lastUpdate)) { | ||
| if (lastUpdate == null || Instant.now().minus(Duration.ofSeconds(60)).isAfter(lastUpdate)) { |
There was a problem hiding this comment.
Good catches, thank you @qqmyers
Should we put these in a seperated PR and add tests so this is getting checked? (Happy to contribute)
There was a problem hiding this comment.
FWIW: I found one more w.r.t. mapping the setting names via Alias. I'd say that unless you have concerns about the fixes, it's not worth another PR - these classes aren't used anywhere else yet and the changes are small.
seeing the following when using the alias/db sources:
Caused by: java.lang.IllegalStateException: Recursive update
at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1983)
at fish.payara.nucleus.microprofile.config.spi.PayaraConfig.getValue(PayaraConfig.java:157)
at fish.payara.nucleus.microprofile.config.spi.PayaraConfig.getValueInternal(PayaraConfig.java:127)
at fish.payara.nucleus.microprofile.config.spi.PayaraConfig.getOptionalValue(PayaraConfig.java:123)
at edu.harvard.iq.dataverse.settings.source.AliasConfigSource.getValue(AliasConfigSource.java:87)
at fish.payara.nucleus.microprofile.config.spi.PayaraConfig.getSourceValue(PayaraConfig.java:183)
at fish.payara.nucleus.microprofile.config.spi.PayaraConfig.getValueConverted(PayaraConfig.java:166)
at fish.payara.nucleus.microprofile.config.spi.PayaraConfig.lambda$getValue$1(PayaraConfig.java:161)
at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1908)
at fish.payara.nucleus.microprofile.config.spi.PayaraConfig.getValue(PayaraConfig.java:157)
at fish.payara.nucleus.microprofile.config.spi.PayaraConfig.getValueInternal(PayaraConfig.java:127)
at fish.payara.nucleus.microprofile.config.spi.PayaraConfig.getOptionalValue(PayaraConfig.java:123)
at edu.harvard.iq.dataverse.branding.BrandingUtil.getInstallationBrandName(BrandingUtil.java:19)
at edu.harvard.iq.dataverse.util.MailUtil.getSubjectTextBasedOnNotification(MailUtil.java:33)
at edu.harvard.iq.dataverse.MailServiceBean.sendNotificationEmail(MailServiceBean.java:247)
Conflicts: src/main/java/edu/harvard/iq/dataverse/branding/BrandingUtil.java src/main/java/edu/harvard/iq/dataverse/branding/BrandingUtilHelper.java src/test/java/edu/harvard/iq/dataverse/branding/BrandingUtilTest.java
|
It's not a blocker (as it works as it is now), but I can do a quick edit to remove the DB source class that you plan to remove given your new design. |
|
An update - with the discussion and new direction with microprofile support, this PR is now independent of them. It now just introduces:
|
What this PR does / why we need it: Adds a new setting that will be used instead of the Root Dataverse Collection Name for the Brand Name (BrandingUtil.getInstallationBrandName() ) if set and a second setting that avoids adding the brand name as a Distributor in the DDI export studyDsc if the Distributor is already set in the metadata (part of the Citation block).
Which issue(s) this PR closes:
Closes #7387
Special notes for your reviewer: Per discussions/issue comments:
This PR changes the broadly used getInstallationBrandName method so if the new setting is used, the change will occur everywhere that is called (primarily in metadata exports and email notifications). If there are any places where this isn't desired, there is a BrandingUtil.getRootDataverseName() call that can be used instead.
One new setting is implemented as an MPconfig variable that also has a settings alias.
(Note that #7680 prevented doing this for
which is just a standard setting in the final PR.)
Suggestions on how to test this:
Does this PR introduce a user interface change? If mockups are available, please link/include them here: only to the text shown where the brand name previously was always the root dataverse collection name.
Is there a release notes update needed for this change?: just noting the new options.
Additional documentation: documented the new settings in the guide