12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196 |
- <?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/tripal_chado.DEPRECATED.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 'api/modules/tripal_chado.module.DEPRECATED.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' => 'chado_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' => 'chado_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' => 'chado_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' => 'chado_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' => 'chado_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' => 'chado_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 Chado CVs',
- '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 == 'chado_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;
- }
-
-
- if (array_key_Exists('chado_table', $form['#instance']['settings'])) {
- $form['instance']['settings']['base_table'] = array(
- '#type' => 'value',
- '#value' => $form['#instance']['settings']['base_table'],
- );
- $form['instance']['settings']['chado_table'] = array(
- '#type' => 'value',
- '#value' => $form['#instance']['settings']['chado_table'],
- );
- $form['instance']['settings']['chado_column'] = array(
- '#type' => 'value',
- '#value' => $form['#instance']['settings']['chado_column'],
- );
- }
- }
-
- }
- 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(array(
- 'header' => $header,
- 'rows' => $rows,
- 'attributes' => $table_attrs,
- 'caption' => $caption
- ));
- return $output;
- }
- }
|