From ad9c08cf287cdb8b026428fa6fe1bc01107acc2f Mon Sep 17 00:00:00 2001 From: Jim Blake Date: Wed, 23 Apr 2014 14:20:14 -0400 Subject: [PATCH] VIVO-742 Many changes to remove "solr" from the code base. Comments, template names, Java classes, variables and method names (Java and JavaScript), etc. --- .../rdf/displayTbox/everytime/displayTBOX.n3 | 4 +- .../grefine/JSONReconcileServlet.java | 2 +- ...> GetRandomSearchIndividualsByVClass.java} | 8 ++-- ...GetRenderedSearchIndividualsByVClass.java} | 12 ++--- .../json/GetSearchIndividualsByVClasses.java | 2 +- .../webapp/controller/json/JsonServlet.java | 10 ++--- .../vitro/webapp/dao/DisplayVocabulary.java | 2 +- .../generators/ManagePageGenerator.java | 6 +-- .../webapp/search/beans/IndexerIface.java | 4 +- .../search/controller/IndexController.java | 6 +-- .../search/documentBuilding/NameBoost.java | 10 +++-- .../webapp/search/indexing/IndexBuilder.java | 2 +- .../search/indexing/IndexWorkerThread.java | 3 +- .../utils/dataGetter/ClassGroupPageData.java | 2 +- .../IndividualsForClassesDataGetter.java | 4 +- .../SearchIndividualsDataGetter.java | 14 +++--- .../ThumbnailImageURLTest.java | 6 +-- webapp/web/i18n/all.properties | 2 +- webapp/web/js/menupage/pageManagementUtils.js | 44 +++++++++---------- .../web/js/menupage/processDataGetterUtils.js | 2 +- .../menupage/processSolrDataGetterContent.js | 22 +++++----- .../freemarker/body/admin/searchIndex.ftl | 10 ++--- ...=> menupage--defaultSearchIndividuals.ftl} | 0 .../menupage--exampleMultipleContentTypes.ftl | 5 ++- .../edit/forms/autoCompleteObjectPropForm.ftl | 2 +- .../pageManagement--contentTemplates.ftl | 2 +- .../pageManagement--customDataScript.ftl | 2 +- ... => pageManagement--searchIndividuals.ftl} | 8 ++-- .../freemarker/edit/forms/pageManagement.ftl | 4 +- 29 files changed, 97 insertions(+), 103 deletions(-) rename webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/{GetRandomSolrIndividualsByVClass.java => GetRandomSearchIndividualsByVClass.java} (90%) rename webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/{GetRenderedSolrIndividualsByVClass.java => GetRenderedSearchIndividualsByVClass.java} (89%) rename webapp/web/templates/freemarker/body/menupage/{menupage--defaultSolrIndividuals.ftl => menupage--defaultSearchIndividuals.ftl} (100%) rename webapp/web/templates/freemarker/edit/forms/{pageManagement--solrIndividuals.ftl => pageManagement--searchIndividuals.ftl} (87%) diff --git a/webapp/rdf/displayTbox/everytime/displayTBOX.n3 b/webapp/rdf/displayTbox/everytime/displayTBOX.n3 index 0338c9a94..d2fc816e6 100644 --- a/webapp/rdf/displayTbox/everytime/displayTBOX.n3 +++ b/webapp/rdf/displayTbox/everytime/displayTBOX.n3 @@ -43,7 +43,7 @@ display:RequiredAction a owl:Class ; a owl:Class ; - rdfs:comment "A data getter for a Solr Class search, i.e. get individuals for VClass" . + rdfs:comment "A data getter for a Class search, i.e. get individuals for VClass" . a owl:Class ; @@ -141,7 +141,7 @@ owl:topObjectProperty display:hasVClassId a owl:ObjectProperty ; - rdfs:comment "Object property defining class for solr data getter" . + rdfs:comment "Object property defining class for search data getter" . ###Vitro properties without which individual templates throw errors as are required diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/grefine/JSONReconcileServlet.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/grefine/JSONReconcileServlet.java index 471371f44..01ed16d9a 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/grefine/JSONReconcileServlet.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/grefine/JSONReconcileServlet.java @@ -454,7 +454,7 @@ public class JSONReconcileServlet extends VitroHttpServlet { } private String escapeWhitespaceInQueryString(String queryStr) { - // Solr wants whitespace to be escaped with a backslash + // The search engine wants whitespace to be escaped with a backslash return queryStr.replaceAll("\\s+", "\\\\ "); } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/GetRandomSolrIndividualsByVClass.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/GetRandomSearchIndividualsByVClass.java similarity index 90% rename from webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/GetRandomSolrIndividualsByVClass.java rename to webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/GetRandomSearchIndividualsByVClass.java index df8fd6a18..7a15f8428 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/GetRandomSolrIndividualsByVClass.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/GetRandomSearchIndividualsByVClass.java @@ -2,7 +2,6 @@ package edu.cornell.mannlib.vitro.webapp.controller.json; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -14,7 +13,6 @@ import org.json.JSONException; import org.json.JSONObject; import edu.cornell.mannlib.vitro.webapp.beans.Individual; -import edu.cornell.mannlib.vitro.webapp.beans.VClass; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao; import edu.cornell.mannlib.vitro.webapp.services.shortview.ShortViewService; @@ -26,11 +24,11 @@ import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.Individual * Does a Solr search for individuals, and uses the short view to render each of * the results. */ -public class GetRandomSolrIndividualsByVClass extends GetSearchIndividualsByVClass { +public class GetRandomSearchIndividualsByVClass extends GetSearchIndividualsByVClass { private static final Log log = LogFactory - .getLog(GetRandomSolrIndividualsByVClass.class); + .getLog(GetRandomSearchIndividualsByVClass.class); - protected GetRandomSolrIndividualsByVClass(VitroRequest vreq) { + protected GetRandomSearchIndividualsByVClass(VitroRequest vreq) { super(vreq); } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/GetRenderedSolrIndividualsByVClass.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/GetRenderedSearchIndividualsByVClass.java similarity index 89% rename from webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/GetRenderedSolrIndividualsByVClass.java rename to webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/GetRenderedSearchIndividualsByVClass.java index 65ec975cf..ba95c69f4 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/GetRenderedSolrIndividualsByVClass.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/GetRenderedSearchIndividualsByVClass.java @@ -2,7 +2,6 @@ package edu.cornell.mannlib.vitro.webapp.controller.json; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -14,7 +13,6 @@ import org.json.JSONException; import org.json.JSONObject; import edu.cornell.mannlib.vitro.webapp.beans.Individual; -import edu.cornell.mannlib.vitro.webapp.beans.VClass; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao; import edu.cornell.mannlib.vitro.webapp.services.shortview.ShortViewService; @@ -23,14 +21,14 @@ import edu.cornell.mannlib.vitro.webapp.services.shortview.ShortViewServiceSetup import edu.cornell.mannlib.vitro.webapp.web.templatemodels.individual.IndividualTemplateModel; /** - * Does a Solr search for individuals, and uses the short view to render each of + * Does a search for individuals, and uses the short view to render each of * the results. */ -public class GetRenderedSolrIndividualsByVClass extends GetSearchIndividualsByVClasses { +public class GetRenderedSearchIndividualsByVClass extends GetSearchIndividualsByVClasses { private static final Log log = LogFactory - .getLog(GetRenderedSolrIndividualsByVClass.class); + .getLog(GetRenderedSearchIndividualsByVClass.class); - protected GetRenderedSolrIndividualsByVClass(VitroRequest vreq) { + protected GetRenderedSearchIndividualsByVClass(VitroRequest vreq) { super(vreq); } @@ -62,8 +60,6 @@ public class GetRenderedSolrIndividualsByVClass extends GetSearchIndividualsByVC return rObj; } - //Get - /** * Look through the return object. For each individual, render the short * view and insert the resulting HTML into the object. diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/GetSearchIndividualsByVClasses.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/GetSearchIndividualsByVClasses.java index 57921ab39..c64937a17 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/GetSearchIndividualsByVClasses.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/GetSearchIndividualsByVClasses.java @@ -28,7 +28,7 @@ public class GetSearchIndividualsByVClasses extends JsonObjectProducer { protected JSONObject process() throws Exception { log.debug("Executing retrieval of individuals by vclasses"); VClass vclass=null; - log.debug("Retrieving solr individuals by vclasses"); + log.debug("Retrieving search individuals by vclasses"); // Could have multiple vclass ids sent in String[] vitroClassIdStr = vreq.getParameterValues("vclassId"); if ( vitroClassIdStr != null && vitroClassIdStr.length > 0){ diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/JsonServlet.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/JsonServlet.java index 2d688b63b..c479f5a09 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/JsonServlet.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/json/JsonServlet.java @@ -69,10 +69,10 @@ public class JsonServlet extends VitroHttpServlet { throw new IllegalArgumentException("The call invoked deprecated classes " + "and the parameter for this call appeared nowhere in the code base, " + "so it was removed in Aug 5th 2013."); - }else if( vreq.getParameter("getRenderedSolrIndividualsByVClass") != null ){ - new GetRenderedSolrIndividualsByVClass(vreq).process(resp); - }else if( vreq.getParameter("getRandomSolrIndividualsByVClass") != null ){ - new GetRandomSolrIndividualsByVClass(vreq).process(resp); + }else if( vreq.getParameter("getRenderedSearchIndividualsByVClass") != null ){ + new GetRenderedSearchIndividualsByVClass(vreq).process(resp); + }else if( vreq.getParameter("getRandomSearchIndividualsByVClass") != null ){ + new GetRandomSearchIndividualsByVClass(vreq).process(resp); } else if( vreq.getParameter("getAllVClasses") != null ){ new GetAllVClasses(vreq).process(resp); } @@ -132,7 +132,7 @@ public class JsonServlet extends VitroHttpServlet { return IndividualListResultsUtils.wrapIndividualListResultsInJson(vcResults, vreq, false); } - //Including version for Random Solr query for Vclass Intersections + //Including version for Random search query for Vclass Intersections private static IndividualListResults getRandomSearchVClassResults(String vclassURI, VitroRequest vreq){ log.debug("Retrieving random search intersection results for " + vclassURI); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/DisplayVocabulary.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/DisplayVocabulary.java index 511644afe..e6e72abf1 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/DisplayVocabulary.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/dao/DisplayVocabulary.java @@ -133,7 +133,7 @@ public class DisplayVocabulary { public static final String FIXED_HTML_VALUE = DISPLAY_NS + "htmlValue"; - /* URI of property for Solr Query Generator */ + /* URI of property for Search Query Generator */ public static final String VCLASSID = DISPLAY_NS + "hasVClassId"; diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManagePageGenerator.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManagePageGenerator.java index 42e85f8e7..caed9de4d 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManagePageGenerator.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/ManagePageGenerator.java @@ -526,7 +526,7 @@ private String getExistingIsSelfContainedTemplateQuery() { MenuManagementDataUtils.includeRequiredSystemData(vreq.getSession().getServletContext(), data); data.put("classGroup", new ArrayList()); data.put("classGroups", DataGetterUtils.getClassGroups(vreq)); - //for solr individuals data get getter + //for search individuals data get getter data.put("classes", this.getAllVClasses(vreq)); data.put("availablePermissions", this.getAvailablePermissions(vreq)); data.put("availablePermissionOrderedList", this.getAvailablePermissonsOrderedURIs()); @@ -671,9 +671,9 @@ private String getExistingIsSelfContainedTemplateQuery() { return query; } - //Get all vclasses for the list of vclasses for solr + //Get all vclasses for the list of vclasses for search //Originally considered using an ajax request to get the vclasses list which is fine for adding a new content type - //but for an existing solr content type, would need to make yet another ajax request which seems too much + //but for an existing search content type, would need to make yet another ajax request which seems too much private List> getAllVClasses(VitroRequest vreq) { List vclasses = new ArrayList(); VClassGroupsForRequest vcgc = VClassGroupCache.getVClassGroups(vreq); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/beans/IndexerIface.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/beans/IndexerIface.java index 55781137d..00bd2a8f4 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/beans/IndexerIface.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/beans/IndexerIface.java @@ -10,8 +10,8 @@ import edu.cornell.mannlib.vitro.webapp.search.IndexingException; * IndexBuilder will manage getting lists of object to index and then use * an object that implements IndexerIface to stuff the backend index. * - * An example is SolrIndexer which is set up and associated with a - * IndexBuilder in SolrSetup. + * An example is SearchIndexer which is set up and associated with a + * IndexBuilder in SearchIndexerSetup. * * @author bdc34 * diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/IndexController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/IndexController.java index 18d827e4b..151f1b670 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/IndexController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/controller/IndexController.java @@ -38,8 +38,8 @@ import edu.cornell.mannlib.vitro.webapp.utils.threads.VitroBackgroundThread.Work * That IndexBuilder will be associated with a object that implements the * IndexerIface. * - * An example of the IndexerIface is SolrIndexer. An example of the IndexBuilder - * and SolrIndexer setup is in SolrSetup. + * An example of the IndexerIface is SearchIndexer. An example of the IndexBuilder + * and SearchIndexer setup is in SearchIndexerSetup. * * @author bdc34 */ @@ -161,7 +161,7 @@ public class IndexController extends FreemarkerHttpServlet { ApplicationUtils.instance().getSearchEngine().ping(); return Boolean.TRUE; } catch (Exception e) { - log.error("Can't connect to the Solr server.", e); + log.error("Can't connect to the search engine.", e); return Boolean.FALSE; } } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/NameBoost.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/NameBoost.java index 5647a1cca..5a0da964b 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/NameBoost.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/NameBoost.java @@ -2,21 +2,23 @@ package edu.cornell.mannlib.vitro.webapp.search.documentBuilding; +import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.NAME_LOWERCASE; +import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.NAME_RAW; +import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.NAME_STEMMED; +import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.NAME_UNSTEMMED; import edu.cornell.mannlib.vitro.webapp.beans.Individual; import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputDocument; import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputField; -import edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames; public class NameBoost implements DocumentModifier { /** - * These are the fields in the solr Document that + * These are the fields in the search Document that * are related to the name. If you modify the schema, * please consider if you need to change this list * of name fields to boost. */ - static final VitroSearchTermNames term = new VitroSearchTermNames(); - String[] fieldsToBoost = {term.NAME_RAW,term.NAME_LOWERCASE,term.NAME_UNSTEMMED,term.NAME_STEMMED}; + String[] fieldsToBoost = {NAME_RAW,NAME_LOWERCASE,NAME_UNSTEMMED,NAME_STEMMED}; final float boost; diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/indexing/IndexBuilder.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/indexing/IndexBuilder.java index 69e2ba3ee..f923cd42e 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/indexing/IndexBuilder.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/indexing/IndexBuilder.java @@ -33,7 +33,7 @@ import edu.cornell.mannlib.vitro.webapp.utils.threads.VitroBackgroundThread; * The IndexBuilder is used to rebuild or update a search index. * There should only be one IndexBuilder in a vitro web application. * It uses an implementation of a back-end through an object that - * implements IndexerIface. An example of a back-end is SolrIndexer. + * implements IndexerIface. An example of a back-end is SearchIndexer. * * See the class SearchReindexingListener for an example of how a model change * listener can use an IndexBuilder to keep the full text index in sncy with diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/indexing/IndexWorkerThread.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/indexing/IndexWorkerThread.java index 3e27a57cf..8ca506c98 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/indexing/IndexWorkerThread.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/indexing/IndexWorkerThread.java @@ -11,14 +11,12 @@ import org.apache.commons.logging.LogFactory; import edu.cornell.mannlib.vitro.webapp.beans.Individual; import edu.cornell.mannlib.vitro.webapp.search.IndexingException; import edu.cornell.mannlib.vitro.webapp.search.beans.IndexerIface; -import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.IndividualToSearchDocument; import edu.cornell.mannlib.vitro.webapp.utils.threads.VitroBackgroundThread; class IndexWorkerThread extends VitroBackgroundThread{ private static final Log log = LogFactory.getLog(IndexWorkerThread.class); protected final int threadNum; - protected IndividualToSearchDocument individualToSolrDoc; protected final IndexerIface indexer; protected final Iterator individualsToIndex; protected boolean stopRequested = false; @@ -38,6 +36,7 @@ class IndexWorkerThread extends VitroBackgroundThread{ stopRequested = true; } + @Override public void run(){ setWorkLevel(WorkLevel.WORKING, "indexing " + individualsToIndex + " individuals"); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/dataGetter/ClassGroupPageData.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/dataGetter/ClassGroupPageData.java index 8952c38d6..5560d259d 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/dataGetter/ClassGroupPageData.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/dataGetter/ClassGroupPageData.java @@ -160,7 +160,7 @@ public class ClassGroupPageData extends DataGetterBase implements DataGetter{ //Get data servuice public String getDataServiceUrl() { - return UrlBuilder.getUrl("/dataservice?getRenderedSolrIndividualsByVClass=1&vclassId="); + return UrlBuilder.getUrl("/dataservice?getRenderedSearchIndividualsByVClass=1&vclassId="); } /** diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/dataGetter/IndividualsForClassesDataGetter.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/dataGetter/IndividualsForClassesDataGetter.java index 7e4aa1d34..25f0ff7fc 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/dataGetter/IndividualsForClassesDataGetter.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/dataGetter/IndividualsForClassesDataGetter.java @@ -210,7 +210,7 @@ public class IndividualsForClassesDataGetter extends DataGetterBase implements D //update class count based on restrict classes private int retrieveCount(VitroRequest vreq, ServletContext context, VClass v, List restrictClasses) { - //Execute solr query that returns only count of individuals + //Execute search query that returns only count of individuals log.debug("Entity count is " + v.getEntityCount()); List classUris = new ArrayList(); classUris.add(v.getURI()); @@ -351,7 +351,7 @@ public class IndividualsForClassesDataGetter extends DataGetterBase implements D //Get data servuice public String getDataServiceUrl() { - return UrlBuilder.getUrl("/dataservice?getRenderedSolrIndividualsByVClass=1&vclassId="); + return UrlBuilder.getUrl("/dataservice?getRenderedSearchIndividualsByVClass=1&vclassId="); } /** diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/dataGetter/SearchIndividualsDataGetter.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/dataGetter/SearchIndividualsDataGetter.java index 944f79b3a..753f1c56c 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/dataGetter/SearchIndividualsDataGetter.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/utils/dataGetter/SearchIndividualsDataGetter.java @@ -47,7 +47,7 @@ public class SearchIndividualsDataGetter extends DataGetterBase implements DataG final static Log log = LogFactory.getLog(SearchIndividualsDataGetter.class); //default template - private final static String defaultTemplate = "menupage--defaultSolrIndividuals.ftl"; + private final static String defaultTemplate = "menupage--defaultSearchIndividuals.ftl"; /** * Constructor with display model and data getter URI that will be called by reflection. @@ -67,7 +67,7 @@ public class SearchIndividualsDataGetter extends DataGetterBase implements DataG merged.put(key, new String[] {String.valueOf(pageData.get(key))}); } - return doSolrQuery( merged); + return doSearchQuery( merged); } /** @@ -125,12 +125,12 @@ public class SearchIndividualsDataGetter extends DataGetterBase implements DataG //Partially copied from IndividualListController - private Map doSolrQuery( Map merged) { + private Map doSearchQuery( Map merged) { if(vclassUris.size() == 0) { if(merged.containsKey("vclassuri")) { this.vclassUris = Arrays.asList(merged.get("vclassuri")); } else { - log.error("No vclass uri found. Solr query will not work"); + log.error("No vclass uri found. Search query will not work"); } } @@ -160,7 +160,7 @@ public class SearchIndividualsDataGetter extends DataGetterBase implements DataG body.put("subtitle", vclass.getName()); } body.put("title", title); - populateSolrQueryResults(vclass, body); + populateSearchQueryResults(vclass, body); body.put("bodyTemplate", this.defaultTemplate); } else { log.error("No VClass URIs found. No query will be executed"); @@ -168,7 +168,7 @@ public class SearchIndividualsDataGetter extends DataGetterBase implements DataG return body; } - private void populateSolrQueryResults(VClass vclass, Map body) { + private void populateSearchQueryResults(VClass vclass, Map body) { try { String alpha = SearchQueryUtils.getAlphaParameter(vreq); int page = SearchQueryUtils.getPageParameter(vreq); @@ -203,7 +203,7 @@ public class SearchIndividualsDataGetter extends DataGetterBase implements DataG public static final String defaultVarNameForResults = "results"; /** - * Query to get the definition of the Solr individuals data getter for a given URI. + * Query to get the definition of the search individuals data getter for a given URI. */ private static final String dataGetterQuery = "PREFIX display: <" + DisplayVocabulary.DISPLAY_NS +"> \n" + diff --git a/webapp/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ThumbnailImageURLTest.java b/webapp/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ThumbnailImageURLTest.java index edce6b4a5..1c963c99d 100644 --- a/webapp/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ThumbnailImageURLTest.java +++ b/webapp/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/ThumbnailImageURLTest.java @@ -53,11 +53,9 @@ public class ThumbnailImageURLTest extends AbstractTestClass{ /** * Test to see if ThumbnailImageURL gets the date it is suppose to gete * from a set of RDF. - * - * Test method for {@link edu.cornell.mannlib.vitro.webapp.search.documentBuilding.ThumbnailImageURL#modifyDocument(edu.cornell.mannlib.vitro.webapp.beans.Individual, org.apache.solr.common.SolrInputDocument, java.lang.StringBuffer)}. */ @Test - public void testThumbnailFieldCreatedInSolrDoc() { + public void testThumbnailFieldCreatedInSearchDoc() { SearchInputDocument doc = ApplicationUtils.instance().getSearchEngine().createInputDocument(); ThumbnailImageURL testMe = new ThumbnailImageURL( testRDF ); Individual ind = new IndividualImpl(); @@ -70,7 +68,7 @@ public class ThumbnailImageURLTest extends AbstractTestClass{ Assert.fail("Test individual was skipped by classes that build the search document: " + e.getMessage()); } - //make sure that a Solr document field got created for the thumbnail image + //make sure that a search document field got created for the thumbnail image SearchInputField thumbnailField = doc.getField( VitroSearchTermNames.THUMBNAIL_URL ); Assert.assertNotNull(thumbnailField); diff --git a/webapp/web/i18n/all.properties b/webapp/web/i18n/all.properties index 0fce78764..9d3439c58 100644 --- a/webapp/web/i18n/all.properties +++ b/webapp/web/i18n/all.properties @@ -592,7 +592,7 @@ page_text = page text sparql_query_results = Sparql Query Results no_results_returned = No results were returned. -solr_individual_results = Solr Class Individuals +solr_individual_results = Search Class Individuals select_vclass_uri = Select VClass # # manage proxies templates ( /templates/freemarker/body/manageproxies ) diff --git a/webapp/web/js/menupage/pageManagementUtils.js b/webapp/web/js/menupage/pageManagementUtils.js index f0dd32258..456092bbb 100644 --- a/webapp/web/js/menupage/pageManagementUtils.js +++ b/webapp/web/js/menupage/pageManagementUtils.js @@ -104,7 +104,7 @@ var pageManagementUtils = { this.classGroupSection = $("section#browseClassGroup"); this.sparqlQuerySection = $("section#sparqlQuery"); this.fixedHTMLSection = $("section#fixedHtml"); - this.solrIndividualsSection = $("section#solrIndividuals"); + this.searchIndividualsSection = $("section#searchIndividuals"); //From original menu management edit this.defaultTemplateRadio = $('input.default-template'); this.customTemplateRadio = $('input.custom-template'); @@ -133,8 +133,8 @@ var pageManagementUtils = { this.rightSideDiv = $("div#rightSide"); //contentDivs container where content added/existing placed this.savedContentDivs = $("section#contentDivs"); - //for solr individuals data getter - this.solrAllClassesDropdown = $("select#vclassUri"); + //for search individuals data getter + this.searchAllClassesDropdown = $("select#vclassUri"); }, initDisplay: function(){ //right side components @@ -147,7 +147,7 @@ var pageManagementUtils = { this.classGroupSection.hide(); this.sparqlQuerySection.hide(); this.fixedHTMLSection.hide(); - this.solrIndividualsSection.hide(); + this.searchIndividualsSection.hide(); this.classesForClassGroup.addClass('hidden'); //left side components //These depend on whether or not this is an existing item or not @@ -160,14 +160,14 @@ var pageManagementUtils = { this.menuSection.hide(); } } - //populates the dropdown of classes for the solr individuals template + //populates the dropdown of classes for the search individuals template //dropdown now populated in template/from form specific data instead of ajax request - //this.populateClassForSolrDropdown(); + //this.populateClassForSearchDropdown(); }, //this method can be utilized if using an ajax request to get the vclasses /* - //for solr individuals - remember this populates the template class dropdown - populateClassForSolrDropdown:function() { + //for search individuals - remember this populates the template class dropdown + populateClassForSearchDropdown:function() { //Run ajax query var url = "dataservice?getAllVClasses=1"; @@ -176,10 +176,10 @@ var pageManagementUtils = { $.getJSON(url, function(results) { //Moved the function to processClassGroupDataGetterContent //Should probably remove this entire method and copy there - pageManagementUtils.displayAllClassesForSolrDropdown(results); + pageManagementUtils.displayAllClassesForSearchDropdown(results); }); }, - displayAllClassesForSolrDropdown:function(results) { + displayAllClassesForSearchDropdown:function(results) { if ( results.classes.length == 0 ) { } else { @@ -193,7 +193,7 @@ var pageManagementUtils = { //if there are options to add if(appendHtml != "") { - pageManagementUtils.solrAllClassesDropdown.html(appendHtml); + pageManagementUtils.searchAllClassesDropdown.html(appendHtml); } } @@ -285,7 +285,7 @@ var pageManagementUtils = { pageManagementUtils.classGroupSection.hide(); pageManagementUtils.fixedHTMLSection.hide(); pageManagementUtils.sparqlQuerySection.hide(); - pageManagementUtils.solrIndividualsSection.hide(); + pageManagementUtils.searchIndividualsSection.hide(); //Reset main content type drop-down pageManagementUtils.contentTypeSelectOptions.eq(0).attr('selected', 'selected'); if ( pageManagementUtils.leftSideDiv.css("height") != undefined ) { @@ -357,31 +357,31 @@ var pageManagementUtils = { pageManagementUtils.classGroupSection.show(); pageManagementUtils.fixedHTMLSection.hide(); pageManagementUtils.sparqlQuerySection.hide(); - pageManagementUtils.solrIndividualsSection.hide(); + pageManagementUtils.searchIndividualsSection.hide(); pageManagementUtils.headerBar.text(pageManagementUtils.browseClassGroup + " - "); pageManagementUtils.headerBar.show(); $('div#selfContainedDiv').hide(); } - if ( _this.contentTypeSelect.val() == "fixedHtml" || _this.contentTypeSelect.val() == "sparqlQuery" || _this.contentTypeSelect.val() == "solrIndividuals") { + if ( _this.contentTypeSelect.val() == "fixedHtml" || _this.contentTypeSelect.val() == "sparqlQuery" || _this.contentTypeSelect.val() == "searchIndividuals") { pageManagementUtils.classGroupSection.hide(); //if fixed html show that, otherwise show sparql results if ( _this.contentTypeSelect.val() == "fixedHtml" ) { pageManagementUtils.headerBar.text(pageManagementUtils.fixedHtml + " - "); pageManagementUtils.fixedHTMLSection.show(); pageManagementUtils.sparqlQuerySection.hide(); - pageManagementUtils.solrIndividualsSection.hide(); + pageManagementUtils.searchIndividualsSection.hide(); } else if (_this.contentTypeSelect.val() == "sparqlQuery"){ pageManagementUtils.headerBar.text(pageManagementUtils.sparqlResults + " - "); pageManagementUtils.sparqlQuerySection.show(); pageManagementUtils.fixedHTMLSection.hide(); - pageManagementUtils.solrIndividualsSection.hide(); + pageManagementUtils.searchIndividualsSection.hide(); } else { - //solr individuals - pageManagementUtils.headerBar.text(pageManagementUtils.solrIndividuals + " - "); + //search individuals + pageManagementUtils.headerBar.text(pageManagementUtils.searchIndividuals + " - "); pageManagementUtils.sparqlQuerySection.hide(); pageManagementUtils.fixedHTMLSection.hide(); - pageManagementUtils.solrIndividualsSection.show(); + pageManagementUtils.searchIndividualsSection.show(); } pageManagementUtils.headerBar.show(); @@ -392,7 +392,7 @@ var pageManagementUtils = { pageManagementUtils.classGroupSection.hide(); pageManagementUtils.fixedHTMLSection.hide(); pageManagementUtils.sparqlQuerySection.hide(); - pageManagementUtils.solrIndividualsSection.hide(); + pageManagementUtils.searchIndividualsSection.hide(); pageManagementUtils.classesForClassGroup.addClass('hidden'); pageManagementUtils.headerBar.hide(); pageManagementUtils.headerBar.text(""); @@ -430,7 +430,7 @@ var pageManagementUtils = { pageManagementUtils.clearInputs(pageManagementUtils.fixedHTMLSection); pageManagementUtils.clearInputs(pageManagementUtils.sparqlQuerySection); pageManagementUtils.clearInputs(pageManagementUtils.classGroupSection); - pageManagementUtils.clearInputs(pageManagementUtils.solrIndividualsSection); + pageManagementUtils.clearInputs(pageManagementUtils.searchIndividualsSection); }, clearInputs:function($el) { @@ -474,7 +474,7 @@ var pageManagementUtils = { // Get rid of the cancel link; it'll be replaced by a delete link $newContentObj.find('span#cancelContent' + counter).html(''); - if ( contentType == "sparqlQuery" || contentType == "fixedHtml" || contentType == "solrIndividuals") { + if ( contentType == "sparqlQuery" || contentType == "fixedHtml" || contentType == "searchIndividuals") { varOrClass = $newContentObj.find('input[name="saveToVar"]').val(); } else if ( contentType == "browseClassGroup" ) { diff --git a/webapp/web/js/menupage/processDataGetterUtils.js b/webapp/web/js/menupage/processDataGetterUtils.js index e7b9cd0c9..009c00ada 100644 --- a/webapp/web/js/menupage/processDataGetterUtils.js +++ b/webapp/web/js/menupage/processDataGetterUtils.js @@ -10,7 +10,7 @@ var processDataGetterUtils = { "sparqlQuery": processSparqlDataGetterContent, "fixedHtml":processFixedHTMLDataGetterContent, "individualsForClasses":processIndividualsForClassesDataGetterContent, - "solrIndividuals":processSolrDataGetterContent}, + "searchIndividuals":processSearchDataGetterContent}, selectDataGetterType:function(pageContentSection) { var contentType = pageContentSection.attr("contentType"); //The form can provide "browse class group" as content type but need to check diff --git a/webapp/web/js/menupage/processSolrDataGetterContent.js b/webapp/web/js/menupage/processSolrDataGetterContent.js index 0e1026b5e..13de2d641 100644 --- a/webapp/web/js/menupage/processSolrDataGetterContent.js +++ b/webapp/web/js/menupage/processSolrDataGetterContent.js @@ -1,9 +1,9 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ -$.extend(this, i18nStringsSolrIndividuals); +$.extend(this, i18nStringsSearchIndividuals); //Process sparql data getter and provide a json object with the necessary information -var processSolrDataGetterContent = { +var processSearchDataGetterContent = { dataGetterClass:null, //can use this if expect to initialize from elsewhere initProcessor:function(dataGetterClass) { @@ -30,13 +30,13 @@ var processSolrDataGetterContent = { //Now find and set value pageContentSection.find("input[name='saveToVar']").val(saveToVarValue); - //set value of solr query + //set value of query pageContentSection.find("select[name='vclassUri']").val(vclassUriValue); }, //For the label of the content section for editing, need to add additional value retrieveContentLabel:function() { - return i18nStringsSolrIndividuals.solrIndividuals; + return i18nStringsSearchIndividuals.searchIndividuals; }, //For the label of the content section for editing, need to add additional value retrieveAdditionalLabelText:function(existingContentObject) { @@ -49,20 +49,20 @@ var processSolrDataGetterContent = { //Check that vclassuri and saveToVar have been input var variableValue = pageContentSection.find("input[name='saveToVar']").val(); if(variableValue == "") { - validationError += pageContentSectionLabel + ": " + i18nStringsSolrIndividuals.supplyQueryVariable + "
" + validationError += pageContentSectionLabel + ": " + i18nStringsSearchIndividuals.supplyQueryVariable + "
" } - if(processSolrDataGetterContent.stringHasSingleQuote(variableValue)) { - validationError += pageContentSectionLabel + ": " + i18nStringsSolrIndividuals.noApostrophes + "
"; + if(processSearchDataGetterContent.stringHasSingleQuote(variableValue)) { + validationError += pageContentSectionLabel + ": " + i18nStringsSearchIndividuals.noApostrophes + "
"; } - if(processSolrDataGetterContent.stringHasDoubleQuote(variableValue)) { - validationError += pageContentSectionLabel + ": " + i18nStringsSolrIndividuals.noDoubleQuotes + "
"; + if(processSearchDataGetterContent.stringHasDoubleQuote(variableValue)) { + validationError += pageContentSectionLabel + ": " + i18nStringsSearchIndividuals.noDoubleQuotes + "
"; } - //validation for solr individuals + //validation for search individuals var vclassUriValue = pageContentSection.find("select[name='vclassUri']").val(); if(vclassUriValue == "") { - validationError += pageContentSectionLabel + ": " + i18nStringsSolrIndividuals.selectClass + "
"; + validationError += pageContentSectionLabel + ": " + i18nStringsSearchIndividuals.selectClass + "
"; } return validationError; }, diff --git a/webapp/web/templates/freemarker/body/admin/searchIndex.ftl b/webapp/web/templates/freemarker/body/admin/searchIndex.ftl index 6486e17c8..06b609b24 100644 --- a/webapp/web/templates/freemarker/body/admin/searchIndex.ftl +++ b/webapp/web/templates/freemarker/body/admin/searchIndex.ftl @@ -7,16 +7,16 @@

${i18n().search_index_status}

<#if !indexIsConnected> - + <#elseif worklevel == "IDLE"> - +

${i18n().search_indexer_idle}

<#if hasPreviousBuild??>

${i18n().most_recent_update} ${since?string("hh:mm:ss a, MMMM dd, yyyy")}

@@ -30,12 +30,12 @@ <#elseif totalToDo == 0> - +

${i18n().preparing_to_rebuild_index}

${i18n().since_elapsed_time(since?string("hh:mm:ss a, MMMM dd, yyyy"),elapsed)}

<#else> - +

${i18n().current_task(currentTask)}

${i18n().since_elapsed_time_est_total(since?string("hh:mm:ss a, MMMM dd, yyyy"),elapsed,expected)}

${i18n().index_recs_completed(completedCount,totalToDo)}

diff --git a/webapp/web/templates/freemarker/body/menupage/menupage--defaultSolrIndividuals.ftl b/webapp/web/templates/freemarker/body/menupage/menupage--defaultSearchIndividuals.ftl similarity index 100% rename from webapp/web/templates/freemarker/body/menupage/menupage--defaultSolrIndividuals.ftl rename to webapp/web/templates/freemarker/body/menupage/menupage--defaultSearchIndividuals.ftl diff --git a/webapp/web/templates/freemarker/body/menupage/menupage--exampleMultipleContentTypes.ftl b/webapp/web/templates/freemarker/body/menupage/menupage--exampleMultipleContentTypes.ftl index 7eca46eac..bc1af5363 100644 --- a/webapp/web/templates/freemarker/body/menupage/menupage--exampleMultipleContentTypes.ftl +++ b/webapp/web/templates/freemarker/body/menupage/menupage--exampleMultipleContentTypes.ftl @@ -1,5 +1,6 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#--This is an example of including multiple content types in the same template, this combines the default templates for Fixed HTML, Class groups and Solr Individuals in one template--> +<#--This is an example of including multiple content types in the same template, + this combines the default templates for Fixed HTML, Class groups and Search Individuals in one template--> <#include "menupage-checkForData.ftl"> <#--Fixed HTML portion--> <#--Note that variableName is employed by both the fixed html and sparql query templates, this is used to store the @@ -32,7 +33,7 @@ variableName is used below.--> ${noDataNotification} -<#--Solr Individuals section--> +<#--Search Individuals section--> <#import "lib-list.ftl" as l> <#include "individualList-checkForData.ftl"> diff --git a/webapp/web/templates/freemarker/edit/forms/autoCompleteObjectPropForm.ftl b/webapp/web/templates/freemarker/edit/forms/autoCompleteObjectPropForm.ftl index a9a74c0a1..457a02d31 100644 --- a/webapp/web/templates/freemarker/edit/forms/autoCompleteObjectPropForm.ftl +++ b/webapp/web/templates/freemarker/edit/forms/autoCompleteObjectPropForm.ftl @@ -103,7 +103,7 @@ <#assign sparqlQueryUrl = "${urls.base}/ajax/sparqlQuery" > <#--Passing in object types only if there are any types returned, otherwise -the parameter should not be passed at all to the solr search. +the parameter should not be passed at all to the search. Also multiple types parameter set to true only if more than one type returned--> \ No newline at end of file diff --git a/webapp/web/templates/freemarker/edit/forms/pageManagement--solrIndividuals.ftl b/webapp/web/templates/freemarker/edit/forms/pageManagement--searchIndividuals.ftl similarity index 87% rename from webapp/web/templates/freemarker/edit/forms/pageManagement--solrIndividuals.ftl rename to webapp/web/templates/freemarker/edit/forms/pageManagement--searchIndividuals.ftl index 38610fd11..31f427226 100644 --- a/webapp/web/templates/freemarker/edit/forms/pageManagement--solrIndividuals.ftl +++ b/webapp/web/templates/freemarker/edit/forms/pageManagement--searchIndividuals.ftl @@ -3,7 +3,7 @@ <#assign classGroup = pageData.classGroup /> <#assign classGroups = pageData.classGroups /> <#assign classes = pageData.classes /> -
+
@@ -21,8 +21,8 @@
-${scripts.add('')} +${scripts.add('')} diff --git a/webapp/web/templates/freemarker/edit/forms/pageManagement.ftl b/webapp/web/templates/freemarker/edit/forms/pageManagement.ftl index 2d248e65f..71e9c9b01 100644 --- a/webapp/web/templates/freemarker/edit/forms/pageManagement.ftl +++ b/webapp/web/templates/freemarker/edit/forms/pageManagement.ftl @@ -81,7 +81,7 @@ - +  ${i18n().add_types}
@@ -179,7 +179,7 @@ browseClassGroup: '${i18n().browse_class_group}', fixedHtml: '${i18n().fixed_html}', sparqlResults: '${i18n().sparql_query_results}', - solrIndividuals: '${i18n().solr_individual_results}', + searchIndividuals: '${i18n().solr_individual_results}', orString: '${i18n().or}', deleteString: '${i18n().delete}', allCapitalized: '${i18n().all_capitalized}',