sendImage.xhtml 2.39 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" xmlns:tools="http://java.sun.com/jsf/composite/tools">
<composite:interface>
</composite:interface>

<composite:implementation>
	<a href="#{request.contextPath}/flash/Uploader.swf" onclick="var newwin = window.open('#{request.contextPath}/flash/Uploader.swf?userid=#{userView.user.id}', 'imagesubmitpopup', 'height=480,width=640'); this.target='imagesubmitpopup'; newwin.focus(); return false; " target="_blank">#{i18n['userimage.webcam']}</a>
	<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">
	<p><input type="hidden" name="id" value="#{userView.user.id}" /> Voit lisätä kuvan kävijälippuasi varten. Näin
	nopeutat asiointiasi tapahtumaan tullessasi.</p>
	<h:panelGrid columns="2">
		<h:outputLabel value="#{i18n['imagefile.file']}" />
		<input type="file" name="file" />
		<!--   <h:outputLabel value="#{i18n['imagefile.description']}"/><input type="text" name="description" />  -->
		<h:panelGroup>
			<input type="submit" name="submit" value="#{i18n['user.imagesubmit']}" />
		</h:panelGroup>
	</h:panelGrid></form>

	<h2>#{i18n['user.thisIsCurrentImage']}</h2>
<h:form>
			<h:commandButton action="#{userView.reloadUser()}" value="Päivitä kuva" />
		</h:form>
	<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>

	<tools:canWrite rendered="#{!empty userView.user.currentImage}" target="USER_MANAGEMENT">
		<div><h:outputText value="Mime: #{userView.user.currentImage.mimeType}" /> <h:form id="imageconvert">
			<h:commandButton action="#{userView.recheckImagetype()}" value="Check imagetype" />
		</h:form></div>


	</tools:canWrite>

</composite:implementation>
</html>