Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Max Mecklin
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5c87ae42
authored
Oct 24, 2013
by
Antti Tonkyra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
incoming flow
1 parent
807d5b31
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
7 deletions
code/MoyaWeb/WebContent/admin/incoming/index.xhtml
code/MoyaWeb/WebContent/admin/incoming/printCard.xhtml
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/reader/ReaderView.java
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/user/UserView.java
code/MoyaWeb/src/fi/codecrew/moya/web/flow/IncomingView.java
code/MoyaWeb/WebContent/admin/incoming/index.xhtml
View file @
5c87ae4
...
@@ -24,6 +24,9 @@
...
@@ -24,6 +24,9 @@
</f:metadata>
</f:metadata>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h:form>
<h:commandButton
action=
"#{incomingView.changeToIncomingView}"
value=
"#{i18n['incoming.changetoview']}"
/>
</h:form>
<br
/>
<br
/>
<br
/>
<br
/>
...
...
code/MoyaWeb/WebContent/admin/incoming/printCard.xhtml
View file @
5c87ae4
...
@@ -15,12 +15,8 @@
...
@@ -15,12 +15,8 @@
<h:form>
<h:form>
<p:poll
interval=
"1"
listener=
"#{incomingView.polledRead}"
/>
<p:poll
interval=
"1"
listener=
"#{incomingView.polledRead}"
/>
</h:form>
</h:form>
<h1>
#{i18n['incomingflow.userdetails']}
</h1>
<h1>
#{i18n['incomingflow.userdetails']}
(RFID-lukija: #{incomingView.readerId})
</h1>
<h:panelGrid
columns=
"3"
>
<h:panelGrid
columns=
"3"
>
<h:panelGroup>
<h:panelGroup>
<user:edit
commitaction=
"#{incomingView.saveUser()}"
commitvalue=
"#{i18n['user.save']}"
camAlwaysOn=
"true"
/>
<user:edit
commitaction=
"#{incomingView.saveUser()}"
commitvalue=
"#{i18n['user.save']}"
camAlwaysOn=
"true"
/>
</h:panelGroup>
</h:panelGroup>
...
@@ -35,7 +31,7 @@
...
@@ -35,7 +31,7 @@
<h:panelGroup>
<h:panelGroup>
<h:form>
<h:form>
<p:graphicImage
url=
"/dydata/usercard/#{userView.user.user.id}.png"
width=
"300"
/><br
/>
<p:graphicImage
url=
"/dydata/usercard/#{userView.user.user.id}.png"
width=
"300"
/><br
/>
<h:commandButton
action=
"#{incomingView.printCard}"
value=
"#{i18n['print']}"
/>
<h:commandButton
action=
"#{incomingView.printCard}"
value=
"#{i18n['print']}"
/>
(status: #{incomingView.printedStatus})
</h:form>
</h:form>
</h:panelGroup>
</h:panelGroup>
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/reader/ReaderView.java
View file @
5c87ae4
...
@@ -289,7 +289,7 @@ public class ReaderView extends GenericCDIView {
...
@@ -289,7 +289,7 @@ public class ReaderView extends GenericCDIView {
}
}
if
(
readerEventList
!=
null
&&
readerEventList
.
isRowAvailable
())
{
if
(
readerEventList
!=
null
&&
readerEventList
.
isRowAvailable
())
{
if
(
readerEventList
.
getRowData
().
getReader
().
getType
()
==
ReaderType
.
BARCODE
)
{
if
(
readerEventList
.
getRowData
().
getReader
().
getType
()
==
ReaderType
.
BARCODE
||
readerEventList
.
getRowData
().
getReader
().
getType
()
==
ReaderType
.
RFID
)
{
return
readerEventList
.
getRowData
().
getValue
();
return
readerEventList
.
getRowData
().
getValue
();
}
}
}
}
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/user/UserView.java
View file @
5c87ae4
...
@@ -38,6 +38,7 @@ import fi.codecrew.moya.model.Role;
...
@@ -38,6 +38,7 @@ import fi.codecrew.moya.model.Role;
import
fi.codecrew.moya.model.User
;
import
fi.codecrew.moya.model.User
;
import
fi.codecrew.moya.model.UserImage
;
import
fi.codecrew.moya.model.UserImage
;
import
fi.codecrew.moya.util.MassPrintResult
;
import
fi.codecrew.moya.util.MassPrintResult
;
import
fi.codecrew.moya.utilities.jsf.MessageHelper
;
import
fi.codecrew.moya.web.annotations.LoggedIn
;
import
fi.codecrew.moya.web.annotations.LoggedIn
;
import
fi.codecrew.moya.web.annotations.SelectedUser
;
import
fi.codecrew.moya.web.annotations.SelectedUser
;
import
fi.codecrew.moya.web.cdiview.GenericCDIView
;
import
fi.codecrew.moya.web.cdiview.GenericCDIView
;
...
@@ -357,6 +358,9 @@ public class UserView extends GenericCDIView {
...
@@ -357,6 +358,9 @@ public class UserView extends GenericCDIView {
card
.
setBarcode
(
readerView
.
getBarcode
());
card
.
setBarcode
(
readerView
.
getBarcode
());
card
.
setCardState
(
CardState
.
PRINTED
);
card
.
setCardState
(
CardState
.
PRINTED
);
//super.addFaceMessage("usercard.associated");
MessageHelper
.
info
(
"usercard.associated"
);
logger
.
debug
(
"barcode {} to card {} "
,
readerView
.
getBarcode
(),
card
.
getUser
().
getNick
());
logger
.
debug
(
"barcode {} to card {} "
,
readerView
.
getBarcode
(),
card
.
getUser
().
getNick
());
cardBean
.
saveCard
(
card
);
cardBean
.
saveCard
(
card
);
}
else
if
(
readerView
.
getReaderEvent
()
!=
null
)
{
}
else
if
(
readerView
.
getReaderEvent
()
!=
null
)
{
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/flow/IncomingView.java
View file @
5c87ae4
...
@@ -25,6 +25,7 @@ import fi.codecrew.moya.model.GroupMembership;
...
@@ -25,6 +25,7 @@ import fi.codecrew.moya.model.GroupMembership;
import
fi.codecrew.moya.model.PrintedCard
;
import
fi.codecrew.moya.model.PrintedCard
;
import
fi.codecrew.moya.util.UserSearchQuery
;
import
fi.codecrew.moya.util.UserSearchQuery
;
import
fi.codecrew.moya.utilities.SearchResult
;
import
fi.codecrew.moya.utilities.SearchResult
;
import
fi.codecrew.moya.utilities.jsf.MessageHelper
;
import
fi.codecrew.moya.web.annotations.SelectedUser
;
import
fi.codecrew.moya.web.annotations.SelectedUser
;
import
fi.codecrew.moya.web.cdiview.GenericCDIView
;
import
fi.codecrew.moya.web.cdiview.GenericCDIView
;
import
fi.codecrew.moya.web.cdiview.reader.ReaderNameContainer
;
import
fi.codecrew.moya.web.cdiview.reader.ReaderNameContainer
;
...
@@ -129,6 +130,10 @@ public class IncomingView extends GenericCDIView {
...
@@ -129,6 +130,10 @@ public class IncomingView extends GenericCDIView {
}
}
}
}
public
Integer
getReaderId
()
{
return
namecontainer
.
getReaderId
();
}
public
String
saveUser
()
{
public
String
saveUser
()
{
logger
.
info
(
"Saving user in incomingView"
);
logger
.
info
(
"Saving user in incomingView"
);
userview
.
saveUser
();
userview
.
saveUser
();
...
@@ -138,6 +143,11 @@ public class IncomingView extends GenericCDIView {
...
@@ -138,6 +143,11 @@ public class IncomingView extends GenericCDIView {
public
void
initializePoller
()
{
public
void
initializePoller
()
{
readerView
.
initializeForPolling
();
readerView
.
initializeForPolling
();
}
}
public
String
changeToIncomingView
()
{
//super.navihandler.redirectNavigation("printCard.jsf?userid="+user.getUser().getId());
return
"printCard.jsf?userid="
+
user
.
getUser
().
getId
();
}
public
void
polledRead
()
{
public
void
polledRead
()
{
...
@@ -184,6 +194,11 @@ public class IncomingView extends GenericCDIView {
...
@@ -184,6 +194,11 @@ public class IncomingView extends GenericCDIView {
return
"printCard"
;
return
"printCard"
;
}
}
public
CardState
getPrintedStatus
()
{
PrintedCard
card
=
cardBean
.
checkPrintedCard
(
user
);
return
card
.
getCardState
();
}
public
String
printCard
()
{
public
String
printCard
()
{
PrintedCard
card
=
cardBean
.
checkPrintedCard
(
user
);
PrintedCard
card
=
cardBean
.
checkPrintedCard
(
user
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment