Cleanup - remove obsolete VitroQuery and related classes.
This commit is contained in:
parent
a408da5e9b
commit
a91a52548e
4 changed files with 1 additions and 121 deletions
|
@ -1,55 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
package edu.cornell.mannlib.vitro.webapp.search.beans;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||
import edu.cornell.mannlib.vitro.webapp.search.SearchException;
|
||||
|
||||
public abstract class VitroQuery {
|
||||
/**
|
||||
* The parameter name for http requests.
|
||||
*/
|
||||
public static final String QUERY_PARAMETER_NAME = "querytext";
|
||||
public static final String QUERY_PARAMETER_EARLIEST = "earliest";
|
||||
public static final String QUERY_PARAMETER_LATEST = "latest";
|
||||
public static final String QUERY_PARAMETER_IGNORE_TIMESTAMP= "ignore_timestamp";
|
||||
|
||||
DateTime earliest;
|
||||
DateTime latest;
|
||||
Map parameters = null;
|
||||
|
||||
/**
|
||||
* Make a VitroQuery with the request parameters
|
||||
* for when the query needs to be created.
|
||||
*/
|
||||
public VitroQuery(VitroRequest request){
|
||||
parameters =request.getParameterMap();
|
||||
if( parameters == null )
|
||||
parameters = Collections.EMPTY_MAP;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the parameters that were passed into this query from the
|
||||
* HttpRequest so they can be displayed to the user on return to a
|
||||
* search form.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map getParameters(){
|
||||
return parameters;
|
||||
}
|
||||
|
||||
public abstract String getTerms();
|
||||
|
||||
/**
|
||||
* This is intended to return an specilized query object
|
||||
* for your implementation of the search.
|
||||
* @return
|
||||
*/
|
||||
public abstract Object getQuery() throws SearchException;
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
package edu.cornell.mannlib.vitro.webapp.search.beans;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest;
|
||||
import edu.cornell.mannlib.vitro.webapp.search.SearchException;
|
||||
|
||||
public interface VitroQueryFactory {
|
||||
public VitroQuery getQuery(VitroRequest req) throws SearchException;
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
||||
|
||||
package edu.cornell.mannlib.vitro.webapp.search.beans;
|
||||
|
||||
/**
|
||||
* VitroQueryWrapper holds the information about the last query that the
|
||||
* user made.
|
||||
*
|
||||
* @author bdc34
|
||||
*
|
||||
*/
|
||||
public class VitroQueryWrapper {
|
||||
private VitroQuery query = null;
|
||||
private int requestCount = 0;
|
||||
private long searchTime = 0;
|
||||
|
||||
|
||||
public VitroQueryWrapper(VitroQuery q, int reqCount, long d){
|
||||
this.setSearchTime(d);
|
||||
this.setQuery(q);
|
||||
this.setRequestCount(reqCount);
|
||||
}
|
||||
|
||||
public long getSearchTime() {
|
||||
return searchTime;
|
||||
}
|
||||
public void setSearchTime(long searchTime) {
|
||||
this.searchTime = searchTime;
|
||||
}
|
||||
public VitroQuery getQuery() {
|
||||
return query;
|
||||
}
|
||||
public void setQuery(VitroQuery query) {
|
||||
this.query = query;
|
||||
}
|
||||
public int getRequestCount() {
|
||||
return requestCount;
|
||||
}
|
||||
public void setRequestCount(int requestCount) {
|
||||
this.requestCount = requestCount;
|
||||
}
|
||||
|
||||
}
|
|
@ -48,10 +48,7 @@ import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
|||
import edu.cornell.mannlib.vitro.webapp.dao.jena.VClassGroupCache;
|
||||
import edu.cornell.mannlib.vitro.webapp.i18n.I18n;
|
||||
import edu.cornell.mannlib.vitro.webapp.search.IndexConstants;
|
||||
import edu.cornell.mannlib.vitro.webapp.search.SearchException;
|
||||
import edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames;
|
||||
import edu.cornell.mannlib.vitro.webapp.search.beans.VitroQuery;
|
||||
import edu.cornell.mannlib.vitro.webapp.search.beans.VitroQueryFactory;
|
||||
import edu.cornell.mannlib.vitro.webapp.search.solr.SolrSetup;
|
||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.LinkTemplateModel;
|
||||
import edu.cornell.mannlib.vitro.webapp.web.templatemodels.searchresult.IndividualSearchResult;
|
||||
|
@ -163,7 +160,7 @@ public class PagedSearchController extends FreemarkerHttpServlet {
|
|||
int startIndex = getStartIndex(vreq);
|
||||
int hitsPerPage = getHitsPerPage( vreq );
|
||||
|
||||
String queryText = vreq.getParameter(VitroQuery.QUERY_PARAMETER_NAME);
|
||||
String queryText = vreq.getParameter(PARAM_QUERY_TEXT);
|
||||
log.debug("Query text is \""+ queryText + "\"");
|
||||
|
||||
|
||||
|
@ -673,15 +670,6 @@ public class PagedSearchController extends FreemarkerHttpServlet {
|
|||
|
||||
public static final int MAX_QUERY_LENGTH = 500;
|
||||
|
||||
public VitroQueryFactory getQueryFactory() {
|
||||
throw new Error("PagedSearchController.getQueryFactory() is unimplemented");
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public List search(VitroQuery query) throws SearchException {
|
||||
throw new Error("PagedSearchController.search() is unimplemented");
|
||||
}
|
||||
|
||||
protected boolean isRequestedFormatXml(VitroRequest req){
|
||||
if( req != null ){
|
||||
String param = req.getParameter(PARAM_XML_REQUEST);
|
||||
|
|
Loading…
Add table
Reference in a new issue