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

9507 show linked collections #9970

Merged
merged 14 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
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
20 changes: 18 additions & 2 deletions src/main/java/edu/harvard/iq/dataverse/DatasetPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -3391,7 +3391,7 @@ public void saveLinkingDataverses(ActionEvent evt) {
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, BundleUtil.getStringFromBundle("dataset.notlinked"), linkingDataverseErrorMessage);
FacesContext.getCurrentInstance().addMessage(null, message);
}

alreadyLinkedDataverses = null; //force update to list of linked dataverses
}

private String linkingDataverseErrorMessage = "";
Expand Down Expand Up @@ -3427,7 +3427,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
27 changes: 14 additions & 13 deletions src/main/java/propertyFiles/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -874,23 +874,23 @@ dataverse.publish.header=Publish Dataverse
dataverse.nopublished=No Published Dataverses
dataverse.nopublished.tip=In order to use this feature you must have at least one published dataverse.
dataverse.contact=Email Dataverse Contact
dataverse.link=Link Dataverse
dataverse.link.btn.tip=Link to Your Dataverse
dataverse.link.yourDataverses=Your Dataverse
dataverse.link.yourDataverses.inputPlaceholder=Enter Dataverse Name
dataverse.link.save=Save Linked Dataverse
dataverse.link.dataverse.choose=Choose which of your dataverses you would like to link this dataverse to.
dataverse.link.dataset.choose=Enter the name of the dataverse you would like to link this dataset to. If you need to remove this link in the future, please contact {0}.
dataverse.link.dataset.none=No linkable dataverses available.
dataverse.link.no.choice=You have one dataverse you can add linked dataverses and datasets in.
dataverse.link.no.linkable=To be able to link a dataverse or dataset, you need to have your own dataverse. Create a dataverse to get started.
dataverse.link.no.linkable.remaining=You have already linked all of your eligible dataverses.
dataverse.link=Link Collection
dataverse.link.btn.tip=Link to Your Collection
dataverse.link.yourDataverses=Your Collection
Copy link
Contributor

Choose a reason for hiding this comment

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

typo? (I noticed the before was also singular, so I'm not sure of the contect, but the key is plural)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was singular in the original. I'll take a look at it in context and maybe change the key name.

dataverse.link.yourDataverses.inputPlaceholder=Enter Collection Name
dataverse.link.save=Save Linked collection
dataverse.link.dataverse.choose=Choose which of your collection you would like to link this collection to.
Copy link
Contributor

Choose a reason for hiding this comment

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

typo

dataverse.link.dataset.choose=Enter the name of the collection you would like to link this dataset to. If you need to remove this link in the future, please contact {0}.
dataverse.link.dataset.none=No linkable collections available.
dataverse.link.no.choice=You have one collection you can add linked collection and datasets in.
Copy link
Contributor

Choose a reason for hiding this comment

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

typo

dataverse.link.no.linkable=To be able to link a collection or dataset, you need to have your own collection. Create a collection to get started.
dataverse.link.no.linkable.remaining=You have already linked all of your eligible collections.
dataverse.savedsearch.link=Link Search
dataverse.savedsearch.searchquery=Search
dataverse.savedsearch.filterQueries=Facets
dataverse.savedsearch.save=Save Linked Search
dataverse.savedsearch.dataverse.choose=Choose which of your dataverses you would like to link this search to.
dataverse.savedsearch.no.choice=You have one dataverse to which you may add a saved search.
dataverse.savedsearch.dataverse.choose=Choose which of your collection you would like to link this search to.
Copy link
Contributor

Choose a reason for hiding this comment

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

typo

dataverse.savedsearch.no.choice=You have one collection to which you may add a saved search.
# Bundle file editors, please note that "dataverse.savedsearch.save.success" is used in a unit test
dataverse.saved.search.success=The saved search has been successfully linked to {0}.
dataverse.saved.search.failure=The saved search was not able to be linked.
Expand Down Expand Up @@ -2498,6 +2498,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: This dataset is already linked to the following collection(s):
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
6 changes: 6 additions & 0 deletions src/main/webapp/dataset.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -1622,6 +1622,12 @@
</div>
</div>
</div>
<div>
<p:fragment rendered="#{!empty DatasetPage.alreadyLinkedDataverses}">
<h:outputLabel value="#{bundle['dataset.linking.popop.already.linked.note']}"/>&#160;
<h:outputText rendered="#{!empty DatasetPage.alreadyLinkedDataverses }" value="#{DatasetPage.alreadyLinkedDataverses}"/>
</p:fragment>
</div>
<div class="button-block">
<p:commandButton id="saveLinkButton" styleClass="btn btn-default"
update="linkNameContent @([id$=Messages])"
Expand Down