FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\UI\Api\Controllers\UploadController Class Reference

Controller for Upload model. More...

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

Public Member Functions

 __construct ($container)
 
 getUploads ($request, $response, $args)
 
 getUploadSummary ($request, $response, $args)
 
 deleteUpload ($request, $response, $args)
 
 moveUpload ($request, $response, $args)
 
 getUploadLicenses ($request, $response, $args)
 
 getUploadCopyrights ($request, $response, $args)
 
 updateUpload ($request, $response, $args)
 
 setUploadPermissions ($request, $response, $args)
 
 getEquivalentValueForPermission ($perm)
 
 getGroupsWithPermissions ($request, $response, $args)
 
 removeMainLicense ($request, $response, $args)
 
 getClearingProgressInfo ($request, $response, $args)
 
 getLicensesHistogram ($request, $response, $args)
 
 getAllAgents ($request, $response, $args)
 
 getEditedLicenses ($request, $response, $args)
 
 getScannedLicenses ($request, $response, $args)
 
 getAgentsRevision ($request, $response, $args)
 
 getTopItem ($request, $response, $args)
 

Public Attributes

const AGENT_PARAM = "agent"
 
const FOLDER_PARAM = "folderId"
 
const RECURSIVE_PARAM = "recursive"
 
const FILTER_NAME = "name"
 
const FILTER_STATUS = "status"
 
const FILTER_ASSIGNEE = "assignee"
 
const FILTER_DATE = "since"
 
const PAGE_PARAM = "page"
 
const LIMIT_PARAM = "limit"
 
const UPLOAD_FETCH_LIMIT = 100
 
const CONTAINER_PARAM = "containers"
 
const VALID_STATUS = ["open", "inprogress", "closed", "rejected"]
 

Private Member Functions

 changeUpload ($request, $response, $args, $isCopy)
 
 isAdj2nestDone ($id)
 
 areAgentsScheduled ($uploadId, $agents, $response)
 

Private Attributes

 $agentNames = AgentRef::AGENT_LIST
 
 $agentDao
 

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 Upload model.

Definition at line 57 of file UploadController.php.

Constructor & Destructor Documentation

◆ __construct()

Fossology\UI\Api\Controllers\UploadController::__construct (   $container)

Constructor for base controller

Parameters
ContainerInterface$container

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

Definition at line 131 of file UploadController.php.

Member Function Documentation

◆ areAgentsScheduled()

Fossology\UI\Api\Controllers\UploadController::areAgentsScheduled (   $uploadId,
  $agents,
  $response 
)
private

Check if every agent passed is scheduled for the upload

Parameters
integer$uploadIdUpload ID to check agents for
array$agentsList of agents to check
ResponseHelper$response
Exceptions
HttpBadRequestExceptionInvalid agent name sent
HttpPreconditionFailExceptionAgent never ran
HttpServiceUnavailableExceptionAgent is running

Definition at line 737 of file UploadController.php.

◆ changeUpload()

Fossology\UI\Api\Controllers\UploadController::changeUpload (   $request,
  $response,
  $args,
  $isCopy 
)
private

Perform copy/move based on $isCopy

Parameters
ServerRequestInterface$request
ResponseHelper$response
array$args
boolean$isCopyTrue to perform copy, else false
Returns
ResponseHelper
Exceptions
HttpErrorException

Definition at line 413 of file UploadController.php.

◆ deleteUpload()

Fossology\UI\Api\Controllers\UploadController::deleteUpload (   $request,
  $response,
  $args 
)

Delete a given upload

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

Definition at line 362 of file UploadController.php.

◆ getAgentsRevision()

Fossology\UI\Api\Controllers\UploadController::getAgentsRevision (   $request,
  $response,
  $args 
)

Get all the revisions for the successful agents of an upload

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

Definition at line 1249 of file UploadController.php.

◆ getAllAgents()

Fossology\UI\Api\Controllers\UploadController::getAllAgents (   $request,
  $response,
  $args 
)

Get all the groups with their respective permissions for a upload

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

Definition at line 1125 of file UploadController.php.

◆ getClearingProgressInfo()

Fossology\UI\Api\Controllers\UploadController::getClearingProgressInfo (   $request,
  $response,
  $args 
)

Get the clearing progress info of the upload

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

Definition at line 1011 of file UploadController.php.

◆ getEditedLicenses()

Fossology\UI\Api\Controllers\UploadController::getEditedLicenses (   $request,
  $response,
  $args 
)

Get all edited licenses for the entire upload

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

Definition at line 1164 of file UploadController.php.

◆ getGroupsWithPermissions()

Fossology\UI\Api\Controllers\UploadController::getGroupsWithPermissions (   $request,
  $response,
  $args 
)

Get all the groups with their respective permissions for a upload

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

Definition at line 853 of file UploadController.php.

◆ getLicensesHistogram()

Fossology\UI\Api\Controllers\UploadController::getLicensesHistogram (   $request,
  $response,
  $args 
)

Get all licenses histogram for the entire upload

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

Definition at line 1053 of file UploadController.php.

◆ getScannedLicenses()

Fossology\UI\Api\Controllers\UploadController::getScannedLicenses (   $request,
  $response,
  $args 
)

Get all scanned licenses for the entire upload

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

Definition at line 1213 of file UploadController.php.

◆ getTopItem()

Fossology\UI\Api\Controllers\UploadController::getTopItem (   $request,
  $response,
  $args 
)

Get the top level item ID for an upload.

Parameters
ServerRequestInterface$request
ResponseHelper$response
array$args
Returns
ResponseHelper
Exceptions
Exception

Definition at line 1280 of file UploadController.php.

◆ getUploadCopyrights()

Fossology\UI\Api\Controllers\UploadController::getUploadCopyrights (   $request,
  $response,
  $args 
)

Get list of copyright and files for given upload

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

Definition at line 629 of file UploadController.php.

◆ getUploadLicenses()

Fossology\UI\Api\Controllers\UploadController::getUploadLicenses (   $request,
  $response,
  $args 
)

Get list of licenses and copyright for given upload

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

Definition at line 552 of file UploadController.php.

◆ getUploads()

Fossology\UI\Api\Controllers\UploadController::getUploads (   $request,
  $response,
  $args 
)

Get list of uploads for current user

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

Definition at line 150 of file UploadController.php.

◆ getUploadSummary()

Fossology\UI\Api\Controllers\UploadController::getUploadSummary (   $request,
  $response,
  $args 
)

Get summary of given upload

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

Definition at line 319 of file UploadController.php.

◆ isAdj2nestDone()

Fossology\UI\Api\Controllers\UploadController::isAdj2nestDone (   $id)
private

Check if adj2nest agent finished on upload

Parameters
integer$idUpload ID
Exceptions
HttpServiceUnavailableExceptionon failure

Definition at line 715 of file UploadController.php.

◆ moveUpload()

Fossology\UI\Api\Controllers\UploadController::moveUpload (   $request,
  $response,
  $args 
)

Move or copy a given upload to a new folder

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

Definition at line 387 of file UploadController.php.

◆ setUploadPermissions()

Fossology\UI\Api\Controllers\UploadController::setUploadPermissions (   $request,
  $response,
  $args 
)

Set permissions for a upload in a folder for different groups

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

Definition at line 788 of file UploadController.php.

◆ updateUpload()

Fossology\UI\Api\Controllers\UploadController::updateUpload (   $request,
  $response,
  $args 
)

Update an upload

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

Definition at line 648 of file UploadController.php.

Member Data Documentation

◆ $agentDao

AgentDao Fossology\UI\Api\Controllers\UploadController::$agentDao
private

Agent Dao object

Definition at line 129 of file UploadController.php.

◆ $agentNames

Fossology\UI\Api\Controllers\UploadController::$agentNames = AgentRef::AGENT_LIST
private

Agent names list

Definition at line 123 of file UploadController.php.

◆ AGENT_PARAM

const Fossology\UI\Api\Controllers\UploadController::AGENT_PARAM = "agent"

Get query parameter name for agent listing

Definition at line 63 of file UploadController.php.

◆ CONTAINER_PARAM

const Fossology\UI\Api\Controllers\UploadController::CONTAINER_PARAM = "containers"

Get query parameter name for container listing

Definition at line 113 of file UploadController.php.

◆ FILTER_ASSIGNEE

const Fossology\UI\Api\Controllers\UploadController::FILTER_ASSIGNEE = "assignee"

Get query parameter name for assignee filtering

Definition at line 88 of file UploadController.php.

◆ FILTER_DATE

const Fossology\UI\Api\Controllers\UploadController::FILTER_DATE = "since"

Get query parameter name for since filtering

Definition at line 93 of file UploadController.php.

◆ FILTER_NAME

const Fossology\UI\Api\Controllers\UploadController::FILTER_NAME = "name"

Get query parameter name for name filtering

Definition at line 78 of file UploadController.php.

◆ FILTER_STATUS

const Fossology\UI\Api\Controllers\UploadController::FILTER_STATUS = "status"

Get query parameter name for status filtering

Definition at line 83 of file UploadController.php.

◆ FOLDER_PARAM

const Fossology\UI\Api\Controllers\UploadController::FOLDER_PARAM = "folderId"

Get query parameter name for folder id

Definition at line 68 of file UploadController.php.

◆ LIMIT_PARAM

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

Get query parameter name for limiting listing

Definition at line 103 of file UploadController.php.

◆ PAGE_PARAM

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

Get query parameter name for page listing

Definition at line 98 of file UploadController.php.

◆ RECURSIVE_PARAM

const Fossology\UI\Api\Controllers\UploadController::RECURSIVE_PARAM = "recursive"

Get query parameter name for recursive listing

Definition at line 73 of file UploadController.php.

◆ UPLOAD_FETCH_LIMIT

const Fossology\UI\Api\Controllers\UploadController::UPLOAD_FETCH_LIMIT = 100

Limit of uploads in get query

Definition at line 108 of file UploadController.php.

◆ VALID_STATUS

const Fossology\UI\Api\Controllers\UploadController::VALID_STATUS = ["open", "inprogress", "closed", "rejected"]

Valid status inputs

Definition at line 118 of file UploadController.php.


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