use of org.xwiki.watchlist.internal.api.WatchListEvent in project xwiki-platform by xwiki.
the class ActivityEventWatchListEventConverter method convert.
@Override
public WatchListEvent convert(ActivityEvent from, Object... parameters) {
DocumentReference documentReference = new DocumentReference(resolver.resolve(from.getPage(), EntityType.DOCUMENT, new WikiReference(from.getWiki())));
String type = from.getType();
DocumentReference userReference = null;
// Watch out for unregistered user events since they have a null user.
if (from.getUser() != null) {
userReference = new DocumentReference(resolver.resolve(from.getUser(), EntityType.DOCUMENT, new WikiReference(from.getWiki())));
}
return new WatchListEvent(documentReference, type, userReference, from.getVersion(), from.getDate());
}
Aggregations