view src/main/webapp/pages/createFile.jsp @ 105:16a0796e3871 default tip

remove "console.log" from general.js
author Calvin Yeh <cyeh@mpipw-berlin.mpg.com>
date Fri, 29 Sep 2017 16:18:02 +0200
parents b27a99201cbe
children
line wrap: on
line source

<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="de.mpiwg.gazetteer.db.DBSection"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<jsp:useBean id="sessionBean" class="de.mpiwg.web.jsp.SessionBean" scope="session" />

<html>

<head>

	<jsp:include page="../componentes/headContent.jsp"/>

	<script>
		$(function() {
			$("#sectionId").autocomplete({
				source : function(request, response) {
					$.ajax({
						url : "<%=sessionBean.getApplicationBean().getRootServer()%>/methods/sectionIdAutocomplete.jsp",
						type : "POST",
						dataType : "json",
						data : {
							term : request.term
						},
						success : function(data) {

							response($.map(data, function(item) {
								return {
									label : item.name,
									value : item.value,
								}
							}));
						},
						error : function(error) {
							alert('error: ' + error);
						}
					});
				},
				minLength : 0
			});
		});
	</script>


</head>

<body>

	<jsp:include page="../componentes/template2.jsp"/>

	<div id="page">

		<% if(sessionBean.getUser() == null) { %>
        <label class="subTitel">Please login or create a new account above</label>
		<% } else { %>

			<label class="subTitel">Create New File (Branch)</label>

			<form name="createFileForm"
				action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp"
				method="post"
				class="contentForm">
				<input name="bean" type="hidden" value="createFileBean" />

				<table style="width: 300px; margin-left: auto;margin-right: auto;">
					<tr>
						<td><label>Section Id</label></td>
						<td>
							<input
								id="sectionId"
								name="sectionId"
								type="text"
								class="searchInput"
								value="<%=(sessionBean.getCreateFilePage().getSectionId() == null) ? "" : sessionBean.getCreateFilePage().getSectionId()%>"
								style="width: 150px;" />
						</td>
						<td>
							<input type="submit" value="Load" onclick="setAction('loadSection', 'createFileForm');"/>
						</td>
					</tr>
				</table>

				<% if(sessionBean.getCreateFilePage().getSection() != null) { %>

					<table style="width: 300px; margin-left: auto;margin-right: auto;">
						<tr>
							<td><label>Section Name</label></td>
							<td><label><%= sessionBean.getCreateFilePage().getSection().getName() %></label></td>
						</tr>
						<tr>
							<td><label>Book Id</label></td>
							<td><label><%= sessionBean.getCreateFilePage().getSection().getBook().getId() %></label></td>
						</tr>
						<tr>
							<td><label>Book Name</label></td>
							<td><label><%= sessionBean.getCreateFilePage().getSection().getBook().getName() %></label></td>
						</tr>
						<tr>
							<td><label>Text</label></td>
							<td>
								<textarea rows=20" cols="70">
									<%=sessionBean.getCreateFilePage().getSection().getText() %>
								</textarea>

							</td>
						</tr>
						<tr>
							<td></td>
							<td>
								<input type="submit"
									value="Create"
							 		title="Create Branch in Extraction Interface"
									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() %>');"/>

								<input type="submit" value="Reset" onclick="setAction('reset', 'createFileForm');"/>
							</td>
						</tr>
					</table>


				<% } %>

			</form>
		<% } %>

	</div>

</body>