mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 18:14:26 +00:00
Fix #11074 export simple archive format with no collection
(cherry picked from commit d282f92427
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
bc5df89155
commit
0e55e70f16
@@ -364,12 +364,14 @@ public class ItemExportServiceImpl implements ItemExportService {
|
||||
File outFile = new File(destDir, "collections");
|
||||
if (outFile.createNewFile()) {
|
||||
try (PrintWriter out = new PrintWriter(new FileWriter(outFile))) {
|
||||
String ownerHandle = item.getOwningCollection().getHandle();
|
||||
out.println(ownerHandle);
|
||||
Collection owningCollection = item.getOwningCollection();
|
||||
// The owning collection is null for workspace and workflow items
|
||||
if (owningCollection != null) {
|
||||
out.println(owningCollection.getHandle());
|
||||
}
|
||||
for (Collection collection : item.getCollections()) {
|
||||
String collectionHandle = collection.getHandle();
|
||||
if (!collectionHandle.equals(ownerHandle)) {
|
||||
out.println(collectionHandle);
|
||||
if (!collection.equals(owningCollection)) {
|
||||
out.println(collection.getHandle());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user