updates for deletion and setting up method of getting field options for individuals with a certain most specific type
Conflicts: webapp/src/edu/cornell/mannlib/vitro/webapp/edit/n3editing/VTwo/fields/IndividualsViaSolrQueryOptions.java
This commit is contained in:
parent
11a35739ae
commit
6a1c67a81d
1 changed files with 43 additions and 0 deletions
|
@ -3,6 +3,10 @@ package edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.fields;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
import java.util.Comparator;
|
||||
>>>>>>> d82c894... updates for deletion and setting up method of getting field options for individuals with a certain most specific type
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -18,9 +22,20 @@ import org.apache.solr.common.SolrDocument;
|
|||
import org.apache.solr.common.SolrDocumentList;
|
||||
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
||||
<<<<<<< HEAD
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo;
|
||||
=======
|
||||
import edu.cornell.mannlib.vitro.webapp.beans.VClass;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.IndividualDao;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.VitroVocabulary;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.jena.WebappDaoFactoryJena;
|
||||
import edu.cornell.mannlib.vitro.webapp.dao.jena.pellet.PelletListener;
|
||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.VTwo.EditConfigurationVTwo;
|
||||
import edu.cornell.mannlib.vitro.webapp.edit.n3editing.configuration.generators.DefaultObjectPropertyFormGenerator;
|
||||
>>>>>>> d82c894... updates for deletion and setting up method of getting field options for individuals with a certain most specific type
|
||||
import edu.cornell.mannlib.vitro.webapp.search.VitroSearchTermNames;
|
||||
import edu.cornell.mannlib.vitro.webapp.search.solr.SolrSetup;
|
||||
|
||||
|
@ -31,9 +46,18 @@ import edu.cornell.mannlib.vitro.webapp.search.solr.SolrSetup;
|
|||
public class IndividualsViaSolrQueryOptions extends IndividualsViaVClassOptions implements FieldOptions {
|
||||
private Log log = LogFactory.getLog(IndividualsViaSolrQueryOptions.class);
|
||||
|
||||
<<<<<<< HEAD
|
||||
private ServletContext servletContext;
|
||||
public IndividualsViaSolrQueryOptions(ServletContext context, String ... vclassURIs) throws Exception {
|
||||
super(vclassURIs);
|
||||
=======
|
||||
public static final String LEFT_BLANK = "";
|
||||
private List<String> vclassURIs;
|
||||
private String defaultOptionLabel;
|
||||
private ServletContext servletContext;
|
||||
public IndividualsViaSolrQueryOptions(ServletContext context, String ... vclassURIs) throws Exception {
|
||||
super();
|
||||
>>>>>>> d82c894... updates for deletion and setting up method of getting field options for individuals with a certain most specific type
|
||||
this.servletContext = context;
|
||||
}
|
||||
|
||||
|
@ -50,6 +74,7 @@ public class IndividualsViaSolrQueryOptions extends IndividualsViaVClassOptions
|
|||
}else{
|
||||
query.setQuery( VitroSearchTermNames.MOST_SPECIFIC_TYPE_URIS + ":" + vclassURI);
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
query.setStart(0)
|
||||
.setRows(1000);
|
||||
query.setFields(VitroSearchTermNames.URI); // fields to retrieve
|
||||
|
@ -72,6 +97,20 @@ public class IndividualsViaSolrQueryOptions extends IndividualsViaVClassOptions
|
|||
catch(Exception ex) {
|
||||
log.error("An error occurred retrieving the individual solr query resutls", ex);
|
||||
}
|
||||
=======
|
||||
query.setRows(0);
|
||||
QueryResponse rsp = solrServer.query(query);
|
||||
SolrDocumentList docs = rsp.getResults();
|
||||
long found = docs.getNumFound();
|
||||
for (SolrDocument doc : docs) {
|
||||
String uri = doc.get(VitroSearchTermNames.URI).toString();
|
||||
Individual individual = wDaoFact.getIndividualDao().getIndividualByURI(uri);
|
||||
if (individual == null) {
|
||||
log.debug("No individual for search document with uri = " + uri);
|
||||
} else {
|
||||
individualMap.put(individual.getURI(), individual);
|
||||
log.debug("Adding individual " + uri + " to individual list");
|
||||
>>>>>>> d82c894... updates for deletion and setting up method of getting field options for individuals with a certain most specific type
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,7 +128,11 @@ public class IndividualsViaSolrQueryOptions extends IndividualsViaVClassOptions
|
|||
|
||||
Map<String, Individual> individualMap = new HashMap<String, Individual>();
|
||||
|
||||
<<<<<<< HEAD
|
||||
for( String vclassURI : vclassURIs){
|
||||
=======
|
||||
for( String vclassURI : this.vclassURIs){
|
||||
>>>>>>> d82c894... updates for deletion and setting up method of getting field options for individuals with a certain most specific type
|
||||
individualMap.putAll( getIndividualsForClass( vclassURI, wDaoFact) );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue