mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
[CST-7756] If no crosswalk is defined for the Item's entity type, default generic Item one is applied
This commit is contained in:
@@ -16,8 +16,8 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.content.Item;
|
||||
@@ -74,9 +74,10 @@ public class ContentGenerator implements SubscriptionGenerator<IndexableObject>
|
||||
for (IndexableObject indexableObject : indexableObjects) {
|
||||
out.write("\n".getBytes(UTF_8));
|
||||
Item item = (Item) indexableObject.getIndexedObject();
|
||||
String entityType = StringUtils.defaultIfBlank(itemService.getEntityTypeLabel(item),
|
||||
"Item");
|
||||
entityType2Disseminator.get(entityType).disseminate(context, item, out);
|
||||
String entityType = itemService.getEntityTypeLabel(item);
|
||||
Optional.ofNullable(entityType2Disseminator.get(entityType))
|
||||
.orElseGet(() -> entityType2Disseminator.get("Item"))
|
||||
.disseminate(context, item, out);
|
||||
}
|
||||
return out.toString();
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user