sendPicture.xhtml 4.95 KB

<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:p="http://primefaces.org/ui" xmlns:users="http://java.sun.com/jsf/composite/cditools/user"
	xmlns:shop="http://java.sun.com/jsf/composite/cditools/shop">
<h:body>
	<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
		<ui:param name="thispage" value="page.user.create" />
		<f:metadata>
			<f:viewParam name="userid" value="#{userView.userid}" />
			<f:event type="preRenderView" listener="#{userView.initView}" />
		</f:metadata>
		<ui:define name="title">
			<h1>#{i18n['sendPicture.header']}</h1>
		</ui:define>
		<ui:define name="content">



			<button onclick="$('#webcamcontainer').show();$(this).hide();">#{i18n['userimage.webcam']}</button>

			<div id="webcamcontainer" style="display: none;">
				<h:form>
					<p:photoCam widgetVar="pc" listener="#{userView.oncapture}" update="@all" />
					<p:commandButton type="button" value="Capture" onclick="pc.capture()" />
				</h:form>
			</div>



			<p>Voit lisätä kuvan kävijälippuasi varten. Näin nopeutat asiointiasi tapahtumaan tullessasi.</p>
			<p>
				Kuvasta on pystyttävä tunnistamaan ongelmitta kortin omistaja. Tästä johtuen kuvan tulee olla selkeä, eikä kuvassa saa olla useita henkilöitä. Ohjeita hyvän tunnistekuvan ottamiseksi löytyy <a
					href="http://www.poliisi.fi/poliisi/home.nsf/files/Passikuvaohje_26-02-2008_FI/$file/Passikuvaohje_26-02-2008_FI.pdf">poliisin passikuvaohjeesta.</a>
			</p>



			<h:form enctype="multipart/form-data">
				<p:fileUpload id="uploadfile" required="TRUE" requiredMessage="Required!" invalidSizeMessage="#{i18n['user.imageTooBig']}" sizeLimit="1024" value="#{userView.image}" mode="simple" />
				<h:message for="uploadfile" />
				<h:commandButton action="#{userView.sendImage}" value="#{i18n['user.imagesubmit']}" />
			</h:form>
			<h2>asdasd</h2>
			<h:dataTable value="#{userView.user.userImageList}" var="img">
				<h:column>
					<h:outputText value="#{img.name}" />
				</h:column>
				<h:column>
					<h:outputText value="#{img.uploaded.time}">
						<f:convertDateTime pattern="#{sessionHandler.datetimeFormat}" timeZone="#{sessionHandler.timezone}" />
					</h:outputText>
				</h:column>
				<h:column>
					<h:outputText value="#{(empty img.defaultImage) ? i18n['user.isNotDefaultImage'] : i18n['user.isDefaultImage']}" />
				</h:column>
			</h:dataTable>


			<h2>#{i18n['user.thisIsCurrentImage']}</h2>

			<h:outputText rendered="#{empty userView.user.currentImage}" value="#{i18n['user.noCurrentImage']}" />
			<ui:fragment rendered="#{!empty userView.user.currentImage}">
				<img width="300" src="#{request.contextPath}/dydata/userimage/#{userView.user.currentImage.id}.img" alt="image" />
				<div>
					<h:form>
						<p:imageCropper value="#{userView.croppedImage}" aspectRatio="0.8" image="/dydata/userimage/#{userView.user.currentImage.id}.img" />
						<h:commandButton action="#{userView.crop()}" value="#{i18n['user.cropImage']}" />
					</h:form>
				</div>
			</ui:fragment>





			<ui:fragment rendered="#{userView.canManage()}">
				<h2>Ylläpito</h2>
				<h:form>
					<h:commandButton action="#{userView.makeCard()}" value="#{i18n['user.makeCard']}" />
					<h:dataTable var="card" value="#{userCardView.printedCards}">
						<h:column>
							<h:outputText value="#{card.enabled}" />
						</h:column>
						<h:column>
							<h:outputText value="#{card.enabled}" />
						</h:column>

						<h:column>
							<a href="#{request.contextPath}/UserCard?cardid=#{card.id}">View Card</a>
							<a href="#{request.contextPath}/UserCard?cardid=#{card.id}&amp;download=1">Print Card</a>
						</h:column>
					</h:dataTable>

				</h:form>

				<h3>RFID</h3>
				<h:form rendered="#{empty readerNameContainer.readerId}">
					<h:dataTable border="1" id="reader" value="#{readerListDataView.readers}" var="rr">
						<h:column>
							<f:facet name="header">
								<h:outputText value="${i18n['reader.name']}" />
							</f:facet>
							<h:outputText value="#{rr}" />
						</h:column>
						<h:column>
							<h:commandButton action="#{readerListDataView.selectReader}" />
						</h:column>

					</h:dataTable>
				</h:form>
				<shop:readerevents rendered="#{!empty readerNameContainer.readerId}" />


			</ui:fragment>




			<!-- 				<h:dataTable var="image" value="#{userView.user.userImageList}"> -->
			<!-- 					<h:column> -->
			<!-- 						<h:outputText value="#{image.id}" /> -->
			<!-- 					</h:column> -->
			<!-- 					<h:column> -->
			<!-- 						<h:outputText value="#{image.name}" /> -->
			<!-- 					</h:column> -->
			<!-- 					<h:column> -->
			<!-- 						<h:outputText value="#{image.description}" /> -->
			<!-- 					</h:column> -->
			<!-- 				</h:dataTable> -->






		</ui:define>


	</ui:composition>
</h:body>
</html>