# HG changeset patch # User dwinter # Date 1427114635 0 # Node ID 17551d9f091f1112dff6621179f1ebe13627dfa7 # Parent e07a1ae515b70adc17252cb8a60f1a838471a08c add new witness view lin, and those below, will be ignored-- A src/main/java/de/mpiwg/itgroup/ismi/publicView/pages/WitnessCodexDynamicPage.java M src/main/java/de/mpiwg/itgroup/ismi/servlets/jsonmethods/JSONGetTitleDetails.java M src/main/java/de/mpiwg/itgroup/ismi/utils/templates/TitleTemplate.java M src/main/resources/hibernate.cfg.xml M src/main/webapp/imageServer/resources/css/diva4ismi.css M src/main/webapp/imageServer/resources/js/diva4ismi.js M src/main/webapp/public/publicCodex.jsp M src/main/webapp/public/publicWitness.jsp M src/main/webapp/public/templates/templateWitnessInformationBig.html diff -r e07a1ae515b7 -r 17551d9f091f src/main/java/de/mpiwg/itgroup/ismi/publicView/pages/WitnessCodexDynamicPage.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/de/mpiwg/itgroup/ismi/publicView/pages/WitnessCodexDynamicPage.java Mon Mar 23 12:43:55 2015 +0000 @@ -0,0 +1,102 @@ +package de.mpiwg.itgroup.ismi.publicView.pages; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.mpi.openmind.repository.bo.Entity; + +import de.mpiwg.itgroup.ismi.utils.templates.WitnessTemplate; + +public class WitnessCodexDynamicPage extends JSPDynamicPage{ + + private List witnessList; + private List unknownList; + private Integer startPage; + private Boolean imageFullscreen; + private Long witnessId; + + @Override + public void load(Long witnessId){ + + this.witnessId = witnessId; + + witnessList = new ArrayList(); + unknownList = new ArrayList(); + + // Load codex for this witness + List codex0 = getWrapper().getTargetsForSourceRelation(witnessId, "is_part_of", "CODEX", 1); + Long codexId; + Entity codexent = (codex0.size() == 0) ? null : codex0.get(0); + codexId = codexent.getId(); + + super.load(codexId); + + //loading the digitalization object + List list0 = getWrapper().getSourcesForTargetRelation(codexId, "is_digitalization_of", "DIGITALIZATION", 1); + this.digi = (list0.size() == 0) ? null : list0.get(0); + + //loading the witnesses + list0 = getWrapper().getSourcesForTargetRelation(codexId, "is_part_of", "WITNESS", -1); + for(Entity witness : list0){ + WitnessTemplate tmp = new WitnessTemplate(witness, getWrapper(), true); + this.witnessList.add(tmp); + if(tmp.isUnknown()){ + this.unknownList.add(tmp); + } + } + Collections.sort(this.witnessList); + Collections.sort(this.unknownList); + } + + public void init(){ + this.startPage = 0; + this.imageFullscreen = false; + try { + + this.load(Long.parseLong(getRequest().getParameter("eid"))); + + try { + this.startPage = Integer.parseInt(getRequest().getParameter("startPage")); + this.imageFullscreen = + (getRequest().getParameter("imgFullscreen") != null) ? Boolean.parseBoolean(getRequest().getParameter("imgFullscreen")) : false; + } catch (Exception e) { + // TODO: handle exception + } + + } catch (Exception e) { + e.printStackTrace(); + } + } + + public Integer getStartPage() { + return startPage; + } + + public Boolean getImageFullscreen() { + return imageFullscreen; + } + + public List getWitnessList() { + return witnessList; + } + + public void setWitnessList(List witnessList) { + this.witnessList = witnessList; + } + + public Long getWitnessId(){ + return this.witnessId; + } + + + + public List getUnknownList() { + return unknownList; + } + + public void setUnknownList(List unknownList) { + this.unknownList = unknownList; + } + +} diff -r e07a1ae515b7 -r 17551d9f091f src/main/java/de/mpiwg/itgroup/ismi/servlets/jsonmethods/JSONGetTitleDetails.java --- a/src/main/java/de/mpiwg/itgroup/ismi/servlets/jsonmethods/JSONGetTitleDetails.java Tue Feb 24 10:09:31 2015 +0000 +++ b/src/main/java/de/mpiwg/itgroup/ismi/servlets/jsonmethods/JSONGetTitleDetails.java Mon Mar 23 12:43:55 2015 +0000 @@ -38,6 +38,7 @@ titleDetails.put("ov", template.ov); titleDetails.put("author", template.author); + titleDetails.put("authorId", template.authorId); titleDetails.put("category", template.category); titleDetails.put("createIn", template.createIn); titleDetails.put("creationDate", template.creationDate); @@ -67,8 +68,18 @@ missatts.put(missatt); } titleDetails.put("authorMisattribution", missatts); + + + + //references + JSONArray references = new JSONArray(); + for(String reference : template.referenceEndnoteIdList){ + references.put(reference); + } + titleDetails.put("references", references); - json.put("data", titleDetails); + json.put("data", titleDetails); + }catch (Exception e) { PrintWriter out = response.getWriter(); diff -r e07a1ae515b7 -r 17551d9f091f src/main/java/de/mpiwg/itgroup/ismi/utils/templates/TitleTemplate.java --- a/src/main/java/de/mpiwg/itgroup/ismi/utils/templates/TitleTemplate.java Tue Feb 24 10:09:31 2015 +0000 +++ b/src/main/java/de/mpiwg/itgroup/ismi/utils/templates/TitleTemplate.java Mon Mar 23 12:43:55 2015 +0000 @@ -35,6 +35,7 @@ //extra public List aliasList; public List authorMisattributionList; + public ListreferenceEndnoteIdList; public String personDedicatedTo; public String commentaryOnText; public String translationOfText; @@ -90,7 +91,7 @@ List list0 = om.getSourcesForTargetRelation(entity.getId(), "is_reference_of", "REFERENCE", -1); for(Entity ref : list0){ - this.refEntityList.add(om.getEntityContent(ref)); + this.refEntityList.add(om.getEntityContent(ref)); } list0 = om.getTargetsForSourceRelation(entity.getId(), "was_created_by", "PERSON", -1); @@ -136,6 +137,14 @@ } this.loadRefernces(); + + this.referenceEndnoteIdList = new ArrayList(); + for (ReferenceTemplate refTempl : this.getReferenceList()){ + this.referenceEndnoteIdList.add(refTempl.getEndnoteId()); + } + + + } diff -r e07a1ae515b7 -r 17551d9f091f src/main/resources/hibernate.cfg.xml --- a/src/main/resources/hibernate.cfg.xml Tue Feb 24 10:09:31 2015 +0000 +++ b/src/main/resources/hibernate.cfg.xml Mon Mar 23 12:43:55 2015 +0000 @@ -22,7 +22,8 @@ jdbc:mysql://localhost/openmind?characterEncoding=UTF-8 UTF-8 root - e1nste1n + + fB79DCsT87 @@ -306,9 +310,12 @@
+
+
+
Codex Information diff -r e07a1ae515b7 -r 17551d9f091f src/main/webapp/public/publicWitness.jsp --- a/src/main/webapp/public/publicWitness.jsp Tue Feb 24 10:09:31 2015 +0000 +++ b/src/main/webapp/public/publicWitness.jsp Mon Mar 23 12:43:55 2015 +0000 @@ -6,7 +6,7 @@ - Witness Details + Codex Details @@ -19,24 +19,22 @@ + - + + + + + + <%codexPage.init(); + if(!codexPage.isErrorLoading()){ + response.sendRedirect("../public/publicCodices.xhtml"); + }else{ + %> - - - - - - <%witnessPage.init(); - if(!witnessPage.isErrorLoading()){ - response.sendRedirect("../public/publicCodices.xhtml"); - }else{ - %> - - - <% } %> - <% if(witnessPage.isErrorLoading()) { %> - + <% if(codexPage.isErrorLoading()) { %> + +
-
-
- + + + - -
+ + + +

<%=codexPage.getDigiLabel()%>

+ + + Titles in this Codex -

<%=witnessPage.getDigiLabel()%>

- - Attributes +
+ + + + + + + + + + + + + + +
TitleFolios
+ + + + + + + + + + + + + + + +
+ + + +

Unknown titles in this Codex

+ + + + + +
+
+ + +
+
+ +
+
+ + Codex Information - - - - - - - - - - - - + + - + @@ -87,6 +87,21 @@ + + + + + + + + + + + +
Author - - - - - -
Title - - - - - -
@@ -249,9 +332,9 @@ - + - @@ -263,7 +346,7 @@
;"> +
- + @@ -274,8 +357,7 @@ - + <% } %> - diff -r e07a1ae515b7 -r 17551d9f091f src/main/webapp/public/templates/templateWitnessInformationBig.html --- a/src/main/webapp/public/templates/templateWitnessInformationBig.html Tue Feb 24 10:09:31 2015 +0000 +++ b/src/main/webapp/public/templates/templateWitnessInformationBig.html Mon Mar 23 12:43:55 2015 +0000 @@ -52,7 +52,7 @@
Readers [Studied by]Readers [Studied by]
Incipit +
Explicit +
Table of Contents +
Script