Project

General

Profile

« Previous | Next » 

Revision a0e3ae5c

Added by Andreas Kohlbecker over 7 years ago

ref #6203 checked return types of classification services and updated documentation

View differences:

modules/cdm_dataportal/cdm_api/webservice_uris.php
76 76
 * stub: treenode_root
77 77
 */
78 78
define('CDM_WS_PORTAL_TAXONOMY', 'portal/classification');
79
/**
80
 * TODO: harmonize return type, the REST service should return TaxonNodeDto
81
 *
82
 * returns list of TaxonNode
83
 */
79 84
define('CDM_WS_PORTAL_TAXONOMY_CHILDNODES', 'portal/classification/$0/childNodes');
80
define('CDM_WS_PORTAL_TAXONOMY_CLASSIFICATION_ROOT_NODE', 'portal/classification/$0/classificationRootNode');
85
/**
86
 * returns list of TaxonNodeDto
87
 */
81 88
define('CDM_WS_PORTAL_TAXONOMY_CHILDNODES_AT_RANK', 'portal/classification/$0/childNodesAt/$1');
89
/**
90
 * returns list of TaxonNodeDto
91
 */
82 92
define('CDM_WS_PORTAL_TAXONOMY_CHILDNODES_OF_TAXON', 'portal/classification/$0/childNodesOf/$1');
93
/**
94
 * returns list of TaxonNodeDto
95
 */
83 96
define('CDM_WS_PORTAL_TAXONOMY_PATH_FROM', 'portal/classification/$0/pathFrom/$1');
97
/**
98
 * returns list of TaxonNodeDto
99
 */
84 100
define('CDM_WS_PORTAL_TAXONOMY_PATH_FROM_TO_RANK', 'portal/classification/$0/pathFrom/$1/toRank/$2');
85 101
define('CDM_WS_PORTAL_TAXONOMY_MEDIA', 'portal/classification/$0/$1');
86 102

  
modules/cdm_dataportal/cdm_dataportal.module
2091 2091

  
2092 2092

  
2093 2093
/**
2094
 * Creates a short taxonname.
2094
 * Creates a short version of a taxonname.
2095 2095
 *
2096 2096
 * The short name is created by using the taggedTitle field of
2097
 * NameSTO or NameTO instances.
2097
 * TaxonNodeDTO instances.
2098 2098
 * If the taggedTitle if empty the fullname will be returned.
2099 2099
 *
2100
 * @param unknown_type $name
2101
 *   Name or TreeNode.
2100
 * @param object $taxonNodeDTO
2101
 *   A TaxonNodeDTO object
2102 2102
 *
2103 2103
 * @return string
2104 2104
 */
2105
function cdm_dataportal_shortname_of($name) {
2105
function cdm_dataportal_shortname_of($taxonNodeDTO) {
2106

  
2106 2107
  $nameStr = '';
2107 2108

  
2108
  normalize_tagged_text($name->taggedTitle);
2109
  normalize_tagged_text($taxonNodeDTO->taggedTitle);
2109 2110

  
2110 2111
  // Get all tagged text tokens of the scientific name.
2111
  foreach ($name->taggedTitle as $tagtxt) {
2112
  foreach ($taxonNodeDTO->taggedTitle as $tagtxt) {
2112 2113
    if ($tagtxt->type == 'name' || $tagtxt->type == 'rank') {
2113 2114
      $nameStr .= ($nameStr ? ' ' : '') . $tagtxt->text;
2114 2115
    }
......
2118 2119
  if ($nameStr) {
2119 2120

  
2120 2121
    // Do not return short names for these.
2121
    if ($name->unplaced || $name->excluded) {
2122
    if ($taxonNodeDTO->unplaced || $taxonNodeDTO->excluded) {
2122 2123
      return $nameStr;
2123 2124
    }
2124 2125

  
......
2138 2139
    }
2139 2140
  }
2140 2141
  else {
2141
    return $name->titleCache;
2142
    return $taxonNodeDTO->titleCache;
2142 2143
  }
2143 2144
}
2144 2145

  
modules/cdm_dataportal/cdm_taxontree/cdm_taxontree.module
1157 1157
 *   Problem is, that the dependency is the other way round.
1158 1158
 * @param string $taxonUuid
1159 1159
 *
1160
 * @return unknown
1160
 * @return string
1161 1161
 */
1162 1162
function cdm_taxontree_view_filter($op, $taxonUuid = NULL) {
1163 1163

  

Also available in: Unified diff