chg: [event restsearch] exposed includeGranularCorrelations

- and also made it visible in the JSON output
feature/workflow-module/publish-event
iglocska 2023-10-05 17:05:22 +02:00
parent b6386674c4
commit a3c728674f
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
3 changed files with 23 additions and 1 deletions

View File

@ -119,7 +119,8 @@ class RestSearchComponent extends Component
'noEventReports',
'noShadowAttributes',
'order',
'protected'
'protected',
'includeGranularCorrelations'
],
'Object' => [
'returnFormat',

View File

@ -79,11 +79,31 @@ class JSONConverterTool
}
if (isset($event['Event']['Attribute'])) {
$event['Event']['Attribute'] = self::__cleanAttributes($event['Event']['Attribute'], $tempSightings);
if (!empty($event['Event']['RelatedAttribute'])) {
foreach ($event['Event']['Attribute'] as $k => $attribute) {
if (isset($event['Event']['RelatedAttribute'][$attribute['id']])) {
foreach($event['Event']['RelatedAttribute'][$attribute['id']] as $correlation) {
$event['Event']['Attribute'][$k]['RelatedAttribute'][] = [
'id' => $correlation['attribute_id'],
'value' => $correlation['value'],
'org_id' => $correlation['org_id'],
'info' => $correlation['info'],
'event_id' => $correlation['id']
];
}
}
}
}
}
if (isset($event['Event']['Object'])) {
$event['Event']['Object'] = self::__cleanObjects($event['Event']['Object'], $tempSightings);
}
unset($tempSightings);
if (!empty($event['Event']['RelatedAttribute'])) {
foreach ($event['Event']['RelatedAttribute'] as $attribute_id => $relatedAttribute) {
}
}
unset($event['Event']['RelatedAttribute']);
// Remove information about user_id from JSON export

View File

@ -178,6 +178,7 @@ class Event extends AppModel
'includeFeedCorrelations',
'includeServerCorrelations',
'includeWarninglistHits',
'includeGranularCorrelations',
'noEventReports', // do not include event report in event data
'noShadowAttributes', // do not fetch proposals,
'limit',