FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\Agent\Copyright\UI\TextFindingsAjax Class Reference

Handles Ajax requests for text findings. More...

Collaboration diagram for Fossology\Agent\Copyright\UI\TextFindingsAjax:
Collaboration graph

Public Member Functions

 __construct ($uploadTreeTableName)
 
 doGetData ($type, $upload, $activated=true)
 Handles GET request and create a JSON response. More...
 

Protected Member Functions

 getTextFindings ($upload_pk, $item, $type, $uploadTreeTableName, $filter, $activated=true)
 Get results from database and format for JSON. More...
 

Private Member Functions

 getTableData ($upload, $item, $type, $listPage, $filter, $activated=true)
 Get the text finding data and fill in expected format. More...
 
 getOrderString ()
 Create sorting string for database query. More...
 
 addSearchFilter (&$filterParams)
 Add filter on content. More...
 
 getTableRowAction ($hash, $upload, $type, $activated=true, $rw=true)
 Helper to create action column for results. More...
 
 fillTableRow ($row, $upload, $item, $type, $listPage, $activated=true, $rw=true)
 Fill table content for JSON response. More...
 
 getTableName ($type)
 Get table name based on decision type. More...
 
 getDecisionTypeName ($type)
 Get type name for ajax calls based. More...
 
 getViewName ($type)
 Get name of view for links. More...
 

Private Attributes

 $uploadtree_tablename
 
 $dbManager
 
 $uploadDao
 
 $copyrightDao
 
 $dataTablesUtility
 

Detailed Description

Handles Ajax requests for text findings.

Definition at line 21 of file TextFindingsAjax.php.

Member Function Documentation

◆ addSearchFilter()

Fossology\Agent\Copyright\UI\TextFindingsAjax::addSearchFilter ( $filterParams)
private

Add filter on content.

Parameters
[out]array$filterParamsParameters list for database query
Returns
string Filter string for query

Definition at line 227 of file TextFindingsAjax.php.

◆ doGetData()

Fossology\Agent\Copyright\UI\TextFindingsAjax::doGetData (   $type,
  $upload,
  $activated = true 
)

Handles GET request and create a JSON response.

Gets the text finding history for given upload and generate a JSONResponse using getTableData()

Parameters
string$typeThe text finding type ('copyright')
int$uploadUpload id to fetch results
bool$activatedTrue to get activated results, false for disabled
Returns
JsonResponse JSON response for JavaScript

Definition at line 64 of file TextFindingsAjax.php.

◆ fillTableRow()

Fossology\Agent\Copyright\UI\TextFindingsAjax::fillTableRow (   $row,
  $upload,
  $item,
  $type,
  $listPage,
  $activated = true,
  $rw = true 
)
private

Fill table content for JSON response.

Parameters
array$rowResult row from database
int$uploadUpload id
int$itemUpload tree id of the item
string$typeThe text finding type ('copyright')
string$listPagePage slug
boolean$activatedTrue to get activated results, false otherwise
Returns
string[]

Definition at line 285 of file TextFindingsAjax.php.

◆ getDecisionTypeName()

Fossology\Agent\Copyright\UI\TextFindingsAjax::getDecisionTypeName (   $type)
private

Get type name for ajax calls based.

  • copyFindings => copyright
    Parameters
    string$typeResult type
    Returns
    string Table name

Definition at line 341 of file TextFindingsAjax.php.

◆ getOrderString()

Fossology\Agent\Copyright\UI\TextFindingsAjax::getOrderString ( )
private

Create sorting string for database query.

Returns
string Sorting string

Definition at line 209 of file TextFindingsAjax.php.

◆ getTableData()

Fossology\Agent\Copyright\UI\TextFindingsAjax::getTableData (   $upload,
  $item,
  $type,
  $listPage,
  $filter,
  $activated = true 
)
private

Get the text finding data and fill in expected format.

Parameters
int$uploadUpload id to get results from
int$itemUpload tree id of the item
string$typeThe text finding type ('copyright')
string$listPagePage slug to use
string$filterFilter data from query
boolean$activatedTrue to get activated copyrights, else false
Returns
array[][] Array of table data, total records in database, filtered records

Definition at line 92 of file TextFindingsAjax.php.

◆ getTableName()

Fossology\Agent\Copyright\UI\TextFindingsAjax::getTableName (   $type)
private

Get table name based on decision type.

  • copyFindings => copyright_decision
    Parameters
    string$typeResult type
    Returns
    string Table name

Definition at line 329 of file TextFindingsAjax.php.

◆ getTableRowAction()

Fossology\Agent\Copyright\UI\TextFindingsAjax::getTableRowAction (   $hash,
  $upload,
  $type,
  $activated = true,
  $rw = true 
)
private

Helper to create action column for results.

Parameters
string$hashUnique hash of the decision
int$uploadUpload id
string$typeThe text finding type ('copyright')
boolean$activatedTrue if content is activated, else false
boolean$rwtrue if content is editable
Returns
string

Definition at line 246 of file TextFindingsAjax.php.

◆ getTextFindings()

Fossology\Agent\Copyright\UI\TextFindingsAjax::getTextFindings (   $upload_pk,
  $item,
  $type,
  $uploadTreeTableName,
  $filter,
  $activated = true 
)
protected

Get results from database and format for JSON.

Parameters
int$upload_pkUpload id to get results from
int$itemUpload tree id of the item
string$typeThe text finding type ('copyright')
string$uploadTreeTableNameUpload tree table to use
string$filterFilter data from query
boolean$activatedTrue to get activated copyrights, else false
Returns
array[][] Array of table records, filtered records, total records

Definition at line 123 of file TextFindingsAjax.php.

◆ getViewName()

Fossology\Agent\Copyright\UI\TextFindingsAjax::getViewName (   $type)
private

Get name of view for links.

  • copyFindings => copyright-view
    Parameters
    string$typeResult type
    Returns
    string View name

Definition at line 353 of file TextFindingsAjax.php.

Member Data Documentation

◆ $copyrightDao

CopyrightDao Fossology\Agent\Copyright\UI\TextFindingsAjax::$copyrightDao
private

CopyrightDao object

Definition at line 38 of file TextFindingsAjax.php.

◆ $dataTablesUtility

DataTablesUtility Fossology\Agent\Copyright\UI\TextFindingsAjax::$dataTablesUtility
private

DataTablesUtility object

Definition at line 42 of file TextFindingsAjax.php.

◆ $dbManager

DbManager Fossology\Agent\Copyright\UI\TextFindingsAjax::$dbManager
private

DbManager object

Definition at line 30 of file TextFindingsAjax.php.

◆ $uploadDao

Fossology\Agent\Copyright\UI\TextFindingsAjax::$uploadDao
private

UploadDao UploadDao object

Definition at line 34 of file TextFindingsAjax.php.

◆ $uploadtree_tablename

string Fossology\Agent\Copyright\UI\TextFindingsAjax::$uploadtree_tablename
private

Upload tree to be used

Definition at line 26 of file TextFindingsAjax.php.


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