# HG changeset patch # User Robert Casties # Date 1508511588 -7200 # Node ID 92c4c9f7312a1c800bd55797de902ce4b23b544c # Parent 3c83f42a8a396a5d2a98ca4aff8e131ce9c7eb16# Parent 2522985f44af601a0fb3af90eb9660f2280e1032 Merge from HEAD 2522985f44af601a0fb3af90eb9660f2280e1032 diff -r 2522985f44af -r 92c4c9f7312a src/main/java/de/mpiwg/itgroup/ismi/entry/beans/SessionBean.java --- a/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/SessionBean.java Fri Oct 20 12:44:15 2017 +0200 +++ b/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/SessionBean.java Fri Oct 20 16:59:48 2017 +0200 @@ -27,6 +27,7 @@ import de.mpiwg.itgroup.ismi.event.beans.TransferEvent; import de.mpiwg.itgroup.ismi.merge.GeneralMerge; import de.mpiwg.itgroup.ismi.merge.ImportMerge; +import de.mpiwg.itgroup.ismi.merge.PublicByAuthorBean; import de.mpiwg.itgroup.ismi.merge.ReferenceMerge; import de.mpiwg.itgroup.ismi.publicView.DynamicPageEditor; import de.mpiwg.itgroup.ismi.publicView.PublicCodexBean; @@ -47,6 +48,7 @@ private CopyEvent copyEventForm = new CopyEvent(); private TransferEvent transferEventForm = new TransferEvent(); private transient AdvancedSearchBean advancedSearch = new AdvancedSearchBean(); + private transient PublicByAuthorBean publicByAuthor = new PublicByAuthorBean(); private EntityDetailsBean entDetailsForm = new EntityDetailsBean(); @@ -137,6 +139,7 @@ private String selectedTab = WITNESS_TAB; private String selectedEventTab = WITNESS_STUDY_EVENT_TAB; private String selectedAdvancedSearchTab = "01"; + private String selectedPublicByAuthorTab = "01"; private Long editFormCurrentEntId; @@ -655,6 +658,11 @@ this.redirect(null, url); } + public void listenerPublicByAuthorTabChange(ItemChangeEvent event) { + String url = "?formIndex=" + this.selectedPublicByAuthorTab; + this.redirect(null, url); + } + protected void redirect(String redirectPath, String parameters){ FacesContext fc = FacesContext.getCurrentInstance(); ExternalContext ec = fc.getExternalContext(); @@ -1099,6 +1107,34 @@ public void setPublicCodexBean(PublicCodexBean publicCodexBean) { this.publicCodexBean = publicCodexBean; } + + /** + * @return the publicByAuthor + */ + public PublicByAuthorBean getPublicByAuthor() { + return publicByAuthor; + } + + /** + * @param publicByAuthor the publicByAuthor to set + */ + public void setPublicByAuthor(PublicByAuthorBean publicByAuthor) { + this.publicByAuthor = publicByAuthor; + } + + /** + * @return the selectedPublicByAuthorTab + */ + public String getSelectedPublicByAuthorTab() { + return selectedPublicByAuthorTab; + } + + /** + * @param selectedPublicByAuthorTab the selectedPublicByAuthorTab to set + */ + public void setSelectedPublicByAuthorTab(String selectedPublicByAuthorTab) { + this.selectedPublicByAuthorTab = selectedPublicByAuthorTab; + } diff -r 2522985f44af -r 92c4c9f7312a src/main/java/de/mpiwg/itgroup/ismi/merge/PublicByAuthorBean.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/de/mpiwg/itgroup/ismi/merge/PublicByAuthorBean.java Fri Oct 20 16:59:48 2017 +0200 @@ -0,0 +1,173 @@ +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.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; + +public class PublicByAuthorBean extends AbstractISMIBean implements Serializable{ + + private static Logger logger = Logger.getLogger(PublicByAuthorBean.class); + + private static final long serialVersionUID = 1L; + + private String currentTemplate; + private static List templateList; + + private String findAuthorName; + + private boolean searched; + + private long timeExecution; + + 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"); + this.reset(); + } + + public void reset(){ + //logger.info("AdvancedSearchBean.reset()"); + currentTemplate = "witness4Title"; + } + + public void listenerChange(ValueChangeEvent event){ + /* + logger.info(event.getOldValue()); + logger.info(event.getNewValue()); + */ + } + + public void listenerFindAuthorSearch(ActionEvent event){ + try { + 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) { + logger.error(e.getMessage(), e); + printInternalError(e); + } + + } + + + + public String actionSearch(){ + this.search(); + return null; + } + + public void search(){ + long start = System.currentTimeMillis(); + + List rs = sample06(); + + //printRs(rs); + + long end = System.currentTimeMillis(); + logger.info("execution time [ms] = " + (end - start)); + logger.info("Search resultSet size= " + 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(); + + //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"); + 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); + + + 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 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() { + return findAuthorName; + } + + /** + * @param findAuthorName the findAuthorName to set + */ + public void setFindAuthorName(String findAuthorName) { + this.findAuthorName = findAuthorName; + } + +} diff -r 2522985f44af -r 92c4c9f7312a src/main/java/de/mpiwg/itgroup/ismi/search/beans/AdvancedSearchBean.java --- a/src/main/java/de/mpiwg/itgroup/ismi/search/beans/AdvancedSearchBean.java Fri Oct 20 12:44:15 2017 +0200 +++ b/src/main/java/de/mpiwg/itgroup/ismi/search/beans/AdvancedSearchBean.java Fri Oct 20 16:59:48 2017 +0200 @@ -3,16 +3,12 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.List; -import java.util.Map; -import java.util.Map.Entry; import javax.faces.event.ValueChangeEvent; import javax.faces.model.SelectItem; import org.apache.log4j.Logger; -import org.mpi.openmind.repository.bo.Attribute; import org.mpi.openmind.search.utils.ResultEntry; -import org.mpi.openmind.search.utils.SAttribute; import org.mpi.openmind.search.utils.SAttributeMultipleName; import org.mpi.openmind.search.utils.SAttributeMultipleValue; import org.mpi.openmind.search.utils.SAttributeUniqueName; @@ -22,8 +18,6 @@ import org.mpi.openmind.search.utils.SRelationUniqueName; import de.mpiwg.itgroup.ismi.entry.beans.AbstractISMIBean; -import de.mpiwg.itgroup.ismi.entry.beans.SessionBean; -import de.mpiwg.itgroup.ismi.util.guiComponents.Calendar; public class AdvancedSearchBean extends AbstractISMIBean implements Serializable{ diff -r 2522985f44af -r 92c4c9f7312a src/main/java/de/mpiwg/itgroup/ismi/search/beans/Titles4PersonQuery.java --- a/src/main/java/de/mpiwg/itgroup/ismi/search/beans/Titles4PersonQuery.java Fri Oct 20 12:44:15 2017 +0200 +++ b/src/main/java/de/mpiwg/itgroup/ismi/search/beans/Titles4PersonQuery.java Fri Oct 20 16:59:48 2017 +0200 @@ -2,16 +2,12 @@ import java.io.Serializable; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; import javax.faces.model.SelectItem; import org.apache.commons.lang.StringUtils; import org.mpi.openmind.repository.bo.Entity; -import org.mpi.openmind.repository.bo.Relation; -import org.mpi.openmind.repository.utils.NormalizerUtils; import org.mpi.openmind.repository.utils.OldNormalizerUtils; import org.mpi.openmind.search.utils.ResultEntry; import org.mpi.openmind.search.utils.SAttributeMultipleName; diff -r 2522985f44af -r 92c4c9f7312a src/main/webapp/clean/components/findAuthor.xhtml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/webapp/clean/components/findAuthor.xhtml Fri Oct 20 16:59:48 2017 +0200 @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 2522985f44af -r 92c4c9f7312a src/main/webapp/clean/publicByAuthor.xhtml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/webapp/clean/publicByAuthor.xhtml Fri Oct 20 16:59:48 2017 +0200 @@ -0,0 +1,40 @@ + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + +
+
+ + + \ No newline at end of file diff -r 2522985f44af -r 92c4c9f7312a src/main/webapp/search/components/titles4Person.xhtml --- a/src/main/webapp/search/components/titles4Person.xhtml Fri Oct 20 12:44:15 2017 +0200 +++ b/src/main/webapp/search/components/titles4Person.xhtml Fri Oct 20 16:59:48 2017 +0200 @@ -66,25 +66,6 @@ - - - - - - - - - - - @@ -139,7 +120,7 @@ - + diff -r 2522985f44af -r 92c4c9f7312a src/main/webapp/templates/main_template.xhtml --- a/src/main/webapp/templates/main_template.xhtml Fri Oct 20 12:44:15 2017 +0200 +++ b/src/main/webapp/templates/main_template.xhtml Fri Oct 20 16:59:48 2017 +0200 @@ -167,6 +167,18 @@ + + + + + + + + + + + Browse Repository @@ -188,7 +200,7 @@ Codices marked as public + value="#{ApplicationBean1.root}/public/publicCodices.xhtml">Public Codices Biographies