|
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.
|