FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\Lib\Dao\UploadDao Class Reference
Collaboration diagram for Fossology\Lib\Dao\UploadDao:
Collaboration graph

Public Member Functions

 __construct (DbManager $dbManager, Logger $logger, UploadPermissionDao $uploadPermissionDao)
 
 getUploadEntry ($uploadTreeId, $uploadTreeTableName="uploadtree")
 
 getUploadtreeIdFromPfile ($uploadFk, $pfileFk)
 
 getUpload ($uploadId)
 
 getActiveUploadsArray ()
 
 getItemTreeBounds ($itemId, $uploadTreeTableName="uploadtree")
 
 getItemTreeBoundsFromUploadId ($uploadTreeId, $uploadId)
 
 getParentItemBounds ($uploadId, $uploadTreeTableName=null)
 
 countPlainFiles (ItemTreeBounds $itemTreeBounds)
 
 getStatus ($uploadId, $groupId)
 Get the upload status. More...
 
 getAssignee ($uploadId, $groupId)
 Get the upload assignee id. More...
 
 getAssigneeDate (int $uploadId)
 
 getClosedDate (int $uploadId)
 
 getClearingDuration (int $uploadId)
 
 getUploadtreeTableName ($uploadId)
 Get the uploadtree table name for this upload_pk If upload_pk does not exist, return "uploadtree". More...
 
 getNextItem ($uploadId, $itemId, $options=null)
 
 getPreviousItem ($uploadId, $itemId, $options=null)
 
 getItemByDirection ($uploadId, $itemId, $direction, $options)
 
 getUploadParent ($uploadId)
 
 getLeftAndRight ($uploadtreeID, $uploadTreeTableName="uploadtree")
 
 getContainingFileCount (ItemTreeBounds $itemTreeBounds, UploadTreeProxy $uploadTreeView)
 
 getContainedItems (ItemTreeBounds $itemTreeBounds, $addCondition="", $addParameters=array())
 
 addReusedUpload ($uploadId, $reusedUploadId, $groupId, $reusedGroupId, $reuseMode=0)
 
 getReusedUpload ($uploadId, $groupId)
 
 countNonArtifactDescendants (ItemTreeBounds $itemTreeBounds, $isFlat=true)
 
 isAccessible ($uploadId, $groupId)
 
 isEditable ($uploadId, $groupId)
 
 makeAccessibleToGroup ($uploadId, $groupId, $perm=null)
 
 makeAccessibleToAllGroupsOf ($uploadId, $userId, $perm=null)
 
 getUploadHashes ($uploadId)
 
 getFatItemArray ($itemId, $uploadId, $uploadtreeTablename)
 
 getFatItemId ($itemId, $uploadId, $uploadtreeTablename)
 
 getPFileDataPerFileName (ItemTreeBounds $itemTreeBounds)
 
 getPFilesDataPerHashAlgo (ItemTreeBounds $itemTreeBounds, $hashAlgo="sha1")
 
 getReportInfo ($uploadId)
 
 updateReportInfo ($uploadId, $column, $value)
 Update report info for upload. More...
 
 getGlobalDecisionSettingsFromInfo ($uploadId, $setGlobal=null)
 
 getUploadHashesFromPfileId ($pfilePk)
 Get Pfile hashes from the pfile id. More...
 
 insertReportConfReuse ($uploadId, $reusedUploadId)
 

Public Attributes

const REUSE_NONE = 0
 
const REUSE_ENHANCED = 2
 
const REUSE_MAIN = 4
 
const REUSE_CONF = 16
 
const REUSE_COPYRIGHT = 128
 
const UNIFIED_REPORT_HEADINGS
 
const CLIXML_REPORT_HEADINGS
 
const DIR_FWD = 1
 
const DIR_BCK = -1
 
const NOT_FOUND = null
 

Protected Member Functions

 createItem ($uploadEntry, $uploadTreeTableName)
 
 createItemTreeBounds ($uploadEntryData, $uploadTreeTableName)
 

Private Member Functions

 handleUploadIdForTable ($uploadTreeTableName, $uploadId, &$parameters)
 
 updateStackState (&$pathStack, &$rgtStack, &$lastLft, $row)
 
 addToPFilePerFileName (&$pfilePerFileName, $pathStack, $row)
 

Private Attributes

 $dbManager
 
 $logger
 
 $permissionDao
 

Detailed Description

Member Function Documentation

◆ addReusedUpload()

Fossology\Lib\Dao\UploadDao::addReusedUpload (   $uploadId,
  $reusedUploadId,
  $groupId,
  $reusedGroupId,
  $reuseMode = 0 
)
Parameters
int$uploadId
int$reusedUploadId
int$groupId
int$reusedGroupId
int$reuseMode

Definition at line 507 of file UploadDao.php.

◆ countNonArtifactDescendants()

Fossology\Lib\Dao\UploadDao::countNonArtifactDescendants ( ItemTreeBounds  $itemTreeBounds,
  $isFlat = true 
)
Parameters
ItemTreeBounds$itemTreeBounds
bool$isFlatplain files from sub*folders instead of folders
Returns
array

Definition at line 569 of file UploadDao.php.

◆ countPlainFiles()

Fossology\Lib\Dao\UploadDao::countPlainFiles ( ItemTreeBounds  $itemTreeBounds)
Parameters
ItemTreeBounds$itemTreeBounds
Returns
int

Definition at line 199 of file UploadDao.php.

◆ createItem()

Fossology\Lib\Dao\UploadDao::createItem (   $uploadEntry,
  $uploadTreeTableName 
)
protected
Parameters
array$uploadEntry
string$uploadTreeTableName
Returns
Item

Definition at line 536 of file UploadDao.php.

◆ createItemTreeBounds()

Fossology\Lib\Dao\UploadDao::createItemTreeBounds (   $uploadEntryData,
  $uploadTreeTableName 
)
protected
Parameters
array$uploadEntryData
string$uploadTreeTableName
Exceptions
Exception
Returns
ItemTreeBounds

Definition at line 556 of file UploadDao.php.

◆ getAssignee()

Fossology\Lib\Dao\UploadDao::getAssignee (   $uploadId,
  $groupId 
)

Get the upload assignee id.

Parameters
int$uploadIdUpload to get assignee id
int$groupIdEffective group
Returns
integer 1 if not found
Exceptions
Exceptionif upload not accessible.

Definition at line 267 of file UploadDao.php.

◆ getAssigneeDate()

Fossology\Lib\Dao\UploadDao::getAssigneeDate ( int  $uploadId)

Get the date when user was first assigned to the upload.

Parameters
int$uploadIdUpload to get assignee date
Returns
string|null Date when user was assigned to the upload, null if not exists.

Definition at line 288 of file UploadDao.php.

◆ getClearingDuration()

Fossology\Lib\Dao\UploadDao::getClearingDuration ( int  $uploadId)

Get the clearing duration of a upload.

Parameters
int$uploadIdUpload to get clearing duration
Returns
array with duration and durationSort when upload was closed or rejected.

Definition at line 322 of file UploadDao.php.

◆ getClosedDate()

Fossology\Lib\Dao\UploadDao::getClosedDate ( int  $uploadId)

Get the date when upload was closed or rejected.

Parameters
int$uploadIdUpload to get closing date
Returns
string|null Date when upload was closed or rejected, null if not exists.

Definition at line 305 of file UploadDao.php.

◆ getContainingFileCount()

Fossology\Lib\Dao\UploadDao::getContainingFileCount ( ItemTreeBounds  $itemTreeBounds,
UploadTreeProxy  $uploadTreeView 
)
Parameters
ItemTreeBounds$itemTreeBounds
UploadTreeProxy$uploadTreeView
Returns
int

Definition at line 465 of file UploadDao.php.

◆ getFatItemArray()

Fossology\Lib\Dao\UploadDao::getFatItemArray (   $itemId,
  $uploadId,
  $uploadtreeTablename 
)
Parameters
int$itemId
string$uploadId
string$uploadtreeTablename
Returns
array

Definition at line 627 of file UploadDao.php.

◆ getFatItemId()

Fossology\Lib\Dao\UploadDao::getFatItemId (   $itemId,
  $uploadId,
  $uploadtreeTablename 
)
Parameters
int$itemId
string$uploadId
string$uploadtreeTablename
Returns
int

Definition at line 650 of file UploadDao.php.

◆ getItemByDirection()

Fossology\Lib\Dao\UploadDao::getItemByDirection (   $uploadId,
  $itemId,
  $direction,
  $options 
)
Parameters
$uploadId
$itemId
$direction
$options
Returns
Item|null

Definition at line 398 of file UploadDao.php.

◆ getItemTreeBounds()

Fossology\Lib\Dao\UploadDao::getItemTreeBounds (   $itemId,
  $uploadTreeTableName = "uploadtree" 
)
Parameters
$itemId
$uploadTreeTableName
Returns
ItemTreeBounds

Definition at line 153 of file UploadDao.php.

◆ getItemTreeBoundsFromUploadId()

Fossology\Lib\Dao\UploadDao::getItemTreeBoundsFromUploadId (   $uploadTreeId,
  $uploadId 
)
Parameters
$uploadTreeId
$uploadId
Returns
ItemTreeBounds

Definition at line 164 of file UploadDao.php.

◆ getNextItem()

Fossology\Lib\Dao\UploadDao::getNextItem (   $uploadId,
  $itemId,
  $options = null 
)
Parameters
int$uploadId
int$itemId
Returns
Item|null

Definition at line 370 of file UploadDao.php.

◆ getParentItemBounds()

Fossology\Lib\Dao\UploadDao::getParentItemBounds (   $uploadId,
  $uploadTreeTableName = null 
)
Parameters
int$uploadId
string|null
Exceptions
Exception
Returns
ItemTreeBounds|false

Definition at line 176 of file UploadDao.php.

◆ getPFileDataPerFileName()

Fossology\Lib\Dao\UploadDao::getPFileDataPerFileName ( ItemTreeBounds  $itemTreeBounds)
Parameters
ItemTreeBounds$itemTreeBounds
Returns
array

Definition at line 660 of file UploadDao.php.

◆ getPFilesDataPerHashAlgo()

Fossology\Lib\Dao\UploadDao::getPFilesDataPerHashAlgo ( ItemTreeBounds  $itemTreeBounds,
  $hashAlgo = "sha1" 
)
Parameters
ItemTreeBounds$itemTreeBounds
String$hashAlgo
Returns
array

Definition at line 739 of file UploadDao.php.

◆ getPreviousItem()

Fossology\Lib\Dao\UploadDao::getPreviousItem (   $uploadId,
  $itemId,
  $options = null 
)
Parameters
$uploadId
$itemId
$options
Returns
mixed

Definition at line 381 of file UploadDao.php.

◆ getReusedUpload()

Fossology\Lib\Dao\UploadDao::getReusedUpload (   $uploadId,
  $groupId 
)
Parameters
int$uploadId
int$groupId
Returns
array Assoc array of reused_upload_fk, reused_group_fk and reuse_mode

Definition at line 519 of file UploadDao.php.

◆ getStatus()

Fossology\Lib\Dao\UploadDao::getStatus (   $uploadId,
  $groupId 
)

Get the upload status.

Parameters
int$uploadIdUpload to get status for
int$groupIdEffective group
Returns
integer Status fk or 1 if not found
Exceptions
Exceptionif upload not accessible.

Definition at line 244 of file UploadDao.php.

◆ getUpload()

Fossology\Lib\Dao\UploadDao::getUpload (   $uploadId)
Parameters
int$uploadId
Returns
Upload|null

Definition at line 125 of file UploadDao.php.

◆ getUploadEntry()

Fossology\Lib\Dao\UploadDao::getUploadEntry (   $uploadTreeId,
  $uploadTreeTableName = "uploadtree" 
)
Parameters
$uploadTreeId
string$uploadTreeTableName
Returns
array

Definition at line 93 of file UploadDao.php.

◆ getUploadHashes()

Fossology\Lib\Dao\UploadDao::getUploadHashes (   $uploadId)
Parameters
int$uploadId
Returns
array with keys sha1, md5, sha256

Definition at line 614 of file UploadDao.php.

◆ getUploadHashesFromPfileId()

Fossology\Lib\Dao\UploadDao::getUploadHashesFromPfileId (   $pfilePk)

Get Pfile hashes from the pfile id.

Parameters
$pfilePk
Returns
array

Definition at line 877 of file UploadDao.php.

◆ getUploadParent()

Fossology\Lib\Dao\UploadDao::getUploadParent (   $uploadId)
Parameters
$uploadId
Returns
int uploadtreeId of top item

Definition at line 434 of file UploadDao.php.

◆ getUploadtreeIdFromPfile()

Fossology\Lib\Dao\UploadDao::getUploadtreeIdFromPfile (   $uploadFk,
  $pfileFk 
)

Get the first entry for uploadtree_pk for a given pfile in a given upload.

Parameters
integer$uploadFkUpload id
integer$pfileFkPfile id
Returns
integer Uploadtree_pk

Definition at line 110 of file UploadDao.php.

◆ getUploadtreeTableName()

Fossology\Lib\Dao\UploadDao::getUploadtreeTableName (   $uploadId)

Get the uploadtree table name for this upload_pk If upload_pk does not exist, return "uploadtree".

Parameters
$upload_pk
Returns
uploadtree table name

Definition at line 349 of file UploadDao.php.

◆ insertReportConfReuse()

Fossology\Lib\Dao\UploadDao::insertReportConfReuse (   $uploadId,
  $reusedUploadId 
)
Parameters
int$uploadId
int$reusedUploadId
Returns
bool

Definition at line 891 of file UploadDao.php.

◆ updateReportInfo()

Fossology\Lib\Dao\UploadDao::updateReportInfo (   $uploadId,
  $column,
  $value 
)

Update report info for upload.

Parameters
int$uploadIdUpload ID to update
string$columnColumn to update
string | array$valueNew value
Returns
boolean True on success

Definition at line 806 of file UploadDao.php.

Member Data Documentation

◆ CLIXML_REPORT_HEADINGS

const Fossology\Lib\Dao\UploadDao::CLIXML_REPORT_HEADINGS
Initial value:
= array(
"mainlicensesclixml" => array("Main Licenses" => true),
"licensepath" => array("License File Path" => true),
"licensehash" => array("License File Hash" => true),
"copyrightsclixml" => array("Copyrights" => true),
"copyrightpath" => array("Copyright File Path" => true),
"copyrighthash" => array("Copyright File Hash" => true),
"exportrestrictionsclixml" => array("Export Restrictions(ECC)" => true),
"eccpath" => array("ECC File Path" => true),
"ecchash" => array("ECC File Hash" => true),
"intellectualPropertyclixml" => array("Identified Patent Relevant Analysis(IPRA)" => true),
"iprapath" => array("IPRA File Path" => true),
"iprahash" => array("IPRA File Hash" => true),
"allobligations" => array("All Obligations" => true),
"acknowledgementsclixml" => array("Acknowledgements" => true),
"irrelevantfilesclixml" => array("Irrelevant Files" => true),
"dnufilesclixml" => array("Do not use Files" => true),
"notesclixml" => array("Additional Notes" => true)
)

Definition at line 54 of file UploadDao.php.

◆ UNIFIED_REPORT_HEADINGS

const Fossology\Lib\Dao\UploadDao::UNIFIED_REPORT_HEADINGS
Initial value:
= array(
"assessment" => array("Assessment Summary" => true),
"compliancetasks" => array("Required license compliance tasks" => true),
"acknowledgements" => array("Acknowledgements" => true),
"exportrestrictions" => array("Export Restrictions" => true),
"intellectualProperty" => array("Patent Relevant Statements" => true),
"notes" => array("Notes" => true),
"scanresults" => array("Results of License Scan" => true),
"mainlicenses" => array("Main Licenses" => true),
"redlicense" => array("Other OSS Licenses (red) - Do not Use Licenses" => true),
"yellowlicense" => array("Other OSS Licenses (yellow) - additional obligations to common rules (e.g. copyleft)" => true),
"whitelicense" => array("Other OSS Licenses (white) - only common rules" => true),
"overviewwithwithoutobligations" => array("Overview of All Licenses with or without Obligations" => true),
"copyrights" => array("Copyrights" => true),
"copyrightsuf" => array("Copyrights (User Findings)" => true),
"bulkfindings" => array("Bulk Findings" => true),
"licensenf" => array("Non-Functional Licenses" => true),
"irrelevantfiles" => array("Irrelevant Files" => true),
"dnufiles" => array("Do not use Files" => true),
"changelog" => array("Clearing Protocol Change Log" => true)
)

Definition at line 33 of file UploadDao.php.


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