tripal_organism.chado_node.inc 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  1. <?php
  2. /**
  3. * @file
  4. * Implements the organims node content type
  5. */
  6. /**
  7. * Implements hook_node_info().
  8. *
  9. * Provide information to drupal about the node types that we're creating
  10. * in this module
  11. *
  12. * @ingroup tripal_organism
  13. */
  14. function tripal_organism_node_info() {
  15. $nodes = array();
  16. $nodes['chado_organism'] = array(
  17. 'name' => t('Organism'),
  18. 'base' => 'chado_organism',
  19. 'description' => t('An organism'),
  20. 'has_title' => TRUE,
  21. 'locked' => TRUE,
  22. 'chado_node_api' => array(
  23. 'base_table' => 'organism',
  24. 'hook_prefix' => 'chado_organism',
  25. 'record_type_title' => array(
  26. 'singular' => t('Organism'),
  27. 'plural' => t('Organisms')
  28. ),
  29. 'sync_filters' => array(
  30. 'type_id' => FALSE,
  31. 'organism_id' => FALSE,
  32. 'checkboxes' => array('genus', 'species'),
  33. ),
  34. )
  35. );
  36. return $nodes;
  37. }
  38. /**
  39. * Implement hook_node_access().
  40. *
  41. * This hook allows node modules to limit access to the node types they define.
  42. *
  43. * @param $node
  44. * The node on which the operation is to be performed, or, if it does not yet exist, the
  45. * type of node to be created
  46. *
  47. * @param $op
  48. * The operation to be performed
  49. *
  50. *
  51. * @param $account
  52. * A user object representing the user for whom the operation is to be performed
  53. *
  54. * @return
  55. * If the permission for the specified operation is not set then return FALSE. If the
  56. * permission is set then return NULL as this allows other modules to disable
  57. * access. The only exception is when the $op == 'create'. We will always
  58. * return TRUE if the permission is set.
  59. *
  60. * @ingroup tripal_organism
  61. */
  62. function chado_organism_node_access($node, $op, $account) {
  63. $node_type = $node;
  64. if (is_object($node)) {
  65. $node_type = $node->type;
  66. }
  67. if($node_type == 'chado_organism') {
  68. if ($op == 'create') {
  69. if (!user_access('create chado_organism content', $account)) {
  70. return NODE_ACCESS_DENY;
  71. }
  72. return NODE_ACCESS_ALLOW;
  73. }
  74. if ($op == 'update') {
  75. if (!user_access('edit chado_organism content', $account)) {
  76. return NODE_ACCESS_DENY;
  77. }
  78. }
  79. if ($op == 'delete') {
  80. if (!user_access('delete chado_organism content', $account)) {
  81. return NODE_ACCESS_DENY;
  82. }
  83. }
  84. if ($op == 'view') {
  85. if (!user_access('access chado_organism content', $account)) {
  86. return NODE_ACCESS_DENY;
  87. }
  88. }
  89. return NODE_ACCESS_IGNORE;
  90. }
  91. }
  92. /**
  93. * Implement hook_form().
  94. *
  95. * When editing or creating a new node of type 'chado_organism' we need
  96. * a form. This function creates the form that will be used for this.
  97. *
  98. * @ingroup tripal_organism
  99. */
  100. function chado_organism_form($node, $form_state) {
  101. $form = array();
  102. // we have a file upload element on the form soe we need the multipart encoding type
  103. $form['#attributes']['enctype'] = 'multipart/form-data';
  104. // if the organism is part of the node object then we are editing. If not we are inserting
  105. if (property_exists($node, 'organism')) {
  106. $organism = $node->organism;
  107. // add in the comment since it is a text field and may not be included if too big
  108. $organism = chado_expand_var($organism, 'field', 'organism.comment');
  109. // get form defaults
  110. $abbreviation = property_exists($node, 'abbreviation') ? property_exists($node, 'abbreviation') : $organism->abbreviation;
  111. $genus = property_exists($node, 'genus') ? property_exists($node, 'genus') : $organism->genus;
  112. $species = property_exists($node, 'species') ? property_exists($node, 'species') : $organism->species;
  113. $common_name = property_exists($node, 'common_name') ? property_exists($node, 'common_name') : $organism->common_name;
  114. $description = property_exists($node, 'description') ? property_exists($node, 'description') : $organism->comment;
  115. $organism_image = property_exists($node, 'organism_image') ? property_exists($node, 'organism_image') : '';
  116. // set the organism_id in the form
  117. $form['organism_id'] = array(
  118. '#type' => 'value',
  119. '#value' => $organism->organism_id,
  120. );
  121. $organism_id = $organism->organism_id;
  122. }
  123. else {
  124. // get form defaults
  125. $abbreviation = property_exists($node, 'abbreviation') ? property_exists($node, 'abbreviation') : '';
  126. $genus = property_exists($node, 'genus') ? property_exists($node, 'genus') : '';
  127. $species = property_exists($node, 'species') ? property_exists($node, 'species') : '';
  128. $common_name = property_exists($node, 'common_name') ? property_exists($node, 'common_name') : '';
  129. $description = property_exists($node, 'description') ? property_exists($node, 'description') : '';
  130. $organism_image = property_exists($node, 'organism_image') ? property_exists($node, 'organism_image') : '';
  131. $organism_id = NULL;
  132. }
  133. $form['genus']= array(
  134. '#type' => 'textfield',
  135. '#title' => t('Genus'),
  136. '#required' => TRUE,
  137. '#default_value' => $genus,
  138. );
  139. $form['species']= array(
  140. '#type' => 'textfield',
  141. '#title' => t('Species'),
  142. '#required' => TRUE,
  143. '#default_value' => $species,
  144. );
  145. $form['abbreviation']= array(
  146. '#type' => 'textfield',
  147. '#title' => t('Abbreviation'),
  148. '#required' => TRUE,
  149. '#default_value' => $abbreviation,
  150. );
  151. $form['common_name']= array(
  152. '#type' => 'textfield',
  153. '#title' => t('Common Name'),
  154. '#required' => TRUE,
  155. '#default_value' => $common_name,
  156. );
  157. $form['description']= array(
  158. '#type' => 'textarea',
  159. '#rows' => 15,
  160. '#title' => t('Description'),
  161. '#default_value' => $description,
  162. );
  163. $form['organism_image']= array(
  164. '#type' => 'managed_file',
  165. '#title' => t('Organism Image'),
  166. '#description' => t('Add an image to display for this organism.'),
  167. '#progress_indicator' => 'bar',
  168. '#upload_location' => 'public://tripal/tripal_organism/images/',
  169. );
  170. // PROPERTIES FORM
  171. //---------------------------------------------
  172. $prop_cv = tripal_get_default_cv('organismprop', 'type_id');
  173. $cv_id = $prop_cv ? $prop_cv->cv_id : NULL;
  174. $details = array(
  175. 'property_table' => 'organismprop', // the name of the prop table
  176. 'chado_id' => $organism_id, // the value of organism_id for this record
  177. 'cv_id' => $cv_id // the cv.cv_id of the cv governing organismprop.type_id
  178. );
  179. // Adds the form elements to your current form
  180. chado_add_node_form_properties($form, $form_state, $details);
  181. // ADDITIONAL DBXREFS FORM
  182. //---------------------------------------------
  183. $details = array(
  184. 'linking_table' => 'organism_dbxref', // the name of the _dbxref table
  185. 'base_foreign_key' => 'organism_id', // the name of the key in your base chado table
  186. 'base_key_value' => $organism_id // the value of organism_id for this record
  187. );
  188. // Adds the form elements to your current form
  189. chado_add_node_form_dbxrefs($form, $form_state, $details);
  190. return $form;
  191. }
  192. /**
  193. * Implementation of hook_validate().
  194. *
  195. * @param $node
  196. * @param $form
  197. * @param $form_state
  198. *
  199. * @ingroup tripal_organism
  200. */
  201. function chado_organism_validate($node, $form, &$form_state) {
  202. // We only want to validate when the node is saved.
  203. // Since this validate can be called on AJAX and Deletion of the node
  204. // we need to make this check to ensure queries are not executed
  205. // without the proper values.
  206. if(property_exists($node, "op") and $node->op != 'Save') {
  207. return;
  208. }
  209. // we are syncing if we do not have a node ID but we do have a organism_id. We don't
  210. // need to validate during syncing so just skip it.
  211. if (!property_exists($node, 'nid') and property_exists($node, 'organism_id') and $node->organism_id != 0) {
  212. return;
  213. }
  214. // remove any white space around values
  215. $node->genus = property_exists($node, 'genus') ? trim($node->genus) : '';
  216. $node->species = property_exists($node, 'species') ? trim($node->species) : '';
  217. $node->abbreviation = property_exists($node, 'abbreviation') ? trim($node->abbreviation) : '';
  218. $node->common_name = property_exists($node, 'common_name') ? trim($node->common_name) : '';
  219. $node->description = property_exists($node, 'description') ? trim($node->description) : '';
  220. // Validating for an update
  221. if (property_exists($node, 'organism_id')) {
  222. $sql = "
  223. SELECT *
  224. FROM {organism} O
  225. WHERE
  226. genus = :genus AND
  227. species = :species AND NOT
  228. organism_id = :organism_id
  229. ";
  230. $args = array(':genus' => $node->genus, ':species' => $node->species, ':organism_id' => $node->organism_id);
  231. $result = chado_query($sql, $args)->fetchObject();
  232. if ($result) {
  233. form_set_error('genus', t("Update cannot proceed. The organism genus
  234. '$node->genus' and species '$node->species' is already present in the database."));
  235. tripal_report_error('tripal_organism', TRIPAL_WARNING,
  236. 'Update organism: genus and species already exists: %values',
  237. array('%values' => "genus = $node->genus, species = $node->species"));
  238. }
  239. }
  240. // Validating for an insert
  241. else {
  242. $values = array(
  243. 'genus' => $node->genus,
  244. 'species' => $node->species,
  245. );
  246. $organism = chado_select_record('organism', array('organism_id'), $values);
  247. if (sizeof($organism) > 0) {
  248. form_set_error('genus', 'Cannot add the organism with this genus and species.
  249. The organism already exists.');
  250. tripal_report_error('tripal_organism', TRIPAL_WARNING,
  251. 'Insert organism: genus and species already exists: %values',
  252. array('%values' => "genus = $node->genus, species = $node->species"));
  253. }
  254. }
  255. }
  256. /**
  257. * Implements hook_insert().
  258. *
  259. * When a new chado_organism node is created we also need to add information
  260. * to our chado_organism table. This function is called on insert of a new node
  261. * of type 'chado_organism' and inserts the necessary information.
  262. *
  263. * @ingroup tripal_organism
  264. */
  265. function chado_organism_insert($node) {
  266. $organism_id = '';
  267. // if there is an organism_id in the $node object then this must be a sync so
  268. // we can skip adding the organism as it is already there, although
  269. // we do need to proceed with insertion into the chado/drupal linking table.
  270. if (!property_exists($node, 'organism_id')) {
  271. // remove any white space around values
  272. $node->genus = trim($node->genus);
  273. $node->species = trim($node->species);
  274. $node->abbreviation = trim($node->abbreviation);
  275. $node->common_name = trim($node->common_name);
  276. $node->description = trim($node->description);
  277. $values = array(
  278. 'genus' => $node->genus,
  279. 'species' => $node->species,
  280. 'abbreviation' => $node->abbreviation,
  281. 'common_name' => $node->common_name,
  282. 'comment' => $node->description
  283. );
  284. $organism = chado_insert_record('organism', $values);
  285. if (!$organism) {
  286. drupal_set_message(t('Unable to add organism.', 'warning'));
  287. tripal_report_error('tripal_organism', TRIPAL_ERROR, 'Insert Organism: Unable to create organism where values:%values',
  288. array('%values' => print_r($values, TRUE)));
  289. return;
  290. }
  291. $organism_id = $organism['organism_id'];
  292. if ($organism_id) {
  293. // * Properties Form *
  294. $details = array(
  295. 'property_table' => 'organismprop', // the name of the prop table
  296. 'base_table' => 'organism', // the name of your chado base table
  297. 'foreignkey_name' => 'organism_id', // the name of the key in your base table
  298. 'foreignkey_value' => $organism_id // the value of the example_id key
  299. );
  300. chado_update_node_form_properties($node, $details);
  301. // * Additional DBxrefs Form *
  302. $details = array(
  303. 'linking_table' => 'organism_dbxref', // the name of your _dbxref table
  304. 'foreignkey_name' => 'organism_id', // the name of the key in your base table
  305. 'foreignkey_value' => $organism_id // the value of the organism_id key
  306. );
  307. chado_update_node_form_dbxrefs($node, $details);
  308. }
  309. }
  310. else {
  311. $organism_id = $node->organism_id;
  312. }
  313. // Make sure the entry for this organism doesn't already exist in the
  314. // chado_organism table if it doesn't exist then we want to add it.
  315. $check_org_id = chado_get_id_from_nid('organism', $node->nid);
  316. if (!$check_org_id) {
  317. $record = new stdClass();
  318. $record->nid = $node->nid;
  319. $record->vid = $node->vid;
  320. $record->organism_id = $organism_id;
  321. drupal_write_record('chado_organism', $record);
  322. }
  323. // add the image
  324. if (property_exists($node, 'organism_image')) {
  325. chado_organism_add_image($node);
  326. }
  327. }
  328. /**
  329. * Implements hook_update().
  330. *
  331. * @ingroup tripal_organism
  332. */
  333. function chado_organism_update($node) {
  334. // remove any white space around values
  335. $node->genus = trim($node->genus);
  336. $node->species = trim($node->species);
  337. $node->abbreviation = trim($node->abbreviation);
  338. $node->common_name = trim($node->common_name);
  339. $node->description = trim($node->description);
  340. $organism_id = chado_get_id_from_nid('organism', $node->nid);
  341. if ($node->revision) {
  342. // there is no way to handle revisions in Chado but leave
  343. // this here just to make not we've addressed it.
  344. }
  345. $match = array(
  346. 'organism_id' => $organism_id,
  347. );
  348. $values = array(
  349. 'genus' => $node->genus,
  350. 'species' => $node->species,
  351. 'abbreviation' => $node->abbreviation,
  352. 'common_name' => $node->common_name,
  353. 'comment' => $node->description
  354. );
  355. $org_status = chado_update_record('organism', $match, $values);
  356. if ( $node->organism_image != '' ) {
  357. chado_organism_add_image($node);
  358. }
  359. // * Properties Form *
  360. $details = array(
  361. 'property_table' => 'organismprop', // the name of the prop table
  362. 'base_table' => 'organism', // the name of your chado base table
  363. 'foreignkey_name' => 'organism_id', // the name of the key in your base table
  364. 'foreignkey_value' => $organism_id // the value of the example_id key
  365. );
  366. chado_update_node_form_properties($node, $details);
  367. // * Additional DBxrefs Form *
  368. $details = array(
  369. 'linking_table' => 'organism_dbxref', // the name of your _dbxref table
  370. 'foreignkey_name' => 'organism_id', // the name of the key in your base table
  371. 'foreignkey_value' => $organism_id // the value of the organism_id key
  372. );
  373. chado_update_node_form_dbxrefs($node, $details);
  374. }
  375. /**
  376. * Adds the image to the organism node and cleans up any old images.
  377. *
  378. * @param $node
  379. * The node object.
  380. */
  381. function chado_organism_add_image($node) {
  382. // If there is already an organism image, then remove it it if
  383. // no other modules are using it
  384. $fid = db_select('file_usage', 'fu')
  385. ->fields('fu', array('fid'))
  386. ->condition('module', 'tripal_organism')
  387. ->condition('type', 'organism_image')
  388. ->condition('id', $node->nid)
  389. ->execute()
  390. ->fetchField();
  391. if ($fid) {
  392. $file = file_load($fid);
  393. file_usage_delete($file, 'tripal_organism', 'organism_image', $node->nid);
  394. file_delete($file);
  395. }
  396. // Save the uploaded file
  397. $file = file_load($node->organism_image);
  398. if ($file) {
  399. $file->status = FILE_STATUS_PERMANENT;
  400. file_save($file);
  401. file_usage_add($file, 'tripal_organism', 'organism_image', $node->nid);
  402. }
  403. }
  404. /**
  405. * Implements hook_delete().
  406. *
  407. * Delete organism from both drupal and chado databases. Check dependency before
  408. * deleting from chado.
  409. *
  410. * @ingroup tripal_organism
  411. */
  412. function chado_organism_delete($node) {
  413. $organism_id = chado_get_id_from_nid('organism', $node->nid);
  414. // if we don't have an organism id for this node then this isn't a node of
  415. // type chado_organism or the entry in the chado_organism table was lost.
  416. if (!$organism_id) {
  417. return;
  418. }
  419. // Remove data from the {chado_organism}, {node}, and {node_revisions} tables
  420. $sql_del = "DELETE FROM {chado_organism} WHERE nid = :nid AND vid = :vid";
  421. db_query($sql_del, array(':nid' => $node->nid, ':vid' => $node->vid));
  422. $sql_del = "DELETE FROM {node} WHERE nid = :nid AND vid = :vid";
  423. db_query($sql_del, array(':nid' => $node->nid, ':vid' => $node->vid));
  424. $sql_del = "DELETE FROM {node_revision} WHERE nid = :nid AND vid = :vid";
  425. db_query($sql_del, array(':nid' => $node->nid, ':vid' => $node->vid));
  426. // Test dependency before deleting from chado database. If a library or
  427. // feature depends on this organism, don't delete it
  428. $sql = "SELECT feature_id FROM {feature} WHERE organism_id = :organism_id";
  429. $check_feature = chado_query($sql, array(':organism_id' => $organism_id))->fetchObject();
  430. $sql = "SELECT library_id FROM {library} WHERE organism_id = :organism_id";
  431. $check_lib = chado_query($sql, array(':organism_id' => $organism_id))->fetchObject();
  432. $sql = "SELECT stock_id FROM {stock} WHERE organism_id = :organism_id";
  433. $check_stock = chado_query($sql, array(':organism_id' => $organism_id))->fetchObject();
  434. if (!$check_lib && !$check_feature && !$check_stock) {
  435. chado_delete_record('organism', array('organism_id' => $organism_id));
  436. }
  437. else {
  438. drupal_set_message(t("Warning: other data depends on this organism. The organism page was removed from this site but the organism was removed from Chado."), 'warning');
  439. }
  440. }
  441. /**
  442. * Implements hook_load().
  443. *
  444. * When a node is requested by the user this function is called to allow us
  445. * to add auxiliary data to the node object.
  446. *
  447. * @ingroup tripal_organism
  448. */
  449. function chado_organism_load($nodes) {
  450. foreach ($nodes as $nid => $node) {
  451. // find the organism and add in the details
  452. $organism_id = chado_get_id_from_nid('organism', $nid);
  453. // if the nid does not have a matching record then skip this node.
  454. // this can happen with orphaned nodes.
  455. if (!$organism_id) {
  456. continue;
  457. }
  458. // build the organism variable
  459. $values = array('organism_id' => $organism_id);
  460. $organism = chado_generate_var('organism', $values);
  461. // add in the description field
  462. $organism = chado_expand_var($organism, 'field', 'organism.comment');
  463. $nodes[$nid]->organism = $organism;
  464. // Now get the title
  465. $node->title = chado_get_node_title($node);
  466. }
  467. }
  468. /**
  469. * Implements hook_node_presave(). Acts on all content types.
  470. *
  471. * @param $node
  472. * The node to be saved
  473. *
  474. * @ingroup tripal_organism
  475. */
  476. function tripal_organism_node_presave($node) {
  477. switch ($node->type) {
  478. // This step is for setting the title for the Drupal node. This title
  479. // is permanent and thus is created to be unique. Title changes provided
  480. // by tokens are generated on the fly dynamically, but the node title
  481. // seen in the content listing needs to be set here. Do not call
  482. // the chado_get_node_title() function here to set the title as the node
  483. // object isn't properly filled out and the function will fail.
  484. case 'chado_organism':
  485. // when syncing the details are not present in the $node object
  486. // as they are when submitted via the form. Therefore, if we do
  487. // not see any field values from the form, we assume this fucntion
  488. // is being called for syncing, so we must set the title accordingly
  489. if (property_exists($node, 'genus')) {
  490. $node->title = $node->genus . " " . $node->species;
  491. }
  492. else if (property_exists($node, 'organism')) {
  493. $node->title = $node->organism->genus . " " . $node->organism->species;
  494. }
  495. break;
  496. }
  497. }
  498. /**
  499. * Implements hook_node_view().
  500. *
  501. * @ingroup tripal_organism
  502. */
  503. function tripal_organism_node_view($node, $view_mode, $langcode) {
  504. switch ($node->type) {
  505. case 'chado_organism':
  506. // Show feature browser and counts
  507. if ($view_mode == 'full') {
  508. $node->content['tripal_organism_base'] = array(
  509. '#theme' => 'tripal_organism_base',
  510. '#node' => $node,
  511. '#tripal_toc_id' => 'base',
  512. '#tripal_toc_title' => 'Overview',
  513. '#weight' => -100,
  514. );
  515. $node->content['tripal_organism_properties'] = array(
  516. '#theme' => 'tripal_organism_properties',
  517. '#node' => $node,
  518. '#tripal_toc_id' => 'properties',
  519. '#tripal_toc_title' => 'Properties',
  520. );
  521. $node->content['tripal_organism_references'] = array(
  522. '#theme' => 'tripal_organism_references',
  523. '#node' => $node,
  524. '#tripal_toc_id' => 'references',
  525. '#tripal_toc_title' => 'Cross References',
  526. );
  527. }
  528. if ($view_mode == 'teaser') {
  529. $node->content['tripal_organism_teaser'] = array(
  530. '#theme' => 'tripal_organism_teaser',
  531. '#node' => $node,
  532. );
  533. }
  534. break;
  535. }
  536. }
  537. /**
  538. * Implements hook_node_insert().
  539. * Acts on all content types.
  540. *
  541. * @ingroup tripal_organism
  542. */
  543. function tripal_organism_node_insert($node) {
  544. switch ($node->type) {
  545. case 'chado_organism':
  546. // find the organism and add in the details
  547. $organism_id = chado_get_id_from_nid('organism', $node->nid);
  548. $values = array('organism_id' => $organism_id);
  549. $organism = chado_generate_var('organism', $values);
  550. $node->organism = $organism;
  551. // Now get the title
  552. $node->title = chado_get_node_title($node);
  553. // Now use the API to set the path.
  554. chado_set_node_url($node);
  555. break;
  556. }
  557. }
  558. /**
  559. * Implements hook_node_update().
  560. * Acts on all content types.
  561. *
  562. * @ingroup tripal_organism
  563. */
  564. function tripal_organism_node_update($node) {
  565. switch ($node->type) {
  566. case 'chado_organism':
  567. // Now get the title.
  568. $node->title = chado_get_node_title($node);
  569. // Now use the API to set the path.
  570. chado_set_node_url($node);
  571. break;
  572. }
  573. }
  574. /**
  575. * Implements [content_type]_chado_node_default_title_format().
  576. *
  577. * Defines a default title format for the Chado Node API to set the titles on
  578. * Chado organism nodes based on chado fields.
  579. */
  580. function chado_organism_chado_node_default_title_format() {
  581. return '[organism.genus] [organism.species]';
  582. }
  583. /**
  584. * Implements hook_chado_node_default_url_format().
  585. *
  586. * Designates a default URL format for organism nodes.
  587. */
  588. function chado_organism_chado_node_default_url_format() {
  589. return '/organism/[organism.genus]/[organism.species]';
  590. }