Skip to content
Open
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
1 change: 1 addition & 0 deletions api/src/org/labkey/api/exp/list/ListService.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ static void setInstance(ListService ls)
boolean hasLists(Container container, boolean includeProjectAndShared);
ListDefinition createList(Container container, String name, ListDefinition.KeyType keyType);
ListDefinition createList(Container container, String name, ListDefinition.KeyType keyType, @Nullable TemplateInfo templateInfo, @Nullable ListDefinition.Category category);
void deleteLists(Container container, User user, @Nullable String auditUserComment);
@Nullable ListDefinition getList(Container container, int listId);
@Nullable ListDefinition getList(Container container, String name);
@Nullable ListDefinition getList(Container container, String name, boolean includeProjectAndShared);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5497,18 +5497,9 @@ public void deleteAllExpObjInContainer(Container c, User user) throws Experiment
{
deleteExperimentRunsByRowIds(c, user, runId);
}
ListService ls = ListService.get();
if (ls != null)
{
for (ListDefinition list : ListService.get().getLists(c, null, false).values())
{
// Temporary fix for Issue 21400: **Deleting workbook deletes lists defined in parent container
if (list.getContainer().equals(c))
{
list.delete(user);
}
}
}

// Delete lists (because for some reason lists are under the purview of experiment...)
ListService.get().deleteLists(c, user, null);

// Delete DataClasses and their exp.Data members
// Need to delete DataClass before SampleTypes since they may be referenced by the DataClass
Expand Down
30 changes: 1 addition & 29 deletions list/src/org/labkey/list/model/ListDefinitionImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -565,37 +565,9 @@ public void delete(User user) throws DomainNotFoundException
@Override
public void delete(User user, @Nullable String auditUserComment) throws DomainNotFoundException
{
TableInfo table = getTable(user);
QueryUpdateService qus = null;

if (null != table)
qus = table.getUpdateService();

// In certain cases we may create a list that is not viable (i.e., one in which a table was never created because
// the metadata wasn't valid). Still allow deleting the list
try (DbScope.Transaction transaction = (table != null) ? table.getSchema().getScope().ensureTransaction() :
ExperimentService.get().ensureTransaction())
{
// remove related full-text search docs and attachments
ListManager.get().deleteIndexedList(this);
if (qus instanceof ListQueryUpdateService listQus)
listQus.deleteRelatedListData(null);

// then delete the list itself
ListManager.get().deleteListDef(getContainer(), getListId());
Domain domain = getDomainOrThrow();
domain.delete(user, auditUserComment);

ListManager.get().addAuditEvent(this, user, String.format("The list %s was deleted", _def.getName()));

transaction.commit();
}

SchemaKey schemaPath = SchemaKey.fromParts(ListQuerySchema.NAME);
QueryService.get().fireQueryDeleted(user, getContainer(), null, schemaPath, Collections.singleton(getName()));
ListManager.get().deleteList(user, this, auditUserComment);
}


@Override
public int insertListItems(User user, Container container, List<ListItem> listItems)
{
Expand Down
Loading
Loading