8 namespace Fossology\UI\Page;
16 use Symfony\Component\HttpFoundation\Request;
17 use Symfony\Component\HttpFoundation\Response;
21 const NAME =
"admin_license_to_yaml";
23 function __construct()
25 parent::__construct(self::NAME, array(
26 self::TITLE =>
"Admin License Rules Export",
27 self::MENU_LIST =>
"Admin::License Admin::Rules Export",
28 self::REQUIRES_LOGIN =>
true,
37 protected function handle(Request $request)
39 $confirmed = $request->get(
'confirmed',
false);
40 $referer = $request->headers->get(
'referer');
41 $fileName =
"fossology-license-comp-rules-export-" . date(
"YMj-Gis") .
'.yaml';
44 $downloadUrl =
"?mod=" . self::NAME .
"&confirmed=true";
49 $dbManager = $this->
getObject(
'db.manager');
51 $compatibilityDao = $this->
getObject(
'dao.compatibility');
54 $content = $licenseYamlExport->createYaml(0);
Helper class to export license list as a YAML from the DB.
Contains the constants and helpers for authentication of user.
static getDownloadConfirmationResponse($downloadUrl, $fileName, $referer)
static getDownloadResponse($content, $fileName, $contentType='text/csv')