Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
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 d597477d
authored
Dec 26, 2014
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jotain pientä, ehkä vaiktutaa johonkin, ehkä ei
1 parent
09d7c4c1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
12 deletions
code/moya-beans/ejbModule/fi/codecrew/moya/facade/PrintedCardFacade.java
code/moya-web/WebContent/info/incoming.xhtml
code/moya-web/src/main/java/fi/codecrew/moya/web/flow/IncomingView.java
code/moya-beans/ejbModule/fi/codecrew/moya/facade/PrintedCardFacade.java
View file @
d597477
...
@@ -116,7 +116,7 @@ public class PrintedCardFacade extends IntegerPkGenericFacade<PrintedCard> {
...
@@ -116,7 +116,7 @@ public class PrintedCardFacade extends IntegerPkGenericFacade<PrintedCard> {
CriteriaQuery
<
PrintedCard
>
cq
=
cb
.
createQuery
(
PrintedCard
.
class
);
CriteriaQuery
<
PrintedCard
>
cq
=
cb
.
createQuery
(
PrintedCard
.
class
);
Root
<
PrintedCard
>
root
=
cq
.
from
(
PrintedCard
.
class
);
Root
<
PrintedCard
>
root
=
cq
.
from
(
PrintedCard
.
class
);
List
<
Predicate
>
preds
=
new
ArrayList
<
Predicate
>();
List
<
Predicate
>
preds
=
new
ArrayList
<>();
preds
.
add
(
cb
.
equal
(
root
.
get
(
PrintedCard_
.
event
),
eventbean
.
getCurrentEvent
()));
preds
.
add
(
cb
.
equal
(
root
.
get
(
PrintedCard_
.
event
),
eventbean
.
getCurrentEvent
()));
...
...
code/moya-web/WebContent/info/incoming.xhtml
View file @
d597477
...
@@ -30,7 +30,6 @@
...
@@ -30,7 +30,6 @@
<h:form
id=
"attachform"
>
<h:form
id=
"attachform"
>
<p:poll
update=
"attachBarcode"
interval=
"2"
ignoreAutoUpdate=
"true"
onerror=
"location.reload();"
/>
<p:poll
update=
"attachBarcode"
interval=
"2"
ignoreAutoUpdate=
"true"
onerror=
"location.reload();"
/>
<h:panelGroup
id=
"attachBarcode"
>
<h:panelGroup
id=
"attachBarcode"
>
...
@@ -41,6 +40,7 @@
...
@@ -41,6 +40,7 @@
</script>
</script>
<h1>
#{i18n['incomingView.attachDialogTitle']}
</h1>
<h1>
#{i18n['incomingView.attachDialogTitle']}
</h1>
<!-- napin painaminen aiheuttaa aina NullPOinterExceptionin, mutta tekee siitä huolimatta tarvittavat asiat -->
<!-- napin painaminen aiheuttaa aina NullPOinterExceptionin, mutta tekee siitä huolimatta tarvittavat asiat -->
<!-- tarjoan oluen sille ketä ratkasee ton exceptionin -TKjne -->
<p:commandButton
styleClass=
"attachbuttonidclass"
value=
"#{i18n['incomingView.attach']}"
actionListener=
"#{incomingView.attachCodeToCard}"
update=
":cardcodeform :placelistform :imgCropperForm :cardsetform"
onerror=
"location.reload(true);"
/>
<p:commandButton
styleClass=
"attachbuttonidclass"
value=
"#{i18n['incomingView.attach']}"
actionListener=
"#{incomingView.attachCodeToCard}"
update=
":cardcodeform :placelistform :imgCropperForm :cardsetform"
onerror=
"location.reload(true);"
/>
<p:commandButton
value=
"#{i18n['incomingView.cancel']}"
actionListener=
"#{incomingView.hideAttachDialog}"
update=
":attachform:attachBarcode"
/>
<p:commandButton
value=
"#{i18n['incomingView.cancel']}"
actionListener=
"#{incomingView.hideAttachDialog}"
update=
":attachform:attachBarcode"
/>
</div>
</div>
...
@@ -167,7 +167,7 @@
...
@@ -167,7 +167,7 @@
<p:graphicImage
url=
"/dydata/usercard/#{userView.selectedUser.user.id}.png"
width=
"300"
/>
<p:graphicImage
url=
"/dydata/usercard/#{userView.selectedUser.user.id}.png"
width=
"300"
/>
<br
/>
<br
/>
<
h:commandButton
action=
"#{incomingView.printCard}
"
value=
"#{i18n['print']}"
/>
<
p:commandButton
actionListener=
"#{incomingView.printCard}"
update=
"cardsetform
"
value=
"#{i18n['print']}"
/>
<b>
<b>
(status:
<p:outputLabel
value=
"#{incomingView.printedStatus}"
/>
)
(status:
<p:outputLabel
value=
"#{incomingView.printedStatus}"
/>
)
<p:outputLabel
value=
"#{i18n['incomingflow.cardfiling.label']}"
rendered=
"#{!empty incomingView.cardFiling}"
/>
<p:outputLabel
value=
"#{i18n['incomingflow.cardfiling.label']}"
rendered=
"#{!empty incomingView.cardFiling}"
/>
...
...
code/moya-web/src/main/java/fi/codecrew/moya/web/flow/IncomingView.java
View file @
d597477
...
@@ -181,12 +181,12 @@ public class IncomingView extends GenericCDIView {
...
@@ -181,12 +181,12 @@ public class IncomingView extends GenericCDIView {
FacesContext
context
=
FacesContext
.
getCurrentInstance
();
FacesContext
context
=
FacesContext
.
getCurrentInstance
();
logger
.
debug
(
":got.code:"
);
//
logger.debug(":got.code:");
EventUser
user
=
event
.
getUser
();
EventUser
user
=
event
.
getUser
();
if
(
user
!=
null
)
{
if
(
user
!=
null
)
{
if
(!
user
.
equals
(
userview
.
getUser
()))
{
if
(!
user
.
equals
(
userview
.
getUser
()))
{
logger
.
info
(
"found user {}, redirecting"
,
user
.
getNick
());
//
logger.info("found user {}, redirecting", user.getNick());
userview
.
setUser
(
user
);
userview
.
setUser
(
user
);
// userview.prepareCardDownload();
// userview.prepareCardDownload();
...
@@ -273,24 +273,29 @@ public class IncomingView extends GenericCDIView {
...
@@ -273,24 +273,29 @@ public class IncomingView extends GenericCDIView {
*/
*/
public
String
getCardFiling
()
{
public
String
getCardFiling
()
{
String
ret
=
""
;
String
ret
=
""
;
try
{
//
try {
PrintedCard
card
=
cardBean
.
checkPrintedCard
(
userview
.
getSelectedUser
());
PrintedCard
card
=
cardBean
.
checkPrintedCard
(
userview
.
getSelectedUser
());
if
(
card
!=
null
)
{
if
(
card
!=
null
)
{
JsonObject
cardMeta
=
card
.
getMeta
();
JsonObject
cardMeta
=
card
.
getMeta
();
JsonObject
cardFilingObject
=
cardMeta
.
getJsonObject
(
"card-filing"
);
JsonObject
cardFilingObject
=
cardMeta
.
getJsonObject
(
"card-filing"
);
ret
=
cardFilingObject
.
getString
(
"cardplace"
);
if
(
cardFilingObject
!=
null
)
{
ret
=
cardFilingObject
.
getString
(
"cardplace"
);
}
}
}
}
catch
(
Exception
e
)
{
// Hmm, onkohan tää ihan tarkoituksenmukaista?
logger
.
warn
(
"Could not get card filing info"
,
e
);
// (mergerequestin tekijä vois arvioida)
}
// } catch (Exception e) {
// logger.warn("Could not get card filing info", e);
// }
return
ret
;
return
ret
;
}
}
public
String
printCard
()
{
public
void
printCard
()
{
PrintedCard
card
=
cardBean
.
checkPrintedCard
(
userview
.
getUser
());
PrintedCard
card
=
cardBean
.
checkPrintedCard
(
userview
.
getUser
());
card
.
setCardState
(
CardState
.
VALIDATED
);
card
.
setCardState
(
CardState
.
VALIDATED
);
cardBean
.
saveCard
(
card
);
cardBean
.
saveCard
(
card
);
return
null
;
}
}
public
ListDataModel
<
GroupMembership
>
getGroupMemberships
()
{
public
ListDataModel
<
GroupMembership
>
getGroupMemberships
()
{
...
...
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