VIVO-742 Many changes to remove "solr" from the code base.
Comments, template names, Java classes, variables and method names (Java and JavaScript), etc.
This commit is contained in:
parent
cceca1659b
commit
ad9c08cf28
29 changed files with 97 additions and 103 deletions
|
@ -43,7 +43,7 @@ display:RequiredAction a owl:Class ;
|
||||||
|
|
||||||
<java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SearchIndividualsDataGetter>
|
<java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SearchIndividualsDataGetter>
|
||||||
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" .
|
||||||
|
|
||||||
<java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlUpdate>
|
<java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlUpdate>
|
||||||
a owl:Class ;
|
a owl:Class ;
|
||||||
|
@ -141,7 +141,7 @@ owl:topObjectProperty
|
||||||
|
|
||||||
display:hasVClassId
|
display:hasVClassId
|
||||||
a owl:ObjectProperty ;
|
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
|
###Vitro properties without which individual templates throw errors as are required
|
||||||
|
|
||||||
|
|
|
@ -454,7 +454,7 @@ public class JSONReconcileServlet extends VitroHttpServlet {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String escapeWhitespaceInQueryString(String queryStr) {
|
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+", "\\\\ ");
|
return queryStr.replaceAll("\\s+", "\\\\ ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.controller.json;
|
package edu.cornell.mannlib.vitro.webapp.controller.json;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -14,7 +13,6 @@ import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
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.controller.VitroRequest;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.services.shortview.ShortViewService;
|
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
|
* Does a Solr search for individuals, and uses the short view to render each of
|
||||||
* the results.
|
* the results.
|
||||||
*/
|
*/
|
||||||
public class GetRandomSolrIndividualsByVClass extends GetSearchIndividualsByVClass {
|
public class GetRandomSearchIndividualsByVClass extends GetSearchIndividualsByVClass {
|
||||||
private static final Log log = LogFactory
|
private static final Log log = LogFactory
|
||||||
.getLog(GetRandomSolrIndividualsByVClass.class);
|
.getLog(GetRandomSearchIndividualsByVClass.class);
|
||||||
|
|
||||||
protected GetRandomSolrIndividualsByVClass(VitroRequest vreq) {
|
protected GetRandomSearchIndividualsByVClass(VitroRequest vreq) {
|
||||||
super(vreq);
|
super(vreq);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.controller.json;
|
package edu.cornell.mannlib.vitro.webapp.controller.json;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -14,7 +13,6 @@ import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
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.controller.VitroRequest;
|
||||||
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
||||||
import edu.cornell.mannlib.vitro.webapp.services.shortview.ShortViewService;
|
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;
|
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.
|
* the results.
|
||||||
*/
|
*/
|
||||||
public class GetRenderedSolrIndividualsByVClass extends GetSearchIndividualsByVClasses {
|
public class GetRenderedSearchIndividualsByVClass extends GetSearchIndividualsByVClasses {
|
||||||
private static final Log log = LogFactory
|
private static final Log log = LogFactory
|
||||||
.getLog(GetRenderedSolrIndividualsByVClass.class);
|
.getLog(GetRenderedSearchIndividualsByVClass.class);
|
||||||
|
|
||||||
protected GetRenderedSolrIndividualsByVClass(VitroRequest vreq) {
|
protected GetRenderedSearchIndividualsByVClass(VitroRequest vreq) {
|
||||||
super(vreq);
|
super(vreq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,8 +60,6 @@ public class GetRenderedSolrIndividualsByVClass extends GetSearchIndividualsByVC
|
||||||
return rObj;
|
return rObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Get
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Look through the return object. For each individual, render the short
|
* Look through the return object. For each individual, render the short
|
||||||
* view and insert the resulting HTML into the object.
|
* view and insert the resulting HTML into the object.
|
|
@ -28,7 +28,7 @@ public class GetSearchIndividualsByVClasses extends JsonObjectProducer {
|
||||||
protected JSONObject process() throws Exception {
|
protected JSONObject process() throws Exception {
|
||||||
log.debug("Executing retrieval of individuals by vclasses");
|
log.debug("Executing retrieval of individuals by vclasses");
|
||||||
VClass vclass=null;
|
VClass vclass=null;
|
||||||
log.debug("Retrieving solr individuals by vclasses");
|
log.debug("Retrieving search individuals by vclasses");
|
||||||
// Could have multiple vclass ids sent in
|
// Could have multiple vclass ids sent in
|
||||||
String[] vitroClassIdStr = vreq.getParameterValues("vclassId");
|
String[] vitroClassIdStr = vreq.getParameterValues("vclassId");
|
||||||
if ( vitroClassIdStr != null && vitroClassIdStr.length > 0){
|
if ( vitroClassIdStr != null && vitroClassIdStr.length > 0){
|
||||||
|
|
|
@ -69,10 +69,10 @@ public class JsonServlet extends VitroHttpServlet {
|
||||||
throw new IllegalArgumentException("The call invoked deprecated classes " +
|
throw new IllegalArgumentException("The call invoked deprecated classes " +
|
||||||
"and the parameter for this call appeared nowhere in the code base, " +
|
"and the parameter for this call appeared nowhere in the code base, " +
|
||||||
"so it was removed in Aug 5th 2013.");
|
"so it was removed in Aug 5th 2013.");
|
||||||
}else if( vreq.getParameter("getRenderedSolrIndividualsByVClass") != null ){
|
}else if( vreq.getParameter("getRenderedSearchIndividualsByVClass") != null ){
|
||||||
new GetRenderedSolrIndividualsByVClass(vreq).process(resp);
|
new GetRenderedSearchIndividualsByVClass(vreq).process(resp);
|
||||||
}else if( vreq.getParameter("getRandomSolrIndividualsByVClass") != null ){
|
}else if( vreq.getParameter("getRandomSearchIndividualsByVClass") != null ){
|
||||||
new GetRandomSolrIndividualsByVClass(vreq).process(resp);
|
new GetRandomSearchIndividualsByVClass(vreq).process(resp);
|
||||||
} else if( vreq.getParameter("getAllVClasses") != null ){
|
} else if( vreq.getParameter("getAllVClasses") != null ){
|
||||||
new GetAllVClasses(vreq).process(resp);
|
new GetAllVClasses(vreq).process(resp);
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ public class JsonServlet extends VitroHttpServlet {
|
||||||
return IndividualListResultsUtils.wrapIndividualListResultsInJson(vcResults, vreq, false);
|
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){
|
private static IndividualListResults getRandomSearchVClassResults(String vclassURI, VitroRequest vreq){
|
||||||
log.debug("Retrieving random search intersection results for " + vclassURI);
|
log.debug("Retrieving random search intersection results for " + vclassURI);
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,7 @@ public class DisplayVocabulary {
|
||||||
public static final String FIXED_HTML_VALUE = DISPLAY_NS + "htmlValue";
|
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";
|
public static final String VCLASSID = DISPLAY_NS + "hasVClassId";
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -526,7 +526,7 @@ private String getExistingIsSelfContainedTemplateQuery() {
|
||||||
MenuManagementDataUtils.includeRequiredSystemData(vreq.getSession().getServletContext(), data);
|
MenuManagementDataUtils.includeRequiredSystemData(vreq.getSession().getServletContext(), data);
|
||||||
data.put("classGroup", new ArrayList<String>());
|
data.put("classGroup", new ArrayList<String>());
|
||||||
data.put("classGroups", DataGetterUtils.getClassGroups(vreq));
|
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("classes", this.getAllVClasses(vreq));
|
||||||
data.put("availablePermissions", this.getAvailablePermissions(vreq));
|
data.put("availablePermissions", this.getAvailablePermissions(vreq));
|
||||||
data.put("availablePermissionOrderedList", this.getAvailablePermissonsOrderedURIs());
|
data.put("availablePermissionOrderedList", this.getAvailablePermissonsOrderedURIs());
|
||||||
|
@ -671,9 +671,9 @@ private String getExistingIsSelfContainedTemplateQuery() {
|
||||||
return query;
|
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
|
//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<HashMap<String, String>> getAllVClasses(VitroRequest vreq) {
|
private List<HashMap<String, String>> getAllVClasses(VitroRequest vreq) {
|
||||||
List<VClass> vclasses = new ArrayList<VClass>();
|
List<VClass> vclasses = new ArrayList<VClass>();
|
||||||
VClassGroupsForRequest vcgc = VClassGroupCache.getVClassGroups(vreq);
|
VClassGroupsForRequest vcgc = VClassGroupCache.getVClassGroups(vreq);
|
||||||
|
|
|
@ -10,8 +10,8 @@ import edu.cornell.mannlib.vitro.webapp.search.IndexingException;
|
||||||
* IndexBuilder will manage getting lists of object to index and then use
|
* IndexBuilder will manage getting lists of object to index and then use
|
||||||
* an object that implements IndexerIface to stuff the backend index.
|
* an object that implements IndexerIface to stuff the backend index.
|
||||||
*
|
*
|
||||||
* An example is SolrIndexer which is set up and associated with a
|
* An example is SearchIndexer which is set up and associated with a
|
||||||
* IndexBuilder in SolrSetup.
|
* IndexBuilder in SearchIndexerSetup.
|
||||||
*
|
*
|
||||||
* @author bdc34
|
* @author bdc34
|
||||||
*
|
*
|
||||||
|
|
|
@ -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
|
* That IndexBuilder will be associated with a object that implements the
|
||||||
* IndexerIface.
|
* IndexerIface.
|
||||||
*
|
*
|
||||||
* An example of the IndexerIface is SolrIndexer. An example of the IndexBuilder
|
* An example of the IndexerIface is SearchIndexer. An example of the IndexBuilder
|
||||||
* and SolrIndexer setup is in SolrSetup.
|
* and SearchIndexer setup is in SearchIndexerSetup.
|
||||||
*
|
*
|
||||||
* @author bdc34
|
* @author bdc34
|
||||||
*/
|
*/
|
||||||
|
@ -161,7 +161,7 @@ public class IndexController extends FreemarkerHttpServlet {
|
||||||
ApplicationUtils.instance().getSearchEngine().ping();
|
ApplicationUtils.instance().getSearchEngine().ping();
|
||||||
return Boolean.TRUE;
|
return Boolean.TRUE;
|
||||||
} catch (Exception e) {
|
} 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;
|
return Boolean.FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,21 +2,23 @@
|
||||||
|
|
||||||
package edu.cornell.mannlib.vitro.webapp.search.documentBuilding;
|
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.beans.Individual;
|
||||||
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputDocument;
|
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputDocument;
|
||||||
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputField;
|
import edu.cornell.mannlib.vitro.webapp.modules.searchEngine.SearchInputField;
|
||||||
import edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames;
|
|
||||||
|
|
||||||
public class NameBoost implements DocumentModifier {
|
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,
|
* are related to the name. If you modify the schema,
|
||||||
* please consider if you need to change this list
|
* please consider if you need to change this list
|
||||||
* of name fields to boost.
|
* of name fields to boost.
|
||||||
*/
|
*/
|
||||||
static final VitroSearchTermNames term = new VitroSearchTermNames();
|
String[] fieldsToBoost = {NAME_RAW,NAME_LOWERCASE,NAME_UNSTEMMED,NAME_STEMMED};
|
||||||
String[] fieldsToBoost = {term.NAME_RAW,term.NAME_LOWERCASE,term.NAME_UNSTEMMED,term.NAME_STEMMED};
|
|
||||||
|
|
||||||
|
|
||||||
final float boost;
|
final float boost;
|
||||||
|
|
|
@ -33,7 +33,7 @@ import edu.cornell.mannlib.vitro.webapp.utils.threads.VitroBackgroundThread;
|
||||||
* The IndexBuilder is used to rebuild or update a search index.
|
* The IndexBuilder is used to rebuild or update a search index.
|
||||||
* There should only be one IndexBuilder in a vitro web application.
|
* There should only be one IndexBuilder in a vitro web application.
|
||||||
* It uses an implementation of a back-end through an object that
|
* 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
|
* 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
|
* listener can use an IndexBuilder to keep the full text index in sncy with
|
||||||
|
|
|
@ -11,14 +11,12 @@ import org.apache.commons.logging.LogFactory;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
||||||
import edu.cornell.mannlib.vitro.webapp.search.IndexingException;
|
import edu.cornell.mannlib.vitro.webapp.search.IndexingException;
|
||||||
import edu.cornell.mannlib.vitro.webapp.search.beans.IndexerIface;
|
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;
|
import edu.cornell.mannlib.vitro.webapp.utils.threads.VitroBackgroundThread;
|
||||||
|
|
||||||
class IndexWorkerThread extends VitroBackgroundThread{
|
class IndexWorkerThread extends VitroBackgroundThread{
|
||||||
private static final Log log = LogFactory.getLog(IndexWorkerThread.class);
|
private static final Log log = LogFactory.getLog(IndexWorkerThread.class);
|
||||||
|
|
||||||
protected final int threadNum;
|
protected final int threadNum;
|
||||||
protected IndividualToSearchDocument individualToSolrDoc;
|
|
||||||
protected final IndexerIface indexer;
|
protected final IndexerIface indexer;
|
||||||
protected final Iterator<Individual> individualsToIndex;
|
protected final Iterator<Individual> individualsToIndex;
|
||||||
protected boolean stopRequested = false;
|
protected boolean stopRequested = false;
|
||||||
|
@ -38,6 +36,7 @@ class IndexWorkerThread extends VitroBackgroundThread{
|
||||||
stopRequested = true;
|
stopRequested = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void run(){
|
public void run(){
|
||||||
setWorkLevel(WorkLevel.WORKING, "indexing " + individualsToIndex + " individuals");
|
setWorkLevel(WorkLevel.WORKING, "indexing " + individualsToIndex + " individuals");
|
||||||
|
|
||||||
|
|
|
@ -160,7 +160,7 @@ public class ClassGroupPageData extends DataGetterBase implements DataGetter{
|
||||||
|
|
||||||
//Get data servuice
|
//Get data servuice
|
||||||
public String getDataServiceUrl() {
|
public String getDataServiceUrl() {
|
||||||
return UrlBuilder.getUrl("/dataservice?getRenderedSolrIndividualsByVClass=1&vclassId=");
|
return UrlBuilder.getUrl("/dataservice?getRenderedSearchIndividualsByVClass=1&vclassId=");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -210,7 +210,7 @@ public class IndividualsForClassesDataGetter extends DataGetterBase implements D
|
||||||
|
|
||||||
//update class count based on restrict classes
|
//update class count based on restrict classes
|
||||||
private int retrieveCount(VitroRequest vreq, ServletContext context, VClass v, List<VClass> restrictClasses) {
|
private int retrieveCount(VitroRequest vreq, ServletContext context, VClass v, List<VClass> 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());
|
log.debug("Entity count is " + v.getEntityCount());
|
||||||
List<String> classUris = new ArrayList<String>();
|
List<String> classUris = new ArrayList<String>();
|
||||||
classUris.add(v.getURI());
|
classUris.add(v.getURI());
|
||||||
|
@ -351,7 +351,7 @@ public class IndividualsForClassesDataGetter extends DataGetterBase implements D
|
||||||
|
|
||||||
//Get data servuice
|
//Get data servuice
|
||||||
public String getDataServiceUrl() {
|
public String getDataServiceUrl() {
|
||||||
return UrlBuilder.getUrl("/dataservice?getRenderedSolrIndividualsByVClass=1&vclassId=");
|
return UrlBuilder.getUrl("/dataservice?getRenderedSearchIndividualsByVClass=1&vclassId=");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class SearchIndividualsDataGetter extends DataGetterBase implements DataG
|
||||||
|
|
||||||
final static Log log = LogFactory.getLog(SearchIndividualsDataGetter.class);
|
final static Log log = LogFactory.getLog(SearchIndividualsDataGetter.class);
|
||||||
//default template
|
//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.
|
* 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))});
|
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
|
//Partially copied from IndividualListController
|
||||||
private Map<String, Object> doSolrQuery( Map<String, String[]> merged) {
|
private Map<String, Object> doSearchQuery( Map<String, String[]> merged) {
|
||||||
if(vclassUris.size() == 0) {
|
if(vclassUris.size() == 0) {
|
||||||
if(merged.containsKey("vclassuri")) {
|
if(merged.containsKey("vclassuri")) {
|
||||||
this.vclassUris = Arrays.asList(merged.get("vclassuri"));
|
this.vclassUris = Arrays.asList(merged.get("vclassuri"));
|
||||||
} else {
|
} 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("subtitle", vclass.getName());
|
||||||
}
|
}
|
||||||
body.put("title", title);
|
body.put("title", title);
|
||||||
populateSolrQueryResults(vclass, body);
|
populateSearchQueryResults(vclass, body);
|
||||||
body.put("bodyTemplate", this.defaultTemplate);
|
body.put("bodyTemplate", this.defaultTemplate);
|
||||||
} else {
|
} else {
|
||||||
log.error("No VClass URIs found. No query will be executed");
|
log.error("No VClass URIs found. No query will be executed");
|
||||||
|
@ -168,7 +168,7 @@ public class SearchIndividualsDataGetter extends DataGetterBase implements DataG
|
||||||
return body;
|
return body;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void populateSolrQueryResults(VClass vclass, Map<String, Object> body) {
|
private void populateSearchQueryResults(VClass vclass, Map<String, Object> body) {
|
||||||
try {
|
try {
|
||||||
String alpha = SearchQueryUtils.getAlphaParameter(vreq);
|
String alpha = SearchQueryUtils.getAlphaParameter(vreq);
|
||||||
int page = SearchQueryUtils.getPageParameter(vreq);
|
int page = SearchQueryUtils.getPageParameter(vreq);
|
||||||
|
@ -203,7 +203,7 @@ public class SearchIndividualsDataGetter extends DataGetterBase implements DataG
|
||||||
public static final String defaultVarNameForResults = "results";
|
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 =
|
private static final String dataGetterQuery =
|
||||||
"PREFIX display: <" + DisplayVocabulary.DISPLAY_NS +"> \n" +
|
"PREFIX display: <" + DisplayVocabulary.DISPLAY_NS +"> \n" +
|
||||||
|
|
|
@ -53,11 +53,9 @@ public class ThumbnailImageURLTest extends AbstractTestClass{
|
||||||
/**
|
/**
|
||||||
* Test to see if ThumbnailImageURL gets the date it is suppose to gete
|
* Test to see if ThumbnailImageURL gets the date it is suppose to gete
|
||||||
* from a set of RDF.
|
* 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
|
@Test
|
||||||
public void testThumbnailFieldCreatedInSolrDoc() {
|
public void testThumbnailFieldCreatedInSearchDoc() {
|
||||||
SearchInputDocument doc = ApplicationUtils.instance().getSearchEngine().createInputDocument();
|
SearchInputDocument doc = ApplicationUtils.instance().getSearchEngine().createInputDocument();
|
||||||
ThumbnailImageURL testMe = new ThumbnailImageURL( testRDF );
|
ThumbnailImageURL testMe = new ThumbnailImageURL( testRDF );
|
||||||
Individual ind = new IndividualImpl();
|
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());
|
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 );
|
SearchInputField thumbnailField = doc.getField( VitroSearchTermNames.THUMBNAIL_URL );
|
||||||
Assert.assertNotNull(thumbnailField);
|
Assert.assertNotNull(thumbnailField);
|
||||||
|
|
|
@ -592,7 +592,7 @@ page_text = page text
|
||||||
|
|
||||||
sparql_query_results = Sparql Query Results
|
sparql_query_results = Sparql Query Results
|
||||||
no_results_returned = No results were returned.
|
no_results_returned = No results were returned.
|
||||||
solr_individual_results = Solr Class Individuals
|
solr_individual_results = Search Class Individuals
|
||||||
select_vclass_uri = Select VClass
|
select_vclass_uri = Select VClass
|
||||||
#
|
#
|
||||||
# manage proxies templates ( /templates/freemarker/body/manageproxies )
|
# manage proxies templates ( /templates/freemarker/body/manageproxies )
|
||||||
|
|
|
@ -104,7 +104,7 @@ var pageManagementUtils = {
|
||||||
this.classGroupSection = $("section#browseClassGroup");
|
this.classGroupSection = $("section#browseClassGroup");
|
||||||
this.sparqlQuerySection = $("section#sparqlQuery");
|
this.sparqlQuerySection = $("section#sparqlQuery");
|
||||||
this.fixedHTMLSection = $("section#fixedHtml");
|
this.fixedHTMLSection = $("section#fixedHtml");
|
||||||
this.solrIndividualsSection = $("section#solrIndividuals");
|
this.searchIndividualsSection = $("section#searchIndividuals");
|
||||||
//From original menu management edit
|
//From original menu management edit
|
||||||
this.defaultTemplateRadio = $('input.default-template');
|
this.defaultTemplateRadio = $('input.default-template');
|
||||||
this.customTemplateRadio = $('input.custom-template');
|
this.customTemplateRadio = $('input.custom-template');
|
||||||
|
@ -133,8 +133,8 @@ var pageManagementUtils = {
|
||||||
this.rightSideDiv = $("div#rightSide");
|
this.rightSideDiv = $("div#rightSide");
|
||||||
//contentDivs container where content added/existing placed
|
//contentDivs container where content added/existing placed
|
||||||
this.savedContentDivs = $("section#contentDivs");
|
this.savedContentDivs = $("section#contentDivs");
|
||||||
//for solr individuals data getter
|
//for search individuals data getter
|
||||||
this.solrAllClassesDropdown = $("select#vclassUri");
|
this.searchAllClassesDropdown = $("select#vclassUri");
|
||||||
},
|
},
|
||||||
initDisplay: function(){
|
initDisplay: function(){
|
||||||
//right side components
|
//right side components
|
||||||
|
@ -147,7 +147,7 @@ var pageManagementUtils = {
|
||||||
this.classGroupSection.hide();
|
this.classGroupSection.hide();
|
||||||
this.sparqlQuerySection.hide();
|
this.sparqlQuerySection.hide();
|
||||||
this.fixedHTMLSection.hide();
|
this.fixedHTMLSection.hide();
|
||||||
this.solrIndividualsSection.hide();
|
this.searchIndividualsSection.hide();
|
||||||
this.classesForClassGroup.addClass('hidden');
|
this.classesForClassGroup.addClass('hidden');
|
||||||
//left side components
|
//left side components
|
||||||
//These depend on whether or not this is an existing item or not
|
//These depend on whether or not this is an existing item or not
|
||||||
|
@ -160,14 +160,14 @@ var pageManagementUtils = {
|
||||||
this.menuSection.hide();
|
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
|
//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
|
//this method can be utilized if using an ajax request to get the vclasses
|
||||||
/*
|
/*
|
||||||
//for solr individuals - remember this populates the template class dropdown
|
//for search individuals - remember this populates the template class dropdown
|
||||||
populateClassForSolrDropdown:function() {
|
populateClassForSearchDropdown:function() {
|
||||||
|
|
||||||
//Run ajax query
|
//Run ajax query
|
||||||
var url = "dataservice?getAllVClasses=1";
|
var url = "dataservice?getAllVClasses=1";
|
||||||
|
@ -176,10 +176,10 @@ var pageManagementUtils = {
|
||||||
$.getJSON(url, function(results) {
|
$.getJSON(url, function(results) {
|
||||||
//Moved the function to processClassGroupDataGetterContent
|
//Moved the function to processClassGroupDataGetterContent
|
||||||
//Should probably remove this entire method and copy there
|
//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 ) {
|
if ( results.classes.length == 0 ) {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -193,7 +193,7 @@ var pageManagementUtils = {
|
||||||
|
|
||||||
//if there are options to add
|
//if there are options to add
|
||||||
if(appendHtml != "") {
|
if(appendHtml != "") {
|
||||||
pageManagementUtils.solrAllClassesDropdown.html(appendHtml);
|
pageManagementUtils.searchAllClassesDropdown.html(appendHtml);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -285,7 +285,7 @@ var pageManagementUtils = {
|
||||||
pageManagementUtils.classGroupSection.hide();
|
pageManagementUtils.classGroupSection.hide();
|
||||||
pageManagementUtils.fixedHTMLSection.hide();
|
pageManagementUtils.fixedHTMLSection.hide();
|
||||||
pageManagementUtils.sparqlQuerySection.hide();
|
pageManagementUtils.sparqlQuerySection.hide();
|
||||||
pageManagementUtils.solrIndividualsSection.hide();
|
pageManagementUtils.searchIndividualsSection.hide();
|
||||||
//Reset main content type drop-down
|
//Reset main content type drop-down
|
||||||
pageManagementUtils.contentTypeSelectOptions.eq(0).attr('selected', 'selected');
|
pageManagementUtils.contentTypeSelectOptions.eq(0).attr('selected', 'selected');
|
||||||
if ( pageManagementUtils.leftSideDiv.css("height") != undefined ) {
|
if ( pageManagementUtils.leftSideDiv.css("height") != undefined ) {
|
||||||
|
@ -357,31 +357,31 @@ var pageManagementUtils = {
|
||||||
pageManagementUtils.classGroupSection.show();
|
pageManagementUtils.classGroupSection.show();
|
||||||
pageManagementUtils.fixedHTMLSection.hide();
|
pageManagementUtils.fixedHTMLSection.hide();
|
||||||
pageManagementUtils.sparqlQuerySection.hide();
|
pageManagementUtils.sparqlQuerySection.hide();
|
||||||
pageManagementUtils.solrIndividualsSection.hide();
|
pageManagementUtils.searchIndividualsSection.hide();
|
||||||
pageManagementUtils.headerBar.text(pageManagementUtils.browseClassGroup + " - ");
|
pageManagementUtils.headerBar.text(pageManagementUtils.browseClassGroup + " - ");
|
||||||
pageManagementUtils.headerBar.show();
|
pageManagementUtils.headerBar.show();
|
||||||
$('div#selfContainedDiv').hide();
|
$('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();
|
pageManagementUtils.classGroupSection.hide();
|
||||||
//if fixed html show that, otherwise show sparql results
|
//if fixed html show that, otherwise show sparql results
|
||||||
if ( _this.contentTypeSelect.val() == "fixedHtml" ) {
|
if ( _this.contentTypeSelect.val() == "fixedHtml" ) {
|
||||||
pageManagementUtils.headerBar.text(pageManagementUtils.fixedHtml + " - ");
|
pageManagementUtils.headerBar.text(pageManagementUtils.fixedHtml + " - ");
|
||||||
pageManagementUtils.fixedHTMLSection.show();
|
pageManagementUtils.fixedHTMLSection.show();
|
||||||
pageManagementUtils.sparqlQuerySection.hide();
|
pageManagementUtils.sparqlQuerySection.hide();
|
||||||
pageManagementUtils.solrIndividualsSection.hide();
|
pageManagementUtils.searchIndividualsSection.hide();
|
||||||
}
|
}
|
||||||
else if (_this.contentTypeSelect.val() == "sparqlQuery"){
|
else if (_this.contentTypeSelect.val() == "sparqlQuery"){
|
||||||
pageManagementUtils.headerBar.text(pageManagementUtils.sparqlResults + " - ");
|
pageManagementUtils.headerBar.text(pageManagementUtils.sparqlResults + " - ");
|
||||||
pageManagementUtils.sparqlQuerySection.show();
|
pageManagementUtils.sparqlQuerySection.show();
|
||||||
pageManagementUtils.fixedHTMLSection.hide();
|
pageManagementUtils.fixedHTMLSection.hide();
|
||||||
pageManagementUtils.solrIndividualsSection.hide();
|
pageManagementUtils.searchIndividualsSection.hide();
|
||||||
} else {
|
} else {
|
||||||
//solr individuals
|
//search individuals
|
||||||
pageManagementUtils.headerBar.text(pageManagementUtils.solrIndividuals + " - ");
|
pageManagementUtils.headerBar.text(pageManagementUtils.searchIndividuals + " - ");
|
||||||
pageManagementUtils.sparqlQuerySection.hide();
|
pageManagementUtils.sparqlQuerySection.hide();
|
||||||
pageManagementUtils.fixedHTMLSection.hide();
|
pageManagementUtils.fixedHTMLSection.hide();
|
||||||
pageManagementUtils.solrIndividualsSection.show();
|
pageManagementUtils.searchIndividualsSection.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
pageManagementUtils.headerBar.show();
|
pageManagementUtils.headerBar.show();
|
||||||
|
@ -392,7 +392,7 @@ var pageManagementUtils = {
|
||||||
pageManagementUtils.classGroupSection.hide();
|
pageManagementUtils.classGroupSection.hide();
|
||||||
pageManagementUtils.fixedHTMLSection.hide();
|
pageManagementUtils.fixedHTMLSection.hide();
|
||||||
pageManagementUtils.sparqlQuerySection.hide();
|
pageManagementUtils.sparqlQuerySection.hide();
|
||||||
pageManagementUtils.solrIndividualsSection.hide();
|
pageManagementUtils.searchIndividualsSection.hide();
|
||||||
pageManagementUtils.classesForClassGroup.addClass('hidden');
|
pageManagementUtils.classesForClassGroup.addClass('hidden');
|
||||||
pageManagementUtils.headerBar.hide();
|
pageManagementUtils.headerBar.hide();
|
||||||
pageManagementUtils.headerBar.text("");
|
pageManagementUtils.headerBar.text("");
|
||||||
|
@ -430,7 +430,7 @@ var pageManagementUtils = {
|
||||||
pageManagementUtils.clearInputs(pageManagementUtils.fixedHTMLSection);
|
pageManagementUtils.clearInputs(pageManagementUtils.fixedHTMLSection);
|
||||||
pageManagementUtils.clearInputs(pageManagementUtils.sparqlQuerySection);
|
pageManagementUtils.clearInputs(pageManagementUtils.sparqlQuerySection);
|
||||||
pageManagementUtils.clearInputs(pageManagementUtils.classGroupSection);
|
pageManagementUtils.clearInputs(pageManagementUtils.classGroupSection);
|
||||||
pageManagementUtils.clearInputs(pageManagementUtils.solrIndividualsSection);
|
pageManagementUtils.clearInputs(pageManagementUtils.searchIndividualsSection);
|
||||||
|
|
||||||
},
|
},
|
||||||
clearInputs:function($el) {
|
clearInputs:function($el) {
|
||||||
|
@ -474,7 +474,7 @@ var pageManagementUtils = {
|
||||||
// Get rid of the cancel link; it'll be replaced by a delete link
|
// Get rid of the cancel link; it'll be replaced by a delete link
|
||||||
$newContentObj.find('span#cancelContent' + counter).html('');
|
$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();
|
varOrClass = $newContentObj.find('input[name="saveToVar"]').val();
|
||||||
}
|
}
|
||||||
else if ( contentType == "browseClassGroup" ) {
|
else if ( contentType == "browseClassGroup" ) {
|
||||||
|
|
|
@ -10,7 +10,7 @@ var processDataGetterUtils = {
|
||||||
"sparqlQuery": processSparqlDataGetterContent,
|
"sparqlQuery": processSparqlDataGetterContent,
|
||||||
"fixedHtml":processFixedHTMLDataGetterContent,
|
"fixedHtml":processFixedHTMLDataGetterContent,
|
||||||
"individualsForClasses":processIndividualsForClassesDataGetterContent,
|
"individualsForClasses":processIndividualsForClassesDataGetterContent,
|
||||||
"solrIndividuals":processSolrDataGetterContent},
|
"searchIndividuals":processSearchDataGetterContent},
|
||||||
selectDataGetterType:function(pageContentSection) {
|
selectDataGetterType:function(pageContentSection) {
|
||||||
var contentType = pageContentSection.attr("contentType");
|
var contentType = pageContentSection.attr("contentType");
|
||||||
//The form can provide "browse class group" as content type but need to check
|
//The form can provide "browse class group" as content type but need to check
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
|
/* $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
|
//Process sparql data getter and provide a json object with the necessary information
|
||||||
var processSolrDataGetterContent = {
|
var processSearchDataGetterContent = {
|
||||||
dataGetterClass:null,
|
dataGetterClass:null,
|
||||||
//can use this if expect to initialize from elsewhere
|
//can use this if expect to initialize from elsewhere
|
||||||
initProcessor:function(dataGetterClass) {
|
initProcessor:function(dataGetterClass) {
|
||||||
|
@ -30,13 +30,13 @@ var processSolrDataGetterContent = {
|
||||||
|
|
||||||
//Now find and set value
|
//Now find and set value
|
||||||
pageContentSection.find("input[name='saveToVar']").val(saveToVarValue);
|
pageContentSection.find("input[name='saveToVar']").val(saveToVarValue);
|
||||||
//set value of solr query
|
//set value of query
|
||||||
pageContentSection.find("select[name='vclassUri']").val(vclassUriValue);
|
pageContentSection.find("select[name='vclassUri']").val(vclassUriValue);
|
||||||
|
|
||||||
},
|
},
|
||||||
//For the label of the content section for editing, need to add additional value
|
//For the label of the content section for editing, need to add additional value
|
||||||
retrieveContentLabel:function() {
|
retrieveContentLabel:function() {
|
||||||
return i18nStringsSolrIndividuals.solrIndividuals;
|
return i18nStringsSearchIndividuals.searchIndividuals;
|
||||||
},
|
},
|
||||||
//For the label of the content section for editing, need to add additional value
|
//For the label of the content section for editing, need to add additional value
|
||||||
retrieveAdditionalLabelText:function(existingContentObject) {
|
retrieveAdditionalLabelText:function(existingContentObject) {
|
||||||
|
@ -49,20 +49,20 @@ var processSolrDataGetterContent = {
|
||||||
//Check that vclassuri and saveToVar have been input
|
//Check that vclassuri and saveToVar have been input
|
||||||
var variableValue = pageContentSection.find("input[name='saveToVar']").val();
|
var variableValue = pageContentSection.find("input[name='saveToVar']").val();
|
||||||
if(variableValue == "") {
|
if(variableValue == "") {
|
||||||
validationError += pageContentSectionLabel + ": " + i18nStringsSolrIndividuals.supplyQueryVariable + " <br />"
|
validationError += pageContentSectionLabel + ": " + i18nStringsSearchIndividuals.supplyQueryVariable + " <br />"
|
||||||
}
|
}
|
||||||
if(processSolrDataGetterContent.stringHasSingleQuote(variableValue)) {
|
if(processSearchDataGetterContent.stringHasSingleQuote(variableValue)) {
|
||||||
validationError += pageContentSectionLabel + ": " + i18nStringsSolrIndividuals.noApostrophes + " <br />";
|
validationError += pageContentSectionLabel + ": " + i18nStringsSearchIndividuals.noApostrophes + " <br />";
|
||||||
}
|
}
|
||||||
if(processSolrDataGetterContent.stringHasDoubleQuote(variableValue)) {
|
if(processSearchDataGetterContent.stringHasDoubleQuote(variableValue)) {
|
||||||
validationError += pageContentSectionLabel + ": " + i18nStringsSolrIndividuals.noDoubleQuotes + " <br />";
|
validationError += pageContentSectionLabel + ": " + i18nStringsSearchIndividuals.noDoubleQuotes + " <br />";
|
||||||
}
|
}
|
||||||
|
|
||||||
//validation for solr individuals
|
//validation for search individuals
|
||||||
|
|
||||||
var vclassUriValue = pageContentSection.find("select[name='vclassUri']").val();
|
var vclassUriValue = pageContentSection.find("select[name='vclassUri']").val();
|
||||||
if(vclassUriValue == "") {
|
if(vclassUriValue == "") {
|
||||||
validationError += pageContentSectionLabel + ": " + i18nStringsSolrIndividuals.selectClass + " <br />";
|
validationError += pageContentSectionLabel + ": " + i18nStringsSearchIndividuals.selectClass + " <br />";
|
||||||
}
|
}
|
||||||
return validationError;
|
return validationError;
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,16 +7,16 @@
|
||||||
<h2>${i18n().search_index_status}</h2>
|
<h2>${i18n().search_index_status}</h2>
|
||||||
|
|
||||||
<#if !indexIsConnected>
|
<#if !indexIsConnected>
|
||||||
<!-- Can't contact the Solr server. Indexing would be impossible. Show an error message. -->
|
<!-- Can't contact the search engine. Indexing would be impossible. Show an error message. -->
|
||||||
<section id="error-alert" role="alert">
|
<section id="error-alert" role="alert">
|
||||||
<img src="${urls.images}/iconAlert.png" width="24" height="24" alt="Error alert icon" />
|
<img src="${urls.images}/iconAlert.png" width="24" height="24" alt="Error alert icon" />
|
||||||
<p>${i18n().search_index_not_connected}</p>
|
<p>${i18n().search_index_not_connected}</p>
|
||||||
<p><tt>SolrServer.ping()</tt> ${i18n().failed}.
|
<p><tt>SearchEngine.ping()</tt> ${i18n().failed}.
|
||||||
<p>${i18n().check_startup_status}</p>
|
<p>${i18n().check_startup_status}</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<#elseif worklevel == "IDLE">
|
<#elseif worklevel == "IDLE">
|
||||||
<!-- Solr indexer is idle. Show the button that rebuilds the index. -->
|
<!-- Search indexer is idle. Show the button that rebuilds the index. -->
|
||||||
<h3>${i18n().search_indexer_idle}</h3>
|
<h3>${i18n().search_indexer_idle}</h3>
|
||||||
<#if hasPreviousBuild??>
|
<#if hasPreviousBuild??>
|
||||||
<p>${i18n().most_recent_update} ${since?string("hh:mm:ss a, MMMM dd, yyyy")}</p>
|
<p>${i18n().most_recent_update} ${since?string("hh:mm:ss a, MMMM dd, yyyy")}</p>
|
||||||
|
@ -30,12 +30,12 @@
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<#elseif totalToDo == 0>
|
<#elseif totalToDo == 0>
|
||||||
<!-- Solr indexer is preparing the list of records. Show elapsed time since request. -->
|
<!-- Search indexer is preparing the list of records. Show elapsed time since request. -->
|
||||||
<h3>${i18n().preparing_to_rebuild_index}</h3>
|
<h3>${i18n().preparing_to_rebuild_index}</h3>
|
||||||
<p>${i18n().since_elapsed_time(since?string("hh:mm:ss a, MMMM dd, yyyy"),elapsed)}</p>
|
<p>${i18n().since_elapsed_time(since?string("hh:mm:ss a, MMMM dd, yyyy"),elapsed)}</p>
|
||||||
|
|
||||||
<#else>
|
<#else>
|
||||||
<!-- Solr indexer is re-building the index. Show the progress. -->
|
<!-- Search indexer is re-building the index. Show the progress. -->
|
||||||
<h3>${i18n().current_task(currentTask)}</h3>
|
<h3>${i18n().current_task(currentTask)}</h3>
|
||||||
<p>${i18n().since_elapsed_time_est_total(since?string("hh:mm:ss a, MMMM dd, yyyy"),elapsed,expected)}</p>
|
<p>${i18n().since_elapsed_time_est_total(since?string("hh:mm:ss a, MMMM dd, yyyy"),elapsed,expected)}</p>
|
||||||
<p>${i18n().index_recs_completed(completedCount,totalToDo)}</p>
|
<p>${i18n().index_recs_completed(completedCount,totalToDo)}</p>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
<#-- $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">
|
<#include "menupage-checkForData.ftl">
|
||||||
<#--Fixed HTML portion-->
|
<#--Fixed HTML portion-->
|
||||||
<#--Note that variableName is employed by both the fixed html and sparql query templates, this is used to store the
|
<#--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}
|
${noDataNotification}
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
<#--Solr Individuals section-->
|
<#--Search Individuals section-->
|
||||||
<#import "lib-list.ftl" as l>
|
<#import "lib-list.ftl" as l>
|
||||||
|
|
||||||
<#include "individualList-checkForData.ftl">
|
<#include "individualList-checkForData.ftl">
|
||||||
|
|
|
@ -103,7 +103,7 @@
|
||||||
|
|
||||||
<#assign sparqlQueryUrl = "${urls.base}/ajax/sparqlQuery" >
|
<#assign sparqlQueryUrl = "${urls.base}/ajax/sparqlQuery" >
|
||||||
<#--Passing in object types only if there are any types returned, otherwise
|
<#--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-->
|
Also multiple types parameter set to true only if more than one type returned-->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var customFormData = {
|
var customFormData = {
|
||||||
|
|
|
@ -3,4 +3,4 @@
|
||||||
<#include "pageManagement--browseClassGroups.ftl">
|
<#include "pageManagement--browseClassGroups.ftl">
|
||||||
<#include "pageManagement--sparqlQuery.ftl">
|
<#include "pageManagement--sparqlQuery.ftl">
|
||||||
<#include "pageManagement--fixedHtml.ftl">
|
<#include "pageManagement--fixedHtml.ftl">
|
||||||
<#include "pageManagement--solrIndividuals.ftl">
|
<#include "pageManagement--searchIndividuals.ftl">
|
|
@ -13,7 +13,7 @@ scripts list.-->
|
||||||
"individualsForClasses": "java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.IndividualsForClassesDataGetter",
|
"individualsForClasses": "java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.IndividualsForClassesDataGetter",
|
||||||
"sparqlQuery":"java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter",
|
"sparqlQuery":"java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SparqlQueryDataGetter",
|
||||||
"fixedHtml":"java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.FixedHTMLDataGetter",
|
"fixedHtml":"java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.FixedHTMLDataGetter",
|
||||||
"solrIndividuals":"java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SearchIndividualsDataGetter"
|
"searchIndividuals":"java:edu.cornell.mannlib.vitro.webapp.utils.dataGetter.SearchIndividualsDataGetter"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
|
@ -3,7 +3,7 @@
|
||||||
<#assign classGroup = pageData.classGroup />
|
<#assign classGroup = pageData.classGroup />
|
||||||
<#assign classGroups = pageData.classGroups />
|
<#assign classGroups = pageData.classGroups />
|
||||||
<#assign classes = pageData.classes />
|
<#assign classes = pageData.classes />
|
||||||
<section id="solrIndividuals" class="contentSectionContainer">
|
<section id="searchIndividuals" class="contentSectionContainer">
|
||||||
<label id="variableLabel" for="variable">${i18n().variable_name_all_caps}<span class="requiredHint"> *</span></label>
|
<label id="variableLabel" for="variable">${i18n().variable_name_all_caps}<span class="requiredHint"> *</span></label>
|
||||||
<input type="text" name="saveToVar" size="20" value="" id="saveToVar" role="input" />
|
<input type="text" name="saveToVar" size="20" value="" id="saveToVar" role="input" />
|
||||||
<label id="vclassUriLabel" for="vclassUri">${i18n().select_vclass_uri}<span class="requiredHint"> *</span></label>
|
<label id="vclassUriLabel" for="vclassUri">${i18n().select_vclass_uri}<span class="requiredHint"> *</span></label>
|
||||||
|
@ -21,8 +21,8 @@
|
||||||
</#if>
|
</#if>
|
||||||
</section>
|
</section>
|
||||||
<script>
|
<script>
|
||||||
var i18nStringsSolrIndividuals = {
|
var i18nStringsSearchIndividuals = {
|
||||||
solrIndividuals: '${i18n().solr_individual_results}',
|
searchIndividuals: '${i18n().solr_individual_results}',
|
||||||
supplyQueryVariable: '${i18n().supply_query_variable}',
|
supplyQueryVariable: '${i18n().supply_query_variable}',
|
||||||
noApostrophes: '${i18n().apostrophe_not_allowed}',
|
noApostrophes: '${i18n().apostrophe_not_allowed}',
|
||||||
noDoubleQuotes: '${i18n().double_quote_note_allowed}',
|
noDoubleQuotes: '${i18n().double_quote_note_allowed}',
|
||||||
|
@ -30,4 +30,4 @@
|
||||||
selectClass: '${i18n().select_class_for_solr}'
|
selectClass: '${i18n().select_class_for_solr}'
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
${scripts.add('<script type="text/javascript" src="${urls.base}/js/menupage/processSolrDataGetterContent.js"></script>')}
|
${scripts.add('<script type="text/javascript" src="${urls.base}/js/menupage/processSearchDataGetterContent.js"></script>')}
|
|
@ -81,7 +81,7 @@
|
||||||
<option value="browseClassGroup">${i18n().browse_class_group}</option>
|
<option value="browseClassGroup">${i18n().browse_class_group}</option>
|
||||||
<option value="fixedHtml">${i18n().fixed_html}</option>
|
<option value="fixedHtml">${i18n().fixed_html}</option>
|
||||||
<option value="sparqlQuery">${i18n().sparql_query_results}</option>
|
<option value="sparqlQuery">${i18n().sparql_query_results}</option>
|
||||||
<option value="solrIndividuals">${i18n().solr_individual_results}</option>
|
<option value="searchIndividuals">${i18n().solr_individual_results}</option>
|
||||||
</select> <span class="note">${i18n().add_types}</span>
|
</select> <span class="note">${i18n().add_types}</span>
|
||||||
</section>
|
</section>
|
||||||
<section id="contentDivs"></section>
|
<section id="contentDivs"></section>
|
||||||
|
@ -179,7 +179,7 @@
|
||||||
browseClassGroup: '${i18n().browse_class_group}',
|
browseClassGroup: '${i18n().browse_class_group}',
|
||||||
fixedHtml: '${i18n().fixed_html}',
|
fixedHtml: '${i18n().fixed_html}',
|
||||||
sparqlResults: '${i18n().sparql_query_results}',
|
sparqlResults: '${i18n().sparql_query_results}',
|
||||||
solrIndividuals: '${i18n().solr_individual_results}',
|
searchIndividuals: '${i18n().solr_individual_results}',
|
||||||
orString: '${i18n().or}',
|
orString: '${i18n().or}',
|
||||||
deleteString: '${i18n().delete}',
|
deleteString: '${i18n().delete}',
|
||||||
allCapitalized: '${i18n().all_capitalized}',
|
allCapitalized: '${i18n().all_capitalized}',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue