From: <sfr...@us...> - 2011-05-05 19:43:10
|
Revision: 829 http://treebase.svn.sourceforge.net/treebase/?rev=829&view=rev Author: sfrgpiel Date: 2011-05-05 19:43:04 +0000 (Thu, 05 May 2011) Log Message: ----------- Some minor edits as a result of feedback from the PRF board Modified Paths: -------------- trunk/treebase-web/src/main/resources/ApplicationResources.properties trunk/treebase-web/src/main/webapp/WEB-INF/pages/dataMan.jsp trunk/treebase-web/src/main/webapp/WEB-INF/pages/studyForm.jsp Modified: trunk/treebase-web/src/main/resources/ApplicationResources.properties =================================================================== --- trunk/treebase-web/src/main/resources/ApplicationResources.properties 2011-05-05 14:29:07 UTC (rev 828) +++ trunk/treebase-web/src/main/resources/ApplicationResources.properties 2011-05-05 19:43:04 UTC (rev 829) @@ -79,7 +79,7 @@ nav.search=Search nav.search.treebase=Search TreeBASE nav.submit=Submit -nav.dataman=NSF Data Management Plan +nav.dataman=NSF Data Management nav.stats=Stats nav.referee=Referee nav.urlapi= URL API Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/dataMan.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/dataMan.jsp 2011-05-05 14:29:07 UTC (rev 828) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/dataMan.jsp 2011-05-05 19:43:04 UTC (rev 829) @@ -33,8 +33,8 @@ <hr /></p> <table width="100%" border="0"> <tr> - <td width="50%" valign="top">Data storage contribution for sponsored research:</td> - <td width="50%" valign="top">Alternatively, please consider a donation towards TreeBASE activities:</td> + <td width="50%" valign="top">Data storage fee for submissions resulting from sponsored research where TreeBASE provides added validation to help with data preparation and to ensure compliance with NSF directives:</td> + <td width="50%" valign="top">Alternatively, for sponsored research that had not budgeted for data sharing with TreeBASE, please consider making a voluntary donation:</td> </tr> <tr> <td><form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/studyForm.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/studyForm.jsp 2011-05-05 14:29:07 UTC (rev 828) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/studyForm.jsp 2011-05-05 19:43:04 UTC (rev 829) @@ -5,11 +5,15 @@ <c:choose> <c:when test="${empty study.submission.id}"> <content tag="heading">Create New Submission</content> - <p>Please complete the following submission information </p> + <p>Please provide a brief title for your study. Usually this is the same title as the title of your pubication.</p> + <p>The notes for your study are not for the public, but are there for your own benefit and for communicating with TreeBASE staff once your submission status is ready to be made public. </p> + <p>If your submission is part of a sponsored research data management plan, please indicate this in the Notes so that TreeBASE staff know to provide added attention and to assist in making your submission fully compliant with the expectations of the of the sponsor. For more information, see the <a href="/treebase-web/dataMan.html" target="_blank">NSF Data Management Plan instructions</a>. </p> </c:when> <c:otherwise> <content tag="heading">Update Submission</content> - <p>Please update the following submission information </p> + <p>Please update the following submission information as needed.</p> + <p>The notes for your study are not for the public, but are there for your own benefit and for communicating with TreeBASE staff once your submission status is ready to be made public. </p> + <p>If your submission is part of a sponsored research data management plan, please indicate this in the Notes so that TreeBASE staff know to provide added attention and to assist in making your submission fully compliant with the expectations of the of the sponsor. For more information, see the <a href="/treebase-web/dataMan.html" target="_blank">NSF Data Management Plan instructions</a>. </p> </c:otherwise> </c:choose> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2011-05-17 21:03:45
|
Revision: 871 http://treebase.svn.sourceforge.net/treebase/?rev=871&view=rev Author: hshyket Date: 2011-05-17 21:03:38 +0000 (Tue, 17 May 2011) Log Message: ----------- Changing search so that there are no longer multiple buttons but a dropdown of the list of options Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/matrixSimpleSearchForm.jsp trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/studyKeywordSearchForm.jsp trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/treeSimpleSearchForm.jsp Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java 2011-05-17 20:17:26 UTC (rev 870) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java 2011-05-17 21:03:38 UTC (rev 871) @@ -378,6 +378,7 @@ protected void saveSearchResults(HttpServletRequest request, SearchResults<?> results) { request.getSession().setAttribute("searchResults", results == null ? null : results.freeze()); request.getSession().setAttribute("searchTerm", request.getParameter("searchTerm")); + request.getSession().setAttribute("searchButton", request.getParameter("searchButton")); } abstract SearchResultsType currentSearchType() ; @@ -477,6 +478,17 @@ return matches; } + protected Map<String,Object> referenceData(HttpServletRequest pRequest) throws Exception { + LOGGER.info("in referenceData"); + + Map<String,Object> resultMap = new HashMap<String,Object>(); + + resultMap.put("buttonName", pRequest.getSession().getAttribute("searchButton")); + + return resultMap; + + } + public SearchService getSearchService() { return searchService; } Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/matrixSimpleSearchForm.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/matrixSimpleSearchForm.jsp 2011-05-17 20:17:26 UTC (rev 870) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/matrixSimpleSearchForm.jsp 2011-05-17 21:03:38 UTC (rev 871) @@ -1,13 +1,26 @@ <%@ include file="/common/taglibs.jsp"%> +<% + java.util.LinkedHashMap searchOptions = new java.util.LinkedHashMap(); + searchOptions.put("matrixID", "Matrix ID"); + searchOptions.put("matrixTitle", "Title"); + searchOptions.put("matrixType", "Type"); + searchOptions.put("matrixNTAX", "NTAX"); + searchOptions.put("matrixNCHAR", "NCHAR"); + + pageContext.setAttribute("searchOptions", searchOptions); +%> <form id="searchSimple" method="post"> <fieldset> Search: <input type="hidden" name="formName" value="matrixSimple"/> <input type=text class="textCell" style="width:150px" name="searchTerm" id="keyword" value="${searchTerm}"/> - <button type="submit" name="searchButton" value="matrixID">Matrix ID</button> - <button type="submit" name="searchButton" value="matrixTitle">Title</button> - <button type="submit" name="searchButton" value="matrixType">Type</button> - <button type="submit" name="searchButton" value="matrixNTAX">NTAX</button> - <button type="submit" name="searchButton" value="matrixNCHAR">NCHAR</button> + <select name="searchButton"> + <c:forEach var="options" items="${searchOptions}"> + <option value="${options.key}" <c:if test="${options.key == searchButton}">selected="selected"</c:if> /> + ${options.value} + </option> + </c:forEach> + </select> + <button type="submit" name="submit" >Search</button> <a href="#" class="openHelp" onclick="openHelp('matrixSimpleSearchForm')"> <img class="iconButton" src="<fmt:message key="icons.help"/>" /> </a> Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/studyKeywordSearchForm.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/studyKeywordSearchForm.jsp 2011-05-17 20:17:26 UTC (rev 870) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/studyKeywordSearchForm.jsp 2011-05-17 21:03:38 UTC (rev 871) @@ -1,16 +1,30 @@ <%@ include file="/common/taglibs.jsp"%> +<% + java.util.LinkedHashMap searchOptions = new java.util.LinkedHashMap(); + searchOptions.put("studyID", "Study ID"); + searchOptions.put("legacyStudyID", "Legacy Study ID"); + searchOptions.put("authorKeyword", "Author"); + searchOptions.put("titleKeyword", "Title"); + searchOptions.put("abstractKeyword", "Abstract"); + searchOptions.put("citationKeyword", "Entire citation"); + searchOptions.put("textKeyword", "All text"); + + pageContext.setAttribute("searchOptions", searchOptions); + +%> <form id="searchSimple" method="post"> <fieldset> For study IDs with values less than 3000, please search using the "Legacy Study ID" button.<br> Search: <input type="hidden" name="formName" value="searchKeyword"/> <input type="text" class="textCell" style="width:150px" name="searchTerm" id="keyword" value="${searchTerm}"/> - <button type="submit" name="searchButton" value="studyID">Study ID</button> - <button type="submit" name="searchButton" value="legacyStudyID">Legacy Study ID</button> - <button type="submit" name="searchButton" value="authorKeyword">Author</button> - <button type="submit" name="searchButton" value="titleKeyword">Title</button> - <button type="submit" name="searchButton" value="abstractKeyword">Abstract</button> - <button type="submit" name="searchButton" value="citationKeyword">Entire citation</button> - <button type="submit" name="searchButton" value="textKeyword">All text</button> + <select name="searchButton"> + <c:forEach var="options" items="${searchOptions}"> + <option value="${options.key}" <c:if test="${options.key == searchButton}">selected="selected"</c:if> /> + ${options.value} + </option> + </c:forEach> + </select> + <button type="submit" name="submit" >Search</button> <a href="#" class="openHelp" onclick="openHelp('studyKeywordSearchForm')"> <img class="iconButton" src="<fmt:message key="icons.help"/>" /> </a> Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/treeSimpleSearchForm.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/treeSimpleSearchForm.jsp 2011-05-17 20:17:26 UTC (rev 870) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/treeSimpleSearchForm.jsp 2011-05-17 21:03:38 UTC (rev 871) @@ -1,14 +1,27 @@ <%@ include file="/common/taglibs.jsp"%> +<% + java.util.LinkedHashMap searchOptions = new java.util.LinkedHashMap(); + searchOptions.put("treeID", "Tree ID"); + searchOptions.put("treeTitle", "Title"); + searchOptions.put("treeType", "Type"); + searchOptions.put("treeKind", "Kind"); + searchOptions.put("treeQuality", "Quality"); + searchOptions.put("treeNTAX", "NTAX"); + + pageContext.setAttribute("searchOptions", searchOptions); +%> <form id="searchSimple" method="post"> <fieldset> Search: <input type="hidden" name="formName" value="treeSimple"/> <input type="text" class="textCell" style="width:150px" name="searchTerm" id="keyword" value="${searchTerm}"/> - <button type="submit" name="searchButton" value="treeID">Tree ID</button> - <button type="submit" name="searchButton" value="treeTitle">Title</button> - <button type="submit" name="searchButton" value="treeType">Type</button> - <button type="submit" name="searchButton" value="treeKind">Kind</button> - <button type="submit" name="searchButton" value="treeQuality">Quality</button> - <button type="submit" name="searchButton" value="treeNTAX">NTAX</button> + <select name="searchButton"> + <c:forEach var="options" items="${searchOptions}"> + <option value="${options.key}" <c:if test="${options.key == searchButton}">selected="selected"</c:if> /> + ${options.value} + </option> + </c:forEach> + </select> + <button type="submit" name="submit" >Search</button> <a href="#" class="openHelp" onclick="openHelp('treeSimpleSearchForm')"> <img class="iconButton" src="<fmt:message key="icons.help"/>" /> </a> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2011-06-02 17:24:12
|
Revision: 895 http://treebase.svn.sourceforge.net/treebase/?rev=895&view=rev Author: hshyket Date: 2011-06-02 15:58:44 +0000 (Thu, 02 Jun 2011) Log Message: ----------- Adding in meta tags so that Google, Yahoo! and Bing can verify the site through their webmaster tools. Adding in functionality to generate a sitemap.xml so that the bots can index the submissions. Modified Paths: -------------- trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml trunk/treebase-web/src/main/webapp/WEB-INF/web.xml trunk/treebase-web/src/main/webapp/common/meta.jsp Added Paths: ----------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SiteMapController.java trunk/treebase-web/src/main/webapp/WEB-INF/pages/sitemap.jsp Added: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SiteMapController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SiteMapController.java (rev 0) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SiteMapController.java 2011-06-02 15:58:44 UTC (rev 895) @@ -0,0 +1,55 @@ + + + +package org.cipres.treebase.web.controllers; + + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.cipres.treebase.domain.study.Submission; +import org.cipres.treebase.domain.study.SubmissionService; + +import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.servlet.mvc.Controller; + + + +/** + * @author mjd 20080701 + */ +public class SiteMapController implements Controller{ + /** + * Logger for this class + */ + //private static final Logger LOGGER = Logger.getLogger(SearchController.class); + private SubmissionService mSubmissionService; + + public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) + throws Exception { + + List<String> phyloURL = new ArrayList<String>(); + + Collection<Submission> submissions = mSubmissionService.findPublishedSubmissions(); + + for ( Submission submission : submissions ) { + phyloURL.add(submission.getStudy().getPhyloWSPath().getPurl().toString()); + } + + return new ModelAndView("sitemap", "phyloURL", phyloURL); + } + + public SubmissionService getSubmissionService() { + return mSubmissionService; + } + + public void setSubmissionService(SubmissionService pNewSubmissionService) { + mSubmissionService = pNewSubmissionService; + } +} + + Added: trunk/treebase-web/src/main/webapp/WEB-INF/pages/sitemap.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/sitemap.jsp (rev 0) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/sitemap.jsp 2011-06-02 15:58:44 UTC (rev 895) @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<%@ include file="/common/taglibs.jsp"%> +<% response.setContentType("application/xml; charset=UTF-8"); %> +<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> + <c:forEach var="url" items="${phyloURL}" varStatus="status"> + <url> + <loc><c:out value="${url}"/>?format=html</loc> + </url> + </c:forEach> +</urlset> \ No newline at end of file Modified: trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml 2011-06-01 18:47:29 UTC (rev 894) +++ trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml 2011-06-02 15:58:44 UTC (rev 895) @@ -190,6 +190,11 @@ <property name="submissionService"><ref bean="submissionService"></ref></property> </bean> + <!-- View SiteMap --> + <bean id="siteMapController" class="org.cipres.treebase.web.controllers.SiteMapController"> + <property name="submissionService"><ref bean="submissionService"></ref></property> + </bean> + <!-- View Taxa --> <bean id="listTaxaController" class="org.cipres.treebase.web.controllers.ListTaxaController"> <property name="studyService"><ref bean="studyService"></ref></property> @@ -1040,8 +1045,10 @@ <prop key="/search/downloadAMatrix.html">downloadAMatrixController</prop> <prop key="/search/downloadAnAnalysisStep.html">downloadAnAnalysisStepController</prop> <prop key="/search/downloadANexusFile.html">downloadANexusFileController</prop> - <prop key="/search/downloadANexusRCTFile.html">downloadANexusRCTFileController</prop> + <prop key="/search/downloadANexusRCTFile.html">downloadANexusRCTFileController</prop> + <prop key="/sitemap.xml">siteMapController</prop> + <!-- SUBMISSION SECTION --> <prop key="/user/updateProfile.html">userFormController</prop> <prop key="/user/submissionList.html">listSubmissionController</prop> Modified: trunk/treebase-web/src/main/webapp/WEB-INF/web.xml =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/web.xml 2011-06-01 18:47:29 UTC (rev 894) +++ trunk/treebase-web/src/main/webapp/WEB-INF/web.xml 2011-06-02 15:58:44 UTC (rev 895) @@ -276,6 +276,10 @@ </servlet-mapping> <servlet-mapping> <servlet-name>treebase</servlet-name> + <url-pattern>*.xml</url-pattern> + </servlet-mapping> + <servlet-mapping> + <servlet-name>treebase</servlet-name> <url-pattern>*.rdf</url-pattern> </servlet-mapping> <servlet-mapping> Modified: trunk/treebase-web/src/main/webapp/common/meta.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/common/meta.jsp 2011-06-01 18:47:29 UTC (rev 894) +++ trunk/treebase-web/src/main/webapp/common/meta.jsp 2011-06-02 15:58:44 UTC (rev 895) @@ -6,6 +6,9 @@ <meta http-equiv="Expires" content="0"/> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> <meta name="author" content="Rutger A. Vos (rut...@gm...)"/> +<meta name="google-site-verification" content="9Lr7BwyD6VMDIk5dENnSt_2YsUdpq_aEhnee0mMTxrw" /> +<META name="y_key" content="8c736195266b5ebb" /> +<meta name="msvalidate.01" content="D931446190993D0D2D719F2978AC44EB" /> <link rel="icon" href="<c:url value="/images/favicon.ico"/>"/> <% String ua = request.getHeader( "User-Agent" ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2011-06-03 18:53:57
|
Revision: 898 http://treebase.svn.sourceforge.net/treebase/?rev=898&view=rev Author: hshyket Date: 2011-06-03 18:53:51 +0000 (Fri, 03 Jun 2011) Log Message: ----------- Fixing sitemap so that it doesn't point to the PURL links but to the actual study URLs in TreeBASE. Google was not able to index the PURL links because it went to an external source Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SiteMapController.java trunk/treebase-web/src/main/webapp/WEB-INF/pages/sitemap.jsp Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SiteMapController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SiteMapController.java 2011-06-02 19:55:32 UTC (rev 897) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SiteMapController.java 2011-06-03 18:53:51 UTC (rev 898) @@ -11,6 +11,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.cipres.treebase.TreebaseUtil; import org.cipres.treebase.domain.study.Submission; import org.cipres.treebase.domain.study.SubmissionService; @@ -37,7 +38,10 @@ Collection<Submission> submissions = mSubmissionService.findPublishedSubmissions(); for ( Submission submission : submissions ) { - phyloURL.add(submission.getStudy().getPhyloWSPath().getPurl().toString()); + //Google web crawler does not like external links in the sitemap + //phyloURL.add(submission.getStudy().getPhyloWSPath().getPurl().toString()); + phyloURL.add(TreebaseUtil.getSiteUrl() + "search/study/summary.html?id=" + submission.getStudy().getId().toString()); + } return new ModelAndView("sitemap", "phyloURL", phyloURL); Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/sitemap.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/sitemap.jsp 2011-06-02 19:55:32 UTC (rev 897) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/sitemap.jsp 2011-06-03 18:53:51 UTC (rev 898) @@ -4,7 +4,7 @@ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <c:forEach var="url" items="${phyloURL}" varStatus="status"> <url> - <loc><c:out value="${url}"/>?format=html</loc> + <loc><c:out value="${url}"/></loc> </url> </c:forEach> </urlset> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sfr...@us...> - 2011-06-17 02:29:01
|
Revision: 920 http://treebase.svn.sourceforge.net/treebase/?rev=920&view=rev Author: sfrgpiel Date: 2011-06-17 02:28:54 +0000 (Fri, 17 Jun 2011) Log Message: ----------- Separating out the submission tutorial instructions along with some youtube videos Modified Paths: -------------- trunk/treebase-web/src/main/resources/ApplicationResources.properties trunk/treebase-web/src/main/webapp/WEB-INF/decorators.xml trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml trunk/treebase-web/src/main/webapp/common/sidebarLeft.jsp trunk/treebase-web/src/main/webapp/login.jsp Added Paths: ----------- trunk/treebase-web/src/main/webapp/WEB-INF/pages/submitTutorial.jsp Modified: trunk/treebase-web/src/main/resources/ApplicationResources.properties =================================================================== --- trunk/treebase-web/src/main/resources/ApplicationResources.properties 2011-06-16 20:52:22 UTC (rev 919) +++ trunk/treebase-web/src/main/resources/ApplicationResources.properties 2011-06-17 02:28:54 UTC (rev 920) @@ -78,6 +78,7 @@ nav.contact=Contact nav.search=Search nav.search.treebase=Search TreeBASE +nav.submittutorial=Submission Tutorial nav.submit=Submit nav.dataman=NSF Data Management nav.stats=Stats Modified: trunk/treebase-web/src/main/webapp/WEB-INF/decorators.xml =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/decorators.xml 2011-06-16 20:52:22 UTC (rev 919) +++ trunk/treebase-web/src/main/webapp/WEB-INF/decorators.xml 2011-06-17 02:28:54 UTC (rev 920) @@ -8,6 +8,7 @@ <decorator name="main" page="mainTemplate.jsp"> <pattern>/home.html</pattern> <pattern>/dataMan.html</pattern> + <pattern>/submitTutorial.html</pattern> <pattern>/about.html</pattern> <pattern>/urlAPI.html</pattern> <pattern>/people.html</pattern> Added: trunk/treebase-web/src/main/webapp/WEB-INF/pages/submitTutorial.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/submitTutorial.jsp (rev 0) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/submitTutorial.jsp 2011-06-17 02:28:54 UTC (rev 920) @@ -0,0 +1,96 @@ +<%@page import="org.cipres.treebase.TreebaseUtil"%> +<% String purlBase = TreebaseUtil.getPurlBase(); %> + +<div class="gutter"> + +<h2>The Submission Process</h2> + +<p>Typically an author submits a paper to a journal for review + and initiates a TreeBASE submission. At this stage, the + submission is classified as "in progress." A submission + number is issued and the submitter is given a special URL + that can be mailed to the journal editor so that referees + or reviewers can inspect (but not change) the uploaded data. +</p> + +<p>When the journal editor says that the paper is "accepted" or + "accepted with minor revision," the submitter can return to the + submission and change its status from "in progress" to "ready." + At that point, the submitter can cite a URI in his or her paper + that serves as an accession number and as a permanent, resolvable + URL to the data. TreeBASE staff will verify that the submission + is complete, and if so, the data are made public. +</p> + +<h2>General Requirements</h2> + +<ul> + <li>The paper must be published in a peer-reviewed journal or book. Data for manuscripts that are "accepted with minor revision," "accepted," or "in press" can be published in TreeBASE. Data for manuscripts that are "submitted" or "in preparation" must not move beyond the initial "in progress" stage of TreeBASE submission.</li> + + <li>The names of all authors listed with the paper must be included.</li> + + <li>At least one data matrix must be included.</li> + + <li>At least one tree must result from an analysis of one or more data matrices. TreeBASE does not accept matrices that were not analyzed to produce a tree or trees for which the matrices used to produce them are not available.</li> + + <li>Normally the trees should be limited to those that were published as figures in the manuscript. However, a set of trees that were used to produce a published consensus tree is also acceptable.</li> + + <li>Only matrices and trees listed with an analysis will ultimately become available to the public. In other words, matrices or trees must not be orphaned but instead must be either the inputs or outputs of explicit analyses.</li> +</ul> + +<h2>Preparation of NEXUS files</h2> + +<p>Data are uploaded to TreeBASE in the NEXUS format, which is used by many popular phylogenetics software packages (e.g., MacClade and Mesquite: Maddison and Maddison, 1992; PAUP: Swofford, 1993). These programs allow other file formats (e.g. Hennig86, PHYLIP, etc.) to be converted into NEXUS. TreeBASE uses <a href="http://mesquiteproject.org/" title="Mesquite" target="_blank">Mesquite</a> to parse incoming data: <strong>if your data cannot be parsed by Mesquite then they will not be parsed by TreeBASE</strong>, so it's always a good idea to save your data in Mesquite prior to uploading. For example: </p> +<ul> +<li> Launch <a href="http://mesquiteproject.org/" title="Mesquite" target="_blank">Mesquite</a> </li> +<li>Under the <em>File Menu</em> select <em>Open File</em> and choose your character matrix</li> +<li>If your tree(s) are stored in a separate file, under the <em>File Menu</em> select + <em>Include File...</em> and choose your tree file </li> +<li>By clicking on "Taxa," "Character Matrix," or "Trees from treefile.tre" from the project margin on the left, you can rename + them: these names will be carried through into TreeBASE, so it's useful to give them informative names. For example, you could name your matrix "Hymenopteran COI Alignment" +or your tree block "Set of 5 MP Trees from COI Analysis"</li> +<li>By clicking on the <em>Tree</em> icon from the project margin on the left, you can examine your trees. + <ul> + <li>Use the <em>Reroot at Branch</em> tool to reorient the tree the way it appears in the figures of your paper</li> + <li>Under the<em> Drawing Menu</em>, + you can view the relative branch lengths in your tree by selecting <em>Branches Proportional to Lengths</em></li> + </ul> +</li> + + <li>To rename your trees, click the <em>List & Manage Trees</em> icon from the project margin on the left. Renaming your trees makes it easy to identify them after uploading to TreeBASE.</li> + <li>To view or edit the taxon labels, click the <em>Taxa</em> icon from the project margin on the left. Verify that the taxon labels comply with TreeBASE's requirements (see below) and edit as needed</li> + <li>If all looks good, select <em>Save File</em> from the <em>File</em> menu. + Your NEXUS file is now ready to upload to TreeBASE </li> + </ul> +<p>The most frequent error in submitting data to TreeBASE is when taxon labels in the matrices do not match with taxon labels in the trees. Using the above procedure with Mesquite, however, will avoid the problem. </p> + +<h3>Instructional Video on Preparing NEXUS Data in Mesquite</h3> + +<p> +<object width="480" height="385"><param name="movie" value="http://www.youtube.com/p/3F38DFE2626A5234?hl=en_US&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/p/3F38DFE2626A5234?hl=en_US&fs=1" type="application/x-shockwave-flash" width="480" height="385" allowscriptaccess="always" allowfullscreen="true"></embed></object> +</p> + +<h3>Preparation of taxon labels</h3> + +<ul> + <li>Do not abbreviate taxon names (e.g. write "Homo sapiens", not "H. sapiens")</li> + + <li>The NEXUS file should use underscores ("_") to represent spaces (but when using the Mesquite GUI, use spaces: it will correctly save them as underscores in the NEXUS)</li> + + <li>Avoid using quotation marks, brackets, parentheses, commas, colons, and semicolons.</li> + + <li>Avoid using codes for non-redundant names (e.g. write "Drosophila melanogaster", not "DMelan45GRX"). However, it is acceptable two write "Drosophila melanogaster 45GRX".</li> + + <li>Separate the name of parasites and hosts with "ex.," e.g. "Wolbachia sp. ex. Drosophila melanogaster"</li> + +</ul> + +<h2>Instructional Video on Submitting to TreeBASE</h2> + +<p>If you are sufficiently caffeinated, please consider watching this video to understand the process of submitting data to TreeBASE. The video is also available in high-definition if you view in "Full screen"</p> + +<p> +<object width="480" height="385"><param name="movie" value="http://www.youtube.com/p/9AD9904B8782D600?hl=en_US&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/p/9AD9904B8782D600?hl=en_US&fs=1" type="application/x-shockwave-flash" width="480" height="385" allowscriptaccess="always" allowfullscreen="true"></embed></object> +</p> + +</div> \ No newline at end of file Modified: trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml 2011-06-16 20:52:22 UTC (rev 919) +++ trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml 2011-06-17 02:28:54 UTC (rev 920) @@ -932,7 +932,8 @@ <prop key="/phylows/matrix/**">phyloWSMatrixController</prop> <prop key="/about.html">filenameController</prop> <prop key="/dataMan.html">filenameController</prop> - <prop key="/home.html">filenameController</prop> + <prop key="/home.html">filenameController</prop> + <prop key="/submitTutorial.html">filenameController</prop> <prop key="/login.html">filenameController</prop> <prop key="/urlAPI.html">filenameController</prop> <prop key="/people.html">filenameController</prop> Modified: trunk/treebase-web/src/main/webapp/common/sidebarLeft.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/common/sidebarLeft.jsp 2011-06-16 20:52:22 UTC (rev 919) +++ trunk/treebase-web/src/main/webapp/common/sidebarLeft.jsp 2011-06-17 02:28:54 UTC (rev 920) @@ -4,6 +4,7 @@ <div id="navcontainer"> <ul id="navlist"> <li><a href="<c:url value="/search/studySearch.html"/>"><fmt:message key="nav.search.treebase"/></a></li> + <li><a href="<c:url value="/submitTutorial.html"/>"><fmt:message key="nav.submittutorial"/></a></li> <li><a href="<c:url value="/user/processUser.html"/>"><fmt:message key="nav.submit"/></a></li> <li><span class="navlistHeading"><fmt:message key="nav.about"/></span> <ul id="innerNavlist"> Modified: trunk/treebase-web/src/main/webapp/login.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/login.jsp 2011-06-16 20:52:22 UTC (rev 919) +++ trunk/treebase-web/src/main/webapp/login.jsp 2011-06-17 02:28:54 UTC (rev 920) @@ -17,83 +17,6 @@ </tr> </table> -<h2>The Submission Process</h2> - -<p>Typically an author submits a paper to a journal for review - and initiates a TreeBASE submission. At this stage, the - submission is classified as "in progress." A submission - number is issued and the submitter is given a special URL - that can be mailed to the journal editor so that referees - or reviewers can inspect (but not change) the uploaded data. -</p> - -<p>When the journal editor says that the paper is "accepted" or - "accepted with minor revision," the submitter can return to the - submission and change its status from "in progress" to "ready." - At that point, the submitter can cite a URI in his or her paper - that serves as an accession number and as a permanent, resolvable - URL to the data. TreeBASE staff will verify that the submission - is complete, and if so, the data are made public. -</p> - -<h2>General Requirements</h2> - -<ul> - <li>The paper must be published in a peer-reviewed journal or book. Data for manuscripts that are "accepted with minor revision," "accepted," or "in press" can be published in TreeBASE. Data for manuscripts that are "submitted" or "in preparation" must not move beyond the initial "in progress" stage of TreeBASE submission.</li> - - <li>The names of all authors listed with the paper must be included.</li> - - <li>At least one data matrix must be included.</li> - - <li>At least one tree must result from an analysis of one or more data matrices. TreeBASE does not accept matrices that were not analyzed to produce a tree or trees for which the matrices used to produce them are not available.</li> - - <li>Normally the trees should be limited to those that were published as figures in the manuscript. However, a set of trees that were used to produce a published consensus tree is also acceptable.</li> - - <li>Only matrices and trees listed with an analysis will ultimately become available to the public. In other words, matrices or trees must not be orphaned but instead must be either the inputs or outputs of explicit analyses.</li> -</ul> - -<h2>Preparation of NEXUS files</h2> - -<p>Data are uploaded to TreeBASE in the NEXUS format, which is used by many popular phylogenetics software packages (e.g., MacClade and Mesquite: Maddison and Maddison, 1992; PAUP: Swofford, 1993). These programs allow other file formats (e.g. Hennig86, PHYLIP, etc.) to be converted into NEXUS. TreeBASE uses <a href="http://mesquiteproject.org/" title="Mesquite" target="_blank">Mesquite</a> to parse incoming data: <strong>if your data cannot be parsed by Mesquite then they will not be parsed by TreeBASE</strong>, so it's always a good idea to save your data in Mesquite prior to uploading. For example: </p> -<ul> -<li> Launch <a href="http://mesquiteproject.org/" title="Mesquite" target="_blank">Mesquite</a> </li> -<li>Under the <em>File Menu</em> select <em>Open File</em> and choose your character matrix</li> -<li>If your tree(s) are stored in a separate file, under the <em>File Menu</em> select - <em>Include File...</em> and choose your tree file </li> -<li>By clicking on "Taxa," "Character Matrix," or "Trees from treefile.tre" from the project margin on the left, you can rename - them: these names will be carried through into TreeBASE, so it's useful to give them informative names. For example, you could name your matrix "Hymenopteran COI Alignment" -or your tree block "Set of 5 MP Trees from COI Analysis"</li> -<li>By clicking on the <em>Tree</em> icon from the project margin on the left, you can examine your trees. - <ul> - <li>Use the <em>Reroot at Branch</em> tool to reorient the tree the way it appears in the figures of your paper</li> - <li>Under the<em> Drawing Menu</em>, - you can view the relative branch lengths in your tree by selecting <em>Branches Proportional to Lengths</em></li> - </ul> -</li> - - <li>To rename your trees, click the <em>List & Manage Trees</em> icon from the project margin on the left. Renaming your trees makes it easy to identify them after uploading to TreeBASE.</li> - <li>To view or edit the taxon labels, click the <em>Taxa</em> icon from the project margin on the left. Verify that the taxon labels comply with TreeBASE's requirements (see below) and edit as needed</li> - <li>If all looks good, select <em>Save File</em> from the <em>File</em> menu. - Your NEXUS file is now ready to upload to TreeBASE </li> - </ul> -<p>The most frequent error in submitting data to TreeBASE is when taxon labels in the matrices do not match with taxon labels in the trees. Using the above procedure with Mesquite, however, will avoid the problem. </p> - - -<h3>Preparation of taxon labels</h3> - -<ul> - <li>Do not abbreviate taxon names (e.g. write "Homo sapiens", not "H. sapiens")</li> - - <li>The NEXUS file should use underscores ("_") to represent spaces (but when using the Mesquite GUI, use spaces: it will correctly save them as underscores in the NEXUS)</li> - - <li>Avoid using quotation marks, brackets, parentheses, commas, colons, and semicolons.</li> - - <li>Avoid using codes for non-redundant names (e.g. write "Drosophila melanogaster", not "DMelan45GRX"). However, it is acceptable two write "Drosophila melanogaster 45GRX".</li> - - <li>Separate the name of parasites and hosts with "ex.," e.g. "Wolbachia sp. ex. Drosophila melanogaster"</li> - -</ul> - <hr/> <p>Please fill in following information to login<br/> <span class="required">* Required Fields</span></p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sfr...@us...> - 2011-09-15 14:28:40
|
Revision: 954 http://treebase.svn.sourceforge.net/treebase/?rev=954&view=rev Author: sfrgpiel Date: 2011-09-15 14:28:32 +0000 (Thu, 15 Sep 2011) Log Message: ----------- Adding RSS feed link for getting a list of all TreeBASE studies Modified Paths: -------------- trunk/treebase-web/src/main/resources/ApplicationResources.properties trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/studyKeywordSearchForm.jsp Added Paths: ----------- trunk/treebase-web/src/main/webapp/images/icons/rss.gif Modified: trunk/treebase-web/src/main/resources/ApplicationResources.properties =================================================================== --- trunk/treebase-web/src/main/resources/ApplicationResources.properties 2011-09-15 14:20:34 UTC (rev 953) +++ trunk/treebase-web/src/main/resources/ApplicationResources.properties 2011-09-15 14:28:32 UTC (rev 954) @@ -314,6 +314,7 @@ download.nexml = Download NeXML File download.json = Download JSON File download.rdf = Download RDF file +download.rss = Download RSS #-- matrix row section -- matrix.row.id = Matrix Row ID @@ -485,8 +486,8 @@ icons.json=/treebase-web/images/icons/script.png icons.permalink=/treebase-web/images/icons/link.png icons.treebase.16px=/treebase-web/images/logo16px.png +icons.rss=/treebase-web/images/icons/rss.gif - #-- help system -- help.title=Help window help.admin.legend=Modify help message "{0}" here Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/studyKeywordSearchForm.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/studyKeywordSearchForm.jsp 2011-09-15 14:20:34 UTC (rev 953) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/studyKeywordSearchForm.jsp 2011-09-15 14:28:32 UTC (rev 954) @@ -24,10 +24,18 @@ </option> </c:forEach> </select> + <c:set var="basePurl" scope="request" value='${treebase.purl.domain}'/> <button type="submit" name="submit" >Search</button> <a href="#" class="openHelp" onclick="openHelp('studyKeywordSearchForm')"> <img class="iconButton" src="<fmt:message key="icons.help"/>" /> - </a> + </a> + <a href="${basePurl}study/find?query=prism.modificationDate%3E%221996-01-01T05:00:00Z%22&format=rss1"> + <img + class="iconButton" + src="<fmt:message key="icons.rss"/>" + title="<fmt:message key="download.rss"/>" + alt="<fmt:message key="download.rss"/>"/> + </a> </fieldset> <jsp:include page="querySearchBox.jsp"/> </form> Added: trunk/treebase-web/src/main/webapp/images/icons/rss.gif =================================================================== (Binary files differ) Property changes on: trunk/treebase-web/src/main/webapp/images/icons/rss.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2011-10-28 14:08:37
|
Revision: 975 http://treebase.svn.sourceforge.net/treebase/?rev=975&view=rev Author: hshyket Date: 2011-10-28 14:08:26 +0000 (Fri, 28 Oct 2011) Log Message: ----------- Updating functionality to allow download of all trees through the tree search page and also via the API query calls for Nexus and NeXML Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/TaxonSearchController.java trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/searchResultsListControls.jsp trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java 2011-10-27 16:58:16 UTC (rev 974) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/SearchController.java 2011-10-28 14:08:26 UTC (rev 975) @@ -3,6 +3,8 @@ package org.cipres.treebase.web.controllers; +import java.io.File; +import java.io.FileWriter; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; @@ -12,6 +14,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Properties; import java.util.Set; import javax.servlet.ServletException; @@ -23,16 +26,31 @@ import org.cipres.treebase.TreebaseUtil; import org.cipres.treebase.TreebaseIDString.MalformedTreebaseIDString; import org.cipres.treebase.domain.TBPersistable; +import org.cipres.treebase.domain.nexus.NexusDataSet; +import org.cipres.treebase.domain.nexus.NexusService; +import org.cipres.treebase.domain.nexus.nexml.NexmlDocumentWriter; import org.cipres.treebase.domain.search.SearchResults; import org.cipres.treebase.domain.search.SearchResultsFrozen; import org.cipres.treebase.domain.search.SearchResultsType; import org.cipres.treebase.domain.search.SearchService; import org.cipres.treebase.domain.search.StudySearchResults; +import org.cipres.treebase.domain.search.TaxonSearchResults; +import org.cipres.treebase.domain.search.TreeSearchResults; +import org.cipres.treebase.domain.taxon.Taxon; +import org.cipres.treebase.domain.taxon.TaxonLabel; +import org.cipres.treebase.domain.taxon.TaxonLabelHome; import org.cipres.treebase.domain.taxon.TaxonLabelService; +import org.cipres.treebase.domain.taxon.TaxonLabelSet; +import org.cipres.treebase.domain.taxon.TaxonVariant; +import org.cipres.treebase.domain.tree.PhyloTree; +import org.cipres.treebase.domain.tree.TreeBlock; import org.cipres.treebase.service.AbstractService; import org.cipres.treebase.web.Constants; import org.cipres.treebase.web.model.SearchCommand; import org.cipres.treebase.web.util.SearchMessageSetter; +import org.cipres.treebase.web.util.WebUtil; +import org.nexml.model.Document; +import org.nexml.model.DocumentFactory; import org.springframework.validation.BindException; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.view.RedirectView; @@ -55,6 +73,12 @@ protected String formView; private TaxonLabelService mTaxonLabelService; + protected static final int FORMAT_NEXUS = 1; + protected static final int FORMAT_NEXML = 2; + private static String mNexmlContentType = "application/xml; charset=UTF-8"; + protected String mFormatParameter = "format"; + private TaxonLabelHome mTaxonLabelHome; + protected abstract ModelAndView handleQueryRequest(HttpServletRequest request,HttpServletResponse response,BindException errors,String query) throws CQLParseException, IOException, InstantiationException, ParseException; /** @@ -122,7 +146,11 @@ onSubmitDiscardResults(request, response, command, errors); } else if ( action.equals("refineSearch") ){ onSubmitRefineSearch(request,response,command,errors); - } else { + } else if ( action.equals("downloadAllTrees") ) { + downloadAllTrees(request, response, errors); + return null; + } + else { throw new Error("Unknown action '" + action + "'"); } } else { @@ -140,6 +168,116 @@ return selectResultsView(request); } + protected void downloadAllTrees(HttpServletRequest request, + HttpServletResponse response, BindException errors) { + // TODO Auto-generated method stub + + try { + java.util.Date date= new java.util.Date(); + + TreeSearchResults treeResults = searchResults(request).convertToTrees(); + + String fileName = "TB" + date.getTime(); + StringBuilder builder = new StringBuilder(); + + if ( getFormat(request) == FORMAT_NEXML ) { + Document doc = DocumentFactory.safeCreateDocument(); + NexmlDocumentWriter ndw = new NexmlDocumentWriter(null,getTaxonLabelHome(), doc); + ndw.fromTreeBaseToXml(treeResults); + builder.append(doc.getXmlString()); + } + else { + Set<PhyloTree> trees = treeResults.getResults(); + TreeBlock treeBlock = new TreeBlock(); + TaxonLabelSet taxonLabelSet = new TaxonLabelSet(); + + for (PhyloTree pTree : trees) { + for (TaxonLabel pTaxLabel : pTree.getTreeBlock().getTaxonLabelList()) { + if (! taxonLabelSet.getTaxonLabelsReadOnly().contains(pTaxLabel)) { + taxonLabelSet.addPhyloTaxonLabel(pTaxLabel); + } + } + treeBlock.addPhyloTree(pTree); + } + + treeBlock.setTaxonLabelSet(taxonLabelSet); + taxonLabelSet.setTitle("TB" + date.getTime()); + + + builder.append("#NEXUS\n\n"); + + taxonLabelSet.buildNexusBlockTaxa(builder, true, false); + + treeBlock.generateAFileDynamically(builder); + fileName += ".nex"; + } + + String downloadDirName = request.getSession().getServletContext().getRealPath( + TreebaseUtil.FILESEP + "NexusFileDownload") + + TreebaseUtil.FILESEP + request.getRemoteUser(); + + + File file = new File(downloadDirName + TreebaseUtil.FILESEP + fileName); + FileWriter out = new FileWriter(file); + out.write(builder.toString()); + out.close(); + + if ( getFormat(request) == FORMAT_NEXML ) { + WebUtil.downloadFile(response, downloadDirName, fileName, mNexmlContentType); + } + else { + WebUtil.downloadFile(response, downloadDirName, fileName); + } + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + /** + * + * @param request + * @return + */ + protected int getFormat (HttpServletRequest request) { + String requestedFormat = request.getParameter(mFormatParameter); + if ( null != requestedFormat ) { + if ( requestedFormat.equalsIgnoreCase("nexml") ) { + return FORMAT_NEXML; + } + else { + return FORMAT_NEXUS; // default + } + } + else { + return FORMAT_NEXUS; // default + } + } + + protected Properties getDefaultProperties(HttpServletRequest request) { + Properties properties = new Properties(); + + properties.setProperty("nexml.uri.base", TreebaseUtil.getPurlBase()); + return properties; + } + + /** + * + * @return + */ + public TaxonLabelHome getTaxonLabelHome() { + return mTaxonLabelHome; + } + + /** + * + * @param nexmlService + */ + public void setTaxonLabelHome(TaxonLabelHome taxonLabelHome) { + mTaxonLabelHome = taxonLabelHome; + } + protected ModelAndView searchResultsAsRDF (SearchResults<?> searchResults,HttpServletRequest request,CQLNode root, String schema, String original) throws UnsupportedEncodingException { //${baseURL} //${phyloWSPath} Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/TaxonSearchController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/TaxonSearchController.java 2011-10-27 16:58:16 UTC (rev 974) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/TaxonSearchController.java 2011-10-28 14:08:26 UTC (rev 975) @@ -409,7 +409,10 @@ Set<Taxon> queryResults = doCQLQuery(root, new HashSet<Taxon>(),request); TaxonSearchResults tsr = new TaxonSearchResults(queryResults); saveSearchResults(request, tsr); - if ( TreebaseUtil.isEmpty(request.getParameter("format")) || ! request.getParameter("format").equals("rss1") ) { + if ( TreebaseUtil.isEmpty(request.getParameter("format")) || + (! request.getParameter("format").equals("rss1") && + ! request.getParameter("format").equals("nexus") && + ! request.getParameter("format").equals("nexml")) ) { return samePage(request); } else { @@ -428,7 +431,16 @@ } } this.saveSearchResults(request, res); - return this.searchResultsAsRDF(res, request, root,schema,"taxon"); + + if (schema.equals("tree") && + ( request.getParameter("format").equals("nexus") || + request.getParameter("format").equals("nexml") )) { + super.downloadAllTrees(request, response, errors); + return null; + } + else { + return this.searchResultsAsRDF(res, request, root,schema,"taxon"); + } } } Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/searchResultsListControls.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/searchResultsListControls.jsp 2011-10-27 16:58:16 UTC (rev 974) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/searchResultsListControls.jsp 2011-10-28 14:08:26 UTC (rev 975) @@ -24,5 +24,8 @@ <input style="align: right;" type="submit" id="discardResults" value="Discard All Results" onclick="confirmDiscard()"/> <a href="#" class="openHelp" onclick="openHelp('s+res+discard-these-results+btn')"><img class="iconButton" src="<fmt:message key="icons.help"/>" /></a> - + <c:if test="${resultSet.resultType == 'TREE'}"> + <input style="align: right;" type="submit" id="downloadAllTrees" value="Download All Trees" onclick="doAction('downloadAllTrees')"/> + <a href="#" class="openHelp" onclick="openHelp('s+res+download-all-treess+btn')"><img class="iconButton" src="<fmt:message key="icons.help"/>" /></a> + </c:if> </c:if> Modified: trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml 2011-10-27 16:58:16 UTC (rev 974) +++ trunk/treebase-web/src/main/webapp/WEB-INF/treebase-servlet.xml 2011-10-28 14:08:26 UTC (rev 975) @@ -749,7 +749,8 @@ <property name="commandName"><value>search</value></property> <property name="commandClass"><value>org.cipres.treebase.web.model.SearchCommand</value></property> <property name="taxonLabelService"><ref bean="taxonLabelService"></ref></property> - <property name="searchService"><ref bean="searchService"></ref></property> + <property name="searchService"><ref bean="searchService"></ref></property> + <property name="taxonLabelHome"><ref bean="taxonLabelHome"></ref></property> </bean> <!-- bean id="mainSearchController" parent="searchController" class="org.cipres.treebase.web.controllers.MainSearchController"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2011-11-18 22:22:58
|
Revision: 985 http://treebase.svn.sourceforge.net/treebase/?rev=985&view=rev Author: hshyket Date: 2011-11-18 22:22:51 +0000 (Fri, 18 Nov 2011) Log Message: ----------- Removing RDF download functionality and links to RDF Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadAMatrixController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadAStudyController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadATreeBlockController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadATreeController.java trunk/treebase-web/src/main/webapp/WEB-INF/pages/anyObjectAsRDF.jsp trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/matrices.jsp trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/summary.jsp trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/trees.jsp Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadAMatrixController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadAMatrixController.java 2011-11-18 18:18:06 UTC (rev 984) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadAMatrixController.java 2011-11-18 22:22:51 UTC (rev 985) @@ -90,18 +90,18 @@ Study pStudy = ControllerUtil.findStudy(request, getStudyService()); Matrix matrix = getMatrixService().findByID(objectId); TaxonLabelSet taxa = matrix.getTaxa(); - if ( getFormat(request) == FORMAT_NEXML ) { + if ( getFormat(request) == FORMAT_NEXML || getFormat(request) == FORMAT_RDF ) { NexusDataSet pNexusDataSet = new NexusDataSet(); pNexusDataSet.getTaxonLabelSets().add(taxa); pNexusDataSet.getMatrices().add(matrix); return getNexmlService().serialize(pNexusDataSet,getDefaultProperties(request),matrix.getStudy()); } - else if ( getFormat(request) == FORMAT_RDF ) { + /*else if ( getFormat(request) == FORMAT_RDF ) { NexusDataSet pNexusDataSet = new NexusDataSet(); pNexusDataSet.getTaxonLabelSets().add(taxa); pNexusDataSet.getMatrices().add(matrix); return getRdfaService().serialize(pNexusDataSet,getDefaultProperties(request),matrix.getStudy()); - } + }*/ else { // FORMAT_NEXUS or none StringBuilder matrixContent = new StringBuilder(); matrixContent.append("#NEXUS\n"); Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadAStudyController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadAStudyController.java 2011-11-18 18:18:06 UTC (rev 984) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadAStudyController.java 2011-11-18 22:22:51 UTC (rev 985) @@ -35,12 +35,12 @@ @Override protected String getFileContent(long pStudyID, HttpServletRequest request) { Study study = getStudyService().findByID(pStudyID); - if ( getFormat(request) == FORMAT_NEXML ) { + if ( getFormat(request) == FORMAT_NEXML || getFormat(request) == FORMAT_RDF ) { return getNexmlService().serialize(study,getDefaultProperties(request)); } - else if ( getFormat(request) == FORMAT_RDF ) { + /*else if ( getFormat(request) == FORMAT_RDF ) { return getRdfaService().serialize(study,getDefaultProperties(request)); - } + }*/ else { StringBuilder builder = new StringBuilder(); builder.append("#NEXUS\n\n"); Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadATreeBlockController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadATreeBlockController.java 2011-11-18 18:18:06 UTC (rev 984) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadATreeBlockController.java 2011-11-18 22:22:51 UTC (rev 985) @@ -98,18 +98,18 @@ @Override protected String getFileContent(long blockid, HttpServletRequest request) { TreeBlock treeBlock = getPhyloTreeHome().findTreeBlockById(blockid); - if ( getFormat(request) == FORMAT_NEXML ) { + if ( getFormat(request) == FORMAT_NEXML || getFormat(request) == FORMAT_RDF ) { NexusDataSet nexusDataSet = new NexusDataSet(); nexusDataSet.getTaxonLabelSets().add(treeBlock.getTaxonLabelSet()); nexusDataSet.getTreeBlocks().add(treeBlock); return getNexmlService().serialize(nexusDataSet,getDefaultProperties(request)); } - else if ( getFormat(request) == FORMAT_RDF ) { + /*else if ( getFormat(request) == FORMAT_RDF ) { NexusDataSet nexusDataSet = new NexusDataSet(); nexusDataSet.getTaxonLabelSets().add(treeBlock.getTaxonLabelSet()); nexusDataSet.getTreeBlocks().add(treeBlock); return getRdfaService().serialize(nexusDataSet,getDefaultProperties(request)); - } + }*/ else { StringBuilder bldr = new StringBuilder("#NEXUS\n\n"); treeBlock.generateAFileDynamically(bldr); Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadATreeController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadATreeController.java 2011-11-18 18:18:06 UTC (rev 984) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/DownloadATreeController.java 2011-11-18 22:22:51 UTC (rev 985) @@ -89,7 +89,7 @@ tree = getPhyloTreeService().resurrect(tree); TreeBlock enclosingTreeBlock = getPhyloTreeService().resurrect(tree.getTreeBlock()); TaxonLabelSet tls = getPhyloTreeService().resurrect(enclosingTreeBlock.getTaxonLabelSet()); - if ( getFormat(request) == FORMAT_NEXML ) { + if ( getFormat(request) == FORMAT_NEXML || getFormat(request) == FORMAT_RDF ) { NexusDataSet nds = new NexusDataSet(); nds.getTaxonLabelSets().add(tls); TreeBlock treeBlock = new TreeBlock(); @@ -98,7 +98,7 @@ nds.getTreeBlocks().add(treeBlock); return getNexmlService().serialize(nds,getDefaultProperties(request),tree.getStudy()); } - else if ( getFormat(request) == FORMAT_RDF ) { + /*else if ( getFormat(request) == FORMAT_RDF ) { NexusDataSet nds = new NexusDataSet(); nds.getTaxonLabelSets().add(tls); TreeBlock treeBlock = new TreeBlock(); @@ -106,7 +106,7 @@ treeBlock.addPhyloTree(tree); nds.getTreeBlocks().add(treeBlock); return getRdfaService().serialize(nds,getDefaultProperties(request),tree.getStudy()); - } + } */ else { StringBuilder builder = new StringBuilder(); builder.append("#NEXUS\n\n"); Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/anyObjectAsRDF.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/anyObjectAsRDF.jsp 2011-11-18 18:18:06 UTC (rev 984) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/anyObjectAsRDF.jsp 2011-11-18 22:22:51 UTC (rev 985) @@ -58,12 +58,12 @@ <dc:format>text/plain</dc:format> </item> </c:if> - <c:if test="${hasRdf}"> +<%-- <c:if test="${hasRdf}"> <item rdf:about="${baseURL}${phyloWSPath}?format=rdf"> <title>RDF file</title> <link>${baseURL}${phyloWSPath}?format=rdf</link> <description>An RDF/XML serialization of the resource</description> <dc:format>application/rdf+xml</dc:format> </item> - </c:if> + </c:if> --%> </rdf:RDF> \ No newline at end of file Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/matrices.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/matrices.jsp 2011-11-18 18:18:06 UTC (rev 984) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/matrices.jsp 2011-11-18 22:22:51 UTC (rev 985) @@ -77,7 +77,7 @@ </a> </display:column> - <display:column + <%--<display:column sortable="false" class="iconColumn" headerClass="iconColumn"> @@ -89,7 +89,7 @@ title="<fmt:message key="download.rdf"/>" alt="<fmt:message key="download.rdf"/>"/> </a> - </display:column> + </display:column> --%> <display:column sortable="false" Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/summary.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/summary.jsp 2011-11-18 18:18:06 UTC (rev 984) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/summary.jsp 2011-11-18 22:22:51 UTC (rev 985) @@ -103,14 +103,15 @@ alt="<fmt:message key="download.nexml"/>"/> NeXML </a> - <a href="${baseLink}?format=rdf"> + <% + /* <a href="${baseLink}?format=rdf"> <img class="iconButton" src="<fmt:message key="icons.rdf"/>" title="<fmt:message key="download.rdf"/>" alt="<fmt:message key="download.rdf"/>"/> RDF - </a> + </a> */ %> </li> </ul> <h3>BibTeX reference</h3> Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/trees.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/trees.jsp 2011-11-18 18:18:06 UTC (rev 984) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/trees.jsp 2011-11-18 22:22:51 UTC (rev 985) @@ -77,7 +77,7 @@ </a> </display:column> - <display:column + <%--<display:column sortable="false" class="iconColumn" headerClass="iconColumn"> @@ -89,7 +89,7 @@ title="<fmt:message key="download.rdf"/>" alt="<fmt:message key="download.rdf"/>"/> </a> - </display:column> + </display:column> --%> <display:column sortable="false" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2011-12-02 20:12:21
|
Revision: 993 http://treebase.svn.sourceforge.net/treebase/?rev=993&view=rev Author: hshyket Date: 2011-12-02 20:12:15 +0000 (Fri, 02 Dec 2011) Log Message: ----------- Checking to make sure that studies that have been cached but then removed from being published do not redirect from the PURL link to the cached object. Cached object may still remain in the Apache frontend cache and possibly be served to a user directly hitting the URL. Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSMatrixController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSStudyController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTreeController.java trunk/treebase-web/src/main/webapp/WEB-INF/web.xml trunk/treebase-web/src/main/webapp/common/meta.jsp Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSController.java 2011-11-30 20:48:02 UTC (rev 992) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSController.java 2011-12-02 20:12:15 UTC (rev 993) @@ -10,10 +10,14 @@ import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.Controller; +import org.cipres.treebase.web.exceptions.NoStudySpecifiedError; + import org.cipres.treebase.NamespacedGUID; import org.cipres.treebase.TreebaseIDString; import org.cipres.treebase.TreebaseUtil; import org.cipres.treebase.TreebaseIDString.MalformedTreebaseIDString; +import org.cipres.treebase.domain.study.Study; +import org.cipres.treebase.domain.study.StudyService; import org.cipres.treebase.web.Constants; /** @@ -58,6 +62,8 @@ public abstract class PhyloWSController implements Controller { private static final long serialVersionUID = 1L; private static String searchBase = "/treebase-web/search/"; + + private boolean redirectDownload = true; /** * Child classes return the display page for the focal type @@ -108,7 +114,10 @@ // output format is something else, re-direct to download services else { - url = createDownloadUrl(tbID.getId(),serializationFormat,req); + url = createDownloadUrl(tbID.getId(),serializationFormat,req); + if (!redirectDownload) { + url = "/treebase-web/accessviolation.html"; + } } } @@ -122,6 +131,7 @@ res.sendError(HttpServletResponse.SC_NOT_FOUND, "Object not found: " + e.getMessage()); } } + if ( ! TreebaseUtil.isEmpty(url) ) { res.setContentType("text/plain"); @@ -274,5 +284,9 @@ super(message); } } + + public void checkAccess(boolean isPublished) { + redirectDownload = isPublished; + } } Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSMatrixController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSMatrixController.java 2011-11-30 20:48:02 UTC (rev 992) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSMatrixController.java 2011-12-02 20:12:15 UTC (rev 993) @@ -40,9 +40,13 @@ throw new ObjectNotFoundException("Can't find matrix " + objectId); } Study study = matrix.getStudy(); + if ( study == null ) { throw new ObjectNotFoundException("Can't find study for matrix "+objectId); } + + checkAccess(study.isPublished()); + Map<String,String> params = new HashMap<String,String>(); params.put("id", ""+study.getId()); params.put("matrixid", ""+objectId); Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSStudyController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSStudyController.java 2011-11-30 20:48:02 UTC (rev 992) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSStudyController.java 2011-12-02 20:12:15 UTC (rev 993) @@ -35,9 +35,13 @@ @Override Map<String,String> getObjectQueryParameters(Long objectId) throws ObjectNotFoundException { Study study = getStudyService().findByID(objectId); + if ( study == null ) { throw new ObjectNotFoundException("Can't find study " + objectId); - } + } + + checkAccess(study.isPublished()); + Map<String,String> params = new HashMap<String,String>(); params.put("id", ""+objectId); return params; Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTreeController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTreeController.java 2011-11-30 20:48:02 UTC (rev 992) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTreeController.java 2011-12-02 20:12:15 UTC (rev 993) @@ -40,9 +40,13 @@ throw new ObjectNotFoundException("Can't find tree " + objectId); } Study study = phyloTree.getStudy(); + if ( study == null ) { throw new ObjectNotFoundException("Can't find study for tree "+objectId); } + + checkAccess(study.isPublished()); + Map<String,String> params = new HashMap<String,String>(); params.put("id",""+study.getId()); params.put("treeid", ""+objectId); Modified: trunk/treebase-web/src/main/webapp/WEB-INF/web.xml =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/web.xml 2011-11-30 20:48:02 UTC (rev 992) +++ trunk/treebase-web/src/main/webapp/WEB-INF/web.xml 2011-12-02 20:12:15 UTC (rev 993) @@ -82,19 +82,11 @@ <url-pattern>/search/study/anyObjectAsRDF.rdf</url-pattern> </filter-mapping> - <filter-mapping> <filter-name>CacheFilter</filter-name> - <url-pattern>/search/study/summary.html</url-pattern> - </filter-mapping> - - - <filter-mapping> - <filter-name>CacheFilter</filter-name> <url-pattern>/search/downloadANexusFile.html</url-pattern> </filter-mapping> - <filter-mapping> <filter-name>CacheFilter</filter-name> <url-pattern>/search/downloadAMatrix.html</url-pattern> @@ -105,11 +97,6 @@ <url-pattern>/search/downloadATree.html</url-pattern> </filter-mapping> - <filter-mapping> - <filter-name>CacheFilter</filter-name> - <url-pattern>/search/downloadATree.html</url-pattern> - </filter-mapping> - <!-- =================================================================== --> Modified: trunk/treebase-web/src/main/webapp/common/meta.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/common/meta.jsp 2011-11-30 20:48:02 UTC (rev 992) +++ trunk/treebase-web/src/main/webapp/common/meta.jsp 2011-12-02 20:12:15 UTC (rev 993) @@ -1,19 +1,10 @@ -<%@page import="java.util.Date" %> -<%@page import="java.util.Calendar" %> -<%@page import="java.text.SimpleDateFormat;" %> <!-- HTTP 1.1 --> <meta http-equiv="Cache-Control" content="no-store"/> <!-- HTTP 1.0 --> <meta http-equiv="Pragma" content="no-cache"/> <!-- Prevents caching at the Proxy Server --> -<% Calendar expires = Calendar.getInstance(); - expires.add(Calendar.DATE,7); - SimpleDateFormat expiresFormat = new SimpleDateFormat("E, dd MMM yyyy kk:mm:ss"); - if (request.getRequestURI().equals("/treebase-web/search/study/summary.html")) { -%><meta http-equiv="Expires" content="<%=expiresFormat.format(expires.getTime())%> GMT"/> -<%}else { -%><meta http-equiv="Expires" content="0"/> -<% } %><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> +<meta http-equiv="Expires" content="0"/> +<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> <meta name="author" content="Rutger A. Vos (rut...@gm...)"/> <meta name="google-site-verification" content="9Lr7BwyD6VMDIk5dENnSt_2YsUdpq_aEhnee0mMTxrw" /> <meta name="y_key" content="8c736195266b5ebb" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hs...@us...> - 2012-01-06 16:46:56
|
Revision: 1008 http://treebase.svn.sourceforge.net/treebase/?rev=1008&view=rev Author: hshyket Date: 2012-01-06 16:46:50 +0000 (Fri, 06 Jan 2012) Log Message: ----------- Adding x-access-code parameter to matrix and tree objects so that it generates a unique file for caching. Removing access to unpublished study's RDF page. Allowing access to unpublished studies trees so that PhyloWidget is able to grab the file Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/AnyObjectAsRDFController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTreeController.java trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/matrices.jsp trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/summary.jsp trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/trees.jsp Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/AnyObjectAsRDFController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/AnyObjectAsRDFController.java 2012-01-03 19:35:57 UTC (rev 1007) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/AnyObjectAsRDFController.java 2012-01-06 16:46:50 UTC (rev 1008) @@ -70,6 +70,12 @@ TBPersistable theObject = getStudyService().findByID(theClass, treebaseIDString.getId()); if ( null != theObject ) { + if (! getStudyService().findByID(treebaseIDString.getId()).isPublished()) { + response.setContentType("text/plain"); + response.setStatus(HttpServletResponse.SC_SEE_OTHER); + response.setHeader("Location", "/treebase-web/accessviolation.html"); + return null; + } request.getSession().setAttribute("theObject", theObject); LOGGER.info("Object: "+theObject); } Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTreeController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTreeController.java 2012-01-03 19:35:57 UTC (rev 1007) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/PhyloWSTreeController.java 2012-01-06 16:46:50 UTC (rev 1008) @@ -45,7 +45,8 @@ throw new ObjectNotFoundException("Can't find study for tree "+objectId); } - checkAccess(study.isPublished()); + //not checking access due to need for Phloywidget to access tree when in review + //checkAccess(phyloTree.getStudy().isPublished()); Map<String,String> params = new HashMap<String,String>(); params.put("id",""+study.getId()); Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/matrices.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/matrices.jsp 2012-01-03 19:35:57 UTC (rev 1007) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/matrices.jsp 2012-01-06 16:46:50 UTC (rev 1008) @@ -13,7 +13,9 @@ </c:url> <c:set var="counter" value="0"/> - +<% + pageContext.setAttribute("accesscode",request.getSession().getAttribute("x-access-code")); +%> <display:table name="matrices" requestURI="" class="list" @@ -67,7 +69,14 @@ sortable="false" class="iconColumn" headerClass="iconColumn"> - <c:url var="url" value="${matrix.phyloWSPath.purl}"><c:param name="format">nexml</c:param></c:url> + <c:url var="url" value="${matrix.phyloWSPath.purl}"> + <c:param name="format">nexml</c:param> + <c:if test="${!empty accesscode}"> + <c:param name="x-access-code"> + <c:out value='${accesscode}' /> + </c:param> + </c:if> + </c:url> <a href="${url}"> <img class="iconButton" @@ -95,7 +104,14 @@ sortable="false" class="iconColumn" headerClass="iconColumn"> - <c:url var="url" value="${matrix.phyloWSPath.purl}"><c:param name="format">nexus</c:param></c:url> + <c:url var="url" value="${matrix.phyloWSPath.purl}"> + <c:param name="format">nexus</c:param> + <c:if test="${!empty accesscode}"> + <c:param name="x-access-code"> + <c:out value='${accesscode}' /> + </c:param> + </c:if> + </c:url> <a href="${url}"> <img class="iconButton" @@ -111,7 +127,8 @@ headerClass="iconColumn"> <c:url value="/search/downloadANexusFile.html" var="originalMatrixURL"> <c:param name="id">${study.id}</c:param> - <c:param name="matrixid">${matrix.id}</c:param> + <c:param name="matrixid">${matrix.id}</c:param> + <c:if test="${!empty accesscode}"><c:param name="x-access-code"><c:out value='${accesscode}' /></c:param></c:if> </c:url> <a href="${originalMatrixURL}"> <img @@ -126,7 +143,14 @@ sortable="false" class="iconColumn" headerClass="iconColumn"> - <c:url var="url" value="${matrix.phyloWSPath.purl}"><c:param name="format">html</c:param></c:url> + <c:url var="url" value="${matrix.phyloWSPath.purl}"> + <c:param name="format">html</c:param> + <c:if test="${!empty accesscode}"> + <c:param name="x-access-code"> + <c:out value='${accesscode}' /> + </c:param> + </c:if> + </c:url> <a href="${url}"> <img class="iconButton" Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/summary.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/summary.jsp 2012-01-03 19:35:57 UTC (rev 1007) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/summary.jsp 2012-01-06 16:46:50 UTC (rev 1008) @@ -69,7 +69,7 @@ </c:if> <c:if test="${not empty cit.URL && cit.URL != 'http://' }"> <li> - Other URL: + Other URL: <a href="<c:out value="${cit.URL}"/>"> <img class="iconButton" src="<fmt:message key="icons.weblink"/>" /> <c:out value="${cit.URL}"/> @@ -87,7 +87,10 @@ </a> </li> <li>Other versions: - <a href="${baseLink}?format=nexus"> + <% + pageContext.setAttribute("accesscode",request.getSession().getAttribute("x-access-code")); + %> + <a href="${baseLink}?format=nexus<c:if test="${!empty accesscode}">&x-access-code=<c:out value='${accesscode}' /></c:if>"> <img class="iconButton" src="<fmt:message key="icons.download.reconstructed"/>" @@ -95,7 +98,7 @@ alt="<fmt:message key="download.reconstructedfile"/>"/> Nexus </a> - <a href="${baseLink}?format=nexml"> + <a href="${baseLink}?format=nexml<c:if test="${!empty accesscode}">&x-access-code=<c:out value='${accesscode}' /></c:if>"> <img class="iconButton" src="<fmt:message key="icons.xml"/>" Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/trees.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/trees.jsp 2012-01-03 19:35:57 UTC (rev 1007) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/study/trees.jsp 2012-01-06 16:46:50 UTC (rev 1008) @@ -8,11 +8,14 @@ <c:url var="studyURL" value="summary.html"> <c:param name="id" value="${study.id}"/> -</c:url> +</c:url> +<% + pageContext.setAttribute("accesscode",request.getSession().getAttribute("x-access-code")); +%> <script type="text/javascript"> function openPhylowidget(tree_id) { - var realURL = "http://www.phylowidget.org/full/?tree='http://"+location.host+"/treebase-web/tree_for_phylowidget/"+"TB2:Tr"+tree_id+"'"; + var realURL = "http://www.phylowidget.org/full/?tree='http://"+location.host+"/treebase-web/tree_for_phylowidget/"+"TB2:Tr"+tree_id<c:if test="${!empty accesscode}">+"?x-access-code=<c:out value='${accesscode}' />"</c:if>+"'"; window.open(realURL,'myplwidget') } </script> @@ -67,7 +70,14 @@ sortable="false" class="iconColumn" headerClass="iconColumn"> - <c:url var="url" value="${baseURL}"><c:param name="format">nexml</c:param></c:url> + <c:url var="url" value="${baseURL}"> + <c:param name="format">nexml</c:param> + <c:if test="${!empty accesscode}"> + <c:param name="x-access-code"> + <c:out value='${accesscode}' /> + </c:param> + </c:if> + </c:url> <a href="${url}"> <img class="iconButton" @@ -95,7 +105,14 @@ sortable="false" class="iconColumn" headerClass="iconColumn"> - <c:url var="url" value="${baseURL}"><c:param name="format">nexus</c:param></c:url> + <c:url var="url" value="${baseURL}"> + <c:param name="format">nexus</c:param> + <c:if test="${!empty accesscode}"> + <c:param name="x-access-code"> + <c:out value='${accesscode}' /> + </c:param> + </c:if> + </c:url> <a href="${url}"> <img class="iconButton" @@ -111,7 +128,12 @@ headerClass="iconColumn"> <c:url value="/search/downloadANexusFile.html" var="originalTreeURL"> <c:param name="id">${study.id}</c:param> - <c:param name="treeid">${tree.id}</c:param> + <c:param name="treeid">${tree.id}</c:param> + <c:if test="${!empty accesscode}"> + <c:param name="x-access-code"> + <c:out value='${accesscode}' /> + </c:param> + </c:if> </c:url> <a href="${originalTreeURL}"> <img This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sfr...@us...> - 2012-01-24 17:29:12
|
Revision: 1018 http://treebase.svn.sourceforge.net/treebase/?rev=1018&view=rev Author: sfrgpiel Date: 2012-01-24 17:29:01 +0000 (Tue, 24 Jan 2012) Log Message: ----------- Adding data download links to the study search result list. Modified Paths: -------------- trunk/treebase-web/src/main/resources/ApplicationResources.properties trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/studyList.jsp Modified: trunk/treebase-web/src/main/resources/ApplicationResources.properties =================================================================== --- trunk/treebase-web/src/main/resources/ApplicationResources.properties 2012-01-20 14:04:31 UTC (rev 1017) +++ trunk/treebase-web/src/main/resources/ApplicationResources.properties 2012-01-24 17:29:01 UTC (rev 1018) @@ -192,6 +192,7 @@ citation.keywords= Keywords citation.pmid= PubMed ID citation.doi=DOI +citation.weblink=Link to Publication citation.abstract = Abstract citation.url = URL citation.type=Citation Type @@ -212,8 +213,8 @@ citation.update.success = Citation has been updated successfully #-- study -- -study.title = TreeBASE Submission Information -study.update.title = Update Treebase Submission +study.title = Submission Information +study.update.title = Update TreeBASE Submission study.id = Submission ID study.name = Name of study study.notes = Notes for study @@ -310,7 +311,7 @@ matrix.include = Included? matrix.description = Description download.original = Download Original File -download.reconstructedfile = Download Reconstructed File +download.reconstructedfile = Download Reconstructed NEXUS File download.unavailable = File download currently not available download.nexml = Download NeXML File download.json = Download JSON File Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/studyList.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/studyList.jsp 2012-01-20 14:04:31 UTC (rev 1017) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/studyList.jsp 2012-01-24 17:29:01 UTC (rev 1018) @@ -48,7 +48,10 @@ <c:if test="${not empty study.citation.doi}"> <c:set var="DOIResource" value="${DOIResolver}${study.citation.doi}"/> <a href="${DOIResource}" target="_blank"> - <img class="iconButton" src="<fmt:message key="icons.weblink"/>" /> + <img class="iconButton" + src="<fmt:message key="icons.weblink"/>" + title="<fmt:message key="citation.weblink"/>" + alt="<fmt:message key="citation.weblink"/>"/> <!-- ${study.citation.doi} --></a> </c:if> </display:column> @@ -58,7 +61,7 @@ url="/search/study/summary.html" paramId="id" paramProperty="id" - class="iconColumn" + class="iconColumn noBreak" headerClass="iconColumn"> <img class="iconButton" @@ -66,6 +69,27 @@ title="<fmt:message key="study.title"/>" alt="<fmt:message key="study.title"/>"/> </display:column> + + <display:column + class="iconColumn" + headerClass="iconColumn" + sortable="false"> + <c:set var="baseLink" value="${study.phyloWSPath.purl}"/> + <a href="${baseLink}?format=nexus" target="_blank"> + <img + class="iconButton" + src="<fmt:message key="icons.download.reconstructed"/>" + title="<fmt:message key="download.reconstructedfile"/>" + alt="<fmt:message key="download.reconstructedfile"/>"/> + </a> + <a href="${baseLink}?format=nexml" target="_blank"> + <img + class="iconButton" + src="<fmt:message key="icons.xml"/>" + title="<fmt:message key="download.nexml"/>" + alt="<fmt:message key="download.nexml"/>"/> + </a> + </display:column> <display:footer> <tr> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hl...@us...> - 2013-01-22 13:03:29
|
Revision: 1098 http://treebase.svn.sourceforge.net/treebase/?rev=1098&view=rev Author: hlapp Date: 2013-01-22 13:03:18 +0000 (Tue, 22 Jan 2013) Log Message: ----------- Rolling back revisions 1084 through 1091 on the main trunk. These revisions are now on the simple-search-UI branch. Modified Paths: -------------- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/MatrixSearchController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/StudySearchController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/TaxonSearchController.java trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/TreeSearchController.java trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/matrixSearch.jsp trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/simpleSearchForm.jsp trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/studySearch.jsp trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/taxonSearch.jsp trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/treeSearch.jsp Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/MatrixSearchController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/MatrixSearchController.java 2013-01-22 13:00:20 UTC (rev 1097) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/MatrixSearchController.java 2013-01-22 13:03:18 UTC (rev 1098) @@ -14,7 +14,6 @@ import org.apache.log4j.Logger; import org.cipres.treebase.TreebaseUtil; import org.cipres.treebase.RangeExpression.MalformedRangeExpression; -import org.cipres.treebase.domain.TBPersistable; import org.cipres.treebase.domain.matrix.CharacterMatrix; import org.cipres.treebase.domain.matrix.Matrix; import org.cipres.treebase.domain.matrix.MatrixService; @@ -22,6 +21,8 @@ import org.cipres.treebase.domain.search.SearchResults; import org.cipres.treebase.domain.search.SearchResultsType; import org.cipres.treebase.web.Constants; +import org.cipres.treebase.web.util.RequestMessageSetter; +import org.cipres.treebase.web.util.SearchMessageSetter; import org.springframework.validation.BindException; import org.springframework.web.servlet.ModelAndView; import org.z3950.zing.cql.CQLAndNode; @@ -56,16 +57,65 @@ byTB1ID } - protected ModelAndView onSubmit(HttpServletRequest req,HttpServletResponse res,Object comm,BindException err) throws Exception { + protected ModelAndView onSubmit( + HttpServletRequest request, + HttpServletResponse response, + Object command, + BindException errors) throws Exception { + LOGGER.info("in matrixSearchController.onSubmit"); - clearMessages(req); - String query = req.getParameter("query"); + + clearMessages(request); + String formName = request.getParameter("formName"); + String query = request.getParameter("query"); + + LOGGER.info("formName is '" + formName + "'"); + if ( ! TreebaseUtil.isEmpty(query) ) { - return handleQueryRequest(req, res, err, query); + return this.handleQueryRequest(request, response, errors, query); + } + + if (formName.equals("matrixSimple")) { + String buttonName = request.getParameter("searchButton"); + Set<Matrix> matches = new HashSet<Matrix>(); + String searchTerm = convertStars(request.getParameter("searchTerm")); + SearchMessageSetter mSetter = new RequestMessageSetter(request); + MatrixSearchResults oldRes; + { + SearchResults<?> sr = searchResults(request); + if (sr != null) { + oldRes = (MatrixSearchResults) sr.convertToMatrices(); + } else { + oldRes = new MatrixSearchResults (); // TODO: Convert existing search results to new type + } + } + if (buttonName.equals("matrixID")) { + matches.addAll(doSearch(request, response, SearchType.byID, errors,searchTerm)); + } else if (buttonName.equals("matrixTitle")) { + matches.addAll(doSearch(request, response, SearchType.byTitle, errors,searchTerm)); + } else if (buttonName.equals("matrixType")) { + matches.addAll(doSearch(request, response, SearchType.byType, errors,searchTerm)); + } else if (buttonName.equals("matrixNTAX")) { + matches.addAll(doSearch(request, response, SearchType.byNTAX, errors,searchTerm)); + } else if (buttonName.equals("matrixNCHAR")) { + matches.addAll(doSearch(request, response, SearchType.byNCHAR, errors,searchTerm)); + } else { + throw new Error("Unknown search button name '" + buttonName + "'"); + } + if ( TreebaseUtil.isEmpty(request.getParameter("format")) || ! request.getParameter("format").equals("rss1") ) { + SearchResults<Matrix> newRes = intersectSearchResults(oldRes, + new MatrixSearchResults(matches), mSetter, "No matching matrices found"); + saveSearchResults(request, newRes); + return new ModelAndView("search/matrixSearch", Constants.RESULT_SET, newRes); + } + else { + return this.searchResultsAsRDF(new MatrixSearchResults(matches), request, null, "matrix", "matrix"); + } + } + + else { + return super.onSubmit(request, response, command, errors); } - else { - return super.onSubmit(req, res, comm, err); - } } protected Set<Matrix> doCQLQuery( @@ -111,7 +161,7 @@ } else if ( index.startsWith("tb.ntax") ) { results.addAll(doSearch(request, response, SearchType.byNTAX, errors, term.getTerm())); } else if ( index.startsWith("tb.nchar") ) { - results.addAll(doSearch(request, response, SearchType.byNCHAR, errors, term.getTerm())); + results.addAll(doSearch(request, response, SearchType.byNTAX, errors, term.getTerm())); } else { // issue warnings addMessage(request, "Unsupported index: " + index); @@ -121,6 +171,7 @@ return results; } + @SuppressWarnings("unchecked") private Collection<Matrix> doSearch( HttpServletRequest request, HttpServletResponse response, @@ -128,68 +179,62 @@ BindException errors, String searchTerm) throws InstantiationException { - Collection<Matrix> results = new HashSet<Matrix>(); + Collection<Matrix> matches = null; MatrixService matrixService = getSearchService().getMatrixService(); switch(searchType) { - case byID: { - addMatchesToResults(doSearchByIDString(request, matrixService, Matrix.class, searchTerm), results); - break; + case byID: + matches = (Collection<Matrix>) doSearchByIDString(request, matrixService, Matrix.class, searchTerm); + break; + + case byTB1ID: + matches = new HashSet<Matrix>(); + matches.add(matrixService.findByTB1StudyID(searchTerm)); + break; + + case byTitle: + matches = matrixService + .findSomethingBySubstring(Matrix.class, "title", searchTerm); + break; + + case byType: + matches = matrixService + .findSomethingByItsDescription(Matrix.class, "matrixKind", searchTerm, false); + break; + + case byNCHAR: + try { + matches = matrixService + .findSomethingByRangeExpression(CharacterMatrix.class, "nChar", searchTerm); + } catch (MalformedRangeExpression e) { + addMessage(request, "Malformed range expression: " + e.getMessage()); } - case byTB1ID: { - Matrix match = matrixService.findByTB1StudyID(searchTerm); - if ( null != match ) { - results.add(match); - } - break; + break; + + + case byNTAX: + try { + matches = matrixService + .findSomethingByRangeExpression(CharacterMatrix.class, "nTax", searchTerm); + } catch (MalformedRangeExpression e) { + addMessage(request, "Malformed range expression: " + e.getMessage()); } - case byTitle: { - addMatchesToResults(matrixService.findSomethingBySubstring(Matrix.class, "title", searchTerm), results); - break; - } - case byType: { - addMatchesToResults(matrixService.findSomethingByItsDescription(Matrix.class, "matrixKind", searchTerm, false),results); - break; - } - case byNCHAR: { - try { - addMatchesToResults(matrixService.findSomethingByRangeExpression(CharacterMatrix.class, "nChar", searchTerm),results); - } catch (MalformedRangeExpression e) { - addMessage(request, "Malformed range expression: " + e.getMessage()); - } - break; - } - case byNTAX: { - try { - addMatchesToResults(matrixService.findSomethingByRangeExpression(CharacterMatrix.class, "nTax", searchTerm),results); - } catch (MalformedRangeExpression e) { - addMessage(request, "Malformed range expression: " + e.getMessage()); - } - break; - } + break; } // XXX need to filter out orphaned matrices or matrices whose studies are unpublished Collection<Matrix> orphanedMatrices = new HashSet<Matrix>(); - for ( Matrix m : results ) { - if ( m.getStudy() == null || m.getStudy().isPublished() == false ) { + for ( Matrix m : matches ) { + if ( m.getStudy() == null || (m.getStudy().isPublished() == false) ) { orphanedMatrices.add(m); - } + } } - results.removeAll(orphanedMatrices); - return results; + matches.removeAll(orphanedMatrices); + return matches; } - @SuppressWarnings("unchecked") - private void addMatchesToResults(Collection<? extends TBPersistable> matches, - Collection<Matrix> results) { - if ( null != matches && ! matches.isEmpty() ) { - results.addAll((Collection<? extends Matrix>) matches); - } - } - SearchResultsType currentSearchType() { return SearchResultsType.MATRIX; } @@ -201,6 +246,7 @@ @Override protected ModelAndView handleQueryRequest(HttpServletRequest request,HttpServletResponse response,BindException errors, String query) throws CQLParseException, IOException, InstantiationException { + //String query = request.getParameter("query"); CQLParser parser = new CQLParser(); CQLNode root = parser.parse(query); root = normalizeParseTree(root); Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/StudySearchController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/StudySearchController.java 2013-01-22 13:00:20 UTC (rev 1097) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/StudySearchController.java 2013-01-22 13:03:18 UTC (rev 1098) @@ -26,6 +26,7 @@ import org.cipres.treebase.domain.study.SubmissionService; import org.cipres.treebase.web.Constants; import org.cipres.treebase.web.model.Identify; +import org.cipres.treebase.web.util.RequestMessageSetter; import org.cipres.treebase.web.util.IdentifyUtil; import org.springframework.validation.BindException; import org.springframework.web.servlet.ModelAndView; @@ -39,6 +40,8 @@ import org.z3950.zing.cql.CQLRelation; import org.z3950.zing.cql.CQLTermNode; +import java.text.DateFormat; + /** * StudySearchController.java * @@ -93,15 +96,73 @@ byDOI } - protected ModelAndView onSubmit(HttpServletRequest req,HttpServletResponse res,Object comm,BindException err) throws Exception { + protected ModelAndView onSubmit( + HttpServletRequest request, + HttpServletResponse response, + Object command, + BindException errors) throws Exception { + LOGGER.info("in StudySearchController.onSubmit"); - clearMessages(req); - String query = req.getParameter("query"); - if ( ! TreebaseUtil.isEmpty(query) ) { - return handleQueryRequest(req, res, err, query); - } + + clearMessages(request); + String formName = request.getParameter("formName"); + String query = request.getParameter("query"); + + LOGGER.info("formName is '" + formName + "'"); + + if ( ! TreebaseUtil.isEmpty(query) && ! query.equals("")) { + LOGGER.info("query is '" + query + "'"); + return this.handleQueryRequest(request, response, errors, query); + } + + if (formName.equals("searchKeyword")) { + SearchType searchType; + String buttonName = request.getParameter("searchButton"); + String searchTerm = convertStars(request.getParameter("searchTerm")); + StudySearchResults oldRes; + { + SearchResults<?> sr = searchResults(request); + if (sr != null) { + oldRes = (StudySearchResults) sr.convertToStudies(); + } else { + oldRes = new StudySearchResults (); // TODO: Convert existing search results to new type + } + } + if (buttonName.equals("authorKeyword")) { + searchType = SearchType.byAuthorName; + } else if (buttonName.equals("studyID")) { + searchType = SearchType.byID; + } else if (buttonName.equals("legacyStudyID")) { + searchType = SearchType.byLegacyID; + } else if (buttonName.equals("titleKeyword")) { + searchType = SearchType.byTitle; + } else if (buttonName.equals("textKeyword")) { + searchType = SearchType.byKeyword; + } else if (buttonName.equals("citationKeyword")) { + searchType = SearchType.inCitation; + } else if (buttonName.equals("abstractKeyword")) { + searchType = SearchType.inAbstract; + } else if (buttonName.equals("doiKeyword")) { + searchType = SearchType.byDOI; + } + else { + throw new Error("Unknown search button name '" + buttonName + "'"); + } + // XXX we now never do an exact match with terms provided through the web app. We can change + // this, e.g. by adding a check box whose value is the boolean argument of doSearch() + Collection<Study> matches = doSearch(request, response, searchType, errors,searchTerm,false,null); + if ( TreebaseUtil.isEmpty(request.getParameter("format")) || ! request.getParameter("format").equals("rss1") ) { + SearchResults<Study> newRes = intersectSearchResults(oldRes, new StudySearchResults(matches), + new RequestMessageSetter(request), "No matching studies found"); + saveSearchResults(request, newRes); + return new ModelAndView("search/studySearch", Constants.RESULT_SET, newRes); + } + else { + return this.searchResultsAsRDF(new StudySearchResults(matches), request, null,"study","study"); + } + } else { - return super.onSubmit(req, res, comm, err); + return super.onSubmit(request, response, command, errors); } } Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/TaxonSearchController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/TaxonSearchController.java 2013-01-22 13:00:20 UTC (rev 1097) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/TaxonSearchController.java 2013-01-22 13:03:18 UTC (rev 1098) @@ -47,14 +47,51 @@ private enum NamingAuthority { TREEBASE, UBIO, NCBI }; @Override - protected ModelAndView onSubmit(HttpServletRequest req, HttpServletResponse res, Object comm, BindException err) throws Exception { - clearMessages(req); - String query = req.getParameter("query"); + protected ModelAndView onSubmit(HttpServletRequest request, + HttpServletResponse response, Object searchCommand, BindException errors) + throws Exception { + clearMessages(request); + String formName = request.getParameter("formName"); + String query = request.getParameter("query"); if ( ! TreebaseUtil.isEmpty(query) ) { - return handleQueryRequest(req, res, err, query); + return this.handleQueryRequest(request, response, errors, query); } - else { - return super.onSubmit(req, res, comm, err); + if (formName.equals("searchByTaxonLabel")) { + SearchCommand newSearchCommand = (SearchCommand)searchCommand; + String searchOn = request.getParameter("searchOn"); + String searchTerm = convertStars(request.getParameter("searchTerm")); + String[] searchTerms = searchTerm.split("\\r\\n"); + Collection<Taxon> taxa = new HashSet<Taxon>(); + for ( int i = 0; i < searchTerms.length; i++ ) { + if ( searchOn.equals("TextSearch") ) { + taxa.addAll(doTaxonSearch(request, newSearchCommand, searchTerms[i], SearchIndex.LABEL, null)); + } + else if ( searchOn.equals("Identifiers") ) { + String objectIdentifier = request.getParameter("objectIdentifier"); + if ( objectIdentifier.equals("TreeBASE") ) { + taxa.addAll(doTaxonSearch(request,newSearchCommand,searchTerms[i],SearchIndex.ID,NamingAuthority.TREEBASE)); + } + else if ( objectIdentifier.equals("NCBI") ) { + taxa.addAll(doTaxonSearch(request,newSearchCommand,searchTerms[i],SearchIndex.ID,NamingAuthority.NCBI)); + } + else if ( objectIdentifier.equals("uBio") ) { + taxa.addAll(doTaxonSearch(request,newSearchCommand,searchTerms[i],SearchIndex.ID,NamingAuthority.UBIO)); + } + } + } + TaxonSearchResults tsr = new TaxonSearchResults(taxa); + saveSearchResults(request, tsr); + if ( TreebaseUtil.isEmpty(request.getParameter("format")) || ! request.getParameter("format").equals("rss1") ) { + return samePage(request); + } + else { + return this.searchResultsAsRDF(tsr, request, null,"taxon","taxon"); + } + + } else if (formName.equals("taxonResultsAction")) { + return modifySearchResults(request, response, errors); + } else { + return super.onSubmit(request, response, (SearchCommand) searchCommand, errors); } } @@ -129,6 +166,31 @@ logger.debug(node); return results; } + + private ModelAndView modifySearchResults(HttpServletRequest request, + HttpServletResponse response, BindException errors) throws InstantiationException { + TaxonSearchResults results = searchResults(request).convertToTaxa(); + + String buttonName = request.getParameter("taxonResultsaction"); + if (buttonName.equals("addCheckedToResults")) { +// Map<String,String> parameterMap = request.getParameterMap(); + Collection<Taxon> newTaxa = new HashSet<Taxon> (); + for (String taxonIdString : request.getParameterValues("selection")) { + Taxon tx; + try { + tx = getTaxonLabelService().findTaxonByIDString(taxonIdString); + } catch (MalformedTreebaseIDString e) { + // This can only occur if the ID numbers in our web form are + // malformed, so it represents a programming error. 20090312 MJD + throw new Error(e); + } + if (tx != null) newTaxa.add(tx); + } + results.union(newTaxa); + saveSearchResults(request, results); + } + return samePage(request); + } protected Collection<Taxon> doTaxonSearch(HttpServletRequest request, SearchCommand searchCommand, String searchTerm, SearchIndex searchIndex, NamingAuthority namingAuthority) throws Exception { @@ -161,6 +223,9 @@ getTaxonLabelService().resurrectAll(taxa); LOGGER.debug("Found " + taxa.size() + " taxa"); return taxa; +// TaxonSearchResults tsr = new TaxonSearchResults(taxa); +// saveSearchResults(request, tsr); +// return samePage(request); } /** @@ -198,20 +263,16 @@ } if ( null != tb1LegacyId && null != index && index.matches(".*taxonVariant.*") ) { TaxonVariant tv = getTaxonHome().findVariantByTB1LegacyId(tb1LegacyId); - if ( null != tv ) { - LOGGER.debug("Found taxon variant: " + tv.getId()); - if ( null != tv.getTaxon() ) { - taxaFound.add(tv.getTaxon()); - } + LOGGER.debug("Found taxon variant: " + tv.getId()); + if ( null != tv.getTaxon() ) { + taxaFound.add(tv.getTaxon()); } } else if ( null != tb1LegacyId ){ Taxon taxon = getTaxonHome().findByTB1LegacyId(tb1LegacyId); + LOGGER.debug("Found taxon: " + taxon.getId()); if ( null != taxon ) { - LOGGER.debug("Found taxon: " + taxon.getId()); - if ( null != taxon ) { - taxaFound.add(taxon); - } + taxaFound.add(taxon); } } } Modified: trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/TreeSearchController.java =================================================================== --- trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/TreeSearchController.java 2013-01-22 13:00:20 UTC (rev 1097) +++ trunk/treebase-web/src/main/java/org/cipres/treebase/web/controllers/TreeSearchController.java 2013-01-22 13:03:18 UTC (rev 1098) @@ -14,12 +14,14 @@ import org.apache.log4j.Logger; import org.cipres.treebase.TreebaseUtil; import org.cipres.treebase.RangeExpression.MalformedRangeExpression; +import org.cipres.treebase.domain.matrix.Matrix; import org.cipres.treebase.domain.search.SearchResults; import org.cipres.treebase.domain.search.SearchResultsType; import org.cipres.treebase.domain.search.TreeSearchResults; import org.cipres.treebase.domain.tree.PhyloTree; import org.cipres.treebase.domain.tree.PhyloTreeService; import org.cipres.treebase.web.Constants; +import org.cipres.treebase.web.util.RequestMessageSetter; import org.springframework.validation.BindException; import org.springframework.web.servlet.ModelAndView; import org.z3950.zing.cql.CQLAndNode; @@ -54,15 +56,73 @@ byNTAX } - protected ModelAndView onSubmit(HttpServletRequest req,HttpServletResponse res,Object comm,BindException err) throws Exception { + protected ModelAndView onSubmit( + HttpServletRequest request, + HttpServletResponse response, + Object command, + BindException errors) throws Exception { + LOGGER.info("in TreeSearchController.onSubmit"); - clearMessages(req); - String query = req.getParameter("query"); + + clearMessages(request); + String formName = request.getParameter("formName"); + String query = request.getParameter("query"); + + LOGGER.info("formName is '" + formName + "'"); + if ( ! TreebaseUtil.isEmpty(query) ) { - return handleQueryRequest(req, res, err, query); + return this.handleQueryRequest(request, response, errors, query); } - else { - return super.onSubmit(req, res, comm, err); + + if (formName.equals("treeSimple")) { + String buttonName = request.getParameter("searchButton"); + String searchTerm = convertStars(request.getParameter("searchTerm")); + Collection<PhyloTree> matches = null; + TreeSearchResults oldRes; + { + SearchResults<?> sr = searchResults(request); + if (sr != null) { + oldRes = (TreeSearchResults) sr.convertToTrees(); + } else { + oldRes = new TreeSearchResults (); // TODO: Convert existing search results to new type + } + } + if (buttonName.equals("treeID")) { + matches = doSearch(request, response, SearchType.byID, errors, searchTerm); + } else if (buttonName.equals("treeTitle")) { + matches = doSearch(request, response, SearchType.byTitle, errors, searchTerm); + } else if (buttonName.equals("treeType")) { + matches = doSearch(request, response, SearchType.byType, errors, searchTerm); + } else if (buttonName.equals("treeKind")) { + matches = doSearch(request, response, SearchType.byKind, errors, searchTerm); + } else if (buttonName.equals("treeQuality")) { + matches = doSearch(request, response, SearchType.byQuality, errors, searchTerm); + } else if (buttonName.equals("treeNTAX")) { + matches = doSearch(request, response, SearchType.byNTAX, errors, searchTerm); + } else { + throw new Error("Unknown search button name '" + buttonName + "'"); + } + + // XXX need to filter out orphaned matrices or matrices whose studies are unpublished + Collection<PhyloTree> orphanedTrees = new HashSet<PhyloTree>(); + for ( PhyloTree t : matches ) { + if (t.getStudy() == null || (t.getStudy().isPublished() == false)){ + orphanedTrees.add(t); + } + } + matches.removeAll(orphanedTrees); + + SearchResults<PhyloTree> newRes = intersectSearchResults(oldRes, new TreeSearchResults(matches), + new RequestMessageSetter(request), "No matching trees found"); + saveSearchResults(request, newRes); + if ( TreebaseUtil.isEmpty(request.getParameter("format")) || ! request.getParameter("format").equals("rss1") ) { + return new ModelAndView("search/treeSearch", Constants.RESULT_SET, newRes); + } + else { + return this.searchResultsAsRDF(newRes, request, null,"tree","tree"); + } + } else { + return super.onSubmit(request, response, command, errors); } } @@ -188,6 +248,7 @@ protected ModelAndView handleQueryRequest(HttpServletRequest request, HttpServletResponse response, BindException errors, String query) throws CQLParseException, IOException, InstantiationException { + //String query = request.getParameter("query"); CQLParser parser = new CQLParser(); CQLNode root = parser.parse(query); root = normalizeParseTree(root); Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/matrixSearch.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/matrixSearch.jsp 2013-01-22 13:00:20 UTC (rev 1097) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/matrixSearch.jsp 2013-01-22 13:03:18 UTC (rev 1098) @@ -15,25 +15,16 @@ 'integer' : [ 'tb.identifier.matrix', 'tb.identifier.matrix.tb1', 'tb.ntax.matrix', 'tb.nchar.matrix' ], 'id' : [ 'tb.identifier.matrix', 'tb.identifier.matrix.tb1' ], 'word' : [ 'tb.title.matrix', 'tb.type.matrix' ], + 'doi' : [ 'prism.doi' ] // this doesn't work yet, we have no search on doi }; - // purlBase is assigned in /common/search-nav.jsp + // purlBase is assigned in /common/search-nav.jsp var phyloWSURI = purlBase + 'matrix/find?query='; //]]> </script> -<%-- jsp:include page="matrixSimpleSearchForm.jsp"/ --%> +<jsp:include page="matrixSimpleSearchForm.jsp"/> -<fieldset> - <legend> - Matrix search - <a href="#" class="openHelp" onclick="openHelp('matrixSimpleSearchForm')"> - <img class="iconButton" src="<fmt:message key="icons.help"/>" /> - </a> - </legend> -<jsp:include page="simpleSearchForm.jsp"/> -</fieldset> - <c:set var="searchType" value="matrix" scope="request"/> <div id="s-clear"></div> Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/simpleSearchForm.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/simpleSearchForm.jsp 2013-01-22 13:00:20 UTC (rev 1097) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/simpleSearchForm.jsp 2013-01-22 13:03:18 UTC (rev 1098) @@ -5,7 +5,7 @@ <input type="radio" name="join" onclick="TreeBASE.expandQuery(); return true;" id="all" value="and"/> All <input type="radio" name="join" onclick="TreeBASE.expandQuery(); return true;" value="or" checked="checked"/> Any<br/> <a onclick="TreeBASE.collapseExpand('expanded','block',this)" id="expander"> - <img src="/treebase-web/images/plus.gif"/> + <img src="http://www.treebase.org/treebase-web/images/plus.gif"/> <small style="color:silver">Advanced search</small> </a> <textarea id="expanded" style="display:none;width:500px;height:300px"></textarea><br/> Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/studySearch.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/studySearch.jsp 2013-01-22 13:00:20 UTC (rev 1097) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/studySearch.jsp 2013-01-22 13:03:18 UTC (rev 1098) @@ -20,25 +20,15 @@ 'doi' : [ 'prism.doi' ] }; - // purlBase is assigned in /common/search-nav.jsp + // purlBase is assigned in /common/search-nav.jsp var phyloWSURI = purlBase + 'study/find?query='; //]]> </script> <c:set var="searchType" value="study" scope="request"/> -<%-- jsp:include page="studyKeywordSearchForm.jsp"/ --%> +<jsp:include page="studyKeywordSearchForm.jsp"/> -<fieldset> - <legend> - Study search - <a href="#" class="openHelp" onclick="openHelp('studyKeywordSearchForm')"> - <img class="iconButton" src="<fmt:message key="icons.help"/>" /> - </a> - </legend> -<jsp:include page="simpleSearchForm.jsp"/> -</fieldset> - <div id="s-clear"></div> <jsp:include page="searchMessages.jsp"/> Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/taxonSearch.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/taxonSearch.jsp 2013-01-22 13:00:20 UTC (rev 1097) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/taxonSearch.jsp 2013-01-22 13:03:18 UTC (rev 1098) @@ -15,9 +15,10 @@ 'integer' : [ 'tb.identifier.ncbi', 'tb.identifier.ubio', 'tb.identifier.taxon', 'tb.identifier.taxon.tb1' ], 'id' : [ 'tb.identifier.taxon', 'tb.identifier.taxon.tb1' ], 'word' : [ 'tb.title.taxon', 'tb.title.taxonLabel', 'tb.title.taxonVariant' ], + 'doi' : [ 'prism.doi' ] // this doesn't work yet, we have no search on doi }; - // purlBase is assigned in /common/search-nav.jsp + // purlBase is assigned in /common/search-nav.jsp var phyloWSURI = purlBase + 'taxon/find?query='; //]]> </script> Modified: trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/treeSearch.jsp =================================================================== --- trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/treeSearch.jsp 2013-01-22 13:00:20 UTC (rev 1097) +++ trunk/treebase-web/src/main/webapp/WEB-INF/pages/search/treeSearch.jsp 2013-01-22 13:03:18 UTC (rev 1098) @@ -19,23 +19,13 @@ 'word' : [ 'tb.title.tree', 'tb.type.tree', 'tb.kind.tree', 'tb.quality.tree' ], }; - // purlBase is assigned in /common/search-nav.jsp + // purlBase is assigned in /common/search-nav.jsp var phyloWSURI = purlBase + 'tree/find?query='; //]]> </script> -<%-- jsp:include page="treeSimpleSearchForm.jsp"/ --%> +<jsp:include page="treeSimpleSearchForm.jsp"/> -<fieldset> - <legend> - Tree search - <a href="#" class="openHelp" onclick="openHelp('treeSimpleSearchForm')"> - <img class="iconButton" src="<fmt:message key="icons.help"/>" /> - </a> - </legend> -<jsp:include page="simpleSearchForm.jsp"/> -</fieldset> - <c:set var="searchType" value="tree" scope="request"/> <div id="s-clear"></div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |