Commit 1c21e92a authored by Jörg Richter's avatar Jörg Richter

Core fix: fire PRE_SEND_TOPIC for QueryResult (#386)

parent 58d10370
Pipeline #10563 passed with stages
in 9 minutes and 6 seconds
......@@ -4,6 +4,7 @@ import systems.dmx.core.Assoc;
import systems.dmx.core.AssocType;
import systems.dmx.core.DMXObject;
import systems.dmx.core.ChildTopics;
import systems.dmx.core.QueryResult;
import systems.dmx.core.RelatedTopic;
import systems.dmx.core.Topic;
import systems.dmx.core.TopicType;
......@@ -91,6 +92,8 @@ class JerseyResponseFilter implements ContainerResponseFilter {
firePreSend((DMXObject) entity);
} else if (isIterable(response, DMXObject.class)) {
firePreSend((Iterable<DMXObject>) entity);
} else if (entity instanceof QueryResult) {
firePreSend(((QueryResult) entity).topics);
} else if (entity instanceof DirectivesResponse) {
firePreSend(((DirectivesResponse) entity).getObject());
//
......@@ -176,7 +179,7 @@ class JerseyResponseFilter implements ContainerResponseFilter {
}
}
private void firePreSend(Iterable<DMXObject> objects) {
private void firePreSend(Iterable<? extends DMXObject> objects) {
for (DMXObject object : objects) {
firePreSend(object);
}
......
......@@ -111,7 +111,7 @@ public class TopicmapsPlugin extends PluginActivator implements TopicmapsService
logger.info("Fetching topicmap " + topicmapId + ", includeChildren=" + includeChildren);
// Note: a Topicmap is not a DMXObject. So the JerseyResponseFilter's automatic
// child topic loading is not applied. We must load the child topics manually here.
Topic topicmapTopic = dmx.getTopic(topicmapId).loadChildTopics();
Topic topicmapTopic = dmx.getTopic(topicmapId);
return new Topicmap(
topicmapTopic.getModel(),
fetchTopicmapViewProps(topicmapTopic),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment