# HG changeset patch # User Robert Casties # Date 1527704625 -7200 # Node ID e9ab943ec528159fe2f894e8c54e70b7365aa7ef # Parent 54246f538821ce4789d025155489717bc2d89afc new start for publicByAuthor using EntityRepositoryBean. diff -r 54246f538821 -r e9ab943ec528 src/main/java/de/mpiwg/itgroup/ismi/merge/PublicByAuthorBean.java --- a/src/main/java/de/mpiwg/itgroup/ismi/merge/PublicByAuthorBean.java Wed May 30 19:17:10 2018 +0200 +++ b/src/main/java/de/mpiwg/itgroup/ismi/merge/PublicByAuthorBean.java Wed May 30 20:23:45 2018 +0200 @@ -1,19 +1,13 @@ package de.mpiwg.itgroup.ismi.merge; import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; import javax.faces.event.ActionEvent; import javax.faces.event.ValueChangeEvent; -import javax.faces.model.SelectItem; import org.apache.log4j.Logger; -import org.mpi.openmind.search.utils.ResultEntry; -import org.mpi.openmind.search.utils.SAttributeMultipleName; -import org.mpi.openmind.search.utils.SEntity; -import org.mpi.openmind.search.utils.SRelation; +import de.mpiwg.itgroup.ismi.browse.EntityRepositoryBean; import de.mpiwg.itgroup.ismi.entry.beans.AbstractISMIBean; public class PublicByAuthorBean extends AbstractISMIBean implements Serializable{ @@ -22,30 +16,11 @@ private static final long serialVersionUID = 1L; - private String currentTemplate; - private static List templateList; - private String findAuthorName = ""; - - private boolean searched = false; - private long timeExecution; - private List rs; + private EntityRepositoryBean browseBean; - static{ - templateList = new ArrayList(); - //templateList.add(new SelectItem("sample01")); - templateList.add(new SelectItem("witness4Title", "Witnesses for a title")); - //templateList.add(new SelectItem("sample03")); - //templateList.add(new SelectItem("sample04")); - //templateList.add(new SelectItem("sample05")); - templateList.add(new SelectItem("titles4Person", "Titles for a person")); - templateList.add(new SelectItem("codexOwnership", "Codex ownership")); - //templateList.add(new SelectItem("sample07")); - //templateList.add(new SelectItem("sample08")); - //templateList.add(new SelectItem("sample09")); - } public PublicByAuthorBean(){ //logger.info("AdvancedSearchBean"); @@ -54,7 +29,8 @@ public void reset(){ //logger.info("AdvancedSearchBean.reset()"); - currentTemplate = "witness4Title"; + browseBean = new EntityRepositoryBean(); + browseBean.setObjectClass("PERSON"); } public void listenerChange(ValueChangeEvent event){ @@ -69,7 +45,6 @@ long start = System.currentTimeMillis(); this.search(); long end = System.currentTimeMillis(); - this.searched = true; this.timeExecution = end - start; logger.info(toString() + " time execution=" + (timeExecution)); } catch (Exception e) { @@ -89,68 +64,12 @@ public void search(){ long start = System.currentTimeMillis(); - rs = sample06(); - - //printRs(rs); - long end = System.currentTimeMillis(); logger.info("execution time [ms] = " + (end - start)); - logger.info("Search resultSet size= " + this.rs.size()); } /** - * 6) Bring up people associated with a particular title (not just one huge list of people, but be able to distinguish author, student, teacher) - * @return - */ - private List sample06(){ - - List entFilters = new ArrayList(); - List relFilters = new ArrayList(); - - //alias, "is_prime_alias_name_of", "PERSON" - //alias, "is_alias_name_of", "PERSON" - SEntity person = new SEntity(1, "PERSON"); - person.addAtt(new SAttributeMultipleName("a", "name_translit", "name")); - entFilters.add(person); - - /* - SEntity alias = new SEntity(1, "ALIAS"); - alias.addAtt(new SAttributeUniqueName("alias", "abu")); - entFilters.add(alias); - */ - - /* - SEntity title = new SEntity(2, "TEXT"); - title.addAtt(new SAttributeMultipleName("abu", "full_title_translit", "full_title")); - entFilters.add(title); - */ - - /* - SRelationMultipleName title_to_person = new SRelationMultipleName(title, person, "had_patron", "was_dedicated_to", "was_created_by"); - relFilters.add(title_to_person); - */ - - List rs = getAppBean().getSS().search(entFilters, relFilters); - - return rs; - - } - - - public String getCurrentTemplate() { - return currentTemplate; - } - - public void setCurrentTemplate(String currentTemplate) { - this.currentTemplate = currentTemplate; - } - - public List getTemplateList() { - return templateList; - } - - /** * @return the findAuthorName */ public String getFindAuthorName() { @@ -165,17 +84,10 @@ } /** - * @return the rs + * @return the browseBean */ - public List getRs() { - return rs; - } - - /** - * @return the searched - */ - public boolean isSearched() { - return searched; + public EntityRepositoryBean getBrowseBean() { + return browseBean; } } diff -r 54246f538821 -r e9ab943ec528 src/main/webapp/clean/components/findAuthor.xhtml --- a/src/main/webapp/clean/components/findAuthor.xhtml Wed May 30 19:17:10 2018 +0200 +++ b/src/main/webapp/clean/components/findAuthor.xhtml Wed May 30 20:23:45 2018 +0200 @@ -16,147 +16,142 @@ - + - + - + + + - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - diff -r 54246f538821 -r e9ab943ec528 src/main/webapp/clean/publicByAuthor.xhtml --- a/src/main/webapp/clean/publicByAuthor.xhtml Wed May 30 19:17:10 2018 +0200 +++ b/src/main/webapp/clean/publicByAuthor.xhtml Wed May 30 20:23:45 2018 +0200 @@ -7,9 +7,9 @@ xmlns:rich="http://richfaces.org/rich"> - + - +