tripal_featuremap.chado_node.inc 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. <?php
  2. /**
  3. * @file
  4. * Hooks implementing the feature map 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_featuremap
  13. */
  14. function tripal_featuremap_node_info() {
  15. $nodes = array();
  16. $nodes['chado_featuremap'] = array(
  17. 'name' => t('Feature Map'),
  18. 'base' => 'chado_featuremap',
  19. 'description' => t('A map of features from the chado database (e.g. genetic map)'),
  20. 'has_title' => TRUE,
  21. 'locked' => TRUE,
  22. 'chado_node_api' => array(
  23. 'base_table' => 'featuremap',
  24. 'hook_prefix' => 'chado_featuremap',
  25. 'record_type_title' => array(
  26. 'singular' => t('Feature Map'),
  27. 'plural' => t('Feature Maps')
  28. ),
  29. 'sync_filters' => array(
  30. 'type_id' => FALSE,
  31. 'organism_id' => FALSE
  32. ),
  33. )
  34. );
  35. return $nodes;
  36. }
  37. /**
  38. * When editing or creating a new node of type 'chado_featuremap' we need
  39. * a form. This function creates the form that will be used for this.
  40. *
  41. * @ingroup tripal_featuremap
  42. */
  43. function chado_featuremap_form($node, &$form_state) {
  44. $form = array();
  45. // Default values can come in the following ways:
  46. //
  47. // 1) as elements of the $node object. This occurs when editing an existing library
  48. // 2) in the $form_state['values'] array which occurs on a failed validation or
  49. // ajax callbacks from non submit form elements
  50. // 3) in the $form_state['input'[ array which occurs on ajax callbacks from submit
  51. // form elements and the form is being rebuilt
  52. //
  53. // set form field defaults
  54. $featuremap_id = NULL;
  55. $fmapname = '';
  56. $description = '';
  57. $unittype_id = '';
  58. // if we are editing an existing node then the featuremap is already part of the node
  59. if (property_exists($node, 'featuremap')) {
  60. $featuremap = $node->featuremap;
  61. $featuremap = chado_expand_var($featuremap, 'field', 'featuremap.description');
  62. $featuremap_id = $featuremap->featuremap_id;
  63. // get form defaults
  64. $fmapname = $featuremap->name;
  65. $description = $featuremap->description;
  66. $unittype_id = $featuremap->unittype_id->cvterm_id;
  67. // set the featuremap_id in the form
  68. $form['featuremap_id'] = array(
  69. '#type' => 'hidden',
  70. '#value' => $featuremap_id,
  71. );
  72. }
  73. // if we are re constructing the form from a failed validation or ajax callback
  74. // then use the $form_state['values'] values
  75. if (array_key_exists('values', $form_state)) {
  76. $fmapname = $form_state['values']['fmapname'];
  77. $description = $form_state['values']['description'];
  78. $unittype_id = $form_state['values']['unittype_id'];
  79. }
  80. // if we are re building the form from after submission (from ajax call) then
  81. // the values are in the $form_state['input'] array
  82. if (array_key_exists('input', $form_state) and !empty($form_state['input'])) {
  83. $fmapname = $form_state['input']['fmapname'];
  84. $description = $form_state['input']['description'];
  85. $unittype_id = $form_state['input']['unittype_id'];
  86. }
  87. $form['fmapname']= array(
  88. '#type' => 'textfield',
  89. '#title' => t('Map Name'),
  90. '#description' => t('Please enter a name for this map'),
  91. '#required' => TRUE,
  92. '#default_value' => $fmapname,
  93. '#maxlength' => 255
  94. );
  95. $form['description']= array(
  96. '#type' => 'textarea',
  97. '#title' => t('Map Description'),
  98. '#description' => t('A description of the map.'),
  99. '#required' => TRUE,
  100. '#default_value' => $description,
  101. );
  102. // get the list of unit types
  103. $units = tripal_get_cvterm_default_select_options('featuremap', 'unittype_id', 'map unit types');
  104. $form['unittype_id'] = array(
  105. '#title' => t('Map Units'),
  106. '#type' => t('select'),
  107. '#description' => t("Chose the units for this map"),
  108. '#required' => TRUE,
  109. '#default_value' => $unittype_id,
  110. '#options' => $units,
  111. );
  112. // Properties Form
  113. // ----------------------------------
  114. $prop_cv = tripal_get_default_cv('featuremap_property', 'type_id');
  115. $cv_id = $prop_cv ? $prop_cv->cv_id : NULL;
  116. $instructions = t('To add additional properties to the drop down. ' . l("Add terms to the featuremap_property vocabulary", "admin/tripal/chado/tripal_cv/cvterm/add") . ".");
  117. $details = array(
  118. 'property_table' => 'featuremapprop',
  119. 'chado_id' => $featuremap_id,
  120. 'cv_id' => $cv_id,
  121. 'fieldset_name' => 'Additional Details',
  122. 'additional_instructions' => $instructions
  123. );
  124. // TODO: remove the 'Map Dbxref' from the list as that should now be handled
  125. // by the dbxref interface below
  126. chado_add_node_form_properties($form, $form_state, $details);
  127. // ADDITIONAL DBXREFS FORM
  128. //---------------------------------------------
  129. $details = array(
  130. 'linking_table' => 'featuremap_dbxref', // the name of the _dbxref table
  131. 'base_foreign_key' => 'featuremap_id', // the name of the key in your base chado table
  132. 'base_key_value' => $featuremap_id // the value of featuremap_id for this record
  133. );
  134. // Adds the form elements to your current form
  135. chado_add_node_form_dbxrefs($form, $form_state, $details);
  136. return $form;
  137. }
  138. /**
  139. * Validates submission of form when adding or updating a map node
  140. *
  141. * @ingroup tripal_featuremap
  142. */
  143. function chado_featuremap_validate($node, $form, &$form_state) {
  144. // We only want to validate when the node is saved.
  145. // Since this validate can be called on AJAX and Deletion of the node
  146. // we need to make this check to ensure queries are not executed
  147. // without the proper values.
  148. if(property_exists($node, "op") and $node->op != 'Save') {
  149. return;
  150. }
  151. // we are syncing if we do not have a node ID but we do have a featuremap_id. We don't
  152. // need to validate during syncing so just skip it.
  153. if (!property_exists($node, 'nid') and property_exists($node, 'featuremap_id') and $node->featuremap_id != 0) {
  154. return;
  155. }
  156. // trim white space from text fields
  157. $node->fmapname = property_exists($node, 'fmapname') ? trim($node->fmapname) : '';
  158. $node->description = property_exists($node, 'description') ? trim($node->description) : '';
  159. $featuremap = 0;
  160. // check to make sure the unique name on the map is unique
  161. // before we try to insert into chado. If this is an update then we will
  162. // have a featuremap_id, therefore we want to look for another map with this
  163. // name but with a different featuremap_id. If this is an insert, just look
  164. // for a case where the name already exists.
  165. if (property_exists($node, 'featuremap_id')) {
  166. $sql = "
  167. SELECT * FROM {featuremap}
  168. WHERE name = :name AND NOT featuremap_id = :featuremap_id
  169. ";
  170. $featuremap = chado_query($sql, array(':name' => $node->fmapname, ':featuremap_id' => $node->featuremap_id))->fetchObject();
  171. }
  172. else {
  173. $sql = "SELECT * FROM {featuremap} WHERE name = :name";
  174. $featuremap = chado_query($sql, array(':name' => $node->fmapname))->fetchObject();
  175. }
  176. if ($featuremap) {
  177. form_set_error('fmapname', t('The unique map name already exists. Please choose another'));
  178. }
  179. }
  180. /**
  181. * Implement hook_node_access().
  182. *
  183. * This hook allows node modules to limit access to the node types they define.
  184. *
  185. * @param $node
  186. * The node on which the operation is to be performed, or, if it does not yet exist, the
  187. * type of node to be created
  188. *
  189. * @param $op
  190. * The operation to be performed
  191. *
  192. * @param $account
  193. * A user object representing the user for whom the operation is to be performed
  194. *
  195. * @return
  196. * If the permission for the specified operation is not set then return FALSE. If the
  197. * permission is set then return NULL as this allows other modules to disable
  198. * access. The only exception is when the $op == 'create'. We will always
  199. * return TRUE if the permission is set.
  200. *
  201. * @ingroup tripal_featuremap
  202. */
  203. function chado_featuremap_node_access($node, $op, $account) {
  204. $node_type = $node;
  205. if (is_object($node)) {
  206. $node_type = $node->type;
  207. }
  208. if($node_type == 'chado_featuremap') {
  209. if ($op == 'create') {
  210. if (!user_access('create chado_featuremap content', $account)) {
  211. return NODE_ACCESS_DENY;
  212. }
  213. return NODE_ACCESS_ALLOW;
  214. }
  215. if ($op == 'update') {
  216. if (!user_access('edit chado_featuremap content', $account)) {
  217. return NODE_ACCESS_DENY;
  218. }
  219. }
  220. if ($op == 'delete') {
  221. if (!user_access('delete chado_featuremap content', $account)) {
  222. return NODE_ACCESS_DENY;
  223. }
  224. }
  225. if ($op == 'view') {
  226. if (!user_access('access chado_featuremap content', $account)) {
  227. return NODE_ACCESS_DENY;
  228. }
  229. }
  230. return NODE_ACCESS_IGNORE;
  231. }
  232. }
  233. /**
  234. * Implements hook_insert().
  235. *
  236. * When a new chado_featuremap node is created we also need to add information
  237. * to our chado_featuremap table. This function is called on insert of a new node
  238. * of type 'chado_featuremap' and inserts the necessary information.
  239. *
  240. * @ingroup tripal_featuremap
  241. */
  242. function chado_featuremap_insert($node) {
  243. $featuremap_id = '';
  244. // if there is an featuremap_id in the $node object then this must be a sync so
  245. // we can skip adding the featuremap as it is already there, although
  246. // we do need to proceed with insertion into the chado/drupal linking table.
  247. if (!property_exists($node, 'featuremap_id')) {
  248. $node->fmapname = trim($node->fmapname);
  249. $node->description = trim($node->description);
  250. $values = array(
  251. 'name' => $node->fmapname,
  252. 'description' => $node->description,
  253. 'unittype_id' => $node->unittype_id
  254. );
  255. $featuremap = chado_insert_record('featuremap', $values);
  256. if(!$featuremap) {
  257. drupal_set_message(t('Unable to add featuremap.', 'warning'));
  258. tripal_report_error('tripal_featuremap', TRIPAL_WARNING, 'Unable to create feature map where values: %values',
  259. array('%values' => print_r($values, TRUE)));
  260. return;
  261. }
  262. $featuremap_id = $featuremap['featuremap_id'];
  263. // now add in the properties
  264. $properties = chado_retrieve_node_form_properties($node);
  265. // We need to deal with the 'Map Dbxref' property specially
  266. $cvterm = chado_select_record(
  267. 'cvterm',
  268. array('cvterm_id'),
  269. array('name' => 'Map Dbxref', 'cv_id' => array('name' => 'featuremap_property'))
  270. );
  271. $map_dbxref_cvterm_id = $cvterm[0]->cvterm_id;
  272. if (isset($properties[$map_dbxref_cvterm_id])) {
  273. foreach ($properties[$map_dbxref_cvterm_id] as $rank => $value) {
  274. $featuremap_dbxref = tripal_featuremap_add_featuremap_dbxref($featuremap_id, $value);
  275. if (!$featuremap_dbxref) {
  276. drupal_set_message("Error cannot add featuremap cross reference: $value", "error");
  277. tripal_report_error('t_featuremap', TRIPAL_ERROR, "Error cannot add featuremap cross reference: %ref",
  278. array('%ref' => $value));
  279. }
  280. }
  281. unset($properties[$map_dbxref_cvterm_id]);
  282. }
  283. $details = array(
  284. 'property_table' => 'featuremapprop',
  285. 'base_table' => 'featuremap',
  286. 'foreignkey_name' => 'featuremap_id',
  287. 'foreignkey_value' => $featuremap_id
  288. );
  289. chado_update_node_form_properties($node, $details, $properties);
  290. // * Additional DBxrefs Form *
  291. $details = array(
  292. 'linking_table' => 'featuremap_dbxref', // the name of your _dbxref table
  293. 'foreignkey_name' => 'featuremap_id', // the name of the key in your base table
  294. 'foreignkey_value' => $featuremap_id // the value of the featuremap_id key
  295. );
  296. chado_update_node_form_dbxrefs($node, $details);
  297. }
  298. else {
  299. $featuremap_id = $node->featuremap_id;
  300. }
  301. // Make sure the entry for this featuremap doesn't already exist in the
  302. // chado_featuremap table if it doesn't exist then we want to add it.
  303. $check_org_id = chado_get_id_from_nid('featuremap', $node->nid);
  304. if (!$check_org_id) {
  305. $record = new stdClass();
  306. $record->nid = $node->nid;
  307. $record->vid = $node->vid;
  308. $record->featuremap_id = $featuremap_id;
  309. drupal_write_record('chado_featuremap', $record);
  310. }
  311. }
  312. /**
  313. * Implements hook_update(). Update nodes
  314. *
  315. * @ingroup tripal_featuremap
  316. */
  317. function chado_featuremap_update($node) {
  318. $node->fmapname = trim($node->fmapname);
  319. $node->description = trim($node->description);
  320. $featuremap_id = chado_get_id_from_nid('featuremap', $node->nid) ;
  321. // update the map record
  322. $match = array(
  323. 'featuremap_id' => $featuremap_id,
  324. );
  325. $values = array(
  326. 'name' => $node->fmapname,
  327. 'description' => $node->description,
  328. 'unittype_id' => $node->unittype_id
  329. );
  330. $status = chado_update_record('featuremap', $match, $values);
  331. if (!$status) {
  332. drupal_set_message("Error updating map", "error");
  333. tripal_report_error('t_featuremap', TRIPAL_ERROR, "Error updating map", array());
  334. return;
  335. }
  336. // Update the properties
  337. $properties = chado_retrieve_node_form_properties($node);
  338. // We need to deal with the 'Map Dbxref' property specially
  339. $cvterm = chado_select_record(
  340. 'cvterm',
  341. array('cvterm_id'),
  342. array('name' => 'Map Dbxref', 'cv_id' => array('name' => 'featuremap_property'))
  343. );
  344. $map_dbxref_cvterm_id = $cvterm[0]->cvterm_id;
  345. if (isset($properties[$map_dbxref_cvterm_id])) {
  346. foreach ($properties[$map_dbxref_cvterm_id] as $rank => $value) {
  347. $featuremap_dbxref = tripal_featuremap_add_featuremap_dbxref($featuremap_id, $value);
  348. if (!$featuremap_dbxref) {
  349. drupal_set_message("Error cannot add featuremap cross reference: $value", "error");
  350. tripal_report_error('t_featuremap', TRIPAL_ERROR, "Error cannot add featuremap cross reference: %ref",
  351. array('%ref' => $value));
  352. }
  353. }
  354. unset($properties[$map_dbxref_cvterm_id]);
  355. }
  356. $details = array(
  357. 'property_table' => 'featuremapprop',
  358. 'base_table' => 'featuremap',
  359. 'foreignkey_name' => 'featuremap_id',
  360. 'foreignkey_value' => $featuremap_id
  361. );
  362. chado_update_node_form_properties($node, $details, $properties);
  363. // * Additional DBxrefs Form *
  364. $details = array(
  365. 'linking_table' => 'featuremap_dbxref', // the name of your _dbxref table
  366. 'foreignkey_name' => 'featuremap_id', // the name of the key in your base table
  367. 'foreignkey_value' => $featuremap_id // the value of the featuremap_id key
  368. );
  369. chado_update_node_form_dbxrefs($node, $details);
  370. }
  371. /**
  372. * Implements hook_load().
  373. *
  374. * When a node is requested by the user this function is called to allow us
  375. * to add auxiliary data to the node object.
  376. *
  377. * @ingroup tripal_featuremap
  378. */
  379. function chado_featuremap_load($nodes) {
  380. foreach ($nodes as $nid => $node) {
  381. // get the feature details from chado
  382. $featuremap_id = chado_get_id_from_nid('featuremap', $node->nid);
  383. // if the nid does not have a matching record then skip this node.
  384. // this can happen with orphaned nodes.
  385. if (!$featuremap_id) {
  386. continue;
  387. }
  388. $values = array('featuremap_id' => $featuremap_id);
  389. $featuremap = chado_generate_var('featuremap', $values);
  390. // expand the description field as it is needed by the form
  391. $featuremap = chado_expand_var($featuremap, 'field', 'featuremap.description');
  392. $nodes[$nid]->featuremap = $featuremap;
  393. // Now get the title
  394. $node->title = chado_get_node_title($node);
  395. }
  396. }
  397. /**
  398. * Implements hook_delete().
  399. *
  400. * Delete data from drupal and chado databases when a node is deleted
  401. * @ingroup tripal_featuremap
  402. */
  403. function chado_featuremap_delete(&$node) {
  404. $featuremap_id = chado_get_id_from_nid('featuremap', $node->nid);
  405. // if we don't have a map id for this node then this isn't a node of
  406. // type chado_featuremap or the entry in the chado_featuremap table was lost.
  407. if (!$featuremap_id) {
  408. return;
  409. }
  410. // Remove data from {chado_featuremap}, {node} and {node_revisions} tables of
  411. // drupal database
  412. $sql_del = "DELETE FROM {chado_featuremap} WHERE nid = :nid AND vid = :vid";
  413. db_query($sql_del, array(':nid' => $node->nid, ':vid' => $node->vid));
  414. $sql_del = "DELETE FROM {node_revision} WHERE nid = :nid AND vid = :vid";
  415. db_query($sql_del, array(':nid' => $node->nid, ':vid' => $node->vid));
  416. $sql_del = "DELETE FROM {node} WHERE nid = :nid AND vid = :vid";
  417. db_query($sql_del, array(':nid' => $node->nid, ':vid' => $node->vid));
  418. // Remove data from map and mapprop tables of chado database as well
  419. chado_query("DELETE FROM {featuremapprop} WHERE featuremap_id = :featuremap_id", array(':featuremap_id' => $featuremap_id));
  420. chado_query("DELETE FROM {featuremap_dbxref} WHERE featuremap_id = :featuremap_id", array(':featuremap_id' => $featuremap_id));
  421. chado_query("DELETE FROM {featuremap} WHERE featuremap_id = :featuremap_id", array(':featuremap_id' => $featuremap_id));
  422. }
  423. /**
  424. * Implements hook_node_presave(). Acts on all content types.
  425. *
  426. * @ingroup tripal_featuremap
  427. */
  428. function tripal_featuremap_node_presave($node) {
  429. switch ($node->type) {
  430. // This step is for setting the title for the Drupal node. This title
  431. // is permanent and thus is created to be unique. Title changes provided
  432. // by tokens are generated on the fly dynamically, but the node title
  433. // seen in the content listing needs to be set here. Do not call
  434. // the chado_get_node_title() function here to set the title as the node
  435. // object isn't properly filled out and the function will fail.
  436. case 'chado_featuremap':
  437. // for a form submission the 'fmapname' field will be set,
  438. // for a sync, we must pull from the featuremap object
  439. if (property_exists($node, 'fmapname')) {
  440. // set the title
  441. $node->title = $node->fmapname;
  442. }
  443. else if (property_exists($node, 'featuremap')) {
  444. $node->title = $node->featuremap->name;
  445. }
  446. break;
  447. }
  448. }
  449. /**
  450. * Implements hook_node_view(). Acts on all content types.
  451. *
  452. * @ingroup tripal_feature
  453. */
  454. function tripal_featuremap_node_view($node, $view_mode, $langcode) {
  455. switch ($node->type) {
  456. case 'chado_featuremap':
  457. // Show feature browser and counts
  458. if ($view_mode == 'full') {
  459. $node->content['tripal_featuremap_base'] = array(
  460. '#theme' => 'tripal_featuremap_base',
  461. '#node' => $node,
  462. '#tripal_toc_id' => 'base',
  463. '#tripal_toc_title' => 'Overview',
  464. '#weight' => -100,
  465. );
  466. $node->content['tripal_featuremap_featurepos'] = array(
  467. '#theme' => 'tripal_featuremap_featurepos',
  468. '#node' => $node,
  469. '#tripal_toc_id' => 'featurepos',
  470. '#tripal_toc_title' => 'Map Features',
  471. );
  472. $node->content['tripal_featuremap_properties'] = array(
  473. '#theme' => 'tripal_featuremap_properties',
  474. '#node' => $node,
  475. '#tripal_toc_id' => 'properties',
  476. '#tripal_toc_title' => 'Properties',
  477. );
  478. $node->content['tripal_featuremap_publication'] = array(
  479. '#theme' => 'tripal_featuremap_publication',
  480. '#node' => $node,
  481. '#tripal_toc_id' => 'publications',
  482. '#tripal_toc_title' => 'Publications',
  483. );
  484. $node->content['tripal_featuremap_references'] = array(
  485. '#theme' => 'tripal_featuremap_references',
  486. '#node' => $node,
  487. '#tripal_toc_id' => 'references',
  488. '#tripal_toc_title' => 'Cross References',
  489. );
  490. }
  491. if ($view_mode == 'teaser') {
  492. $node->content['tripal_featuremap_teaser'] = array(
  493. '#theme' => 'tripal_featuremap_teaser',
  494. '#node' => $node,
  495. );
  496. }
  497. break;
  498. case 'chado_feature':
  499. if ($view_mode == 'full') {
  500. $node->content['tripal_feature_featurepos'] = array(
  501. '#theme' => 'tripal_feature_featurepos',
  502. '#node' => $node,
  503. '#tripal_toc_id' => 'featurepos',
  504. '#tripal_toc_title' => 'Maps',
  505. );
  506. }
  507. break;
  508. }
  509. }
  510. /**
  511. * Implements hook_node_insert().
  512. * Acts on all content types.
  513. *
  514. * @ingroup tripal_featuremap
  515. */
  516. function tripal_featuremap_node_insert($node) {
  517. switch ($node->type) {
  518. case 'chado_featuremap':
  519. // get the feature details from chado
  520. $featuremap_id = chado_get_id_from_nid('featuremap', $node->nid);
  521. $values = array('featuremap_id' => $featuremap_id);
  522. $featuremap = chado_generate_var('featuremap', $values);
  523. $node->featuremap = $featuremap;
  524. // Now get the title
  525. $node->title = chado_get_node_title($node);
  526. // Now use the API to set the path.
  527. chado_set_node_url($node);
  528. break;
  529. }
  530. }
  531. /**
  532. * Implements hook_node_update().
  533. * Acts on all content types.
  534. *
  535. * @ingroup tripal_featuremap
  536. */
  537. function tripal_featuremap_node_update($node) {
  538. switch ($node->type) {
  539. case 'chado_featuremap':
  540. // Now get the title
  541. $node->title = chado_get_node_title($node);
  542. // Now use the API to set the path.
  543. chado_set_node_url($node);
  544. break;
  545. }
  546. }
  547. /**
  548. * Implements [content_type]_chado_node_default_title_format().
  549. *
  550. * Defines a default title format for the Chado Node API to set the titles on
  551. * Chado featuremap nodes based on chado fields.
  552. */
  553. function chado_featuremap_chado_node_default_title_format() {
  554. return '[featuremap.name]';
  555. }
  556. /**
  557. * Implements hook_chado_node_default_url_format().
  558. *
  559. * Designates a default URL format for featuremap nodes.
  560. */
  561. function chado_featuremap_chado_node_default_url_format() {
  562. return '/featuremap/[featuremap.featuremap_id]';
  563. }