# HG changeset patch # User casties # Date 1450811233 -3600 # Node ID 70207f24937e38c4510231cc8d6353d568e4cdb8 # Parent 38dc1f0e24511dfedf62fa3230a4c1376e90c2b9 cleaned displayAuthor. added filter for witnesses with scans. diff -r 38dc1f0e2451 -r 70207f24937e src/main/java/de/mpiwg/itgroup/ismi/search/beans/DisplayBean.java --- a/src/main/java/de/mpiwg/itgroup/ismi/search/beans/DisplayBean.java Thu Dec 17 17:31:07 2015 +0100 +++ b/src/main/java/de/mpiwg/itgroup/ismi/search/beans/DisplayBean.java Tue Dec 22 20:07:13 2015 +0100 @@ -7,6 +7,7 @@ import javax.faces.model.SelectItem; import org.apache.log4j.Logger; +import org.mpi.openmind.repository.bo.Attribute; import org.mpi.openmind.repository.bo.Entity; import de.mpiwg.itgroup.ismi.auxObjects.SelectItem0; @@ -30,6 +31,7 @@ //Witness elements protected List witnessItems = new ArrayList(); protected Long selectedWitnessId; + protected boolean showWitnessesWithScans = false; //Title elements protected Long selectedTitleId; @@ -61,10 +63,21 @@ //****** getting witnesses ********************** long startWitness = System.currentTimeMillis(); - List list = getWrapper().getSourcesForTargetRelation(selectedTitleId, is_exemplar_of, WITNESS, -1); - for(Entity src : list){ - SelectItem0 item = new SelectItem0(src.getId(), src.getOwnValue() + " [" + src.getId() + "]", true); + List list = new ArrayList(); + List allwits = getWrapper().getSourcesForTargetRelation(selectedTitleId, is_exemplar_of, WITNESS, -1); + for (Entity witness : allwits) { + if (this.showWitnessesWithScans) { + List codices = getWrapper().getTargetsForSourceRelation(witness.getId(), is_part_of, CODEX, 1); + Entity codex = codices.get(0); + // TODO: look at DIGITALIZATION + Attribute pub = getWrapper().getAttributeByName(codex.getId(), "public"); + if (pub == null || ! pub.getValue().equals("true")) { + continue; + } + } + SelectItem0 item = new SelectItem0(witness.getId(), witness.getOwnValue() + " [" + witness.getId() + "]", true); this.witnessItems.add(item); + list.add(witness); } if(list.size() > 0){ @@ -193,6 +206,13 @@ } + + public void changeShowWitnessesWithScans() { + if (this.selectedTitleId != null) { + showTitle(this.selectedTitleId); + } + } + public int getWitnessItemsSize() { if(witnessItems != null) return witnessItems.size(); @@ -226,4 +246,12 @@ public void setSelectedTitleId(Long selectedTitleId) { this.selectedTitleId = selectedTitleId; } + + public boolean isShowWitnessesWithScans() { + return showWitnessesWithScans; + } + + public void setShowWitnessesWithScans(boolean showWitnessesWithScans) { + this.showWitnessesWithScans = showWitnessesWithScans; + } } diff -r 38dc1f0e2451 -r 70207f24937e src/main/java/de/mpiwg/itgroup/ismi/utils/templates/TitleTemplate.java --- a/src/main/java/de/mpiwg/itgroup/ismi/utils/templates/TitleTemplate.java Thu Dec 17 17:31:07 2015 +0100 +++ b/src/main/java/de/mpiwg/itgroup/ismi/utils/templates/TitleTemplate.java Tue Dec 22 20:07:13 2015 +0100 @@ -9,7 +9,6 @@ import org.mpi.openmind.cache.WrapperService; import org.mpi.openmind.repository.bo.Attribute; import org.mpi.openmind.repository.bo.Entity; -import org.mpi.openmind.repository.bo.Relation; import org.mpi.openmind.repository.utils.RomanizationLoC; import de.mpiwg.itgroup.ismi.util.guiComponents.Calendar; @@ -57,6 +56,7 @@ Attribute att = null; Long entId = entity.getId(); + this.ov = entity.getOwnValue(); //attributes this.fullTitle = om.getAttributeOVByName(entId, "full_title", useRomanization); diff -r 38dc1f0e2451 -r 70207f24937e src/main/webapp/search/displayAuthor.xhtml --- a/src/main/webapp/search/displayAuthor.xhtml Thu Dec 17 17:31:07 2015 +0100 +++ b/src/main/webapp/search/displayAuthor.xhtml Tue Dec 22 20:07:13 2015 +0100 @@ -145,7 +145,7 @@ - + - - + + @@ -283,14 +283,30 @@ + + + + + - + + + + + + + - - + + @@ -381,10 +397,8 @@ escape="false" /> - - - @@ -457,6 +471,11 @@ + + +