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 1248fc3c
authored
Sep 01, 2013
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'devel' of codecrew.fi:bortal into devel
2 parents
dd908bdc
0815e5f8
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
70 additions
and
30 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/CardPrintBean.java
code/MoyaWeb/WebContent/index.xhtml
code/MoyaWeb/WebContent/orgrole/list.xhtml
code/MoyaWeb/WebContent/resources/templates/template1/template.xhtml
code/MoyaWeb/WebContent/tournaments/admin/createwizard.xhtml
code/MoyaWeb/WebContent/useradmin/edit.xhtml
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n.properties
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_en.properties
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_fi.properties
code/MoyaWeb/src/fi/codecrew/moya/servlet/FileDownloadServlet.java
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/organisation/EventPropertyView.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/CardPrintBean.java
View file @
1248fc3
...
@@ -234,6 +234,9 @@ public class CardPrintBean implements CardPrintBeanLocal {
...
@@ -234,6 +234,9 @@ public class CardPrintBean implements CardPrintBeanLocal {
@Override
@Override
public
byte
[]
constructPNG
(
PrintedCard
card
)
throws
Exception
{
public
byte
[]
constructPNG
(
PrintedCard
card
)
throws
Exception
{
if
(
card
==
null
)
{
return
null
;
}
card
=
printedCardFacade
.
reload
(
card
);
card
=
printedCardFacade
.
reload
(
card
);
// logger.info("Printing card tpl {} with template image {}",
// logger.info("Printing card tpl {} with template image {}",
...
...
code/MoyaWeb/WebContent/index.xhtml
View file @
1248fc3
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!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:ui=
"http://java.sun.com/jsf/facelets"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
>
<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"
>
<h:head>
<h:head>
<meta
http-equiv=
"refresh"
content=
"1;url=frontpage.jsf"
/>
<meta
http-equiv=
"refresh"
content=
"1;url=
#{request.contextPath}/
frontpage.jsf"
/>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
window
.
location
.
href
=
"frontpage.jsf"
window
.
location
.
href
=
"
#{request.contextPath}/
frontpage.jsf"
</script>
</script>
<title></title>
<title></title>
</h:head>
</h:head>
<h:body>
<h:body>
Redirecting to
<a
href=
"frontpage.jsf"
>
Frontpage
</a>
Redirecting to
<a
href=
"
#{request.contextPath}/
frontpage.jsf"
>
Frontpage
</a>
</h:body>
</h:body>
</html>
</html>
\ No newline at end of file
code/MoyaWeb/WebContent/orgrole/list.xhtml
View file @
1248fc3
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
<f:event
type=
"preRenderView"
listener=
"#{orgRoleView.permissionList()}"
/>
<f:event
type=
"preRenderView"
listener=
"#{orgRoleView.permissionList()}"
/>
</f:metadata>
</f:metadata>
<ui:define
name=
"title"
>
<ui:define
name=
"title"
>
<h1>
#{i18n['
foodwave.template.edi
t.title']}
</h1>
<h1>
#{i18n['
orgrole.lis
t.title']}
</h1>
</ui:define>
</ui:define>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<orgrole:list
/>
<orgrole:list
/>
...
...
code/MoyaWeb/WebContent/resources/templates/template1/template.xhtml
View file @
1248fc3
...
@@ -87,7 +87,8 @@
...
@@ -87,7 +87,8 @@
</div>
</div>
<ui:insert
name=
"title"
/>
<ui:insert
name=
"title"
/>
<p:messages
severity=
"info"
/>
<p:messages
severity=
"info"
/>
<h:messages
/>
<ui:insert
name=
"edittab"
/>
<!-- <h:messages /> -->
<ui:repeat
var=
"cont1"
value=
"#{menuView.getPagecontent('top')}"
>
<ui:repeat
var=
"cont1"
value=
"#{menuView.getPagecontent('top')}"
>
<h:outputText
value=
"#{cont1.content}"
escape=
"false"
/>
<h:outputText
value=
"#{cont1.content}"
escape=
"false"
/>
</ui:repeat>
</ui:repeat>
...
...
code/MoyaWeb/WebContent/tournaments/admin/createwizard.xhtml
View file @
1248fc3
...
@@ -80,6 +80,7 @@
...
@@ -80,6 +80,7 @@
<f:selectItems
value=
"#{tournamentCreateView.tournamentTypes}"
var=
"val"
itemLabel=
"#{val}"
/>
<f:selectItems
value=
"#{tournamentCreateView.tournamentTypes}"
var=
"val"
itemLabel=
"#{val}"
/>
</h:selectOneMenu>
</h:selectOneMenu>
<br
/>
<h:outputText
value=
"#{i18n['tournaments.players_per_match']}"
/>
<h:outputText
value=
"#{i18n['tournaments.players_per_match']}"
/>
<h:panelGrid
columns=
"1"
style=
"margin-bottom:10px"
>
<h:panelGrid
columns=
"1"
style=
"margin-bottom:10px"
>
<p:inputText
id=
"playerSlider"
value=
"#{tournamentCreateView.tournament.playersPerMatch}"
/>
<p:inputText
id=
"playerSlider"
value=
"#{tournamentCreateView.tournament.playersPerMatch}"
/>
...
...
code/MoyaWeb/WebContent/useradmin/edit.xhtml
View file @
1248fc3
...
@@ -13,6 +13,9 @@
...
@@ -13,6 +13,9 @@
<ui:define
name=
"title"
>
<ui:define
name=
"title"
>
<h1>
#{i18n['user.edit.title']}
</h1>
<h1>
#{i18n['user.edit.title']}
</h1>
<!-- <users:usertabs tabId="edit" /> -->
</ui:define>
<ui:define
name=
"edittab"
>
<users:usertabs
tabId=
"edit"
/>
<users:usertabs
tabId=
"edit"
/>
</ui:define>
</ui:define>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n.properties
View file @
1248fc3
...
@@ -81,6 +81,7 @@ bortalApplication.shop.SHOP_TO_OTHERS = Shop to other users
...
@@ -81,6 +81,7 @@ bortalApplication.shop.SHOP_TO_OTHERS = Shop to other users
bortalApplication.terminal.CASHIER
=
Access cashier terminal functions
bortalApplication.terminal.CASHIER
=
Access cashier terminal functions
bortalApplication.terminal.CUSTOMER
=
Access client terminal functions
bortalApplication.terminal.CUSTOMER
=
Access client terminal functions
bortalApplication.terminal.SELFHELP
=
Self help terminal
bortalApplication.terminal.SELFHELP
=
Self help terminal
bortalApplication.tournament.SINGLE_ELIMINATION
=
Single Elimination
bortalApplication.user
=
User permissions
bortalApplication.user
=
User permissions
bortalApplication.user.ANYUSER
=
All users have this anyways
bortalApplication.user.ANYUSER
=
All users have this anyways
bortalApplication.user.CREATE_NEW
=
Create new user
bortalApplication.user.CREATE_NEW
=
Create new user
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_en.properties
View file @
1248fc3
...
@@ -159,6 +159,7 @@ bortalApplication.shop.SHOP_TO_OTHERS = Shop to other users
...
@@ -159,6 +159,7 @@ bortalApplication.shop.SHOP_TO_OTHERS = Shop to other users
bortalApplication.terminal.CASHIER
=
Access cashier terminal functions
bortalApplication.terminal.CASHIER
=
Access cashier terminal functions
bortalApplication.terminal.CUSTOMER
=
Access client terminal functions
bortalApplication.terminal.CUSTOMER
=
Access client terminal functions
bortalApplication.terminal.SELFHELP
=
Self help terminal
bortalApplication.terminal.SELFHELP
=
Self help terminal
bortalApplication.tournament.SINGLE_ELIMINATION
=
Single Elimination
bortalApplication.user
=
User permissions
bortalApplication.user
=
User permissions
bortalApplication.user.ANYUSER
=
All users have this anyways
bortalApplication.user.ANYUSER
=
All users have this anyways
bortalApplication.user.CREATE_NEW
=
Create new user
bortalApplication.user.CREATE_NEW
=
Create new user
...
@@ -540,9 +541,10 @@ org.hibernate.validator.constraints.Length.message = length must be between {m
...
@@ -540,9 +541,10 @@ org.hibernate.validator.constraints.Length.message = length must be between {m
org.hibernate.validator.constraints.NotEmpty.message
=
may not be empty
org.hibernate.validator.constraints.NotEmpty.message
=
may not be empty
org.hibernate.validator.constraints.Range.message
=
must be between {min} and {max}
org.hibernate.validator.constraints.Range.message
=
must be between {min} and {max}
orgrole.create
=
Create
orgrole.create
=
Create
orgrole.name
=
Name
orgrole.list.title
=
Organization role list
orgrole.parents
=
Parent
orgrole.name
=
Name
orgrole.parents
=
Parent
page.account.edit.header
=
Edit account events
page.account.edit.header
=
Edit account events
page.account.list.header
=
Account events
page.account.list.header
=
Account events
...
@@ -982,6 +984,7 @@ topnavi.usermgmt = Users
...
@@ -982,6 +984,7 @@ topnavi.usermgmt = Users
topnavi.userplaces
=
Computer Places
topnavi.userplaces
=
Computer Places
topnavi.usershop
=
Shop
topnavi.usershop
=
Shop
tournament.admin.create
=
Create new tournament
tournament.create
=
Create tournament
tournament.create
=
Create tournament
tournament.edit
=
Edit tournament
tournament.edit
=
Edit tournament
tournament.game
=
Game
tournament.game
=
Game
...
@@ -993,10 +996,12 @@ tournament.type = Type
...
@@ -993,10 +996,12 @@ tournament.type = Type
tournaments.active_tournaments
=
Active tournaments
tournaments.active_tournaments
=
Active tournaments
tournaments.admin.begin_time_constraints
=
Tournament begin time
tournaments.admin.begin_time_constraints
=
Tournament begin time
tournaments.admin.create
=
Create tournament
tournaments.admin.create_a_game
=
Create a game
tournaments.admin.create_a_game
=
Create a game
tournaments.admin.create_new_ruleset
=
Create a new ruleset
tournaments.admin.create_new_ruleset
=
Create a new ruleset
tournaments.admin.create_tournament
=
Create a tournament
tournaments.admin.create_tournament
=
Create a tournament
tournaments.admin.description
=
Manage tournaments
tournaments.admin.description
=
Manage tournaments
tournaments.admin.edit
=
Edit tournament
tournaments.admin.game_description
=
Game description
tournaments.admin.game_description
=
Game description
tournaments.admin.game_name
=
Game name
tournaments.admin.game_name
=
Game name
tournaments.admin.registration_time_constraints
=
Registration time constraints
tournaments.admin.registration_time_constraints
=
Registration time constraints
...
@@ -1005,10 +1010,16 @@ tournaments.admin.select_a_game = Select a game
...
@@ -1005,10 +1010,16 @@ tournaments.admin.select_a_game = Select a game
tournaments.admin.select_a_ruleset
=
Select a ruleset
tournaments.admin.select_a_ruleset
=
Select a ruleset
tournaments.admin.set_time_constraints
=
Set time constraints
tournaments.admin.set_time_constraints
=
Set time constraints
tournaments.admin.title
=
Tournaments management
tournaments.admin.title
=
Tournaments management
tournaments.backup_players
=
Max backup players
tournaments.players_per_match
=
Max players per match
tournaments.registration_closes
=
Set registration closing time
tournaments.registration_closes
=
Set registration closing time
tournaments.registration_opens
=
Set registration opening time
tournaments.registration_opens
=
Set registration opening time
tournaments.ruleset_description
=
Ruleset description
tournaments.ruleset_description
=
Ruleset description
tournaments.ruleset_name
=
Ruleset name
tournaments.ruleset_name
=
Ruleset name
tournaments.ruleset_rules
=
Tournament ruleset
tournaments.tournament_details
=
Tournament details
tournaments.tournament_name
=
Tournament name
tournaments.tournament_type
=
Tournament type
user.accountBalance
=
Account balance
user.accountBalance
=
Account balance
user.accountEventHeader
=
Account events
user.accountEventHeader
=
Account events
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_fi.properties
View file @
1248fc3
...
@@ -160,6 +160,7 @@ bortalApplication.shop.SHOP_TO_OTHERS = Saa ostaa tuotteita muille
...
@@ -160,6 +160,7 @@ bortalApplication.shop.SHOP_TO_OTHERS = Saa ostaa tuotteita muille
bortalApplication.terminal.CASHIER
=
Muokata rahastusp
\u
00E4
\u
00E4tteiden toimintoja
bortalApplication.terminal.CASHIER
=
Muokata rahastusp
\u
00E4
\u
00E4tteiden toimintoja
bortalApplication.terminal.CUSTOMER
=
Muokata k
\u
00E4vij
\u
00E4p
\u
00E4
\u
00E4tteiden toimintoja
bortalApplication.terminal.CUSTOMER
=
Muokata k
\u
00E4vij
\u
00E4p
\u
00E4
\u
00E4tteiden toimintoja
bortalApplication.terminal.SELFHELP
=
Itsepalvelup
\u
00E4
\u
00E4te
bortalApplication.terminal.SELFHELP
=
Itsepalvelup
\u
00E4
\u
00E4te
bortalApplication.tournament.SINGLE_ELIMINATION
=
Single Elimination
bortalApplication.user
=
K
\u
00E4ytt
\u
00E4j
\u
00E4oikeudet
bortalApplication.user
=
K
\u
00E4ytt
\u
00E4j
\u
00E4oikeudet
bortalApplication.user.ANYUSER
=
AINA kaikilla k
\u
00E4ytt
\u
00E4jill
\u
00E4
bortalApplication.user.ANYUSER
=
AINA kaikilla k
\u
00E4ytt
\u
00E4jill
\u
00E4
bortalApplication.user.CREATE_NEW
=
Voi luoda uuden k
\u
00E4ytt
\u
00E4j
\u
00E4n
bortalApplication.user.CREATE_NEW
=
Voi luoda uuden k
\u
00E4ytt
\u
00E4j
\u
00E4n
...
@@ -549,9 +550,10 @@ org.hibernate.validator.constraints.Length.message = length must be between {m
...
@@ -549,9 +550,10 @@ org.hibernate.validator.constraints.Length.message = length must be between {m
org.hibernate.validator.constraints.NotEmpty.message
=
may not be empty
org.hibernate.validator.constraints.NotEmpty.message
=
may not be empty
org.hibernate.validator.constraints.Range.message
=
must be between {min} and {max}
org.hibernate.validator.constraints.Range.message
=
must be between {min} and {max}
orgrole.create
=
Luo
orgrole.create
=
Luo
orgrole.name
=
Nimi
orgrole.list.title
=
Lista organisaation rooleista
orgrole.parents
=
Periytyy
orgrole.name
=
Nimi
orgrole.parents
=
Periytyy
page.account.edit.header
=
Muokkaa tilitapahtumia
page.account.edit.header
=
Muokkaa tilitapahtumia
page.account.list.header
=
Tilitapahtumat
page.account.list.header
=
Tilitapahtumat
...
@@ -965,6 +967,7 @@ topnavi.usermgmt = K\u00E4ytt\u00E4j\u00E4t
...
@@ -965,6 +967,7 @@ topnavi.usermgmt = K\u00E4ytt\u00E4j\u00E4t
topnavi.userplaces
=
Konepaikat
topnavi.userplaces
=
Konepaikat
topnavi.usershop
=
Kauppa
topnavi.usershop
=
Kauppa
tournament.admin.create
=
Luo uusi turnaus
tournament.create
=
Luo turnaus
tournament.create
=
Luo turnaus
tournament.edit
=
Muokkaa turnausta
tournament.edit
=
Muokkaa turnausta
tournament.game
=
Peli
tournament.game
=
Peli
...
@@ -976,10 +979,12 @@ tournament.type = Tyyppi
...
@@ -976,10 +979,12 @@ tournament.type = Tyyppi
tournaments.active_tournaments
=
Aktiiviset turnaukset
tournaments.active_tournaments
=
Aktiiviset turnaukset
tournaments.admin.begin_time_constraints
=
Turnauksen aloitusaika
tournaments.admin.begin_time_constraints
=
Turnauksen aloitusaika
tournaments.admin.create
=
Luo turnaus
tournaments.admin.create_a_game
=
Luo peli
tournaments.admin.create_a_game
=
Luo peli
tournaments.admin.create_new_ruleset
=
Luo uusi s
\u
00E4
\u
00E4nn
\u
00F6st
\u
00F6
tournaments.admin.create_new_ruleset
=
Luo uusi s
\u
00E4
\u
00E4nn
\u
00F6st
\u
00F6
tournaments.admin.create_tournament
=
Luo turnaus
tournaments.admin.create_tournament
=
Luo turnaus
tournaments.admin.description
=
Hallinnoi turnauksia
tournaments.admin.description
=
Hallinnoi turnauksia
tournaments.admin.edit
=
Muokkaa turnausta
tournaments.admin.game_description
=
Pelin kuvaus
tournaments.admin.game_description
=
Pelin kuvaus
tournaments.admin.game_name
=
Pelin nimi
tournaments.admin.game_name
=
Pelin nimi
tournaments.admin.registration_time_constraints
=
Rekister
\u
00F6itymisaika
tournaments.admin.registration_time_constraints
=
Rekister
\u
00F6itymisaika
...
@@ -988,10 +993,16 @@ tournaments.admin.select_a_game = Valitse peli
...
@@ -988,10 +993,16 @@ tournaments.admin.select_a_game = Valitse peli
tournaments.admin.select_a_ruleset
=
Valitse s
\u
00E4
\u
00E4nn
\u
00F6st
\u
00F6
tournaments.admin.select_a_ruleset
=
Valitse s
\u
00E4
\u
00E4nn
\u
00F6st
\u
00F6
tournaments.admin.set_time_constraints
=
Aseta aikarajat
tournaments.admin.set_time_constraints
=
Aseta aikarajat
tournaments.admin.title
=
Turnauksien hallinnointi
tournaments.admin.title
=
Turnauksien hallinnointi
tournaments.backup_players
=
Maksimim
\u
00E4
\u
00E4r
\u
00E4 varapelaajia
tournaments.players_per_match
=
Maksimim
\u
00E4
\u
00E4r
\u
00E4 pelaajia matchissa
tournaments.registration_closes
=
Rekister
\u
00F6itymisen sulkeutumisaika
tournaments.registration_closes
=
Rekister
\u
00F6itymisen sulkeutumisaika
tournaments.registration_opens
=
Rekister
\u
00F6itymisen aukeamisaika
tournaments.registration_opens
=
Rekister
\u
00F6itymisen aukeamisaika
tournaments.ruleset_description
=
S
\u
00E4
\u
00E4nn
\u
00F6st
\u
00F6n kuvaus
tournaments.ruleset_description
=
S
\u
00E4
\u
00E4nn
\u
00F6st
\u
00F6n kuvaus
tournaments.ruleset_name
=
S
\u
00E4
\u
00E4nn
\u
00F6st
\u
00F6n nimi
tournaments.ruleset_name
=
S
\u
00E4
\u
00E4nn
\u
00F6st
\u
00F6n nimi
tournaments.ruleset_rules
=
Turnauksen s
\u
00E4
\u
00E4nn
\u
00F6t
tournaments.tournament_details
=
Turnauksen yksityiskohdat
tournaments.tournament_name
=
Turnauksen nimi
tournaments.tournament_type
=
Turnauksen tyyppi
user.accountBalance
=
Tilin saldo
user.accountBalance
=
Tilin saldo
user.accountEventHeader
=
Tilitapahtumat
user.accountEventHeader
=
Tilitapahtumat
...
...
code/MoyaWeb/src/fi/codecrew/moya/servlet/FileDownloadServlet.java
View file @
1248fc3
...
@@ -44,13 +44,12 @@ public class FileDownloadServlet extends GenericImageServlet {
...
@@ -44,13 +44,12 @@ public class FileDownloadServlet extends GenericImageServlet {
@EJB
@EJB
private
transient
UserBeanLocal
userbean
;
private
transient
UserBeanLocal
userbean
;
@EJB
@EJB
private
transient
CardTemplateBeanLocal
cardbean
;
private
transient
CardTemplateBeanLocal
cardbean
;
@EJB
@EJB
private
transient
CardPrintBeanLocal
cardprint
;
private
transient
CardPrintBeanLocal
cardprint
;
@EJB
@EJB
private
transient
PermissionBeanLocal
permbean
;
private
transient
PermissionBeanLocal
permbean
;
...
@@ -61,19 +60,13 @@ public class FileDownloadServlet extends GenericImageServlet {
...
@@ -61,19 +60,13 @@ public class FileDownloadServlet extends GenericImageServlet {
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FileDownloadServlet
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FileDownloadServlet
.
class
);
/**
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
* response)
*/
*/
private
static
final
Pattern
URLPATTERN
=
Pattern
.
compile
(
"([^./]+)"
);
private
static
final
Pattern
URLPATTERN
=
Pattern
.
compile
(
"([^./]+)"
);
/**
/**
* Usage MoyaWeb/dydata/format/
* Usage MoyaWeb/dydata/format/ possible formats logo userimage/<eventuserid>.jpg cardtemplate/<cardtemplateid>.png usercard/
* possible formats
* logo
* userimage/<eventuserid>.jpg
* cardtemplate/<cardtemplateid>.png
* usercard/
*/
*/
@Override
@Override
protected
ImageMover
getImagedata
()
{
protected
ImageMover
getImagedata
()
{
...
@@ -135,28 +128,25 @@ public class FileDownloadServlet extends GenericImageServlet {
...
@@ -135,28 +128,25 @@ public class FileDownloadServlet extends GenericImageServlet {
}
}
}
}
}
else
if
(
urlparts
.
get
(
0
).
equals
(
"usercard"
)
&&
urlparts
.
size
()
>
2
)
}
else
if
(
urlparts
.
get
(
0
).
equals
(
"usercard"
)
&&
urlparts
.
size
()
>
2
)
{
{
int
userid
=
Integer
.
parseInt
(
urlparts
.
get
(
1
));
int
userid
=
Integer
.
parseInt
(
urlparts
.
get
(
1
));
EventUser
usr
=
userbean
.
findByUserId
(
userid
);
EventUser
usr
=
userbean
.
findByUserId
(
userid
);
logger
.
info
(
"Trying to print usercard for user {}"
,
usr
);
logger
.
info
(
"Trying to print usercard for user {}"
,
usr
);
if
(
usr
!=
null
)
{
if
(
usr
!=
null
)
{
PrintedCard
card
=
cardbean
.
checkPrintedCard
(
usr
);
PrintedCard
card
=
cardbean
.
checkPrintedCard
(
usr
);
try
{
try
{
byte
[]
img
=
cardprint
.
constructPNG
(
card
);
byte
[]
img
=
cardprint
.
constructPNG
(
card
);
if
(
img
.
length
>
0
)
if
(
img
!=
null
&&
img
.
length
>
0
)
{
{
ret
.
setData
(
img
);
ret
.
setData
(
img
);
ret
.
setImagetype
(
"image/png"
);
ret
.
setImagetype
(
"image/png"
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
logger
.
warn
(
"Error generating image"
,
e
);
e
.
printStackTrace
();
}
}
}
}
}
}
if
(
ret
.
getImagetype
()
==
null
)
{
if
(
ret
.
getImagetype
()
==
null
)
{
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/organisation/EventPropertyView.java
View file @
1248fc3
package
fi
.
codecrew
.
moya
.
web
.
cdiview
.
organisation
;
package
fi
.
codecrew
.
moya
.
web
.
cdiview
.
organisation
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
...
@@ -136,6 +137,23 @@ public class EventPropertyView extends GenericCDIView {
...
@@ -136,6 +137,23 @@ public class EventPropertyView extends GenericCDIView {
if
(
property
.
getKey
().
isData
()
&&
file
!=
null
)
if
(
property
.
getKey
().
isData
()
&&
file
!=
null
)
{
{
logger
.
info
(
"saving data values type: {}, length {}"
,
file
.
getContentType
(),
file
.
getSize
());
logger
.
info
(
"saving data values type: {}, length {}"
,
file
.
getContentType
(),
file
.
getSize
());
byte
[]
contents
=
null
;
if
(
file
.
getContents
()
!=
null
)
{
contents
=
file
.
getContents
();
}
else
{
contents
=
new
byte
[(
int
)
file
.
getSize
()];
try
{
file
.
getInputstream
().
read
(
contents
);
}
catch
(
IOException
e
)
{
logger
.
warn
(
"Error reading file from stream"
,
e
);
contents
=
null
;
}
}
if
(
contents
==
null
)
{
super
.
addFaceMessage
(
"eventProperty.errorUploadingFile"
);
return
null
;
}
property
.
setByteValue
(
file
.
getContents
());
property
.
setByteValue
(
file
.
getContents
());
property
.
setByteMime
(
file
.
getContentType
());
property
.
setByteMime
(
file
.
getContentType
());
}
}
...
...
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