Mercurial > hg > LGServices
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/webapp/pages/createFile.jsp Thu Apr 23 15:46:01 2015 +0200 @@ -0,0 +1,127 @@ +<%@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/template.jsp"/> + + <div id="page"> + + <% if(sessionBean.getUser() == null) { %> + <label>You must login!</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> \ No newline at end of file