英文:
Obtaining the user who originated the change event in Vaadin Collaboration Kit when subscribing to changes in a NamedMap within a Topic
问题
I am using Vaadin Collaboration Kit and have subscribed to changes in a NamedMap within a Topic in Vaadin Collaboration Engine. I would like to obtain the user who originated the change event when updates occur in the map.
Here is the code I am using to subscribe to changes in the NamedMap:
CollaborationEngine.getInstance().openTopicConnection(this, "topic",
localUser, topicConnection -> {
CollaborationMap formManagerCollaborationMap = topicConnection.getNamedMap("mapvalues");
formManagerCollaborationMap.subscribe(event -> {
// How can I obtain the user who originated the change event?
// I want to access the user who made the change in the map
// ...
});
return null;
}
);
How can I retrieve the user ID who originated the change event? Is there any specific method or property to access this information?
I have tried to use the event, but is of type MapChangeEvent which only has the attributes key:String, oldValue:JsonNode, value:JsonNode. I couldn't find the user information associated with the event.
Any help would be greatly appreciated. Thank you!
英文:
I am using Vaadin Collaboration Kit and have subscribed to changes in a NamedMap within a Topic in Vaadin Collaboration Engine. I would like to obtain the user who originated the change event when updates occur in the map.
Here is the code I am using to subscribe to changes in the NamedMap:
CollaborationEngine.getInstance().openTopicConnection(this, "topic",
localUser, topicConnection -> {
CollaborationMap formManagerCollaborationMap = topicConnection.getNamedMap("mapvalues");
formManagerCollaborationMap.subscribe(event -> {
// How can I obtain the user who originated the change event?
// I want to access the user who made the change in the map
// ...
});
return null;
}
);
How can I retrieve the user ID who originated the change event? Is there any specific method or property to access this information?
I have tried to use the event, but is of type MapChangeEvent which only has the attributes key:String, oldValue:JsonNode, value:JsonNode. I couldn't find the user information associated with the event
Any help would be greatly appreciated. Thank you!
答案1
得分: 2
Collaboration Kit 不追踪该信息。如果需要知道,可以将其嵌入存储在地图中的值中。
英文:
Collaboration Kit does not track that information. If you need to know it, then you can embed it in the value that you store in the map itself.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论