# HG changeset patch
# User casties
# Date 1443782547 0
# Node ID 4ee8d47e1e346e3420c466a4ff9f363e924025ef
# Parent 8efabe84b7ea67ba9b3c66465d7799f1f18a3bcd
hide simple search when not logged in. add scan viewer link to displayAuthor when codex is public.
diff -r 8efabe84b7ea -r 4ee8d47e1e34 src/main/java/de/mpiwg/itgroup/ismi/utils/templates/WitnessTemplate.java
--- a/src/main/java/de/mpiwg/itgroup/ismi/utils/templates/WitnessTemplate.java Wed Sep 30 15:52:17 2015 +0000
+++ b/src/main/java/de/mpiwg/itgroup/ismi/utils/templates/WitnessTemplate.java Fri Oct 02 10:42:27 2015 +0000
@@ -47,6 +47,11 @@
public String folios;
public String ahlwardtNo;
public String colophon;
+
+ /** scans attribute */
+ public String scans;
+ /** public scan viewer URL */
+ public String scanViewer;
public String incipit;
public String explicit;
@@ -125,6 +130,8 @@
this.script = om.getAttributeOVByName(id, "script", useRomanization);
this.writing_surface = om.getAttributeOVByName(id, "writing_surface", useRomanization);
+ this.scans = om.getAttributeOVByName(id, "scans", useRomanization);
+
Attribute att0 = om.getAttributeByName(witness.getId(), "creation_date");
Calendar creationDate0 = AbstractISMIBean.updateCalendar(att0);
this.creationDate = creationDate0.getCalendarAsHtml();
@@ -204,11 +211,20 @@
if (list.size() > 0) {
Entity codex = list.get(0);
- Attribute att = om.getAttributeByName(codex.getId(),
- "identifier");
+ Attribute att = om.getAttributeByName(codex.getId(), "identifier");
if (att != null && StringUtils.isNotEmpty(att.getValue())) {
this.codex = att.getValue();
}
+
+ /*
+ * add scan viewer URL if codex is public
+ */
+ // TODO: use scans attribute if available?
+ Attribute pub = om.getAttributeByName(codex.getId(), "public");
+ if (pub != null && pub.getValue().equals("true")) {
+ // FIXME: make viewer URL configurable
+ this.scanViewer = "https://ismi-dev.mpiwg-berlin.mpg.de/om4-ismi/public/publicWitness.jsp?eid=" + this.id;
+ }
for (Relation rel : om.getSourceRelations(codex, "owned_by", "PERSON", -1)) {
String date = (rel.getAttributeByName("date") != null) ? new Calendar(
@@ -380,6 +396,14 @@
return this.titleId != null;
}
+ public String getScans() {
+ return this.scans;
+ }
+
+ public String getScanViewer() {
+ return this.scanViewer;
+ }
+
// 40b-49b
// 104b-111b
public int compareTo(WitnessTemplate other) {
diff -r 8efabe84b7ea -r 4ee8d47e1e34 src/main/webapp/search/displayAuthor.xhtml
--- a/src/main/webapp/search/displayAuthor.xhtml Wed Sep 30 15:52:17 2015 +0000
+++ b/src/main/webapp/search/displayAuthor.xhtml Fri Oct 02 10:42:27 2015 +0000
@@ -410,6 +410,11 @@
+