sendImage.xhtml 2.8 KB
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:composite="http://java.sun.com/jsf/composite" xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
>
<composite:interface>
</composite:interface>

<composite:implementation>

	<h:outputScript target="head" library="script" name="jquery.min.js" />
	<h:outputScript target="head" library="jpegcam" name="webcam.js" />
	<h:outputScript target="head">
		webcam.set_api_url( '#{request.contextPath}/UploadServlet?type=userimage&amp;id=#{userView.selectedUser.id}' );
		webcam.set_hook('onComplete', 'my_completion_handler');
		
		webcam.set_swf_url('#{request.contextPath}/resources/jpegcam/Webcam.swf');
		webcam.set_shutter_sound(true,'#{request.contextPath}/resources/jpegcam/shutter.mp3');
		function my_completion_handler(msg) {
		//	alert("Completition handler executed" + msg);
		window.location.href=window.location.href;
		}
	</h:outputScript>

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

	<div id="webcamcontainer" style="display: none;"></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>
	<form
		onsubmit="window.open('', 'imagesubmitpopup', 'height=240,width=320'); this.target='imagesubmitpopup'; return true; "
		action="#{request.contextPath}/UploadServlet?type=userimage" enctype="multipart/form-data" method="post"
	>
		<input type="hidden" name="id" value="#{userView.user.id}" />
		<!-- 			<h:outputLabel value="#{i18n['imagefile.file']}" /> -->
		<input type="file" name="file" />
		<!--   <h:outputLabel value="#{i18n['imagefile.description']}"/><input type="text" name="description" />  -->
		<input type="submit" name="submit" value="#{i18n['user.imagesubmit']}" />
	</form>

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

	<h:outputText rendered="#{empty userView.user.currentImage}" value="#{i18n['user.noCurrentImage']}" />
	<h:panelGroup rendered="#{!empty userView.user.currentImage}">
		<img width="300" src="#{request.contextPath}/Userimage?imageid=#{userView.user.currentImage.id}" alt="image" />
	</h:panelGroup>

	


</composite:implementation>
</html>