comparison src/main/webapp/pages/createFile.jsp @ 0:3e62083dbcbf

First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
author "jurzua <jurzua@mpiwg-berlin.mpg.de>"
date Thu, 23 Apr 2015 15:46:01 +0200
parents
children b27a99201cbe
comparison
equal deleted inserted replaced
-1:000000000000 0:3e62083dbcbf
1 <%@page import="org.apache.commons.lang.StringUtils"%>
2 <%@page import="de.mpiwg.gazetteer.db.DBSection"%>
3 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
4
5 <jsp:useBean id="sessionBean" class="de.mpiwg.web.jsp.SessionBean" scope="session" />
6
7 <html>
8
9 <head>
10
11 <jsp:include page="../componentes/headContent.jsp"/>
12
13 <script>
14 $(function() {
15 $("#sectionId").autocomplete({
16 source : function(request, response) {
17 $.ajax({
18 url : "<%=sessionBean.getApplicationBean().getRootServer()%>/methods/sectionIdAutocomplete.jsp",
19 type : "POST",
20 dataType : "json",
21 data : {
22 term : request.term
23 },
24 success : function(data) {
25
26 response($.map(data, function(item) {
27 return {
28 label : item.name,
29 value : item.value,
30 }
31 }));
32 },
33 error : function(error) {
34 alert('error: ' + error);
35 }
36 });
37 },
38 minLength : 0
39 });
40 });
41 </script>
42
43
44 </head>
45
46 <body>
47
48 <jsp:include page="../componentes/template.jsp"/>
49
50 <div id="page">
51
52 <% if(sessionBean.getUser() == null) { %>
53 <label>You must login!</label>
54 <% } else { %>
55
56 <label class="subTitel">Create New File (Branch)</label>
57
58 <form name="createFileForm"
59 action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp"
60 method="post"
61 class="contentForm">
62 <input name="bean" type="hidden" value="createFileBean" />
63
64 <table style="width: 300px; margin-left: auto;margin-right: auto;">
65 <tr>
66 <td><label>Section Id</label></td>
67 <td>
68 <input
69 id="sectionId"
70 name="sectionId"
71 type="text"
72 class="searchInput"
73 value="<%=(sessionBean.getCreateFilePage().getSectionId() == null) ? "" : sessionBean.getCreateFilePage().getSectionId()%>"
74 style="width: 150px;" />
75 </td>
76 <td>
77 <input type="submit" value="Load" onclick="setAction('loadSection', 'createFileForm');"/>
78 </td>
79 </tr>
80 </table>
81
82 <% if(sessionBean.getCreateFilePage().getSection() != null) { %>
83
84 <table style="width: 300px; margin-left: auto;margin-right: auto;">
85 <tr>
86 <td><label>Section Name</label></td>
87 <td><label><%= sessionBean.getCreateFilePage().getSection().getName() %></label></td>
88 </tr>
89 <tr>
90 <td><label>Book Id</label></td>
91 <td><label><%= sessionBean.getCreateFilePage().getSection().getBook().getId() %></label></td>
92 </tr>
93 <tr>
94 <td><label>Book Name</label></td>
95 <td><label><%= sessionBean.getCreateFilePage().getSection().getBook().getName() %></label></td>
96 </tr>
97 <tr>
98 <td><label>Text</label></td>
99 <td>
100 <textarea rows=20" cols="70">
101 <%=sessionBean.getCreateFilePage().getSection().getText() %>
102 </textarea>
103
104 </td>
105 </tr>
106 <tr>
107 <td></td>
108 <td>
109 <input type="submit"
110 value="Create"
111 title="Create Branch in Extraction Interface"
112 onclick="sectionInExtractionInterface(<%=sessionBean.getCreateFilePage().getSectionId() %>, '<%=sessionBean.getCreateFilePage().getSection().getName()%>', <%=sessionBean.getCreateFilePage().getSection().getBook().getId() %>, '<%=sessionBean.getCreateFilePage().getSection().getBook().getName() %>', <%=sessionBean.getUser().getId() %>, '<%=sessionBean.getApplicationBean().getExtractionInterfaceUrl() %>');"/>
113
114 <input type="submit" value="Reset" onclick="setAction('reset', 'createFileForm');"/>
115 </td>
116 </tr>
117 </table>
118
119
120 <% } %>
121
122 </form>
123 <% } %>
124
125 </div>
126
127 </body>