-
Notifications
You must be signed in to change notification settings - Fork 7
Issue 695: Add feature to allow unreferenced files to be deleted from apps #7320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release25.11-SNAPSHOT
Are you sure you want to change the base?
Changes from all commits
9034063
a2ffc20
f51bd73
7350ecc
9031881
dbc018d
e103580
8d84c5c
82c8247
6bec4b5
bdb8893
62ac8de
2a78a9d
4b7da07
347f319
5cfc64b
8d908c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package org.labkey.api.exp.query; | ||
|
|
||
| import org.labkey.api.data.ContainerFilterable; | ||
| import org.labkey.api.data.TableInfo; | ||
|
|
||
| public interface ExpUnreferencedSampleFilesTable extends ContainerFilterable, TableInfo | ||
| { | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,12 +34,14 @@ | |
| import org.labkey.api.data.Container; | ||
| import org.labkey.api.data.ContainerFilter; | ||
| import org.labkey.api.data.ContainerManager; | ||
| import org.labkey.api.data.CoreSchema; | ||
| import org.labkey.api.data.ExcelWriter; | ||
| import org.labkey.api.data.JdbcType; | ||
| import org.labkey.api.data.MutableColumnInfo; | ||
| import org.labkey.api.data.RenderContext; | ||
| import org.labkey.api.data.SQLFragment; | ||
| import org.labkey.api.data.SimpleFilter; | ||
| import org.labkey.api.data.SqlSelector; | ||
| import org.labkey.api.exp.DomainDescriptor; | ||
| import org.labkey.api.exp.OntologyManager; | ||
| import org.labkey.api.exp.PropertyColumn; | ||
|
|
@@ -75,6 +77,7 @@ | |
| import org.labkey.api.security.User; | ||
| import org.labkey.api.security.permissions.InsertPermission; | ||
| import org.labkey.api.security.permissions.UpdatePermission; | ||
| import org.labkey.api.settings.AppProps; | ||
| import org.labkey.api.util.ConfigurationException; | ||
| import org.labkey.api.util.FileUtil; | ||
| import org.labkey.api.util.HtmlString; | ||
|
|
@@ -84,6 +87,7 @@ | |
| import org.labkey.api.writer.HtmlWriter; | ||
| import org.labkey.api.writer.MemoryVirtualFile; | ||
| import org.labkey.api.writer.VirtualFile; | ||
| import org.labkey.experiment.FileLinkFileListener; | ||
| import org.labkey.experiment.controllers.exp.ExperimentController; | ||
| import org.labkey.experiment.lineage.LineageMethod; | ||
| import org.springframework.beans.MutablePropertyValues; | ||
|
|
@@ -200,6 +204,8 @@ public List<String> addFileColumns(boolean isFilesTable) | |
| addColumn(Column.FileExtension); | ||
| addColumn(Column.WebDavUrl); | ||
| addColumn(Column.WebDavUrlRelative); | ||
| if (AppProps.getInstance().isOptionalFeatureEnabled(ExpSchema.SAMPLE_FILES_TABLE)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| addColumn(getFileLinkReferenceCountColumn()); | ||
| var flagCol = addColumn(Column.Flag); | ||
| if (isFilesTable) | ||
| flagCol.setLabel("Description"); | ||
|
|
@@ -227,6 +233,18 @@ public List<String> addFileColumns(boolean isFilesTable) | |
| return customProps; | ||
| } | ||
|
|
||
| // This is included in exp.data, not just exp.files because we want to be able to show a filtered view of | ||
| // sample files from our applications, and exp.files will not show subfolders | ||
| private MutableColumnInfo getFileLinkReferenceCountColumn() | ||
| { | ||
| var result = wrapColumn(Column.ReferenceCount.name(), _rootTable.getColumn("RowId")); | ||
| result.setDescription("The number of references to this file from File fields in any domain."); | ||
| result.setJdbcType(JdbcType.INTEGER); | ||
| result.setHidden(true); | ||
| result.setDisplayColumnFactory(new ReferenceCountDisplayColumnFactory()); | ||
| return result; | ||
| } | ||
|
|
||
| @Override | ||
| public boolean supportTableRules() // intentional override | ||
| { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.