fixed npe
This commit is contained in:
parent
99bae13b31
commit
737df27c41
|
@ -26,4 +26,5 @@ spark-warehouse
|
|||
/**/*.log
|
||||
.svn
|
||||
/**/.svn
|
||||
|
||||
apps/dnet-orgs-database-application/data/
|
||||
apps/dnet-orgs-database-application/src/main/resources/tmp_data
|
||||
|
|
|
@ -99,25 +99,25 @@ public class SubscriptionEventMatcher implements Runnable {
|
|||
|
||||
final BoolQueryBuilder mapQuery = QueryBuilders.boolQuery();
|
||||
s.getConditionsAsList()
|
||||
.stream()
|
||||
.map(MapCondition::asQueryBuilder)
|
||||
.filter(Objects::nonNull)
|
||||
.forEach(mapQuery::must);
|
||||
.stream()
|
||||
.map(MapCondition::asQueryBuilder)
|
||||
.filter(Objects::nonNull)
|
||||
.forEach(mapQuery::must);
|
||||
|
||||
final NativeSearchQuery searchQuery = new NativeSearchQueryBuilder()
|
||||
.withQuery(QueryBuilders.boolQuery()
|
||||
.must(QueryBuilders.matchQuery("topic", s.getTopic()))
|
||||
.must(QueryBuilders.rangeQuery("creationDate").from(s.getLastNotificationDate().getTime()))
|
||||
.must(QueryBuilders.nestedQuery("map", mapQuery, ScoreMode.None)))
|
||||
.withSearchType(SearchType.DEFAULT)
|
||||
// .withIndices(elasticSearchProperties.getEventsIndexName())
|
||||
// .withTypes(elasticSearchProperties.getEventsIndexType())
|
||||
.withPageable(PageRequest.of(0, 10))
|
||||
.build();
|
||||
.withQuery(QueryBuilders.boolQuery()
|
||||
.must(QueryBuilders.matchQuery("topic", s.getTopic()))
|
||||
.must(QueryBuilders.rangeQuery("creationDate").from(s.getLastNotificationDate() != null ? s.getLastNotificationDate().getTime() : 0))
|
||||
.must(QueryBuilders.nestedQuery("map", mapQuery, ScoreMode.None)))
|
||||
.withSearchType(SearchType.DEFAULT)
|
||||
// .withIndices(elasticSearchProperties.getEventsIndexName())
|
||||
// .withTypes(elasticSearchProperties.getEventsIndexType())
|
||||
.withPageable(PageRequest.of(0, 10))
|
||||
.build();
|
||||
|
||||
final List<Event> events = new ArrayList<>();
|
||||
final CloseableIterator<SearchHit<Event>> it =
|
||||
esOperations.searchForStream(searchQuery, Event.class, IndexCoordinates.of(elasticSearchProperties.getEventsIndexName()));
|
||||
esOperations.searchForStream(searchQuery, Event.class, IndexCoordinates.of(elasticSearchProperties.getEventsIndexName()));
|
||||
while (it.hasNext()) {
|
||||
final Event e = it.next().getContent();
|
||||
final Notification n = new Notification(s, e);
|
||||
|
|
|
@ -348,6 +348,28 @@ openaireBrokerControllers.controller('notificationsCtrl', function ($scope, $htt
|
|||
$location.path('/ntf/' + n + "/" + $scope.subscrId);
|
||||
}
|
||||
|
||||
$scope.isAuthorHighlighted = function(author, list) {
|
||||
if (list) {
|
||||
for (var i=0; i<list.length; i++) {
|
||||
if (author.fullname + author.orcid == list[i].fullname + list[i].orcid) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
$scope.isSubjectHighlighted = function(subject, list) {
|
||||
if (list) {
|
||||
for (var i=0; i<list.length; i++) {
|
||||
if (subject.value == list[i].value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
$scope.isInstanceHighlighted = function(instance, list) {
|
||||
if (list) {
|
||||
for (var i=0; i<list.length; i++) {
|
||||
|
@ -359,6 +381,17 @@ openaireBrokerControllers.controller('notificationsCtrl', function ($scope, $htt
|
|||
return false;
|
||||
}
|
||||
|
||||
$scope.isProjectHighlighted= function(project, list) {
|
||||
if (list) {
|
||||
for (var i=0; i<list.length; i++) {
|
||||
if (project.openaireId == list[i].openaireId) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
$scope.isPidHighlighted = function(pid, list) {
|
||||
if (list) {
|
||||
for (var i=0; i<list.length; i++) {
|
||||
|
@ -370,5 +403,39 @@ openaireBrokerControllers.controller('notificationsCtrl', function ($scope, $htt
|
|||
return false;
|
||||
}
|
||||
|
||||
$scope.isDatasetHighlighted= function(dataset, list) {
|
||||
if (list) {
|
||||
for (var i=0; i<list.length; i++) {
|
||||
if (dataset.openaireId == list[i].openaireId) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
$scope.isSoftwareHighlighted= function(sw, list) {
|
||||
if (list) {
|
||||
for (var i=0; i<list.length; i++) {
|
||||
if (sw.openaireId == list[i].openaireId) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$scope.isRelatedPublicationHighlighted= function(pub, list) {
|
||||
if (list) {
|
||||
for (var i=0; i<list.length; i++) {
|
||||
if (pub.openaireId == list[i].openaireId) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
$scope.refresh();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue