<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page errorPage="error.jsp" %>
<%@ page import="java.util.List" %>
<%@ page import="at.knowcenter.wag.egov.egiz.pdf.SignatureHolder" %>
<%@ page import="at.knowcenter.wag.egov.egiz.pdf.TextualSignatureHolder" %>
<%@ page import="at.knowcenter.wag.egov.egiz.web.FormFields" %>
<%@ page import="at.knowcenter.wag.egov.egiz.web.SessionAttributes" %>
<%@ page import="at.knowcenter.wag.egov.egiz.web.servlets.VerifyPreviewServlet" %>
<%@ page import="at.gv.egiz.pdfas.web.VerifySessionInformation" %>
<%@ page import="at.gv.egiz.pdfas.web.helper.SessionHelper"%>
<%
  String btlurl = (String)request.getAttribute("btlurl");

  VerifySessionInformation si = (VerifySessionInformation) SessionHelper.getSession(request);

  List signature_holders = si.signature_holders;
  Integer ver_wh = (Integer) request.getAttribute(FormFields.FIELD_VERIFY_WHICH);
  int verify_which = ver_wh.intValue();
  SignatureHolder signature_holder = (SignatureHolder) signature_holders.get(verify_which);

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>PDF-AS Amtssignaturen Vorschau</title>
<link rel="stylesheet" type="text/css" href="/pdf-as/css/styles.css" />

<script type="text/javascript">
  function initSigValues()
  {
<%= VerifyPreviewServlet.renderRequiredKeysJavaScript(signature_holder.getSignatureObject(), "") %>
  }
</script>

</head>

<body onload="initSigValues()">
<div class="maindiv">

<h1>PDF-AS Amtssignaturen</h1>

<div class="mainframe">
<div class="mainheadline">Vorschau: Dokument Pr&uuml;fen</div>

<form action="<%= response.encodeURL(request.getContextPath() + "/VerifyPreview") %>"
      name="submitform"
      enctype="multipart/form-data"
      accept-charset="UTF-8"
      method="post">
<div class="contentsdiv">


<input type="hidden" name="<%= FormFields.FIELD_VERIFY_WHICH %>" value="<%= verify_which %>" />

<div>Rekonstruktion der Signaturmarke:</div>
<textarea class="previewfield" cols="80" rows="14" name="<%= FormFields.FIELD_RAW_DOCUMENT_TEXT %>"><%= ((TextualSignatureHolder)signature_holder).getSignedText() %></textarea>

<%= VerifyPreviewServlet.renderRequiredKeys(signature_holder.getSignatureObject(), "", false) %>

<br />

<input type="hidden" name="verify" value="false" />

<input class="button" type="submit" value="Werte &uuml;bernehmen" />

<input class="button" type="submit" value="Werte &uuml;bernehmen und pr&uuml;fen" onclick="document.submitform.verify.value='true'" />

</div>
</form>

</div>

<a class="big" href="/pdf-as">zur&uuml;ck</a>
<a class="big" href="<%=btlurl%>">zur&uuml;ck zur Liste</a>

</div>
</body>

</html>