[sword-svn] r406 - trunk/webapp
scribe at crosswire.org
scribe at crosswire.org
Tue May 21 12:40:03 MST 2013
Author: scribe
Date: 2013-05-21 12:40:03 -0700 (Tue, 21 May 2013)
New Revision: 406
Added:
trunk/webapp/witnessgrid.jsp
Modified:
trunk/webapp/fetchdata.jsp
trunk/webapp/passagestudy.jsp
trunk/webapp/simplelookup.jsp
Log:
updated to include better Eusebian support, including in gadget viewer.
Added start of witness grid
Modified: trunk/webapp/fetchdata.jsp
===================================================================
--- trunk/webapp/fetchdata.jsp 2013-02-06 23:25:49 UTC (rev 405)
+++ trunk/webapp/fetchdata.jsp 2013-05-21 19:40:03 UTC (rev 406)
@@ -55,6 +55,7 @@
if (srcMod != null) {
book = mgr.getModuleByName(srcMod);
}
+//System.out.println("book:" + book+ ";key="+key+"activeKey:"+activeKey);
if ((key != null) && (book != null) && activeKey != null) {
try {
Integer.parseInt(key); // assert we have only an int and need to get our book and chapter from session
@@ -65,6 +66,7 @@
String vk[] = book.parseKeyList(activeKey);
activeKey=vk[0];
StringBuffer vmrResponse = HTTPUtils.postURL("http://ntvmr.uni-muenster.de/community/vmr/api/metadata/liste/search/", "biblicalContent="+activeKey+"&detail=page&limit=40");
+//System.out.println("**** response: " + vmrResponse);
XMLBlock manuscripts = new XMLBlock(vmrResponse.toString());
%>
<p><b>Some Manuscript Witnesses for <%=vk[0]%></b></p>
Modified: trunk/webapp/passagestudy.jsp
===================================================================
--- trunk/webapp/passagestudy.jsp 2013-02-06 23:25:49 UTC (rev 405)
+++ trunk/webapp/passagestudy.jsp 2013-05-21 19:40:03 UTC (rev 406)
@@ -1,4 +1,5 @@
<%@ page import="org.crosswire.xml.*" %>
+<%@ page import="org.crosswire.utils.HTTPUtils" %>
<%@ include file="init.jsp" %>
<%
@@ -69,6 +70,8 @@
%>
<tiles:insert beanName="basic" flush="true" >
+
+
<tiles:put name="title" value="Passage Bible study" />
<tiles:put name="pintro" type="string" ><div></div></tiles:put>
<tiles:put name="sidebar_left" type="string">
@@ -131,6 +134,7 @@
</div>
</tiles:put>
<tiles:put name="sidebar_right" type="string">
+<fb:like href="http://www.crosswire.org/study/passagestudy.jsp?key=<%=activeModule.getKeyChildren()[7]%>#cv" send="true" layout="button_count" width="171" show_faces="true"></fb:like>
<div class="promoLine"><%= promoLine %></div>
<div id="studytools">
<h2><t:t>Study Tools:</t:t></h2>
@@ -204,11 +208,21 @@
</div>
</tiles:put>
+<%
+ activeModule.setKeyText(activeKey);
+ activeKey = activeModule.getKeyText(); // be sure it is formatted nicely
+%>
+ <tiles:put name="extraMeta" type="string">
+ <meta property="og:title" content="<%=activeModule.getKeyText()%>"/>
+ <meta property="og:type" content="Bible verse"/>
+ <meta property="og:url" content="http://www.crosswire.org/study/passagestudy.jsp?key=<%=activeModule.getKeyChildren()[7]%>#cv"/>
+ <meta property="og:image" content="http://www.crosswire.org/images/pocketsword.gif"/>
+ <meta property="og:site_name" content="CrossWire Bible Society"/>
+ <meta property="fb:admins" content="scribe777"/>
+ <meta property="og:description"
+ content="<%=HTTPUtils.canonize(activeModule.getStripText().replace("[]", "").replace(" ", " ").replace(" ", " ").trim())%>"/>
+ </tiles:put>
<tiles:put name="content" type="string">
- <%
- activeModule.setKeyText(activeKey);
- activeKey = activeModule.getKeyText(); // be sure it is formatted nicely
- %>
<div id="passagestudy">
<h2><%= activeKey %></h2>
Modified: trunk/webapp/simplelookup.jsp
===================================================================
--- trunk/webapp/simplelookup.jsp 2013-02-06 23:25:49 UTC (rev 405)
+++ trunk/webapp/simplelookup.jsp 2013-05-21 19:40:03 UTC (rev 406)
@@ -2,6 +2,7 @@
language="java"
contentType="text/html;charset=utf-8"
%>
+<%@ page import="org.crosswire.xml.*" %>
<%@ page import="org.crosswire.sword.orb.*" %>
<%@ page import="java.net.URLEncoder" %>
<%@ page import="java.net.URL" %>
@@ -18,6 +19,8 @@
String activeModuleName = request.getParameter("mod");
if (activeModuleName == null) activeModuleName = "WHNU";
SWModule activeModule = mgr.getModuleByName(activeModuleName);
+ SWModule eusVs = mgr.getModuleByName("Eusebian_vs");
+ SWModule eusNum = mgr.getModuleByName("Eusebian_num");
String promoLine = activeModule.getConfigEntry("ShortPromo");
if (promoLine.equalsIgnoreCase("<swnull>")) {
@@ -50,12 +53,28 @@
String lang = activeModule.getConfigEntry("Lang");
boolean rtol = ("RtoL".equalsIgnoreCase(activeModule.getConfigEntry("Direction")));
+ String lastEusNum = "";
+ String myEusNum = "";
for (activeModule.setKeyText("="+chapterPrefix + ":0"); (activeModule.error() == (char)0); activeModule.next()) {
String keyText = activeModule.getKeyText();
String keyProps[] = activeModule.getKeyChildren();
// book and chapter intros
// TODO: change 'chapterPrefix' to use keyProps so we can support book intros (e.g. Jn.0.0)
boolean intro = (keyProps[2].equals("0") || keyProps[3].equals("0"));
+ if (eusVs != null) {
+ myEusNum = "";
+ if (!intro) {
+ eusVs.setKeyText(keyText);
+ myEusNum = eusVs.getStripText().trim();
+ if (!lastEusNum.equals(myEusNum)) {
+ lastEusNum = myEusNum;
+ eusNum.setKeyText(myEusNum);
+ XMLTag d = new XMLBlock(eusNum.getRawEntry());
+ myEusNum = myEusNum.substring(myEusNum.indexOf(".")+1) + "<br/>" + d.getAttribute("table");
+ }
+ else myEusNum = "";
+ }
+ }
if (first) {
%>
<table class="<%= lang %>">
@@ -76,7 +95,7 @@
String[] heads = activeModule.getEntryAttribute("Heading", "Preverse", "", true);
for (int h = 0; h < heads.length; ++h) {
%>
- <tr><td colspan="2"><div <%= rtol ? "dir=\"rtl\"" : "" %> class="<%= (keyText.equals(activeKey)) ? "currentverse" : "verse" %>">
+ <tr><td colspan="3"><div <%= rtol ? "dir=\"rtl\"" : "" %> class="<%= (keyText.equals(activeKey)) ? "currentverse" : "verse" %>">
<h3>
<%= heads[h] %>
</h3></div></td></tr>
@@ -88,13 +107,24 @@
<%
if (!rtol) {
%>
+ <td style="padding:0;margin:0" valign="top" align="center"><div <%= rtol ? "dir=\"rtl\"" : "" %>>
+<%
+ if (myEusNum.length() > 0) {
+%>
+ <span class="eusnum">
+ <a target="_blank" href="<%= baseURL %>/eusebian.jsp?mod=<%=activeModuleName%>&key=<%= URLEncoder.encode(keyText)+"#cv" %>"><%= myEusNum %></a>
+ </span>
+<%
+ }
+%>
+ </div></td>
<td valign="top" align="right"><div <%= rtol ? "dir=\"rtl\"" : "" %> class="<%= (keyText.equals(activeKey)) ? "currentverse" : "verse" %>">
<%
if (!intro) {
%>
<span class="versenum">
<a target="_blank" <%= (curVerse == anchorVerse)?"id=\"cv\"":"" %> href="<%= baseURL %>/passagestudy.jsp?key=<%= URLEncoder.encode(keyText)+"#cv" %>">
- <%= keyText.substring(keyText.indexOf(":")+1) %></a>
+ <%= keyProps[3] %></a>
</span>
<%
}
@@ -122,13 +152,25 @@
<%
if (!intro) {
%>
- <span class="versenum"><a <%= (curVerse == anchorVerse)?"id=\"cv\"":"" %> href="passagestudy.jsp?key=<%= URLEncoder.encode(keyText)+"#cv" %>">
- <%= keyText.substring(keyText.indexOf(":")+1) %></a>
+ <span class="versenum">
+ <a target="_blank" <%= (curVerse == anchorVerse)?"id=\"cv\"":"" %> href="<%= baseURL %>/passagestudy.jsp?key=<%= URLEncoder.encode(keyText)+"#cv" %>">
+ <%= keyProps[3] %></a>
</span>
<%
}
%>
</div></td>
+ <td style="padding:0;margin:0" valign="top" align="center"><div <%= rtol ? "dir=\"rtl\"" : "" %>>
+<%
+ if (myEusNum.length() > 0) {
+%>
+ <span class="eusnum">
+ <a target="_blank" href="<%= baseURL %>/eusebian.jsp?mod=<%=activeModuleName%>&key=<%= URLEncoder.encode(keyText)+"#cv" %>"><%= myEusNum %></a>
+ </span>
+<%
+ }
+%>
+ </div></td>
<%
}
%>
Added: trunk/webapp/witnessgrid.jsp
===================================================================
--- trunk/webapp/witnessgrid.jsp (rev 0)
+++ trunk/webapp/witnessgrid.jsp 2013-05-21 19:40:03 UTC (rev 406)
@@ -0,0 +1,111 @@
+<%@ page
+ language="java"
+ contentType="text/html;charset=utf-8"
+%>
+<%@ include file="init.jsp" %>
+
+<%@ page import="org.crosswire.utils.HTTPUtils" %>
+<%@ page import="org.crosswire.xml.XMLBlock" %>
+<%@ page import="org.crosswire.sword.keys.*" %>
+<%@ page import="org.crosswire.xml.*" %>
+<%@ page import="java.util.Arrays" %>
+
+<%
+%>
+<tiles:insert beanName="basic" flush="true" >
+ <tiles:put name="lookup_url" value="witnessgrid.jsp" />
+ <tiles:put name="title" value="New Testament Witnesses" />
+ <tiles:put name="pintro" type="string" ><div></div></tiles:put>
+ <tiles:put name="sidebar_left" type="string">
+ </tiles:put>
+ <tiles:put name="sidebar_right" type="string">
+ <h3>Date: <span id="contextValue">400</span>CE</h3>
+ <div style="height:400px; margin:0px 8px 0px 5px;" id="contextControl"></div>
+ </tiles:put>
+
+ <tiles:put name="content" type="string">
+<style>
+
+.verseNum a:link {
+ text-decoration: none;
+}
+
+.verseNum {
+ color:blue;
+ font-size: .75em;
+ line-height: 0.5em;
+ vertical-align: baseline;
+ position: relative;
+ top: -0.4em;
+}
+
+td {
+ vertical-align:top;
+ border: 1px solid grey;
+ padding: 5px;
+}
+</style>
+<div id="passagestudy">
+<div style="width:100%">
+</div>
+<div id="eusebianTable">
+<table style="margin:100px 10px 10px 10px; border-collapse:collapse;">
+<thead>
+<tr>
+<th></th>
+<%
+for (int i = 1; i < 35; ++i) {
+%>
+<th><%= i %></th>
+<%
+}
+%>
+</tr>
+</thead>
+<tbody>
+<%
+VerseKey vk = new VerseKey("Matt.1.1");
+while (vk.popError()==0) {
+%>
+<tr>
+<th><%=vk.getBookName()%></th>
+<%
+ for (int i = 0; i < vk.getChapterMax(); ++i) {
+/*
+ StringBuffer vmrResponse = HTTPUtils.postURL("http://ntvmr.uni-muenster.de/community/vmr/api/metadata/liste/search/", "biblicalContent="+vk.getBookName()+"."+vk.getChapter()+"&detail=page&limit=40");
+ XMLBlock manuscripts = new XMLBlock(vmrResponse.toString());
+ for (XMLBlock m : manuscripts.getBlocks("manuscript")) {
+ }
+*/
+%>
+<td></td>
+<%
+ }
+%>
+</tr>
+<%
+ vk.setBook(vk.getBook()+1);
+}
+%>
+</tr>
+</tbody>
+</table>
+</div>
+</div>
+<script type="text/javascript">
+
+ $(document).ready(function() {
+
+ $("#contextControl").slider({
+ orientation: 'vertical',
+ min: 0, max: 5,
+ change: function(event, ui) {
+ },
+ slide: function(event, ui) {
+ $('#contextValue').html(ui.value);
+ }
+ });
+ });
+</script>
+ </tiles:put>
+</tiles:insert>
More information about the sword-cvs
mailing list