Mercurial > hg > ismi-richfaces
changeset 165:85fdcca37a0d public_by_author
working on public by author feature...
author | Robert Casties <casties@mpiwg-berlin.mpg.de> |
---|---|
date | Tue, 29 May 2018 21:04:13 +0200 |
parents | d5ae699a4152 |
children | 54246f538821 |
files | src/main/java/de/mpiwg/itgroup/ismi/merge/PublicByAuthorBean.java src/main/webapp/clean/components/findAuthor.xhtml |
diffstat | 2 files changed, 26 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/itgroup/ismi/merge/PublicByAuthorBean.java Tue May 22 18:49:10 2018 +0200 +++ b/src/main/java/de/mpiwg/itgroup/ismi/merge/PublicByAuthorBean.java Tue May 29 21:04:13 2018 +0200 @@ -11,11 +11,8 @@ 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.SAttributeUniqueName; import org.mpi.openmind.search.utils.SEntity; import org.mpi.openmind.search.utils.SRelation; -import org.mpi.openmind.search.utils.SRelationMultipleName; -import org.mpi.openmind.search.utils.SRelationUniqueName; import de.mpiwg.itgroup.ismi.entry.beans.AbstractISMIBean; @@ -28,11 +25,13 @@ private String currentTemplate; private static List<SelectItem> templateList; - private String findAuthorName; + private String findAuthorName = ""; - private boolean searched; + private boolean searched = false; private long timeExecution; + + private List<ResultEntry> rs; static{ templateList = new ArrayList<SelectItem>(); @@ -90,13 +89,13 @@ public void search(){ long start = System.currentTimeMillis(); - List<ResultEntry> rs = sample06(); + rs = sample06(); //printRs(rs); long end = System.currentTimeMillis(); logger.info("execution time [ms] = " + (end - start)); - logger.info("Search resultSet size= " + rs.size()); + logger.info("Search resultSet size= " + this.rs.size()); } @@ -109,12 +108,6 @@ List<SEntity> entFilters = new ArrayList<SEntity>(); List<SRelation> relFilters = new ArrayList<SRelation>(); - //The user can select between: - //"Author", "Annotator", "Copyist", "Corrector", "Dedicatee", "Illuminator", "Illustrator", "Owner", "Patron", "inspector" - SEntity role = new SEntity(0, "ROLE"); - role.addAtt(new SAttributeUniqueName("name", "Annotator")); - entFilters.add(role); - //alias, "is_prime_alias_name_of", "PERSON" //alias, "is_alias_name_of", "PERSON" SEntity person = new SEntity(1, "PERSON"); @@ -127,15 +120,16 @@ entFilters.add(alias); */ + /* SEntity title = new SEntity(2, "TEXT"); title.addAtt(new SAttributeMultipleName("abu", "full_title_translit", "full_title")); entFilters.add(title); - + */ - SRelationUniqueName has_role = new SRelationUniqueName(person, role, "has_role"); + /* SRelationMultipleName title_to_person = new SRelationMultipleName(title, person, "had_patron", "was_dedicated_to", "was_created_by"); relFilters.add(title_to_person); - relFilters.add(has_role); + */ List<ResultEntry> rs = getAppBean().getSS().search(entFilters, relFilters); @@ -170,4 +164,18 @@ this.findAuthorName = findAuthorName; } + /** + * @return the rs + */ + public List<ResultEntry> getRs() { + return rs; + } + + /** + * @return the searched + */ + public boolean isSearched() { + return searched; + } + }
--- a/src/main/webapp/clean/components/findAuthor.xhtml Tue May 22 18:49:10 2018 +0200 +++ b/src/main/webapp/clean/components/findAuthor.xhtml Tue May 29 21:04:13 2018 +0200 @@ -30,21 +30,11 @@ <h:panelGrid id="selectPersonPanel" columns="1"> - <h:panelGrid columns="3" - rendered="#{Session.advancedSearch.titles4PersonQuery.searched}"> - <h:outputLabel - value="Result set - size=#{Session.advancedSearch.titles4PersonQuery.rsSize}" /> - <h:outputLabel - value="Time execution [ms]=#{Session.advancedSearch.titles4PersonQuery.timeExecution}" /> - <h:commandButton value="reset" - actionListener="#{Session.advancedSearch.titles4PersonQuery.listenerReset}" /> - </h:panelGrid> - <h:panelGrid columns="1" - rendered="#{!empty Session.advancedSearch.titles4PersonQuery.rs}"> + rendered="#{!empty Session.publicByAuthor.rs}"> <rich:dataTable var="entry" - value="#{Session.advancedSearch.titles4PersonQuery.rs}" + value="#{Session.publicByAuthor.rs}" paginator="true" rows="20"> <f:facet name="header">