1
|
<?php
|
2
|
// $Id$
|
3
|
|
4
|
/**
|
5
|
* @file
|
6
|
* Functions which are required or useful when accessing and processing CDM Data Store Webservices
|
7
|
*
|
8
|
* Naming conventions:
|
9
|
* ----------------------
|
10
|
*
|
11
|
* - all webservice access methods are prefixed with cdm_ws
|
12
|
*
|
13
|
*
|
14
|
* Copyright (C) 2007 EDIT
|
15
|
* European Distributed Institute of Taxonomy
|
16
|
* http://www.e-taxonomy.eu
|
17
|
*/
|
18
|
require_once ('xml2json.php');
|
19
|
require_once ('uuids.php');
|
20
|
|
21
|
|
22
|
|
23
|
/**
|
24
|
* Implementation of hook_requirements()
|
25
|
*/
|
26
|
function cdm_api_requirements() {
|
27
|
|
28
|
$requirements['cdm_api'] = array(
|
29
|
'title' => t('CDM API')
|
30
|
);
|
31
|
|
32
|
if( function_exists('curl_init') ){
|
33
|
$requirements['cdm_api']['description'] = ''; // description below title is not jet in use
|
34
|
$requirements['cdm_api']['value'] = 'CURL php extension is available.';
|
35
|
} else {
|
36
|
$requirements['cdm_api']['value'] = 'CURL php extension is missing.';
|
37
|
}
|
38
|
|
39
|
//FIXME: once _get_content_fsockopen is implemented change severity to REQUIREMENT_WARNING,
|
40
|
$requirements['cdm_api']['severity'] = (function_exists('curl_init') ? REQUIREMENT_OK : REQUIREMENT_ERROR);
|
41
|
|
42
|
return $requirements;
|
43
|
}
|
44
|
|
45
|
|
46
|
/**
|
47
|
* Implementation of hook_menu()
|
48
|
*/
|
49
|
function cdm_api_menu($may_cache) {
|
50
|
$items = array();
|
51
|
if ($may_cache) {
|
52
|
|
53
|
$items[] = array(
|
54
|
// usage: url('cdm_api/proxy/'.urlencode($content_url)."/$theme");
|
55
|
'path' => 'cdm_api/proxy',
|
56
|
'callback' => 'proxy_content',
|
57
|
'access' => true,
|
58
|
'type' => MENU_CALLBACK,
|
59
|
);
|
60
|
|
61
|
}
|
62
|
|
63
|
return $items;
|
64
|
}
|
65
|
|
66
|
function cdm_api_settings_form(){
|
67
|
|
68
|
$form['cdm_webservice'] = array(
|
69
|
'#type' => 'fieldset',
|
70
|
'#title' => t('CDM Web Service'),
|
71
|
'#collapsible' => FALSE,
|
72
|
'#collapsed' => FALSE,
|
73
|
);
|
74
|
|
75
|
$form['cdm_webservice']['cdm_webservice_url'] = array(
|
76
|
'#type' => 'textfield',
|
77
|
'#title' => t('CDM Web Service URL'),
|
78
|
'#description' => t('The URL of CDM Webservice which delivers the data to be published.'),
|
79
|
'#default_value' => variable_get('cdm_webservice_url', 'http://dev.e-taxonomy.eu/svn/trunk/drupal/modules/cdm_dataportal/cdm_api/ws_stub/'),
|
80
|
);
|
81
|
|
82
|
$form['cdm_webservice']['cdm_webservice_isStub'] = array(
|
83
|
'#type' => 'checkbox',
|
84
|
'#title' => t('Use Web Service Stub'),
|
85
|
'#default_value' => variable_get('cdm_webservice_isStub', 1),
|
86
|
'#description' => t('Use a static web service stub. Only for development. For further information please refer to the ')
|
87
|
.l('ws_stub/README.txt', 'http://dev.e-taxonomy.eu/svn/trunk/drupal/modules/cdm_dataportal/cdm/ws_stub/README.txt', array('target'=>'_blank')),
|
88
|
);
|
89
|
|
90
|
|
91
|
$form['cdm_webservice']['cdm_webservice_type'] = array(
|
92
|
'#type' => 'select',
|
93
|
'#title' => t('Web Service Type'),
|
94
|
'#default_value' => variable_get('cdm_webservice_type', 'json'),
|
95
|
'#options' => array(
|
96
|
'xml' => t('XML'),
|
97
|
'json' => t('JSON'),
|
98
|
),
|
99
|
'#description' => t('The response data type of the web service.'),
|
100
|
);
|
101
|
|
102
|
$form['cdm_webservice']['cdm_webservice_cache'] = array(
|
103
|
'#type' => 'checkbox',
|
104
|
'#title' => t('Enable Caching'),
|
105
|
'#default_value' => variable_get('cdm_webservice_cache', 1),
|
106
|
'#description' => t('Enable caching of webservice responses on simple requests, '
|
107
|
.'that is requests which only have one parameter generally a UUID or a concatenation of UUIDs')
|
108
|
);
|
109
|
|
110
|
$form['cdm_webservice']['proxy'] = array(
|
111
|
'#type' => 'fieldset',
|
112
|
'#title' => t('Proxy'),
|
113
|
'#collapsible' => TRUE,
|
114
|
'#collapsed' => TRUE
|
115
|
);
|
116
|
|
117
|
$form['cdm_webservice']['proxy']['cdm_webservice_proxy_url'] = array(
|
118
|
'#type' => 'textfield',
|
119
|
'#title' => t('Proxy URL'),
|
120
|
'#description' => t('If this proxy url is set the cdm api tries
|
121
|
to connect the web service over the given proxy server.
|
122
|
Otherwise proxy usage is deactivated.'),
|
123
|
'#default_value' => variable_get('cdm_webservice_proxy_url', false),
|
124
|
);
|
125
|
|
126
|
$form['cdm_webservice']['proxy']['cdm_webservice_proxy_port'] = array(
|
127
|
'#type' => 'textfield',
|
128
|
'#title' => t('Proxy Port'),
|
129
|
'#default_value' => variable_get('cdm_webservice_proxy_port', '80'),
|
130
|
);
|
131
|
|
132
|
$form['cdm_webservice']['proxy']['cdm_webservice_proxy_usr'] = array(
|
133
|
'#type' => 'textfield',
|
134
|
'#title' => t('Login'),
|
135
|
'#default_value' => variable_get('cdm_webservice_proxy_usr', false),
|
136
|
);
|
137
|
|
138
|
$form['cdm_webservice']['proxy']['cdm_webservice_proxy_pwd'] = array(
|
139
|
'#type' => 'textfield',
|
140
|
'#title' => t('Password'),
|
141
|
'#default_value' => variable_get('cdm_webservice_proxy_pwd', false),
|
142
|
);
|
143
|
|
144
|
$form['cdm_webservice']['cdm_webservice_debug'] = array(
|
145
|
'#type' => 'checkbox',
|
146
|
'#title' => t('Debug CDM Web Service'),
|
147
|
'#default_value' => variable_get('cdm_webservice_debug', 1),
|
148
|
'#description' => t('Enable CDM Web Service debugging messages')
|
149
|
);
|
150
|
return $form;
|
151
|
}
|
152
|
|
153
|
/**
|
154
|
* Implementation of hook_cron().
|
155
|
*
|
156
|
* Expire outdated cache entries
|
157
|
*/
|
158
|
function cdm_api_cron() {
|
159
|
cache_clear_all(NULL, 'cache_cdm_ws');
|
160
|
}
|
161
|
|
162
|
|
163
|
// ----------------------------------------------------------- //
|
164
|
|
165
|
|
166
|
/**
|
167
|
* Converts an array of TagedText items into a sequence of corresponding html tags whereas
|
168
|
* each item will provided with a class attribute which set to the key of the TaggedText item.
|
169
|
*
|
170
|
* @param array $taggedtxt
|
171
|
* @param String $tag
|
172
|
* @param String $glue the string by which the chained text tokens are concatenated together.
|
173
|
* Default is a blak character
|
174
|
* @return String of HTML
|
175
|
*/
|
176
|
function cdm_taggedtext2html(array &$taggedtxt, $tag = 'span', $glue = ' ', $skiptags = array()){
|
177
|
$out = '';
|
178
|
$i = 0;
|
179
|
foreach($taggedtxt as $tt){
|
180
|
if(!in_array($tt->type, $skiptags) && strlen($tt->text) > 0){
|
181
|
$out .= (strlen($out) > 0 && ++$i < count($taggedtxt)? $glue : '').'<'.$tag.' class="'.$tt->type.'">'.$tt->text.'</'.$tag.'>';
|
182
|
}
|
183
|
}
|
184
|
return $out;
|
185
|
}
|
186
|
|
187
|
/**
|
188
|
* Finds the text tagged with $$tag_type in an array of taggedText instances
|
189
|
*
|
190
|
* @param array $taggedtxt
|
191
|
* @param string $tag_type
|
192
|
* @return the text mapped by $tag_type or an empty string
|
193
|
*/
|
194
|
function cdm_taggedtext_value(array &$taggedtxt = array(), $tag_type){
|
195
|
foreach($taggedtxt as $tagtxt){
|
196
|
if($tagtxt->type == $tag_type)
|
197
|
return $tagtxt->text;
|
198
|
}
|
199
|
return '';
|
200
|
}
|
201
|
|
202
|
|
203
|
/**
|
204
|
* Produces a path to a static web service stub out of a cdm web service path.
|
205
|
* These stubs are object serialisations stored in files whereas the filename
|
206
|
* consists of the service name and of a
|
207
|
* encoded version of the request query parameters
|
208
|
*
|
209
|
* @param string $path
|
210
|
* @param string $fileExtension
|
211
|
* @return string
|
212
|
*/
|
213
|
function cdm_encode_stub($path, $fileExtension, $hasParams = false){
|
214
|
$path = str_replace('/',',',$path);
|
215
|
if($hasParams){
|
216
|
$path = str_replace('?',',',$path);
|
217
|
$path = str_replace('&',',',$path);
|
218
|
}
|
219
|
return variable_get('cdm_webservice_type', 'xml').'/'.$path.'.'.$fileExtension;
|
220
|
}
|
221
|
|
222
|
|
223
|
function cdm_compose_url($ws_name, $parameters = array()){
|
224
|
|
225
|
$request_params = '';
|
226
|
$path_params = '';
|
227
|
if(!is_array($parameters)){
|
228
|
// add to path
|
229
|
$path_params .= '/'.( is_string($parameters) ? urlencode($parameters) : $parameters);
|
230
|
}else{
|
231
|
foreach($parameters as $key=>$value){
|
232
|
if(is_numeric($key)){
|
233
|
// add to path
|
234
|
$path_params .= '/'.( is_string($value) ? urlencode($value) : $value);
|
235
|
} else {
|
236
|
// add to parameters
|
237
|
$request_params .= ( strlen($request_params) == 0 ? '?' : '&').$key.'='.( is_string($value) ? urlencode($value) : $value);
|
238
|
}
|
239
|
}
|
240
|
}
|
241
|
$path = $ws_name.$path_params.$request_params;
|
242
|
|
243
|
if(variable_get('cdm_webservice_isStub', 0)){
|
244
|
$path = cdm_encode_stub($path, variable_get('cdm_webservice_type', 'json'), strlen($request_params) > 0);
|
245
|
}
|
246
|
|
247
|
$url = variable_get('cdm_webservice_url', '').$path;
|
248
|
return $url;
|
249
|
}
|
250
|
|
251
|
|
252
|
function proxy_content($url, $theme = null){
|
253
|
$args = func_get_args();
|
254
|
|
255
|
$url = array_shift($args);
|
256
|
$theme = array_shift($args);
|
257
|
|
258
|
//TODO reconsider caching logic in this function
|
259
|
if(!$theme){
|
260
|
// print out JSON, the cache cannot be used since it contains objetcs
|
261
|
$data = get_content(urldecode($url));
|
262
|
print $data;
|
263
|
} else {
|
264
|
$obj = cdm_ws_load(urldecode($url), false);
|
265
|
array_unshift($args, $theme, $obj);
|
266
|
print call_user_func_array('theme', $args);
|
267
|
}
|
268
|
}
|
269
|
|
270
|
|
271
|
/**
|
272
|
* Enter description here...
|
273
|
*
|
274
|
* @param unknown_type $method
|
275
|
* @param $parameters may be an array or a single variable
|
276
|
* @return unknown
|
277
|
*/
|
278
|
function cdm_ws_get($method, $parameters = array()){
|
279
|
/*$args = func_get_args();
|
280
|
$method = array_shift($args);
|
281
|
*/
|
282
|
/*if(isset($args[0]) && is_array($args[0])){
|
283
|
$url = cdm_compose_url_parametrised($method, $args[0]);
|
284
|
} else {
|
285
|
*/
|
286
|
$url = cdm_compose_url($method, $parameters);
|
287
|
//}
|
288
|
return cdm_ws_load($url, (is_array($parameters)));
|
289
|
}
|
290
|
|
291
|
/**
|
292
|
* Loads the XML or JSON response for the given url from the CDM Data Store Webservice.
|
293
|
* The XML is turned into a object which is returned.
|
294
|
*
|
295
|
* @param String $url the relative url of the web service call.
|
296
|
* Relative means relative to the web service base url which is stored in cdm_webservice_url
|
297
|
* @return An object or false
|
298
|
*/
|
299
|
function cdm_ws_load($url, $is_multi_paramater_query){
|
300
|
|
301
|
$do_cache = !$is_multi_paramater_query && variable_get('cdm_webservice_cache', 0);
|
302
|
$cache_entry = false;
|
303
|
|
304
|
if($do_cache){
|
305
|
// try to get object from cache
|
306
|
$cache_entry = cache_get($url, 'cache_cdm_ws');
|
307
|
}
|
308
|
|
309
|
if(!$cache_entry){
|
310
|
// load fresh data from webservice
|
311
|
$time_get_start = microtime(true);
|
312
|
$datastr = get_content($url);
|
313
|
$time_get = microtime(true) - $time_get_start;
|
314
|
/*if(TRUE){
|
315
|
$storef = urlencode($url);
|
316
|
drupal_set_message($storef);
|
317
|
file_save_data($datastr, $storef, FILE_EXISTS_REPLACE);
|
318
|
}*/
|
319
|
|
320
|
$time_parse_start = microtime(true);
|
321
|
$obj = cdm_load_obj($datastr);
|
322
|
$time_parse = microtime(true) - $time_parse_start;
|
323
|
if(variable_get('cdm_webservice_debug', 1)){
|
324
|
drupal_set_message($url.' [fetched in: '.sprintf('%3.3f', $time_get).'s; parsed in '.sprintf('%3.3f', $time_parse).' s; size:'.sprintf('%3.1f', (strlen($datastr) / 1024)).' kb of '.($obj ? l('valid data', 'cdm_api/proxy/'.urlencode($url), array('target'=>'json-data')):'invalid data').'] '.$json_data_link, 'debug');
|
325
|
}
|
326
|
if( !$obj || !$datastr){
|
327
|
watchdog('CDM', 'cdm_ws_load() - URL: '.$url, WATCHDOG_ERROR);
|
328
|
} else if($do_cache) {
|
329
|
// store fresh data in cache
|
330
|
cache_set($url, 'cache_cdm_ws', serialize($obj), CACHE_TEMPORARY);
|
331
|
}
|
332
|
} else {
|
333
|
$obj = unserialize($cache_entry->data);
|
334
|
if(variable_get('cdm_webservice_debug', 1)){
|
335
|
drupal_set_message('Using cache for: '.$url, 'debug');
|
336
|
}
|
337
|
}
|
338
|
return $obj;
|
339
|
}
|
340
|
|
341
|
|
342
|
function cdm_load_obj($datastr){
|
343
|
|
344
|
// if the web service delivers XML convert it into json
|
345
|
if(variable_get('cdm_webservice_type', 'xml') == 'xml'){
|
346
|
$datastr = xml2json::transformXmlStringToJson($datastr);
|
347
|
}
|
348
|
$use_stub = variable_get('cdm_webservice_isStub', 0);
|
349
|
if($use_stub){
|
350
|
// --- for STUBS use the more syntax tolerant PEAR json lib --- //
|
351
|
$json_pear = new Services_JSON();
|
352
|
$obj = $json_pear->decode($datastr);
|
353
|
} else {
|
354
|
// --- generally use the fast php json lib --- //
|
355
|
$obj = json_decode($datastr);
|
356
|
}
|
357
|
|
358
|
if(!(is_object($obj) || is_array($obj)) || ($use_stub && !isset($obj->root)) ){
|
359
|
ob_start();
|
360
|
var_dump($obj);
|
361
|
$obj_dump = ob_get_contents();
|
362
|
ob_clean();
|
363
|
watchdog('CDM', 'cdm_load_obj() - invalid object: '.$obj_dump, WATCHDOG_ERROR);
|
364
|
return false;
|
365
|
}
|
366
|
|
367
|
if($use_stub){
|
368
|
$arr = (array)$obj;
|
369
|
$obj = array_pop($arr);
|
370
|
}
|
371
|
return $obj;
|
372
|
}
|
373
|
|
374
|
function get_content($url){
|
375
|
global $locale; // drupal variable containing the current locale i.e. language
|
376
|
static $header;
|
377
|
|
378
|
if(!$header){
|
379
|
$header = array();
|
380
|
$header[] = 'Accept: '.(variable_get('cdm_webservice_type', 'json') == 'json' ? 'application/json' : 'text/xml');
|
381
|
$header[] = 'Accept-Language: '.$locale;
|
382
|
$header[] = 'Accept-Encoding: UTF8';
|
383
|
}
|
384
|
|
385
|
if(function_exists('curl_init')){
|
386
|
|
387
|
// use the CURL lib if installed it is supposed to be 20x faster
|
388
|
return _get_content_curl($url, $header);
|
389
|
} else {
|
390
|
return _get_content_fsockopen($url, $header);
|
391
|
}
|
392
|
}
|
393
|
|
394
|
|
395
|
function _get_content_fsockopen($url, $header = array()){
|
396
|
//FIXME implement get_content_fsockopen($url);
|
397
|
watchdog('CDM_API', '_get_content_fsockopen - UNIMPLEMENTED', WATCHDOG_ERROR);
|
398
|
return false;
|
399
|
}
|
400
|
|
401
|
|
402
|
/**
|
403
|
* Return string content from a remote file
|
404
|
*
|
405
|
* @param string $url
|
406
|
* @return string
|
407
|
*
|
408
|
* @author Luiz Miguel Axcar (lmaxcar@yahoo.com.br)
|
409
|
*/
|
410
|
function _get_content_curl($url, $header = array())
|
411
|
{
|
412
|
$ch = curl_init();
|
413
|
|
414
|
curl_setopt ($ch, CURLOPT_URL, $url);
|
415
|
// set proxy settings
|
416
|
if(variable_get('cdm_webservice_proxy_url', false)){
|
417
|
curl_setopt($ch, CURLOPT_PROXY, variable_get('cdm_webservice_proxy_url', ''));
|
418
|
curl_setopt($ch, CURLOPT_PROXYPORT, variable_get('cdm_webservice_proxy_port', '80'));
|
419
|
if(variable_get('cdm_webservice_proxy_usr', false)){
|
420
|
curl_setopt ($ch, CURLOPT_PROXYUSERPWD, variable_get('cdm_webservice_proxy_usr', '').':'.variable_get('cdm_webservice_proxy_pwd', ''));
|
421
|
}
|
422
|
}
|
423
|
// set headers
|
424
|
curl_setopt ($ch, CURLOPT_HTTPHEADER, $header);
|
425
|
|
426
|
ob_start();
|
427
|
curl_exec ($ch);
|
428
|
if(curl_errno($ch)){
|
429
|
watchdog('CDM_API', '_get_content_curl() - '.curl_error($ch).' URL: '.$url, WATCHDOG_ERROR);
|
430
|
if(variable_get('cdm_webservice_debug', 1)){
|
431
|
drupal_set_message('_get_content_curl() - '.curl_error($ch).' URL: '.$url, 'error');
|
432
|
}
|
433
|
}
|
434
|
curl_close ($ch);
|
435
|
$string = ob_get_contents();
|
436
|
ob_end_clean();
|
437
|
|
438
|
return $string;
|
439
|
}
|
440
|
|
441
|
function cdm_api_secref_cache_prefetch(&$secUuids){
|
442
|
global $secref_cache;
|
443
|
if(!is_array($secref_cache)){
|
444
|
$secref_cache = array();
|
445
|
}
|
446
|
$uniqueUuids = array_unique($secUuids);
|
447
|
$i = 0;
|
448
|
$param = '';
|
449
|
while($i++ < count($uniqueUuids)){
|
450
|
$param .= $secUuids[$i].',';
|
451
|
if(strlen($param) + 37 > 2000){
|
452
|
_cdm_api_secref_cache_add($param);
|
453
|
$param = '';
|
454
|
}
|
455
|
}
|
456
|
if($param){
|
457
|
_cdm_api_secref_cache_add($param);
|
458
|
}
|
459
|
}
|
460
|
|
461
|
function cdm_api_secref_cache_get($secUuid){
|
462
|
global $secref_cache;
|
463
|
if(!is_array($secref_cache)){
|
464
|
$secref_cache = array();
|
465
|
}
|
466
|
if(!array_key_exists($secUuid, $secref_cache)){
|
467
|
_cdm_api_secref_cache_add($secUuid);
|
468
|
}
|
469
|
return $secref_cache[$secUuid];
|
470
|
}
|
471
|
|
472
|
function cdm_api_secref_cache_clear(){
|
473
|
global $secref_cache;
|
474
|
$secref_cache = array();
|
475
|
}
|
476
|
|
477
|
function _cdm_api_secref_cache_add($secUuidsStr){
|
478
|
global $secref_cache;
|
479
|
$refSTOs = cdm_ws_get(CDM_WS_SIMPLE_REFERENCE, $secUuidsStr);
|
480
|
$assocRefSTOs = array();
|
481
|
if($refSTOs) {
|
482
|
foreach($refSTOs as $ref){
|
483
|
$assocRefSTOs[$ref->uuid] = $ref;
|
484
|
}
|
485
|
$secref_cache = array_merge($secref_cache, $assocRefSTOs);
|
486
|
}
|
487
|
}
|
488
|
|
489
|
/**
|
490
|
* Web Service Arguments: {Uuid}
|
491
|
*
|
492
|
* The whatis service returns the type
|
493
|
* i.e. DTO class name and simplename & cdm class name and simplename of the instance referenced by the $uuid parameter.
|
494
|
*
|
495
|
* return: false if the cdm store contains no matching instance.
|
496
|
* An associative array with the following key-value pairs:
|
497
|
* - 'cdmName': name of the cdm class as returned by Class.getName(), e.g. eu.etaxonomy.cdm.model.taxon.Taxon
|
498
|
* - 'cdmSimpleName': simple name of the cdm class as returned by Class.getSimpleName(), e.g. Taxon
|
499
|
* - 'dtoName': name of the DTO class as returned by Class.getName(), e.g. eu.etaxonomy.cdm.dto.TaxonTO
|
500
|
* - 'dtoSimpleName': simple name of the TDO class as returned by Class.getSimpleName(), e.g. TaxonTO
|
501
|
*/
|
502
|
define('CDM_WS_WHATIS', 'whatis');
|
503
|
|
504
|
|
505
|
/**
|
506
|
* Web Service Arguments: {NameUuid}
|
507
|
*/
|
508
|
define('CDM_WS_NAME', 'name');
|
509
|
|
510
|
/**
|
511
|
* Web Service url parameters:
|
512
|
* - [last path element]: querystring
|
513
|
* - sec : the uuid of the concept reference
|
514
|
* - higherTaxa : list of taxon uuid, if higherTaxa are defined only taxa which are includet in one these taxa are taken in to account
|
515
|
* - matchAnywhere : false (default) match the querystring to the beginning of names, if set to true any matching substring is taken as a hit.
|
516
|
* - onlyAccepted : return only taxa which are accepted in the sence of the concept reference as given by parameter sec
|
517
|
* - pagesize : maximum number of iteme per result page
|
518
|
* - page: the number of page to be returned
|
519
|
*
|
520
|
* returns ResultPageSTO
|
521
|
*/
|
522
|
define('CDM_WS_FIND_TAXA', 'find/taxon');
|
523
|
|
524
|
/**
|
525
|
* Web Service Arguments: {referenceUuid}
|
526
|
*
|
527
|
*/
|
528
|
define('CDM_WS_REFERENCE', 'ref');
|
529
|
|
530
|
/**
|
531
|
* Web Service Arguments: {referenceUuid} or array of {referenceUuid}
|
532
|
*
|
533
|
* returns a list of ReferenceSTO
|
534
|
*/
|
535
|
define('CDM_WS_SIMPLE_REFERENCE', 'simple/ref');
|
536
|
|
537
|
/**
|
538
|
* Web Service Arguments: {taxonUuid}
|
539
|
*/
|
540
|
define('CDM_WS_TAXON', 'taxon');
|
541
|
|
542
|
|
543
|
/**
|
544
|
* Web Service Arguments: {taxonUuid} or array of {referenceUuid}
|
545
|
*
|
546
|
* returns a list of TaxonSTO
|
547
|
*/
|
548
|
define('CDM_WS_SIMPLE_TAXON', 'simple/taxon');
|
549
|
|
550
|
/**
|
551
|
* Web Service Arguments: {nameUuid}
|
552
|
*
|
553
|
* returns a set of type designation which are assigned to the name given
|
554
|
* as parameter. The Set may contain {@link NameTypeDesignationSTO}
|
555
|
* and {@link SpecimenTypeDesignationSTO}
|
556
|
*/
|
557
|
define('CDM_WS_TYPE_DESIGNATIONS', 'types');
|
558
|
|
559
|
/**
|
560
|
* Web Service Arguments: {taxonUuid}
|
561
|
*
|
562
|
* returns the taxon which is the accepted synonym for the taxon given as
|
563
|
* parameter taxonUuid. If the taxon specified by taxonUuid is itself the
|
564
|
* accepted taxon, this one will be returned.
|
565
|
*/
|
566
|
define('CDM_WS_ACCEPTED_TAXON', 'simple/taxon/acceptedfor');
|
567
|
|
568
|
/**
|
569
|
* Web Service Arguments: {secUuid}
|
570
|
*
|
571
|
* Gets the root nodes of the taxonomic concept tree for the concept
|
572
|
* reference specified by the secUuid parameter.
|
573
|
*
|
574
|
* stub: treenode_root
|
575
|
*/
|
576
|
define('CDM_WS_TREENODE_ROOT', 'taxonomy/root');
|
577
|
|
578
|
/**
|
579
|
* Web Service Arguments: {taxonUuid}
|
580
|
*
|
581
|
* Searches the concept taxon tree for all parent taxa by walking the tree
|
582
|
* from the taxon which is referenced by the parameter taxonUuid down to its
|
583
|
* root. The reference taxon will also be included into the returned set of
|
584
|
* TreeNode instances.
|
585
|
*
|
586
|
* stub: treenode_parents
|
587
|
*/
|
588
|
define('CDM_WS_TREENODE_PARENTS', 'taxonomy/parents');
|
589
|
|
590
|
/**
|
591
|
* Web Service Arguments: {taxonUuid}
|
592
|
*
|
593
|
* returns the children of the taxon referenced by the parameter
|
594
|
* taxonUuid.
|
595
|
*
|
596
|
* stub: treenode_children
|
597
|
*/
|
598
|
define('CDM_WS_TREENODE_CHILDREN', 'taxonomy/children');
|
599
|
|