sendPicture.xhtml
4.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!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:event type="preRenderView" listener="#{userView.prepareCardDownload}" />
</f:metadata>
<ui:define name="title">
<h1>#{i18n['sendPicture.header']}</h1>
<users:usertabs tabId="picture" />
</ui:define>
<ui:define name="content">
<h:outputScript library="primefaces" name="jquery/jquery.js" target="head" />
<h:form enctype="multipart/form-data">
<p:fileUpload value="#{userView.image}" mode="simple" required="true" />
<h:commandButton action="#{userView.sendImage}" value="#{i18n['user.imagesubmit']}" />
</h:form>
<h2>#{i18n['user.thisIsCurrentImage']}</h2>
<h:outputText rendered="#{empty userView.user.currentImage}" value="#{i18n['user.noCurrentImage']}" />
<ui:fragment rendered="#{!empty userView.user.currentImage}">
<h:panelGrid columns="2">
<img width="300" src="#{request.contextPath}/dydata/userimage/#{userView.user.currentImage.id}.jpg" alt="image" />
<ui:fragment rendered="#{userView.canManage()}">
<h:form>
<p:imageCropper value="#{userView.croppedImage}" aspectRatio="0.7317073170731707" image="/dydata/userimage/#{userView.user.currentImage.id}.jpg" />
<h:commandButton action="#{userView.crop}" value="#{i18n['user.cropImage']}" />
</h:form>
</ui:fragment>
</h:panelGrid>
<ui:fragment rendered="#{userView.canManage()}">
<h2>Ylläpito</h2>
<h:form>
<p:commandButton action="#{userView.prepareCardDownload()}" rendered="#{userView.waitForAcceptance==false}" value="print card" ajax="true" update="@form" onclick="PrimeFaces.monitorDownload(start, stop)">
<p:fileDownload value="#{userView.streamedFile}" />
</p:commandButton>
<p:commandButton action="#{userView.acceptPrintedCard()}" value="accept printed card" />
</h:form>
<!-- <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}&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:fragment>
</ui:define>
</ui:composition>
</h:body>
</html>