From 601e691b82cafdd9fe3dd3ce148d52660eb9608e Mon Sep 17 00:00:00 2001 From: labkey-jeckels Date: Thu, 16 Oct 2025 15:51:46 -0700 Subject: [PATCH 1/6] Expose more PropertyDescriptor data in exp.Fields --- .../org/labkey/experiment/api/BaseFieldsTable.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/experiment/src/org/labkey/experiment/api/BaseFieldsTable.java b/experiment/src/org/labkey/experiment/api/BaseFieldsTable.java index d603739eb50..4bf53d7b80c 100644 --- a/experiment/src/org/labkey/experiment/api/BaseFieldsTable.java +++ b/experiment/src/org/labkey/experiment/api/BaseFieldsTable.java @@ -3,6 +3,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.labkey.api.data.BaseColumnInfo; +import org.labkey.api.data.ColumnInfo; import org.labkey.api.data.ContainerFilter; import org.labkey.api.data.JdbcType; import org.labkey.api.data.MutableColumnInfo; @@ -13,6 +14,7 @@ import org.labkey.api.query.FieldKey; import org.labkey.api.query.FilteredTable; import org.labkey.api.security.permissions.AdminPermission; +import org.labkey.api.security.permissions.Permission; public abstract class BaseFieldsTable extends FilteredTable { @@ -32,6 +34,18 @@ public BaseFieldsTable(String tableName, @NotNull ExpSchema userSchema, @Nullabl addWrapColumn(_rootTable.getColumn("Description")); addWrapColumn(_rootTable.getColumn("RangeURI")); addWrapColumn(_rootTable.getColumn("StorageColumnName")); + addWrapColumn(_rootTable.getColumn("ConceptURI")); + + // Add the other columns in case they're useful for future troubleshooting, but keep them out + // of the way by default + for (ColumnInfo column : _rootTable.getColumns()) + { + if (getColumn(column.getName()) == null) + { + addWrapColumn(column).setHidden(true); + } + } + } protected MutableColumnInfo addColumn(String name, JdbcType type) From b1d1d85e6ecd87bf484bac4c86d8cb43e63fb637 Mon Sep 17 00:00:00 2001 From: labkey-jeckels Date: Sat, 18 Oct 2025 08:37:51 -0700 Subject: [PATCH 2/6] Fix exp.PhiFields --- experiment/src/org/labkey/experiment/api/PhiFieldsTable.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/experiment/src/org/labkey/experiment/api/PhiFieldsTable.java b/experiment/src/org/labkey/experiment/api/PhiFieldsTable.java index 5f0bc9ce4b9..7f394aa1f1d 100644 --- a/experiment/src/org/labkey/experiment/api/PhiFieldsTable.java +++ b/experiment/src/org/labkey/experiment/api/PhiFieldsTable.java @@ -18,8 +18,9 @@ public PhiFieldsTable(@NotNull ExpSchema userSchema, @Nullable ContainerFilter c setDescription("Shows one row for each PHI-annotated field in the selected folder(s). Rows are shown in " + "a folder or project only if the user has administrator permissions in that folder."); - MutableColumnInfo phi = addColumn("PHI", JdbcType.VARCHAR); + MutableColumnInfo phi = getMutableColumnOrThrow("PHI"); phi.setDescription("PHI Annotation"); + phi.setHidden(false); addCondition(new SimpleFilter(phi.getFieldKey(), "NotPHI", CompareType.NEQ)); } From 6145666348243a8ac76f5f4ab2b5cc8ccdea61f6 Mon Sep 17 00:00:00 2001 From: labkey-jeckels Date: Sat, 18 Oct 2025 08:44:25 -0700 Subject: [PATCH 3/6] Fix BiologicsReportTest --- .../api/reports/report/r/view/DownloadParamReplacement.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/org/labkey/api/reports/report/r/view/DownloadParamReplacement.java b/api/src/org/labkey/api/reports/report/r/view/DownloadParamReplacement.java index 10bff2618d2..81d2c14d87a 100644 --- a/api/src/org/labkey/api/reports/report/r/view/DownloadParamReplacement.java +++ b/api/src/org/labkey/api/reports/report/r/view/DownloadParamReplacement.java @@ -49,7 +49,7 @@ protected final File getSubstitution(File directory, String extension) fileName = getName().concat(extension); if (directory != null) - file = FileUtil.appendName(directory, fileName); + file = FileUtil.appendPath(directory, Path.parse(fileName)); } if (file != null) addFile(file); From 05ac2ca2fcb1e9a39f13dd2f6e870826a49c90ab Mon Sep 17 00:00:00 2001 From: labkey-jeckels Date: Sat, 18 Oct 2025 08:48:05 -0700 Subject: [PATCH 4/6] Import --- .../r/view/DownloadParamReplacement.java | 149 +++++++++--------- 1 file changed, 75 insertions(+), 74 deletions(-) diff --git a/api/src/org/labkey/api/reports/report/r/view/DownloadParamReplacement.java b/api/src/org/labkey/api/reports/report/r/view/DownloadParamReplacement.java index 81d2c14d87a..dc07a83d288 100644 --- a/api/src/org/labkey/api/reports/report/r/view/DownloadParamReplacement.java +++ b/api/src/org/labkey/api/reports/report/r/view/DownloadParamReplacement.java @@ -1,74 +1,75 @@ -/* - * Copyright (c) 2012-2019 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.labkey.api.reports.report.r.view; - -import org.labkey.api.reports.report.ScriptOutput; -import org.labkey.api.reports.report.r.AbstractParamReplacement; -import org.labkey.api.util.FileUtil; - -import java.io.File; - -/** - * User: Dax Hawkins - * Date: Dec 14, 2012 - */ -public abstract class DownloadParamReplacement extends AbstractParamReplacement -{ - protected static final String UNABLE_TO_RENDER = "Unable to render this output, no report associated with this replacement param"; - - public DownloadParamReplacement(String id) - { - super(id); - } - - protected final File getSubstitution(File directory, String extension) - { - String fileName; - String tokenName = getName(); - File file = null; - if (tokenName != null) - { - String tokenExtension = FileUtil.getExtension(tokenName); - if (tokenExtension != null) - fileName = tokenName; - else - fileName = getName().concat(extension); - - if (directory != null) - file = FileUtil.appendPath(directory, Path.parse(fileName)); - } - if (file != null) - addFile(file); - return file; - } - - protected ScriptOutput renderAsScriptOutput(File file, DownloadOutputView view, ScriptOutput.ScriptOutputType scriptOutputType) - { - String downloadUrl = view.renderInternalAsString(file); - - if (null != downloadUrl) - return new ScriptOutput(scriptOutputType, getName(), downloadUrl); - - return null; - } - - protected ScriptOutput renderAsScriptOutputError() - { - return new ScriptOutput(ScriptOutput.ScriptOutputType.error, getName(), - DownloadParamReplacement.UNABLE_TO_RENDER); - } -} +/* + * Copyright (c) 2012-2019 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.labkey.api.reports.report.r.view; + +import org.labkey.api.reports.report.ScriptOutput; +import org.labkey.api.reports.report.r.AbstractParamReplacement; +import org.labkey.api.util.FileUtil; +import org.labkey.api.util.Path; + +import java.io.File; + +/** + * User: Dax Hawkins + * Date: Dec 14, 2012 + */ +public abstract class DownloadParamReplacement extends AbstractParamReplacement +{ + protected static final String UNABLE_TO_RENDER = "Unable to render this output, no report associated with this replacement param"; + + public DownloadParamReplacement(String id) + { + super(id); + } + + protected final File getSubstitution(File directory, String extension) + { + String fileName; + String tokenName = getName(); + File file = null; + if (tokenName != null) + { + String tokenExtension = FileUtil.getExtension(tokenName); + if (tokenExtension != null) + fileName = tokenName; + else + fileName = getName().concat(extension); + + if (directory != null) + file = FileUtil.appendPath(directory, Path.parse(fileName)); + } + if (file != null) + addFile(file); + return file; + } + + protected ScriptOutput renderAsScriptOutput(File file, DownloadOutputView view, ScriptOutput.ScriptOutputType scriptOutputType) + { + String downloadUrl = view.renderInternalAsString(file); + + if (null != downloadUrl) + return new ScriptOutput(scriptOutputType, getName(), downloadUrl); + + return null; + } + + protected ScriptOutput renderAsScriptOutputError() + { + return new ScriptOutput(ScriptOutput.ScriptOutputType.error, getName(), + DownloadParamReplacement.UNABLE_TO_RENDER); + } +} From 983fb91d84bf76c48f0bc18a041c3485c4ed4e7e Mon Sep 17 00:00:00 2001 From: labkey-jeckels Date: Sat, 18 Oct 2025 08:49:36 -0700 Subject: [PATCH 5/6] Fix line ending --- .../r/view/DownloadParamReplacement.java | 150 +++++++++--------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/api/src/org/labkey/api/reports/report/r/view/DownloadParamReplacement.java b/api/src/org/labkey/api/reports/report/r/view/DownloadParamReplacement.java index dc07a83d288..c86fb853632 100644 --- a/api/src/org/labkey/api/reports/report/r/view/DownloadParamReplacement.java +++ b/api/src/org/labkey/api/reports/report/r/view/DownloadParamReplacement.java @@ -1,75 +1,75 @@ -/* - * Copyright (c) 2012-2019 LabKey Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.labkey.api.reports.report.r.view; - -import org.labkey.api.reports.report.ScriptOutput; -import org.labkey.api.reports.report.r.AbstractParamReplacement; -import org.labkey.api.util.FileUtil; -import org.labkey.api.util.Path; - -import java.io.File; - -/** - * User: Dax Hawkins - * Date: Dec 14, 2012 - */ -public abstract class DownloadParamReplacement extends AbstractParamReplacement -{ - protected static final String UNABLE_TO_RENDER = "Unable to render this output, no report associated with this replacement param"; - - public DownloadParamReplacement(String id) - { - super(id); - } - - protected final File getSubstitution(File directory, String extension) - { - String fileName; - String tokenName = getName(); - File file = null; - if (tokenName != null) - { - String tokenExtension = FileUtil.getExtension(tokenName); - if (tokenExtension != null) - fileName = tokenName; - else - fileName = getName().concat(extension); - - if (directory != null) - file = FileUtil.appendPath(directory, Path.parse(fileName)); - } - if (file != null) - addFile(file); - return file; - } - - protected ScriptOutput renderAsScriptOutput(File file, DownloadOutputView view, ScriptOutput.ScriptOutputType scriptOutputType) - { - String downloadUrl = view.renderInternalAsString(file); - - if (null != downloadUrl) - return new ScriptOutput(scriptOutputType, getName(), downloadUrl); - - return null; - } - - protected ScriptOutput renderAsScriptOutputError() - { - return new ScriptOutput(ScriptOutput.ScriptOutputType.error, getName(), - DownloadParamReplacement.UNABLE_TO_RENDER); - } -} +/* + * Copyright (c) 2012-2019 LabKey Corporation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.labkey.api.reports.report.r.view; + +import org.labkey.api.reports.report.ScriptOutput; +import org.labkey.api.reports.report.r.AbstractParamReplacement; +import org.labkey.api.util.FileUtil; +import org.labkey.api.util.Path; + +import java.io.File; + +/** + * User: Dax Hawkins + * Date: Dec 14, 2012 + */ +public abstract class DownloadParamReplacement extends AbstractParamReplacement +{ + protected static final String UNABLE_TO_RENDER = "Unable to render this output, no report associated with this replacement param"; + + public DownloadParamReplacement(String id) + { + super(id); + } + + protected final File getSubstitution(File directory, String extension) + { + String fileName; + String tokenName = getName(); + File file = null; + if (tokenName != null) + { + String tokenExtension = FileUtil.getExtension(tokenName); + if (tokenExtension != null) + fileName = tokenName; + else + fileName = getName().concat(extension); + + if (directory != null) + file = FileUtil.appendPath(directory, Path.parse(fileName)); + } + if (file != null) + addFile(file); + return file; + } + + protected ScriptOutput renderAsScriptOutput(File file, DownloadOutputView view, ScriptOutput.ScriptOutputType scriptOutputType) + { + String downloadUrl = view.renderInternalAsString(file); + + if (null != downloadUrl) + return new ScriptOutput(scriptOutputType, getName(), downloadUrl); + + return null; + } + + protected ScriptOutput renderAsScriptOutputError() + { + return new ScriptOutput(ScriptOutput.ScriptOutputType.error, getName(), + DownloadParamReplacement.UNABLE_TO_RENDER); + } +} From a387b1f2700f9ffe885cf007e7a060063ce20ce8 Mon Sep 17 00:00:00 2001 From: labkey-jeckels Date: Sun, 19 Oct 2025 08:36:46 -0700 Subject: [PATCH 6/6] Distinguish between failures --- .../labkey/assay/AssayIntegrationTestCase.jsp | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/assay/src/org/labkey/assay/AssayIntegrationTestCase.jsp b/assay/src/org/labkey/assay/AssayIntegrationTestCase.jsp index 674ad8d39fd..d66cbfd7755 100644 --- a/assay/src/org/labkey/assay/AssayIntegrationTestCase.jsp +++ b/assay/src/org/labkey/assay/AssayIntegrationTestCase.jsp @@ -96,6 +96,8 @@ <%@ page import="java.io.IOException" %> <%@ page import="org.apache.commons.collections.MapUtils" %> <%@ page import="org.labkey.vfs.FileSystemLike" %> +<%@ page import="static org.junit.Assert.assertEquals" %> +<%@ page import="static org.junit.Assert.assertNotEquals" %> <%@ page extends="org.labkey.api.jsp.JspTest.BVT" %> <%! @@ -559,18 +561,18 @@ runsQUS.updateRows(user, c, Collections.singletonList(updated), null, errors, null, null); // verify runs modified is changed, but created is not Map modifiedRunResults = new TableSelector(runsTable, selectColumns, new SimpleFilter("rowId", runRowId), null).getMap(); - assertTrue(modifiedRunResults.get("Created").equals(runOriginalCreated)); - assertFalse(modifiedRunResults.get("Modified").equals(runOriginalModified)); + assertEquals("modifiedRunResults should have the same Created", modifiedRunResults.get("Created"), runOriginalCreated); + assertNotEquals("modifiedRunResults should have a different Modified", modifiedRunResults.get("Modified"), runOriginalModified); // verify results created/modified matches run's created in query table Map queryResultAfterRunModify = new TableSelector(resultsTable, selectColumns, new SimpleFilter(runFieldKey, runRowId), null).getMap(); - assertTrue(queryResultAfterRunModify.get("Created").equals(runOriginalCreated)); - assertTrue(queryResultAfterRunModify.get("Modified").equals(runOriginalCreated)); - assertFalse(queryResultAfterRunModify.get("Modified").equals(modifiedRunResults.get("Modified"))); + assertEquals("queryResultAfterRunModify should have the same Created", queryResultAfterRunModify.get("Created"), runOriginalCreated); + assertEquals("queryResultAfterRunModify should have the same Modified", queryResultAfterRunModify.get("Modified"), runOriginalCreated); + assertNotEquals("queryResultAfterRunModify should have a different Modified", queryResultAfterRunModify.get("Modified"), modifiedRunResults.get("Modified")); // verify created/modified in provisioned result table is still not populated after run edit dbResult = getRealResult(resultsTable.getSchema(), realResultsTable.getName(), resultRowId); - assertTrue(dbResult.get("Created") == null && dbResult.get("Modified") == null); + assertTrue("Created and Modified in the provisioned result table weren't as expected", dbResult.get("Created") == null && dbResult.get("Modified") == null); // now edit the result QueryUpdateService resultsQUS = resultsTable.getUpdateService(); @@ -582,18 +584,18 @@ // verify result created matches run's created in query table, but result modified now differs from run's created Map modifiedResults = new TableSelector(resultsTable, selectColumns, new SimpleFilter(runFieldKey, runRowId), null).getMap(); - assertTrue(modifiedResults.get("Created").equals(runOriginalCreated)); - assertFalse(modifiedResults.get("Created").equals(modifiedResults.get("Modified"))); - assertFalse(modifiedResults.get("Modified").equals(runOriginalCreated)); - assertFalse(modifiedResults.get("Modified").equals(runOriginalModified)); - assertFalse(modifiedResults.get("Modified").equals(modifiedRunResults.get("Modified"))); + assertEquals("modifiedResults Created didn't match runOriginalCreated", modifiedResults.get("Created"), runOriginalCreated); + assertNotEquals("modifiedResults Created shouldn't match modifiedResult Modified", modifiedResults.get("Created"), modifiedResults.get("Modified")); + assertNotEquals("modifiedResults Modified shouldn't match runOriginalCreated", modifiedResults.get("Modified"), runOriginalCreated); + assertNotEquals("modifiedResults Modified shouldn't match runOriginalModified", modifiedResults.get("Modified"), runOriginalModified); + assertNotEquals("modifiedResults Modified shouldn't match modifiedRunResults Modified", modifiedResults.get("Modified"), modifiedRunResults.get("Modified")); // verify modified in provisioned result table no longer null after result edit dbResult = getRealResult(resultsTable.getSchema(), realResultsTable.getName(), resultRowId); - assertTrue(dbResult.get("Created") == null && dbResult.get("CreatedBy") == null); - assertFalse(dbResult.get("Modified") == null || dbResult.get("ModifiedBy") == null); - assertTrue(dbResult.get("Modified").equals(modifiedResults.get("Modified"))); - assertTrue(dbResult.get("ModifiedBy").equals(modifiedResults.get("ModifiedBy"))); + assertTrue("dbResult shouldn't have Created or CreatedBy", dbResult.get("Created") == null && dbResult.get("CreatedBy") == null); + assertFalse("dbResult didn't have a Modified or ModifiedBy", dbResult.get("Modified") == null || dbResult.get("ModifiedBy") == null); + assertEquals("dbResults Modified didn't match", dbResult.get("Modified"), modifiedResults.get("Modified")); + assertEquals("dbResults ModifiedBy didn't match", dbResult.get("ModifiedBy"), modifiedResults.get("ModifiedBy")); } @Test