Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Riina Antikainen
/
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 0fa769dc
authored
Jun 06, 2013
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added print time setting in card state changing
1 parent
a4086d50
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/CardTemplateBean.java
code/MoyaWeb/src/fi/codecrew/moya/rest/pojo/PrintedCardRestPojo.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/CardTemplateBean.java
View file @
0fa769d
...
...
@@ -5,6 +5,7 @@ import java.io.ByteArrayInputStream;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.List
;
import
javax.annotation.security.DeclareRoles
;
...
...
@@ -32,6 +33,7 @@ import fi.codecrew.moya.model.LanEventPropertyKey;
import
fi.codecrew.moya.model.PrintedCard
;
import
fi.codecrew.moya.model.Role
;
import
fi.codecrew.moya.util.MailMessage
;
rew
.
moya
.
util
.
MailMessage
;
/**
* Session Bean implementation class CardTemplateBean
...
...
@@ -278,6 +280,7 @@ public class CardTemplateBean implements CardTemplateBeanLocal {
{
case
PRINTED:
card
.
setPrintCount
(
card
.
getPrintCount
()
+
1
);
card
.
setPrintTime
(
Calendar
.
getInstance
());
break
;
case
PRINTING_IN_PROGRESS:
if
(
card
.
getCardState
().
equals
(
CardState
.
PRINTING_IN_PROGRESS
)
...
...
code/MoyaWeb/src/fi/codecrew/moya/rest/pojo/PrintedCardRestPojo.java
View file @
0fa769d
package
fi
.
codecrew
.
moya
.
rest
.
pojo
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
javax.xml.bind.annotation.XmlElement
;
...
...
@@ -55,6 +56,15 @@ public class PrintedCardRestPojo {
return
card
.
getCardState
().
toString
();
}
@XmlElement
(
name
=
"printTime"
)
public
Date
getPrintTime
()
{
Date
ret
=
null
;
if
(
card
.
getPrintTime
()
!=
null
)
ret
=
card
.
getPrintTime
().
getTime
();
return
ret
;
}
public
static
CardRoot
parseCards
(
List
<
PrintedCard
>
cards
)
{
ArrayList
<
PrintedCardRestPojo
>
ret
=
new
ArrayList
<
PrintedCardRestPojo
>();
...
...
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