Skip to content

Commit

Permalink
Add callback to pre-process results
Browse files Browse the repository at this point in the history
This callback allows the results being exported to be processed by
another extension, etc. before the export occurs. This could be used to
divert results to a queuing system instead, to filter sensitive data out
of a result set, etc.
  • Loading branch information
Jason Crome committed Aug 8, 2024
1 parent e30335f commit 19899e7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions html/Search/Results.xlsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,13 @@ if ( $Class eq 'RT::Assets' && !$Format ) {
$Format .= "'__CF.{$_}__/TITLE:$_', " for map {$_ = $_->Name; s/['\\]/\\$1/g; $_} @{$CFs->ItemsArrayRef};
}

$m->callback(
CallbackName => 'BeforeExport',
ARGSRef => \%ARGS,
Collection => $collection,
Format => $Format,
PreserveNewLines => $PreserveNewLines,
%ARGS,
);
$m->comp( "/Elements/XLSXExport", Collection => $collection, Format => $Format, PreserveNewLines => $PreserveNewLines );
</%INIT>

0 comments on commit 19899e7

Please sign in to comment.