FOSSology  4.4.0
Open Source License Compliance by Open Source Software
UIExportList Class Reference
Inheritance diagram for UIExportList:
Inheritance graph
Collaboration diagram for UIExportList:
Collaboration graph

Public Member Functions

 __construct ()
 base constructor. Most plugins will just use this More...
 
 setDelimiter ($delimiter=',')
 
 setEnclosure ($enclosure='"')
 
 RegisterMenus ()
 Customize submenus.
 
 getAgentPksFromRequest ($upload_pk)
 
 getTemplateName ()
 
 Output ()
 This function returns the scheduler status.
 
 getCopyrights ($uploadId, $uploadtree_pk, $uploadTreeTableName, $NomostListNum, $exclude, $copyrightType="all")
 
- Public Member Functions inherited from FO_Plugin
 Install ()
 This function (when defined) is only called when the plugin is first installed. It should make sure all requirements are available and create anything it needs to run. It returns 0 on success, non-zero on failure. A failed install is not inserted in the system. More...
 
 Remove ()
 This function (when defined) is only called once, when the plugin is removed. It should uninstall and remove all items that are only used by this plugin. There should be no residues – if the plugin is ever installed again, it should act like a clean install. Thus, any DB, files, or state variables specific to this plugin must be removed. This function must always succeed.
 
 Initialize ()
 dummy stub till all references are removed.
 
 PostInitialize ()
 This function is called before the plugin is used and after all plugins have been initialized. If there is any initialization step that is dependent on other plugins, put it here. More...
 
 Destroy ()
 This is a destructor called after the plugin is no longer needed. It should assume that PostInitialize() was already run one time (this session) and succeeded. This function must always succeed.
 
 OutputOpen ()
 This function is called when user output is requested. This function is responsible for assigning headers.
 
 OutputUnSet ()
 Similar to OutputClose, this ends the output type for this object. However, this does NOT change any global settings. This is called when this object is a dependency for another object.
 
 getResponse ()
 
 renderString ($templateName, $vars=null)
 
 renderScripts ($scripts)
 Render JavaScript in the template's footer. More...
 
 getRequest ()
 
 execute ()
 
 preInstall ()
 
 postInstall ()
 
 unInstall ()
 
 getName ()
 
 __toString ()
 

Protected Attributes

 $delimiter = ','
 
 $enclosure = '"'
 
- Protected Attributes inherited from FO_Plugin
 $microMenu
 
 $renderer
 
 $vars = array()
 

Private Member Functions

 updateCopyrightList (&$list, $newCopyrights, $NomostListNum, $uploadTreeTableName, $key)
 
 removeCopyrightWithLicense (&$lines, $itemTreeBounds, $agentList, $exclude)
 
 consolidateConclusions ($conclusions)
 
 removeIfKeyExists (&$lines, $key)
 
 printLines ($lines, $copyright=false)
 
 consolidateResult ($lines)
 
 consolidateFindingsPerDirectory ($lines)
 
 printCSV ($lines, $uploadtreeTablename, $copyright=false)
 
 printSpreadsheet ($lines, $uploadtreeTablename)
 
 reduceCopyrightLines ($lines)
 

Private Attributes

 $uploadDao
 
 $licenseDao
 
 $clearingDao
 
 $copyrightDao
 
 $clearingFilter
 
 $treeDao
 

Additional Inherited Members

- Public Attributes inherited from FO_Plugin
 $State = PLUGIN_STATE_INVALID
 
 $Name = ""
 
 $Version = "1.0"
 
 $Title = ""
 
 $DBaccess = PLUGIN_DB_NONE
 
 $LoginFlag = 0
 
 $NoMenu = 0
 
 $NoHeader = 0
 
 $PluginLevel = 10
 
 $Dependency = array()
 
 $InitOrder = 0
 
 $MenuList = NULL
 
 $MenuOrder = 0
 
 $MenuTarget = NULL
 
 $OutputType = "HTML"
 
 $OutputToStdout = 0
 
- Protected Member Functions inherited from FO_Plugin
 render ($templateName, $vars=null)
 

Detailed Description

Print the founded and concluded license or copyrights as a list or CSV.

Definition at line 32 of file ui-export-list.php.

Constructor & Destructor Documentation

◆ __construct()

UIExportList::__construct ( )

base constructor. Most plugins will just use this

Makes sure the plugin is in the correct state. If so, the plugin is inserted into the Plugins data structure.

The constructor assumes that Install() was already run one time (possibly years ago and not during this object's creation).

Returns
true on success, false on failure.

On failure the plugin is not used by the system. NOTE: This function must NOT assume that other plugins are installed. See PostInitialize.

Reimplemented from FO_Plugin.

Definition at line 66 of file ui-export-list.php.

Member Function Documentation

◆ consolidateConclusions()

UIExportList::consolidateConclusions (   $conclusions)
private

Reduce the 2D list of conclusions on a file to a linear array

Parameters
array$conclusions2D array of conclusions
Returns
array List of unique conclusions on the file

Definition at line 494 of file ui-export-list.php.

◆ consolidateFindingsPerDirectory()

UIExportList::consolidateFindingsPerDirectory (   $lines)
private

Remove basename from filePath and reduce lines that has same result.

Parameters
array$linesLicense and results per file
Returns
array Lines by directories without duplicated result

Definition at line 599 of file ui-export-list.php.

◆ consolidateResult()

UIExportList::consolidateResult (   $lines)
private

Reduce license findings from agents into one

Parameters
array$linesScanned results of agents and conclusions
Returns
array Lines with consolidated license list

Definition at line 554 of file ui-export-list.php.

◆ getAgentPksFromRequest()

UIExportList::getAgentPksFromRequest (   $upload_pk)

Get the agent IDs for requested agents.

Parameters
integer$upload_pkCurrent upload id
Returns
array Array with agent name as key and agent id if found or false as value.

Definition at line 139 of file ui-export-list.php.

◆ getCopyrights()

UIExportList::getCopyrights (   $uploadId,
  $uploadtree_pk,
  $uploadTreeTableName,
  $NomostListNum,
  $exclude,
  $copyrightType = "all" 
)

Get the list of copyrights

Parameters
integer$uploadIdUpload ID
integer$uploadtree_pkItem ID
integer$uploadTreeTableNameUpload tree table name
integer$NomostListNumLimit of lines to print
integer$excludeFiles to be excluded
string$copyrightTypeWhich copyrights to print ("all" to print everything, "nolic" to print only files with no scanner findings and no license as conclusion)
Returns
array List of copyrights with filePath and content

Definition at line 374 of file ui-export-list.php.

◆ getTemplateName()

UIExportList::getTemplateName ( )

See also
FO_Plugin::getTemplateName()

Reimplemented from FO_Plugin.

Definition at line 225 of file ui-export-list.php.

◆ printCSV()

UIExportList::printCSV (   $lines,
  $uploadtreeTablename,
  $copyright = false 
)
private

Print the lines as CSV

Parameters
array$linesLines to be printed
string$uploadtreeTablenameUpload tree table name
boolean$copyrightResults are copyright?
Returns
Response CSV file as a response

Definition at line 636 of file ui-export-list.php.

◆ printLines()

UIExportList::printLines (   $lines,
  $copyright = false 
)
private

Print the lines for browser

Parameters
array$linesLines to be printed
boolean$copyrightResults are copyright?
Returns
string

Definition at line 527 of file ui-export-list.php.

◆ printSpreadsheet()

UIExportList::printSpreadsheet (   $lines,
  $uploadtreeTablename 
)
private

Print the lines as spreadsheet

Parameters
array$linesLines to be printed
string$uploadtreeTablenameUpload tree table name
Returns
Response spreadsheet(xlsx) file as a response

Definition at line 695 of file ui-export-list.php.

◆ reduceCopyrightLines()

UIExportList::reduceCopyrightLines (   $lines)
private

Reduce multidimentional copyright list to simple 2D array

Parameters
array$linesCopyright list
Returns
array Simple 2D array

Definition at line 824 of file ui-export-list.php.

◆ removeCopyrightWithLicense()

UIExportList::removeCopyrightWithLicense ( $lines,
  $itemTreeBounds,
  $agentList,
  $exclude 
)
private

Remove all files which either have license findings and not remove, or have at least one license as conclusion

Parameters
array[in,out]$lines Lines to be filtered
ItemTreeBounds$itemTreeBoundsItem bounds
array$agentListList of agent IDs
string$excludeFiles to be excluded

Definition at line 459 of file ui-export-list.php.

◆ removeIfKeyExists()

UIExportList::removeIfKeyExists ( $lines,
  $key 
)
private

Remove key from a list if it exists

Note
Uses strpos to find the key
Parameters
array[in,out]$lines Array
string$keyKey to be removed

Definition at line 511 of file ui-export-list.php.

◆ setDelimiter()

UIExportList::setDelimiter (   $delimiter = ',')

Set the delimiter for CSV

Parameters
string$delimiterThe delimiter to be used (max len 1)

Definition at line 87 of file ui-export-list.php.

◆ setEnclosure()

UIExportList::setEnclosure (   $enclosure = '"')

Set the enclosure for CSV

Parameters
string$enclosureThe enclosure to be used (max len 1)

Definition at line 96 of file ui-export-list.php.

◆ updateCopyrightList()

UIExportList::updateCopyrightList ( $list,
  $newCopyrights,
  $NomostListNum,
  $uploadTreeTableName,
  $key 
)
private

Update the list of copyrights with new list

Parameters
array[in,out]$list List of copyrights
array$newCopyrightsList of copyrights to be included
integer$NomostListNumLimit of copyrights
string$uploadTreeTableNameUpload tree table name
string$keyKey of the array holding copyright

Definition at line 433 of file ui-export-list.php.

Member Data Documentation

◆ $clearingDao

ClearingDao UIExportList::$clearingDao
private

Clearing Dao object

Definition at line 44 of file ui-export-list.php.

◆ $clearingFilter

ClearingDecisionFilter UIExportList::$clearingFilter
private

Clearing filer

Definition at line 52 of file ui-export-list.php.

◆ $copyrightDao

CopyrightDao UIExportList::$copyrightDao
private

CopyrightDao object

Definition at line 48 of file ui-export-list.php.

◆ $delimiter

string UIExportList::$delimiter = ','
protected

Delimiter for CSV

Definition at line 60 of file ui-export-list.php.

◆ $enclosure

string UIExportList::$enclosure = '"'
protected

Enclosure for strings in CSV

Definition at line 64 of file ui-export-list.php.

◆ $licenseDao

LicenseDao UIExportList::$licenseDao
private

License Dao object

Definition at line 40 of file ui-export-list.php.

◆ $treeDao

TreeDao UIExportList::$treeDao
private

TreeDao to get file path

Definition at line 56 of file ui-export-list.php.

◆ $uploadDao

UploadDao UIExportList::$uploadDao
private

Upload Dao object

Definition at line 36 of file ui-export-list.php.


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