Skip to content
Open
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
38 changes: 0 additions & 38 deletions api/src/org/labkey/api/data/CompareType.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
5 changes: 0 additions & 5 deletions api/src/org/labkey/api/data/SimpleFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
34 changes: 0 additions & 34 deletions api/src/org/labkey/api/query/InvalidNamedSetException.java

This file was deleted.

6 changes: 0 additions & 6 deletions api/src/org/labkey/api/query/QueryService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -504,10 +502,6 @@ interface Hierarchy
*/
Collection<Hierarchy> getOlapHierarchies(String configId, Container c, String cubeName, String dimension);

void saveNamedSet(String setName, List<String> setList);
void deleteNamedSet(String setName);
List<String> 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.
Expand Down
13 changes: 0 additions & 13 deletions api/src/org/labkey/api/visualization/VisDataRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ public static class Measure
String alias;
Boolean inNotNullSet;
String name;
String nsvalues;
String queryName;
String axisName;
Boolean requireLeftJoin;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,6 @@ protected VisualizationSourceColumn(ViewContext context, VisDataRequest.Measure
{
_values.addAll(values);
}
String namedSetValue = measure.getNsvalues();
if (namedSetValue != null)
{
List<String> namedSet = QueryService.get().getNamedSet(namedSetValue);
_values.addAll(namedSet);
}
}

private static UserSchema getUserSchema(ViewContext context, String schemaName)
Expand Down
30 changes: 0 additions & 30 deletions query/src/org/labkey/query/QueryServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -271,9 +268,6 @@ public void moduleChanged(Module module)
}
};

private static final Cache<String, List<String>> 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<Class<? extends Controller>, Pair<Module, String>> _schemaLinkActions = new ConcurrentHashMap<>();
private QueryAnalysisService _queryAnalysisService;

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -2577,28 +2569,6 @@ public MultiValuedMap<Path, ModuleQueryMetadataDef> load(Stream<? extends Resour
}
}

@Override
public void saveNamedSet(String setName, List<String> 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<String> getNamedSet(String setName)
{
List<String> 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)
{
Expand Down
61 changes: 0 additions & 61 deletions query/src/org/labkey/query/controllers/QueryController.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -7564,64 +7563,6 @@ public void setSchemas(Map<String, List<Map<String, Object>>> schemas)
}
}


@RequiresPermission(ReadPermission.class)
public static class SaveNamedSetAction extends MutatingApiAction<NamedSetForm>
{
@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<String> parseSetList()
{
return Arrays.asList(setList);
}
}


@RequiresPermission(ReadPermission.class)
public static class DeleteNamedSetAction extends MutatingApiAction<NamedSetForm>
{

@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<Object>
{
Expand Down Expand Up @@ -8414,8 +8355,6 @@ controller.new ImportAction(),
new AuditHistoryAction(),
new AuditDetailsAction(),
new ExportTablesAction(),
new SaveNamedSetAction(),
new DeleteNamedSetAction(),
new ApiTestAction(),
new GetDefaultVisibleColumnsAction()
);
Expand Down
28 changes: 0 additions & 28 deletions query/src/org/labkey/query/olap/QubeQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -466,33 +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<String> namedSet = QueryService.get().getNamedSet(setName.toString());
TreeSet<Member> 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");
Expand Down
Loading