function component_row(Package $package, $indentation, TableCreator $table_creator)
{
    $ret = $table_creator->row(array($package->full_name(), $package->afferente(), $package->efferente(), round($package->instability(), 2)));
    $nested = $package->with('packages')->packages;
    foreach ($nested as $nuc) {
        $ret .= component_row($nuc, $indentation + 1, $table_creator);
    }
    return $ret;
}
function component_row(Package $package, $indentation, TableCreator $table_creator)
{
    $package->with('integration');
    $ret = $table_creator->row(array($package->full_name(), $package->integration == null ? 'Architettura del sistema' : $package->integration->public_id()));
    $nested = $package->with('packages')->packages;
    foreach ($nested as $nuc) {
        $ret .= component_row($nuc, $indentation + 1, $table_creator);
    }
    return $ret;
}
function test_row(ValidationTest $test, $indentation, TableCreator $table_creator)
{
    $test->with('test', 'requirement', 'children');
    $ret = "";
    $ret .= $table_creator->row(array($table_creator->child_indentation($indentation), $test->public_id(), $test->test->description, $test->requirement == null ? '' : $test->requirement->public_id(), 'success'));
    $nested = $test->children;
    foreach ($nested as $c) {
        $ret .= test_row($c, $indentation + 1, $table_creator);
    }
    return $ret;
}
function req_row(Requirement $req, $indentation, TableCreator $table_creator)
{
    $req->with('validationTest', 'requirements');
    $ret = "";
    $ret .= $table_creator->row(array($table_creator->child_indentation($indentation), $req->public_id(), $req->validationTest == null ? '' : $req->validationTest->public_id()));
    $nested = $req->requirements;
    foreach ($nested as $c) {
        $ret .= req_row($c, $indentation + 1, $table_creator);
    }
    return $ret;
}
Пример #5
0
function test_row(TUnitTest $test, TableCreator $table_creator)
{
    $methods = array();
    foreach ($test->methods as $meth) {
        $methods[] = $meth->name . "()";
    }
    if (!empty($methods)) {
        return $table_creator->row(array($test->public_id(), $test->description, implode($methods, "\n\n"), 'Success'));
    }
    return '';
}
function class_row(Class_Prog $class, TableCreator $table_creator)
{
    $ret = "";
    $pkg_name = array();
    foreach ($class->requirements as $c) {
        array_push($pkg_name, $c->public_id());
    }
    array_unique($pkg_name);
    sort($pkg_name);
    $cells = array($table_creator->anchor($class->full_name(), $class->name), implode("\n\n", $pkg_name));
    $ret .= $table_creator->row($cells);
    return $ret;
}
Пример #7
0
function test_row(Requirement $req, $indentation, TableCreator $table_creator, $filter_cat, $filter_pri)
{
    $test = $req->with('system_test')->system_test;
    $ret = "";
    if (isset($req->system_test) && (!is_numeric($filter_cat) || $req->category == $filter_cat) && (!is_numeric($filter_pri) || $req->priority == $filter_pri)) {
        $test->with('test');
        $ret .= $table_creator->row(array($test->public_id(), $test->test->description, 'success', $table_creator->anchor($req->public_id(), $req->public_id())));
    }
    $nested = $req->with('requirements')->requirements;
    foreach ($nested as $nreq) {
        $ret .= test_row($nreq, $indentation + 1, $table_creator, $filter_cat, $filter_pri);
    }
    return $ret;
}
Пример #8
0
 function install()
 {
     switch ($this->step) {
         case 1:
             if ($this->installFormVarsSet() && $this->connect()) {
                 // Ready to create tables
                 $tc = new TableCreator($this->connector->getConnection());
                 $tablesOk = $tc->createAll();
             } else {
                 // vars not yet set
                 // Don't go to step 2 yet.
             }
             break;
     }
 }
Пример #9
0
 static function performDNARNAFilter($con, $previousTable, $currentTable, $args)
 {
     if ($args == null || count($args) == 0) {
         return;
     } else {
         if (count($args) != 2) {
             REDLog::writeErrLog("Args for DNA-RNA Filter are incomplete, please have a check");
         }
     }
     TableCreator::createFilterTable($con, $previousTable, $currentTable);
     REDLog::writeInfoLog("Start performing DNA-RNA Filter");
     $dnaVcfTable = $args[0];
     $editingType = $args[1];
     $negativeType = REDTools::getNegativeStrandEditingType($editingType);
     try {
         $num1 = substr($editingType, 0, 1);
         $num2 = substr($negativeType, 0, 1);
         $sqlClause = "insert into {$currentTable} select * from {$previousTable} where exists (select chrom\nfrom {$dnaVcfTable} where ({$dnaVcfTable}.chrom={$previousTable}.chrom and {$dnaVcfTable}.pos={$previousTable}.pos and (\n{$dnaVcfTable}.ref='{$num1}' or {$dnaVcfTable}.ref='{$num2}')))";
         $v = mysqli_query($con, $sqlClause);
         if (!$v) {
             throw new Exception("Error execute sql clause in performDNARNAFilter");
         }
     } catch (Exception $e) {
         REDLog::writeErrLog($e->getMessage());
     }
     REDLog::writeInfoLog("End performing DNA-RNA Filter");
 }
Пример #10
0
function test_row(ValidationTest $test, TableCreator $table_creator)
{
    $test->with('children');
    if (!isset($test->children) || count($test->children) == 0) {
        return "";
    }
    $str = "\nAll'utente è richiesto di:\n";
    $str .= $table_creator->begin_list();
    foreach ($test->children as $child) {
        $child->with('test');
        $id = $child->public_id();
        $str .= $table_creator->list_item($table_creator->anchor($id, $child->test->description . " ({$id})"));
        $str .= test_row($child, $table_creator);
    }
    $str .= $table_creator->end_list();
    return $str;
}
Пример #11
0
 static function performLikelihoodRateFilter($con, $previousTable, $currentTable, $args)
 {
     if ($args == null || count($args) == 0) {
         return;
     } else {
         if (count($args) != 2) {
             REDLog::writeErrLog("Args for Likelihood Rate Test Filter are incomplete, please have a check");
         }
     }
     $dnaVcfTable = $args[0];
     $threshold = (double) $args[1];
     TableCreator::createFilterTable($con, $previousTable, $currentTable);
     REDLog::writeInfoLog("Start performing Likelihood Rate Test Filter");
     $sqlClause1 = "select {$previousTable}.chrom,{$previousTable}.pos,{$previousTable}.AD,\n{$dnaVcfTable}.qual from {$previousTable},{$dnaVcfTable} where {$previousTable}.chrom=\n{$dnaVcfTable}.chrom and {$previousTable}.pos={$dnaVcfTable}.pos";
     $rs = DatabaseManager::query1($con, $sqlClause1);
     $i = 0;
     while ($row = mysqli_fetch_array($rs)) {
         $chr = (string) $row[0];
         $pos = (int) $row[1];
         $ad = (string) $row[2];
         $qual = (double) $row[3];
         $pb = new SiteBean();
         $pb->SiteBean1($chr, $pos);
         $pb->setAd($ad);
         $pb->setQual($qual);
         $siteBeans[$i] = $pb;
         $i++;
     }
     DatabaseManager::setAutoCommit($con, false);
     $count = 0;
     for ($j = 0; $j < $i; $j++) {
         $str = $siteBeans[$j]->getAd();
         $section = explode("/", $str);
         $ref = (int) $section[0];
         $alt = (int) $section[1];
         if ($ref + $alt > 0) {
             $f_ml = 1.0 * $ref / ($ref + $alt);
             $y = pow($f_ml, $ref) * pow(1 - $f_ml, $alt);
             $y = log($y) / log(10.0);
             $judge = $y + $siteBeans[$j]->getQual() / 10.0;
             if ($judge >= $threshold) {
                 $siteChr = $siteBeans[$j]->getChr();
                 $sitePos = $siteBeans[$j]->getPos();
                 $sqlClause2 = "insert into {$currentTable} select * from {$previousTable} where chrom='" . $siteChr . "' and pos=" . $sitePos;
                 DatabaseManager::insertClause($con, $sqlClause2);
                 if (++$count % 10000 == 0) {
                     DatabaseManager::commit($con);
                 }
             }
         }
     }
     DatabaseManager::commit($con);
     DatabaseManager::setAutoCommit($con, true);
     REDLog::writeInfoLog("End performing Likelihood Rate Test Filter");
 }
Пример #12
0
function test_row(Requirement $req, $indentation, TableCreator $table_creator, $filter_cat, $filter_pri)
{
    $test = $req->with('system_test')->system_test;
    $validation = $req->with('validation0')->validation0;
    $ret = "";
    $rv = '';
    if (isset($test)) {
        $rv = $test->public_id();
    } else {
        if (isset($validation)) {
            $rv = $validation->name;
        }
    }
    $ret .= $table_creator->row(array($table_creator->child_indentation($indentation), $req->public_id(), $rv));
    $nested = $req->with('requirements')->requirements;
    foreach ($nested as $nreq) {
        $ret .= test_row($nreq, $indentation + 1, $table_creator, $filter_cat, $filter_pri);
    }
    return $ret;
}
Пример #13
0
 static function performQualityControlFilter($con, $previousTable, $currentTable, $args)
 {
     $COMMIT_COUNTS_PER_ONCE = 10000;
     if ($args == null || count($args) == 0) {
         return;
     } elseif (count($args) != 2) {
         REDLog::writeErrLog("Args for Quality Control Filter are incomplete, please have a check");
     }
     $quality = (double) $args[0];
     $depth = (int) $args[1];
     TableCreator::createFilterTable($con, $previousTable, $currentTable);
     REDLog::writeInfoLog("Start performing Quality Control Filter");
     try {
         $count = 0;
         $str = array("CHROM", "POS", "AD");
         $rs = DatabaseManager::query2($con, $previousTable, $str, null, null);
         $i = 0;
         while ($row = mysqli_fetch_array($rs)) {
             if ($row[2] != null) {
                 $siteBean = new SiteBean();
                 $siteBean->SiteBean1($row[0], $row[1]);
                 $siteBean->setAd($row[2]);
                 $siteBeans[$i] = $siteBean;
                 $i = $i + 1;
             }
         }
         DatabaseManager::setAutoCommit($con, false);
         for ($j = 0; $j < $i; $j++) {
             $str = $siteBeans[$j]->getAd();
             $section = explode("/", $str);
             $ref_n = (int) $section[0];
             $alt_n = (int) $section[1];
             $pos = $siteBeans[$j]->getPos();
             $chr = $siteBeans[$j]->getChr();
             if ($ref_n + $alt_n >= $depth) {
                 $sqlClause = "insert into " . $currentTable . " (select * from " . $previousTable . " where filter='PASS' and pos={$pos} and qual>=" . $quality . " and chrom='" . $chr . "')";
                 $v = mysqli_query($con, $sqlClause);
                 if (++$count % $COMMIT_COUNTS_PER_ONCE == 0) {
                     DatabaseManager::commit($con);
                 }
             }
         }
         DatabaseManager::commit($con);
         DatabaseManager::setAutoCommit($con, true);
         if (!$v) {
             throw new Exception("Error execute sql clause in QualityControlFilter:performFilter()");
         }
     } catch (Exception $e) {
         REDLog::writeErrLog($e->getMessage());
     }
     REDLog::writeInfoLog("End performing Quality Control Filter");
 }
function requirement_row($req, $indentation, TableCreator $table_creator, $filter_cat, $filter_pri)
{
    $ret = "";
    if ((!is_numeric($filter_cat) || $req->category == $filter_cat) && (!is_numeric($filter_pri) || $req->priority == $filter_pri)) {
        $source_desc = array();
        foreach ($req->sources as $rc) {
            $rc->with('useCase', 'externalSource');
            if (isset($rc->useCase)) {
                array_push($source_desc, $table_creator->link($rc->useCase->public_id(), $rc->useCase->public_id()));
            } else {
                array_push($source_desc, $rc->externalSource->description);
            }
        }
        sort($source_desc);
        $cells = array($table_creator->child_indentation($indentation), $req->public_id(), implode("\n\n", $source_desc));
        $ret .= $table_creator->row($cells);
    }
    $nested = $req->with('sources')->findAll("t.parent=:parent", array(':parent' => $req->id_requirement));
    foreach ($nested as $nreq) {
        $ret .= requirement_row($nreq, $indentation + 1, $table_creator, $filter_cat, $filter_pri);
    }
    return $ret;
}
Пример #15
0
 static function performKnownSNPFilter($con, $previousTable, $currentTable, $args)
 {
     REDLog::writeInfoLog("Start performing Known SNP Filter");
     TableCreator::createFilterTable($con, $previousTable, $currentTable);
     $dbSnpTable = "dbsnp_database";
     try {
         $sqlClause = "insert into {$currentTable} select * from {$previousTable} where not exists (select chrom from\n{$dbSnpTable} where ({$dbSnpTable}.chrom={$previousTable}.chrom and {$dbSnpTable}.pos={$previousTable}.pos))";
         $v = mysqli_query($con, $sqlClause);
         if (!$v) {
             throw new Exception("Error execute sql clause in performKnownSNPFilter");
         }
     } catch (Exception $e) {
         REDLog::writeErrLog($e->getMessage());
     }
     REDLog::writeInfoLog("End performing Known SNP Filter");
 }
function src_row($uc, $indentation, TableCreator $table_creator)
{
    $req_id = array();
    $uc->with('idUseCase');
    $uc->idUseCase->with('requirements');
    foreach ($uc->idUseCase->requirements as $rq) {
        array_push($req_id, $table_creator->link($rq->public_id(), $rq->public_id()));
    }
    $cells = array($table_creator->child_indentation($indentation), $table_creator->link($uc->public_id(), $uc->public_id()), $table_creator->link($uc->public_id(), $uc->title), implode("\n\n", $req_id));
    $ret = $table_creator->row($cells);
    $nested = UseCase::model()->findAll("t.parent = :parent", array(':parent' => $uc->id_use_case));
    foreach ($nested as $nuc) {
        $ret .= src_row($nuc, $indentation + 1, $table_creator);
    }
    return $ret;
}
function component_row(Package $component, $indentation, TableCreator $table_creator)
{
    $req_id = array();
    $component->with('requirements');
    foreach ($component->requirements as $rq) {
        array_push($req_id, $table_creator->link($rq->public_id(), $rq->public_id()));
    }
    array_unique($req_id);
    $cells = array($table_creator->child_indentation($indentation), $table_creator->link($component->full_name(), $component->full_name("::\\-")), implode("\n\n", $req_id));
    $ret = $table_creator->row($cells);
    $nested = $component->with('packages')->packages;
    foreach ($nested as $nuc) {
        $ret .= component_row($nuc, $indentation + 1, $table_creator);
    }
    return $ret;
}
Пример #18
0
 static function performRepeatRegionsFilter($con, $previousTable, $currentTable, $args)
 {
     TableCreator::createFilterTable($con, $previousTable, $currentTable);
     REDLog::writeInfoLog("Start performing Repeat Regions Filter");
     $repeatTable = "repeat_masker";
     try {
         $sqlClause1 = "insert into " . $currentTable . " select * from " . $previousTable . " where not exists (select * from " . $repeatTable . " where (" . $repeatTable . ".chrom= " . $previousTable . ".chrom and  " . $repeatTable . ".begin<=" . $previousTable . ".pos and " . $repeatTable . ".end>=" . $previousTable . ".pos)) ";
         $a = mysqli_query($con, $sqlClause1);
         if (!$a) {
             throw new Exception("Error execute sqlA clause in performRepeatRegionsFilter");
         }
         REDLog::writeInfoLog("Start finding sites in Alu Regions");
         $tempTable = REDTools::getRandomString(10);
         $sqlClause2 = "create temporary table {$tempTable} like {$currentTable}";
         $b = mysqli_query($con, $sqlClause2);
         if (!$b) {
             throw new Exception("Error execute sqlB clause in performRepeatRegionsFilter");
         }
         $sqlClause3 = "insert into  {$tempTable} select * from {$previousTable} where exists (select chrom from {$repeatTable}\nwhere {$repeatTable}.chrom = {$previousTable}.chrom and {$repeatTable}.begin<={$previousTable}.pos and\n{$repeatTable}.end>={$previousTable}.pos and {$repeatTable}.type='SINE/Alu')";
         $c = mysqli_query($con, $sqlClause3);
         if (!$c) {
             throw new Exception("Error execute sqlC clause in performRepeatRegionsFilter");
         }
         $sqlClause4 = "update {$tempTable} set alu='T'";
         $d = mysqli_query($con, $sqlClause4);
         if (!$d) {
             throw new Exception("Error execute sqlD clause in performRepeatRegionsFilter");
         }
         $sqlClause5 = "insert into {$currentTable} select * from {$tempTable}";
         $e = mysqli_query($con, $sqlClause5);
         if (!$e) {
             throw new Exception("Error execute sqlE clause in performRepeatRegionsFilter");
         }
         DatabaseManager::deleteTable($con, $tempTable);
         REDLog::writeInfoLog("End finding sites in Alu Regions");
     } catch (Exception $e) {
         REDLog::writeErrLog($e->getMessage());
     }
     REDLog::writeInfoLog("End performing Repeat Regions Filter");
 }
Пример #19
0
 static function performEditingTypeFilter($con, $previousTable, $currentTable, $args)
 {
     REDLog::writeInfoLog('Star executing Editing Type Filter');
     TableCreator::createFilterTable($con, $previousTable, $currentTable);
     $refAlt = $args;
     $refAlt2 = REDTools::getNegativeStrandEditingType($refAlt);
     $sql11 = substr($refAlt, 0, 1);
     $sql12 = substr($refAlt, 1);
     $sql21 = substr($refAlt2, 0, 1);
     $sql22 = substr($refAlt2, 1);
     $sql1 = "insert into " . $currentTable . " select * from " . $previousTable . " WHERE REF='{$sql11}' AND ALT='{$sql12}' AND GT!='0/0'";
     $v = DatabaseManager::insertClause($con, $sql1);
     if (!$v) {
         REDLog::writeErrLog('There is a syntax error for SQL clause:' . $sql1);
     }
     $sql2 = "insert into " . $currentTable . " select * from " . $previousTable . " WHERE REF='{$sql21}' AND ALT='{$sql22}' AND GT!='0/0'";
     $v = DatabaseManager::insertClause($con, $sql2);
     if (!$v) {
         REDLog::writeErrLog('There is a syntax error for SQL clause:' . $sql2);
     }
     REDLog::writeInfoLog('End executing Editing Type Filter');
 }
Пример #20
0
 static function createDBSNPTable($con, $tableName)
 {
     try {
         $tableLists = DatabaseManager::getCurrentTables($con, self::$dbName);
         $v = in_array($tableName, $tableLists);
         if (!$v) {
             $rs = false;
         } else {
             $rs = true;
         }
         if (!$rs) {
             $columnName = array("chrom", "pos");
             $columnParams = array("varchar(30)", "int");
             $index = "index(chrom,pos)";
             $a = TableCreator::createReferenceTable($con, $tableName, $columnName, $columnParams, $index);
             if (!$a) {
                 throw new Exception("Error create dbSNP table");
             }
         }
     } catch (Exception $e) {
         REDLog::writeErrLog($e->getMessage());
     }
 }
Пример #21
0
 static function createRefSeqGeneTable($con, $tableName)
 {
     try {
         $tableLists = DatabaseManager::getCurrentTables($con, self::$dbName);
         $v = in_array($tableName, $tableLists);
         if (!$v) {
             $rs = false;
         } else {
             $rs = true;
         }
         if (!$rs) {
             $columnName = array("bin", "name", "chrom", "strand", "txStart", "txEnd", "cdsStart", "cdsEnd", "exonCount", "exonStarts", "exonEnds", "score", "name2", "cdsStartStat", "cdsEndStat", "exonFrames");
             $columnParams = array("int", "varchar(255)", "varchar(255)", "varchar(1)", "int", "int", "int", "int", "int", "longblob", "longblob", "int", "varchar(255)", "varchar(8)", "varchar(8)", "longblob");
             $index = "index(chrom,txStart,txEnd)";
             $a = TableCreator::createReferenceTable($con, $tableName, $columnName, $columnParams, $index);
             if (!$a) {
                 throw new Exception("Error create RefSeqGene table");
             }
         }
     } catch (Exception $e) {
         REDLog::writeErrLog($e->getMessage());
     }
 }
Пример #22
0
 static function createSpliceJunctionTable($con, $tableName)
 {
     try {
         $tableLists = DatabaseManager::getCurrentTables($con, self::$dbName);
         $v = in_array($tableName, $tableLists);
         if (!$v) {
             $rs = false;
         } else {
             $rs = true;
         }
         if (!$rs) {
             //existTable($tableName)
             $columnName = array("chrom", "ref", "type", "begin", "end", "score", "strand", "frame", "info");
             $columnParams = array("varchar(30)", "varchar(30)", "varchar(10)", "int", "int", "float(8,6)", "varchar(1)", "varchar(1)", "varchar(100)");
             $index = "index(chrom,type)";
             $v = TableCreator::createReferenceTable($con, $tableName, $columnName, $columnParams, $index);
             if (!$v) {
                 throw new Exception("Error create Splice Junction table");
             }
         }
     } catch (Exception $e) {
         REDLog::writeErrLog($e->getMessage());
     }
 }
Пример #23
0
 static function createRepeatRegionsTable($con, $tableName)
 {
     try {
         $tableLists = DatabaseManager::getCurrentTables($con, self::$dbName);
         $v = in_array($tableName, $tableLists);
         if (!$v) {
             $rs = false;
         } else {
             $rs = true;
         }
         if (!$rs) {
             //existTable($tableName)
             $columnName = array("chrom", "begin", "end", "type");
             $columnParams = array("varchar(30)", "int", "int", "varchar(40)");
             $index = "index(chrom,begin,end)";
             $v = TableCreator::createReferenceTable($con, $tableName, $columnName, $columnParams, $index);
             if (!$v) {
                 throw new Exception("Error create repeat regions table");
             }
         }
     } catch (Exception $e) {
         REDLog::writeErrLog($e->getMessage());
     }
 }
Пример #24
0
 static function performSpliceJunctionFilter($con, $previousTable, $currentTable, $args)
 {
     if ($args == null || $args == 0) {
         return;
     } else {
         if (count($args) != 1) {
             REDLog::writeErrLog("Args for Splice Junction Filter are incomplete, please have a check");
         }
     }
     TableCreator::createFilterTable($con, $previousTable, $currentTable);
     REDLog::writeInfoLog("Start performing Splice Junction Filter...");
     $spliceJunctionTable = "splice_junction";
     $edge = (int) $args[0];
     try {
         $sqlClause = "insert into {$currentTable} select * from {$previousTable} where not exists (select chrom from\n{$spliceJunctionTable} where ({$spliceJunctionTable}.type='CDS' and {$spliceJunctionTable}.chrom={$previousTable}.chrom\nand (({$spliceJunctionTable}.begin<{$previousTable}.pos+{$edge} and {$spliceJunctionTable}.begin>{$previousTable}.pos-{$edge})\nor ({$spliceJunctionTable}.end<{$previousTable}.pos+{$edge} and {$spliceJunctionTable}.end>{$previousTable}.pos-{$edge}))))";
         $v = mysqli_query($con, $sqlClause);
         if (!$v) {
             throw new Exception("Error execute sql clause in performSpliceJunctionFilter");
         }
     } catch (Exception $e) {
         REDLog::writeErrLog($e->getMessage());
     }
     REDLog::writeInfoLog("End performing Splice Junction Filter...");
 }
Пример #25
0
function display_package(Package $pack, $indentation, TableCreator $table_creator)
{
    $txt = "";
    /*$name = $pack->full_name("::");
      if ( !$pack->virtual )
      {
          $txt .= $table_creator->anchor($name,'')."\n";
          $txt .= $table_creator->title(2,$name);
          $txt .= $pack->description."\n\n";
      }*/
    if ($indentation == 1) {
        $txt .= $table_creator->title(2, $pack->name);
    }
    //else if ( $indentation == 2 )
    //    $txt .= $table_creator->title(3,$pack->name);
    $pack->with('classes', 'packages');
    foreach ($pack->classes as $c) {
        $txt .= display_class($c, $table_creator);
    }
    foreach ($pack->packages as $p) {
        $txt .= display_package($p, $indentation + 1, $table_creator);
    }
    return $txt;
}
function requirement_row($req, $indentation, TableCreator $table_creator, $filter_cat, $filter_pri)
{
    $ret = "";
    if ((!is_numeric($filter_cat) || $req->category == $filter_cat) && (!is_numeric($filter_pri) || $req->priority == $filter_pri)) {
        $pkg_name = array();
        foreach ($req->classes as $c) {
            array_push($pkg_name, $table_creator->link($c->full_name(), $c->name));
        }
        array_unique($pkg_name);
        sort($pkg_name);
        $cells = array($table_creator->child_indentation($indentation), $table_creator->link($req->public_id(), $req->public_id()), implode("\n\n", $pkg_name));
        $ret .= $table_creator->row($cells);
    }
    $nested = Requirement::model()->with('classes')->findAll("t.parent=:parent", array(':parent' => $req->id_requirement));
    foreach ($nested as $nreq) {
        $ret .= requirement_row($nreq, $indentation + 1, $table_creator, $filter_cat, $filter_pri);
    }
    return $ret;
}
Пример #27
0
function test_row(UnitTest $test, $indentation, TableCreator $table_creator)
{
    return $table_creator->row(array($table_creator->child_indentation($indentation), $test->public_id(), $test->test->description, $test->method->name . "()", 'success'));
}
Пример #28
0
function display_class(Class_Prog $class, TableCreator $table_creator)
{
    $txt = "";
    if (!$class->library) {
        $id = $class->full_name();
        $name = $class->full_name(" :: ");
        $txt .= $table_creator->anchor($id, '') . "\n";
        $txt .= $table_creator->title(4, $name, $class->name);
        $txt .= $table_creator->begin_desc_list();
        $txt .= $table_creator->desc_list_item('Descrizione', $class->description);
        if (strlen(trim($class->usage)) > 0) {
            $txt .= $table_creator->desc_list_item('Utilizzo', $class->usage);
        }
        $class->with('children', 'parents');
        if (count($class->parents)) {
            $inh_txt = '';
            $inh_txt .= "\\vspace{-7mm}\n";
            $inh_txt .= $table_creator->begin_list();
            foreach ($class->parents as $par) {
                if (!$par->library) {
                    $inh_txt .= $table_creator->list_item($table_creator->link($par->full_name(), $par->full_name(" :: ")));
                } else {
                    $inh_txt .= $table_creator->list_item($par->full_name());
                }
            }
            $inh_txt .= $table_creator->end_list();
            $txt .= $table_creator->desc_list_item('Classi ereditate', $inh_txt);
        }
        if (count($class->children)) {
            $inh_txt = '';
            $inh_txt .= "\\vspace{-7mm}\n";
            $inh_txt .= $table_creator->begin_list();
            foreach ($class->children as $par) {
                $inh_txt .= $table_creator->list_item($table_creator->link($par->full_name(), $par->full_name(" :: ")));
            }
            $inh_txt .= $table_creator->end_list();
            $txt .= $table_creator->desc_list_item('Classi figlie', $inh_txt);
        }
        $ass = Association::model()->findAll('class_from = :idc or class_to = :idc', array(':idc' => $class->id_class));
        if (count($ass)) {
            $rel = '';
            $rel .= "\\vspace{-7mm}\n";
            $rel .= $table_creator->begin_desc_list();
            foreach ($ass as $ss) {
                if ($ss->class_to != $class->id_class) {
                    $par = $ss->with('classTo')->classTo;
                    $ass_dir = "uscente";
                } else {
                    if ($ss->class_from != $class->id_class) {
                        $par = $ss->with('classFrom')->classFrom;
                        $ass_dir = "entrante";
                    } else {
                        continue;
                    }
                }
                $ss->with('attribute');
                if (!$par->library) {
                    $acn = $par->full_name();
                    if (strlen($acn) > 60) {
                        $acn = substr($acn, strlen($acn) - 60);
                        $acn = "..." . substr($acn, strpos($acn, "::") + 2);
                    }
                    $ass_name = $table_creator->link($par->full_name(), $acn);
                } else {
                    $ass_name = $par->full_name();
                }
                $ass_txt = "Relazione {$ass_dir}, " . lcfirst($ss->attribute->description);
                $rel .= $table_creator->desc_list_item($ass_name, $ass_txt);
            }
            $rel .= $table_creator->end_desc_list();
            $txt .= $table_creator->desc_list_item('Relazioni con altre classi', $rel);
        }
    }
    $txt .= $table_creator->end_desc_list();
    $txt .= "\n\\vspace{0.5cm}\n";
    return $txt;
}
Пример #29
0
function test_row(Method $meth, TableCreator $table_creator)
{
    $text = $meth->ttest != null ? $meth->ttest->unitTest->public_id() : '';
    return $table_creator->row(array(Class_Prog::model()->findByPK($meth->id_class)->name . "::" . $meth->name . "()", $text));
}
Пример #30
0
<?php

include '../database/DatabaseConnect.php';
include '../database/TableCreator.php';
include '../database/DatabaseManager.php';
include '../REDTools/REDLog.php';
$con = DatabaseConnect::mysqlConnect();
TableCreator::createFilterTable($con, 'users', 'test');
echo 'success';