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
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.labkey.elispot.query;

import org.jetbrains.annotations.NotNull;
import org.labkey.api.assay.AssayDomainKind;
import org.labkey.api.data.DbScope;
import org.labkey.api.data.JdbcType;
Expand Down Expand Up @@ -87,7 +88,7 @@ public String getStorageSchemaName()
}

@Override
public Set<String> getReservedPropertyNames(Domain domain, User user)
public @NotNull Set<String> getReservedPropertyNames(Domain domain, User user)
{
return getAssayReservedPropertyNames();
}
Expand Down
42 changes: 22 additions & 20 deletions luminex/src/org/labkey/luminex/LuminexAnalyteDomainKind.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@
*/
package org.labkey.luminex;

import org.jetbrains.annotations.NotNull;
import org.labkey.api.assay.AssayDomainKind;
import org.labkey.api.collections.CaseInsensitiveHashSet;
import org.labkey.api.exp.property.Domain;
import org.labkey.api.exp.property.DomainUtil;
import org.labkey.api.security.User;

import java.util.List;
import java.util.Set;

/**
Expand All @@ -27,6 +31,22 @@
*/
public class LuminexAnalyteDomainKind extends AssayDomainKind
{
private static final Set<String> RESERVED_NAMES;
static {
RESERVED_NAMES = DomainUtil.getNamesAndLabels(
List.of("Name",
"FitProb",
"RegressionType",
"ResVar",
"StdCurve",
"MinStandardRecovery",
"MaxStandardRecovery",
LuminexDataHandler.POSITIVITY_THRESHOLD_COLUMN_NAME,
LuminexDataHandler.NEGATIVE_BEAD_COLUMN_NAME
)
);
RESERVED_NAMES.addAll(getAssayReservedPropertyNames());
}
public LuminexAnalyteDomainKind()
{
super(LuminexAssayProvider.ASSAY_DOMAIN_ANALYTE);
Expand All @@ -39,27 +59,9 @@ public String getKindName()
}

@Override
public Set<String> getReservedPropertyNames(Domain domain, User user)
public @NotNull Set<String> getReservedPropertyNames(Domain domain, User user)
{
Set<String> result = getAssayReservedPropertyNames();
result.add("Name");
result.add("FitProb");
result.add("Fit Prob");
result.add("RegressionType");
result.add("Regression Type");
result.add("ResVar");
result.add("Res Var");
result.add("StdCurve");
result.add("Std Curve");
result.add("MinStandardRecovery");
result.add("Min Standard Recovery");
result.add("MaxStandardRecovery");
result.add("Max Standard Recovery");
result.add(LuminexDataHandler.POSITIVITY_THRESHOLD_COLUMN_NAME);
result.add(LuminexDataHandler.POSITIVITY_THRESHOLD_DISPLAY_NAME);
result.add(LuminexDataHandler.NEGATIVE_BEAD_COLUMN_NAME);
result.add(LuminexDataHandler.NEGATIVE_BEAD_DISPLAY_NAME);
return result;
return RESERVED_NAMES;
}

@Override
Expand Down
36 changes: 22 additions & 14 deletions luminex/src/org/labkey/luminex/LuminexDataDomainKind.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@
*/
package org.labkey.luminex;

import org.jetbrains.annotations.NotNull;
import org.labkey.api.assay.AssayDomainKind;
import org.labkey.api.collections.CaseInsensitiveHashSet;
import org.labkey.api.exp.property.Domain;
import org.labkey.api.exp.property.DomainUtil;
import org.labkey.api.security.User;
import org.labkey.luminex.query.LuminexDataTable;
import org.labkey.luminex.query.LuminexProtocolSchema;

import java.util.HashSet;
import java.util.Map;
import java.util.Set;

Expand All @@ -30,6 +34,22 @@
*/
public class LuminexDataDomainKind extends AssayDomainKind
{
public static final Set<String> RESERVED_NAMES;

static {
// Standard reserved names
Set<String> names = new HashSet<>(getAssayReservedPropertyNames());
// All from the basic Luminex data table
names.addAll(LuminexProtocolSchema.getTableInfoDataRow().getColumnNameSet());
// Also reserve the aliased names of the columns
for (Map.Entry<String,String> entry : LuminexDataTable.REMAPPED_SCHEMA_COLUMNS.entrySet())
{
names.add(entry.getKey());
names.add(entry.getValue());
}

RESERVED_NAMES = DomainUtil.getNamesAndLabels(names);
}
public LuminexDataDomainKind()
{
super(LuminexAssayProvider.ASSAY_DOMAIN_CUSTOM_DATA);
Expand All @@ -42,20 +62,8 @@ public String getKindName()
}

@Override
public Set<String> getReservedPropertyNames(Domain domain, User user)
public @NotNull Set<String> getReservedPropertyNames(Domain domain, User user)
{
// Standard reserved names
Set<String> result = getAssayReservedPropertyNames();

// All from the basic Luminex data table
result.addAll(LuminexProtocolSchema.getTableInfoDataRow().getColumnNameSet());

// Also reserve the aliased names of the columns
for (Map.Entry<String,String> entry : LuminexDataTable.REMAPPED_SCHEMA_COLUMNS.entrySet())
{
result.add(entry.getKey());
result.add(entry.getValue());
}
return result;
return RESERVED_NAMES;
}
}
16 changes: 9 additions & 7 deletions nab/src/org/labkey/nab/query/NabVirusDomainKind.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,29 @@
*/
package org.labkey.nab.query;

import org.jetbrains.annotations.NotNull;
import org.labkey.api.assay.AssayDomainKind;
import org.labkey.api.collections.CaseInsensitiveHashSet;
import org.labkey.api.data.DbScope;
import org.labkey.api.data.JdbcType;
import org.labkey.api.data.PropertyStorageSpec;
import org.labkey.api.exp.property.Domain;
import org.labkey.api.exp.property.DomainUtil;
import org.labkey.api.security.User;
import org.labkey.nab.NabAssayProvider;
import org.labkey.nab.NabManager;

import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.stream.Collectors;

public class NabVirusDomainKind extends AssayDomainKind
{
public static final String VIRUS_LSID_COLUMN_NAME = "virusLsid";
public static final String DATLSID_COLUMN_NAME = "dataLsid";
private static final Set<PropertyStorageSpec> _baseFields;
private static final Set<String> RESERVED_PROPERTY_NAMES;

static
{
Expand All @@ -42,6 +47,8 @@ public class NabVirusDomainKind extends AssayDomainKind
baseFields.add(new PropertyStorageSpec(DATLSID_COLUMN_NAME, JdbcType.VARCHAR));

_baseFields = Collections.unmodifiableSet(baseFields);
RESERVED_PROPERTY_NAMES = DomainUtil.getNamesAndLabels(_baseFields.stream().map(PropertyStorageSpec::getName).collect(Collectors.toSet()));
RESERVED_PROPERTY_NAMES.addAll(getAssayReservedPropertyNames());
}

public NabVirusDomainKind()
Expand Down Expand Up @@ -74,13 +81,8 @@ public String getStorageSchemaName()
}

@Override
public Set<String> getReservedPropertyNames(Domain domain, User user)
public @NotNull Set<String> getReservedPropertyNames(Domain domain, User user)
{
Set<String> names = getAssayReservedPropertyNames();

for (PropertyStorageSpec spec : getBaseProperties(domain))
names.add(spec.getName());

return names;
return RESERVED_PROPERTY_NAMES;
}
}