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
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion elisa/src/org/labkey/elisa/ElisaController.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public static class GetCurveFitXYPairs extends ReadOnlyApiAction<GetCurveFitXYPa
public void validateForm(GetCurveFitXYPairsForm form, Errors errors)
{
// GitHub Kanban #1236: getExpRun() resolves by global rowId; ensure the run belongs to the current container
_run = ExperimentService.get().getExpRun(form.getRunId(), getContainer());
_run = ExperimentService.get().getExpRun(getContainer(), form.getRunId());
if (_run == null)
throw new NotFoundException("Run " + form.getRunId() + " does not exist.");
if (form.getNumberOfPoints() < 2)
Expand Down
16 changes: 8 additions & 8 deletions elispotassay/src/org/labkey/elispot/ElispotController.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ public class RunDetailsAction extends SimpleViewAction<DetailsForm>
@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.");
}
Expand Down Expand Up @@ -291,7 +291,7 @@ public class RunDetailRedirectAction extends SimpleRedirectAction<DetailsForm>
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.");
Expand All @@ -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.");
}
Expand Down Expand Up @@ -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.");
}
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand Down
2 changes: 1 addition & 1 deletion flow/src/org/labkey/flow/data/FlowProtocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ static public FlowProtocol getForContainer(Container container, String name)
return null;
}

// For serialzation
// For serialization
protected FlowProtocol() {}

public FlowProtocol(ExpProtocol protocol)
Expand Down
20 changes: 0 additions & 20 deletions flow/src/org/labkey/flow/data/FlowWell.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,6 @@ static public FlowWell fromWellId(long id)
return null;
}

static public List<? extends FlowWell> fromWellIds(long... ids)
{
List<FlowWell> wells = new ArrayList<>(ids.length);
List<FlowDataObject> flowobjs = fromRowIds(ids);
for (FlowDataObject flowobj : flowobjs)
if (flowobj instanceof FlowWell)
wells.add((FlowWell)flowobj);
return wells;
}

static public List<FlowWell> fromWellIds(Collection<Long> ids)
{
List<FlowWell> wells = new ArrayList<>(ids.size());
List<FlowDataObject> 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);
Expand Down
9 changes: 2 additions & 7 deletions luminex/src/org/labkey/luminex/LuminexController.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
14 changes: 7 additions & 7 deletions nab/src/org/labkey/nab/NabAssayController.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down Expand Up @@ -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.");

Expand Down Expand Up @@ -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.");
Expand Down Expand Up @@ -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.");
Expand Down Expand Up @@ -1083,7 +1083,7 @@ public class SaveQCControlInfoAction extends MutatingApiAction<QCControlInfo>
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.");
Expand All @@ -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)
{
Expand Down Expand Up @@ -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<WellExclusion> exclusions = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading