diff --git a/.gitattributes b/.gitattributes index 218f1d92c..e9e6c9066 100644 --- a/.gitattributes +++ b/.gitattributes @@ -554,8 +554,6 @@ ms2/resources/queries/protein/GOMolecularFunction.query.xml -text ms2/resources/queries/protein/GOMolecularFunction.sql -text ms2/resources/schemas/dbscripts/postgresql/ms2-create.sql -text ms2/resources/schemas/dbscripts/postgresql/ms2-drop.sql -text -ms2/resources/schemas/dbscripts/sqlserver/ms2-create.sql -text -ms2/resources/schemas/dbscripts/sqlserver/ms2-drop.sql -text ms2/resources/schemas/ms2.xml -text ms2/resources/views/runsOverview.html -text ms2/resources/views/runsOverview.view.xml -text diff --git a/elisa/src/org/labkey/elisa/ElisaController.java b/elisa/src/org/labkey/elisa/ElisaController.java index da34acf5e..42f16a893 100644 --- a/elisa/src/org/labkey/elisa/ElisaController.java +++ b/elisa/src/org/labkey/elisa/ElisaController.java @@ -111,7 +111,7 @@ public static class GetCurveFitXYPairs extends ReadOnlyApiAction @Override public ModelAndView getView(DetailsForm form, BindException errors) { - _run = ExperimentService.get().getExpRun(form.getRowId()); - if (_run == null || !_run.getContainer().equals(getContainer())) + _run = ExperimentService.get().getExpRun(getContainer(), form.getRowId()); + if (_run == null) { throw new NotFoundException("Run " + form.getRowId() + " does not exist."); } @@ -291,7 +291,7 @@ public class RunDetailRedirectAction extends SimpleRedirectAction public ActionURL getRedirectURL(DetailsForm form) { // GitHub Kanban #1236: getExpRun() resolves by rowId; ensure the run belongs to the current container - ExpRun run = ExperimentService.get().getExpRun(form.getRowId(), getContainer()); + ExpRun run = ExperimentService.get().getExpRun(getContainer(), form.getRowId()); if (run == null) { throw new NotFoundException("Run " + form.getRowId() + " does not exist."); @@ -313,8 +313,8 @@ public ApiResponse execute(DetailsForm form, BindException errors) { ApiSimpleResponse response = new ApiSimpleResponse(); - ExpRun run = ExperimentService.get().getExpRun(form.getRowId()); - if (run == null || !run.getContainer().equals(getContainer())) + ExpRun run = ExperimentService.get().getExpRun(getContainer(), form.getRowId()); + if (run == null) { throw new NotFoundException("Run " + form.getRowId() + " does not exist."); } @@ -558,7 +558,7 @@ public boolean handlePost(Object o, BindException errors) throws Exception for (String selection : selections) { int rowId = NumberUtils.toInt(selection, -1); - ExpRun run = rowId != -1 ? ExperimentService.get().getExpRun(rowId, getContainer()) : null; + ExpRun run = rowId != -1 ? ExperimentService.get().getExpRun(getContainer(), rowId) : null; if (run == null) throw new NotFoundException("Run " + selection + " does not exist."); } @@ -614,8 +614,8 @@ public void testRunDetailRedirectContainerScoping() throws Exception // Control: the same run resolves through the container-scoped lookup from its own container but not from // folder A, demonstrating the mechanism the fix relies on (the run exists identically in both calls). ExperimentService exp = ExperimentService.get(); - assertNotNull("Run should resolve within its own container", exp.getExpRun(runInB.getRowId(), _folderB)); - assertNull("Run must not resolve from a foreign container", exp.getExpRun(runInB.getRowId(), _folderA)); + assertNotNull("Run should resolve within its own container", exp.getExpRun(_folderB, runInB.getRowId())); + assertNull("Run must not resolve from a foreign container", exp.getExpRun(_folderA, runInB.getRowId())); } private ExpRun createRun(Container c) throws Exception diff --git a/elispotassay/src/org/labkey/elispot/pipeline/BackgroundSubtractionJob.java b/elispotassay/src/org/labkey/elispot/pipeline/BackgroundSubtractionJob.java index e7414c4a8..bf1336964 100644 --- a/elispotassay/src/org/labkey/elispot/pipeline/BackgroundSubtractionJob.java +++ b/elispotassay/src/org/labkey/elispot/pipeline/BackgroundSubtractionJob.java @@ -102,7 +102,12 @@ public void run() if (rowId != -1) { - ExpRun run = ExperimentService.get().getExpRun(rowId); + ExpRun run = ExperimentService.get().getExpRun(getContainer(), rowId); + if (run == null) + { + info("Skipping run " + runId + ": not found in this folder."); + continue; + } try (DbScope.Transaction transaction = ExperimentService.get().getSchema().getScope().ensureTransaction()) { diff --git a/flow/src/org/labkey/flow/data/FlowProtocol.java b/flow/src/org/labkey/flow/data/FlowProtocol.java index 06c56b8a5..918fdc80d 100644 --- a/flow/src/org/labkey/flow/data/FlowProtocol.java +++ b/flow/src/org/labkey/flow/data/FlowProtocol.java @@ -199,7 +199,7 @@ static public FlowProtocol getForContainer(Container container, String name) return null; } - // For serialzation + // For serialization protected FlowProtocol() {} public FlowProtocol(ExpProtocol protocol) diff --git a/flow/src/org/labkey/flow/data/FlowWell.java b/flow/src/org/labkey/flow/data/FlowWell.java index 19474f314..c969046c5 100644 --- a/flow/src/org/labkey/flow/data/FlowWell.java +++ b/flow/src/org/labkey/flow/data/FlowWell.java @@ -65,26 +65,6 @@ static public FlowWell fromWellId(long id) return null; } - static public List fromWellIds(long... ids) - { - List wells = new ArrayList<>(ids.length); - List flowobjs = fromRowIds(ids); - for (FlowDataObject flowobj : flowobjs) - if (flowobj instanceof FlowWell) - wells.add((FlowWell)flowobj); - return wells; - } - - static public List fromWellIds(Collection ids) - { - List wells = new ArrayList<>(ids.size()); - List flowobjs = fromRowIds(ids); - for (FlowDataObject flowobj : flowobjs) - if (flowobj instanceof FlowWell) - wells.add((FlowWell)flowobj); - return wells; - } - static public FlowWell fromURL(ActionURL url, Container actionContainer, User user) { return fromURL(url, null, actionContainer, user); diff --git a/luminex/src/org/labkey/luminex/LuminexController.java b/luminex/src/org/labkey/luminex/LuminexController.java index 6e11ca253..14f1d4214 100644 --- a/luminex/src/org/labkey/luminex/LuminexController.java +++ b/luminex/src/org/labkey/luminex/LuminexController.java @@ -633,17 +633,12 @@ public void validateForm(LuminexSaveExclusionsForm form, Errors errors) } // verify that the runId is valid and matches an existing run - if (form.getRunId() == null || ExperimentService.get().getExpRun(form.getRunId()) == null) + ExpRun run = form.getRunId() != null ? ExperimentService.get().getExpRun(getContainer(), form.getRunId()) : null; + if (run == null) { errors.reject(ERROR_MSG, "No run found for id " + form.getRunId()); } - ExpRun run = ExperimentService.get().getExpRun(form.getRunId()); - if (!getContainer().equals(run.getContainer())) - { - errors.reject(ERROR_MSG, "The run for id " + form.getRunId() + " does not exist in the current container"); - } - form.validate(errors); } diff --git a/nab/src/org/labkey/nab/NabAssayController.java b/nab/src/org/labkey/nab/NabAssayController.java index 16f477881..1b8d44ad9 100644 --- a/nab/src/org/labkey/nab/NabAssayController.java +++ b/nab/src/org/labkey/nab/NabAssayController.java @@ -233,7 +233,7 @@ public ModelAndView getView(RenderAssayForm form, BindException errors) throws E throw new NotFoundException("No run specified"); } // GitHub Kanban #1892: getExpRun() resolves by global rowId; ensure the run belongs to the current container - ExpRun run = ExperimentService.get().getExpRun(form.getRowId(), getContainer()); + ExpRun run = ExperimentService.get().getExpRun(getContainer(), form.getRowId()); if (run == null) { throw new NotFoundException("Run " + form.getRowId() + " does not exist."); @@ -483,7 +483,7 @@ public void validateCommand(DeleteRunForm form, Errors errors) throw new NotFoundException("No run specified"); } // GitHub Kanban #1892: getExpRun() resolves by global rowId; ensure the run belongs to the current container - _run = ExperimentService.get().getExpRun(form.getRowId(), getContainer()); + _run = ExperimentService.get().getExpRun(getContainer(), form.getRowId()); if (_run == null) throw new NotFoundException("Run " + form.getRowId() + " does not exist."); @@ -841,7 +841,7 @@ public ModelAndView getView(NabQCForm form, BindException errors) form.setEdit(false); // GitHub Kanban #1892: Resolve the run scoped to the current container - ExpRun run = ExperimentService.get().getExpRun(form.getRowId(), getContainer()); + ExpRun run = ExperimentService.get().getExpRun(getContainer(), form.getRowId()); if (run == null) { throw new NotFoundException("Run " + form.getRowId() + " does not exist."); @@ -884,7 +884,7 @@ public ApiResponse execute(NabQCForm form, BindException errors) throws Exceptio { ApiSimpleResponse response = new ApiSimpleResponse(); // GitHub Kanban #1892: Resolve the run scoped to the current container - ExpRun run = ExperimentService.get().getExpRun(form.getRowId(), getContainer()); + ExpRun run = ExperimentService.get().getExpRun(getContainer(), form.getRowId()); if (run == null) { throw new NotFoundException("Run " + form.getRowId() + " does not exist."); @@ -1083,7 +1083,7 @@ public class SaveQCControlInfoAction extends MutatingApiAction public void validateForm(QCControlInfo form, Errors errors) { // GitHub Kanban #1892: Resolve the run scoped to the current container - _run = ExperimentService.get().getExpRun(form.getRunId(), getContainer()); + _run = ExperimentService.get().getExpRun(getContainer(), form.getRunId()); if (_run == null) { errors.reject(ERROR_MSG, "NAb Run " + form.getRunId() + " does not exist."); @@ -1096,7 +1096,7 @@ public ApiResponse execute(QCControlInfo form, BindException errors) throws Exce ApiSimpleResponse response = new ApiSimpleResponse(); DbSchema schema = DilutionManager.getSchema(); DbScope scope = schema.getScope(); - ExpRun run = ExperimentService.get().getExpRun(form.getRunId()); + ExpRun run = _run; if (run != null) { @@ -1312,7 +1312,7 @@ public ApiResponse execute(RenderAssayBean form, BindException errors) { ApiSimpleResponse response = new ApiSimpleResponse(); // GitHub Kanban #1892: Resolve the run scoped to the current container - ExpRun run = ExperimentService.get().getExpRun(form.getRowId(), getContainer()); + ExpRun run = ExperimentService.get().getExpRun(getContainer(), form.getRowId()); if (run != null) { List exclusions = new ArrayList<>(); diff --git a/viability/src/org/labkey/viability/ViabilityAssayUploadWizardAction.java b/viability/src/org/labkey/viability/ViabilityAssayUploadWizardAction.java index 3cdc41e29..759b9e23f 100644 --- a/viability/src/org/labkey/viability/ViabilityAssayUploadWizardAction.java +++ b/viability/src/org/labkey/viability/ViabilityAssayUploadWizardAction.java @@ -369,7 +369,7 @@ public boolean executeStep(ViabilityAssayRunUploadForm form, BindException error ExpExperiment experiment = null; if (form.getReRunId() != null) { - ExpRun reRun = ExperimentService.get().getExpRun(form.getReRunId()); + ExpRun reRun = ExperimentService.get().getExpRun(getContainer(), form.getReRunId()); if (reRun != null) { experiment = findExperiment(reRun);