From 11030d8666c973ac2c1c8519b29770df06d91f28 Mon Sep 17 00:00:00 2001 From: labkey-jeckels Date: Mon, 15 Jun 2026 16:10:13 -0700 Subject: [PATCH 1/4] Delete unused "named set" code --- .../query/controllers/QueryController.java | 59 ------------------- query/webapp/query/olap.js | 58 ------------------ 2 files changed, 117 deletions(-) diff --git a/query/src/org/labkey/query/controllers/QueryController.java b/query/src/org/labkey/query/controllers/QueryController.java index 82ffe266649..7fc5b65425f 100644 --- a/query/src/org/labkey/query/controllers/QueryController.java +++ b/query/src/org/labkey/query/controllers/QueryController.java @@ -96,7 +96,6 @@ import org.labkey.api.data.ActionButton; import org.labkey.api.data.Aggregate; import org.labkey.api.data.AnalyticsProviderItem; -import org.labkey.api.data.BaseColumnInfo; import org.labkey.api.data.ButtonBar; import org.labkey.api.data.CachedResultSetBuilder; import org.labkey.api.data.ColumnHeaderType; @@ -7564,64 +7563,6 @@ public void setSchemas(Map>> schemas) } } - - @RequiresPermission(ReadPermission.class) - public static class SaveNamedSetAction extends MutatingApiAction - { - @Override - public Object execute(NamedSetForm namedSetForm, BindException errors) - { - QueryService.get().saveNamedSet(namedSetForm.getSetName(), namedSetForm.parseSetList()); - return new ApiSimpleResponse("success", true); - } - } - - - @SuppressWarnings({"unused", "WeakerAccess"}) - public static class NamedSetForm - { - String setName; - String[] setList; - - public String getSetName() - { - return setName; - } - - public void setSetName(String setName) - { - this.setName = setName; - } - - public String[] getSetList() - { - return setList; - } - - public void setSetList(String[] setList) - { - this.setList = setList; - } - - public List parseSetList() - { - return Arrays.asList(setList); - } - } - - - @RequiresPermission(ReadPermission.class) - public static class DeleteNamedSetAction extends MutatingApiAction - { - - @Override - public Object execute(NamedSetForm namedSetForm, BindException errors) - { - QueryService.get().deleteNamedSet(namedSetForm.getSetName()); - return new ApiSimpleResponse("success", true); - } - } - @RequiresPermission(ReadPermission.class) public static class AnalyzeQueriesAction extends ReadOnlyApiAction { diff --git a/query/webapp/query/olap.js b/query/webapp/query/olap.js index 68acba866b1..5bf46c46e82 100644 --- a/query/webapp/query/olap.js +++ b/query/webapp/query/olap.js @@ -681,7 +681,6 @@ Ext4.define('LABKEY.query.olap.MDX', { _cube : null, _filter : null, - _serverSets: {}, constructor: function(cube) { @@ -785,67 +784,10 @@ return this._filter[name]; }, - serverSaveNamedSet : function(name, members, callback, scope) { - Ext4.Ajax.request({ - url: LABKEY.ActionURL.buildURL('query', 'saveNamedSet'), - method: 'POST', - jsonData: { - setName: name, - setList: members - }, - success: function(response) { -// console.log('saved "' + name + '" in server cache. Contains', members.length, 'members.'); - this._serverSets[name] = members; - if (Ext4.isFunction(callback)) { - callback.call(scope || this, name); - } - }, - failure: function() { - alert('ERROR: serverSaveNamedSet.'); - }, - scope: this - }); - }, - allowMemberCaching : function() { return this._cube.useServerMemberCache === true; }, - serverDeleteNamedSet : function(name, callback, scope) { - Ext4.Ajax.request({ - url: LABKEY.ActionURL.buildURL('query', 'deleteNamedSet'), - method: 'POST', - jsonData: { - setName: name - }, - success: function() { -// console.log('deleted "' + name + '" in server cache.'); - if (this._serverSets[name]) { - delete this._serverSets[name]; - } - if (Ext4.isFunction(callback)) { - callback.call(scope || this); - } - }, - failure: function() { - alert('ERROR: serverDeleteNamedSet.'); - }, - scope: this - }); - }, - - serverGetNamedSets : function() { - return Ext4.clone(this._serverSets); - }, - - serverGetNamedSet : function(name) { - return this._serverSets[name]; - }, - - serverHasNamedSet : function(name) { - return Ext4.isArray(this._serverSets[name]); - }, - resetNamedFilters : function() { this._filter = {}; From b7f14bdf608a96a2537effbc23f40dc063e5a91d Mon Sep 17 00:00:00 2001 From: labkey-jeckels Date: Mon, 15 Jun 2026 16:17:00 -0700 Subject: [PATCH 2/4] Delete unused "named set" code --- query/src/org/labkey/query/controllers/QueryController.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/query/src/org/labkey/query/controllers/QueryController.java b/query/src/org/labkey/query/controllers/QueryController.java index 7fc5b65425f..3cb0d7f6d5d 100644 --- a/query/src/org/labkey/query/controllers/QueryController.java +++ b/query/src/org/labkey/query/controllers/QueryController.java @@ -8355,8 +8355,6 @@ controller.new ImportAction(), new AuditHistoryAction(), new AuditDetailsAction(), new ExportTablesAction(), - new SaveNamedSetAction(), - new DeleteNamedSetAction(), new ApiTestAction(), new GetDefaultVisibleColumnsAction() ); From de1716b025bc2f4a1b6ebeb93eb33eb1dceefa7e Mon Sep 17 00:00:00 2001 From: labkey-jeckels Date: Mon, 15 Jun 2026 16:42:10 -0700 Subject: [PATCH 3/4] More references --- api/src/org/labkey/api/data/CompareType.java | 38 ------------------- api/src/org/labkey/api/data/SimpleFilter.java | 5 --- .../org/labkey/api/query/QueryService.java | 6 --- .../api/visualization/VisDataRequest.java | 13 ------- .../VisualizationSourceColumn.java | 6 --- .../org/labkey/query/QueryServiceImpl.java | 30 --------------- .../src/org/labkey/query/olap/QubeQuery.java | 33 ---------------- .../VisualizationController.java | 3 +- 8 files changed, 1 insertion(+), 133 deletions(-) diff --git a/api/src/org/labkey/api/data/CompareType.java b/api/src/org/labkey/api/data/CompareType.java index ef1905ee6d2..b3928febbf3 100644 --- a/api/src/org/labkey/api/data/CompareType.java +++ b/api/src/org/labkey/api/data/CompareType.java @@ -560,44 +560,6 @@ public boolean isNewLineSeparatorAllowed() } }; - public static final CompareType IN_NS = new CompareType("Equals One Of A Member Of A Named Set", "inns", "IN", true, null, OperatorType.IN) - { - // Each compare type uses CompareClause by default - @Override - public FilterClause createFilterClause(@NotNull FieldKey fieldKey, Object value) - { - String namedSet = null; - if (value != null && StringUtils.isNotBlank(value.toString())) - namedSet = value.toString(); - return new SimpleFilter.InClause(fieldKey, namedSet, true); - } - - @Override - public boolean meetsCriteria(ColumnRenderProperties col, Object value, Object[] paramVals) - { - throw new UnsupportedOperationException("Should be handled inside of " + SimpleFilter.InClause.class); - } - }; - - public static final CompareType NOT_IN_NS = new CompareType("Does Not Equal Any Members Of A Named Set", "notinns", "NOT IN", true, null, OperatorType.NOTIN) - { - // Each compare type uses CompareClause by default - @Override - public FilterClause createFilterClause(@NotNull FieldKey fieldKey, Object value) - { - String namedSet = null; - if (value != null && StringUtils.isNotBlank(value.toString())) - namedSet = value.toString(); - return new SimpleFilter.InClause(fieldKey, namedSet, true); - } - - @Override - public boolean meetsCriteria(ColumnRenderProperties col, Object value, Object[] paramVals) - { - throw new UnsupportedOperationException("Should be handled inside of " + SimpleFilter.InClause.class); - } - }; - // BETWEEN is inclusive of the begin and end values public static final CompareType BETWEEN = new CompareType("Between", "between", "BETWEEN", true, " BETWEEN ? AND ?", OperatorType.BETWEEN) { diff --git a/api/src/org/labkey/api/data/SimpleFilter.java b/api/src/org/labkey/api/data/SimpleFilter.java index 9edaee620f8..f06b23998d5 100644 --- a/api/src/org/labkey/api/data/SimpleFilter.java +++ b/api/src/org/labkey/api/data/SimpleFilter.java @@ -719,11 +719,6 @@ public InClause(FieldKey fieldKey, Collection params, boolean urlClause, bool _needsTypeConversion = urlClause; } - public InClause(FieldKey fieldKey, String namedSet, boolean urlClause) - { - this(fieldKey, QueryService.get().getNamedSet(namedSet), urlClause, false); - } - @Override public void appendFilterText(StringBuilder sb, ColumnNameFormatter formatter) { diff --git a/api/src/org/labkey/api/query/QueryService.java b/api/src/org/labkey/api/query/QueryService.java index dc14c04d745..d54e7b9e044 100644 --- a/api/src/org/labkey/api/query/QueryService.java +++ b/api/src/org/labkey/api/query/QueryService.java @@ -42,7 +42,6 @@ import org.labkey.api.data.Sort; import org.labkey.api.data.SqlSelector; import org.labkey.api.data.TableInfo; -import org.labkey.api.data.TableSelector; import org.labkey.api.data.dialect.SqlDialect; import org.labkey.api.gwt.client.model.GWTPropertyDescriptor; import org.labkey.api.module.Module; @@ -62,7 +61,6 @@ import org.springframework.web.servlet.mvc.Controller; import java.io.IOException; -import java.sql.ResultSet; import java.util.Collection; import java.util.LinkedHashMap; import java.util.List; @@ -504,10 +502,6 @@ interface Hierarchy */ Collection getOlapHierarchies(String configId, Container c, String cubeName, String dimension); - void saveNamedSet(String setName, List setList); - void deleteNamedSet(String setName); - List getNamedSet(String setName); - /** * Add a pass-through method to the allow list for the primary LabKey database type. This enables modules to create * and enable custom database functions, for example. diff --git a/api/src/org/labkey/api/visualization/VisDataRequest.java b/api/src/org/labkey/api/visualization/VisDataRequest.java index 9a270e15a0d..a42ac28175b 100644 --- a/api/src/org/labkey/api/visualization/VisDataRequest.java +++ b/api/src/org/labkey/api/visualization/VisDataRequest.java @@ -237,7 +237,6 @@ public static class Measure String alias; Boolean inNotNullSet; String name; - String nsvalues; String queryName; String axisName; Boolean requireLeftJoin; @@ -398,18 +397,6 @@ public Measure setIsDemographic(boolean isDemographic) return this; } - // see QueryService.get().getNamedSet(); - public String getNsvalues() - { - return nsvalues; - } - - public Measure setNsvalues(String nsvalues) - { - this.nsvalues = nsvalues; - return this; - } - public List getValues() { return values; diff --git a/api/src/org/labkey/api/visualization/VisualizationSourceColumn.java b/api/src/org/labkey/api/visualization/VisualizationSourceColumn.java index 6defadfc04a..75cc8fd0dd8 100644 --- a/api/src/org/labkey/api/visualization/VisualizationSourceColumn.java +++ b/api/src/org/labkey/api/visualization/VisualizationSourceColumn.java @@ -173,12 +173,6 @@ protected VisualizationSourceColumn(ViewContext context, VisDataRequest.Measure { _values.addAll(values); } - String namedSetValue = measure.getNsvalues(); - if (namedSetValue != null) - { - List namedSet = QueryService.get().getNamedSet(namedSetValue); - _values.addAll(namedSet); - } } private static UserSchema getUserSchema(ViewContext context, String schemaName) diff --git a/query/src/org/labkey/query/QueryServiceImpl.java b/query/src/org/labkey/query/QueryServiceImpl.java index b5293e49739..b972c6ee8bd 100644 --- a/query/src/org/labkey/query/QueryServiceImpl.java +++ b/query/src/org/labkey/query/QueryServiceImpl.java @@ -39,8 +39,6 @@ import org.labkey.api.audit.AuditLogService; import org.labkey.api.audit.AuditTypeEvent; import org.labkey.api.audit.DetailedAuditTypeEvent; -import org.labkey.api.cache.Cache; -import org.labkey.api.cache.CacheManager; import org.labkey.api.collections.CaseInsensitiveHashMap; import org.labkey.api.collections.LabKeyCollectors; import org.labkey.api.data.AuditConfigurable; @@ -97,7 +95,6 @@ import org.labkey.api.query.DefaultSchema; import org.labkey.api.query.DetailsURL; import org.labkey.api.query.FieldKey; -import org.labkey.api.query.InvalidNamedSetException; import org.labkey.api.query.MetadataColumnJSON; import org.labkey.api.query.MetadataUnavailableException; import org.labkey.api.query.QueryAction; @@ -271,9 +268,6 @@ public void moduleChanged(Module module) } }; - private static final Cache> NAMED_SET_CACHE = CacheManager.getCache(100, CacheManager.DAY, "Named sets for IN clause"); - private static final String NAMED_SET_CACHE_ENTRY = "NAMEDSETS:"; - private final ConcurrentMap, Pair> _schemaLinkActions = new ConcurrentHashMap<>(); private QueryAnalysisService _queryAnalysisService; @@ -303,8 +297,6 @@ public void moduleChanged(Module module) CompareType.CONTAINS_NONE_OF, CompareType.IN, CompareType.NOT_IN, - CompareType.IN_NS, - CompareType.NOT_IN_NS, CompareType.BETWEEN, CompareType.NOT_BETWEEN, CompareType.MEMBER_OF, @@ -2577,28 +2569,6 @@ public MultiValuedMap load(Stream setList) - { - NAMED_SET_CACHE.put(NAMED_SET_CACHE_ENTRY + setName, setList); - } - - @Override - public void deleteNamedSet(String setName) - { - NAMED_SET_CACHE.remove(NAMED_SET_CACHE_ENTRY + setName); - } - - @Override - public List getNamedSet(String setName) - { - List namedSet = NAMED_SET_CACHE.get(NAMED_SET_CACHE_ENTRY + setName); - if (namedSet == null) - throw new InvalidNamedSetException("Named set not found in cache: " + setName); - - return Collections.unmodifiableList(namedSet); - } - @Override public void registerPassthroughMethod(String name, @Nullable String declaringSchemaName, JdbcType returnType, int minArguments, int maxArguments) { diff --git a/query/src/org/labkey/query/olap/QubeQuery.java b/query/src/org/labkey/query/olap/QubeQuery.java index d54f645e1ab..e982d27eef8 100644 --- a/query/src/org/labkey/query/olap/QubeQuery.java +++ b/query/src/org/labkey/query/olap/QubeQuery.java @@ -21,7 +21,6 @@ import org.json.JSONObject; import org.labkey.api.action.SpringActionController; import org.labkey.api.collections.CaseInsensitiveHashMap; -import org.labkey.api.query.QueryService; import org.labkey.api.util.JsonUtil; import org.labkey.api.util.Path; import org.labkey.query.olap.metadata.CachedCube; @@ -466,38 +465,6 @@ else if (membersObj instanceof JSONArray arr) } e.membersSet = set; } - else if (membersObj instanceof JSONObject membersJson) - { - if (membersJson.has("namedSet")) - { - // For now we're only expecting a single optional property in the json map, to use a previously - // saved named set substition for the members enumeration. - Object setName = membersJson.get("namedSet"); - if (!(setName instanceof String) || setName.toString().isEmpty()) - { - errors.reject(SpringActionController.ERROR_MSG, "Could not parse namedSet for members property"); - throw errors; - } - List namedSet = QueryService.get().getNamedSet(setName.toString()); - TreeSet set = new TreeSet<>(new CompareMetaDataElement()); - for (String nsEntry : namedSet) - { - Member m = _getMember(nsEntry, h, l); - if (null == m) - { - errors.reject(SpringActionController.ERROR_MSG, "Member not found: " + nsEntry); - throw errors; - } - set.add(m); - } - e.membersSet = set; - } - } - else - { - errors.reject(SpringActionController.ERROR_MSG, "Could not parse members property"); - throw errors; - } } else if (null != json.opt("membersQuery")) { diff --git a/visualization/src/org/labkey/visualization/VisualizationController.java b/visualization/src/org/labkey/visualization/VisualizationController.java index f1529480719..2b2de37b9ca 100644 --- a/visualization/src/org/labkey/visualization/VisualizationController.java +++ b/visualization/src/org/labkey/visualization/VisualizationController.java @@ -1660,7 +1660,7 @@ public void testJacksonBinding() throws Exception ObjectReader r = JsonUtil.DEFAULT_MAPPER.reader(VisDataRequest.class) .without(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); String measure1 = "{\"allowNullResults\":true, \"aggregate\":\"MAX\", \"alias\":\"table_column\", " + - "\"inNotNullSet\":true, \"name\":\"column\", \"nsvalues\":\"whatisthis\"," + + "\"inNotNullSet\":true, \"name\":\"column\", " + "\"queryName\":\"table\", \"requireLeftJoin\":true, \"schemaName\":\"schema\", \"values\":[1,2,3]}"; String measure2 = "{\"allowNullResults\":false, \"aggregate\":\"MAX\", \"alias\":\"table_column2\", " + "\"inNotNullSet\":false, \"name\":\"column2\"," + @@ -1707,7 +1707,6 @@ public void testJacksonBinding() throws Exception assertEquals("table_column", m.getAlias()); assertTrue(m.getInNotNullSet()); assertEquals("column", m.getName()); - assertEquals("whatisthis", m.getNsvalues()); assertEquals("table", m.getQueryName()); assertTrue(m.getRequireLeftJoin()); assertEquals("schema", m.getSchemaName()); From fa95ee84914e0ef7b7e8448e2f5b367d69424a80 Mon Sep 17 00:00:00 2001 From: labkey-jeckels Date: Mon, 15 Jun 2026 16:53:31 -0700 Subject: [PATCH 4/4] More references --- .../api/query/InvalidNamedSetException.java | 34 ------------------- .../src/org/labkey/query/olap/QubeQuery.java | 5 +++ 2 files changed, 5 insertions(+), 34 deletions(-) delete mode 100644 api/src/org/labkey/api/query/InvalidNamedSetException.java diff --git a/api/src/org/labkey/api/query/InvalidNamedSetException.java b/api/src/org/labkey/api/query/InvalidNamedSetException.java deleted file mode 100644 index 79e56d41e28..00000000000 --- a/api/src/org/labkey/api/query/InvalidNamedSetException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2014-2016 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.query; - -import org.labkey.api.util.ExpectedException; -import org.labkey.api.view.NotFoundException; - -/** - * Thrown if a requested named member set isn't found in the cache in QueryService. It either never existed, or has expired - * from the cache. As the cache miss due to expiration is considered normal operation, mmplements ExpectedException - * so we don't log to the console in API calls. - * User: tgaluhn - * Date: 7/15/2014 - */ -public class InvalidNamedSetException extends NotFoundException implements ExpectedException -{ - public InvalidNamedSetException(String string) - { - super(string); - } -} diff --git a/query/src/org/labkey/query/olap/QubeQuery.java b/query/src/org/labkey/query/olap/QubeQuery.java index e982d27eef8..a6a6e1a2b65 100644 --- a/query/src/org/labkey/query/olap/QubeQuery.java +++ b/query/src/org/labkey/query/olap/QubeQuery.java @@ -465,6 +465,11 @@ else if (membersObj instanceof JSONArray arr) } e.membersSet = set; } + else + { + errors.reject(SpringActionController.ERROR_MSG, "Could not parse members property"); + throw errors; + } } else if (null != json.opt("membersQuery")) {