tripal_pub.DEPRECATED.inc 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <?php
  2. /**
  3. * @file
  4. * Wrapper functions to provide backwards compatibility for the tripal analysis api
  5. */
  6. /**
  7. * @deprecated Restructured API to make naming more readable and consistent.
  8. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  9. * This function has been replaced by tripal_get_remote_pubs().
  10. *
  11. * @see tripal_get_remote_pubs().
  12. */
  13. function tripal_pub_get_remote_search_results($remote_db, $search_array, $num_to_retrieve, $page = 0) {
  14. tripal_report_error(
  15. 'tripal_api',
  16. TRIPAL_NOTICE,
  17. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  18. array(
  19. '%old_function'=>'tripal_pub_get_remote_search_results',
  20. '%new_function' => 'tripal_get_remote_pubs'
  21. )
  22. );
  23. return tripal_get_remote_pubs($remote_db, $search_array, $num_to_retrieve, $page);;
  24. }
  25. /**
  26. * @deprecated Restructured API to make naming more readable and consistent.
  27. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  28. * This function has been replaced by chado_get_remote_pub_record().
  29. *
  30. * @see chado_get_remote_pub_record().
  31. */
  32. function tripal_pub_get_raw_data($dbxref) {
  33. tripal_report_error(
  34. 'tripal_api',
  35. TRIPAL_NOTICE,
  36. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  37. array(
  38. '%old_function'=>'tripal_pub_get_raw_data',
  39. '%new_function' => 'chado_get_remote_pub_record'
  40. )
  41. );
  42. return tripal_get_remote_pub($dbxref);
  43. }
  44. /**
  45. * @deprecated Restructured API to make naming more readable and consistent.
  46. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  47. * This function has been replaced by chado_update_multiple_publications().
  48. *
  49. * @see chado_update_multiple_publications().
  50. */
  51. function tripal_pub_update_publications($do_contact = FALSE, $dbxref = NULL, $db = NULL) {
  52. tripal_report_error(
  53. 'tripal_api',
  54. TRIPAL_NOTICE,
  55. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  56. array(
  57. '%old_function'=>'tripal_pub_update_publications',
  58. '%new_function' => 'chado_reimport_publications'
  59. )
  60. );
  61. return chado_reimport_publications($do_contact, $dbxref, $db);
  62. }
  63. /**
  64. * @deprecated Restructured API to make naming more readable and consistent.
  65. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  66. * This function has been replaced by chado_import_multiple_publications().
  67. *
  68. * @see chado_import_multiple_publications().
  69. */
  70. function tripal_pub_import_publications_by_import_id($import_id, $job_id = NULL) {
  71. tripal_report_error(
  72. 'tripal_api',
  73. TRIPAL_NOTICE,
  74. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  75. array(
  76. '%old_function'=>'tripal_pub_import_publications_by_import_id',
  77. '%new_function' => 'tripal_execute_pub_importer'
  78. )
  79. );
  80. return tripal_execute_pub_importer($import_id, $job_id);
  81. }
  82. /**
  83. * @deprecated Restructured API to make naming more readable and consistent.
  84. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  85. * This function has been replaced by chado_import_multiple_publications().
  86. *
  87. * @see chado_import_multiple_publications().
  88. */
  89. function tripal_pub_import_publications($report_email = FALSE, $do_update = FALSE) {
  90. tripal_report_error(
  91. 'tripal_api',
  92. TRIPAL_NOTICE,
  93. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  94. array(
  95. '%old_function'=>'tripal_pub_import_publications',
  96. '%new_function' => 'tripal_execute_active_pub_importers'
  97. )
  98. );
  99. return tripal_execute_active_pub_importers($report_email, $do_update);
  100. }
  101. /**
  102. * @deprecated Restructured API to make naming more readable and consistent.
  103. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  104. * This function has been replaced by chado_import_multiple_publications().
  105. *
  106. * @see chado_import_multiple_publications().
  107. */
  108. function tripal_pub_import_by_dbxref($pub_dbxref, $do_contact = FALSE, $do_update) {
  109. tripal_report_error(
  110. 'tripal_api',
  111. TRIPAL_NOTICE,
  112. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  113. array(
  114. '%old_function'=>'tripal_pub_import_by_dbxref',
  115. '%new_function' => 'chado_import_multiple_publications'
  116. )
  117. );
  118. return tripal_import_pub_by_dbxref($pub_dbxref, $do_contact, $do_udpate);
  119. }
  120. /**
  121. * @deprecated Restructured API to make naming more readable and consistent.
  122. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  123. * This function has been replaced by chado_associate_dbxref().
  124. *
  125. * @see chado_associate_dbxref().
  126. */
  127. function tripal_pub_add_pub_dbxref($pub_id, $pub_dbxref) {
  128. tripal_report_error(
  129. 'tripal_api',
  130. TRIPAL_NOTICE,
  131. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  132. array(
  133. '%old_function'=>'tripal_pub_add_pub_dbxref',
  134. '%new_function' => 'chado_associate_dbxref'
  135. )
  136. );
  137. $dbxref = array();
  138. if(preg_match('/^(.*?):(.*?)$/', trim($pub_dbxref), $matches)) {
  139. $dbxref['db_name'] = $matches[1];
  140. $dbxref['accession'] = $matches[2];
  141. }
  142. return chado_associate_dbxref('pub', $pub_id, $dbxref);
  143. }
  144. /**
  145. * @deprecated Restructured API to make naming more readable and consistent.
  146. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  147. * This function has been replaced by chado_get_publication().
  148. *
  149. * @see chado_get_publication().
  150. */
  151. function tripal_pub_get_pubs_by_dbxref($pub_dbxref) {
  152. tripal_report_error(
  153. 'tripal_api',
  154. TRIPAL_NOTICE,
  155. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  156. array(
  157. '%old_function'=>'tripal_pub_get_pubs_by_dbxref',
  158. '%new_function' => 'chado_get_publication'
  159. )
  160. );
  161. $pub = chado_get_publication(array('dbxref' => $pub_dbxref));
  162. if ($pub) {
  163. // the original function returned an array of pub_ids
  164. return array($pub->pub_id);
  165. }
  166. else {
  167. return array();
  168. }
  169. }
  170. /**
  171. * @deprecated Restructured API to make naming more readable and consistent.
  172. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  173. * This function has been replaced by chado_get_publication().
  174. *
  175. * @see chado_get_publication().
  176. */
  177. function tripal_pub_get_pubs_by_title_type_pyear_series($title, $type = NULL, $pyear = NULL, $series_name = NULL) {
  178. tripal_report_error(
  179. 'tripal_api',
  180. TRIPAL_NOTICE,
  181. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  182. array(
  183. '%old_function'=>'tripal_pub_get_pubs_by_title_type_pyear_series',
  184. '%new_function' => 'chado_get_publication'
  185. )
  186. );
  187. $pub_details = array(
  188. 'Title' => $title,
  189. 'Year' => $pyear,
  190. 'Series Name' => $series_name,
  191. 'Publication Type' => $type,
  192. );
  193. return chado_does_pub_exist($pub_details);
  194. }
  195. /**
  196. * @deprecated Restructured API to make naming more readable and consistent.
  197. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  198. * This function has been replaced by chado_get_publication().
  199. *
  200. * @see chado_get_publication().
  201. */
  202. function tripal_pub_get_pub_by_uniquename($uniquenname) {
  203. tripal_report_error(
  204. 'tripal_api',
  205. TRIPAL_NOTICE,
  206. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  207. array(
  208. '%old_function'=>'tripal_pub_get_pub_by_uniquename',
  209. '%new_function' => 'chado_get_publication'
  210. )
  211. );
  212. $pub = chado_get_publication(array('uniquename' => $uniquenname));
  213. if ($pub) {
  214. // the original version of this function returned an array of matching pub_ids
  215. return array($pub->pub_id);
  216. }
  217. return array();
  218. }
  219. /**
  220. * @deprecated Restructured API to make naming more readable and consistent.
  221. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  222. * This function has been replaced by chado_get_property().
  223. *
  224. * @see chado_get_property().
  225. */
  226. function tripal_pub_get_property($pub_id, $property) {
  227. tripal_report_error(
  228. 'tripal_api',
  229. TRIPAL_NOTICE,
  230. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  231. array(
  232. '%old_function'=>'tripal_pub_get_property',
  233. '%new_function' => 'chado_get_property'
  234. )
  235. );
  236. return chado_get_property('pub', $pub_id, $property, 'tripal_pub');
  237. }
  238. /**
  239. * @deprecated Restructured API to make naming more readable and consistent.
  240. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  241. * This function has been replaced by chado_insert_property().
  242. *
  243. * @see chado_insert_property().
  244. */
  245. function tripal_pub_insert_property($pub_id, $property, $value, $update_if_present = 0) {
  246. tripal_report_error(
  247. 'tripal_api',
  248. TRIPAL_NOTICE,
  249. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  250. array(
  251. '%old_function'=>'tripal_pub_insert_property',
  252. '%new_function' => 'chado_insert_property'
  253. )
  254. );
  255. return chado_insert_property('pub', $pub_id, $property, 'tripal_pub', $value, $update_if_present);
  256. }
  257. /**
  258. * @deprecated Restructured API to make naming more readable and consistent.
  259. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  260. * This function has been replaced by chado_update_property().
  261. *
  262. * @see chado_update_property().
  263. */
  264. function tripal_pub_update_property($pub_id, $property, $value, $insert_if_missing = 0) {
  265. tripal_report_error(
  266. 'tripal_api',
  267. TRIPAL_NOTICE,
  268. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  269. array(
  270. '%old_function'=>'tripal_pub_update_property',
  271. '%new_function' => 'chado_update_property'
  272. )
  273. );
  274. return chado_update_property('pub', $pub_id, $property, 'tripal_pub', $value, $insert_if_missing);
  275. }
  276. /**
  277. * @deprecated Restructured API to make naming more readable and consistent.
  278. * Function was deprecated in Tripal 2.0 and will be removed 2 releases from now.
  279. * This function has been replaced by chado_delete_property().
  280. *
  281. * @see chado_delete_property().
  282. */
  283. function tripal_pub_delete_property($pub_id, $property) {
  284. tripal_report_error(
  285. 'tripal_api',
  286. TRIPAL_NOTICE,
  287. "DEPRECATED: %old_function has been replaced with %new_function. Please update your code.",
  288. array(
  289. '%old_function'=>'tripal_pub_delete_property',
  290. '%new_function' => 'chado_delete_property'
  291. )
  292. );
  293. return chado_delete_property('pub', $pub_id, $property, 'tripal_pub');
  294. }