root/lex/trunk/jsp/published.jsp

Revision 394, 1.8 kB (checked in by chris, 3 years ago)

Fix problem with being unable to create an LS for clauses with no
predicate, e.g. Gen 3,5(f).

Reorganised jsp directory to separate includes and css from jsp pages.

Renamed lsedit.jsp to lexicon.jsp.

Added a controller for lexicon.jsp.

Moved tests into their own package.

Separated finished and unfinished tests to make it easier to run all the
finished and working ones.

Line 
1 <% String pageTitle = "Published Data"; %>
2
3 <%@ page import="java.util.*" %>
4 <%@ page import="com.qwirx.lex.Search" %>
5 <%@ page import="com.qwirx.lex.Search.SearchResult" %>
6 <%@ page import="com.qwirx.lex.hebrew.*" %>
7 <%@ page import="com.qwirx.lex.morph.*" %>
8 <%@ page import="com.qwirx.lex.translit.*" %>
9 <%@ page import="jemdros.*" %>
10 <%@ page import="org.aptivate.web.utils.EditField" %>
11
12 <%@ include file="include/setup.jsp" %>
13 <%@ include file="include/auth.jsp" %>
14 <%@ include file="include/header.jsp" %>
15
16 <%
17         EditField field = new EditField(request);
18         List<String> books = emdros.getEnumerationConstantNames("book_name_e");
19        
20         int maxResults = 100;
21        
22         try
23         {
24                 maxResults = Integer.parseInt(request.getParameter("max_results"));
25         }
26         catch (Exception e)
27         {
28                 // do nothing
29         }
30        
31         Search search = new Search(emdros, new DatabaseTransliterator(sql));
32         search.setMaxResults(maxResults);
33         List<SearchResult> results = search.advanced("published = 1");
34 %>
35
36 <h3>Published Clauses</h3>
37
38 <%
39         if (results.size() == 0)
40         {
41                 %><h4>No matches found</h4><%
42         }
43         else
44         {
45                 int numShown = search.getResultCount();
46                 %><h4>Displaying first <%= results.size() %> of
47                 <%= search.getResultCount() %> results.</h4><%
48                 %>
49                 <table class="search_results">
50                         <tr>
51                                 <th>Verb</th>
52                                 <th>Logical Structure</th>
53                                 <th>Reference</th>
54                         </tr>
55                 <%
56                
57                 for (Iterator<SearchResult> i = results.iterator(); i.hasNext();)
58                 {
59                         SearchResult result = i.next();
60                        
61                         %>
62                         <tr>
63                                 <td><%=
64                                         HebrewConverter.toHtml(result.getPredicate())
65                                 %></td>
66                                 <td><%=
67                                         HebrewConverter.toHtml(result.getLogicalStructure())
68                                 %></td>
69                                 <td><a href="<%=
70                                         EditField.escapeEntities(result.getLinkUrl())
71                                         %>"><%=
72                                         result.getLocation()
73                                 %></a></td>
74                         </tr>
75                         <%
76                 }
77                
78                 %>
79                 </table>
80                 <%
81         }
82 %>
83
84 <%@ include file="include/footer.jsp" %>
Note: See TracBrowser for help on using the browser.