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 35b9f5df
authored
Dec 28, 2012
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'devel' of codecrew.fi:bortal into devel
2 parents
fc1bbff6
9add6114
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
230 additions
and
71 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/BarcodeBean.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/CardPrintBean.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/CardTemplateBean.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/ReaderBean.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/VotingBean.java
code/MoyaBeansClient/ejbModule/fi/codecrew/moya/beans/BarcodeBeanLocal.java
code/MoyaBeansClient/ejbModule/fi/codecrew/moya/beans/ReaderBeanLocal.java
code/MoyaDatabase/src/fi/codecrew/moya/model/CompoEntry.java
code/MoyaWeb/WebContent/admin/adduser/update.xhtml
code/MoyaWeb/WebContent/card/massprint.xhtml
code/MoyaWeb/WebContent/resources/cditools/shop/readerevents.xhtml
code/MoyaWeb/WebContent/shop/createReader.xhtml
code/MoyaWeb/WebContent/useradmin/userCartShow.xhtml
code/MoyaWeb/WebContent/voting/submitEntry.xhtml
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_fi.properties
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/card/CardMassPrintView.java
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/shop/BarcodeView.java
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/shop/ReaderView.java
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/voting/CompoView.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/BarcodeBean.java
0 → 100644
View file @
35b9f5d
package
fi
.
codecrew
.
moya
.
beans
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
javax.ejb.LocalBean
;
import
javax.ejb.Stateless
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
fi.codecrew.moya.model.PrintedCard
;
import
fi.codecrew.moya.utilities.BarcodeUtils
;
/**
* Session Bean implementation class BarcodeBean
*/
@Stateless
@LocalBean
public
class
BarcodeBean
implements
BarcodeBeanLocal
{
private
static
final
String
PRINTED_CARD_PREFIX
=
"200"
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
BarcodeBean
.
class
);
/**
* Default constructor.
*/
public
BarcodeBean
()
{
// TODO Auto-generated constructor stub
}
public
InputStream
getCardBarcode
(
PrintedCard
printedCard
)
throws
IOException
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
PRINTED_CARD_PREFIX
);
String
idStr
=
printedCard
.
getId
().
toString
();
for
(
int
i
=
12
-
idStr
.
length
()
-
sb
.
length
();
i
>
0
;
--
i
)
{
sb
.
append
(
"0"
);
}
sb
.
append
(
idStr
);
String
barcode
=
sb
.
toString
();
logger
.
debug
(
"Geneating barcode for card {} : {}"
,
printedCard
,
barcode
);
return
BarcodeUtils
.
getBarcodeEAN
(
barcode
);
}
}
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/CardPrintBean.java
View file @
35b9f5d
...
@@ -22,12 +22,10 @@ import com.pdfjet.TextLine;
...
@@ -22,12 +22,10 @@ import com.pdfjet.TextLine;
import
fi.codecrew.moya.facade.CardTemplateFacade
;
import
fi.codecrew.moya.facade.CardTemplateFacade
;
import
fi.codecrew.moya.facade.EventUserFacade
;
import
fi.codecrew.moya.facade.EventUserFacade
;
import
fi.codecrew.moya.facade.UserFacade
;
import
fi.codecrew.moya.facade.UserFacade
;
import
fi.codecrew.moya.beans.CardPrintBeanLocal
;
import
fi.codecrew.moya.model.CardTemplate
;
import
fi.codecrew.moya.model.CardTemplate
;
import
fi.codecrew.moya.model.EventUser
;
import
fi.codecrew.moya.model.EventUser
;
import
fi.codecrew.moya.model.PrintedCard
;
import
fi.codecrew.moya.model.PrintedCard
;
import
fi.codecrew.moya.util.MassPrintResult
;
import
fi.codecrew.moya.util.MassPrintResult
;
import
fi.codecrew.moya.utilities.BarcodeUtils
;
/**
/**
* Session Bean implementation class CardPrintBean
* Session Bean implementation class CardPrintBean
...
@@ -46,6 +44,8 @@ public class CardPrintBean implements CardPrintBeanLocal {
...
@@ -46,6 +44,8 @@ public class CardPrintBean implements CardPrintBeanLocal {
private
CardTemplateFacade
cardTemplateFacade
;
private
CardTemplateFacade
cardTemplateFacade
;
@EJB
@EJB
private
UserFacade
userfacade
;
private
UserFacade
userfacade
;
@EJB
private
BarcodeBean
barcodeBean
;
/**
/**
* Default constructor.
* Default constructor.
...
@@ -111,13 +111,14 @@ public class CardPrintBean implements CardPrintBeanLocal {
...
@@ -111,13 +111,14 @@ public class CardPrintBean implements CardPrintBeanLocal {
cardTemplate
.
getImage
()));
cardTemplate
.
getImage
()));
BufferedImage
faceBufferedImage
=
ImageIO
BufferedImage
faceBufferedImage
=
ImageIO
.
read
(
new
ByteArrayInputStream
(
user
.
getCurrentImage
()
.
read
(
new
ByteArrayInputStream
(
user
.
getCurrentImage
().
getImageData
()));
.
getImageData
()));
/*
if
(
faceBufferedImage
.
getWidth
()
>
1024
||
faceBufferedImage
.
getHeight
()
>
1024
)
{
* if (faceBufferedImage.getWidth() > 1024 ||
throw
new
Exception
(
"Image dimensions too large, please take/upload smaller!"
);
* faceBufferedImage.getHeight() > 1024) { throw new
}
* Exception("Image dimensions too large, please take/upload smaller!"
* ); }
*/
int
originalWidth
=
faceBufferedImage
.
getWidth
();
int
originalWidth
=
faceBufferedImage
.
getWidth
();
int
originalHeight
=
faceBufferedImage
.
getHeight
();
int
originalHeight
=
faceBufferedImage
.
getHeight
();
...
@@ -184,14 +185,15 @@ public class CardPrintBean implements CardPrintBeanLocal {
...
@@ -184,14 +185,15 @@ public class CardPrintBean implements CardPrintBeanLocal {
roleTextLine
.
drawOn
(
page
);
roleTextLine
.
drawOn
(
page
);
// Barcode
// Barcode
String
barcodeString
=
String
.
valueOf
(
user
.
getUser
().
getCreated
()
// String barcodeString =
.
getTime
().
getTime
());
// String.valueOf(user.getUser().getCreated().getTime().getTime());
barcodeString
=
barcodeString
.
substring
(
barcodeString
.
length
()
-
12
);
BufferedImage
barCodeBufferedImage
=
ImageIO
.
read
(
BarcodeUtils
// barcodeString = barcodeString.substring(barcodeString.length() -
.
getBarcodeEAN
(
barcodeString
));
// 12);
Image
barCodeImage
=
new
Image
(
pdf
,
convertBufferedImageToPng
(
barCodeBufferedImage
),
ImageType
.
PNG
);
BufferedImage
barCodeBufferedImage
=
ImageIO
.
read
(
barcodeBean
.
getCardBarcode
(
printedCard
));
barCodeImage
.
setPosition
(
0.0
,
243.5
);
Image
barCodeImage
=
new
Image
(
pdf
,
convertBufferedImageToPng
(
barCodeBufferedImage
),
ImageType
.
PNG
);
barCodeImage
.
setPosition
(
0.0
,
230
);
// 243.5);
barCodeImage
.
scaleBy
(
0.7
);
barCodeImage
.
scaleBy
(
0.7
);
barCodeImage
.
drawOn
(
page
);
barCodeImage
.
drawOn
(
page
);
...
...
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/CardTemplateBean.java
View file @
35b9f5d
...
@@ -17,16 +17,12 @@ import javax.imageio.ImageIO;
...
@@ -17,16 +17,12 @@ import javax.imageio.ImageIO;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
fi.codecrew.moya.enums.apps.UserPermission
;
import
fi.codecrew.moya.facade.CardTemplateFacade
;
import
fi.codecrew.moya.facade.CardTemplateFacade
;
import
fi.codecrew.moya.facade.EventUserFacade
;
import
fi.codecrew.moya.facade.EventUserFacade
;
import
fi.codecrew.moya.facade.GroupMembershipFacade
;
import
fi.codecrew.moya.facade.GroupMembershipFacade
;
import
fi.codecrew.moya.facade.LanEventPropertyFacade
;
import
fi.codecrew.moya.facade.LanEventPropertyFacade
;
import
fi.codecrew.moya.facade.PrintedCardFacade
;
import
fi.codecrew.moya.facade.PrintedCardFacade
;
import
fi.codecrew.moya.beans.CardTemplateBeanLocal
;
import
fi.codecrew.moya.beans.EventBeanLocal
;
import
fi.codecrew.moya.beans.UserBeanLocal
;
import
fi.codecrew.moya.beans.UtilBeanLocal
;
import
fi.codecrew.moya.enums.apps.UserPermission
;
import
fi.codecrew.moya.model.CardTemplate
;
import
fi.codecrew.moya.model.CardTemplate
;
import
fi.codecrew.moya.model.EventUser
;
import
fi.codecrew.moya.model.EventUser
;
import
fi.codecrew.moya.model.LanEvent
;
import
fi.codecrew.moya.model.LanEvent
;
...
@@ -179,6 +175,8 @@ public class CardTemplateBean implements CardTemplateBeanLocal {
...
@@ -179,6 +175,8 @@ public class CardTemplateBean implements CardTemplateBeanLocal {
}
else
{
}
else
{
logger
.
info
(
"User {} has power {} and roles has power {}"
,
new
Object
[]
{
user
.
getUser
().
getLogin
(),
existingPower
,
newPower
});
logger
.
info
(
"User {} has power {} and roles has power {}"
,
new
Object
[]
{
user
.
getUser
().
getLogin
(),
existingPower
,
newPower
});
}
}
eventPropertyFacade
.
flush
();
return
biggestCard
;
return
biggestCard
;
}
}
...
...
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/ReaderBean.java
View file @
35b9f5d
...
@@ -15,10 +15,6 @@ import org.slf4j.LoggerFactory;
...
@@ -15,10 +15,6 @@ import org.slf4j.LoggerFactory;
import
fi.codecrew.moya.facade.PrintedCardFacade
;
import
fi.codecrew.moya.facade.PrintedCardFacade
;
import
fi.codecrew.moya.facade.ReaderEventFacade
;
import
fi.codecrew.moya.facade.ReaderEventFacade
;
import
fi.codecrew.moya.facade.ReaderFacade
;
import
fi.codecrew.moya.facade.ReaderFacade
;
import
fi.codecrew.moya.beans.CardTemplateBeanLocal
;
import
fi.codecrew.moya.beans.EventBeanLocal
;
import
fi.codecrew.moya.beans.ReaderBeanLocal
;
import
fi.codecrew.moya.beans.UserBeanLocal
;
import
fi.codecrew.moya.model.AccountEvent
;
import
fi.codecrew.moya.model.AccountEvent
;
import
fi.codecrew.moya.model.CardTemplate
;
import
fi.codecrew.moya.model.CardTemplate
;
import
fi.codecrew.moya.model.EventUser
;
import
fi.codecrew.moya.model.EventUser
;
...
@@ -260,4 +256,11 @@ public class ReaderBean implements ReaderBeanLocal {
...
@@ -260,4 +256,11 @@ public class ReaderBean implements ReaderBeanLocal {
}
}
return
readerfacade
.
merge
(
reader
);
return
readerfacade
.
merge
(
reader
);
}
}
@Override
public
void
createReader
(
Reader
reader
)
{
reader
.
setEvent
(
eventbean
.
getCurrentEvent
());
readerfacade
.
create
(
reader
);
}
}
}
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/VotingBean.java
View file @
35b9f5d
...
@@ -92,6 +92,10 @@ public class VotingBean implements VotingBeanLocal {
...
@@ -92,6 +92,10 @@ public class VotingBean implements VotingBeanLocal {
Compo
co
=
compoFacade
.
reload
(
entry
.
getCompo
());
Compo
co
=
compoFacade
.
reload
(
entry
.
getCompo
());
entry
.
setCreator
(
permissionBean
.
getCurrentUser
());
entry
.
setCreator
(
permissionBean
.
getCurrentUser
());
if
(
entry
.
getTitle
()
==
null
)
{
entry
.
setTitle
(
""
);
}
if
(
co
.
getCompoEntries
()
==
null
)
{
if
(
co
.
getCompoEntries
()
==
null
)
{
co
.
setCompoEntries
(
new
ArrayList
<
CompoEntry
>());
co
.
setCompoEntries
(
new
ArrayList
<
CompoEntry
>());
}
}
...
...
code/MoyaBeansClient/ejbModule/fi/codecrew/moya/beans/BarcodeBeanLocal.java
0 → 100644
View file @
35b9f5d
package
fi
.
codecrew
.
moya
.
beans
;
import
javax.ejb.Local
;
@Local
public
interface
BarcodeBeanLocal
{
}
code/MoyaBeansClient/ejbModule/fi/codecrew/moya/beans/ReaderBeanLocal.java
View file @
35b9f5d
...
@@ -35,4 +35,6 @@ public interface ReaderBeanLocal {
...
@@ -35,4 +35,6 @@ public interface ReaderBeanLocal {
Reader
saveReader
(
Reader
reader
);
Reader
saveReader
(
Reader
reader
);
void
createReader
(
Reader
reader
);
}
}
code/MoyaDatabase/src/fi/codecrew/moya/model/CompoEntry.java
View file @
35b9f5d
...
@@ -43,21 +43,21 @@ public class CompoEntry extends GenericEntity {
...
@@ -43,21 +43,21 @@ public class CompoEntry extends GenericEntity {
private
Calendar
created
=
Calendar
.
getInstance
();
private
Calendar
created
=
Calendar
.
getInstance
();
@Column
(
name
=
"title"
,
nullable
=
false
)
@Column
(
name
=
"title"
,
nullable
=
false
)
private
String
title
;
private
String
title
=
""
;
@Column
(
name
=
"author"
)
@Column
(
name
=
"author"
)
private
String
author
;
private
String
author
=
""
;
@Lob
@Lob
@Column
(
name
=
"notes"
)
@Column
(
name
=
"notes"
)
private
String
notes
;
private
String
notes
=
""
;
@Lob
@Lob
@Column
(
name
=
"screen_message"
)
@Column
(
name
=
"screen_message"
)
private
String
screenMessage
;
private
String
screenMessage
=
""
;
@Column
(
name
=
"sort"
)
@Column
(
name
=
"sort"
)
private
Integer
sort
;
private
Integer
sort
=
10
;
@Column
(
name
=
"final_position"
)
@Column
(
name
=
"final_position"
)
private
Integer
finalPosition
;
private
Integer
finalPosition
;
...
...
code/MoyaWeb/WebContent/admin/adduser/update.xhtml
View file @
35b9f5d
...
@@ -36,7 +36,9 @@
...
@@ -36,7 +36,9 @@
</h:panelGroup>
</h:panelGroup>
</h:panelGrid>
</h:panelGrid>
</div>
</div>
<div
style=
""
>
<h:link
style=
"margin: 0 auto; font-size: 3em;"
outcome=
"/admin/adduser/start"
value=
"Valmis"
/>
</div>
<script>
<script>
function
dophoto
(
pc
)
{
function
dophoto
(
pc
)
{
...
...
code/MoyaWeb/WebContent/card/massprint.xhtml
View file @
35b9f5d
...
@@ -14,13 +14,15 @@
...
@@ -14,13 +14,15 @@
<h1>
#{i18n['card.massprint.title']}
</h1>
<h1>
#{i18n['card.massprint.title']}
</h1>
</ui:define>
</ui:define>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<h:form
rendered=
"#{
cardMassPrintView.file!=null
}"
>
<h:form
rendered=
"#{
!empty cardMassPrintView.streamedFile
}"
>
<p:commandButton
id=
"downloadLink"
value=
"Download"
ajax=
"false"
onclick=
"PrimeFaces.monitorDownload(start, stop)"
icon=
"ui-icon-arrowthichk-s"
>
<p:commandButton
id=
"downloadLink"
value=
"Download"
ajax=
"false"
onclick=
"PrimeFaces.monitorDownload(start, stop)"
icon=
"ui-icon-arrowthichk-s"
>
<p:fileDownload
value=
"#{cardMassPrintView.streamedFile}"
/>
<p:fileDownload
value=
"#{cardMassPrintView.streamedFile}"
/>
</p:commandButton>
</p:commandButton>
<p:commandButton
value=
"Accept printout"
action=
"#{cardMassPrintView.acceptPrintout()}"
rendered=
"#{cardMassPrintView.waitForAcceptance}"
/>
<p:commandButton
value=
"Accept printout"
action=
"#{cardMassPrintView.acceptPrintout()}"
rendered=
"#{cardMassPrintView.waitForAcceptance}"
/>
</h:form>
</h:form>
<h:outputText
value=
"Error generating mass output!"
rendered=
"#{empty cardMassPrintView.streamedFile}"
/>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
</h:body>
</h:body>
...
...
code/MoyaWeb/WebContent/resources/cditools/shop/readerevents.xhtml
View file @
35b9f5d
...
@@ -10,7 +10,11 @@
...
@@ -10,7 +10,11 @@
<composite:implementation>
<composite:implementation>
<h:form>
<h:form>
<p:poll
interval=
"3"
/>
<p:poll
interval=
"3"
/>
<h:dataTable
border=
"1"
id=
"event"
value=
"#{readerView.readerEvents}"
var=
"event"
>
<h:dataTable
border=
"1"
id=
"event"
value=
"#{readerView.readerEvents}"
var=
"event"
>
<h:column>
<h:column>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
...
...
code/MoyaWeb/WebContent/shop/createReader.xhtml
0 → 100644
View file @
35b9f5d
<!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:shop=
"http://java.sun.com/jsf/composite/cditools/shop"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<f:metadata>
<f:event
type=
"preRenderView"
listener=
"#{readerView.initCreateReader}"
/>
</f:metadata>
<ui:define
name=
"content"
>
<h:form>
<h:panelGrid
columns=
"3"
>
<h:outputLabel
for=
"name"
value=
"#{i18n['reader.identification']}"
/>
<h:inputText
id=
"name"
value=
"#{readerView.reader.identification}"
/>
<h:message
for=
"name"
/>
<h:outputLabel
for=
"type"
value=
"#{i18n['reader.type']}"
/>
<h:selectOneMenu
value=
"#{readerView.reader.type}"
>
<f:selectItems
value=
"#{readerView.readerTypes}"
/>
</h:selectOneMenu>
</h:panelGrid>
<h:commandButton
action=
"#{readerView.createReader}"
value=
"#{i18n['reader.create']}"
/>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
code/MoyaWeb/WebContent/useradmin/userCartShow.xhtml
View file @
35b9f5d
...
@@ -6,7 +6,8 @@
...
@@ -6,7 +6,8 @@
<h:body>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<f:metadata>
<f:metadata>
<f:event
type=
"preRenderView"
listener=
"#{userCartView.initView}"
/>
<!-- f:event type="preRenderView" listener="#{userCartView.initView}" />
-->
</f:metadata>
</f:metadata>
<ui:define
name=
"title"
>
<ui:define
name=
"title"
>
...
...
code/MoyaWeb/WebContent/voting/submitEntry.xhtml
View file @
35b9f5d
...
@@ -7,16 +7,19 @@
...
@@ -7,16 +7,19 @@
<h:body>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<f:metadata>
<f:metadata>
<f:viewParam
name=
"compoId"
value=
"#{compoView.compoId}"
/>
<f:viewParam
name=
"entryId"
value=
"#{compoView.entryId}"
/>
<f:viewParam
name=
"entryId"
value=
"#{compoView.entryId}"
/>
<f:event
type=
"preRenderView"
listener=
"#{compoView.initEntryView}"
/>
<f:event
type=
"preRenderView"
listener=
"#{compoView.initEntryView}"
/>
</f:metadata>
</f:metadata>
<ui:define
name=
"content"
>
<ui:define
name=
"content"
>
<!-- <h:outputStylesheet library="style" name="insomnia2/css/actionlog.css" /> -->
<!-- <h:outputStylesheet library="style" name="insomnia2/css/actionlog.css" /> -->
<h1>
#{i18n['voting.compoentryadd.title']}
</h1>
<h1>
#{i18n['voting.compoentryadd.title']}
</h1>
<p>
#{i18n['voting.compoentryadd.description']} #{compoView.compo.name}
</p>
<p>
#{i18n['voting.compoentryadd.description']}
<h:outputText
value=
"#{compoView.compo.name}"
/></p>
<p>
<h:outputText
value=
"#{compoView.compo.description}"
/>
</p>
<h:form>
<h:form>
<h:panelGrid
columns=
"3"
>
<
!-- <
h:panelGrid columns="3">
<h:outputLabel value="Title" for="name" />
<h:outputLabel value="Title" for="name" />
<h:inputText value="#{compoView.entry.title}" id="name" />
<h:inputText value="#{compoView.entry.title}" id="name" />
<h:message for="name" />
<h:message for="name" />
...
@@ -32,14 +35,18 @@
...
@@ -32,14 +35,18 @@
<h:outputLabel value="#{i18n['voting.compoentryadd.screenmessage']}" for="screenmessage" />
<h:outputLabel value="#{i18n['voting.compoentryadd.screenmessage']}" for="screenmessage" />
<h:inputTextarea value="#{compoView.entry.screenMessage}" id="screenmessage" />
<h:inputTextarea value="#{compoView.entry.screenMessage}" id="screenmessage" />
<h:message for="screenmessage" />
<h:message for="screenmessage" />
<h:commandButton rendered="#{empty compoView.entry.id}" action="#{compoView.createEntry()}" value="#{i18n['voting.compoentryadd.button']}" />
<h:commandButton rendered="#{empty compoView.entry.id}" action="#{compoView.createEntry()}" value="#{i18n['voting.compoentryadd.button']}" />
<h:commandButton
rendered=
"#{!empty compoView.entry.id}"
action=
"#{compoView.saveEntry()}"
value=
"#{i18n['voting.compoentrysave.button']}"
/>
<h:commandButton rendered="#{!empty compoView.entry.id}" action="#{compoView.saveEntry()}" value="#{i18n['voting.compoentrysave.button']}" />
</h:panelGrid>
</h:panelGrid>
</h:form>
-->
<h:commandButton
rendered=
"#{empty compoView.entry.id}"
action=
"#{compoView.createEntry()}"
value=
"Ilmoittaudu kilpailuun"
/>
</h:form>
<ui:fragment
rendered=
"#{!empty compoView.entry.id}"
>
<ui:fragment
rendered=
"#{!empty compoView.entry.id}"
>
<h:form
enctype=
"multipart/form-data"
>
<!--
<h:form enctype="multipart/form-data">
<p:fileUpload value="#{compoView.uploadedFile}" id="uploadedfile" mode="simple" />
<p:fileUpload value="#{compoView.uploadedFile}" id="uploadedfile" mode="simple" />
<h:commandButton action="#{compoView.submitEntryfile}" value="#{i18n['compofile.upload']}" />
<h:commandButton action="#{compoView.submitEntryfile}" value="#{i18n['compofile.upload']}" />
</h:form>
</h:form>
...
@@ -54,6 +61,8 @@
...
@@ -54,6 +61,8 @@
<p:fileDownload value="#{compoFileDownloadView.dlfile}" />
<p:fileDownload value="#{compoFileDownloadView.dlfile}" />
</h:commandButton>
</h:commandButton>
</h:form>
</h:form>
-->
Ilmoittautuminen otettu vastaan.
</ui:fragment>
</ui:fragment>
</ui:define>
</ui:define>
...
...
code/MoyaWeb/src/fi/codecrew/moya/resources/i18n_fi.properties
View file @
35b9f5d
...
@@ -868,12 +868,12 @@ voting.allcompos.voteStart = \u00C4\u00E4nestys auki
...
@@ -868,12 +868,12 @@ voting.allcompos.voteStart = \u00C4\u00E4nestys auki
voting.compo.submit
=
L
\u
00E4het
\u
00E4 kappale
voting.compo.submit
=
L
\u
00E4het
\u
00E4 kappale
voting.compo.vote
=
\u
00C4
\u
00E4nest
\u
00E4
voting.compo.vote
=
\u
00C4
\u
00E4nest
\u
00E4
voting.compoentryadd.button
=
L
\u
00E4het
\u
00E4
voting.compoentryadd.button
=
L
\u
00E4het
\u
00E4
voting.compoentryadd.description
=
Lis
\u
00E4
\u
00E4 uusi entry compoon
voting.compoentryadd.description
=
Ilmoittaudu kilpailuun:
voting.compoentryadd.entryname
=
Nimi
voting.compoentryadd.entryname
=
Nimi
voting.compoentryadd.file
=
Tiedosto
voting.compoentryadd.file
=
Tiedosto
voting.compoentryadd.notes
=
Huomatuksia
voting.compoentryadd.notes
=
Huomatuksia
voting.compoentryadd.screenmessage
=
Screenmessage
voting.compoentryadd.screenmessage
=
Screenmessage
voting.compoentryadd.title
=
Lis
\u
00E4
\u
00E4 entry
voting.compoentryadd.title
=
Ilmoittaudu
voting.compoentryadd.uploadedFile
=
asdsda
voting.compoentryadd.uploadedFile
=
asdsda
voting.compoentrysave.button
=
Tallenna
voting.compoentrysave.button
=
Tallenna
voting.create.compoEnd
=
Lopetusaika
voting.create.compoEnd
=
Lopetusaika
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/card/CardMassPrintView.java
View file @
35b9f5d
package
fi
.
codecrew
.
moya
.
web
.
cdiview
.
card
;
package
fi
.
codecrew
.
moya
.
web
.
cdiview
.
card
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayInputStream
;
import
java.io.File
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -15,6 +14,8 @@ import javax.inject.Named;
...
@@ -15,6 +14,8 @@ import javax.inject.Named;
import
org.primefaces.model.DefaultStreamedContent
;
import
org.primefaces.model.DefaultStreamedContent
;
import
org.primefaces.model.StreamedContent
;
import
org.primefaces.model.StreamedContent
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
fi.codecrew.moya.beans.CardPrintBeanLocal
;
import
fi.codecrew.moya.beans.CardPrintBeanLocal
;
import
fi.codecrew.moya.model.EventUser
;
import
fi.codecrew.moya.model.EventUser
;
...
@@ -32,11 +33,11 @@ public class CardMassPrintView extends GenericCDIView implements Serializable {
...
@@ -32,11 +33,11 @@ public class CardMassPrintView extends GenericCDIView implements Serializable {
@EJB
@EJB
private
CardPrintBeanLocal
cardPrintBean
;
private
CardPrintBeanLocal
cardPrintBean
;
private
File
file
;
private
StreamedContent
streamedFile
;
private
StreamedContent
streamedFile
;
private
MassPrintResult
mpr
=
null
;
private
MassPrintResult
mpr
=
null
;
private
boolean
waitForAcceptance
=
true
;
private
boolean
waitForAcceptance
=
true
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
CardMassPrintView
.
class
);
public
CardMassPrintView
()
{
public
CardMassPrintView
()
{
// TODO Auto-generated constructor stub
// TODO Auto-generated constructor stub
...
@@ -49,9 +50,8 @@ public class CardMassPrintView extends GenericCDIView implements Serializable {
...
@@ -49,9 +50,8 @@ public class CardMassPrintView extends GenericCDIView implements Serializable {
userIdList
.
add
(
eu
.
getId
());
userIdList
.
add
(
eu
.
getId
());
}
}
file
=
null
;
try
{
try
{
mpr
=
cardPrintBean
.
getUserCardsAsPrintablePdf
(
userIdList
);
mpr
=
cardPrintBean
.
getUserCardsAsPrintablePdf
(
userIdList
);
waitForAcceptance
=
true
;
waitForAcceptance
=
true
;
...
@@ -89,14 +89,6 @@ public class CardMassPrintView extends GenericCDIView implements Serializable {
...
@@ -89,14 +89,6 @@ public class CardMassPrintView extends GenericCDIView implements Serializable {
this
.
userCartView
=
userCartView
;
this
.
userCartView
=
userCartView
;
}
}
public
File
getFile
()
{
return
file
;
}
public
void
setFile
(
File
file
)
{
this
.
file
=
file
;
}
public
StreamedContent
getStreamedFile
()
{
public
StreamedContent
getStreamedFile
()
{
return
streamedFile
;
return
streamedFile
;
}
}
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/shop/BarcodeView.java
View file @
35b9f5d
...
@@ -19,10 +19,9 @@ import fi.codecrew.moya.web.cdiview.user.UserView;
...
@@ -19,10 +19,9 @@ import fi.codecrew.moya.web.cdiview.user.UserView;
public
class
BarcodeView
extends
GenericCDIView
{
public
class
BarcodeView
extends
GenericCDIView
{
private
static
final
long
serialVersionUID
=
-
5723180869625883034L
;
private
static
final
long
serialVersionUID
=
-
5723180869625883034L
;
private
String
barcode
;
private
String
barcode
;
private
static
final
Logger
logger
=
LoggerFactory
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
BarcodeView
.
class
);
.
getLogger
(
BarcodeView
.
class
);
@Inject
@Inject
private
UserView
userView
;
private
UserView
userView
;
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/shop/ReaderView.java
View file @
35b9f5d
...
@@ -14,7 +14,6 @@ import org.slf4j.LoggerFactory;
...
@@ -14,7 +14,6 @@ import org.slf4j.LoggerFactory;
import
fi.codecrew.moya.beans.ProductBeanLocal
;
import
fi.codecrew.moya.beans.ProductBeanLocal
;
import
fi.codecrew.moya.beans.ReaderBeanLocal
;
import
fi.codecrew.moya.beans.ReaderBeanLocal
;
import
fi.codecrew.moya.beans.RoleBeanLocal
;
import
fi.codecrew.moya.beans.UserBeanLocal
;
import
fi.codecrew.moya.beans.UserBeanLocal
;
import
fi.codecrew.moya.enums.apps.ShopPermission
;
import
fi.codecrew.moya.enums.apps.ShopPermission
;
import
fi.codecrew.moya.enums.apps.UserPermission
;
import
fi.codecrew.moya.enums.apps.UserPermission
;
...
@@ -46,7 +45,7 @@ public class ReaderView extends GenericCDIView {
...
@@ -46,7 +45,7 @@ public class ReaderView extends GenericCDIView {
@Inject
@Inject
private
ReaderNameContainer
namecontainer
;
private
ReaderNameContainer
namecontainer
;
@EJB
@EJB
private
transient
ReaderBeanLocal
readerbean
;
private
transient
ReaderBeanLocal
readerbean
;
...
@@ -81,10 +80,27 @@ public class ReaderView extends GenericCDIView {
...
@@ -81,10 +80,27 @@ public class ReaderView extends GenericCDIView {
// card.getPrintedCard());
// card.getPrintedCard());
return
null
;
return
null
;
}
}
public
List
<
Role
>
getUserRoles
(
EventUser
user
)
{
public
List
<
Role
>
getUserRoles
(
EventUser
user
)
{
return
userbean
.
findUsersRoles
(
user
);
return
userbean
.
findUsersRoles
(
user
);
}
}
public
void
initCreateReader
()
{
if
(
super
.
requirePermissions
(
ShopPermission
.
SHOP_TO_OTHERS
)
&&
reader
==
null
)
{
reader
=
new
Reader
();
super
.
beginConversation
();
}
}
public
String
createReader
()
{
readerbean
.
createReader
(
reader
);
namecontainer
.
setReaderId
(
reader
.
getId
());
return
"/shop/showReaderEvents"
;
}
public
void
initUserassocView
()
{
public
void
initUserassocView
()
{
if
(
super
.
requirePermissions
(
UserPermission
.
CREATE_NEW
)
&&
event
==
null
)
{
if
(
super
.
requirePermissions
(
UserPermission
.
CREATE_NEW
)
&&
event
==
null
)
{
event
=
readerbean
.
getEvent
(
eventid
);
event
=
readerbean
.
getEvent
(
eventid
);
...
@@ -95,9 +111,11 @@ public class ReaderView extends GenericCDIView {
...
@@ -95,9 +111,11 @@ public class ReaderView extends GenericCDIView {
super
.
beginConversation
();
super
.
beginConversation
();
}
}
}
}
public
boolean
isReaderSelected
()
{
public
boolean
isReaderSelected
()
{
return
this
.
readerid
!=
null
;
return
this
.
readerid
!=
null
;
}
}
public
String
assocToCard
()
public
String
assocToCard
()
{
{
...
@@ -123,10 +141,10 @@ public class ReaderView extends GenericCDIView {
...
@@ -123,10 +141,10 @@ public class ReaderView extends GenericCDIView {
public
void
initReaderList
()
{
public
void
initReaderList
()
{
if
(
super
.
requirePermissions
(
ShopPermission
.
SHOP_TO_OTHERS
))
{
if
(
super
.
requirePermissions
(
ShopPermission
.
SHOP_TO_OTHERS
))
{
}
}
}
}
public
List
<
Product
>
getAutoProducts
()
{
public
List
<
Product
>
getAutoProducts
()
{
List
<
Product
>
ret
=
new
ArrayList
<
Product
>();
List
<
Product
>
ret
=
new
ArrayList
<
Product
>();
...
@@ -239,4 +257,8 @@ public class ReaderView extends GenericCDIView {
...
@@ -239,4 +257,8 @@ public class ReaderView extends GenericCDIView {
this
.
userview
=
userview
;
this
.
userview
=
userview
;
}
}
public
ReaderType
[]
getReaderTypes
()
{
return
ReaderType
.
values
();
}
}
}
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/voting/CompoView.java
View file @
35b9f5d
...
@@ -47,6 +47,7 @@ public class CompoView extends GenericCDIView {
...
@@ -47,6 +47,7 @@ public class CompoView extends GenericCDIView {
private
Compo
compo
;
private
Compo
compo
;
private
Integer
entryId
;
private
Integer
entryId
;
private
Integer
compoId
;
private
transient
ListDataModel
<
EntryWrapper
>
voteEntries
;
private
transient
ListDataModel
<
EntryWrapper
>
voteEntries
;
...
@@ -56,17 +57,34 @@ public class CompoView extends GenericCDIView {
...
@@ -56,17 +57,34 @@ public class CompoView extends GenericCDIView {
public
void
initEntryView
()
public
void
initEntryView
()
{
{
if
(
entry
==
null
)
if
(
super
.
requirePermissions
(
CompoPermission
.
SUBMIT_ENTRY
)
&&
entry
==
null
)
{
{
entry
=
votbean
.
findEntry
(
entryId
);
if
(
entryId
==
null
)
if
(
entry
==
null
||
!
super
.
requirePermissions
(
super
.
hasPermission
(
CompoPermission
.
MANAGE
)
||
permbean
.
isCurrentUser
(
entry
.
getCreator
())))
{
{
entry
=
null
;
entry
=
new
CompoEntry
();
}
else
{
if
(
compo
==
null
&&
compoId
!=
null
)
{
super
.
beginConversation
();
compo
=
votbean
.
getCompoById
(
compoId
);
entry
.
setCompo
(
compo
);
}
super
.
beginConversation
();
}
else
{
entry
=
votbean
.
findEntry
(
entryId
);
if
(
entry
==
null
||
!
super
.
requirePermissions
(
super
.
hasPermission
(
CompoPermission
.
MANAGE
)
||
permbean
.
isCurrentUser
(
entry
.
getCreator
())))
{
entry
=
null
;
compo
=
null
;
}
else
{
compo
=
entry
.
getCompo
();
super
.
beginConversation
();
}
}
}
}
}
logger
.
info
(
"Initializing entry view {} {}"
,
entry
,
compo
);
}
}
public
String
startVote
()
public
String
startVote
()
...
@@ -110,6 +128,7 @@ public class CompoView extends GenericCDIView {
...
@@ -110,6 +128,7 @@ public class CompoView extends GenericCDIView {
public
String
createEntry
()
public
String
createEntry
()
{
{
compo
=
votbean
.
addEntry
(
getEntry
());
compo
=
votbean
.
addEntry
(
getEntry
());
return
null
;
return
null
;
}
}
...
@@ -209,4 +228,12 @@ public class CompoView extends GenericCDIView {
...
@@ -209,4 +228,12 @@ public class CompoView extends GenericCDIView {
this
.
voteEntries
=
voteEntries
;
this
.
voteEntries
=
voteEntries
;
}
}
public
Integer
getCompoId
()
{
return
compoId
;
}
public
void
setCompoId
(
Integer
compoId
)
{
this
.
compoId
=
compoId
;
}
}
}
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