8 namespace Fossology\UI\Page;
12 use Symfony\Component\HttpFoundation\Request;
13 use Symfony\Component\HttpFoundation\Response;
17 const NAME =
"admin_all_license_to_json";
19 function __construct()
21 parent::__construct(self::NAME, array(
22 self::TITLE =>
"Admin All Groups License JSON Export",
23 self::MENU_LIST =>
"Admin::License Admin::JSON Export All",
24 self::REQUIRES_LOGIN =>
true,
33 protected function handle(Request $request)
35 $licenseCsvExport = new \Fossology\Lib\Application\LicenseCsvExport($this->
getObject(
'db.manager'));
36 $content = $licenseCsvExport->createCsv(intval($request->get(
'rf')),
true,
true);
37 $fileName =
"fossology-license-export-".date(
"YMj-Gis");
39 'Content-type' =>
'text/json, charset=UTF-8',
40 'Content-Disposition' =>
'attachment; filename='.$fileName.
'.json',
41 'Pragma' =>
'no-cache',
42 'Cache-Control' =>
'no-cache, must-revalidate, maxage=1, post-check=0, pre-check=0',
43 'Expires' =>
'Expires: Thu, 19 Nov 1981 08:52:00 GMT');
45 return new Response($content, Response::HTTP_OK, $headers);
49 register_plugin(
new AdminAllLicenseToJSON());
Contains the constants and helpers for authentication of user.