2 # SPDX-FileCopyrightText: © 2019 Siemens AG
4 # SPDX-License-Identifier: GPL-2.0-only
6 namespace Fossology\Ojo\Ui;
13 private $ojoDesc =
"Scan files for licenses using SPDX-License-Identifier";
15 public function __construct()
17 $this->Name =
"agent_ojo";
18 $this->Title = _(
"Ojo License Analysis <img src=\"images/info_16.png\" data-toggle=\"tooltip\" title=\"".$this->ojoDesc.
"\" class=\"info-bullet\"/>");
19 $this->AgentName =
"ojo";
21 parent::__construct();
26 return CheckARS($uploadId, $this->AgentName,
"ojo agent",
"ojo_ars");
33 public function AgentAdd($jobId, $uploadId, &$errorMsg, $dependencies=[],
34 $arguments=
null, $request=
null, $unpackArgs=
null)
36 if ($request !=
null && !is_array($request)) {
37 $unpackArgs = intval($request->get(
'scm', 0)) == 1 ?
'-I' :
'';
39 $unpackArgs = intval(@$_POST[
'scm']) == 1 ?
'-I' :
'';
46 if ($jobQueueId != 0) {
51 if (!empty($unpackArgs)) {
52 return $this->
doAgentAdd($jobId, $uploadId, $errorMsg, array(
"agent_mimetype"),$uploadId,$args,$request);
54 return $this->
doAgentAdd($jobId, $uploadId, $errorMsg, array(
"agent_adj2nest"), $uploadId,
null, $request);
66 foreach ($dependencies as $dependency) {
67 if ($dependency == $agentName) {
70 if (is_array($dependency) && $agentName == $dependency[
'name']) {
77 register_plugin(
new OjosAgentPlugin());
doAgentAdd($jobId, $uploadId, &$errorMsg, $dependencies, $jqargs="", $jq_cmd_args=null, $request=null)
isAgentIncluded($dependencies, $agentName)
AgentHasResults($uploadId=0)
AgentAdd($jobId, $uploadId, &$errorMsg, $dependencies=[], $arguments=null, $request=null, $unpackArgs=null)
CheckARS($upload_pk, $AgentName, $AgentDesc, $AgentARSTableName)
Check the ARS table to see if an agent has successfully scanned an upload.
IsAlreadyScheduled($job_pk, $AgentName, $upload_pk)
Check if an agent is already scheduled in a job.