File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed
audit/src/org/labkey/audit Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change 21
21
import org .labkey .api .audit .provider .SiteSettingsAuditProvider ;
22
22
import org .labkey .api .module .DefaultModule ;
23
23
import org .labkey .api .module .ModuleContext ;
24
+ import org .labkey .api .settings .OptionalFeatureFlag ;
25
+ import org .labkey .api .settings .OptionalFeatureService ;
24
26
import org .labkey .api .view .WebPartFactory ;
25
27
import org .labkey .audit .query .AuditQuerySchema ;
26
28
30
32
31
33
public class AuditModule extends DefaultModule
32
34
{
35
+ public static final String LEGACY_UNION_AUDIT_TABLE = "legacyUnionAuditTable" ;
36
+
33
37
@ Override
34
38
@ NotNull
35
39
protected Collection <WebPartFactory > createWebPartFactories ()
@@ -75,6 +79,14 @@ public void doStartup(ModuleContext moduleContext)
75
79
AuditLogService .get ().registerAuditType (new SiteSettingsAuditProvider ());
76
80
77
81
AuditController .registerAdminConsoleLinks ();
82
+ OptionalFeatureService .get ().addFeatureFlag (new OptionalFeatureFlag (
83
+ LEGACY_UNION_AUDIT_TABLE ,
84
+ "Restore legacy union audit table" ,
85
+ "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." ,
86
+ false ,
87
+ false ,
88
+ OptionalFeatureService .FeatureType .Deprecated
89
+ ));
78
90
}
79
91
80
92
@ Override
Original file line number Diff line number Diff line change 29
29
import org .labkey .api .query .QueryView ;
30
30
import org .labkey .api .query .UserSchema ;
31
31
import org .labkey .api .security .User ;
32
+ import org .labkey .api .settings .OptionalFeatureService ;
32
33
import org .labkey .api .view .ViewContext ;
33
34
import org .labkey .audit .AuditSchema ;
34
35
import org .springframework .validation .BindException ;
37
38
import java .util .LinkedHashSet ;
38
39
import java .util .Set ;
39
40
40
- /**
41
- * User: Karl Lum
42
- * Date: Oct 5, 2007
43
- */
41
+ import static org .labkey .audit .AuditModule .LEGACY_UNION_AUDIT_TABLE ;
42
+
44
43
public class AuditQuerySchema extends UserSchema
45
44
{
46
45
public static final String SCHEMA_NAME = "auditLog" ;
@@ -86,12 +85,12 @@ public Set<String> getTableNames()
86
85
@ Override
87
86
public TableInfo createTable (String name , ContainerFilter cf )
88
87
{
89
- // event specific audit views are implemented as queries on the audit schema
88
+ // event- specific audit views are implemented as queries on the audit schema
90
89
AuditTypeProvider provider = AuditLogService .get ().getAuditProvider (name );
91
90
if (provider != null )
92
91
return provider .createTableInfo (this , cf );
93
92
94
- if (AUDIT_TABLE_NAME .equalsIgnoreCase (name ))
93
+ if (OptionalFeatureService . get (). isFeatureEnabled ( LEGACY_UNION_AUDIT_TABLE ) && AUDIT_TABLE_NAME .equalsIgnoreCase (name ))
95
94
return new AuditLogUnionTable (this , cf );
96
95
97
96
return null ;
You can’t perform that action at this time.
0 commit comments