Skip to content

Commit

Permalink
#9507 prelim check in
Browse files Browse the repository at this point in the history
  • Loading branch information
sekmiller committed Oct 2, 2023
1 parent fa97a76 commit cb1f3e6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import edu.harvard.iq.dataverse.util.WebloaderUtil;
import edu.harvard.iq.dataverse.validation.URLValidator;
import edu.harvard.iq.dataverse.workflows.WorkflowComment;
import edu.harvard.iq.dataverse.Dataverse;

import java.io.File;
import java.io.FileOutputStream;
Expand Down Expand Up @@ -3423,7 +3424,23 @@ private Boolean saveLink(Dataverse dataverse){
}
return retVal;
}


private String alreadyLinkedDataverses = null;

public String getAlreadyLinkedDataverses(){
if (alreadyLinkedDataverses != null) {
return alreadyLinkedDataverses;
}
List<Dataverse> dataverseList = dataverseService.findDataversesThatLinkToThisDatasetId(dataset.getId());
for (Dataverse dv: dataverseList){
if (alreadyLinkedDataverses == null){
alreadyLinkedDataverses = dv.getCurrentName();
} else {
alreadyLinkedDataverses = alreadyLinkedDataverses + ", " + dv.getCurrentName();
}
}
return alreadyLinkedDataverses;
}

public List<Dataverse> completeLinkingDataverse(String query) {
dataset = datasetService.find(dataset.getId());
Expand Down
1 change: 1 addition & 0 deletions src/main/java/propertyFiles/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2494,6 +2494,7 @@ dataset.registered=DatasetRegistered
dataset.registered.msg=Your dataset is now registered.
dataset.notlinked=DatasetNotLinked
dataset.notlinked.msg=There was a problem linking this dataset to yours:
dataset.linking.popop.already.linked.note=Note: the dataset is already linked to the following dataverses:
datasetversion.archive.success=Archival copy of Version successfully submitted
datasetversion.archive.failure=Error in submitting an archival copy
datasetversion.update.failure=Dataset Version Update failed. Changes are still in the DRAFT version.
Expand Down
8 changes: 8 additions & 0 deletions src/main/webapp/dataset.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,14 @@
</div>
</div>
</div>
<div>
<p:outputLabel rendered="#{!empty DatasetPage.alreadyLinkedDataverses }" >
#{bundle.dataset.linking.popop.already.linked.note}
</p:outputLabel>
<h:outputText rendered="#{!empty DatasetPage.alreadyLinkedDataverses }">
#{DatasetPage.alreadyLinkedDataverses}
</h:outputText>
</div>
<div class="button-block">
<p:commandButton id="saveLinkButton" styleClass="btn btn-default"
update="linkNameContent @([id$=Messages])"
Expand Down

0 comments on commit cb1f3e6

Please sign in to comment.