diff options
Diffstat (limited to 'src/main/webapp/jsp/signupload.jsp')
-rw-r--r-- | src/main/webapp/jsp/signupload.jsp | 174 |
1 files changed, 138 insertions, 36 deletions
diff --git a/src/main/webapp/jsp/signupload.jsp b/src/main/webapp/jsp/signupload.jsp index 3db3be5..287afb1 100644 --- a/src/main/webapp/jsp/signupload.jsp +++ b/src/main/webapp/jsp/signupload.jsp @@ -1,78 +1,180 @@ <%@ page import="at.knowcenter.wag.egov.egiz.web.FormFields" %>
<%@ page import="at.knowcenter.wag.egov.egiz.web.SessionAttributes" %>
<%@ page import="at.gv.egiz.pdfas.api.commons.Constants" %>
+<%@ page import="at.gv.egiz.pdfas.web.i18n.LanguageDecoratorMapper"%>
+<%@ page import="at.knowcenter.wag.egov.egiz.web.servlets.UpdateFormServlet"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<%@ include file="language.jsp" %>
+
<html>
<head>
- <title>PDF-Signaturen</title>
+ <%
+ boolean testMode = request.getContextPath().startsWith("/test-");
+ boolean forceTextualForMocca = true;
+ %>
+ <title>
+ <%
+ if (testMode) {
+ %>
+ <fmt:message key="test.common.title"/>
+ <% } else { %>
+ <fmt:message key="common.title"/>
+ <% } // end if %>
+ </title>
<% session.removeAttribute(SessionAttributes.SIGNED_PDF_DOCUMENT); %>
+ <script language="javascript" type="text/javascript">
+ <!--
+ function updateForm() {
+ var updateform = document.getElementById('updateform');
+ var submitform = document.getElementById('submitform');
+
+ updateform.<%= FormFields.FIELD_SIGNATURE_TYPE %>.value = submitform.<%= FormFields.FIELD_SIGNATURE_TYPE %>.value;
+ updateform.<%= FormFields.FIELD_MODE %>.value = submitform.<%= FormFields.FIELD_MODE %>.value;
+ updateform.<%= FormFields.FIELD_CONNECTOR %>.value = submitform.<%= FormFields.FIELD_CONNECTOR %>.value;
+ updateform.submit();
+ return(false);
+ }
+ function submitForm(preview) {
+ var submitform = document.getElementById('submitform');
+ if (!submitform.fileupload.value) {
+ if (preview) {
+ alert('<fmt:message key="signupload.documentnotselected.preview"/>');
+ } else {
+ alert('<fmt:message key="signupload.documentnotselected"/>');
+ }
+ return(false);
+ }
+ if (preview) {
+ submitform.<%= FormFields.FIELD_PREVIEW %>.value='true';
+ } else {
+ submitform.<%= FormFields.FIELD_PREVIEW %>.value='false';
+ }
+ return(true);
+ }
+ -->
+ </script>
+ <%
+ String device = (String) session.getAttribute(UpdateFormServlet.UPLOADFORM_SIGNATURE_DEVICE_KEY);
+ if (device == null) {
+ device = Constants.SIGNATURE_DEVICE_MOC;
+ session.setAttribute(UpdateFormServlet.UPLOADFORM_SIGNATURE_DEVICE_KEY, device);
+ }
+ String mode = (String) session.getAttribute(UpdateFormServlet.UPLOADFORM_SIGNATURE_MODE_KEY);
+ if (forceTextualForMocca && Constants.SIGNATURE_DEVICE_MOC.equals(device)) {
+ mode = FormFields.VALUE_MODE_TEXTUAL;
+ session.setAttribute(UpdateFormServlet.UPLOADFORM_SIGNATURE_MODE_KEY, mode);
+ }
+ if (mode == null) {
+ mode = FormFields.VALUE_MODE_TEXTUAL;
+ session.setAttribute(UpdateFormServlet.UPLOADFORM_SIGNATURE_MODE_KEY, mode);
+ }
+ String type = (String) session.getAttribute(UpdateFormServlet.UPLOADFORM_SIGNATURE_TYPE_KEY);
+ if (type == null) {
+ Locale locale = (Locale) session.getAttribute(LocaleParamFilter.LOCALE_SESSION_KEY);
+ if (locale == null) {
+ locale = request.getLocale();
+ }
+ type = Locale.GERMAN.getLanguage().equals(locale.getLanguage()) ? "SIGNATURBLOCK_DE" : "SIGNATURBLOCK_EN";
+ session.setAttribute(UpdateFormServlet.UPLOADFORM_SIGNATURE_TYPE_KEY, type);
+ }
+
+ %>
</head>
<body>
-<h1>PDF-Signaturen</h1>
-<h2>Dokument Signatur erstellen</h2>
-<div class="pdfasnote">Bitte wählen Sie die zu signierende PDF-Datei. Diese wird mit Ihrer Bürgerkarte signiert.</div>
-<form name="submitform"
+<h1>
+ <%
+ if (testMode) {
+ %>
+ <fmt:message key="test.common.title"/>
+ <% } else { %>
+ <fmt:message key="common.title"/>
+ <% } // end if %>
+</h1>
+<h2><fmt:message key="signupload.heading2"/></h2>
+<div class="pdfasnote"><fmt:message key="signupload.selectfilenote"/></div>
+<form name="updateform" id="updateform" method="post" action="<%= request.getContextPath() %>/UpdateForm">
+ <input type="hidden" name="<%= FormFields.FIELD_SIGNATURE_TYPE %>" value=""/>
+ <input type="hidden" name="<%= FormFields.FIELD_MODE %>" value=""/>
+ <input type="hidden" name="<%= FormFields.FIELD_CONNECTOR %>" value=""/>
+</form>
+<form name="submitform" id="submitform"
enctype="multipart/form-data"
accept-charset="UTF-8"
method="post"
action="<%= request.getContextPath() %>/Sign">
<table border="0" cellspacing="0" cellpadding="4" id="pdfasupperformtable">
<tr>
- <td nowrap="nowrap"><label>PDF Datei:</label></td>
- <td><input size="50" type="file" name="<%= FormFields.FIELD_UPLOAD %>" accept="application/pdf"/></td>
- </tr>
- <tr>
- <td nowrap="nowrap"><label>Signatur Typ:</label></td>
+ <td nowrap="nowrap"><label><fmt:message key="signupload.signaturetype"/>:</label></td>
<td>
- <select class="field" name="sig_type">
- <option value="SIGNATURBLOCK_DE" selected="selected">Standardsignatur Deutsch</option>
- <option value="SIGNATURBLOCK_EN" >Standardsignatur Englisch</option>
+ <select class="field" name="<%= FormFields.FIELD_SIGNATURE_TYPE %>" onchange="return updateForm();">
+ <option value="SIGNATURBLOCK_DE" <%= "SIGNATURBLOCK_DE".equals(type) ? "selected=\"selected\"" : "" %>><fmt:message key="signupload.signaturetype.signaturblock.de"/></option>
+ <option value="SIGNATURBLOCK_EN" <%= "SIGNATURBLOCK_EN".equals(type) ? "selected=\"selected\"" : "" %>><fmt:message key="signupload.signaturetype.signaturblock.en"/></option>
</select>
<!-- %= // FormFields.generateTypeSelectBox() % -->
</td>
</tr>
<tr>
- <td nowrap="nowrap"><label>Signatur Modus:</label></td>
+ <td nowrap="nowrap"><label><fmt:message key="signupload.signaturemode"/>:</label></td>
<td>
- <select name="<%= FormFields.FIELD_MODE %>">
- <option value="<%= FormFields.VALUE_MODE_BINARY %>">binär</option>
- <option value="<%= FormFields.VALUE_MODE_TEXTUAL %>" selected="selected">textuell</option>
- <!--
- <option value="<%= FormFields.VALUE_MODE_DETACHED %>">detached</option>
- -->
- </select>
+ <% if (forceTextualForMocca && Constants.SIGNATURE_DEVICE_MOC.equals(device)) {%>
+ <fmt:message key="common.textual"/>
+ <input type="hidden" name="<%= FormFields.FIELD_MODE %>" value="<%= FormFields.VALUE_MODE_TEXTUAL %>"/>
+ <% } else { %>
+ <select name="<%= FormFields.FIELD_MODE %>" onchange="return updateForm();">
+ <option value="<%= FormFields.VALUE_MODE_BINARY %>" <%= FormFields.VALUE_MODE_BINARY.equals(mode) ? "selected=\"selected\"" : "" %>><fmt:message key="common.binary"/></option>
+ <option value="<%= FormFields.VALUE_MODE_TEXTUAL %>" <%= FormFields.VALUE_MODE_TEXTUAL.equals(mode) ? "selected=\"selected\"" : "" %>><fmt:message key="common.textual"/></option>
+ <!--
+ <option value="<%= FormFields.VALUE_MODE_DETACHED %>">detached</option>
+ -->
+ </select>
+ <% } %>
</td>
</tr>
<tr>
- <td nowrap="nowrap"><label>Signaturgerät:</label></td>
+ <td nowrap="nowrap"><label><fmt:message key="signupload.signaturedevice"/>:</label></td>
<td>
- <select name="connector">
- <option value="<%= Constants.SIGNATURE_DEVICE_BKU %>">BKU</option>
- <option value="<%= Constants.SIGNATURE_DEVICE_MOC %>" selected="selected">MOCCA</option>
+ <select name="<%= FormFields.FIELD_CONNECTOR %>" onchange="return updateForm();">
+ <option value="<%= Constants.SIGNATURE_DEVICE_BKU %>" <%= Constants.SIGNATURE_DEVICE_BKU.equals(device) ? "selected=\"selected\"" : "" %>><fmt:message key="common.bku"/></option>
+ <option value="<%= Constants.SIGNATURE_DEVICE_MOC %>" <%= Constants.SIGNATURE_DEVICE_MOC.equals(device) ? "selected=\"selected\"" : "" %>><fmt:message key="common.mocca"/></option>
</select>
</td>
</tr>
+ <tr>
+ <td nowrap="nowrap"><label><fmt:message key="signupload.file"/>:</label></td>
+ <td><input size="50" type="file" id="fileupload" name="<%= FormFields.FIELD_UPLOAD %>" accept="application/pdf"/></td>
+ </tr>
</table>
- <div class="pdfasnote"><span class="pdfasemphasis">Bitte beachten Sie:</span> Im textuellen Modus signierte Dokumente können nur dann geprüft werden, wenn das Zertifikat in einem Verzeichnisdienst verfügbar ist.</div>
+ <div class="pdfasnote"><span class="pdfasemphasis"><fmt:message key="signupload.note.prefix"/>:</span> <fmt:message key="signupload.note"/></div>
<input type="hidden" name="<%= FormFields.FIELD_DOWNLOAD %>" value="<%= FormFields.VALUE_DOWNLOAD_ATTACHMENT %>"/>
<input type="hidden" name="<%= FormFields.FIELD_PREVIEW %>" value="false" />
<div class="pdfasverticalspace"></div>
- <jsp:include page="SIGNATURBLOCK_DE.jsp"/>
+ <jsp:include page="SIGNATURBLOCK.jsp"/>
- <div class="pdfasnote">Das Erscheinungsbild der Signaturmarke kann abhängig vom Signatur Typ, vom Signatur Modus, von der verwendeten Bürgerkarte, sowie von der verwendeten Bürgerkartenumgebung variieren.</div>
- <div>
- <!-- =============================================== Start BKU-Erkennung -->
- <iframe src="<%= request.getContextPath() %>/bku-erkennung/bku-erkennung_iframe.html" width="152" height="57" id="sep_iframe" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" allowtransparency="true"></iframe>
- <!-- ================================================ Stop BKU-Erkennung -->
- </div>
- <input type="submit" value="Signatur erstellen" />
- <input type="submit" value="Vorschau" onclick="document.submitform.<%= FormFields.FIELD_PREVIEW %>.value='true'" />
+ <div class="pdfasnote"><fmt:message key="signupload.noteonsigmark"/></div>
+ <% if (Constants.SIGNATURE_DEVICE_BKU.equals(device)) { %>
+ <div>
+ <!-- =============================================== Start BKU-Erkennung -->
+ <iframe src="<%= request.getContextPath() %>/bku-erkennung/bku-erkennung_iframe.html" width="152" height="57" id="sep_iframe" scrolling="no" marginheight="0" marginwidth="0" frameborder="0" allowtransparency="true"></iframe>
+ <!-- ================================================ Stop BKU-Erkennung -->
+ </div>
+ <% } else if (Constants.SIGNATURE_DEVICE_MOC.equals(device)) { %>
+ <div>
+ <img src="images/chiperling.jpg" width="57" height="57" alt="<fmt:message key="common.mocca"/>"/>
+ </div>
+ <% } else { %>
+ <div class="pdfasverticalspace"></div>
+ <% } // end if %>
+ <div>
+ <input type="submit" value="<fmt:message key="signupload.button.sign"/>" onclick="return submitForm(false);"/>
+ <input type="submit" value="<fmt:message key="signupload.button.preview"/>" onclick="return submitForm(true);"/>
+ </div>
</form>
</body>
-</html>
\ No newline at end of file +</html>
|