Project

General

Profile

« Previous | Next » 

Revision 4c812e71

Added by Katja Luther almost 5 years ago

ref #8182: remove local server for blast ws and add collabsible rows in specimen table and blast result table

View differences:

modules/cdm_dataportal/cdm_dataportal.module
437 437
        // Expected callback arguments: uuid.
438 438
    );
439 439

  
440
    $items['cdm_dataportal/specimen/accession_number'] = array(
440
   $items['cdm_dataportal/specimen/accession_number'] = array(
441 441
        'page callback' => 'cdm_dataportal_specimen_by_accession_number_page_view',
442 442
        'access arguments' => array('access cdm content'),
443 443
        'type' => MENU_CALLBACK,
......
505 505
    'access arguments' => array('access cdm content'),
506 506
    'type' => MENU_DEFAULT_LOCAL_TASK,
507 507
  );
508
  if (variable_get(CDM_SEARCH_BLAST_ENABLED)) {
509
    $items['cdm_dataportal/search/blast'] = array(
510
        'title' => 'Blast', // will be passed through t()
511
        'page callback' => 'cdm_dataportal_view_search_blast',
512
        'access arguments' => array('access cdm content'),
513
        'type' => MENU_LOCAL_TASK,
514
    );
515
  }
508
  $items['cdm_dataportal/search/blast'] = array(
509
    'title' => 'Blast', // will be passed through t()
510
    'page callback' => 'cdm_dataportal_view_search_blast',
511
    'access arguments' => array('access cdm content'),
512
    'type' => MENU_LOCAL_TASK,
513
  );
514

  
516 515
  $items['cdm_dataportal/search/taxon_by_description'] = array(
517 516
    'title' => 'By content category', // will be passed through t()
518 517
    'page callback' => 'cdm_dataportal_view_search_taxon_by_description',
......
1603 1602
        $specimen_or_observation = cdm_ws_get(CDM_WS_OCCURRENCE_ACCESSION_NUMBER, null, 'accessionNumber=' . $accession_number);
1604 1603

  
1605 1604
        if (isset($specimen_or_observation) && $specimen_or_observation){
1606
            cdm_dataportal_specimen_page_view($specimen_or_observation->uuid, $specimen_or_observation);
1605

  
1606
            $nodes = cdm_dataportal_specimen_page_view($specimen_or_observation->uuid, $specimen_or_observation);
1607
            return $nodes;
1607 1608
        }
1608 1609

  
1609 1610
    }
......
1613 1614
 * @param string $uuid the UUID of the specimen
1614 1615
 * @return array|string
1615 1616
 */
1616
function cdm_dataportal_specimen_page_view($uuid) {
1617
function cdm_dataportal_specimen_page_view($uuid, $specimenDTO = null) {
1617 1618

  
1618 1619
    //cdm_check_valid_taxon_page($chapter);
1619 1620
    //cdm_dd("START OF TAXON PAGE [" . $chapter . "] " . $uuid . ' for ' . $_GET['q']);
......
1628 1629
    }
1629 1630

  
1630 1631
    // Display the page for the specimen defined by $uuid.
1631
    $specimenpage = cdm_dataportal_specimen_view($uuid);
1632
    if (isset($specimenDTO)){
1633
        //$specimenpage = compose_specimen_array($specimenDTO);
1634
        $dto_array = array($specimenDTO);
1635
        $specimen_array = compose_specimen_array($dto_array);
1636
        $specimen_table = array(
1637
            '#theme' => 'table',
1638
            '#weight' => 2,
1639
            // prefix attributes and rows with '#' to let it pass toF the theme function,
1640
            // otherwise it is handled as child render array
1641

  
1642
            '#attributes' => array('class' => 'specimens'),
1643
            '#rows' => array(),
1644
            '#prefix' => '<div id="specimens">',
1645
            '#suffix' => '</div>',
1646

  
1647

  
1648
        );
1649
        foreach($specimen_array as $value){
1650
            $renderArray = array(
1651
                '#theme' => 'item_list',
1652
                '#items' => array($value),
1653
                '#type' => 'ul');
1654
            $output = drupal_render($renderArray);
1655
//            $specimen_table['#rows'][] = array(
1656
//                // An array of table rows. collabsible row
1657
//                'data' => "",
1658
//                'class' => array('expand_column')
1659
//            );
1660
            $specimen_table['#rows'][] = array(
1661
                // An array of table rows. Every row is an array of cells, or an associative array
1662
                'data' => array($output),
1663
                'class' =>  array(
1664
                    'descriptionElement',
1665
                    'descriptionElement_IndividualsAssociation'
1666
                ),
1667
            );
1668

  
1669

  
1670
        }
1671
        $specimenpage = new stdClass();
1672

  
1673
        $specimenpage->title = theme('theme_cdm_specimen_dto_page_title', array(
1674
            'specimen' => $specimenDTO
1675
        ));
1676

  
1677
        $render_array['markup'] = $specimen_table;
1678

  
1679
//        $render_array['specimens'] = array(
1680
//            '#prefix' => '<div id="specimens" class="page-part">' . ($page_part == 'all' ? '<h2>' . t(cdm_taxonpage_tab_label('Specimens')) . '</h2>' : ''),
1681
//            'content' => $specimen_table, // returns render array
1682
//            '#suffix' => '</div>',
1683
//        );
1684
        $specimenpage->content = drupal_render($render_array);
1685
    }else{
1686
        $specimenpage = cdm_dataportal_specimen_view($uuid);
1687
    }
1688

  
1632 1689
    if (!empty($specimenpage)) {
1633 1690
        return cdm_node_show(NODETYPE_TAXON, $uuid, $specimenpage->title, $specimenpage->content);
1634 1691
    }
modules/cdm_dataportal/includes/occurrences.inc
474 474
                                $name_link = path_to_taxon($determinationEvent->taxon->uuid);
475 475
                            }
476 476
                            if ($taxon_name) {
477
                                $taxon_html = render_taxon_or_name($taxon_name, $name_link);
477
                                //$taxon_html = render_taxon_or_name($taxon_name, $name_link);
478

  
479
                                $taxon_html = l($taxon_name->titleCache, $name_link, array('attributes' => array('target' => '_blank')));
478 480
                                $dd_elements[$weight] = $taxon_html;
479 481
                            }
480 482
                            if (isset($determinationEvent->modifier)) {
modules/cdm_dataportal/js/table_modification.js
47 47
//    }
48 48
//    ,function(event){
49 49
//        jQuery(event.target).parent(".summary_row").css("background","");
50
//    })
50
//    })
51

  
52

  
modules/cdm_dataportal/settings.php
37 37
  define('CDM_DATAPORTAL_LAST_VISITED_TAB_ARRAY_INDEX', 999);
38 38
  define('CDM_DATAPORTAL_SPECIMEN_DERIVATE_TREE', 0);
39 39

  
40
  define('CDM_SEARCH_BLAST_SERVICE_URI', 'http://127.0.0.1:9001/api/sequence');
40
  define('CDM_SEARCH_BLAST_SERVICE_URI', 'http://130.133.70.28:9001/api/sequence');
41 41
  define('CDM_SEARCH_BLAST_ENABLED', 0);
42 42
  define('CDM_REGISTRATION_PRESISTENT_IDENTIFIER_AS_LINK', 'cdm_registration_presistent_identifier_as_link');
43 43

  

Also available in: Unified diff