From: <rv...@us...> - 2009-06-27 07:04:56
|
Revision: 133 http://treebase.svn.sourceforge.net/treebase/?rev=133&view=rev Author: rvos Date: 2009-06-27 07:04:54 +0000 (Sat, 27 Jun 2009) Log Message: ----------- This commit fixes issue 2810620 Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/EditTaxonLabelController.java trunk/treebase-web/src/main/webapp/WEB-INF/pages/editTaxonLabel.jsp Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/EditTaxonLabelController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/EditTaxonLabelController.java 2009-06-26 15:41:18 UTC (rev 132) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/EditTaxonLabelController.java 2009-06-27 07:04:54 UTC (rev 133) @@ -225,12 +225,23 @@ } else { // 2b - Integer ncbiId = getTaxonLabelService().findNcbiTaxIdByUBIOTaxId(manualId); - String ncbiPreferredName = getTaxonLabelService().getNCBIPreferredName(ncbiId.toString()); - Taxon newTaxon = new Taxon(ncbiPreferredName,manualId,ncbiId); + TaxonLabelService taxonLabelService = getTaxonLabelService(); + Integer ncbiId = taxonLabelService.findNcbiTaxIdByUBIOTaxId(manualId); + Taxon newTaxon = null; + TaxonVariant newVariant = null; + if ( null != ncbiId ) { + String ncbiPreferredName = taxonLabelService.getNCBIPreferredName(ncbiId.toString()); + newTaxon = new Taxon(ncbiPreferredName,manualId,ncbiId); + newVariant = new TaxonVariant(manualId,taxonLabel.getTaxonLabel(),ncbiPreferredName,"canonical form"); + } + else { + newTaxon = new Taxon(); + newTaxon.setName(taxonLabel.getTaxonLabel()); + newTaxon.setUBioNamebankId(manualId); + newVariant = new TaxonVariant(manualId,taxonLabel.getTaxonLabel(),taxonLabel.getTaxonLabel(),"canonical form"); + } + newVariant.setTaxon(newTaxon); getTaxonHome().store(newTaxon); - TaxonVariant newVariant = new TaxonVariant(manualId,taxonLabel.getTaxonLabel(),ncbiPreferredName,"canonical form"); - newVariant.setTaxon(newTaxon); getTaxonHome().store(newVariant); variant = newVariant; } Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/editTaxonLabel.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/editTaxonLabel.jsp 2009-06-26 15:41:18 UTC (rev 132) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/editTaxonLabel.jsp 2009-06-27 07:04:54 UTC (rev 133) @@ -71,17 +71,25 @@ <c:set var="counter" value="${counter+1}"/> </c:forEach> <div> + <input type="radio" name="taxonvariantid" id="textBoxRadio" value="-1"/> + I did a uBio lookup for + <spring:bind path="txnlabel.taxonLabel"> + <a href="http://www.ubio.org/browser/search.php?search_all=<c:out value="${status.value}"/>" title="uBio taxonomy" target="_new"> + <img src="<fmt:message key="icons.weblink"/>" class="iconButton"/><c:out value="${status.value}"/></a> + </spring:bind> + and here is the namebank id: + <script type="text/javascript"> + function selectRadio(textBoxRadio) { + alert($(textBoxRadio)); + $(textBoxRadio).checked = true; + } + </script> + <input style="width:100px" class="textCell" type="text" name="manualid" onchange="selectRadio('textBoxRadio')" value=""/> + </div> + <div> <input type="radio" name="taxonvariantid" value="-1" - <c:if test="${counter==0}">checked="checked"</c:if> /><em>no association</em> - </div> - or enter taxon id by hand: - <input style="width:100px" class="textCell" type="text" name="manualid" value=""/> - from - <spring:bind path="txnlabel.taxonLabel"> - <a href="http://www.ubio.org/browser/search.php?search_all=<c:out value="${status.value}"/>" title="uBio taxonomy" target="_new"> - <img src="<fmt:message key="icons.weblink"/>" class="iconButton"/> uBio - </a> - </spring:bind> + <c:if test="${counter==0}">checked="checked"</c:if> /> <em>no association</em> + </div> </fieldset> <input type="submit" name="Update" value="<fmt:message key="button.update"/>" /> <input type="submit" name="_cancel" value="<fmt:message key="button.cancel"/>" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |