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
5 changes: 1 addition & 4 deletions api/src/org/labkey/api/audit/AbstractAuditTypeProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,7 @@ public List<FieldKey> getDefaultVisibleColumns()
@Override
public Map<FieldKey, String> legacyNameMap()
{
Map<FieldKey, String> legacyNames = new LinkedHashMap<>();
legacyNames.put(FieldKey.fromParts("ContainerId"), "Container");
legacyNames.put(FieldKey.fromParts("Date"), "Created");
return legacyNames;
return new LinkedHashMap<>();
}

public static Container getDomainContainer()
Expand Down
4 changes: 1 addition & 3 deletions api/src/org/labkey/api/audit/AuditTypeProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ public interface AuditTypeProvider

<K extends AuditTypeEvent> Class<K> getEventClass();

/**
* Mapping from old audit table names ("intKey1", "key1", and "Property/Foo" to the new column names.)
*/
@Deprecated // Not used anymore - remove
Map<FieldKey, String> legacyNameMap();

ActionURL getAuditUrl();
Expand Down
15 changes: 0 additions & 15 deletions api/src/org/labkey/api/audit/ClientApiAuditProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,6 @@ public String getDescription()
return "Information about audit events created through the client API.";
}

@Override
public Map<FieldKey, String> legacyNameMap()
{
Map<FieldKey, String> legacyNames = super.legacyNameMap();

// 'key1' mapped to 'subtype' and other 'keyN' are mapped to 'stringN-1'
legacyNames.put(FieldKey.fromParts("key1"), COLUMN_NAME_SUBTYPE);
legacyNames.put(FieldKey.fromParts("key2"), COLUMN_NAME_STRING1);
legacyNames.put(FieldKey.fromParts("key3"), COLUMN_NAME_STRING2);
legacyNames.put(FieldKey.fromParts("intKey1"), COLUMN_NAME_INT1);
legacyNames.put(FieldKey.fromParts("intKey2"), COLUMN_NAME_INT2);
legacyNames.put(FieldKey.fromParts("intKey3"), COLUMN_NAME_INT3);
return legacyNames;
}

@Override
public TableInfo createTableInfo(UserSchema userSchema, ContainerFilter cf)
{
Expand Down
10 changes: 0 additions & 10 deletions api/src/org/labkey/api/audit/provider/FileSystemAuditProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,6 @@ public String getDescription()
return "Displays information about file uploads and modifications.";
}

@Override
public Map<FieldKey, String> legacyNameMap()
{
Map<FieldKey, String> legacyNames = super.legacyNameMap();
legacyNames.put(FieldKey.fromParts("key1"), COLUMN_NAME_DIRECTORY);
legacyNames.put(FieldKey.fromParts("key2"), COLUMN_NAME_FILE);
legacyNames.put(FieldKey.fromParts("key3"), COLUMN_NAME_RESOURCE_PATH);
return legacyNames;
}

@Override
public <K extends AuditTypeEvent> Class<K> getEventClass()
{
Expand Down
10 changes: 0 additions & 10 deletions api/src/org/labkey/api/audit/provider/GroupAuditProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,6 @@ public GroupAuditProvider()
super(new GroupAuditDomainKind());
}

@Override
public Map<FieldKey, String> legacyNameMap()
{
Map<FieldKey, String> legacyNames = super.legacyNameMap();
legacyNames.put(FieldKey.fromParts("EntityId"), COLUMN_NAME_RESOURCE_ENTITY_ID);
legacyNames.put(FieldKey.fromParts("intKey1"), COLUMN_NAME_USER);
legacyNames.put(FieldKey.fromParts("intKey2"), COLUMN_NAME_GROUP);
return legacyNames;
}

@Override
public <K extends AuditTypeEvent> Class<K> getEventClass()
{
Expand Down
10 changes: 0 additions & 10 deletions api/src/org/labkey/api/audit/provider/MessageAuditProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,6 @@ public String getDescription()
return "Data about messages sent from the server.";
}

@Override
public Map<FieldKey, String> legacyNameMap()
{
Map<FieldKey, String> legacyNames = super.legacyNameMap();
legacyNames.put(FieldKey.fromParts("key1"), COLUMN_NAME_FROM);
legacyNames.put(FieldKey.fromParts("key2"), COLUMN_NAME_TO);
legacyNames.put(FieldKey.fromParts("key3"), COLUMN_NAME_CONTENT_TYPE);
return legacyNames;
}

@Override
public <K extends AuditTypeEvent> Class<K> getEventClass()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,6 @@ public Map<String, Object> getAuditLogMessageElements()
}
}

@Override
public Map<FieldKey, String> legacyNameMap()
{
Map<FieldKey, String> legacyNames = super.legacyNameMap();
legacyNames.put(FieldKey.fromParts("Property", AUDIT_PROP_DIFF), COLUMN_NAME_CHANGES);
return legacyNames;
}

public static class SiteSettingsAuditDomainKind extends AbstractAuditDomainKind
{
public static final String NAME = "SiteSettingsAuditDomain";
Expand Down
13 changes: 1 addition & 12 deletions api/src/org/labkey/api/audit/query/AbstractAuditDomainKind.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.junit.Test;
import org.labkey.api.audit.AbstractAuditTypeProvider;
import org.labkey.api.audit.AuditLogService;
import org.labkey.api.collections.CaseInsensitiveHashSet;
import org.labkey.api.collections.LabKeyCollectors;
import org.labkey.api.data.Container;
import org.labkey.api.data.ContainerManager;
Expand All @@ -49,7 +48,6 @@
import org.labkey.api.query.QueryService;
import org.labkey.api.query.ValidationException;
import org.labkey.api.security.User;
import org.labkey.api.settings.OptionalFeatureService;
import org.labkey.api.util.PageFlowUtil;
import org.labkey.api.view.ActionURL;
import org.labkey.api.view.NavTree;
Expand All @@ -66,8 +64,6 @@
import java.util.Set;
import java.util.stream.Collectors;

import static org.labkey.api.audit.query.DefaultAuditTypeTable.LEGACY_UNION_AUDIT_TABLE;

public abstract class AbstractAuditDomainKind extends DomainKind<JSONObject>
{
private static final String XAR_SUBSTITUTION_SCHEMA_NAME = "SchemaName";
Expand Down Expand Up @@ -398,14 +394,7 @@ public PropertyStorageSpec getPropertySpec(PropertyDescriptor pd, Domain domain)
@Override
public Set<String> getNonProvisionedTableNames()
{
// omit the legacy auditlog table, this can be removed once the
// table is dropped after migration
Set<String> tables = new CaseInsensitiveHashSet();

if (OptionalFeatureService.get().isFeatureEnabled(LEGACY_UNION_AUDIT_TABLE))
tables.add("auditlog");

return tables;
return Collections.emptySet();
}

@Nullable
Expand Down
27 changes: 4 additions & 23 deletions api/src/org/labkey/api/audit/query/DefaultAuditTypeTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import org.labkey.api.security.roles.CanSeeAuditLogRole;
import org.labkey.api.security.roles.Role;
import org.labkey.api.security.roles.RoleManager;
import org.labkey.api.settings.OptionalFeatureService;

import java.util.ArrayList;
import java.util.List;
Expand All @@ -51,10 +50,7 @@

public class DefaultAuditTypeTable extends FilteredTable<UserSchema>
{
public static final String LEGACY_UNION_AUDIT_TABLE = "legacyUnionAuditTable";

protected AuditTypeProvider _provider;
protected Map<FieldKey, String> _legacyNameMap;
protected Map<String, String> _dbSchemaToColumnMap;

public DefaultAuditTypeTable(AuditTypeProvider provider, TableInfo storage, UserSchema schema, ContainerFilter cf, List<FieldKey> defaultVisibleColumns)
Expand All @@ -67,17 +63,9 @@ public DefaultAuditTypeTable(AuditTypeProvider provider, TableInfo storage, User
if (_provider.getDescription() != null)
setDescription(_provider.getDescription());

_legacyNameMap = OptionalFeatureService.get().isFeatureEnabled(LEGACY_UNION_AUDIT_TABLE) ? provider.legacyNameMap() : Map.of();

// Create a mapping from the real dbTable names to the legacy query table names for QueryUpdateService.
_dbSchemaToColumnMap = new CaseInsensitiveHashMap<>();

for (FieldKey legacyName : _legacyNameMap.keySet())
{
String newName = _legacyNameMap.get(legacyName);
_dbSchemaToColumnMap.put(newName, legacyName.getName());
}

setTitle(provider.getEventName());

wrapAllColumns(true);
Expand Down Expand Up @@ -171,17 +159,10 @@ protected ColumnInfo resolveColumn(String name)

String newName = null;

if (_legacyNameMap.isEmpty())
{
// Backward compatibility with widely used legacy name
if ("Date".equalsIgnoreCase(name))
newName = "Created";
}
else
{
// Handle the old style 'intKey1' and 'key1' columns
newName = _legacyNameMap.get(FieldKey.fromParts(name));
}
// Backward compatibility with widely-used legacy name
if ("Date".equalsIgnoreCase(name))
newName = "Created";

col = super.resolveColumn(newName);
if (col != null)
{
Expand Down
9 changes: 0 additions & 9 deletions api/src/org/labkey/api/exp/property/DomainAuditProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,6 @@ public List<FieldKey> getDefaultVisibleColumns()
return defaultVisibleColumns;
}

@Override
public Map<FieldKey, String> legacyNameMap()
{
Map<FieldKey, String> legacyNames = super.legacyNameMap();
legacyNames.put(FieldKey.fromParts("key1"), COLUMN_NAME_DOMAIN_URI);
legacyNames.put(FieldKey.fromParts("key3"), COLUMN_NAME_DOMAIN_NAME);
return legacyNames;
}

@Override
public <K extends AuditTypeEvent> Class<K> getEventClass()
{
Expand Down
12 changes: 0 additions & 12 deletions audit/src/org/labkey/audit/AuditModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@
import org.jetbrains.annotations.NotNull;
import org.labkey.api.audit.AuditLogService;
import org.labkey.api.audit.provider.SiteSettingsAuditProvider;
import org.labkey.api.audit.query.DefaultAuditTypeTable;
import org.labkey.api.module.DefaultModule;
import org.labkey.api.module.ModuleContext;
import org.labkey.api.settings.OptionalFeatureFlag;
import org.labkey.api.settings.OptionalFeatureService;
import org.labkey.api.view.WebPartFactory;
import org.labkey.audit.query.AuditQuerySchema;

Expand Down Expand Up @@ -76,16 +73,7 @@ public void doStartup(ModuleContext moduleContext)
{
AuditQuerySchema.register(this);
AuditLogService.get().registerAuditType(new SiteSettingsAuditProvider());

AuditController.registerAdminConsoleLinks();
OptionalFeatureService.get().addFeatureFlag(new OptionalFeatureFlag(
DefaultAuditTypeTable.LEGACY_UNION_AUDIT_TABLE,
"Restore legacy union audit table",
"Restores a legacy query that unions all the event tables together into a single query. This option will be removed in LabKey Server v26.3.",
false,
false,
OptionalFeatureService.FeatureType.Deprecated
));
}

@Override
Expand Down
Loading