changeset 16:0d0a3b757981

fixes for bibliographic reference display (by dwinter).
author casties
date Fri, 10 Apr 2015 15:49:50 +0000
parents 7f4e0e6d7a48
children dba143f9cb85
files src/main/java/de/mpiwg/itgroup/ismi/publicView/pages/CodexDynamicPage.java src/main/java/de/mpiwg/itgroup/ismi/servlets/jsonmethods/JSONGetWitnessDetails.java src/main/java/de/mpiwg/itgroup/ismi/utils/templates/WitnessTemplate.java src/main/webapp/public/publicCodex.jsp
diffstat 4 files changed, 44 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/itgroup/ismi/publicView/pages/CodexDynamicPage.java	Wed Apr 08 18:10:36 2015 +0000
+++ b/src/main/java/de/mpiwg/itgroup/ismi/publicView/pages/CodexDynamicPage.java	Fri Apr 10 15:49:50 2015 +0000
@@ -14,7 +14,8 @@
 	private List<WitnessTemplate> unknownList;
 	private Integer startPage;
 	private Boolean imageFullscreen;
-	
+        private List<String> references;
+
 	@Override
 	public void load(Long codexId){
 		super.load(codexId);
@@ -37,6 +38,16 @@
 		}
 		Collections.sort(this.witnessList);
 		Collections.sort(this.unknownList);
+
+
+		//load the references
+		this.references=new ArrayList<String>();
+
+		list0 = getWrapper().getSourcesForTargetRelation(codexId, "is_reference_of", "REFERENCE", 1);
+		for(Entity reference:list0){
+		    this.references.add(reference.getOwnValue());
+		}
+		
 	}
 	
 	public void init(){
@@ -82,5 +93,10 @@
 	public void setUnknownList(List<WitnessTemplate> unknownList) {
 		this.unknownList = unknownList;
 	}
+
+    public List<String> getReferenceList(){
+	return references;
+
+    }
 	
 }
--- a/src/main/java/de/mpiwg/itgroup/ismi/servlets/jsonmethods/JSONGetWitnessDetails.java	Wed Apr 08 18:10:36 2015 +0000
+++ b/src/main/java/de/mpiwg/itgroup/ismi/servlets/jsonmethods/JSONGetWitnessDetails.java	Fri Apr 10 15:49:50 2015 +0000
@@ -79,6 +79,12 @@
 			witnessDetails.put("authorName", template.authorName);
 			witnessDetails.put("authorNameTranslit", template.authorNameTranslit);
 			
+			//references
+			JSONArray references = new JSONArray();
+			for(String reference : template.referenceEndnoteIdList){
+				references.put(reference);
+			}
+			witnessDetails.put("references", references);
 			
 			
 			JSONArray array = new JSONArray();
@@ -102,4 +108,4 @@
 		out.print(json.toString());
 		
 	}
-}
\ No newline at end of file
+}
--- a/src/main/java/de/mpiwg/itgroup/ismi/utils/templates/WitnessTemplate.java	Wed Apr 08 18:10:36 2015 +0000
+++ b/src/main/java/de/mpiwg/itgroup/ismi/utils/templates/WitnessTemplate.java	Fri Apr 10 15:49:50 2015 +0000
@@ -52,7 +52,7 @@
 	public String explicit;
 	public String subject;
 
-	// public List<String> referenceList;
+	public List<String> referenceList;
 	public Map<String, String> ownedByMap;
 	public Map<String, String> readByMap;
 	
@@ -61,7 +61,7 @@
 	public String authorAsWrittenInWitness;
 	public String copyist;
 	public String placeOfCopying;
-	
+        public List<String>referenceEndnoteIdList;
 	public String page_dimensions;
 	public String written_area_dimensions;
 	public String lines_per_page;
@@ -270,6 +270,11 @@
 			}
 
 			this.loadRefernces();
+		       	this.referenceEndnoteIdList = new ArrayList();
+			for  (ReferenceTemplate refTempl : this.getReferenceList()){
+			    this.referenceEndnoteIdList.add(refTempl.getEndnoteId());
+		}
+
 		} catch (Exception e) {
 			logger.error(e.getMessage(), e);
 		}
--- a/src/main/webapp/public/publicCodex.jsp	Wed Apr 08 18:10:36 2015 +0000
+++ b/src/main/webapp/public/publicCodex.jsp	Fri Apr 10 15:49:50 2015 +0000
@@ -340,6 +340,19 @@
 											<td>
 										</tr>
 									</c:forEach>
+									<tr><td class="tdTitle">References</td><td></td><td><table class="tableContent">
+									<tbody>
+										<c:forEach var="ref" items="${codexPage.getReferenceList()}">
+										<tr>
+										<td  style="text-align">	<c:out value="${ref}"/>
+										</td>
+										</tr>
+
+										</c:forEach>
+									</tbody>
+									</table>
+
+									</td></tr>
 								</tbody>
 							</table>