1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171 |
- <?php
- require_once "api/tripal_chado.api.inc";
- require_once 'api/tripal_chado.property.api.inc';
- require_once 'api/tripal_chado.query.api.inc';
- require_once 'api/tripal_chado.entity.api.inc';
- require_once 'api/tripal_chado.variables.api.inc';
- require_once 'api/tripal_chado.schema.api.inc';
- require_once 'api/tripal_chado.custom_tables.api.inc';
- require_once 'api/tripal_chado.mviews.api.inc';
- require_once 'api/tripal_chado.schema_v1.3.api.inc';
- require_once 'api/tripal_chado.schema_v1.2.api.inc';
- require_once 'api/tripal_chado.schema_v1.11.api.inc';
- require_once 'api/tripal_chado.semweb.api.inc';
- require_once 'api/tripal_chado.migrate.api.inc';
- require_once 'api/modules/tripal_chado.analysis.api.inc';
- require_once 'api/modules/tripal_chado.contact.api.inc';
- require_once 'api/modules/tripal_chado.cv.api.inc';
- require_once 'api/modules/tripal_chado.db.api.inc';
- require_once 'api/modules/tripal_chado.feature.api.inc';
- require_once 'api/modules/tripal_chado.organism.api.inc';
- require_once 'api/modules/tripal_chado.pub.api.inc';
- require_once 'api/modules/tripal_chado.stock.api.inc';
- require_once 'api/modules/tripal_chado.phylotree.api.inc';
- require_once "includes/tripal_chado.entity.inc";
- require_once "includes/tripal_chado.schema.inc";
- require_once "includes/tripal_chado.vocab_storage.inc";
- require_once "includes/tripal_chado.field_storage.inc";
- require_once "includes/tripal_chado.bundle.inc";
- require_once "includes/tripal_chado.fields.inc";
- require_once "includes/tripal_chado.mapping.inc";
- require_once "includes/TripalFields/ChadoField.inc";
- require_once "includes/TripalFields/ChadoFieldWidget.inc";
- require_once "includes/TripalFields/ChadoFieldFormatter.inc";
- require_once "includes/ChadoDatabaseConnection.inc";
- tripal_chado_set_globals();
- function tripal_chado_set_globals() {
-
-
-
-
-
-
- $GLOBALS["chado_is_installed"] = chado_is_installed();
- if ($GLOBALS["chado_is_installed"]) {
- $GLOBALS["chado_is_local"] = chado_is_local();
- $GLOBALS["chado_version"] = chado_get_version();
- $GLOBALS["exact_chado_version"] = chado_get_version(TRUE);
- $GLOBALS["chado_tables"] = array();
- }
- }
- function tripal_chado_init() {
- if (user_access('administer tripal')) {
- if ($GLOBALS["chado_is_installed"]) {
-
- if (!variable_get('tripal_chado_is_prepared', FALSE)) {
- drupal_set_message('Chado is installed but Tripal has not yet prepared Drupal and Chado. Please ' .
- l('prepare both Drupal and Chado', 'admin/tripal/storage/chado/prepare') .
- ' before continuing.', 'warning');
- }
- }
- else {
- drupal_set_message('Tripal cannot find a Chado installation. Please ' .
- l('install Chado', 'admin/tripal/storage/chado/install') .
- ' before continuing.', 'warning');
- }
- }
- }
- function tripal_chado_views_api() {
- return array(
- 'api' => 3.0,
- );
- }
- function tripal_chado_menu() {
- $items = array();
-
-
-
- $items['admin/tripal/storage/chado'] = array(
- 'title' => 'Chado',
- 'description' => t("Integrates Chado with Tripal and includes tools to
- load data, and extend the chado schema through custom tables &
- materialized views."),
- 'weight' => -100,
- 'access arguments' => array('administer tripal'),
- );
- $items['admin/tripal/storage/chado/install'] = array(
- 'title' => 'Install Chado',
- 'description' => t('Installs the Chado database tables, views, etc., inside the current Drupal database'),
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_chado_load_form'),
- 'type' => MENU_NORMAL_ITEM,
- 'access arguments' => array('install chado'),
- 'file' => 'includes/tripal_chado.install.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'weight' => -100
- );
- $items['admin/tripal/storage/chado/prepare'] = array(
- 'title' => 'Prepare Chado',
- 'description' => t('Prepares Drupal to use Chado.'),
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_chado_prepare_form'),
- 'type' => MENU_NORMAL_ITEM,
- 'access arguments' => array('install chado'),
- 'file' => 'includes/setup/tripal_chado.setup.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'weight' => -99
- );
- $items['admin/tripal/storage/chado/publish'] = array(
- 'title' => 'Publish',
- 'description' => t('Publish data that is present in Chado but which does
- not yet have a page on this site for viewing. In Tripal v2.0 or
- earlier this was refered to as "syncing".'),
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_chado_publish_form'),
- 'type' => MENU_NORMAL_ITEM,
- 'access arguments' => array('publish tripal content'),
- 'file' => 'includes/tripal_chado.publish.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'weight' => -99
- );
-
- $items['admin/structure/bio_data/publish'] = array(
- 'title' => 'Publish Tripal Content',
- 'description' => t('Publish data that is present in Chado but which does
- not yet have a page on this site for viewing. In Tripal v2.0 or
- earlier this was refered to as "syncing".'),
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_chado_publish_form'),
- 'access arguments' => array('publish tripal content'),
- 'file' => 'includes/tripal_chado.publish.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_LOCAL_ACTION,
- 'weight' => 2
- );
- $items['admin/content/bio_data/publish'] = array(
- 'title' => 'Publish Tripal Content',
- 'description' => t('Publish data that is present in Chado but which does
- not yet have a page on this site for viewing. In Tripal v2.0 or
- earlier this was refered to as "syncing".'),
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_chado_publish_form'),
- 'access arguments' => array('publish tripal content'),
- 'file' => 'includes/tripal_chado.publish.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_LOCAL_ACTION,
- 'weight' => 2
- );
-
-
-
- $items['admin/tripal/storage/chado/mviews'] = array(
- 'title' => 'Materialized Views',
- 'description' => t('Materialized views are used to improve speed of large or complex queries.'),
- 'page callback' => 'tripal_mview_admin_view',
- 'access arguments' => array('administer chado mviews'),
- 'type' => MENU_NORMAL_ITEM,
- 'file' => 'includes/tripal_chado.mviews.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'weight' => -10
- );
- $items['admin/tripal/storage/chado/mviews/help'] = array(
- 'title' => 'Help',
- 'description' => t('Help for the materialized views management system'),
- 'page callback' => 'theme',
- 'page arguments' => array('tripal_mviews_help'),
- 'access arguments' => array('administer chado mviews'),
- 'type' => MENU_LOCAL_TASK,
- 'file' => 'includes/tripal_chado.mviews.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'weight' => 10
- );
- $items['admin/tripal/storage/chado/mviews/report/%'] = array(
- 'title' => 'Materialized View',
- 'description' => t('Materialized views are used to improve speed of large or complex queries. These are database views as compared to Drupal views.'),
- 'page callback' => 'tripal_mview_report',
- 'page arguments' => array(6),
- 'access arguments' => array('administer chado mviews'),
- 'type' => MENU_CALLBACK,
- 'file' => 'includes/tripal_chado.mviews.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- );
- $items['admin/tripal/storage/chado/mviews/new'] = array(
- 'title' => 'Create Materialized View',
- 'description' => t('Create a new materialized view.'),
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_mviews_form'),
- 'access arguments' => array('administer chado mviews'),
- 'type' => MENU_CALLBACK,
- 'file' => 'includes/tripal_chado.mviews.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- );
- $items['admin/tripal/storage/chado/mviews/edit/%'] = array(
- 'title' => 'Edit Materialized View',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_mviews_form', 6),
- 'access arguments' => array('administer chado mviews'),
- 'type' => MENU_CALLBACK,
- 'file' => 'includes/tripal_chado.mviews.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- );
- $items['admin/tripal/storage/chado/mviews/update/%'] = array(
- 'title' => 'Create Materialized View',
- 'description' => t('Materialized views are used to improve speed of large or complex queries.'),
- 'page callback' => 'tripal_mviews_add_populate_job',
- 'page arguments' => array(6),
- 'access arguments' => array('administer chado mviews'),
- 'type' => MENU_CALLBACK,
- 'file' => 'includes/tripal_chado.mviews.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- );
- $items['admin/tripal/storage/chado/mviews/delete/%'] = array(
- 'title' => 'Create Materialized View',
- 'description' => t('Materialized views are used to improve speed of large or complex queries.'),
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_mviews_delete_form', 6),
- 'access arguments' => array('administer chado mviews'),
- 'type' => MENU_CALLBACK,
- 'file' => 'includes/tripal_chado.mviews.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- );
-
-
- $items['admin/tripal/storage/chado/mviews/import'] = array(
- 'title' => 'Import MView',
- 'description' => 'Import a materialized view from another Tripal instance.',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_mviews_import_form'),
- 'access arguments' => array('administer chado mviews'),
- 'type' => MENU_CALLBACK,
- 'file' => 'includes/tripal_chado.mviews.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- );
- $items['admin/tripal/storage/chado/mviews/%tblid/export'] = array(
- 'title' => 'Export MView',
- 'description' => 'Export a materialized view for use by another Tripal instance.',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_mviews_export_form', 5),
- 'access arguments' => array('administer chado mviews'),
- 'type' => MENU_CALLBACK,
- 'file' => 'includes/tripal_chado.mviews.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- );
-
-
-
- $items['admin/tripal/storage/chado/custom_tables'] = array(
- 'title' => 'Custom Tables',
- 'description' => t('Creation of custom tables that are added to Chado database.'),
- 'page callback' => 'tripal_custom_table_admin_view',
- 'access arguments' => array('administer chado custom tables'),
- 'type' => MENU_NORMAL_ITEM,
- 'file' => 'includes/tripal_chado.custom_tables.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'weight' => -10
- );
- $items['admin/tripal/storage/chado/custom_tables/help'] = array(
- 'title' => 'Help',
- 'description' => t('Help for the tripal job management system'),
- 'page callback' => 'theme',
- 'page arguments' => array('tripal_job_help'),
- 'access arguments' => array('administer chado custom tables'),
- 'type' => MENU_LOCAL_TASK,
- 'file' => 'includes/tripal_chado.custom_tables.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'weight' => 10
- );
- $items['admin/tripal/storage/chado/custom_tables/view/%'] = array(
- 'title' => 'Custom Tables',
- 'description' => t('Custom tables are added to Chado.'),
- 'page callback' => 'tripal_custom_table_view',
- 'page arguments' => array(6),
- 'access arguments' => array('administer chado custom tables'),
- 'file' => 'includes/tripal_chado.custom_tables.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
- $items['admin/tripal/storage/chado/custom_tables/new'] = array(
- 'title' => 'Create Custom Table',
- 'description' => t('An interface for creating your own custom tables.'),
- 'page callback' => 'tripal_custom_table_new_page',
- 'access arguments' => array('administer chado custom tables'),
- 'file' => 'includes/tripal_chado.custom_tables.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
- $items['admin/tripal/storage/chado/custom_tables/edit/%'] = array(
- 'title' => 'Edit Custom Table',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_custom_tables_form', 6),
- 'access arguments' => array('administer chado custom tables'),
- 'file' => 'includes/tripal_chado.custom_tables.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
- $items['admin/tripal/storage/chado/custom_tables/delete/%'] = array(
- 'title' => 'Create Custom Table',
- 'description' => t('Custom tables are added to Chado.'),
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_custom_tables_delete_form', 6),
- 'access arguments' => array('administer chado custom tables'),
- 'file' => 'includes/tripal_chado.custom_tables.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
- $items['admin/tripal/storage/chado/custom_tables/views/tables/enable'] = array(
- 'title' => 'Enable Custom Tables Administrative View',
- 'page callback' => 'tripal_enable_view',
- 'page arguments' => array('tripal_admin_custom_table', 'admin/tripal/storage/chado/custom_tables'),
- 'access arguments' => array('administer chado custom tables'),
- 'file' => 'includes/tripal_chado.custom_tables.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
-
-
-
- $items['admin/tripal/loaders/pub'] = array(
- 'title' => t('Chado Publication Importers'),
- 'description' => t('Create and modify importers that can connect to and retreive publications from remote databases.'),
- 'page callback' => 'tripal_pub_importers_list',
- 'access arguments' => array('load tripal data'),
- 'file' => 'includes/loaders/tripal_chado.pub_importers.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_NORMAL_ITEM,
- 'weight' => 0
- );
- $items['admin/tripal/loaders/pub/new'] = array(
- 'title' => t('Add an Importer'),
- 'description' => t('Add a new publication importer.'),
- 'page callback' => 'tripal_pub_importer_setup_page',
- 'access arguments' => array('load tripal data'),
- 'type ' => MENU_CALLBACK,
- 'file' => 'includes/loaders/tripal_chado.pub_importers.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- );
- $items['admin/tripal/loaders/pub/edit/%'] = array(
- 'page callback' => 'tripal_pub_importer_setup_page',
- 'page arguments' => array(5),
- 'access arguments' => array('load tripal data'),
- 'type ' => MENU_CALLBACK,
- 'file' => 'includes/loaders/tripal_chado.pub_importers.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- );
- $items['admin/tripal/loaders/pub/raw/%'] = array(
- 'page callback' => 'tripal_get_remote_pub_raw_page',
- 'page arguments' => array(5),
- 'access arguments' => array('load tripal data'),
- 'type ' => MENU_CALLBACK,
- 'file' => 'includes/loaders/tripal_chado.pub_importers.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- );
-
- $items['admin/tripal/loaders/pub/import'] = array(
- 'page callback' => 'tripal_pub_importers_list',
- 'access arguments' => array('load tripal data'),
- 'type' => MENU_CALLBACK,
- 'file' => 'includes/loaders/tripal_chado.pub_importers.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- );
- $items['admin/tripal/loaders/pub/submit/%'] = array(
- 'page callback' => 'tripal_pub_importer_submit_job',
- 'page arguments' => array(5),
- 'access arguments' => array('load tripal data'),
- 'type ' => MENU_CALLBACK,
- 'file' => 'includes/loaders/tripal_chado.pub_importers.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- );
- $items['admin/tripal/loaders/pub/delete/%'] = array(
- 'page callback' => 'tripal_pub_importer_delete',
- 'page arguments' => array(5),
- 'access arguments' => array('load tripal data'),
- 'type ' => MENU_CALLBACK,
- 'file' => 'includes/loaders/tripal_chado.pub_importers.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- );
- $items['admin/tripal/loaders/pub/changedb'] = array(
- 'page callback' => 'tripal_pub_importer_setup_page_update_remotedb',
- 'page arguments' => array(),
- 'access arguments' => array('load tripal data'),
- 'type ' => MENU_CALLBACK,
- 'file' => 'includes/loaders/tripal_chado.pub_importers.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- );
- $items['admin/tripal/loaders/pub/criteria/%/%'] = array(
- 'page callback' => 'tripal_pub_importer_setup_page_update_criteria',
- 'page arguments' => array(5, 6),
- 'access arguments' => array('load tripal data'),
- 'type ' => MENU_CALLBACK,
- 'file' => 'includes/loaders/tripal_chado.pub_importers.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- );
-
-
-
- $items['admin/tripal/storage/chado/migrate'] = array(
- 'title' => 'Migrate',
- 'description' => t('Migrate Tripal v2 content to Tripal v3'),
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_chado_migrate_form'),
- 'type' => MENU_NORMAL_ITEM,
- 'access arguments' => array('administer tripal'),
- 'file' => 'includes/tripal_chado.migrate.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'weight' => 10
- );
-
-
-
- $items['admin/tripal/storage/chado/semweb'] = array(
- 'title' => 'Semantic Web',
- 'description' => t('Semantic web settings. Set terms used for the web services.'),
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_chado_semweb_form'),
- 'type' => MENU_NORMAL_ITEM,
- 'access arguments' => array('administer chado semantic web'),
- 'file' => 'includes/tripal_chado.semweb.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'weight' => 10
- );
- $items['admin/tripal/storage/chado/semweb/edit/%/%'] = array(
- 'title' => 'Edit Semantic Web Term',
- 'description' => t('Edit terms used for the web services.'),
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_chado_semweb_edit_form', 6, 7),
- 'type' => MENU_CALLBACK,
- 'access arguments' => array('administer chado semantic web'),
- 'file' => 'includes/tripal_chado.semweb.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- );
- $items['admin/tripal/storage/chado/semweb/reset/%/%'] = array(
- 'title' => 'Reset Semantic Web Term',
- 'description' => t('Edit terms used for the web services.'),
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_chado_semweb_reset_form', 6, 7),
- 'type' => MENU_CALLBACK,
- 'access arguments' => array('administer chado semantic web'),
- 'file' => 'includes/tripal_chado.semweb.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- );
-
-
-
- $items['admin/tripal/storage/chado/auto_name/dbxref/%/%'] = array(
- 'page callback' => 'tripal_autocomplete_dbxref',
- 'page arguments' => array(6, 7),
- 'access arguments' => array('access content'),
- 'file' => 'api/modules/tripal_chado.db.api.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
- $items['admin/tripal/storage/chado/auto_name/cv/%'] = array(
- 'page callback' => 'tripal_autocomplete_cv',
- 'page arguments' => array(6),
- 'access arguments' => array('access content'),
- 'file' => 'api/modules/tripal_chado.cv.api.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
- $items['admin/tripal/storage/chado/auto_name/cvterm/%/%'] = array(
- 'page callback' => 'tripal_autocomplete_cvterm',
- 'page arguments' => array(6, 7),
- 'access arguments' => array('access content'),
- 'file' => 'api/modules/tripal_chado.cv.api.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
- $items['admin/tripal/storage/chado/auto_name/pub/%'] = array(
- 'page callback' => 'tripal_autocomplete_pub',
- 'page arguments' => array(6),
- 'access arguments' => array('access content'),
- 'file' => 'api/modules/tripal_chado.pub.api.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
- $items['admin/tripal/storage/chado/auto_name/contact/%'] = array(
- 'page callback' => 'tripal_autocomplete_contact',
- 'page arguments' => array(6),
- 'access arguments' => array('access content'),
- 'file' => 'api/modules/tripal_chado.contact.api.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
- $items['admin/tripal/storage/chado/auto_name/feature/%'] = array(
- 'page callback' => 'tripal_autocomplete_feature',
- 'page arguments' => array(6),
- 'access arguments' => array('access content'),
- 'file' => 'api/modules/tripal_chado.feature.api.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
- $items['admin/tripal/storage/chado/auto_name/organism/%'] = array(
- 'page callback' => 'tripal_autocomplete_organism',
- 'page arguments' => array(6),
- 'access arguments' => array('access content'),
- 'file' => 'api/modules/tripal_chado.organism.api.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
-
-
-
- $items['admin/tripal/loaders/chado_vocabs'] = array(
- 'title' => 'Chado Vocabularies',
- 'description' => t('Tools facilitating management (including import) of controlled
- vocabularies and their terms into Chado.'),
- 'access arguments' => array('administer controlled vocabularies'),
- 'type' => MENU_NORMAL_ITEM,
- 'weight' => 6
- );
- $items['admin/tripal/loaders/chado_vocabs/chado_cv'] = array(
- 'title' => 'Manage Controlled Vocabularies',
- 'description' => 'View, edit and add controlled vocabularies used by this site.',
- 'page callback' => 'tripal_cv_admin_cv_listing',
- 'access arguments' => array('administer controlled vocabularies'),
- 'file' => 'includes/tripal_chado.cv.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_NORMAL_ITEM,
- );
- $items['admin/tripal/loaders/chado_vocabs/chado_cv/edit/%'] = array(
- 'title' => 'Edit a Controlled Vocabulary',
- 'description' => 'Edit the details such as name and description for an existing controlled vocabulary.',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_cv_cv_edit_form', 6),
- 'access callback' => 'user_access',
- 'access arguments' => array('administer controlled vocabularies'),
- 'file' => 'includes/tripal_chado.cv.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
- $items['admin/tripal/loaders/chado_vocabs/chado_cv/delete/%'] = array(
- 'title' => 'Delete a Controlled Vocabulary',
- 'description' => 'Delete a controlled vocabulary.',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_cv_cv_delete_form', 6),
- 'access callback' => 'user_access',
- 'access arguments' => array('administer controlled vocabularies'),
- 'file' => 'includes/tripal_chado.cv.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
- $items['admin/tripal/loaders/chado_vocabs/chado_cv/add'] = array(
- 'title' => 'Add a Controlled Vocabulary',
- 'description' => 'Manually a new controlled vocabulary.',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_cv_cv_add_form'),
- 'access callback' => 'user_access',
- 'access arguments' => array('administer controlled vocabularies'),
- 'file' => 'includes/tripal_chado.cv.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
- $items['admin/tripal/loaders/chado_vocabs/chado_cv/%/cvterm/add'] = array(
- 'title' => 'Add a Controlled Vocabulary Term',
- 'description' => 'Add a new controlled vocabulary term.',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_cv_cvterm_add_form', 5),
- 'access arguments' => array('administer controlled vocabularies'),
- 'file' => 'includes/tripal_chado.cv.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
- $items['admin/tripal/loaders/chado_vocabs/chado_cv/cvterm/add'] = array(
- 'title' => 'Add a Controlled Vocabulary Term',
- 'description' => 'Add a new controlled vocabulary term.',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_cv_cvterm_add_form'),
- 'access arguments' => array('administer controlled vocabularies'),
- 'file' => 'includes/tripal_chado.cv.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
- $items['admin/tripal/loaders/chado_vocabs/chado_cv/%/cvterm/edit/%'] = array(
- 'title' => 'Edit a Controlled Vocabulary Term',
- 'description' => 'Edit an existing controlled vocabulary term.',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_cv_cvterm_edit_form', 5, 8),
- 'access arguments' => array('administer controlled vocabularies'),
- 'file' => 'includes/tripal_chado.cv.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
- $items['admin/tripal/loaders/chado_vocabs/cvtermpath'] = array(
- 'title' => 'Update CV Term Paths',
- 'description' => 'The Chado cvtermpath table provides lineage for
- controlled vocabulary terms and is useful for quickly finding any
- ancestor parent of a term. If controlled vocabularies are loaded
- using the OBO Importer then the vocabulary is automatically added to
- the cvtermpath table. However, if it is needed, the addition of terms
- to the cvtermpath table can be manually executed here.',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_cv_cvtermpath_form'),
- 'access arguments' => array('administer controlled vocabularies'),
- 'file' => 'includes/tripal_chado.cv.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_NORMAL_ITEM,
- );
-
-
-
- $items['admin/tripal/loaders/chado_db'] = array(
- 'title' => 'Chado Databases',
- 'description' => 'View, edit and add external databases. When data originates
- from a remote online resource (or database) then that database must
- be added in order to cross link records in this site to records in
- the remote site.',
- 'page callback' => 'tripal_chado_admin_db_listing',
- 'access arguments' => array('administer db cross-references'),
- 'file' => 'includes/tripal_chado.db.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_NORMAL_ITEM,
- );
- $items['admin/tripal/loaders/chado_db/edit/%'] = array(
- 'title' => 'Edit a Database Reference',
- 'description' => 'Edit existing Database References.',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_chado_db_edit_form', 5),
- 'access callback' => 'user_access',
- 'access arguments' => array('administer db cross-references'),
- 'file' => 'includes/tripal_chado.db.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
- $items['admin/tripal/loaders/chado_db/add'] = array(
- 'title' => 'Create a Database Reference',
- 'description' => 'Create a new reference to an External Database.',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_chado_db_add_form'),
- 'access callback' => 'user_access',
- 'access arguments' => array('administer db cross-references'),
- 'file' => 'includes/tripal_chado.db.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
-
-
-
-
- $items['feature/%'] = array(
- 'page callback' => 'tripal_feature_match_features_page',
- 'page arguments' => array(1),
- 'access arguments' => array('access chado_feature content'),
- 'type' => MENU_LOCAL_TASK,
- );
-
- $items['find/sequences'] = array(
- 'title' => 'Sequence Retrieval',
- 'description' => 'Download a file of sequences',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_chado_feature_seq_extract_form'),
- 'access arguments' => array('access content'),
- 'file' => 'includes/tripal_chado.seq_extract.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
- $items['find/sequences/download'] = array(
- 'page callback' => 'tripal_chado_feature_seq_extract_download',
- 'access arguments' => array('access content'),
- 'file' => 'includes/tripal_chado.seq_extract.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK,
- );
-
-
-
- $items['find/publications' ]= array(
- 'title' => 'Publication Search',
- 'description' => ('Search for publications'),
- 'page callback' => 'tripal_chado_pub_search_page',
- 'access arguments' => array('access content'),
- 'file' => 'includes/tripal_chado.pub_search.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_CALLBACK
- );
- $items['find/publications/criteria/%/%'] = array(
- 'page callback' => 'tripal_chado_pub_search_page_update_criteria',
- 'page arguments' => array(5, 6),
- 'access arguments' => array('access content'),
- 'file' => 'includes/tripal_chado.pub_search.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type ' => MENU_CALLBACK,
- );
- $items['admin/tripal/storage/chado/pub-search-config'] = array(
- 'title' => 'Publication Search Settings',
- 'description' => 'Configure the settings for the publication search.',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_chado_pub_search_admin_form'),
- 'file' => 'includes/tripal_chado.pub_search.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- 'type' => MENU_NORMAL_ITEM,
- 'access arguments' => array('administer tripal'),
- );
-
-
-
-
- $items['phylotree/%'] = array(
- 'page callback' => 'tripal_phylogeny_ajax_get_tree_json',
- 'page arguments' => array(1),
-
- 'access callback' => TRUE,
- 'file' => 'includes/tripal_chado.phylotree.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- );
- $items['admin/tripal/storage/chado/phylogeny'] = array(
- 'title' => 'Phylogeny and Taxonomy',
- 'description' => 'Settings for display of phylogenetic and taxonomic trees.',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('tripal_phylogeny_default_plots_form'),
- 'access arguments' => array('administer tripal'),
- 'type' => MENU_NORMAL_ITEM,
- 'weight' => 2,
- 'file' => 'includes/tripal_chado.phylotree.inc',
- 'file path' => drupal_get_path('module', 'tripal_chado'),
- );
- return $items;
- }
- function tripal_chado_permission() {
- return array(
- 'install chado' => array(
- 'title' => t('Install Chado'),
- 'description' => t('Allow the user to install or upgrade a Chado database in the existing Drupal database.')
- ),
- 'view chado_ids' => array(
- 'title' => t('View Internal IDs'),
- 'description' => t('On content pages Tripal will typically provide
- a table of information pulled from the Chado database but the
- primary key IDs for that data is typically not shown. The
- default Tripal templates can show the primary key ID inside of a
- blue shaded table row if this permission is enabled. This can
- be useful for site developers who might want these IDs when working
- with the underlying database.'),
- 'restrict access' => TRUE,
- ),
- 'administer chado mviews' => array(
- 'title' => t('Administer Chado Materialized Views'),
- 'description' => t('Allows the user to create, edit and populate materialized views in the Chado databse.'),
- ),
- 'administer chado custom tables' => array(
- 'title' => t('Administer Chado Custom Tables'),
- 'description' => t('Allows the user to create, edit and delete custom tables in the Chado database.'),
- ),
- 'administer db cross-references' => array(
- 'title' => t('Administer Chado Databases'),
- 'description' => t('Allows the user to create, edit and delete database records in the Chado database.')
- ),
- 'administer controlled vocabularies' => array(
- 'title' => t('Administer Chado Controlled Vocabularies'),
- 'description' => t('Allows the user to create, edit and delete controlled vocabularies in the Chado database.')
- ),
- 'administer chado semantic web' => array(
- 'title' => t('Administer Semantic Web and Chado Integration'),
- 'description' => t('Allows the user to assign controlled vocabulary terms to tables and table columns in Chado.')
- ),
- );
- }
- function tripal_chado_theme($existing, $type, $theme, $path) {
- $themes = array(
-
- 'tripal_chado_feature_seq_extract_form' => array(
- 'render element' => 'form',
- ),
- 'tripal_chado_date_combo' => array(
- 'render element' => 'element',
- 'file' => 'theme/tripal_chado.theme.inc',
- ),
-
- 'tripal_pub_importer_setup_form_elements' => array(
- 'render element' => 'form',
- 'file' => 'includes/loaders/tripal_chado.pub_importers.inc',
- ),
- 'tripal_chado_pub_search_setup_form_elements' => array(
- 'render element' => 'form',
- 'file' => 'includes/tripal_chado.pub_search.inc',
- ),
- 'tripal_phylogeny_admin_org_color_tables' => array(
- 'render element' => 'element',
- )
- );
-
-
- if (module_exists('tripal_core')) {
- $core_path = drupal_get_path('module', 'tripal_core');
-
- $enabled_templates = variable_get('tripal_chado_enabled_legacy_templates', array());
-
- $bundles = db_select('tripal_bundle', 'tb')
- ->fields('tb')
- ->execute();
-
-
-
- while ($bundle = $bundles->fetchObject()) {
- $term = tripal_load_term_entity(array('term_id' => $bundle->term_id));
- $vocab = $term->vocab;
- $params = array(
- 'vocabulary' => $vocab->vocabulary,
- 'accession' => $term->accession,
- );
- $mapped_table = chado_get_cvterm_mapping($params);
-
- if (!$mapped_table) {
- continue;
- }
- $chado_table = $mapped_table->chado_table;
- $legacy_template = 'legacy_template--chado_' . $chado_table;
- if (key_exists($legacy_template, $enabled_templates) && $enabled_templates[$legacy_template]) {
- $themes['TripalEntity__' . $bundle->name] = array(
- 'template' => 'node--chado-generic',
- 'render element' => 'entity',
- 'base hook' => 'entity',
- 'path' => "$core_path/theme/templates",
- );
- }
- }
- }
- return $themes;
- }
- function tripal_chado_preprocess(&$variables, $hook) {
- if ($hook == 'entity' and array_key_exists('TripalEntity', $variables)) {
-
-
- $variables['teaser'] = FALSE;
- $variables['node'] = $variables['TripalEntity'];
- }
- }
- function tripal_chado_exclude_type_by_default() {
- return array('text' => 'strlen("<field_value> ") > 250');
- }
- function tripal_chado_job_describe_args($callback, $args) {
- $new_args = array();
- if ($callback == 'tripal_populate_mview') {
-
- $sql = "SELECT * FROM {tripal_mviews} WHERE mview_id = :mview_id ";
- $results = db_query($sql, array(':mview_id' => $args[0]));
- $mview = $results->fetchObject();
- $new_args['View Name'] = $mview->name;
- }
- elseif ($callback == 'tripal_install_chado') {
- $new_args['Action'] = $args[0];
- }
- return $new_args;
- }
- function tripal_chado_node_delete($node) {
- $nid = $node->nid;
- $sql = "UPDATE chado_entity SET nid = NULL WHERE nid = :nid";
-
- }
- function tripal_chado_form_field_ui_field_edit_form_alter(&$form, &$form_state, $form_id) {
-
-
-
-
-
-
- if ($form['#instance']['entity_type'] == 'TripalEntity') {
- if ($form['#field']['storage']['type'] == 'field_chado_storage' and
- $form['#field']['type'] != 'chado_linker__prop') {
- $form['field']['cardinality']['#access'] = FALSE;
- $form['instance']['required']['#access'] = FALSE;
- }
- }
-
- }
- function tripal_feature_match_features_page($id) {
-
-
-
- $sql = "
- SELECT source
- FROM {url_alias}
- WHERE alias = :alias
- ";
- $match = db_query($sql, array(':alias' => "feature/$id"))->fetchObject();
- if ($match) {
- drupal_goto($match->source);
- return;
- }
- $sql = "
- SELECT
- F.name, F.uniquename, F.feature_id,
- O.genus, O.species, O.organism_id,
- CVT.cvterm_id, CVT.name as type_name,
- array_agg(S.name) as synonyms
- FROM {feature} F
- INNER JOIN {organism} O on F.organism_id = O.organism_id
- INNER JOIN {cvterm} CVT on CVT.cvterm_id = F.type_id
- LEFT JOIN {feature_synonym} FS on FS.feature_id = F.feature_id
- LEFT JOIN {synonym} S on S.synonym_id = FS.synonym_id
- WHERE
- F.uniquename = :uname or
- F.name = :fname or
- S.name = :sname
- GROUP BY F.name, F.uniquename, F.feature_id, O.genus, O.species,
- O.organism_id, CVT.cvterm_id, CVT.name
- ";
- $args = array(':uname' => $id, ':fname' => $id, ':sname' => $id);
- $results = chado_query($sql, $args);
- $num_matches = $results->rowCount();
-
- if ($num_matches == 0) {
- drupal_set_message("No features matched the given name '$id'", 'warning');
- return "No matches found";
- }
-
-
- elseif ($num_matches == 1) {
- $curr_match = $results->fetchObject();
- $entity_id = chado_get_record_entity_by_table('feature', $curr_match->feature_id);
- if ($entity_id) {
- drupal_goto("bio_data/" . $entity_id);
- return;
- }
-
-
- if (module_exists(tripal_feature)) {
- $nid = chado_get_nid_from_id('feature', $curr_match->feature_id);
- drupal_goto("node/" . $nid);
- return;
- }
-
- drupal_set_message("No published features matched the given name '$id'", 'warning');
- return "No matches found";
- }
- elseif ($num_matches > 1) {
-
- $header = array('Uniquename', 'Name', 'Type', 'Species', 'Synonyms');
- $rows = array();
- while ($match = $results->fetchObject()) {
- $curr_match = $match;
- $synonyms = $match->synonyms;
- $synonyms = preg_replace('/[\"\{\}]/', '', $synonyms);
-
- $entity_id = chado_get_record_entity_by_table('feature', $curr_match->feature_id);
- $link = '';
- if ($entity_id) {
- $link = "bio_data/" . $entity_id;
- }
-
-
- if (!$entity_id and module_exists('tripal_feature')) {
- $nid = chado_get_nid_from_id('feature', $curr_match->feature_id);
- $link = "node/" . $nid;
- }
- if (!$link) {
- continue;
- }
- $rows[] = array(
- $match->uniquename,
- l($match->name, $link),
- $match->type_name,
- '<i>' . $match->genus . ' ' . $match->species . '</i>',
- $synonyms,
- );
- $num_matches++;
- }
- $table_attrs = array('class' => 'tripal-data-table');
- $output = "<p>The following features match the name '$id'.</p>";
- $output .= theme_table($header, $rows, $table_attrs, $caption);
- return $output;
- }
- }
|