Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -6876,6 +6876,11 @@ private ExperimentAnnotations getCopiedExperimentFor(ExperimentAnnotations expAn
return null;
}

if (_journalSubmission.hasPendingSubmission())
{
errors.reject(ERROR_MSG, String.format("There is a pending re-submit request for this experiment on '%s'", _journal.getName()));
return null;
}
if (expAnnot.isJournalCopy())
{
if (!_journalSubmission.isLatestExperimentCopy(_expAnnot.getId()))
Expand Down Expand Up @@ -7007,12 +7012,10 @@ public void validateCommand(PublicationDetailsForm form, Errors errors)
return;
}
}
if (!form.hasNewPublicationDetails(_copiedExperiment))
{
errors.reject(ERROR_MSG, String.format("Publication details are the same as the ones associated with the data on %s at %s",
_journal.getName(), _copiedExperiment.getShortUrl().renderShortURL()));
return;
}
// Validation removed: no need to ensure that publication details entered in the form differ from the
// publication details already associated with the experiment. The user may have entered the
// correct PubMedID etc. when submitting but forgot to make the data public.
// (See commit history for the original logic.)
}
else if (_copiedExperiment.isPublic())
{
Expand Down Expand Up @@ -7356,13 +7359,6 @@ public boolean hasLinkAndCitation()
{
return !(StringUtils.isBlank(_link) || StringUtils.isBlank(_citation));
}

public boolean hasNewPublicationDetails(ExperimentAnnotations copiedExperiment)
{
return !(Objects.equals(_pubmedId, copiedExperiment.getPubmedId())
&& Objects.equals(_link, copiedExperiment.getPublicationLink())
&& Objects.equals(_citation, copiedExperiment.getCitation()));
}
}

public static abstract class PanoramaPublicExperimentAction<T extends ExperimentIdForm> extends FormViewAction<T>
Expand Down Expand Up @@ -9849,7 +9845,7 @@ private MessageExampleBean createExampleMessage(List<Integer> experimentIds, Pan
{
continue;
}
Announcement announcement = announcementSvc.getAnnouncement(announcementsContainer, getUser(), submission.getAnnouncementId());
Announcement announcement = submission.getAnnouncement(announcementSvc, announcementsContainer, getUser());
if (announcement == null)
{
continue; // old data before we started posting submission requests to a message board
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,14 +396,15 @@ public static String getDataStatusReminderMessage(@NotNull ExperimentAnnotations
message.append("Dear ").append(getUserName(submitter)).append(",").append(NL2)
.append("We are reaching out regarding your data on Panorama Public (").append(shortUrl).append("), which has been private since ")
.append(dateString).append(".")
.append("\n\n**Is the paper associated with this work already published?**")
.append("\n- If yes: Please make your data public by clicking the \"Make Public\" button in your folder or by clicking this link: ")
.append(NL2).append(bold("Title:")).append(" ").append(escape(exptAnnotations.getTitle()))
.append(NL2).append(bold("Is the paper associated with this work already published?"))
.append(NL).append("- If yes: Please make your data public by clicking the \"Make Public\" button in your folder or by clicking this link: ")
.append(bold(link("Make Data Public", makePublicLink)))
.append(". This helps ensure that your valuable research is easily accessible to the community.")
.append("\n- If not: You have a couple of options:")
.append("\n - **Request an Extension** - If your paper is still under review, or you need additional time, please let us know by clicking ")
.append(NL).append("- If not: You have a couple of options:")
.append(NL).append(" - ").append(bold("Request an Extension")).append(" - If your paper is still under review, or you need additional time, please let us know by clicking ")
.append(bold(link("Request Extension", requestExtensionUrl.getURIString()))).append(".")
.append("\n - **Delete from Panorama Public** - If you no longer wish to host your data on Panorama Public, please click ")
.append(NL).append(" - ").append(bold("Delete from Panorama Public")).append(" - If you no longer wish to host your data on Panorama Public, please click ")
.append(bold(link("Request Deletion", requesDeletionUrl.getURIString()))).append(". ")
.append("We will remove your data from Panorama Public.");
if (sourceExperiment != null)
Expand All @@ -413,9 +414,9 @@ public static String getDataStatusReminderMessage(@NotNull ExperimentAnnotations
.append(") will remain intact, allowing you to resubmit your data in the future if you wish.");
}

message.append("\n\nIf you have any questions or need further assistance, please do not hesitate to respond to this message by ")
message.append(NL2).append("If you have any questions or need further assistance, please do not hesitate to respond to this message by ")
.append(bold(link("clicking here", respondToMessageUrl.getURIString()))).append(".")
.append("\n\nThank you for sharing your research on Panorama Public. We appreciate your commitment to open science and your contributions to the research community.")
.append(NL2).append("Thank you for sharing your research on Panorama Public. We appreciate your commitment to open science and your contributions to the research community.")
.append(NL2).append("Best regards,")
.append(NL).append(getUserName(journalAdmin));
return message.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ public List<String> getInstruments()
return instruments;
}

public String getInstrumentsCommaSeparated()
{
return StringUtils.join(getInstruments(), ", ");
}

public void setInstrument(String instrument)
{
_instrument = instrument;
Expand Down Expand Up @@ -504,12 +509,12 @@ public DataLicense getDataLicense()

/**
* Returns true if the experiment is in an 'Experimental Data' folder that is public and the experiment is
* associated with a published paper.
* associated with a peer-reviewed paper (excludes biorxiv and medrxiv preprint servers).
*/
public boolean isFinal()
{
TargetedMSService.FolderType folderType = TargetedMSService.get().getFolderType(getContainer());
return Experiment.equals(folderType) && isPublic() && isPublished();
return Experiment.equals(folderType) && isPublic() && isPeerReviewed();
}

public boolean hasCompletePublicationInfo()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.labkey.api.announcements.api.Announcement;
import org.labkey.api.announcements.api.AnnouncementService;
import org.labkey.api.data.Container;
import org.labkey.api.security.User;
import org.labkey.api.view.ShortURLRecord;
import org.labkey.panoramapublic.query.SubmissionManager;

Expand Down Expand Up @@ -69,11 +73,20 @@ public int getModifiedBy()
return _journalExperiment.getModifiedBy();
}

public Integer getAnnouncementId()
public @Nullable Integer getAnnouncementId()
{
return _journalExperiment.getAnnouncementId();
}

public @Nullable Announcement getAnnouncement(@NotNull AnnouncementService announcementSvc,
@NotNull Container announcementsContainer,
@NotNull User user)
{
return (getAnnouncementId() != null)
? announcementSvc.getAnnouncement(announcementsContainer, user, getAnnouncementId())
: null; // old data before we started posting submission requests to a message board
}

public Integer getReviewerId()
{
return _journalExperiment.getReviewer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ private void postMessage()
continue;
}

Announcement announcement = announcementSvc.getAnnouncement(announcementsContainer, getUser(), submission.getAnnouncementId());
Announcement announcement = submission.getAnnouncement(announcementSvc, announcementsContainer, getUser());

if (announcement == null)
{
getLogger().error("Could not find the message thread for experiment Id: " + experimentAnnotationsId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ private static ReminderDecision getReminderDecision(@NotNull ExperimentAnnotatio
return ReminderDecision.skip("Not the current version of the experiment");
}

// Make sure the data does not have a pending re-submission request
JournalSubmission journalSubmission = SubmissionManager.getSubmissionForJournalCopy(exptAnnotations);
if (journalSubmission != null && journalSubmission.hasPendingSubmission())
{
return ReminderDecision.skip("Data has a pending re-submission request");
}

DatasetStatus datasetStatus = DatasetStatusManager.getForExperiment(exptAnnotations);
if (datasetStatus != null)
{
Expand Down Expand Up @@ -244,7 +251,7 @@ private void processExperiment(Integer experimentAnnotationsId, ProcessingContex
}

Container announcementsFolder = context.getAnnouncementsFolder();
Announcement announcement = context.getAnnouncementService().getAnnouncement(announcementsFolder, getUser(), submission.getAnnouncementId());
Announcement announcement = submission.getAnnouncement(context.getAnnouncementService(), context.getAnnouncementsFolder(), getUser());
if (announcement == null)
{
processingResults.addAnnouncementNotFound(experimentAnnotationsId, submission, announcementsFolder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ void writePublicationList(ExperimentAnnotations experimentAnnotations)
HtmlList publicationList = new HtmlList();
if(experimentAnnotations.isPublished())
{
publicationList.addItem("Link: ", experimentAnnotations.getPublicationLink(), false);
publicationList.addItem("Link", experimentAnnotations.getPublicationLink(), false);

if(experimentAnnotations.hasPubmedId())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
<li><strong>Organism:</strong> <%=h(annot.getOrganismsNoTaxId())%></li>
<%}%>
<%if(annot.getInstrument() != null){%>
<li><strong>Instrument:</strong> <%=h(annot.getInstrument())%></li>
<li><strong>Instrument:</strong> <%=h(annot.getInstrumentsCommaSeparated())%></li>
<%}%>
<%if(annot.getSpikeIn() != null){%>
<li><strong>SpikeIn:</strong>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,20 @@
%>
<p>
Select one or more files or folders in the browser above and click the download icon ( <span class="fa fa-download"></span> ).
<br/>
<br/>
Data can also be downloaded by mapping this folder as a network drive in Windows Explorer, or by using a
<%=simpleLink("WebDAV", "https://en.wikipedia.org/wiki/WebDAV")%>
client such as <span class="nobr"><%=simpleLink("CyberDuck", "https://cyberduck.io")%></span>
or <span class="nobr"><%=simpleLink("WinSCP", "https://winscp.net/eng/docs/introduction")%></span>.
For details look at <%=simpleLink("Download data from Panorama Public", downloadDataDocHref)%>.
Use the following URL, login email and password to connect to this folder:
<br/>
WebDAV downloads require an account on the PanoramaWeb server. Information on obtaining an account and other download options
is available on the <%=simpleLink("Download data from Panorama Public", downloadDataDocHref)%> help page.
Use the following URL to connect to this folder for WebDAV downloads:
<br/>
URL: <b class="bold"><span class="nobr" id="webdav_url_link"><%=h(webdavUrl)%></span></b>
<br/>
Login email: <b class="bold"><%=h(publicDataUser.getEmail())%></b>
<br/>
Password: <b class="bold"><%=h(publicDataUser.getPassword())%></b>
<b class="bold">Note: </b> If you plan to download large volumes of data or datasets from multiple projects via WebDAV,
please contact the PanoramaWeb team in advance so that we can coordinate the download to minimize load on the server
and ensure reliable access.
</p>
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@

import org.labkey.test.BaseWebDriverTest;
import org.labkey.test.Locator;
import org.labkey.test.WebTest;
import org.labkey.test.WebTestHelper;
import org.labkey.test.components.BodyWebPart;
import org.labkey.test.util.DataRegionTable;
import org.openqa.selenium.WebElement;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.Map;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
Expand Down Expand Up @@ -83,6 +89,24 @@ public void clickMakePublic()
clickLink(elementCache().makePublicButton, "Expected to see a \"Make Public\" button");
}

public Integer getExperimentAnnotationsId()
{
WebElement moreDetailsLink = elementCache().moreDetailsLink;
if (moreDetailsLink != null)
{
String href = moreDetailsLink.getAttribute("href");
try
{
return Integer.parseInt(WebTestHelper.parseUrlQuery(new URL(href)).get("id"));
}
catch (MalformedURLException e)
{
throw new RuntimeException(e);
}
}
return null;
}

public void clickAddPublication()
{
clickLink(elementCache().addPublicationButton, "Expected to see a \"Add Publication\" button");
Expand Down
Loading
Loading