FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
wget_agent.php
Go to the documentation of this file.
1 <?php
2 /***********************************************************
3  Copyright (C) 2012-2013 Hewlett-Packard Development Company, L.P.
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public License
7  version 2 as published by the Free Software Foundation.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License along
15  with this program; if not, write to the Free Software Foundation, Inc.,
16  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 ***********************************************************/
18 
24 define("TITLE_agent_wget_agent", "wget_agent");
25 
30 class agent_wget_agent extends FO_Plugin {
31 
32  public $Name = "wget_agent";
33  public $Title = TITLE_agent_wget_agent;
34  public $Version = "1.0";
35  public $Dependency = array();
36  public $DBaccess = PLUGIN_DB_WRITE;
37  public $AgentName = "wget_agent"; // agent.agent_name
38 
43  function RegisterMenus()
44  {
45  if ($this->State != PLUGIN_STATE_READY) {
46  return (0);
47  } // don't run
48 
49  /* fake menu item used to identify plugin agents */
50  menu_insert("Agents::" . $this->Title, 0, $this->Name);
51  }
52 
53 
64  function AgentHasResults($upload_pk)
65  {
66  return (0);
67  } // AgentHasResults()
68 
69 
88  function AgentAdd($job_pk, $upload_pk, &$ErrorMsg, $Dependencies)
89  {
90  $Dependencies[] = "wget_agent";
91  return CommonAgentAdd($this, $job_pk, $upload_pk, $ErrorMsg, $Dependencies);
92  } // AgentAdd()
93 
94 };
95 $NewPlugin = new agent_wget_agent;
96 ?>
AgentHasResults($upload_pk)
Check if the upload has results from this agent.
Definition: wget_agent.php:64
UI plugin for WGET_AGENT.
Definition: wget_agent.php:30
CommonAgentAdd($plugin, $job_pk, $upload_pk, &$ErrorMsg, $Dependencies, $jqargs="", $jq_cmd_args=NULL)
Queue an agent. This is a simple version of AgentAdd() that can be used by multiple plugins that only...
Definition: common-job.php:435
RegisterMenus()
While menus can be added to any time at or after the PostInitialize phase, this is the standard locat...
Definition: wget_agent.php:43
Definition: state.hpp:26
#define PLUGIN_DB_WRITE
Plugin requires write permission on DB.
Definition: libfossology.h:50
This is the Plugin class. All plugins should:
Definition: FO_Plugin.php:67
menu_insert($Path, $LastOrder=0, $URI=NULL, $Title=NULL, $Target=NULL, $HTML=NULL)
Given a Path, order level for the last item, and optional plugin name, insert the menu item...
AgentAdd($job_pk, $upload_pk, &$ErrorMsg, $Dependencies)
Queue the wget agent.
Definition: wget_agent.php:88