Handle new file uploads from Slim framework and move to FOSSology.
More...
|
| __construct () |
|
| handleScheduleAnalysis ($uploadId, $folderId, $scanOptionsJSON, $newUpload=false, $apiVersion=ApiVersion::V1) |
|
| createNewUpload ($reqBody, $folderId, $fileDescription, $isPublic, $ignoreScm, $uploadType, $applyGlobal=false) |
|
| fetchClearingStatus ($itemTreeBounds, $clearingDao, $groupId) |
|
|
| createFileUpload ($uploadedFile, $folderId, $fileDescription, $isPublic, $ignoreScm=0, $applyGlobal=0) |
|
| handleUpload ($body, $uploadType, $folderId, $fileDescription, $isPublic, $ignoreScm=0, $applyGlobal=0) |
|
| sanitizeVcsData (&$vcsData) |
| Check if the passed VCS object is correct or not. More...
|
|
| sanitizeUrlData (&$urlData) |
| Check if the passed URL object is correct or not. More...
|
|
| sanitizeSrvData (&$srvData) |
| Check if the passed server upload object is correct or not. More...
|
|
| generateVcsUpload ($vcsData, $folderId, $fileDescription, $isPublic, $ignoreScm, $applyGlobal) |
|
| generateUrlUpload ($urlData, $folderName, $fileDescription, $isPublic, $ignoreScm, $applyGlobal) |
|
| generateSrvUpload ($srvData, $folderName, $fileDescription, $isPublic, $ignoreScm, $applyGlobal) |
|
| getMainLicenses ($dbManager, $uploadId, $groupId) |
|
Handle new file uploads from Slim framework and move to FOSSology.
Definition at line 47 of file UploadHelper.php.
◆ __construct()
Fossology\UI\Api\Helper\UploadHelper::__construct |
( |
| ) |
|
Constructor to get UploadFilePage and UploadVcsPage objects.
Definition at line 95 of file UploadHelper.php.
◆ createFileUpload()
Fossology\UI\Api\Helper\UploadHelper::createFileUpload |
( |
|
$uploadedFile, |
|
|
|
$folderId, |
|
|
|
$fileDescription, |
|
|
|
$isPublic, |
|
|
|
$ignoreScm = 0 , |
|
|
|
$applyGlobal = 0 |
|
) |
| |
|
private |
Create request required by UploadFilePage
- Parameters
-
UploadedFile | $uploadedFile | Uploaded file object |
string | $folderId | ID of the folder to upload the file |
string | $fileDescription | Description of file uploaded |
string | $isPublic | Upload is public, private or protected |
integer | $ignoreScm | 1 if the SCM should be ignored. |
integer | $applyGlobal | 1 if global decisions should be applied. |
- Returns
- array Array with status, message and upload id
Definition at line 219 of file UploadHelper.php.
◆ createNewUpload()
Fossology\UI\Api\Helper\UploadHelper::createNewUpload |
( |
|
$reqBody, |
|
|
|
$folderId, |
|
|
|
$fileDescription, |
|
|
|
$isPublic, |
|
|
|
$ignoreScm, |
|
|
|
$uploadType, |
|
|
|
$applyGlobal = false |
|
) |
| |
Get a request from Slim and translate to Symfony request to be processed by FOSSology
- Parameters
-
array | null | $reqBody | |
string | $folderId | ID of the folder to upload the file |
string | $fileDescription | Description of file uploaded |
string | $isPublic | Upload is public, private or protected |
boolean | $ignoreScm | True if the SCM should be ignored. |
string | $uploadType | Type of upload (if other than file) |
boolean | $applyGlobal | True if global decisions should be applied. |
- Returns
- array Array with status, message and upload id
- See also
- createVcsUpload()
-
createFileUpload()
Definition at line 171 of file UploadHelper.php.
◆ fetchClearingStatus()
Fossology\UI\Api\Helper\UploadHelper::fetchClearingStatus |
( |
|
$itemTreeBounds, |
|
|
|
$clearingDao, |
|
|
|
$groupId |
|
) |
| |
Get the clearing status for files within an upload
- Parameters
-
ItemTreeBounds | $itemTreeBounds | ItemTreeBounds object for the uploadtree |
ClearingDao | $clearingDao | ClearingDao object |
integer | $groupId | groupId of the user |
- Returns
- string String containing the Clearing status message
- Exceptions
-
Exception | In case decision type not found |
Definition at line 712 of file UploadHelper.php.
◆ generateSrvUpload()
Fossology\UI\Api\Helper\UploadHelper::generateSrvUpload |
( |
|
$srvData, |
|
|
|
$folderName, |
|
|
|
$fileDescription, |
|
|
|
$isPublic, |
|
|
|
$ignoreScm, |
|
|
|
$applyGlobal |
|
) |
| |
|
private |
Generate the upload by calling handleRequest of HelperToUploadSrvPage
- Parameters
-
array | $srvData | Information from POST |
string | $folderName | Name of the folder |
string | $fileDescription | Description of the upload |
string | $isPublic | Upload is public, private or protected |
integer | $ignoreScm | 1 if the SCM should be ignored. |
integer | $applyGlobal | 1 if global decisions should be applied. |
- Returns
- array Array with status, message and upload id
Definition at line 526 of file UploadHelper.php.
◆ generateUrlUpload()
Fossology\UI\Api\Helper\UploadHelper::generateUrlUpload |
( |
|
$urlData, |
|
|
|
$folderName, |
|
|
|
$fileDescription, |
|
|
|
$isPublic, |
|
|
|
$ignoreScm, |
|
|
|
$applyGlobal |
|
) |
| |
|
private |
Generate the upload by calling handleRequest of HelperToUploadUrlPage
- Parameters
-
array | $urlData | Information from POST |
string | $folderName | Name of the folder |
string | $fileDescription | Description of the upload |
string | $isPublic | Upload is public, private or protected |
integer | $ignoreScm | 1 if the SCM should be ignored. |
integer | $applyGlobal | 1 if global decisions should be applied. |
- Returns
- array Array with status, message and upload id
Definition at line 481 of file UploadHelper.php.
◆ generateVcsUpload()
Fossology\UI\Api\Helper\UploadHelper::generateVcsUpload |
( |
|
$vcsData, |
|
|
|
$folderId, |
|
|
|
$fileDescription, |
|
|
|
$isPublic, |
|
|
|
$ignoreScm, |
|
|
|
$applyGlobal |
|
) |
| |
|
private |
Generate the upload by calling handleRequest of HelperToUploadVcsPage
- Parameters
-
array | $vcsData | Information from POST |
string | $folderId | ID of the folder |
string | $fileDescription | Description of the upload |
string | $isPublic | Upload is public, private or protected |
integer | $ignoreScm | 1 if the SCM should be ignored. |
boolean | $applyGlobal | 1 if global decisions should be applied. |
- Returns
- array Array with status, message and upload id
Definition at line 435 of file UploadHelper.php.
◆ getMainLicenses()
Fossology\UI\Api\Helper\UploadHelper::getMainLicenses |
( |
|
$dbManager, |
|
|
|
$uploadId, |
|
|
|
$groupId |
|
) |
| |
|
private |
Get main license selected for the upload
- Parameters
-
DbManager | $dbManager | DbManager object |
integer | $uploadId | Upload ID |
integer | $groupId | Group ID |
- Returns
- NULL|array
Definition at line 638 of file UploadHelper.php.
◆ handleScheduleAnalysis()
Fossology\UI\Api\Helper\UploadHelper::handleScheduleAnalysis |
( |
|
$uploadId, |
|
|
|
$folderId, |
|
|
|
$scanOptionsJSON, |
|
|
|
$newUpload = false , |
|
|
|
$apiVersion = ApiVersion::V1 |
|
) |
| |
Schedule Analysis after the upload
- Parameters
-
integer | $uploadId | Upload ID |
integer | $folderId | Folder ID |
array | $scanOptionsJSON | scanOptions |
boolean | $newUpload | Request is for new upload? |
- Returns
- Info Response
- Exceptions
-
HttpBadRequestException | If no parameters are selected for agents |
HttpForbiddenException | If the user does not have write access to the upload |
HttpNotFoundException | If the folder does not contain the upload |
Definition at line 114 of file UploadHelper.php.
◆ handleUpload()
Fossology\UI\Api\Helper\UploadHelper::handleUpload |
( |
|
$body, |
|
|
|
$uploadType, |
|
|
|
$folderId, |
|
|
|
$fileDescription, |
|
|
|
$isPublic, |
|
|
|
$ignoreScm = 0 , |
|
|
|
$applyGlobal = 0 |
|
) |
| |
|
private |
Create request required by Upload pages
- Parameters
-
array | $body | Parsed upload request |
string | $uploadType | Type of upload (url, vcs or server) |
string | $folderId | ID of the folder to upload the file |
string | $fileDescription | Description of file uploaded |
string | $isPublic | Upload is public, private or protected |
integer | $ignoreScm | 1 if the SCM should be ignored. |
integer | $applyGlobal | 1 if global decisions should be applied. |
- Returns
- array Array with status, message and upload id
Definition at line 256 of file UploadHelper.php.
◆ sanitizeSrvData()
Fossology\UI\Api\Helper\UploadHelper::sanitizeSrvData |
( |
& |
$srvData | ) |
|
|
private |
Check if the passed server upload object is correct or not.
- Check if all the required parameters are passed by user.
- Add missing keys with empty data to prevent warnings.
- Parameters
-
array | $srvData | Parsed server upload object to be sanitized |
- Returns
- array|boolean True if everything is correct, error array otherwise
Definition at line 403 of file UploadHelper.php.
◆ sanitizeUrlData()
Fossology\UI\Api\Helper\UploadHelper::sanitizeUrlData |
( |
& |
$urlData | ) |
|
|
private |
Check if the passed URL object is correct or not.
- Check if all the required parameters are passed by user.
- Add missing keys with empty data to prevent warnings.
- Parameters
-
array | $urlData | Parsed URL object to be sanitized |
- Returns
- array|boolean True if everything is correct, error array otherwise
Definition at line 363 of file UploadHelper.php.
◆ sanitizeVcsData()
Fossology\UI\Api\Helper\UploadHelper::sanitizeVcsData |
( |
& |
$vcsData | ) |
|
|
private |
Check if the passed VCS object is correct or not.
- Check if all the required parameters are passed by user.
- Translate the
vcsType
to required values.
- Add missing keys with empty data to prevent warnings.
- Parameters
-
array | $vcsData | Parsed VCS object to be sanitized |
- Returns
- array|boolean True if everything is correct, error array otherwise
Definition at line 308 of file UploadHelper.php.
◆ $uploadFilePage
◆ $uploadSrvPage
◆ $uploadUrlPage
◆ $uploadVcsPage
◆ VALID_UPLOAD_TYPES
array Fossology\UI\Api\Helper\UploadHelper::VALID_UPLOAD_TYPES |
Initial value:= array(
"vcs",
"url",
"server"
)
Array of valid inputs for uploadType parameter
Definition at line 86 of file UploadHelper.php.
◆ VALID_VCS_TYPES
array Fossology\UI\Api\Helper\UploadHelper::VALID_VCS_TYPES |
Initial value:Array of valid inputs for vcsType parameter
Definition at line 77 of file UploadHelper.php.
The documentation for this class was generated from the following file: