Skip to content

Conversation

@labkey-susanh
Copy link
Contributor

@labkey-susanh labkey-susanh commented Jan 12, 2026

Rationale

Issue 695 - We generally do not remove files from the @files directory, so these files remain in the search index indefinitely. This causes some potential problems for some clients when users can discover, say, old SOPs that have subsequently been replaced and thus might follow incorrect procedures. Here we add the ability to delete the files that had been associated with sample file fields but are no longer referenced from the application and update the exp.data table with a column that displays the reference counts for each exp.data file.

Related Pull Requests

Changes

  • Add experimental feature flag
  • Add UnreferencedSampleFiles virtual table
  • Add ReferenceCount column to exp.data table.

addColumn(Column.FileExtension);
addColumn(Column.WebDavUrl);
addColumn(Column.WebDavUrlRelative);
if (AppProps.getInstance().isOptionalFeatureEnabled(ExpSchema.SAMPLE_FILES_TABLE))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is file related, it could / should instead be added to ExpFilesTable instead. Even though exp.files doesn't support container filtering, since Exp.UnreferencedSampleFiles does return data.container field, this can be used as the correct request context to query UnreferencedSampleFiles at its own container.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we want to be able to link to a filtered set of files from the Unreferenced Sample Files page that should include the subfolder files, we're leaving this on the Data table. The Files table does not include subfolder files and does not have a column that can be filtered on to show only the sample files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants