FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
ui-buckets.php
1 <?php
2 /***********************************************************
3  Copyright (C) 2010-2013 Hewlett-Packard Development Company, L.P.
4  Copyright (C) 2015 Siemens AG
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License
8  version 2 as published by the Free Software Foundation.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License along
16  with this program; if not, write to the Free Software Foundation, Inc.,
17  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 ***********************************************************/
19 
23 
28 class ui_buckets extends FO_Plugin
29 {
32  function __construct()
33  {
34  $this->Name = "bucketbrowser";
35  $this->Title = _("Bucket Browser");
36  $this->Dependency = array("browse","view");
37  $this->DBaccess = PLUGIN_DB_READ;
38  $this->LoginFlag = 0;
39  parent::__construct();
40  }
41 
46  function Install()
47  {
48  global $PG_CONN;
49 
50  if (empty($PG_CONN)) {
51  return(1);
52  } /* No DB */
53 
65  /* Check if there is already a bucket pool, if there is
66  * then return because there is nothing to do.
67  */
68  $sql = "SELECT bucketpool_pk FROM bucketpool limit 1";
69  $result = pg_query($PG_CONN, $sql);
70  DBCheckResult($result, $sql, __FILE__, __LINE__);
71  if (pg_num_rows($result) > 0)
72  {
73  pg_free_result($result);
74  return;
75  }
76 
77  /* none exist so create the demo */
78  $DemoPoolName = "GPL Demo bucket pool";
79  $sql = "INSERT INTO bucketpool (bucketpool_name, version, active, description) VALUES ('$DemoPoolName', 1, 'Y', 'Demonstration of a very simple GPL/non-gpl bucket pool')";
80  $result = pg_query($PG_CONN, $sql);
81  DBCheckResult($result, $sql, __FILE__, __LINE__);
82  pg_free_result($result);
83 
84  /* get the bucketpool_pk of the newly inserted record */
85  $sql = "select bucketpool_pk from bucketpool
86  where bucketpool_name='$DemoPoolName' limit 1";
87  $result = pg_query($PG_CONN, $sql);
88  DBCheckResult($result, $sql, __FILE__, __LINE__);
89  $row = pg_fetch_assoc($result);
90  $bucketpool_pk = $row['bucketpool_pk'];
91  pg_free_result($result);
92 
93  /* Insert the bucket_def records */
94  $sql = "INSERT INTO bucketpool (bucketpool_name, version, active, description) VALUES ('$DemoPoolName', 1, 'Y', 'Demonstration of a very simple GPL/non-gpl bucket pool')";
95  $Columns = "bucket_name, bucket_color, bucket_reportorder, bucket_evalorder, bucketpool_fk, bucket_type, bucket_regex, stopon, applies_to";
96  $sql = "INSERT INTO bucket_def ($Columns) VALUES ('GPL Licenses (Demo)', 'orange', 50, 50, $bucketpool_pk, 3, '(affero|gpl)', 'N', 'f');
97  INSERT INTO bucket_def ($Columns) VALUES ('non-gpl (Demo)', 'yellow', 50, 1000, $bucketpool_pk, 99, NULL, 'N', 'f')";
98  $result = pg_query($PG_CONN, $sql);
99  DBCheckResult($result, $sql, __FILE__, __LINE__);
100  pg_free_result($result);
101 
102  return(0);
103  } // Install()
104 
108  function RegisterMenus()
109  {
110  // For all other menus, permit coming back here.
111  $Item = GetParm("item",PARM_INTEGER);
112  $Upload = GetParm("upload",PARM_INTEGER);
113  $bucketpool_pk = GetParm("bp",PARM_INTEGER);
114  if (!empty($Item) && !empty($Upload))
115  {
116  $menuText = "Bucket";
117  $menuPosition = 55;
118  $URI = $this->Name . Traceback_parm_keep(array("format","page","upload","item","bp"));
119  $tooltipText = _("Browse by buckets");
120  $this->microMenu->insert(array(MicroMenu::VIEW_META, MicroMenu::VIEW), $menuText, $menuPosition, $this->getName(), $URI, $tooltipText);
121  }
122  } // RegisterMenus()
123 
124 
135  function Initialize()
136  {
137  global $_GET;
138 
139  if ($this->State != PLUGIN_STATE_INVALID) {
140  return(1);
141  } // don't re-run
142  if ($this->Name !== "") // Name must be defined
143  {
144  global $Plugins;
145  $this->State=PLUGIN_STATE_VALID;
146  array_push($Plugins,$this);
147  }
148 
149  return($this->State == PLUGIN_STATE_VALID);
150  } // Initialize()
151 
152 
161  function ShowUploadHist($Uploadtree_pk,$Uri)
162  {
163  global $PG_CONN;
164 
165  $VF=""; // return values for file listing
166  $VLic=""; // return values for output
167  $V=""; // total return value
168  $UniqueTagArray = array();
169  global $Plugins;
170 
171  $ModLicView = &$Plugins[plugin_find_id("view-license")];
172 
173  /******* Get Bucket names and counts ******/
174  /* Find lft and rgt bounds for this $Uploadtree_pk */
175  $sql = "SELECT lft,rgt,upload_fk FROM $this->uploadtree_tablename
176  WHERE uploadtree_pk = $Uploadtree_pk";
177  $result = pg_query($PG_CONN, $sql);
178  DBCheckResult($result, $sql, __FILE__, __LINE__);
179  if (pg_num_rows($result) < 1)
180  {
181  pg_free_result($result);
182  $text = _("Invalid URL, nonexistant item");
183  return "<h2>$text $Uploadtree_pk</h2>";
184  }
185  $row = pg_fetch_assoc($result);
186  $lft = $row["lft"];
187  $rgt = $row["rgt"];
188  $upload_pk = $row["upload_fk"];
189  pg_free_result($result);
190 
191  /* Get the ars_pk of the scan to display, also the select list */
192  $ars_pk = GetArrayVal("ars", $_GET);
193  $BucketSelect = SelectBucketDataset($upload_pk, $ars_pk, "selectbdata",
194  "onchange=\"addArsGo('newds','selectbdata');\"");
195  if ($ars_pk == 0)
196  {
197  /* No bucket data for this upload */
198  return $BucketSelect;
199  }
200 
201  /* Get scan keys */
202  $sql = "select agent_fk, nomosagent_fk, bucketpool_fk from bucket_ars where ars_pk=$ars_pk";
203  $result = pg_query($PG_CONN, $sql);
204  DBCheckResult($result, $sql, __FILE__, __LINE__);
205  $row = pg_fetch_assoc($result);
206  $bucketagent_pk = $row["agent_fk"];
207  $nomosagent_pk = $row["nomosagent_fk"];
208  $bucketpool_pk = $row["bucketpool_fk"];
209  pg_free_result($result);
210 
211  /* Create bucketDefArray as individual query this is MUCH faster
212  than incorporating it with a join in the following queries.
213  */
214  $bucketDefArray = initBucketDefArray($bucketpool_pk);
215 
216  /*select all the buckets for entire tree for this bucketpool */
217  $sql = "SELECT distinct(bucket_fk) as bucket_pk,
218  count(bucket_fk) as bucketcount, bucket_reportorder
219  from bucket_file, bucket_def,
220  (SELECT distinct(pfile_fk) as PF from $this->uploadtree_tablename
221  where upload_fk=$upload_pk
222  and ((ufile_mode & (1<<28))=0)
223  and ((ufile_mode & (1<<29))=0)
224  and $this->uploadtree_tablename.lft BETWEEN $lft and $rgt) as SS
225  where PF=pfile_fk and agent_fk=$bucketagent_pk
226  and bucket_file.nomosagent_fk=$nomosagent_pk
227  and bucket_pk=bucket_fk
228  and bucketpool_fk=$bucketpool_pk
229  group by bucket_fk,bucket_reportorder
230  order by bucket_reportorder asc";
231  $result = pg_query($PG_CONN, $sql);
232  DBCheckResult($result, $sql, __FILE__, __LINE__);
233  $historows = pg_fetch_all($result);
234  pg_free_result($result);
235 
236  /* Show dataset list */
237  if (!empty($BucketSelect))
238  {
239  $action = Traceback_uri() . "?mod=bucketbrowser&upload=$upload_pk&item=$Uploadtree_pk";
240 
241  $VLic .= "<script type='text/javascript'>
242 function addArsGo(formid, selectid )
243 {
244 var selectobj = document.getElementById(selectid);
245 var ars_pk = selectobj.options[selectobj.selectedIndex].value;
246 document.getElementById(formid).action='$action'+'&ars='+ars_pk;
247 document.getElementById(formid).submit();
248 return;
249 }
250 </script>";
251 
252  /* form to select new dataset (ars_pk) */
253  $VLic .= "<form action='$action' id='newds' method='POST'>\n";
254  $VLic .= $BucketSelect;
255  $VLic .= "</form>";
256  }
257 
258  $sql = "select bucketpool_name, version from bucketpool where bucketpool_pk=$bucketpool_pk";
259  $result = pg_query($PG_CONN, $sql);
260  DBCheckResult($result, $sql, __FILE__, __LINE__);
261  $row = pg_fetch_assoc($result);
262  $bucketpool_name = $row['bucketpool_name'];
263  $bucketpool_version = $row['version'];
264  pg_free_result($result);
265 
266  /* Write bucket histogram to $VLic */
267  $bucketcount = 0;
268  $Uniquebucketcount = 0;
269  $NoLicFound = 0;
270  if (is_array($historows))
271  {
272  $text = _("Bucket Pool");
273  $VLic .= "$text: $bucketpool_name v$bucketpool_version<br>";
274  $VLic .= "<table border=1 width='100%'>\n";
275  $text = _("Count");
276  $VLic .= "<tr><th width='10%'>$text</th>";
277  $text = _("Files");
278  $VLic .= "<th width='10%'>$text</th>";
279  $text = _("Bucket");
280  $VLic .= "<th align='left'>$text</th></tr>\n";
281 
282  foreach($historows as $bucketrow)
283  {
284  $Uniquebucketcount++;
285  $bucket_pk = $bucketrow['bucket_pk'];
286  $bucketcount = $bucketrow['bucketcount'];
287  $bucket_name = $bucketDefArray[$bucket_pk]['bucket_name'];
288  $bucket_color = $bucketDefArray[$bucket_pk]['bucket_color'];
289 
290  /* Count */
291  $VLic .= "<tr><td align='right' style='background-color:$bucket_color'>$bucketcount</td>";
292 
293  /* Show */
294  $VLic .= "<td align='center'><a href='";
295  $VLic .= Traceback_uri();
296  $text = _("Show");
297  $VLic .= "?mod=list_bucket_files&bapk=$bucketagent_pk&item=$Uploadtree_pk&bpk=$bucket_pk&bp=$bucketpool_pk&napk=$nomosagent_pk" . "'>$text</a></td>";
298 
299  /* Bucket name */
300  $VLic .= "<td align='left'>";
301  $VLic .= "<a id='$bucket_pk' onclick='FileColor_Get(\"" . Traceback_uri() . "?mod=ajax_filebucket&bapk=$bucketagent_pk&item=$Uploadtree_pk&bucket_pk=$bucket_pk\")'";
302  $VLic .= ">$bucket_name </a>";
303 
304  /* Allow users to tag an entire bucket */
305 /* Future, maybe v 2.1
306  $TagHref = "<a href=" . Traceback_uri() . "?mod=bucketbrowser&upload=$upload_pk&item=$Uploadtree_pk&bapk=$bucketagent_pk&bpk=$bucket_pk&bp=$bucketpool_pk&napk=$nomosagent_pk&tagbucket=1>Tag</a>";
307  $VLic .= " [$TagHref]";
308 */
309 
310  $VLic .= "</td>";
311  $VLic .= "</tr>\n";
312  // if ($row['bucket_name'] == "No Buckets Found") $NoLicFound = $row['bucketcount'];
313  }
314  $VLic .= "</table>\n";
315  $VLic .= "<p>\n";
316  $text = _("Unique buckets");
317  $VLic .= "$text: $Uniquebucketcount<br>\n";
318  }
319 
320 
321  /******* File Listing ************/
322  /* Get ALL the items under this Uploadtree_pk */
323  $Children = GetNonArtifactChildren($Uploadtree_pk, $this->uploadtree_tablename);
324 
325  if (count($Children) == 0)
326  {
327  $sql = "SELECT * FROM $this->uploadtree_tablename WHERE uploadtree_pk = '$Uploadtree_pk'";
328  $result = pg_query($PG_CONN, $sql);
329  DBCheckResult($result, $sql, __FILE__, __LINE__);
330  $row = pg_fetch_assoc($result);
331  pg_free_result($result);
332  if (empty($row) || (IsDir($row['ufile_mode']))) {
333  return;
334  }
335  // $ModLicView = &$Plugins[plugin_find_id("view-license")];
336  // return($ModLicView->Output() );
337  }
338  $ChildCount=0;
339  $Childbucketcount=0;
340 
341  /* Countd disabled until we know we need them
342  $NumSrcPackages = 0;
343  $NumBinPackages = 0;
344  $NumBinNoSrcPackages = 0;
345  */
346 
347  /* get mimetypes for packages */
348  $MimetypeArray = GetPkgMimetypes();
349 
350  $VF .= "<table border=0>";
351  foreach($Children as $C)
352  {
353  if (empty($C)) {
354  continue;
355  }
356 
357  /* update package counts */
358  /* This is an expensive count. Comment out until we know we really need it
359  IncrSrcBinCounts($C, $MimetypeArray, $NumSrcPackages, $NumBinPackages, $NumBinNoSrcPackages);
360  */
361 
362  $IsDir = Isdir($C['ufile_mode']);
363  $IsContainer = Iscontainer($C['ufile_mode']);
364 
365  /* Determine the hyperlink for non-containers to view-license */
366  if (!empty($C['pfile_fk']) && !empty($ModLicView))
367  {
368  $LinkUri = Traceback_uri();
369  $LinkUri .= "?mod=view-license&napk=$nomosagent_pk&bapk=$bucketagent_pk&upload=$upload_pk&item=$C[uploadtree_pk]";
370  }
371  else
372  {
373  $LinkUri = NULL;
374  }
375 
376  /* Determine link for containers */
377  if (Iscontainer($C['ufile_mode']))
378  {
379  $uploadtree_pk = DirGetNonArtifact($C['uploadtree_pk'], $this->uploadtree_tablename);
380  $tmpuri = "?mod=" . $this->Name . Traceback_parm_keep(array("upload","folder","ars"));
381  $LicUri = "$tmpuri&item=" . $uploadtree_pk;
382  }
383  else
384  {
385  $LicUri = NULL;
386  }
387 
388  /* Populate the output ($VF) - file list */
389  /* id of each element is its uploadtree_pk */
390  $VF .= "<tr><td id='$C[uploadtree_pk]' align='left'>";
391  $HasHref=0;
392  $HasBold=0;
393  if ($IsContainer)
394  {
395  $VF .= "<a href='$LicUri'>"; $HasHref=1;
396  $VF .= "<b>"; $HasBold=1;
397  }
398  else if (!empty($LinkUri))
399  {
400  $VF .= "<a href='$LinkUri'>"; $HasHref=1;
401  }
402  $VF .= $C['ufile_name'];
403  if ($IsDir) {
404  $VF .= "/";
405  };
406  if ($HasBold) {
407  $VF .= "</b>";
408  }
409  if ($HasHref) {
410  $VF .= "</a>";
411  }
412 
413  /* print buckets */
414  $VF .= "<br>";
415  $VF .= "<span style='position:relative;left:1em'>";
416  /* get color coded string of bucket names */
417  $VF .= GetFileBuckets_string($nomosagent_pk, $bucketagent_pk, $C['uploadtree_pk'],
418  $bucketDefArray, ",", True);
419  $VF .= "</span>";
420  $VF .= "</td><td valign='top'>";
421 
422  /* display item links */
423  $VF .= FileListLinks($C['upload_fk'], $C['uploadtree_pk'], $nomosagent_pk, $C['pfile_fk'], True, $UniqueTagArray, $this->uploadtree_tablename);
424  $VF .= "</td>";
425  $VF .= "</tr>\n";
426 
427  $ChildCount++;
428  }
429  $VF .= "</table>\n";
430 
431  $V .= ActiveHTTPscript("FileColor");
432 
433  /* Add javascript for color highlighting
434  This is the response script needed by ActiveHTTPscript
435  responseText is bucket_pk',' followed by a comma seperated list of uploadtree_pk's */
436  $script = "
437  <script type=\"text/javascript\" charset=\"utf-8\">
438  var Lastutpks=''; /* save last list of uploadtree_pk's */
439  var Lastbupk=''; /* save last bucket_pk */
440  var color = '#4bfe78';
441  function FileColor_Reply()
442  {
443  if ((FileColor.readyState==4) && (FileColor.status==200))
444  {
445  /* remove previous highlighting */
446  var numpks = Lastutpks.length;
447  if (numpks > 0) document.getElementById(Lastbupk).style.backgroundColor='white';
448  while (numpks)
449  {
450  document.getElementById(Lastutpks[--numpks]).style.backgroundColor='white';
451  }
452 
453  utpklist = FileColor.responseText.split(',');
454  Lastbupk = utpklist.shift();
455  numpks = utpklist.length;
456  Lastutpks = utpklist;
457 
458  /* apply new highlighting */
459  elt = document.getElementById(Lastbupk);
460  if (elt != null) elt.style.backgroundColor=color;
461  while (numpks)
462  {
463  document.getElementById(utpklist[--numpks]).style.backgroundColor=color;
464  }
465  }
466  return;
467  }
468  </script>
469  ";
470  $V .= $script;
471 
472  /* Display source, binary, and binary missing source package counts */
473  /* Counts disabled above until we know we need these
474  $VLic .= "<ul>";
475  $text = _("source packages");
476  $VLic .= "<li> $NumSrcPackages $text";
477  $text = _("binary packages");
478  $VLic .= "<li> $NumBinPackages $text";
479  $text = _("binary packages with no source package");
480  $VLic .= "<li> $NumBinNoSrcPackages $text";
481  $VLic .= "</ul>";
482  */
483 
484  /* Combine VF and VLic */
485  $V .= "<table border=0 width='100%'>\n";
486  $V .= "<tr><td valign='top' width='50%'>$VLic</td><td valign='top'>$VF</td></tr>\n";
487  $V .= "</table>\n";
488  $V .= "<hr />\n";
489 
490  return($V);
491  } // ShowUploadHist()
492 
493 
503  function TagBucket($upload_pk, $uploadtree_pk, $bucketagent_pk, $bucket_pk, $bucketpool_pk, $nomosagent_pk)
504  {
505  } // TagBucket()
506 
507 
512  public function Output()
513  {
514  $uTime = microtime(true);
515  $V="";
516  $Upload = GetParm("upload",PARM_INTEGER);
518  $uploadDao = $GLOBALS['container']->get('dao.upload');
519  if ( !$uploadDao->isAccessible($Upload, Auth::getGroupId()) )
520  {
521  $text = _("Permission Denied");
522  return "<h2>$text</h2>";
523  }
524 
525  $Item = GetParm("item",PARM_INTEGER);
526  if ( !$Item)
527  {
528  return _('No item selected');
529  }
530  $updcache = GetParm("updcache",PARM_INTEGER);
531  $tagbucket = GetParm("tagbucket",PARM_INTEGER);
532 
534 
535  /* Remove "updcache" from the GET args and set $this->UpdCache
536  * This way all the url's based on the input args won't be
537  * polluted with updcache
538  * Use Traceback_parm_keep to ensure that all parameters are in order
539  */
540  $CacheKey = "?mod=" . $this->Name . Traceback_parm_keep(array("upload","item","folder","ars")) ;
541  if ($updcache)
542  {
543  $_SERVER['REQUEST_URI'] = preg_replace("/&updcache=[0-9]*/","",$_SERVER['REQUEST_URI']);
544  unset($_GET['updcache']);
545  $V = ReportCachePurgeByKey($CacheKey);
546  }
547  else
548  {
549  $V = ReportCacheGet($CacheKey);
550  }
551 
552  if (!empty($tagbucket))
553  {
554  $bucketagent_pk = GetParm("bapk",PARM_INTEGER);
555  $bucket_pk = GetParm("bpk",PARM_INTEGER);
556  $bucketpool_pk = GetParm("bp",PARM_INTEGER);
557  $nomosagent_pk = GetParm("napk",PARM_INTEGER);
558  $this->TagBucket($Upload, $Item, $bucketagent_pk, $bucket_pk, $bucketpool_pk, $nomosagent_pk);
559  }
560 
561  $Cached = !empty($V);
562  if(!$Cached)
563  {
564  $V .= "<font class='text'>\n";
565 
566  $Children = GetNonArtifactChildren($Item, $this->uploadtree_tablename);
567  if (count($Children) == 0) // no children, display View-Meta micromenu
568  $V .= Dir2Browse($this->Name,$Item,NULL,1,"View-Meta", -1, '', '', $this->uploadtree_tablename) . "<P />\n";
569  else // has children, display Browse micormenu
570  $V .= Dir2Browse($this->Name,$Item,NULL,1,"Browse", -1, '', '', $this->uploadtree_tablename) . "<P />\n";
571 
572  if (!empty($Upload))
573  {
574  $Uri = preg_replace("/&item=([0-9]*)/","",Traceback());
575  $V .= $this->ShowUploadHist($Item,$Uri);
576  }
577  $V .= "</font>\n";
578  $text = _("Loading...");
579  }
580 
581  $Time = microtime(true) - $uTime; // convert usecs to secs
582  $text = _("Elapsed time: %.2f seconds");
583  $V .= sprintf( "<p><small>$text</small>", $Time);
584 
585  if ($Cached){
586  $text = _("cached");
587  $text1 = _("Update");
588  echo " <i>$text</i> <a href=\"$_SERVER[REQUEST_URI]&updcache=1\"> $text1 </a>";
589  }
590  else if ($Time > 0.5)
591  {
592  ReportCachePut($CacheKey, $V);
593  }
594  return $V;
595  }
596 
597 }
598 
599 $NewPlugin = new ui_buckets;
600 $NewPlugin->Initialize();
FUNCTION char * GetUploadtreeTableName(PGconn *pgConn, int upload_pk)
Get the uploadtree table name for this upload_pk If upload_pk does not exist, return "uploadtree"...
Definition: libfossagent.c:421
TagBucket($upload_pk, $uploadtree_pk, $bucketagent_pk, $bucket_pk, $bucketpool_pk, $nomosagent_pk)
Tag a bucket.
Definition: ui-buckets.php:503
Dir2Browse($Mod, $UploadtreePk, $LinkLast=NULL, $ShowBox=1, $ShowMicro=NULL, $Enumerate=-1, $PreText='', $PostText='', $uploadtree_tablename="uploadtree")
Get an html linked string of a file browse path.
Definition: common-dir.php:274
RegisterMenus()
Customize submenus.
Definition: ui-buckets.php:108
Traceback_uri()
Get the URI without query to this location.
$uploadtree_tablename
Definition: ui-buckets.php:30
initBucketDefArray($bucketpool_pk)
Initializes array of bucket_def records.
GetPkgMimetypes()
Get package mimetype.
Definition: common-pkg.php:33
ShowUploadHist($Uploadtree_pk, $Uri)
Definition: ui-buckets.php:161
GetFileBuckets_string($nomosagent_pk, $bucketagent_pk, $uploadtree_pk, $bucketDefArray, $delimiter, $color)
Get string of $delimiter delimited bucket names for the given inputs. Args are same as GetFileBuckets...
ReportCachePut($CacheKey, $CacheValue)
This function is used to write a record to the report cache. If the record already exists...
int IsDir(char *Fname)
Given a filename, is it a directory?
Definition: utils.c:330
ActiveHTTPscript($RequestName, $IncludeScriptTags=1)
Given a function name, create the JavaScript needed for doing the request.
Iscontainer($mode)
Definition: common-dir.php:49
Install()
Create and configure database tables.
Definition: ui-buckets.php:46
#define PLUGIN_DB_READ
Plugin requires read permission on DB.
Definition: libfossology.h:49
FileListLinks($upload_fk, $uploadtree_pk, $napk, $pfile_pk, $Recurse=True, &$UniqueTagArray=array(), $uploadtree_tablename="uploadtree", $wantTags=true)
Get list of links: [View][Info][Download]
DirGetNonArtifact($UploadtreePk, $uploadtree_tablename='uploadtree')
Given an artifact directory (uploadtree_pk), return the first non-artifact directory (uploadtree_pk)...
Definition: common-dir.php:169
ReportCachePurgeByKey($CacheKey)
Purge from the report cache the record with $CacheKey.
Definition: state.hpp:26
GetParm($parameterName, $parameterType)
This function will retrieve the variables and check data types.
Definition: common-parm.php:57
const PARM_INTEGER
Definition: common-parm.php:25
char * uploadtree_tablename
upload.uploadtree_tablename
Definition: adj2nest.c:112
Isdir($mode)
Definition: common-dir.php:31
ReportCacheGet($CacheKey)
This function is used by Output() to see if the requested report is in the report cache...
This is the Plugin class. All plugins should:
Definition: FO_Plugin.php:67
SelectBucketDataset($upload_pk, &$ars_pk, $id="selectbucketdataset", $extra="")
Return a select list showing all the successful bucket runs on a particular $upload_pk.
foreach($Options as $Option=> $OptVal) if(0==$reference_flag &&0==$nomos_flag) $PG_CONN
DBCheckResult($result, $sql, $filenm, $lineno)
Check the postgres result for unexpected errors. If found, treat them as fatal.
Definition: common-db.php:198
Initialize()
This is called before the plugin is used. It should assume that Install() was already run one time (p...
Definition: ui-buckets.php:135
Traceback_parm_keep($List)
Create a new URI, keeping only these items.
GetArrayVal($Key, $Arr)
Get the value from a array(map)
Definition: common-ui.php:143
Output()
This function is called when user output is requested. This function is responsible for content...
Definition: FO_Plugin.php:407
Traceback()
Get the URI + query to this location.