From 4838b150a02f55669002430b865e5d285eb1bd30 Mon Sep 17 00:00:00 2001 From: preecej Date: Wed, 18 Jul 2012 02:52:09 +0000 Subject: [PATCH] Added TO (Trait Ontology) web service and db access, fixed Annotation form bug on listing Publications (no more tilde wildcards.) svn path=/; revision=364 --- planteome/paw/forms/Annotation.wiki | 4 ++-- planteome/paw/local_settings/dev.LocalSettings.php | 1 - planteome/paw/services/TermSearch_JSON.php | 11 ++++++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/planteome/paw/forms/Annotation.wiki b/planteome/paw/forms/Annotation.wiki index 7d7ac0b..69db501 100644 --- a/planteome/paw/forms/Annotation.wiki +++ b/planteome/paw/forms/Annotation.wiki @@ -184,8 +184,8 @@ __NOTOC__ Need to add a reference to a publication without a PubMed ID or DOI (Digital Object Identifier)?
{{#formlink:form=Publication|link text=Add a new publication reference|link type=|query string=Publication[New Annotation Reference]={{PAGENAME}} }} - {{#if: {{#ask:[[Category:Publications]][[Is Associated With Annotations::~*{{PAGENAME}}* ]] OR [[Category:Reference Publications]][[Is Associated With Annotations::~*{{PAGENAME}}* ]] }} - | {{#ask:[[Category:Publications]][[Is Associated With Annotations::~*{{PAGENAME}}* ]] OR [[Category:Reference Publications]][[Is Associated With Annotations::~*{{PAGENAME}}* ]] + {{#if: {{#ask:[[Category:Publications]][[Is Associated With Annotations::{{PAGENAME}} ]] OR [[Category:Reference Publications]][[Is Associated With Annotations::{{PAGENAME}} ]] }} + | {{#ask:[[Category:Publications]][[Is Associated With Annotations::{{PAGENAME}} ]] OR [[Category:Reference Publications]][[Is Associated With Annotations::{{PAGENAME}} ]] |? has First Author |? has Publication Title |? has Journal Name diff --git a/planteome/paw/local_settings/dev.LocalSettings.php b/planteome/paw/local_settings/dev.LocalSettings.php index 3b264e1..1b0dff4 100644 --- a/planteome/paw/local_settings/dev.LocalSettings.php +++ b/planteome/paw/local_settings/dev.LocalSettings.php @@ -167,7 +167,6 @@ $wgCachePages = false; * */ $wgCacheEpoch = 'date +%Y%m%d%H%M%S'; - # When you make changes to this configuration file, this will make # sure that cached pages are cleared. $wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', @filemtime( __FILE__ ) ) ); diff --git a/planteome/paw/services/TermSearch_JSON.php b/planteome/paw/services/TermSearch_JSON.php index d127a66..277a5d2 100644 --- a/planteome/paw/services/TermSearch_JSON.php +++ b/planteome/paw/services/TermSearch_JSON.php @@ -5,7 +5,7 @@ if(isset($_GET['user']) && ($_GET['user']) == 'paw') { $arr_field_names = array('name','acc'); - $arr_ontologies = array('go','po'); + $arr_ontologies = array('go','po','to'); /* read the params and/or set our own */ $type = isset($_GET['type']) ? $_GET['type'] : autocomplete; // autocomplete is the default @@ -48,6 +48,13 @@ if(isset($_GET['user']) && ($_GET['user']) == 'paw') { $term_types = "'biological_process','cellular_component','molecular_function'"; break; + case 'to': + $link = mysql_connect($_SERVER['to_host'], $_SERVER['to_user'], $_SERVER['to_pw']) or die('Cannot connect to the DB'); + mysql_select_db($_SERVER['to_db'],$link) or die('Cannot select the DB'); + + $term_types = "'plant_trait_ontology'"; + break; + default: die('Sorry, this ontology type is not available.'); } @@ -111,6 +118,8 @@ if(isset($_GET['user']) && ($_GET['user']) == 'paw') { $term_type_formal = "Cellular Component"; break; case 'molecular_function': $term_type_formal = "Molecular Function"; break; + case 'plant_trait_ontology': + $term_type_formal = "Plant Trait Ontology"; break; } $terms[] = array( 'name'=>$term['name'], -- 2.34.1