FOSSology  4.5.0-rc1
Open Source License Compliance by Open Source Software
Fossology\UI\Page\AdminLicenseFromCSV Class Reference

Upload a file from the users computer using the UI. More...

Inheritance diagram for Fossology\UI\Page\AdminLicenseFromCSV:
Inheritance graph
Collaboration diagram for Fossology\UI\Page\AdminLicenseFromCSV:
Collaboration graph

Public Member Functions

 getFileInputName ($apiVersion=ApiVersion::V1)
 
 handleLicenseDbImport ()
 
 handleFileUpload ($uploadedFile, $delimiter=',', $enclosure='"')
 
 checkLicenseDBHealth ()
 
- Public Member Functions inherited from Fossology\Lib\Plugin\DefaultPlugin
 __construct ($name, $parameters=array())
 
 getName ()
 
 getVersion ()
 
 getTitle ()
 
 isRequiresLogin ()
 
 getDependency ()
 
 getPluginLevel ()
 
 getDBaccess ()
 
 getState ()
 
 getInitOrder ()
 
 getNoMenu ()
 
 getResponse ()
 
 getObject ($name)
 
 preInstall ()
 
 postInstall ()
 
 unInstall ()
 
 execute ()
 
 isLoggedIn ()
 
 __get ($name)
 
 __toString ()
 

Public Attributes

const NAME = "admin_license_from_csv"
 
const KEY_UPLOAD_MAX_FILESIZE = 'upload_max_filesize'
 
const FILE_INPUT_NAME = 'file_input'
 
const FILE_INPUT_NAME_V2 = 'fileInput'
 
- Public Attributes inherited from Fossology\Lib\Plugin\DefaultPlugin
const PERMISSION = "permission"
 
const REQUIRES_LOGIN = "requiresLogin"
 
const ENABLE_MENU = "ENABLE_MENU"
 
const LEVEL = "level"
 
const DEPENDENCIES = "dependencies"
 
const INIT_ORDER = "initOrder"
 
const MENU_LIST = "menuList"
 
const MENU_ORDER = "menuOrder"
 
const MENU_TARGET = "menuTarget"
 
const TITLE = "title"
 
 $fileLogger
 

Protected Member Functions

 handle (Request $request)
 
- Protected Member Functions inherited from Fossology\Lib\Plugin\DefaultPlugin
 RegisterMenus ()
 Customize submenus.
 
 render ($templateName, $vars=null, $headers=null)
 
 getDefaultHeaders ()
 
 getDefaultVars ()
 
 mergeWithDefault ($vars)
 
 flushContent ($content)
 

Private Attributes

 $guzzleClient
 
 $sysconfig
 

Additional Inherited Members

- Protected Attributes inherited from Fossology\Lib\Plugin\DefaultPlugin
 $container
 
 $renderer
 
 $microMenu
 

Detailed Description

Upload a file from the users computer using the UI.

Definition at line 26 of file AdminLicenseFromCSV.php.

Member Function Documentation

◆ checkLicenseDBHealth()

Fossology\UI\Page\AdminLicenseFromCSV::checkLicenseDBHealth ( )

Checks the health status of the license database by sending a GET request to a specified health endpoint. Returns a boolean result indicating whether the database is reachable and healthy. Implements error handling for HTTP request failures.

Returns
bool True if the database health check succeeds with an HTTP 200 response, false otherwise.

Definition at line 185 of file AdminLicenseFromCSV.php.

◆ getFileInputName()

Fossology\UI\Page\AdminLicenseFromCSV::getFileInputName (   $apiVersion = ApiVersion::V1)
Returns
string

Definition at line 67 of file AdminLicenseFromCSV.php.

◆ handle()

Fossology\UI\Page\AdminLicenseFromCSV::handle ( Request  $request)
protected
Parameters
Request$request
Returns
Response

Reimplemented from Fossology\Lib\Plugin\DefaultPlugin.

Definition at line 80 of file AdminLicenseFromCSV.php.

◆ handleFileUpload()

Fossology\UI\Page\AdminLicenseFromCSV::handleFileUpload (   $uploadedFile,
  $delimiter = ',',
  $enclosure = '"' 
)
Parameters
UploadedFile$uploadedFile
Returns
array

Definition at line 152 of file AdminLicenseFromCSV.php.

◆ handleLicenseDbImport()

Fossology\UI\Page\AdminLicenseFromCSV::handleLicenseDbImport ( )

Handles the import of license data from a database by sending a GET request to a specified URL, decoding the retrieved JSON response, and passing the data to the CSV import logic. Provides appropriate error handling for HTTP request failures and JSON decoding errors.

Returns
string A message indicating the result of the operation, including error messages if applicable.

Definition at line 124 of file AdminLicenseFromCSV.php.


The documentation for this class was generated from the following file: