Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDCC/HDC 3B-Bi-directional LDN messaging, Template Instructions #8775

Merged
merged 84 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from 66 commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
c193ae2
initial POC to send email when inbox msgs are received
qqmyers May 20, 2021
a889282
bug fixes
qqmyers May 20, 2021
5d0c5f4
git doi: style pid
qqmyers May 20, 2021
9e10844
fix email message
qqmyers May 20, 2021
3573185
text tweaks
qqmyers May 20, 2021
c757be2
Merge remote-tracking branch 'IQSS/develop'
qqmyers Feb 2, 2022
6c5d26d
Add a DASH idType in the template
qqmyers Feb 24, 2022
d2d4bdc
Merge branch 'IQSS/7882-messaging' into GDCC/DC-3B
qqmyers Feb 24, 2022
9ac2083
add additionalInfo to UserNotification
qqmyers Mar 2, 2022
b0ec225
Add LDN Announce message handling with email and notification
qqmyers Mar 2, 2022
d219f92
cleanup
qqmyers Mar 2, 2022
035d5b0
local updated titanium library
qqmyers Mar 2, 2022
7591138
titanium 1.2+ update
qqmyers Mar 2, 2022
55d65fb
update to use our example format
qqmyers Mar 2, 2022
45f6547
fix consumes mimetype
qqmyers Mar 3, 2022
7a69aa9
update DASH type to DASH-NRS
qqmyers Mar 4, 2022
e46b568
Merge remote-tracking branch 'IQSS/develop' into GDCC/DC-3B
qqmyers Mar 16, 2022
7c5e0bb
refactor OREMap, start LDN workflow step
qqmyers Mar 17, 2022
5ec0679
Add a centralized method that can replace lots of others
qqmyers Mar 18, 2022
fa2cf31
sample workflow file
qqmyers Mar 18, 2022
19e78af
completed class
qqmyers Mar 18, 2022
7cc96a1
add step to internal spi
qqmyers Mar 18, 2022
18c7de1
Merge remote-tracking branch 'IQSS/develop' into GDCC/DC-3B
qqmyers Mar 21, 2022
b4e39ee
name should be inbox
qqmyers Mar 24, 2022
7fd93c2
temporary setting for custom instructions
qqmyers Apr 4, 2022
5f3f913
display custom instructions
qqmyers Apr 4, 2022
ccae650
can't job.build twice
qqmyers Apr 4, 2022
3ae929f
typos
qqmyers Apr 4, 2022
4c6cf3e
Merge remote-tracking branch 'IQSS/develop' into GDCC/DC-3B
qqmyers Apr 12, 2022
6e19a19
typos - don't make variable a string :-)
qqmyers Apr 12, 2022
8c4c3d3
put message to right of title for primitive and compound fields
qqmyers Apr 12, 2022
51b743e
protect against null TermsOfUseAndAccess
qqmyers Apr 12, 2022
cd6bf58
remove extra copy of instructions
qqmyers Apr 12, 2022
b846a96
Merge remote-tracking branch 'IQSS/develop' into GDCC/DC-3B
qqmyers Apr 26, 2022
27c112e
Merge remote-tracking branch 'IQSS/develop' into GDCC/DC-3B
qqmyers May 16, 2022
e440236
update for #8592 semantic mapping update
qqmyers May 16, 2022
874de76
add missing method
qqmyers May 16, 2022
810486b
Merge remote-tracking branch 'IQSS/develop' into
qqmyers May 27, 2022
381d180
initial changes to store/use template instructions
qqmyers Jun 2, 2022
6975f5c
add DASh-NRS to properties file
qqmyers Jun 2, 2022
4110bc1
initial working edit in place in template
qqmyers Jun 2, 2022
af0aace
start adding support to see instructions in template view mode
qqmyers Jun 2, 2022
de5adc7
add template in correct include
qqmyers Jun 2, 2022
2226fa5
formatting/text changes, tooltip
qqmyers Jun 3, 2022
37a82ec
further formatting/text changes
qqmyers Jun 3, 2022
cf0c784
set template to default/selected during create
qqmyers Jun 3, 2022
2e7563d
comment typo
qqmyers Jun 3, 2022
5f1d2b4
add template param in metadata view mode
qqmyers Jun 3, 2022
be574c3
Merge remote-tracking branch 'IQSS/develop' into GDCC/DC-3B
qqmyers Jun 3, 2022
d984405
adjust spacing
qqmyers Jun 3, 2022
31e721b
show instructions on template page view mode
qqmyers Jun 3, 2022
afdc9ea
update close to clone instructions
qqmyers Jun 3, 2022
c132c8e
expand width of editor
qqmyers Jun 3, 2022
3a8f005
cleanup - remove temp setting
qqmyers Jun 6, 2022
944aa4e
fix display width in dataset md edit mode
qqmyers Jun 8, 2022
1e72823
flyway for instructions column in template
qqmyers Jun 8, 2022
c6517f8
Merge remote-tracking branch 'IQSS/develop' into GDCC/DC-3B
qqmyers Jun 8, 2022
67c215b
update flyway
qqmyers Jun 14, 2022
63a2020
OK when metadata doesn't exist and won't send message
qqmyers Jun 14, 2022
444ab38
Merge remote-tracking branch 'IQSS/develop' into GDCC/DC-3B
qqmyers Jun 24, 2022
70b38b3
fix missing field check
qqmyers Jun 24, 2022
1bca044
missing property
qqmyers Jul 5, 2022
a21c7c5
Merge remote-tracking branch 'IQSS/develop' into GDCC/DC-3B
qqmyers Jul 19, 2022
9aa7dd0
Merge remote-tracking branch 'IQSS/develop' into GDCC/DC-3B
qqmyers Jul 21, 2022
b9c4bba
update script names
qqmyers Jul 27, 2022
ff8eec0
Merge remote-tracking branch 'IQSS/develop' into GDCC/DC-3B
qqmyers Jul 28, 2022
2169a43
Merge remote-tracking branch 'IQSS/develop' into GDCC/DC-3B
qqmyers Aug 3, 2022
c9c6f86
rename scripts per review
qqmyers Aug 3, 2022
0ced73a
change setting to use LDN, flip default to no hosts allowed
qqmyers Aug 4, 2022
84a4826
docs for receive api and send workflow
qqmyers Aug 4, 2022
378ad35
Merge branch 'GDCC/DC-3B' of https://github.com/GlobalDataverseCommun…
qqmyers Aug 4, 2022
7438794
Merge branch 'develop' into GDCC/DC-3B #7882
pdurbin Aug 4, 2022
6fa670a
add indent
qqmyers Aug 5, 2022
7532103
Merge branch 'GDCC/DC-3B' of https://github.com/GlobalDataverseCommun…
qqmyers Aug 5, 2022
b0a6af9
typos
qqmyers Aug 5, 2022
fc2d67d
missing spaces
qqmyers Aug 5, 2022
99300ae
add to toc
qqmyers Aug 5, 2022
e137a9b
change test that counts citation block elements
qqmyers Aug 8, 2022
95d8ffa
add workflow settings to main list per qa
qqmyers Aug 11, 2022
1d76db0
add template custom instructions info
qqmyers Aug 11, 2022
80bd84d
Merge remote-tracking branch 'IQSS/develop' into GDCC/DC-3B
qqmyers Aug 12, 2022
45a35dd
get blocks from metadataroot
qqmyers Aug 12, 2022
b35b28a
Merge remote-tracking branch 'IQSS/develop' into GDCC/DC-3B
qqmyers Aug 12, 2022
3e0416a
added a cvv entry so test should check for one more
qqmyers Aug 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
<dependency>
<groupId>com.apicatalog</groupId>
<artifactId>titanium-json-ld</artifactId>
<version>0.8.6</version>
<version>1.3.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
Expand Down
1 change: 1 addition & 0 deletions scripts/api/data/metadatablocks/citation.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
publicationIDType upc 14
publicationIDType url 15
publicationIDType urn 16
publicationIDType DASH-NRS 17
contributorType Data Collector 0
contributorType Data Curator 1
contributorType Data Manager 2
Expand Down
16 changes: 16 additions & 0 deletions scripts/api/data/workflows/internal-ldnannounce-workflow.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "LDN Announce workflow",
"steps": [
{
"provider":":internal",
"stepType":"ldnannounce",
"parameters": {
"stepName":"LDN Announce"
},
"requiredSettings": {
":LDNAnnounceRequiredFields": "string",
":LDNTarget": "string"
}
}
]
}
20 changes: 19 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/Dataset.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import edu.harvard.iq.dataverse.util.BundleUtil;
import edu.harvard.iq.dataverse.util.StringUtil;
import edu.harvard.iq.dataverse.util.SystemConfig;

/**
*
Expand Down Expand Up @@ -152,6 +152,19 @@ public void setCitationDateDatasetFieldType(DatasetFieldType citationDateDataset
this.citationDateDatasetFieldType = citationDateDatasetFieldType;
}


@ManyToOne
@JoinColumn(name="template_id",nullable = true)
private Template template;

public Template getTemplate() {
return template;
}

public void setTemplate(Template template) {
this.template = template;
}

public Dataset() {
DatasetVersion datasetVersion = new DatasetVersion();
datasetVersion.setDataset(this);
Expand Down Expand Up @@ -743,6 +756,11 @@ public void setHarvestIdentifier(String harvestIdentifier) {
this.harvestIdentifier = harvestIdentifier;
}

public String getLocalURL() {
//Assumes GlobalId != null
return SystemConfig.getDataverseSiteUrlStatic() + "/dataset.xhtml?persistentId=" + this.getGlobalId().asString();
}

public String getRemoteArchiveURL() {
if (isHarvested()) {
if (HarvestingClient.HARVEST_STYLE_DATAVERSE.equals(this.getHarvestedFrom().getHarvestStyle())) {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -1768,6 +1768,7 @@ public void handleChangeButton() {
workingVersion.initDefaultValues(licenseServiceBean.getDefault());
updateDatasetFieldInputLevels();
}
dataset.setTemplate(selectedTemplate);
/*
Issue 8646: necessary for the access popup which is shared by the dataset page and the file page
*/
Expand Down Expand Up @@ -2055,6 +2056,8 @@ private String init(boolean initFull) {
selectedTemplate = testT;
}
}
//Initalize with the default if there is one
dataset.setTemplate(selectedTemplate);
workingVersion = dataset.getEditVersion(selectedTemplate, null);
updateDatasetFieldInputLevels();
} else {
Expand Down Expand Up @@ -3565,6 +3568,7 @@ public String save() {
if (editMode == EditMode.CREATE) {
//Lock the metadataLanguage once created
dataset.setMetadataLanguage(getEffectiveMetadataLanguage());
//ToDo - could drop use of selectedTemplate and just use the persistent dataset.getTemplate()
if ( selectedTemplate != null ) {
if ( isSessionUserAuthenticated() ) {
cmd = new CreateNewDatasetCommand(dataset, dvRequestService.getDataverseRequest(), false, selectedTemplate);
Expand Down
25 changes: 24 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/MailServiceBean.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import edu.harvard.iq.dataverse.util.BundleUtil;
import edu.harvard.iq.dataverse.util.MailUtil;
import edu.harvard.iq.dataverse.util.SystemConfig;
import edu.harvard.iq.dataverse.util.json.JsonUtil;

import java.io.UnsupportedEncodingException;
import java.text.MessageFormat;
import java.util.ArrayList;
Expand Down Expand Up @@ -169,7 +171,7 @@ public boolean sendSystemEmail(String to, String subject, String messageText, bo
return sent;
}

private InternetAddress getSystemAddress() {
public InternetAddress getSystemAddress() {
String systemEmail = settingsService.getValueForKey(Key.SystemEmail);
return MailUtil.parseSystemAddress(systemEmail);
}
Expand Down Expand Up @@ -608,6 +610,26 @@ public String getMessageTextBasedOnNotification(UserNotification userNotificatio
));

return ingestedCompletedWithErrorsMessage;
case DATASETMENTIONED:
String additionalInfo = userNotification.getAdditionalInfo();
dataset = (Dataset) targetObject;
javax.json.JsonObject citingResource = null;
citingResource = JsonUtil.getJsonObject(additionalInfo);


pattern = BundleUtil.getStringFromBundle("notification.email.datasetWasMentioned");
Object[] paramArrayDatasetMentioned = {
userNotification.getUser().getName(),
BrandingUtil.getInstallationBrandName(),
citingResource.getString("@type"),
citingResource.getString("@id"),
citingResource.getString("name"),
citingResource.getString("relationship"),
systemConfig.getDataverseSiteUrl(),
dataset.getGlobalId().toString(),
dataset.getDisplayName()};
messageText = MessageFormat.format(pattern, paramArrayDatasetMentioned);
return messageText;
}

return "";
Expand All @@ -632,6 +654,7 @@ public Object getObjectOfNotification (UserNotification userNotification){
case GRANTFILEACCESS:
case REJECTFILEACCESS:
case DATASETCREATED:
case DATASETMENTIONED:
return datasetService.find(userNotification.getObjectId());
case CREATEDS:
case SUBMITTEDDS:
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/edu/harvard/iq/dataverse/SettingsWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import edu.harvard.iq.dataverse.util.MailUtil;
import edu.harvard.iq.dataverse.util.StringUtil;
import edu.harvard.iq.dataverse.util.SystemConfig;
import edu.harvard.iq.dataverse.util.json.JsonUtil;
import edu.harvard.iq.dataverse.UserNotification.Type;

import java.time.LocalDate;
Expand Down Expand Up @@ -646,5 +647,4 @@ public boolean isCustomLicenseAllowed() {
}
return customLicenseAllowed;
}
}

}
73 changes: 66 additions & 7 deletions src/main/java/edu/harvard/iq/dataverse/Template.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package edu.harvard.iq.dataverse;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
Expand All @@ -10,6 +9,11 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import javax.json.Json;
import javax.json.JsonObjectBuilder;
import javax.json.JsonString;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
Expand All @@ -28,6 +32,8 @@
import javax.validation.constraints.Size;

import edu.harvard.iq.dataverse.util.DateUtil;
import edu.harvard.iq.dataverse.util.json.JsonUtil;

import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import org.hibernate.validator.constraints.NotBlank;
Expand Down Expand Up @@ -125,7 +131,13 @@ public void setTermsOfUseAndAccess(TermsOfUseAndAccess termsOfUseAndAccess) {
public List<DatasetField> getDatasetFields() {
return datasetFields;
}

@Column(columnDefinition="TEXT", nullable = true )
private String instructions;

@Transient
private Map<String, String> instructionsMap = null;

@Transient
private Map<MetadataBlock, List<DatasetField>> metadataBlocksForView = new HashMap<>();
@Transient
Expand Down Expand Up @@ -256,26 +268,31 @@ public void setMetadataValueBlocks() {
metadataBlocksForView.clear();
metadataBlocksForEdit.clear();
List<DatasetField> filledInFields = this.getDatasetFields();

Map<String, String> instructionsMap = getInstructionsMap();

List <MetadataBlock> viewMDB = new ArrayList<>();
List <MetadataBlock> editMDB=this.getDataverse().getMetadataBlocks(true);

//The metadatablocks in this template include any from the Dataverse it is associated with
//plus any others where the template has a displayable field (i.e. from before a block was dropped in the dataverse/collection)
viewMDB.addAll(this.getDataverse().getMetadataBlocks(true));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My guess is that this call is no longer needed. As is it gets no blocks unless the current one is the metadatablockroot and it is the loop below that adds the right blocks. Looking back at #8837 where this was added, there used to be one list of blocks for edit and view, which is why getting the available blocks was needed. Now that this variable is just for view, I don't think getting the possible blocks is needed. (I also don't think it hurts in that for view, only the blocks with defined fields appear anyway, so having extra blocks in viewMDB doesn't break anything.

for (DatasetField dsfv : filledInFields) {
if (!dsfv.isEmptyForDisplay()) {
MetadataBlock mdbTest = dsfv.getDatasetFieldType().getMetadataBlock();
for (DatasetField dsf : filledInFields) {
if (!dsf.isEmptyForDisplay()) {
MetadataBlock mdbTest = dsf.getDatasetFieldType().getMetadataBlock();
if (!viewMDB.contains(mdbTest)) {
viewMDB.add(mdbTest);
}
}
}
}

for (MetadataBlock mdb : viewMDB) {

List<DatasetField> datasetFieldsForView = new ArrayList<>();
for (DatasetField dsf : this.getDatasetFields()) {
if (dsf.getDatasetFieldType().getMetadataBlock().equals(mdb)) {
if (!dsf.isEmpty()) {
//For viewing, show the field if it has a value or custom instructions
if (!dsf.isEmpty() || instructionsMap.containsKey(dsf.getDatasetFieldType().getName())) {
datasetFieldsForView.add(dsf);
}
}
Expand Down Expand Up @@ -344,6 +361,9 @@ public Template cloneNewTemplate(Template source) {
}
terms.setTemplate(newTemplate);
newTemplate.setTermsOfUseAndAccess(terms);

newTemplate.getInstructionsMap().putAll(source.getInstructionsMap());
newTemplate.updateInstructions();
return newTemplate;
}

Expand Down Expand Up @@ -383,6 +403,45 @@ private List<DatasetField> getFlatDatasetFields(List<DatasetField> dsfList) {
return retList;
}

//Cache values in map for reading
public Map<String, String> getInstructionsMap() {
if(instructionsMap==null)
if(instructions != null) {
instructionsMap = JsonUtil.getJsonObject(instructions).entrySet().stream().collect(Collectors.toMap(entry -> entry.getKey(),entry -> ((JsonString)entry.getValue()).getString()));
} else {
instructionsMap = new HashMap<String,String>();
}
return instructionsMap;
}

//Get the cutstom instructions defined for a give fieldType
public String getInstructionsFor(String fieldType) {
return getInstructionsMap().get(fieldType);
}

/*
//Add/change or remove (null instructionString) instructions for a given fieldType
public void setInstructionsFor(String fieldType, String instructionString) {
if(instructionString==null) {
getInstructionsMap().remove(fieldType);
} else {
getInstructionsMap().put(fieldType, instructionString);
}
updateInstructions();
}
*/

//Keep instructions up-to-date on any change
public void updateInstructions() {
JsonObjectBuilder builder = Json.createObjectBuilder();
getInstructionsMap().forEach((key, value) -> {
if (value != null)
builder.add(key, value);
});
instructions = JsonUtil.prettyPrint(builder.build());
}


@Override
public int hashCode() {
int hash = 0;
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/TemplatePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ public String save(String redirectPage) {

DatasetFieldUtil.tidyUpFields( template.getDatasetFields(), false );

template.updateInstructions();

if (editMode == EditMode.CREATE) {
template.setCreateTime(new Timestamp(new Date().getTime()));
template.setUsageCount(new Long(0));
Expand Down Expand Up @@ -247,5 +249,11 @@ public String deleteTemplate(Long templateId) {
}
return "/manage-templates.xhtml?dataverseId=" + dataverse.getId() + "&faces-redirect=true";
}

//Get the cutstom instructions defined for a give fieldType
public String getInstructionsLabelFor(String fieldType) {
String fieldInstructions = template.getInstructionsMap().get(fieldType);
return (fieldInstructions!=null && !fieldInstructions.isBlank()) ? fieldInstructions : BundleUtil.getStringFromBundle("template.instructions.empty.label");
}

}
12 changes: 11 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/UserNotification.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public enum Type {
ASSIGNROLE, REVOKEROLE, CREATEDV, CREATEDS, CREATEACC, SUBMITTEDDS, RETURNEDDS,
PUBLISHEDDS, REQUESTFILEACCESS, GRANTFILEACCESS, REJECTFILEACCESS, FILESYSTEMIMPORT,
CHECKSUMIMPORT, CHECKSUMFAIL, CONFIRMEMAIL, APIGENERATED, INGESTCOMPLETED, INGESTCOMPLETEDWITHERRORS,
PUBLISHFAILED_PIDREG, WORKFLOW_SUCCESS, WORKFLOW_FAILURE, STATUSUPDATED, DATASETCREATED;
PUBLISHFAILED_PIDREG, WORKFLOW_SUCCESS, WORKFLOW_FAILURE, STATUSUPDATED, DATASETCREATED, DATASETMENTIONED;

public String getDescription() {
return BundleUtil.getStringFromBundle("notification.typeDescription." + this.name());
Expand Down Expand Up @@ -88,6 +88,8 @@ public static String toStringValue(Set<Type> typesSet) {
@Column( nullable = false )
private Type type;
private Long objectId;

private String additionalInfo;

@Transient
private boolean displayAsRead;
Expand Down Expand Up @@ -196,4 +198,12 @@ public void setRoleString(String roleString) {
public String getLocaleSendDate() {
return DateUtil.formatDate(sendDate);
}

public String getAdditionalInfo() {
return additionalInfo;
}

public void setAdditionalInfo(String additionalInfo) {
this.additionalInfo = additionalInfo;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,16 @@ public void sendNotification(AuthenticatedUser dataverseUser, Timestamp sendDate
}

public void sendNotification(AuthenticatedUser dataverseUser, Timestamp sendDate, Type type, Long objectId, String comment, AuthenticatedUser requestor, boolean isHtmlContent) {
sendNotification(dataverseUser, sendDate, type, objectId, comment, requestor, isHtmlContent, null);
}
public void sendNotification(AuthenticatedUser dataverseUser, Timestamp sendDate, Type type, Long objectId, String comment, AuthenticatedUser requestor, boolean isHtmlContent, String additionalInfo) {
UserNotification userNotification = new UserNotification();
userNotification.setUser(dataverseUser);
userNotification.setSendDate(sendDate);
userNotification.setType(type);
userNotification.setObjectId(objectId);
userNotification.setRequestor(requestor);
userNotification.setAdditionalInfo(additionalInfo);

if (!isEmailMuted(userNotification) && mailService.sendNotificationEmail(userNotification, comment, requestor, isHtmlContent)) {
logger.fine("email was sent");
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/edu/harvard/iq/dataverse/api/Datasets.java
Original file line number Diff line number Diff line change
Expand Up @@ -1592,8 +1592,7 @@ public Response getCustomTermsTab(@PathParam("id") String id, @PathParam("versio
User user = session.getUser();
String persistentId;
try {
if (getDatasetVersionOrDie(createDataverseRequest(user), versionId, findDatasetOrDie(id), uriInfo, headers)
.getTermsOfUseAndAccess().getLicense() != null) {
if (DatasetUtil.getLicense(getDatasetVersionOrDie(createDataverseRequest(user), versionId, findDatasetOrDie(id), uriInfo, headers)) != null) {
return error(Status.NOT_FOUND, "This Dataset has no custom license");
}
persistentId = getRequestParameter(":persistentId".substring(1));
Expand Down
Loading