FOSSology  4.7.0-rc1
Open Source License Compliance by Open Source Software
Fossology\UI\Api\Controllers\LicenseController Class Reference

Controller for licenses. More...

Inheritance diagram for Fossology\UI\Api\Controllers\LicenseController:
Inheritance graph
Collaboration diagram for Fossology\UI\Api\Controllers\LicenseController:
Collaboration graph

Public Member Functions

 __construct ($container)
 
 getLicense ($request, $response, $args)
 
 getAllLicenses ($request, $response, $args)
 
 createLicense ($request, $response, $args)
 
 updateLicense ($request, $response, $args)
 
 getAllAdminAcknowledgements ($request, $response, $args)
 
 handleAdminLicenseAcknowledgement ($request, $response, $args)
 
 getAllLicenseStandardComments ($request, $response, $args)
 
 handleLicenseStandardComment ($request, $response, $args)
 
 exportAdminLicenseToCSV ($request, $response, $args)
 
 exportAdminLicenseToJSON ($request, $response, $args)
 
 exportBulkText ($request, $response, $args)
 
- Public Member Functions inherited from Fossology\UI\Api\Controllers\RestController
 isJsonRequest ($request)
 

Public Attributes

const PAGE_PARAM = "page"
 
const LIMIT_PARAM = "limit"
 
const ACTIVE_PARAM = "active"
 
const LICENSE_FETCH_LIMIT = 100
 

Private Member Functions

 isNewLicense ($shortName, $groupId=0)
 

Private Attributes

 $licenseDao
 
 $adminLicenseAckDao
 
 $licenseStdCommentDao
 

Additional Inherited Members

- Protected Member Functions inherited from Fossology\UI\Api\Controllers\RestController
 getParsedBody (ServerRequestInterface $request)
 Parse request body as JSON and return associative PHP array. More...
 
 throwNotAdminException ()
 
 uploadAccessible ($id)
 
 isItemExists (int $uploadId, int $itemId)
 
- Protected Attributes inherited from Fossology\UI\Api\Controllers\RestController
 $container
 
 $restHelper
 
 $dbHelper
 

Detailed Description

Controller for licenses.

Definition at line 45 of file LicenseController.php.

Constructor & Destructor Documentation

◆ __construct()

Fossology\UI\Api\Controllers\LicenseController::__construct (   $container)
Parameters
ContainerInterface$container

Reimplemented from Fossology\UI\Api\Controllers\RestController.

Definition at line 85 of file LicenseController.php.

Member Function Documentation

◆ createLicense()

Fossology\UI\Api\Controllers\LicenseController::createLicense (   $request,
  $response,
  $args 
)

Create a new license

Parameters
Request$request
ResponseHelper$response
array$args
Returns
ResponseHelper
Exceptions
HttpErrorException

Definition at line 240 of file LicenseController.php.

◆ exportAdminLicenseToCSV()

Fossology\UI\Api\Controllers\LicenseController::exportAdminLicenseToCSV (   $request,
  $response,
  $args 
)

Export licenses to CSV file

Parameters
Request$request
ResponseHelper$response
array$args
Returns
ResponseHelper
Exceptions
HttpErrorException

Definition at line 859 of file LicenseController.php.

◆ exportAdminLicenseToJSON()

Fossology\UI\Api\Controllers\LicenseController::exportAdminLicenseToJSON (   $request,
  $response,
  $args 
)

Export licenses to JSON file

Parameters
Request$request
ResponseHelper$response
array$args
Returns
ResponseHelper
Exceptions
HttpErrorException

Definition at line 896 of file LicenseController.php.

◆ exportBulkText()

Fossology\UI\Api\Controllers\LicenseController::exportBulkText (   $request,
  $response,
  $args 
)

Export bulk text scan data to CSV or JSON.

Query params:

  • format: optional export format, csv|json (default json)
  • filter: optional filter type, all|user|group (default all)
  • userId: required when filter=user
  • groupId: required when filter=group
  • delimiter: optional CSV delimiter (default ,)
  • enclosure: optional CSV enclosure (default ")
Parameters
Request$request
ResponseHelper$response
array$args
Returns
ResponseHelper
Exceptions
HttpErrorException

Definition at line 941 of file LicenseController.php.

◆ getAllAdminAcknowledgements()

Fossology\UI\Api\Controllers\LicenseController::getAllAdminAcknowledgements (   $request,
  $response,
  $args 
)

Get all admin license acknowledgements

Parameters
Request$request
ResponseHelper$response
array$args
Returns
ResponseHelper
Exceptions
HttpErrorException

Definition at line 481 of file LicenseController.php.

◆ getAllLicenses()

Fossology\UI\Api\Controllers\LicenseController::getAllLicenses (   $request,
  $response,
  $args 
)

Get list of all licenses, paginated upon request params

Parameters
Request$request
ResponseHelper$response
array$args
Returns
ResponseHelper
Exceptions
HttpErrorException

Definition at line 156 of file LicenseController.php.

◆ getAllLicenseStandardComments()

Fossology\UI\Api\Controllers\LicenseController::getAllLicenseStandardComments (   $request,
  $response,
  $args 
)

Get all license standard comments

Parameters
Request$request
ResponseHelper$response
array$args
Returns
ResponseHelper

Definition at line 590 of file LicenseController.php.

◆ getLicense()

Fossology\UI\Api\Controllers\LicenseController::getLicense (   $request,
  $response,
  $args 
)

Get the license information based on the provided parameters

Parameters
Request$request
ResponseHelper$response
array$args
Returns
ResponseHelper
Exceptions
HttpErrorException

Definition at line 102 of file LicenseController.php.

◆ handleAdminLicenseAcknowledgement()

Fossology\UI\Api\Controllers\LicenseController::handleAdminLicenseAcknowledgement (   $request,
  $response,
  $args 
)

Add, Edit & toggle admin license acknowledgement.

Parameters
Request$request
ResponseHelper$response
array$args
Returns
ResponseHelper
Exceptions
HttpErrorException

Definition at line 505 of file LicenseController.php.

◆ handleLicenseStandardComment()

Fossology\UI\Api\Controllers\LicenseController::handleLicenseStandardComment (   $request,
  $response,
  $args 
)

Add, Edit & toggle license standard comment.

Parameters
Request$request
ResponseHelper$response
array$args
Returns
ResponseHelper
Exceptions
HttpErrorException

Definition at line 611 of file LicenseController.php.

◆ isNewLicense()

Fossology\UI\Api\Controllers\LicenseController::isNewLicense (   $shortName,
  $groupId = 0 
)
private

Check if the given shortname already exists in DB.

Parameters
string$shortNameShortname to check
integer$groupIdGroup ID if candidate license

Definition at line 362 of file LicenseController.php.

◆ updateLicense()

Fossology\UI\Api\Controllers\LicenseController::updateLicense (   $request,
  $response,
  $args 
)

Update a license

Parameters
Request$request
ResponseHelper$response
array$args
Returns
ResponseHelper
Exceptions
HttpErrorException

Definition at line 301 of file LicenseController.php.

Member Data Documentation

◆ $adminLicenseAckDao

LicenseAcknowledgementDao Fossology\UI\Api\Controllers\LicenseController::$adminLicenseAckDao
private

LicenseAcknowledgementDao object

Definition at line 73 of file LicenseController.php.

◆ $licenseDao

LicenseDao Fossology\UI\Api\Controllers\LicenseController::$licenseDao
private

License Dao object

Definition at line 67 of file LicenseController.php.

◆ $licenseStdCommentDao

LicenseStdCommentDao Fossology\UI\Api\Controllers\LicenseController::$licenseStdCommentDao
private

License Dao object

Definition at line 79 of file LicenseController.php.

◆ ACTIVE_PARAM

const Fossology\UI\Api\Controllers\LicenseController::ACTIVE_PARAM = "active"

Get header parameter name for active licenses

Definition at line 58 of file LicenseController.php.

◆ LICENSE_FETCH_LIMIT

const Fossology\UI\Api\Controllers\LicenseController::LICENSE_FETCH_LIMIT = 100

Limit of licenses in get query

Definition at line 62 of file LicenseController.php.

◆ LIMIT_PARAM

const Fossology\UI\Api\Controllers\LicenseController::LIMIT_PARAM = "limit"

Get header parameter name for limiting listing

Definition at line 54 of file LicenseController.php.

◆ PAGE_PARAM

const Fossology\UI\Api\Controllers\LicenseController::PAGE_PARAM = "page"

Get header parameter name for page listing

Definition at line 50 of file LicenseController.php.


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