Skip to content

Commit e4e9983

Browse files
committed
[bugfix] Make sure to reload the collection after removing a resource
Closes eXist-db/exist#5711
1 parent 3037281 commit e4e9983

File tree

3 files changed

+35
-4
lines changed

3 files changed

+35
-4
lines changed

exist-core/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,7 @@
799799
<include>src/main/java/org/exist/client/DocumentView.java</include>
800800
<include>src/main/java/org/exist/client/IndexDialog.java</include>
801801
<include>src/main/java/org/exist/client/InteractiveClient.java</include>
802+
<include>src/main/java/org/exist/client/NewResourceDialog.java</include>
802803
<include>src/main/java/org/exist/client/QueryDialog.java</include>
803804
<include>src/main/java/org/exist/client/TriggersDialog.java</include>
804805
<include>src/main/java/org/exist/client/UploadDialog.java</include>
@@ -1006,6 +1007,7 @@
10061007
<exclude>src/main/java/org/exist/client/DocumentView.java</exclude>
10071008
<exclude>src/main/java/org/exist/client/IndexDialog.java</exclude>
10081009
<exclude>src/main/java/org/exist/client/InteractiveClient.java</exclude>
1010+
<exclude>src/main/java/org/exist/client/NewResourceDialog.java</exclude>
10091011
<exclude>src/main/java/org/exist/client/QueryDialog.java</exclude>
10101012
<exclude>src/main/java/org/exist/client/TriggersDialog.java</exclude>
10111013
<exclude>src/main/java/org/exist/client/UploadDialog.java</exclude>

exist-core/src/main/java/org/exist/client/ClientFrame.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,6 +768,13 @@ private void removeAction(final ActionEvent ev) {
768768
}
769769
}
770770

771+
try {
772+
removeRootCollection.close();
773+
client.reloadCollection();
774+
} catch (final XMLDBException e) {
775+
showErrorMessage(e.getMessage(), e);
776+
}
777+
771778
ClientAction.call(client::getResources, e -> showErrorMessage(e.getMessage(), e));
772779
};
773780
client.newClientThread("remove", removeTask).start();

exist-core/src/main/java/org/exist/client/NewResourceDialog.java

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
11
/*
2+
* Elemental
3+
* Copyright (C) 2024, Evolved Binary Ltd
4+
*
5+
6+
* https://www.evolvedbinary.com | https://www.elemental.xyz
7+
*
8+
* This library is free software; you can redistribute it and/or
9+
* modify it under the terms of the GNU Lesser General Public
10+
* License as published by the Free Software Foundation; version 2.1.
11+
*
12+
* This library is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
* Lesser General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Lesser General Public
18+
* License along with this library; if not, write to the Free Software
19+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20+
*
21+
* NOTE: Parts of this file contain code from 'The eXist-db Authors'.
22+
* The original license header is included below.
23+
*
24+
* =====================================================================
25+
*
226
* eXist-db Open Source Native XML Database
327
* Copyright (C) 2001 The eXist-db Authors
428
*
@@ -45,6 +69,8 @@
4569
import org.xmldb.api.modules.BinaryResource;
4670
import org.xmldb.api.modules.XMLResource;
4771

72+
import static org.exist.util.StringUtil.isNullOrEmpty;
73+
4874
/**
4975
*
5076
* @author <a href="mailto:[email protected]">Adam Retter</a>
@@ -297,8 +323,4 @@ private void createResource(final ResourceType resourceType, final String filena
297323
ClientFrame.showErrorMessage(xmldbe.getMessage(), xmldbe);
298324
}
299325
}
300-
301-
private boolean isNullOrEmpty(String str) {
302-
return str == null || str.isEmpty();
303-
}
304326
}

0 commit comments

Comments
 (0)