diff --git a/productMods/WEB-INF/resources/startup_listeners.txt b/productMods/WEB-INF/resources/startup_listeners.txt index ce0c70b5..4040cc02 100644 --- a/productMods/WEB-INF/resources/startup_listeners.txt +++ b/productMods/WEB-INF/resources/startup_listeners.txt @@ -13,6 +13,8 @@ edu.cornell.mannlib.vitro.webapp.config.ConfigurationPropertiesSmokeTests edu.cornell.mannlib.vitro.webapp.utils.developer.DeveloperSettings$Setup +edu.cornell.mannlib.vitro.webapp.application.ApplicationImpl$Setup + edu.cornell.mannlib.vitro.webapp.config.RevisionInfoSetup edu.cornell.mannlib.vitro.webapp.email.FreemarkerEmailFactory$Setup @@ -65,12 +67,13 @@ edu.ucsf.vitro.opensocial.OpenSocialSmokeTests # For multiple language support edu.cornell.mannlib.vitro.webapp.i18n.selection.LocaleSelectionSetup -# Add VIVO specific DocumentModifers, this must come before SolrSetup -edu.cornell.mannlib.vitro.webapp.search.solr.VivoDocumentModifiers +# Add VIVO specific DocumentModifers, this must come before SearchIndexerSetup +edu.cornell.mannlib.vitro.webapp.search.documentBuilding.VivoDocumentModifiers -# The Solr index uses a "public" permission, so the PropertyRestrictionPolicyHelper +# The search indexer uses a "public" permission, so the PropertyRestrictionPolicyHelper # and the PermissionRegistry must already be set up. -edu.cornell.mannlib.vitro.webapp.search.solr.SolrSetup +edu.cornell.mannlib.vitro.webapp.searchengine.SearchEngineSetup +edu.cornell.mannlib.vitro.webapp.searchindex.SearchIndexerSetup edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerSetup edu.cornell.mannlib.vitro.webapp.freemarker.config.FreemarkerConfiguration$Setup diff --git a/productMods/js/homePageUtils.js b/productMods/js/homePageUtils.js index 7c5410ba..75d064f9 100644 --- a/productMods/js/homePageUtils.js +++ b/productMods/js/homePageUtils.js @@ -23,7 +23,7 @@ $(document).ready(function(){ var individualList = ""; if ( facultyMemberCount > 0 ) { - // determine the row at which to start the solr query + // determine the row at which to start the search query var rowStart = Math.floor((Math.random()*facultyMemberCount)); var diff; var pageSize = 4; // the number of faculty to display on the home page @@ -34,7 +34,7 @@ $(document).ready(function(){ } // in case the random number is equal to or within 3 of the facultyMemberCount - // subtract 1 from the facultyMemberCount because the Solr rows begin at 0, not 1 + // subtract 1 from the facultyMemberCount because the search rows begin at 0, not 1 if ( (rowStart + (pageSize-1)) > (facultyMemberCount-1) ) { diff = (rowStart + (pageSize-1)) - (facultyMemberCount-1); if ( diff == 0 ) { @@ -48,7 +48,7 @@ $(document).ready(function(){ rowStart = 0; } - var dataServiceUrl = urlsBase + "/dataservice?getRandomSolrIndividualsByVClass=1&vclassId="; + var dataServiceUrl = urlsBase + "/dataservice?getRandomSearchIndividualsByVClass=1&vclassId="; var url = dataServiceUrl + encodeURIComponent("http://vivoweb.org/ontology/core#FacultyMember"); url += "&page=" + rowStart + "&pageSize=" + pageSize; diff --git a/productMods/js/menupage/processDataGetterUtils.js b/productMods/js/menupage/processDataGetterUtils.js index 87c22e55..b5e37834 100644 --- a/productMods/js/menupage/processDataGetterUtils.js +++ b/productMods/js/menupage/processDataGetterUtils.js @@ -11,7 +11,7 @@ var processDataGetterUtils = { "sparqlQuery": processSparqlDataGetterContent, "fixedHtml":processFixedHTMLDataGetterContent, "internalClass":processInternalClassDataGetterContent, - "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/productMods/templates/freemarker/edit/forms/addConceptThroughObjectPropertyAutoComplete.ftl b/productMods/templates/freemarker/edit/forms/addConceptThroughObjectPropertyAutoComplete.ftl index 9d92cefa..87b92b2b 100644 --- a/productMods/templates/freemarker/edit/forms/addConceptThroughObjectPropertyAutoComplete.ftl +++ b/productMods/templates/freemarker/edit/forms/addConceptThroughObjectPropertyAutoComplete.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/productMods/templates/freemarker/lib/lib-home-page.ftl b/productMods/templates/freemarker/lib/lib-home-page.ftl index 61fddcb0..25e119b4 100644 --- a/productMods/templates/freemarker/lib/lib-home-page.ftl +++ b/productMods/templates/freemarker/lib/lib-home-page.ftl @@ -30,7 +30,7 @@ -<#-- We need the faculty count in order to randomly select 4 faculty using a solr query --> +<#-- We need the faculty count in order to randomly select 4 faculty using a search query --> <#macro facultyMemberCount classGroups> <#assign foundClassGroup = false /> <#list classGroups as group> diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddConceptThroughObjectPropertyGenerator.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddConceptThroughObjectPropertyGenerator.java index 41f4c1e2..bd35f344 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddConceptThroughObjectPropertyGenerator.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/generators/AddConceptThroughObjectPropertyGenerator.java @@ -18,10 +18,8 @@ import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationUtils; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.ConstantFieldOptions; import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.FieldVTwo; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.IndividualsViaObjectPropetyOptions; -import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.IndividualsViaSolrQueryOptions; +import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields.IndividualsViaSearchQueryOptions; /** * This generator is for the case where a new concept is being added for an object property other than research/subject areas where the @@ -121,8 +119,7 @@ public class AddConceptThroughObjectPropertyGenerator extends DefaultObjectPrope types.add(v.getURI()); } String[] typesArray = types.toArray(new String[types.size()]); - field.setOptions( new IndividualsViaSolrQueryOptions( - vreq.getSession().getServletContext(), + field.setOptions( new IndividualsViaSearchQueryOptions( getSubjectUri(), predicateUri, getObjectUri(), diff --git a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/utils/ProcessDataGetterN3Map.java b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/utils/ProcessDataGetterN3Map.java index cda9baf8..b97eb540 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/utils/ProcessDataGetterN3Map.java +++ b/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/configuration/preprocessors/utils/ProcessDataGetterN3Map.java @@ -18,7 +18,7 @@ public class ProcessDataGetterN3Map { map.put("edu.cornell.mannlib.vitro.webapp.utils.dataGetter.ClassGroupPageData", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors.utils.ProcessClassGroupDataGetterN3"); map.put("edu.cornell.mannlib.vitro.webapp.utils.dataGetter.InternalClassesDataGetter", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors.utils.ProcessInternalClassDataGetterN3"); map.put("edu.cornell.mannlib.vitro.webapp.utils.dataGetter.FixedHTMLDataGetter", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors.utils.ProcessFixedHTMLN3"); - map.put("edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SolrIndividualsDataGetter", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors.utils.ProcessSolrIndividualsDataGetterN3"); + map.put("edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SearchIndividualsDataGetter", "edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.preprocessors.utils.ProcessSearchIndividualsDataGetterN3"); return map; } diff --git a/src/edu/cornell/mannlib/vitro/webapp/search/solr/CalculateParameters.java b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/CalculateParameters.java similarity index 95% rename from src/edu/cornell/mannlib/vitro/webapp/search/solr/CalculateParameters.java rename to src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/CalculateParameters.java index 432c3573..4e0542e8 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/search/solr/CalculateParameters.java +++ b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/CalculateParameters.java @@ -1,6 +1,6 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ -package edu.cornell.mannlib.vitro.webapp.search.solr; +package edu.cornell.mannlib.vitro.webapp.search.documentBuilding; import java.util.ArrayList; import java.util.HashSet; @@ -10,7 +10,6 @@ import java.util.Set; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.solr.common.SolrInputDocument; import com.hp.hpl.jena.query.Dataset; import com.hp.hpl.jena.query.Query; @@ -27,8 +26,9 @@ import com.hp.hpl.jena.rdf.model.ResourceFactory; import com.hp.hpl.jena.shared.Lock; import edu.cornell.mannlib.vitro.webapp.beans.Individual; +import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputDocument; import edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames; -import edu.cornell.mannlib.vitro.webapp.search.solr.documentBuilding.DocumentModifier; +import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.DocumentModifier; public class CalculateParameters implements DocumentModifier { @@ -241,17 +241,18 @@ public class CalculateParameters implements DocumentModifier { } @Override - public void modifyDocument(Individual individual, SolrInputDocument doc, StringBuffer addUri) { + public void modifyDocument(Individual individual, SearchInputDocument doc, StringBuffer addUri) { // TODO Auto-generated method stub // calculate beta value. log.debug("Parameter calculation starts.."); float beta = calculateBeta(individual.getURI()); - doc.addField(VitroSearchTermNames.BETA, beta); + doc.addField(VitroSearchTermNames.BETA, (Object) beta); doc.setDocumentBoost(beta + doc.getDocumentBoost() ); log.debug("Parameter calculation is done"); } + @Override public void shutdown(){ shutdown=true; } @@ -267,6 +268,7 @@ class TotalInd implements Runnable{ this.totalCountQuery = totalCountQuery; } + @Override public void run(){ int totalInd=0; Query query; diff --git a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VIVOValuesFromVcards.java b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VIVOValuesFromVcards.java similarity index 89% rename from src/edu/cornell/mannlib/vitro/webapp/search/solr/VIVOValuesFromVcards.java rename to src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VIVOValuesFromVcards.java index b4141ca6..27fa9411 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VIVOValuesFromVcards.java +++ b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VIVOValuesFromVcards.java @@ -1,6 +1,6 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ -package edu.cornell.mannlib.vitro.webapp.search.solr; +package edu.cornell.mannlib.vitro.webapp.search.documentBuilding; import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.ALLTEXT; import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.ALLTEXTUNSTEMMED; @@ -9,17 +9,17 @@ import static edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames.PREFE import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.solr.common.SolrInputDocument; import com.hp.hpl.jena.query.QuerySolution; import com.hp.hpl.jena.query.ResultSet; import com.hp.hpl.jena.rdf.model.RDFNode; import edu.cornell.mannlib.vitro.webapp.beans.Individual; +import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputDocument; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory; import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceUtils; -import edu.cornell.mannlib.vitro.webapp.search.solr.documentBuilding.DocumentModifier; +import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.DocumentModifier; /** * If there are any VCards on this Individual with Title objects, store the text @@ -44,7 +44,7 @@ public class VIVOValuesFromVcards implements DocumentModifier { private static final ResultParser PREFERRED_TITLE_PARSER = new ResultParser() { @Override - public void parse(String uri, QuerySolution solution, SolrInputDocument doc) { + public void parse(String uri, QuerySolution solution, SearchInputDocument doc) { String title = getLiteralValue(solution, "title"); if (StringUtils.isNotBlank(title)) { doc.addField(PREFERRED_TITLE, title); @@ -68,7 +68,7 @@ public class VIVOValuesFromVcards implements DocumentModifier { private static final ResultParser EMAIL_PARSER = new ResultParser() { @Override public void parse(String uri, QuerySolution solution, - SolrInputDocument doc) { + SearchInputDocument doc) { String email = getLiteralValue(solution, "email"); if (StringUtils.isNotBlank(email)) { doc.addField(ALLTEXT, email); @@ -85,7 +85,7 @@ public class VIVOValuesFromVcards implements DocumentModifier { } @Override - public void modifyDocument(Individual individual, SolrInputDocument doc, + public void modifyDocument(Individual individual, SearchInputDocument doc, StringBuffer addUri) { if (individual == null) return; @@ -96,7 +96,7 @@ public class VIVOValuesFromVcards implements DocumentModifier { } private void processQuery(Individual individual, String queryTemplate, - ResultParser resultParser, SolrInputDocument doc) { + ResultParser resultParser, SearchInputDocument doc) { String uri = "<" + individual.getURI() + "> "; String query = queryTemplate.replaceAll("\\?uri", uri); @@ -124,7 +124,7 @@ public class VIVOValuesFromVcards implements DocumentModifier { } private abstract static class ResultParser { - public abstract void parse(String uri, QuerySolution solution, SolrInputDocument doc); + public abstract void parse(String uri, QuerySolution solution, SearchInputDocument doc); String getLiteralValue(QuerySolution solution, String name) { RDFNode node = solution.get(name); diff --git a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoAgentContextNodeFields.java b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoAgentContextNodeFields.java similarity index 96% rename from src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoAgentContextNodeFields.java rename to src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoAgentContextNodeFields.java index 3dbe47e4..440d2599 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoAgentContextNodeFields.java +++ b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoAgentContextNodeFields.java @@ -1,16 +1,14 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ -package edu.cornell.mannlib.vitro.webapp.search.solr; +package edu.cornell.mannlib.vitro.webapp.search.documentBuilding; import java.util.ArrayList; import java.util.List; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory; -import edu.cornell.mannlib.vitro.webapp.search.solr.documentBuilding.ContextNodeFields; - -import edu.cornell.mannlib.vitro.webapp.search.solr.documentBuilding.ContextNodeFields; +import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.ContextNodeFields; /** - * Class that adds text from context nodes to Solr Documents for + * Class that adds text from context nodes to Search Documents for * foaf:Agent individuals. */ public class VivoAgentContextNodeFields extends ContextNodeFields{ diff --git a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoDocumentModifiers.java b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoDocumentModifiers.java similarity index 72% rename from src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoDocumentModifiers.java rename to src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoDocumentModifiers.java index b27bfbad..ea717983 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoDocumentModifiers.java +++ b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoDocumentModifiers.java @@ -1,5 +1,5 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ -package edu.cornell.mannlib.vitro.webapp.search.solr; +package edu.cornell.mannlib.vitro.webapp.search.documentBuilding; import java.util.ArrayList; import java.util.List; @@ -13,9 +13,17 @@ import com.hp.hpl.jena.query.DatasetFactory; import edu.cornell.mannlib.vitro.webapp.dao.ModelAccess; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory; import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceUtils; -import edu.cornell.mannlib.vitro.webapp.search.solr.documentBuilding.DocumentModifier; -import edu.cornell.mannlib.vitro.webapp.search.solr.documentBuilding.ExcludeBasedOnNamespace; -import edu.cornell.mannlib.vitro.webapp.search.solr.documentBuilding.SearchIndexExcluder; +import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.CalculateParameters; +import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.DocumentModifier; +import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.ExcludeBasedOnNamespace; +import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.SearchIndexExcluder; +import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.VIVOValuesFromVcards; +import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.VivoISFAdvisingFields; +import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.VivoISFBasicFields; +import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.VivoISFEducationFields; +import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.VivoISFGrantFields; +import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.VivoISFMemberFields; +import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.VivoInformationResourceContextNodeFields; public class VivoDocumentModifiers implements javax.servlet.ServletContextListener{ @@ -36,9 +44,9 @@ public class VivoDocumentModifiers implements javax.servlet.ServletContextListen Dataset dataset = DatasetFactory.create(ModelAccess.on(context).getJenaOntModel()); - /* Put DocumentModifiers into servlet context for use later in startup by SolrSetup + /* Put DocumentModifiers into servlet context for use later in startup by SearchSetup * This adds the code for VIVO specific additions to the building - * of solr Documents. */ + * of search input Documents. */ List modifiers = (List)context.getAttribute("DocumentModifiers"); if( modifiers == null ){ modifiers = new ArrayList(); diff --git a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoISFAdvisingFields.java b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFAdvisingFields.java similarity index 92% rename from src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoISFAdvisingFields.java rename to src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFAdvisingFields.java index 26db9076..ac08fa1a 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoISFAdvisingFields.java +++ b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFAdvisingFields.java @@ -1,12 +1,12 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ -package edu.cornell.mannlib.vitro.webapp.search.solr; +package edu.cornell.mannlib.vitro.webapp.search.documentBuilding; import java.util.ArrayList; import java.util.List; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory; -import edu.cornell.mannlib.vitro.webapp.search.solr.documentBuilding.ContextNodeFields; +import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.ContextNodeFields; /** * DocumentModifier for adding rdfs:labels of individuals related via diff --git a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoISFBasicFields.java b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFBasicFields.java similarity index 89% rename from src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoISFBasicFields.java rename to src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFBasicFields.java index b617a1d9..3675f67f 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoISFBasicFields.java +++ b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFBasicFields.java @@ -1,17 +1,17 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ -package edu.cornell.mannlib.vitro.webapp.search.solr; +package edu.cornell.mannlib.vitro.webapp.search.documentBuilding; import java.util.ArrayList; import java.util.List; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory; -import edu.cornell.mannlib.vitro.webapp.search.solr.documentBuilding.ContextNodeFields; +import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.ContextNodeFields; /** - * DocumentModifier to populate Solr fields for the basic ISF relationships. + * DocumentModifier to populate Search index fields for the basic ISF relationships. * - * This will add the all rdfs:labels of the related individuals to the solr document. + * This will add the all rdfs:labels of the related individuals to the search document. * * @author bdc34 */ diff --git a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoISFEducationFields.java b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFEducationFields.java similarity index 93% rename from src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoISFEducationFields.java rename to src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFEducationFields.java index 69d4c00c..6a9aa443 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoISFEducationFields.java +++ b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFEducationFields.java @@ -1,12 +1,12 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ -package edu.cornell.mannlib.vitro.webapp.search.solr; +package edu.cornell.mannlib.vitro.webapp.search.documentBuilding; import java.util.ArrayList; import java.util.List; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory; -import edu.cornell.mannlib.vitro.webapp.search.solr.documentBuilding.ContextNodeFields; +import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.ContextNodeFields; public class VivoISFEducationFields extends ContextNodeFields { private static String VIVONS = "http://vivoweb.org/ontology/core#"; diff --git a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoISFGrantFields.java b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFGrantFields.java similarity index 81% rename from src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoISFGrantFields.java rename to src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFGrantFields.java index 7512c74e..1ffb164f 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoISFGrantFields.java +++ b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFGrantFields.java @@ -1,24 +1,24 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ -package edu.cornell.mannlib.vitro.webapp.search.solr; +package edu.cornell.mannlib.vitro.webapp.search.documentBuilding; import java.util.ArrayList; import java.util.List; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory; -import edu.cornell.mannlib.vitro.webapp.search.solr.documentBuilding.ContextNodeFields; +import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.ContextNodeFields; /* * This DocumentModifier is for the ISF style grants. * It will - * add people's names to the grant's Solr Document - * add the grant's name to the people's Solr Document - * add the grant's name to the Organization's Solr Document - * add the organization's name to the grant's Solr Document - * add the grant's names to the project's Solr Document - * add the people's names to the project's Solr Document - * add the project's name to the grant's Solr Document - * add the project's name to the people's Solr Document + * add people's names to the grant's search Document + * add the grant's name to the people's search Document + * add the grant's name to the Organization's search Document + * add the organization's name to the grant's search Document + * add the grant's names to the project's search Document + * add the people's names to the project's search Document + * add the project's name to the grant's search Document + * add the project's name to the people's search Document */ public class VivoISFGrantFields extends ContextNodeFields { private static String VIVONS = "http://vivoweb.org/ontology/core#"; @@ -35,7 +35,7 @@ public class VivoISFGrantFields extends ContextNodeFields { } /** - * Query to add people's names to the grant's Solr Document. + * Query to add people's names to the grant's search Document. * ?uri is the URI of a grant. */ private static String peopleForGrant = @@ -48,7 +48,7 @@ public class VivoISFGrantFields extends ContextNodeFields { "}"; /** - * Query to add the grant's name to the people's Solr Document. + * Query to add the grant's name to the people's search Document. * ?uri is the URI of a person. */ private static String grantsForPerson = @@ -63,7 +63,7 @@ public class VivoISFGrantFields extends ContextNodeFields { "}"; /** - * Query to add the grant's name to the Organization's Solr Document. + * Query to add the grant's name to the Organization's search Document. * ?uri is the URI of an Organization. */ private static String grantsForOrganization = @@ -76,7 +76,7 @@ public class VivoISFGrantFields extends ContextNodeFields { "}"; /** - * Query to add the organization's name to the grant's Solr Document. + * Query to add the organization's name to the grant's search Document. * ?uri is the URI of a grant. */ private static String organizationsForGrant = @@ -89,7 +89,7 @@ public class VivoISFGrantFields extends ContextNodeFields { "}"; /** - * Query to add the grant's names to the project's Solr Document. + * Query to add the grant's names to the project's search Document. * ?uir is the URI of a Project. */ private static String grantsForProject = @@ -103,7 +103,7 @@ public class VivoISFGrantFields extends ContextNodeFields { "}"; /** - * Query to add the people's names to the project's Solr Document. + * Query to add the people's names to the project's search Document. * ?uri is the URI of a Project. */ private static String peopleForProject = @@ -117,7 +117,7 @@ public class VivoISFGrantFields extends ContextNodeFields { "}"; /** - * Query to add the project's name to the grant's Solr Document. + * Query to add the project's name to the grant's search Document. * ?uri is the URI of a grant. */ private static String projectsForGrant = @@ -133,7 +133,7 @@ public class VivoISFGrantFields extends ContextNodeFields { "}"; /** - * Query to add the project's name to the people's Solr Document. + * Query to add the project's name to the people's search Document. * ?uri is the URI of a person. */ private static String projectsForPerson = diff --git a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoISFMemberFields.java b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFMemberFields.java similarity index 83% rename from src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoISFMemberFields.java rename to src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFMemberFields.java index a3de1b32..6ea535d1 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoISFMemberFields.java +++ b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoISFMemberFields.java @@ -1,17 +1,17 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ -package edu.cornell.mannlib.vitro.webapp.search.solr; +package edu.cornell.mannlib.vitro.webapp.search.documentBuilding; import java.util.ArrayList; import java.util.List; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory; -import edu.cornell.mannlib.vitro.webapp.search.solr.documentBuilding.ContextNodeFields; +import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.ContextNodeFields; /** * This class will: - * add people's names to organization's Solr Documents. - * add organization names to people's Solr Documents. + * add people's names to organization's search Documents. + * add organization names to people's search Documents. * * @author bdc34 * @@ -31,7 +31,7 @@ public class VivoISFMemberFields extends ContextNodeFields { } /** - * Add people's names to organization's Solr Documents. + * Add people's names to organization's search Documents. */ private static String peopleForOrganization = prefix + @@ -43,7 +43,7 @@ public class VivoISFMemberFields extends ContextNodeFields { "}"; /** - * add organization names to people's Solr Documents. + * add organization names to people's search Documents. */ private static String organizationForPeople = prefix + diff --git a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoInformationResourceContextNodeFields.java b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoInformationResourceContextNodeFields.java similarity index 91% rename from src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoInformationResourceContextNodeFields.java rename to src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoInformationResourceContextNodeFields.java index 2fcf6798..54ef0dad 100644 --- a/src/edu/cornell/mannlib/vitro/webapp/search/solr/VivoInformationResourceContextNodeFields.java +++ b/src/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoInformationResourceContextNodeFields.java @@ -1,16 +1,14 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ -package edu.cornell.mannlib.vitro.webapp.search.solr; +package edu.cornell.mannlib.vitro.webapp.search.documentBuilding; import java.util.ArrayList; import java.util.List; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory; -import edu.cornell.mannlib.vitro.webapp.search.solr.documentBuilding.ContextNodeFields; - -import edu.cornell.mannlib.vitro.webapp.search.solr.documentBuilding.ContextNodeFields; +import edu.cornell.mannlib.vitro.webapp.search.documentBuilding.ContextNodeFields; /** - * Class that adds text from context nodes to Solr Documents for + * Class that adds text from context nodes to search index Documents for * obo:IAO_0000030 individuals. * * @author bdc34 diff --git a/test/edu/cornell/mannlib/vitro/webapp/search/solr/NIHVIVO3853_DataSet1.rdf b/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/NIHVIVO3853_DataSet1.rdf similarity index 100% rename from test/edu/cornell/mannlib/vitro/webapp/search/solr/NIHVIVO3853_DataSet1.rdf rename to test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/NIHVIVO3853_DataSet1.rdf diff --git a/test/edu/cornell/mannlib/vitro/webapp/search/solr/VIVO146_DataSet1.n3 b/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VIVO146_DataSet1.n3 similarity index 100% rename from test/edu/cornell/mannlib/vitro/webapp/search/solr/VIVO146_DataSet1.n3 rename to test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VIVO146_DataSet1.n3 diff --git a/test/edu/cornell/mannlib/vitro/webapp/search/solr/VivoAgentContextNodeFieldsTest.java b/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoAgentContextNodeFieldsTest.java similarity index 95% rename from test/edu/cornell/mannlib/vitro/webapp/search/solr/VivoAgentContextNodeFieldsTest.java rename to test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoAgentContextNodeFieldsTest.java index 372b1e75..e4ab7c20 100644 --- a/test/edu/cornell/mannlib/vitro/webapp/search/solr/VivoAgentContextNodeFieldsTest.java +++ b/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoAgentContextNodeFieldsTest.java @@ -1,11 +1,11 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ -package edu.cornell.mannlib.vitro.webapp.search.solr; +package edu.cornell.mannlib.vitro.webapp.search.documentBuilding; -import static org.junit.Assert.*; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import java.io.InputStream; -import org.apache.solr.common.SolrInputDocument; import org.junit.BeforeClass; import org.junit.Test; diff --git a/test/edu/cornell/mannlib/vitro/webapp/search/solr/VivoAgentContextNodeFieldsTest2.java b/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoAgentContextNodeFieldsTest2.java similarity index 94% rename from test/edu/cornell/mannlib/vitro/webapp/search/solr/VivoAgentContextNodeFieldsTest2.java rename to test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoAgentContextNodeFieldsTest2.java index 53c5222a..1d641e92 100644 --- a/test/edu/cornell/mannlib/vitro/webapp/search/solr/VivoAgentContextNodeFieldsTest2.java +++ b/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoAgentContextNodeFieldsTest2.java @@ -1,12 +1,12 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ -package edu.cornell.mannlib.vitro.webapp.search.solr; +package edu.cornell.mannlib.vitro.webapp.search.documentBuilding; -import static org.junit.Assert.*; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; import java.io.InputStream; import org.apache.commons.lang.StringUtils; -import org.apache.solr.common.SolrInputDocument; import org.junit.BeforeClass; import org.junit.Test; diff --git a/test/edu/cornell/mannlib/vitro/webapp/search/solr/VivoInformationResourceContextNodeFieldsTest.java b/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoInformationResourceContextNodeFieldsTest.java similarity index 81% rename from test/edu/cornell/mannlib/vitro/webapp/search/solr/VivoInformationResourceContextNodeFieldsTest.java rename to test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoInformationResourceContextNodeFieldsTest.java index 6112829b..c95c0c6d 100644 --- a/test/edu/cornell/mannlib/vitro/webapp/search/solr/VivoInformationResourceContextNodeFieldsTest.java +++ b/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoInformationResourceContextNodeFieldsTest.java @@ -1,24 +1,29 @@ /* $This file is distributed under the terms of the license in /doc/license.txt$ */ -package edu.cornell.mannlib.vitro.webapp.search.solr; +package edu.cornell.mannlib.vitro.webapp.search.documentBuilding; import java.io.IOException; import java.io.InputStream; import java.util.Collection; -import org.apache.solr.common.SolrInputDocument; import org.junit.Assert; import org.junit.Test; +import stubs.edu.cornell.mannlib.vitro.webapp.modules.ApplicationStub; +import stubs.edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchEngineStub; +import stubs.javax.servlet.ServletContextStub; + import com.hp.hpl.jena.ontology.OntModel; import com.hp.hpl.jena.ontology.OntModelSpec; import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.ModelFactory; import edu.cornell.mannlib.vitro.testing.AbstractTestClass; +import edu.cornell.mannlib.vitro.webapp.application.ApplicationUtils; import edu.cornell.mannlib.vitro.webapp.beans.Individual; import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; import edu.cornell.mannlib.vitro.webapp.dao.jena.WebappDaoFactoryJena; +import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputDocument; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFService; import edu.cornell.mannlib.vitro.webapp.rdfservice.RDFServiceFactory; import edu.cornell.mannlib.vitro.webapp.rdfservice.impl.RDFServiceFactorySingle; @@ -32,6 +37,7 @@ public class VivoInformationResourceContextNodeFieldsTest extends AbstractTestCl @Test public void testNoLabel() throws IOException{ + ApplicationStub.setup(new ServletContextStub(), new SearchEngineStub()); //Test that rdfs:label is NOT added by the VivoInformationResourceContextNodeFields @@ -51,13 +57,13 @@ public class VivoInformationResourceContextNodeFieldsTest extends AbstractTestCl RDFService rdfService = new RDFServiceModel(ontModel); RDFServiceFactory rdfServiceFactory = new RDFServiceFactorySingle(rdfService); - SolrInputDocument doc = new SolrInputDocument(); + SearchInputDocument doc = ApplicationUtils.instance().getSearchEngine().createInputDocument(); doc.addField("ALLTEXT", ""); VivoInformationResourceContextNodeFields vircnf = new VivoInformationResourceContextNodeFields(rdfServiceFactory); vircnf.modifyDocument(ind, doc, new StringBuffer()); - Collection values = doc.getFieldValues("ALLTEXT"); + Collection values = doc.getField("ALLTEXT").getValues(); for( Object value : values){ Assert.assertFalse("rdf:label erroneously added by document modifier:", value.toString().contains(RDFS_LABEL_VALUE)); } diff --git a/test/edu/cornell/mannlib/vitro/webapp/search/solr/VivoInformationResourceContextNodeFieldsTest.n3 b/test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoInformationResourceContextNodeFieldsTest.n3 similarity index 100% rename from test/edu/cornell/mannlib/vitro/webapp/search/solr/VivoInformationResourceContextNodeFieldsTest.n3 rename to test/edu/cornell/mannlib/vitro/webapp/search/documentBuilding/VivoInformationResourceContextNodeFieldsTest.n3 diff --git a/themes/wilma/templates/page-home.ftl b/themes/wilma/templates/page-home.ftl index d28a80b5..323e26e2 100644 --- a/themes/wilma/templates/page-home.ftl +++ b/themes/wilma/templates/page-home.ftl @@ -25,7 +25,7 @@ - <#-- supplies the faculty count to the js function that generates a random row number for the solr query --> + <#-- supplies the faculty count to the js function that generates a random row number for the search query --> <@lh.facultyMemberCount vClassGroups! /> <#include "identity.ftl">