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 a339c322
authored
May 19, 2012
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stream published compostuff...
1 parent
5af2a9e5
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
874 additions
and
284 deletions
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/Menubean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/ReaderBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/VotingBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/facade/CompoEntryFileFacade.java
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/VotingBeanLocal.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Compo.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/CompoEntry.java
code/LanBortalWeb/WebContent/resources/cditools/products/shop.xhtml
code/LanBortalWeb/WebContent/shop/shopToUser.xhtml
code/LanBortalWeb/WebContent/useradmin/accountEvents.xhtml
code/LanBortalWeb/WebContent/useradmin/editAccountevent.xhtml
code/LanBortalWeb/WebContent/voting/compolist.xhtml
code/LanBortalWeb/WebContent/voting/details.xhtml
code/LanBortalWeb/WebContent/voting/myEntries.xhtml
code/LanBortalWeb/WebContent/voting/submitEntry.xhtml
code/LanBortalWeb/WebContent/voting/vote.xhtml
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_en.properties
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_fi.properties
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/ReaderView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/user/AccountEventView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/CompoFileDownloadView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/CompoView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/CompoWrapper.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/VotingCompoListView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/converter/CompoFileConverter.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/Menubean.java
View file @
a339c32
...
@@ -12,6 +12,7 @@ import org.slf4j.Logger;
...
@@ -12,6 +12,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
fi.insomnia.bortal.enums.apps.BillPermission
;
import
fi.insomnia.bortal.enums.apps.BillPermission
;
import
fi.insomnia.bortal.enums.apps.CompoPermission
;
import
fi.insomnia.bortal.enums.apps.ContentPermission
;
import
fi.insomnia.bortal.enums.apps.ContentPermission
;
import
fi.insomnia.bortal.enums.apps.MapPermission
;
import
fi.insomnia.bortal.enums.apps.MapPermission
;
import
fi.insomnia.bortal.enums.apps.PollPermission
;
import
fi.insomnia.bortal.enums.apps.PollPermission
;
...
@@ -99,6 +100,14 @@ public class Menubean implements MenubeanLocal {
...
@@ -99,6 +100,14 @@ public class Menubean implements MenubeanLocal {
pollTopmenu
.
setKey
(
"topnavi.poll"
);
pollTopmenu
.
setKey
(
"topnavi.poll"
);
pollTopmenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/poll/index"
),
PollPermission
.
ANSWER
);
pollTopmenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/poll/index"
),
PollPermission
.
ANSWER
);
MenuNavigation
compoMenu
=
usernavi
.
addPage
(
null
,
null
);
compoMenu
.
setKey
(
"topnavi.compos"
);
compoMenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/voting/compolist"
),
CompoPermission
.
VIEW_COMPOS
);
compoMenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/voting/myEntries"
),
CompoPermission
.
VIEW_COMPOS
);
compoMenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/voting/create"
),
CompoPermission
.
MANAGE
);
compoMenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/voting/submitEntry"
),
null
).
setVisible
(
false
);
compoMenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/voting/details"
),
null
).
setVisible
(
false
);
MenuNavigation
adminnavi
=
new
MenuNavigation
(
ev
,
"supernavi.admin"
);
MenuNavigation
adminnavi
=
new
MenuNavigation
(
ev
,
"supernavi.admin"
);
navifacade
.
create
(
adminnavi
);
navifacade
.
create
(
adminnavi
);
MenuNavigation
adminuser
=
adminnavi
.
addPage
(
null
,
null
);
MenuNavigation
adminuser
=
adminnavi
.
addPage
(
null
,
null
);
...
...
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/ReaderBean.java
View file @
a339c32
...
@@ -216,10 +216,12 @@ public class ReaderBean implements ReaderBeanLocal {
...
@@ -216,10 +216,12 @@ public class ReaderBean implements ReaderBeanLocal {
@Override
@Override
public
ReaderEvent
createCard
(
ReaderEvent
event
,
EventUser
user
)
{
public
ReaderEvent
createCard
(
ReaderEvent
event
,
EventUser
user
)
{
ReaderEvent
ret
=
null
;
ReaderEvent
ret
=
null
;
logger
.
info
(
"Trying to create card for event {} with printed card {}"
,
event
,
event
.
getPrintedCard
());
if
(
event
.
getPrintedCard
()
==
null
)
if
(
event
.
getPrintedCard
()
==
null
)
{
{
CardTemplate
ct
=
cardTemplateBean
.
getUsersCardtype
(
user
);
CardTemplate
ct
=
cardTemplateBean
.
getUsersCardtype
(
user
);
logger
.
info
(
"Card template {}"
,
ct
);
if
(
ct
==
null
)
if
(
ct
==
null
)
{
{
return
null
;
return
null
;
...
...
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/VotingBean.java
View file @
a339c32
...
@@ -4,10 +4,13 @@ import java.util.ArrayList;
...
@@ -4,10 +4,13 @@ import java.util.ArrayList;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.List
;
import
java.util.List
;
import
javax.annotation.security.DeclareRoles
;
import
javax.annotation.security.RolesAllowed
;
import
javax.ejb.EJB
;
import
javax.ejb.EJB
;
import
javax.ejb.LocalBean
;
import
javax.ejb.LocalBean
;
import
javax.ejb.Stateless
;
import
javax.ejb.Stateless
;
import
fi.insomnia.bortal.enums.apps.CompoPermission
;
import
fi.insomnia.bortal.facade.CompoEntryFacade
;
import
fi.insomnia.bortal.facade.CompoEntryFacade
;
import
fi.insomnia.bortal.facade.CompoEntryFileFacade
;
import
fi.insomnia.bortal.facade.CompoEntryFileFacade
;
import
fi.insomnia.bortal.facade.CompoFacade
;
import
fi.insomnia.bortal.facade.CompoFacade
;
...
@@ -22,6 +25,9 @@ import fi.insomnia.bortal.model.Vote;
...
@@ -22,6 +25,9 @@ import fi.insomnia.bortal.model.Vote;
*/
*/
@Stateless
@Stateless
@LocalBean
@LocalBean
@DeclareRoles
({
CompoPermission
.
S_SUBMIT_ENTRY
,
CompoPermission
.
S_MANAGE
})
public
class
VotingBean
implements
VotingBeanLocal
{
public
class
VotingBean
implements
VotingBeanLocal
{
@EJB
@EJB
...
@@ -36,42 +42,78 @@ public class VotingBean implements VotingBeanLocal {
...
@@ -36,42 +42,78 @@ public class VotingBean implements VotingBeanLocal {
private
EventBean
eventBean
;
private
EventBean
eventBean
;
@EJB
@EJB
private
PermissionBeanLocal
permissionBean
;
private
PermissionBeanLocal
permissionBean
;
/**
/**
* Default constructor.
* Default constructor.
*/
*/
public
VotingBean
()
{
public
VotingBean
()
{
// TODO Auto-generated constructor stub
// TODO Auto-generated constructor stub
}
}
public
void
createVote
(
Vote
v
)
{
public
void
createVote
(
Vote
v
)
{
voteFacade
.
create
(
v
);
voteFacade
.
create
(
v
);
}
}
public
void
createCompo
(
Compo
c
)
{
public
void
createCompo
(
Compo
c
)
{
c
.
setEvent
(
eventBean
.
getCurrentEvent
());
c
.
setEvent
(
eventBean
.
getCurrentEvent
());
compoFacade
.
create
(
c
);
compoFacade
.
create
(
c
);
}
}
public
void
addEntry
(
CompoEntry
compoEntry
,
CompoEntryFile
compoEntryFile
)
{
public
void
addEntry
(
CompoEntry
compoEntry
,
CompoEntryFile
compoEntryFile
)
{
compoEntry
.
setCreated
(
Calendar
.
getInstance
());
compoEntry
.
setCreated
(
Calendar
.
getInstance
());
compoEntry
.
setCreator
(
permissionBean
.
getCurrentUser
());
compoEntry
.
setCreator
(
permissionBean
.
getCurrentUser
());
Compo
c
=
compoFacade
.
merge
(
compoEntry
.
getCompo
());
Compo
c
=
compoFacade
.
merge
(
compoEntry
.
getCompo
());
c
.
getCompoEntries
().
add
(
compoEntry
);
c
.
getCompoEntries
().
add
(
compoEntry
);
compoFacade
.
flush
();
compoFacade
.
flush
();
compoEntryFile
.
setEntriesId
(
compoEntry
);
compoEntryFile
.
setEntriesId
(
compoEntry
);
compoEntry
.
getFiles
().
add
(
compoEntryFile
);
compoEntry
.
getFiles
().
add
(
compoEntryFile
);
}
}
public
Compo
getCompoById
(
Integer
compoId
)
{
public
Compo
getCompoById
(
Integer
compoId
)
{
return
compoFacade
.
find
(
compoId
);
return
compoFacade
.
find
(
compoId
);
}
}
public
List
<
Compo
>
getCompoList
()
{
public
List
<
Compo
>
getCompoList
()
{
return
compoFacade
.
getList
();
return
compoFacade
.
getList
();
}
}
@Override
@RolesAllowed
({
CompoPermission
.
S_SUBMIT_ENTRY
,
CompoPermission
.
S_MANAGE
,
})
public
Compo
addEntry
(
CompoEntry
entry
)
{
Compo
co
=
compoFacade
.
find
(
entry
.
getCompo
().
getId
());
if
(
co
.
getCompoEntries
()
==
null
)
{
co
.
setCompoEntries
(
new
ArrayList
<
CompoEntry
>());
}
if
(!
co
.
getCompoEntries
().
contains
(
entry
))
{
co
.
getCompoEntries
().
add
(
entry
);
}
return
co
;
}
@Override
public
CompoEntry
saveEntry
(
CompoEntry
entry
)
{
return
compoEntryFacade
.
merge
(
entry
);
}
@Override
public
List
<
CompoEntryFile
>
getEntryFiles
(
CompoEntry
entry
)
{
return
compoEntryFileFacade
.
findFor
(
entry
);
}
@Override
public
CompoEntryFile
findEntryFile
(
Integer
id
)
{
return
compoEntryFileFacade
.
find
(
id
);
}
@Override
public
CompoEntry
findEntry
(
Integer
entryId
)
{
return
compoEntryFacade
.
find
(
entryId
);
}
}
}
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/facade/CompoEntryFileFacade.java
View file @
a339c32
package
fi
.
insomnia
.
bortal
.
facade
;
package
fi
.
insomnia
.
bortal
.
facade
;
import
java.util.List
;
import
javax.ejb.LocalBean
;
import
javax.ejb.LocalBean
;
import
javax.ejb.Stateless
;
import
javax.ejb.Stateless
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Root
;
import
fi.insomnia.bortal.model.CompoEntry
;
import
fi.insomnia.bortal.model.CompoEntryFile
;
import
fi.insomnia.bortal.model.CompoEntryFile
;
import
fi.insomnia.bortal.model.CompoEntryFile_
;
@Stateless
@Stateless
@LocalBean
@LocalBean
...
@@ -14,4 +21,13 @@ public class CompoEntryFileFacade extends IntegerPkGenericFacade<CompoEntryFile>
...
@@ -14,4 +21,13 @@ public class CompoEntryFileFacade extends IntegerPkGenericFacade<CompoEntryFile>
super
(
CompoEntryFile
.
class
);
super
(
CompoEntryFile
.
class
);
}
}
public
List
<
CompoEntryFile
>
findFor
(
CompoEntry
entry
)
{
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
CompoEntryFile
>
cq
=
cb
.
createQuery
(
CompoEntryFile
.
class
);
Root
<
CompoEntryFile
>
root
=
cq
.
from
(
CompoEntryFile
.
class
);
cq
.
where
(
cb
.
equal
(
root
.
get
(
CompoEntryFile_
.
entry
),
entry
));
return
getEm
().
createQuery
(
cq
).
getResultList
();
}
}
}
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/VotingBeanLocal.java
View file @
a339c32
...
@@ -11,7 +11,21 @@ import fi.insomnia.bortal.model.CompoEntryFile;
...
@@ -11,7 +11,21 @@ import fi.insomnia.bortal.model.CompoEntryFile;
@Local
@Local
public
interface
VotingBeanLocal
{
public
interface
VotingBeanLocal
{
public
void
createCompo
(
Compo
c
);
public
void
createCompo
(
Compo
c
);
public
void
addEntry
(
CompoEntry
compoEntry
,
CompoEntryFile
compoEntryFile
);
public
void
addEntry
(
CompoEntry
compoEntry
,
CompoEntryFile
compoEntryFile
);
public
List
<
Compo
>
getCompoList
();
public
List
<
Compo
>
getCompoList
();
public
Compo
getCompoById
(
Integer
compoId
);
public
Compo
getCompoById
(
Integer
compoId
);
public
Compo
addEntry
(
CompoEntry
entry
);
public
CompoEntry
saveEntry
(
CompoEntry
entry
);
public
List
<
CompoEntryFile
>
getEntryFiles
(
CompoEntry
entry
);
public
CompoEntryFile
findEntryFile
(
Integer
id
);
public
CompoEntry
findEntry
(
Integer
entryId
);
}
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Compo.java
View file @
a339c32
...
@@ -15,6 +15,7 @@ import javax.persistence.JoinColumn;
...
@@ -15,6 +15,7 @@ import javax.persistence.JoinColumn;
import
javax.persistence.Lob
;
import
javax.persistence.Lob
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.OneToMany
;
import
javax.persistence.OneToMany
;
import
javax.persistence.OrderBy
;
import
javax.persistence.Table
;
import
javax.persistence.Table
;
import
javax.persistence.Temporal
;
import
javax.persistence.Temporal
;
import
javax.persistence.TemporalType
;
import
javax.persistence.TemporalType
;
...
@@ -50,7 +51,7 @@ public class Compo extends GenericEntity {
...
@@ -50,7 +51,7 @@ public class Compo extends GenericEntity {
@Column
(
name
=
"compo_start"
)
@Column
(
name
=
"compo_start"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Calendar
startTime
;
private
Calendar
startTime
;
@Column
(
name
=
"compo_end"
)
@Column
(
name
=
"compo_end"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Calendar
endTime
;
private
Calendar
endTime
;
...
@@ -83,8 +84,6 @@ public class Compo extends GenericEntity {
...
@@ -83,8 +84,6 @@ public class Compo extends GenericEntity {
@Column
(
name
=
"max_participant_count"
)
@Column
(
name
=
"max_participant_count"
)
private
int
maxParticipantCount
;
private
int
maxParticipantCount
;
/**
/**
* If ( for some unimaginable reason ) compo is delayed hold voting can be
* If ( for some unimaginable reason ) compo is delayed hold voting can be
* used to postpone the start of the voting from the time specified in
* used to postpone the start of the voting from the time specified in
...
@@ -97,6 +96,7 @@ public class Compo extends GenericEntity {
...
@@ -97,6 +96,7 @@ public class Compo extends GenericEntity {
* Entries submitted to participate this compo.
* Entries submitted to participate this compo.
*/
*/
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"compo"
)
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"compo"
)
@OrderBy
(
"sort"
)
private
List
<
CompoEntry
>
compoEntries
;
private
List
<
CompoEntry
>
compoEntries
;
public
Compo
(
String
compoName
,
boolean
holdVoting
)
{
public
Compo
(
String
compoName
,
boolean
holdVoting
)
{
...
@@ -204,7 +204,7 @@ public class Compo extends GenericEntity {
...
@@ -204,7 +204,7 @@ public class Compo extends GenericEntity {
public
void
setEvent
(
LanEvent
event
)
{
public
void
setEvent
(
LanEvent
event
)
{
this
.
event
=
event
;
this
.
event
=
event
;
}
}
public
Calendar
getEndTime
()
{
public
Calendar
getEndTime
()
{
return
endTime
;
return
endTime
;
}
}
...
...
code/LanBortalDatabase/src/fi/insomnia/bortal/model/CompoEntry.java
View file @
a339c32
...
@@ -11,6 +11,7 @@ import java.util.List;
...
@@ -11,6 +11,7 @@ import java.util.List;
import
javax.persistence.CascadeType
;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
import
javax.persistence.FetchType
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.Lob
;
import
javax.persistence.Lob
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.ManyToOne
;
...
@@ -39,7 +40,7 @@ public class CompoEntry extends GenericEntity {
...
@@ -39,7 +40,7 @@ public class CompoEntry extends GenericEntity {
@Column
(
name
=
"entry_created"
,
nullable
=
false
)
@Column
(
name
=
"entry_created"
,
nullable
=
false
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Calendar
created
;
private
Calendar
created
=
Calendar
.
getInstance
()
;
@Column
(
name
=
"entry_name"
,
nullable
=
false
)
@Column
(
name
=
"entry_name"
,
nullable
=
false
)
private
String
name
;
private
String
name
;
...
@@ -62,11 +63,11 @@ public class CompoEntry extends GenericEntity {
...
@@ -62,11 +63,11 @@ public class CompoEntry extends GenericEntity {
@OneToOne
@OneToOne
private
CompoEntryFile
currentFile
;
private
CompoEntryFile
currentFile
;
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"compoEntry"
)
@OneToMany
(
mappedBy
=
"compoEntry"
)
private
List
<
Vote
>
votes
;
private
List
<
Vote
>
votes
;
@PrivateOwned
@PrivateOwned
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"entry"
)
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"entry"
,
fetch
=
FetchType
.
LAZY
)
private
List
<
CompoEntryFile
>
files
;
private
List
<
CompoEntryFile
>
files
;
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"entry"
)
@OneToMany
(
cascade
=
CascadeType
.
ALL
,
mappedBy
=
"entry"
)
...
@@ -80,12 +81,6 @@ public class CompoEntry extends GenericEntity {
...
@@ -80,12 +81,6 @@ public class CompoEntry extends GenericEntity {
super
();
super
();
}
}
public
CompoEntry
(
Calendar
entryCreated
,
String
entryName
)
{
super
();
this
.
created
=
entryCreated
;
this
.
name
=
entryName
;
}
public
Calendar
getCreated
()
{
public
Calendar
getCreated
()
{
return
created
;
return
created
;
}
}
...
...
code/LanBortalWeb/WebContent/resources/cditools/products/shop.xhtml
View file @
a339c32
...
@@ -15,7 +15,9 @@
...
@@ -15,7 +15,9 @@
<!-- <h:outputScript target="head" library="script" name="jquery.min.js" /> -->
<!-- <h:outputScript target="head" library="script" name="jquery.min.js" /> -->
<!-- <h:outputScript target="head" library="script" name="shopscript.js" /> -->
<!-- <h:outputScript target="head" library="script" name="shopscript.js" /> -->
<h:outputScript
library=
"primefaces"
name=
"jquery/jquery.js"
/>
<h:outputScript
library=
"primefaces"
name=
"jquery/jquery.js"
/>
<div
style=
"margin-top: 5px;"
>
<h:commandButton
action=
"#{cc.attrs.commitaction}"
id=
"commitbutton-top"
value=
"#{cc.attrs.commitValue}"
/>
</div>
<h:dataTable
styleClass=
"bordertable"
id=
"billcart"
value=
"#{cc.attrs.items}"
var=
"cart"
>
<h:dataTable
styleClass=
"bordertable"
id=
"billcart"
value=
"#{cc.attrs.items}"
var=
"cart"
>
<h:column>
<h:column>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
...
@@ -50,14 +52,14 @@
...
@@ -50,14 +52,14 @@
<f:ajax
render=
"@form"
/>
<f:ajax
render=
"@form"
/>
</h:commandButton>
</h:commandButton>
<h:inputText
size=
"4"
id=
"cartcount"
value=
"#{cart.count}"
>
<h:inputText
size=
"4"
id=
"cartcount"
value=
"#{cart.count}"
>
<f:ajax
render=
"@form"
event=
"valueChange"
/>
<f:ajax
render=
"@form"
event=
"valueChange"
/>
</h:inputText>
</h:inputText>
<h:commandButton
action=
"#{productShopView.add(1)}"
value=
"#{i18n['productshop.plusOne']}"
>
<h:commandButton
action=
"#{productShopView.add(1)}"
value=
"#{i18n['productshop.plusOne']}"
>
<f:ajax
render=
"@form"
/>
<f:ajax
render=
"@form"
/>
</h:commandButton>
</h:commandButton>
<h:commandButton
action=
"#{productShopView.add(10)}"
value=
"#{i18n['productshop.plusTen']}"
>
<h:commandButton
action=
"#{productShopView.add(10)}"
value=
"#{i18n['productshop.plusTen']}"
>
<f:ajax
render=
"@form"
/>
<f:ajax
render=
"@form"
/>
</h:commandButton>
</h:commandButton>
</h:column>
</h:column>
<h:column>
<h:column>
<h:dataTable
border=
"0"
var=
"disc"
value=
"#{cart.discounts}"
>
<h:dataTable
border=
"0"
var=
"disc"
value=
"#{cart.discounts}"
>
...
@@ -80,7 +82,7 @@
...
@@ -80,7 +82,7 @@
<f:convertNumber
maxFractionDigits=
"2"
minFractionDigits=
"2"
/>
<f:convertNumber
maxFractionDigits=
"2"
minFractionDigits=
"2"
/>
</h:outputText>
</h:outputText>
</div>
</div>
<h:commandButton
action=
"#{cc.attrs.commitaction}"
id=
"commitbutton"
value=
"#{cc.attrs.commitValue}"
/>
<h:commandButton
action=
"#{cc.attrs.commitaction}"
id=
"commitbutton
-botton
"
value=
"#{cc.attrs.commitValue}"
/>
...
...
code/LanBortalWeb/WebContent/shop/shopToUser.xhtml
View file @
a339c32
...
@@ -24,8 +24,8 @@
...
@@ -24,8 +24,8 @@
<h:panelGrid
columns=
"2"
>
<h:panelGrid
columns=
"2"
>
<h:outputLabel
style=
"#{productShopView.accountPositive?'':'color: red;'} font-size: 1.1em;"
value=
"#{i18n['shop.accountBalance']}"
/>
<h:outputLabel
value=
"#{i18n['shop.accountBalance']}"
/>
<h:outputText
style=
"#{productShopView.accountPositive?'':'color: red';} font-size: 1.1em;"
value=
"#{productShopView.accountBalance}"
>
<h:outputText
value=
"#{productShopView.accountBalance}"
>
<f:convertNumber
/>
<f:convertNumber
/>
</h:outputText>
</h:outputText>
...
@@ -43,7 +43,6 @@
...
@@ -43,7 +43,6 @@
</h:panelGrid>
</h:panelGrid>
<h:outputText
value=
"#{i18n['product.shopInstant']}"
/>
<h:outputText
value=
"#{i18n['product.shopInstant']}"
/>
<products:shop
commitaction=
"#{productShopView.commitShoppingCart()}"
items=
"#{productShopView.shoppingcart}"
commitValue=
"#{i18n['productshop.commit']}"
/>
<h:selectBooleanCheckbox
value=
"#{productShopView.payInstant}"
>
<h:selectBooleanCheckbox
value=
"#{productShopView.payInstant}"
>
<f:ajax
render=
"@form"
execute=
"@form"
/>
<f:ajax
render=
"@form"
execute=
"@form"
/>
</h:selectBooleanCheckbox>
</h:selectBooleanCheckbox>
...
...
code/LanBortalWeb/WebContent/useradmin/accountEvents.xhtml
View file @
a339c32
...
@@ -68,11 +68,11 @@
...
@@ -68,11 +68,11 @@
</h:column>
</h:column>
<
!-- <h:column> --
>
<
h:column
>
<!-- <h:link outcome="/user/editAccountevent" value="#{i18n['accountEvent.edit']}"> --
>
<h:link
outcome=
"/useradmin/editAccountevent"
value=
"#{i18n['accountEvent.edit']}"
>
<!-- <f:param name="accountid" value="#{ac.id}" /> --
>
<f:param
name=
"id"
value=
"#{ac.id}"
/
>
<!-- </h:link> --
>
</h:link
>
<
!-- </h:column> --
>
<
/h:column
>
</h:dataTable>
</h:dataTable>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
...
...
code/LanBortalWeb/WebContent/useradmin/editAccountevent.xhtml
0 → 100644
View file @
a339c32
<!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:users=
"http://java.sun.com/jsf/composite/cditools/user"
xmlns:tools=
"http://java.sun.com/jsf/composite/cditools"
xmlns:account=
"http://java.sun.com/jsf/composite/cditools/account"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
xmlns:p=
"http://primefaces.org/ui"
>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<f:metadata>
<f:viewParam
name=
"id"
value=
"#{accountEventView.accountid}"
/>
<f:event
type=
"preRenderView"
listener=
"#{accountEventView.initView}"
/>
</f:metadata>
<ui:define
name=
"title"
>
<h1>
#{i18n['accountevent.edit.title']}
</h1>
<users:usertabs
tabId=
"accountevents"
/>
</ui:define>
<ui:define
name=
"content"
>
<h:form
id=
"acform"
>
<h:panelGrid
columns=
"3"
>
<h:outputLabel
for=
"user"
value=
"#{i18n['accountevent.user']}"
/>
<h:outputText
id=
"user"
value=
"#{accountEventView.accountevent.user.user.id} / #{accountEventView.accountevent.user.user.wholeName}"
/>
<h:message
for=
"user"
/>
<h:outputLabel
for=
"price"
value=
"#{i18n['accountevent.price']}"
/>
<h:inputText
id=
"price"
value=
"#{accountEventView.accountevent.unitPrice}"
>
<f:convertNumber
minFractionDigits=
"0"
maxFractionDigits=
"4"
/>
</h:inputText>
<h:message
for=
"price"
/>
<h:outputLabel
for=
"quantity"
value=
"#{i18n['accountevent.quantity']}"
/>
<h:inputText
id=
"quantity"
value=
"#{accountEventView.accountevent.quantity}"
>
<f:convertNumber
minFractionDigits=
"0"
maxFractionDigits=
"4"
/>
</h:inputText>
<h:message
for=
"quantity"
/>
<h:outputLabel
for=
"time"
value=
"#{i18n['accountevent.quantity']}"
/>
<p:calendar
id=
"time"
value=
"#{accountEventView.accountevent.eventTime.time}"
pattern=
"#{sessionHandler.datetimeFormat}"
timeZone=
"#{sessionHandler.timezone}"
/>
<h:message
for=
"time"
/>
</h:panelGrid>
<h:commandButton
action=
"#{accountEventView.save()}"
rendered=
"#{accountEventView.canSave}"
value=
"#{i18n['accountevent.save']}"
/>
<h:commandButton
action=
"#{accountEventView.delete()}"
rendered=
"#{accountEventView.canSave}"
value=
"#{i18n['accountevent.delete']}"
/>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
code/LanBortalWeb/WebContent/voting/compolist.xhtml
View file @
a339c32
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"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"
<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:users=
"http://java.sun.com/jsf/composite/cditools/user"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:users=
"http://java.sun.com/jsf/composite/cditools/user"
xmlns:tools=
"http://java.sun.com/jsf/composite/cditools"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:p=
"http://primefaces.org/ui"
>
xmlns:tools=
"http://java.sun.com/jsf/composite/cditools"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:p=
"http://primefaces.org/ui"
>
<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=
"#{votingCompoListView.initView()}"
/>
<f:event
type=
"preRenderView"
listener=
"#{compoView.initListView()}"
/>
</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.allcompos.header']}
</h1>
<h1>
#{i18n['voting.allcompos.header']}
</h1>
<p>
#{i18n['voting.allcompos.description']}
</p>
<p>
#{i18n['voting.allcompos.description']}
</p>
<div
class=
"clearfix"
></div>
<h:form>
<h:dataTable
styleClass=
"bordertable"
rowClasses=
"roweven,rowodd"
id=
"compolisttable"
value=
"#{compoView.compos}"
var=
"compo"
>
<div
id=
"actionlog"
>
<h:column>
<f:facet
name=
"header"
>
<h:dataTable
styleClass=
"bordertable"
rowClasses=
"roweven,rowodd"
id=
"compolisttable"
value=
"#{votingCompoListView.compos}"
var=
"compo"
>
<h:outputText
value=
"#{i18n['voting.allcompos.name']}"
/>
<h:column>
</f:facet>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{compo.compo.name}"
/>
<h:outputText
value=
"#{i18n['voting.allcompos.name']}"
/>
</h:column>
</f:facet>
<h:link
outcome=
"details"
>
<!-- <h:column rendered="#{compoView.curEntries}"> -->
<f:param
name=
"compoId"
value=
"#{compo.id}"
/>
<!-- <f:facet name="header"> -->
#{compo.name}
<!-- <h:outputText value="#{i18n['voting.allcompos.curEntries']}" /> -->
</h:link>
<!-- </f:facet> -->
<!-- <h:outputText value="#{compo.name}" /> -->
<!-- <h:outputText value="#{compo.compoEntries.size()}" /> -->
</h:column>
<!-- </h:column> -->
<h:column>
<!-- <h:column rendered="#{compoView.maxParts}"> -->
<f:facet
name=
"header"
>
<!-- <f:facet name="header"> -->
<h:outputText
value=
"#{i18n['voting.allcompos.descri']}"
/>
<!-- <h:outputText value="#{i18n['voting.allcompos.maxParts']}" /> -->
</f:facet>
<!-- </f:facet> -->
<h:outputText
value=
"#{compo.description}"
/>
<!-- <h:outputText value="#{compo.maxParticipantCount}" /> -->
</h:column>
<!-- </h:column> -->
<h:column
rendered=
"#{votingCompoListView.curEntries}"
>
<h:column>
<f:facet
name=
"header"
>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['voting.allcompos.curEntries']}"
/>
<h:outputText
value=
"#{i18n['voting.allcompos.startTime']}"
/>
</f:facet>
</f:facet>
<h:outputText
value=
"#{compo.compoEntries.size()}"
/>
<h:outputText
value=
"#{compo.compo.startTime.time}"
>
</h:column>
<f:convertDateTime
type=
"both"
pattern=
"dd.MM.yyyy HH:mm"
/>
<h:column
rendered=
"#{votingCompoListView.maxParts}"
>
</h:outputText>
<f:facet
name=
"header"
>
</h:column>
<h:outputText
value=
"#{i18n['voting.allcompos.maxParts']}"
/>
</f:facet>
<h:column>
<h:outputText
value=
"#{compo.maxParticipantCount}"
/>
<f:facet
name=
"header"
>
</h:column>
<h:outputText
value=
"#{i18n['voting.allcompos.voteEnd']}"
/>
<h:column>
</f:facet>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{compo.compo.voteEnd.time}"
>
<h:outputText
value=
"#{i18n['voting.allcompos.startTime']}"
/>
<f:convertDateTime
type=
"both"
pattern=
"dd.MM.yyyy HH:mm"
/>
</f:facet>
</h:outputText>
<h:outputText
value=
"#{compo.startTime.time}"
>
</h:column>
<f:convertDateTime
type=
"both"
pattern=
"dd.MM.yyyy HH:mm"
/>
</h:outputText>
<h:column>
</h:column>
<f:facet
name=
"header"
>
<h:column>
<h:outputText
value=
"#{i18n['voting.allcompos.submitEnd']}"
/>
<f:facet
name=
"header"
>
</f:facet>
<h:outputText
value=
"#{i18n['voting.allcompos.endTime']}"
/>
<h:outputText
value=
"#{compo.compo.submitEnd.time}"
>
</f:facet>
<f:convertDateTime
type=
"both"
pattern=
"dd.MM.yyyy HH:mm"
/>
<h:outputText
value=
"#{compo.endTime.time}"
>
</h:outputText>
<f:convertDateTime
type=
"both"
pattern=
"dd.MM.yyyy HH:mm"
/>
</h:column>
</h:outputText>
<h:column>
</h:column>
<h:commandButton
rendered=
"#{compo.vote or compoView.manage}"
action=
"#{compoView.vote()}"
value=
"#{i18n['voting.compo.vote']}"
/>
<h:column>
</h:column>
<f:facet
name=
"header"
>
<h:column>
<h:outputText
value=
"#{i18n['voting.allcompos.voteStart']}"
/>
<h:commandButton
rendered=
"#{compo.submit or compoView.manage}"
action=
"#{compoView.submitEntry()}"
value=
"#{i18n['voting.compo.submit']}"
/>
</f:facet>
<h:outputText
value=
"#{compo.voteStart.time}"
>
</h:column>
<f:convertDateTime
type=
"both"
pattern=
"dd.MM.yyyy HH:mm"
/>
<h:column
rendered=
"#{compoView.manage}"
>
</h:outputText>
<h:link
outcome=
"details"
value=
"#{i18n['compo.edit']}"
>
</h:column>
<f:param
name=
"compoId"
value=
"#{compo.compo.id}"
/>
<h:column>
</h:link>
<f:facet
name=
"header"
>
</h:column>
<h:outputText
value=
"#{i18n['voting.allcompos.voteEnd']}"
/>
</h:dataTable>
</f:facet>
</h:form>
<h:outputText
value=
"#{compo.voteEnd.time}"
>
<f:convertDateTime
type=
"both"
pattern=
"dd.MM.yyyy HH:mm"
/>
</h:outputText>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['voting.allcompos.submitStart']}"
/>
</f:facet>
<h:outputText
value=
"#{compo.submitStart.time}"
>
<f:convertDateTime
type=
"both"
pattern=
"dd.MM.yyyy HH:mm"
/>
</h:outputText>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['voting.allcompos.submitEnd']}"
/>
</f:facet>
<h:outputText
value=
"#{compo.submitEnd.time}"
>
<f:convertDateTime
type=
"both"
pattern=
"dd.MM.yyyy HH:mm"
/>
</h:outputText>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
""
/>
</f:facet>
<h:link
outcome=
"addentry"
rendered=
"#{compo.maxParticipantCount gt compo.compoEntries.size()}"
>
<f:param
name=
"compoId"
value=
"#{compo.id}"
/>
#{i18n['voting.allcompos.submitEntry']}
</h:link>
</h:column>
</h:dataTable>
</div>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
</h:body>
</h:body>
...
...
code/LanBortalWeb/WebContent/voting/details.xhtml
View file @
a339c32
<!DOCTYPE html
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"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"
<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:users=
"http://java.sun.com/jsf/composite/cditools/user"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:users=
"http://java.sun.com/jsf/composite/cditools/user"
xmlns:tools=
"http://java.sun.com/jsf/composite/cditools"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:p=
"http://primefaces.org/ui"
>
xmlns:tools=
"http://java.sun.com/jsf/composite/cditools"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:p=
"http://primefaces.org/ui"
>
<h:body>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
...
@@ -17,42 +15,52 @@
...
@@ -17,42 +15,52 @@
<!-- <h:outputStylesheet library="style" name="insomnia2/css/actionlog.css" /> -->
<!-- <h:outputStylesheet library="style" name="insomnia2/css/actionlog.css" /> -->
<h1>
Compo: #{votingDetailsView.compoName}
</h1>
<h1>
Compo: #{votingDetailsView.compoName}
</h1>
<p>
Infoa compon entryistä
</p>
<p>
Infoa compon entryistä
</p>
<div
class=
"clearfix"
></div>
<h:form>
<div
id=
"actionlog"
>
<h:dataTable
styleClass=
"bordertable"
rowClasses=
"roweven,rowodd"
id=
"compolisttable"
value=
"#{votingDetailsView.entries}"
var=
"entry"
>
<h:column>
<h:dataTable
styleClass=
"bordertable"
rowClasses=
"roweven,rowodd"
id=
"compolisttable"
value=
"#{votingDetailsView.entries}"
var=
"entry"
>
<f:facet
name=
"header"
>
<h:column>
<h:outputText
value=
"nimi"
/>
<f:facet
name=
"header"
>
</f:facet>
<h:outputText
value=
"nimi"
/>
<h:outputText
value=
"#{entry.name}"
/>
</f:facet>
</h:column>
<h:outputText
value=
"#{entry.name}"
/>
<h:column>
</h:column>
<f:facet
name=
"header"
>
<h:column>
<h:outputText
value=
"notes"
/>
<f:facet
name=
"header"
>
</f:facet>
<h:outputText
value=
"notes"
/>
<h:outputText
value=
"#{entry.notes}"
/>
</f:facet>
</h:column>
<h:outputText
value=
"#{entry.notes}"
/>
<h:column>
</h:column>
<f:facet
name=
"header"
>
<h:column>
<h:outputText
value=
"screenmessage"
/>
<f:facet
name=
"header"
>
</f:facet>
<h:outputText
value=
"screenmessage"
/>
<h:outputText
value=
"#{entry.screenMessage}"
/>
</f:facet>
</h:column>
<h:outputText
value=
"#{entry.screenMessage}"
/>
<h:column>
</h:column>
<f:facet
name=
"header"
>
<h:column>
<h:outputText
value=
"creator"
/>
<f:facet
name=
"header"
>
</f:facet>
<h:outputText
value=
"creator"
/>
<h:outputText
value=
"#{entry.creator.wholeName}"
/>
</f:facet>
</h:column>
<h:outputText
value=
"#{entry.creator.user.wholeName}"
/>
<h:column>
</h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"sort"
/>
</h:dataTable>
</f:facet>
<h:outputText
value=
"#{entry.sort}"
/>
</div>
</h:column>
<h:column>
<h:link
outcome=
"/voting/submitEntry"
value=
"#{i18n['entry.edit']}"
>
<f:param
name=
"entryId"
value=
"#{entry.id}"
/>
</h:link>
</h:column>
</h:dataTable>
</h:form>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
</h:body>
</h:body>
...
...
code/LanBortalWeb/WebContent/voting/myEntries.xhtml
0 → 100644
View file @
a339c32
<!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:users=
"http://java.sun.com/jsf/composite/cditools/user"
xmlns:tools=
"http://java.sun.com/jsf/composite/cditools"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:p=
"http://primefaces.org/ui"
>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<f:metadata>
<f:event
type=
"preRenderView"
listener=
"#{userView.initView}"
/>
</f:metadata>
<ui:define
name=
"content"
>
<h1>
My entries
</h1>
<h:form>
<h:dataTable
styleClass=
"bordertable"
rowClasses=
"roweven,rowodd"
id=
"compolisttable"
value=
"#{userView.user.compoEntries}"
var=
"entry"
>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Name"
/>
</f:facet>
<h:outputText
value=
"#{entry.name}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Notes"
/>
</f:facet>
<h:outputText
value=
"#{entry.notes}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Screen message"
/>
</f:facet>
<h:outputText
value=
"#{entry.screenMessage}"
/>
</h:column>
<h:column>
<h:link
outcome=
"/voting/submitEntry"
value=
"#{i18n['entry.edit']}"
>
<f:param
name=
"entryId"
value=
"#{entry.id}"
/>
</h:link>
</h:column>
</h:dataTable>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
code/LanBortalWeb/WebContent/voting/submitEntry.xhtml
0 → 100644
View file @
a339c32
<!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:users=
"http://java.sun.com/jsf/composite/cditools/user"
xmlns:tools=
"http://java.sun.com/jsf/composite/cditools"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:p=
"http://primefaces.org/ui"
>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<f:metadata>
<f:viewParam
name=
"entryId"
value=
"#{compoView.entryId}"
/>
<f:event
type=
"preRenderView"
listener=
"#{compoView.initEntryView}"
/>
</f:metadata>
<ui:define
name=
"content"
>
<!-- <h:outputStylesheet library="style" name="insomnia2/css/actionlog.css" /> -->
<h1>
#{i18n['voting.compoentryadd.title']}
</h1>
<p>
#{i18n['voting.compoentryadd.description']} #{compoView.compo.name}
</p>
<h:form>
<h:panelGrid
columns=
"3"
>
<h:outputLabel
value=
"#{i18n['voting.compoentryadd.entryname']}"
for=
"name"
/>
<h:inputText
value=
"#{compoView.entry.name}"
id=
"name"
/>
<h:message
for=
"name"
/>
<h:outputLabel
value=
"#{i18n['voting.compoentryadd.notes']}"
for=
"notes"
/>
<h:inputTextarea
value=
"#{compoView.entry.notes}"
id=
"notes"
/>
<h:message
for=
"notes"
/>
<h:outputLabel
value=
"#{i18n['voting.compoentryadd.screenmessage']}"
for=
"screenmessage"
/>
<h:inputTextarea
value=
"#{compoView.entry.screenMessage}"
id=
"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.saveEntry()}"
value=
"#{i18n['voting.compoentrysave.button']}"
/>
</h:panelGrid>
</h:form>
<ui:fragment
rendered=
"#{!empty compoView.entry.id}"
>
<h:form
enctype=
"multipart/form-data"
>
<p:fileUpload
value=
"#{compoView.uploadedFile}"
id=
"uploadedfile"
mode=
"simple"
/>
<h:commandButton
action=
"#{compoView.submitEntryfile}"
value=
"#{i18n['compofile.upload']}"
/>
</h:form>
<h:form
rendered=
"#{!empty compoFileDownloadView.files}"
>
<h2>
<h:outputText
value=
"#{i18n['compofile.download.header']}"
/>
</h2>
<h:selectOneRadio
layout=
"pageDirection"
value=
"#{compoFileDownloadView.file}"
converter=
"#{compoFileConverter}"
>
<f:selectItems
var=
"fi"
value=
"#{compoFileDownloadView.files}"
itemLabel=
"#{fi.fileName} / #{fi.uploaded.time}"
/>
</h:selectOneRadio>
<h:commandButton
value=
"#{i18n['compofile.download']}"
>
<p:fileDownload
value=
"#{compoFileDownloadView.dlfile}"
/>
</h:commandButton>
</h:form>
</ui:fragment>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
code/LanBortalWeb/WebContent/voting/vote.xhtml
0 → 100644
View file @
a339c32
<!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:users=
"http://java.sun.com/jsf/composite/cditools/user"
xmlns:tools=
"http://java.sun.com/jsf/composite/cditools"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:p=
"http://primefaces.org/ui"
>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:define
name=
"content"
>
<!-- <h:outputStylesheet library="style" name="insomnia2/css/actionlog.css" /> -->
<h1>
Compo: #{votingDetailsView.compoName}
</h1>
<p>
Infoa compon entryistä
</p>
<h:form>
<h:dataTable
styleClass=
"bordertable"
rowClasses=
"roweven,rowodd"
id=
"compolisttable"
value=
"#{compoView..entries}"
var=
"entry"
>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"nimi"
/>
</f:facet>
<h:outputText
value=
"#{entry.name}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"notes"
/>
</f:facet>
<h:outputText
value=
"#{entry.notes}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"screenmessage"
/>
</f:facet>
<h:outputText
value=
"#{entry.screenMessage}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"creator"
/>
</f:facet>
<h:outputText
value=
"#{entry.creator.wholeName}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"sort"
/>
</f:facet>
<h:outputText
value=
"#{entry.sort}"
/>
</h:column>
<h:column>
<h:link
outcome=
"/voting/submitEntry"
value=
"#{i18n['entry.edit']}"
>
<f:param
name=
"entryId"
value=
"#{entry.id}"
/>
</h:link>
</h:column>
</h:dataTable>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_en.properties
View file @
a339c32
...
@@ -71,6 +71,12 @@ cardTemplate.name = Card template
...
@@ -71,6 +71,12 @@ cardTemplate.name = Card template
cardTemplate.power
=
Card power
cardTemplate.power
=
Card power
cardTemplate.roles
=
Associated roles
cardTemplate.roles
=
Associated roles
compo.edit
=
Edit compo
compofile.download
=
Download
compofile.download.header
=
Download file
compofile.upload
=
Upload file
discount.active
=
Active
discount.active
=
Active
discount.amountMax
=
Max amount
discount.amountMax
=
Max amount
discount.amountMin
=
Min amount
discount.amountMin
=
Min amount
...
@@ -92,6 +98,8 @@ editplace.header = Edit place
...
@@ -92,6 +98,8 @@ editplace.header = Edit place
editplacegroup.header
=
Placegroup information
editplacegroup.header
=
Placegroup information
entry.edit
=
Edit entry
event.defaultRole
=
Default user role
event.defaultRole
=
Default user role
event.edit
=
Edit
event.edit
=
Edit
event.endTime
=
End time
event.endTime
=
End time
...
@@ -450,6 +458,9 @@ submenu.useradmin.create = Create user
...
@@ -450,6 +458,9 @@ submenu.useradmin.create = Create user
submenu.useradmin.createCardTemplate
=
Create cardtemplate
submenu.useradmin.createCardTemplate
=
Create cardtemplate
submenu.useradmin.list
=
List users
submenu.useradmin.list
=
List users
submenu.useradmin.listCardTemplates
=
Card templates
submenu.useradmin.listCardTemplates
=
Card templates
submenu.voting.compolist
=
Compos
submenu.voting.create
=
Create new compo
submenu.voting.myEntries
=
My entries
supernavi.admin
=
Adminview
supernavi.admin
=
Adminview
supernavi.user
=
Userview
supernavi.user
=
Userview
...
@@ -458,6 +469,7 @@ template.loggedInAs = Logged in as:
...
@@ -458,6 +469,7 @@ template.loggedInAs = Logged in as:
topnavi.adminshop
=
Adminshop
topnavi.adminshop
=
Adminshop
topnavi.billing
=
Billing
topnavi.billing
=
Billing
topnavi.compos
=
Compos
topnavi.contents
=
Site contents
topnavi.contents
=
Site contents
topnavi.frontpage
=
Front page
topnavi.frontpage
=
Front page
topnavi.maps
=
Maps
topnavi.maps
=
Maps
...
@@ -562,6 +574,8 @@ voting.allcompos.submitEntry = Submit entry
...
@@ -562,6 +574,8 @@ voting.allcompos.submitEntry = Submit entry
voting.allcompos.submitStart
=
Submit start
voting.allcompos.submitStart
=
Submit start
voting.allcompos.voteEnd
=
Vote end
voting.allcompos.voteEnd
=
Vote end
voting.allcompos.voteStart
=
Vote start
voting.allcompos.voteStart
=
Vote start
voting.compo.submit
=
Submit entry
voting.compo.vote
=
Vote
voting.compoentryadd.button
=
Send
voting.compoentryadd.button
=
Send
voting.compoentryadd.description
=
Add new entry to compo
voting.compoentryadd.description
=
Add new entry to compo
voting.compoentryadd.entryname
=
Name
voting.compoentryadd.entryname
=
Name
...
@@ -570,6 +584,7 @@ voting.compoentryadd.notes = Notes
...
@@ -570,6 +584,7 @@ voting.compoentryadd.notes = Notes
voting.compoentryadd.screenmessage
=
Screenmessage
voting.compoentryadd.screenmessage
=
Screenmessage
voting.compoentryadd.title
=
Add entry
voting.compoentryadd.title
=
Add entry
voting.compoentryadd.uploadedFile
=
File to
voting.compoentryadd.uploadedFile
=
File to
voting.compoentrysave.button
=
Save
voting.create.compoEnd
=
End time
voting.create.compoEnd
=
End time
voting.create.compoStart
=
Start time
voting.create.compoStart
=
Start time
voting.create.createButton
=
Create
voting.create.createButton
=
Create
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_fi.properties
View file @
a339c32
...
@@ -69,6 +69,12 @@ cardTemplate.name = Korttipohja
...
@@ -69,6 +69,12 @@ cardTemplate.name = Korttipohja
cardTemplate.power
=
Teho
cardTemplate.power
=
Teho
cardTemplate.roles
=
Yhdistetyt roolit
cardTemplate.roles
=
Yhdistetyt roolit
compo.edit
=
Muokkaa compoa
compofile.download
=
lataa
compofile.download.header
=
Lataa tiedosto
compofile.upload
=
L
\u
00E4het
\u
00E4 tiedosto
discount.active
=
Aktiivinen
discount.active
=
Aktiivinen
discount.amountMax
=
Enimm
\u
00E4ism
\u
00E4
\u
00E4r
\u
00E4
discount.amountMax
=
Enimm
\u
00E4ism
\u
00E4
\u
00E4r
\u
00E4
discount.amountMin
=
V
\u
00E4himm
\u
00E4ism
\u
00E4
\u
00E4r
\u
00E4
discount.amountMin
=
V
\u
00E4himm
\u
00E4ism
\u
00E4
\u
00E4r
\u
00E4
...
@@ -90,6 +96,8 @@ editplace.header = Muokkaa paikkaa
...
@@ -90,6 +96,8 @@ editplace.header = Muokkaa paikkaa
editplacegroup.header
=
Paikkaryhm
\u
00E4n tiedot
editplacegroup.header
=
Paikkaryhm
\u
00E4n tiedot
entry.edit
=
Muokkaa
event.defaultRole
=
K
\u
00E4ytt
\u
00E4jien oletusrooli
event.defaultRole
=
K
\u
00E4ytt
\u
00E4jien oletusrooli
event.edit
=
Muokkaa
event.edit
=
Muokkaa
event.endTime
=
Lopetusp
\u
00E4iv
\u
00E4
event.endTime
=
Lopetusp
\u
00E4iv
\u
00E4
...
@@ -441,6 +449,9 @@ submenu.useradmin.create = Luo uusi k\u00E4ytt\u00E4j\u00E4
...
@@ -441,6 +449,9 @@ submenu.useradmin.create = Luo uusi k\u00E4ytt\u00E4j\u00E4
submenu.useradmin.createCardTemplate
=
Luo uusi korttipohja
submenu.useradmin.createCardTemplate
=
Luo uusi korttipohja
submenu.useradmin.list
=
Listaa k
\u
00E4ytt
\u
00E4j
\u
00E4t
submenu.useradmin.list
=
Listaa k
\u
00E4ytt
\u
00E4j
\u
00E4t
submenu.useradmin.listCardTemplates
=
Listaa korttipohjat
submenu.useradmin.listCardTemplates
=
Listaa korttipohjat
submenu.voting.compolist
=
Kilpailut
submenu.voting.create
=
Uusi kilpailu
submenu.voting.myEntries
=
Omat entryt
supernavi.admin
=
Yll
\u
00E4piton
\u
00E4kym
\u
00E4
supernavi.admin
=
Yll
\u
00E4piton
\u
00E4kym
\u
00E4
supernavi.user
=
K
\u
00E4ytt
\u
00E4j
\u
00E4n
\u
00E4kym
\u
00E4
supernavi.user
=
K
\u
00E4ytt
\u
00E4j
\u
00E4n
\u
00E4kym
\u
00E4
...
@@ -449,6 +460,7 @@ template.loggedInAs = Kirjautunut tunnuksella:
...
@@ -449,6 +460,7 @@ template.loggedInAs = Kirjautunut tunnuksella:
topnavi.adminshop
=
Kauppa
topnavi.adminshop
=
Kauppa
topnavi.billing
=
Laskutus
topnavi.billing
=
Laskutus
topnavi.compos
=
Kilpailut
topnavi.contents
=
Sivuston sis
\u
00E4lt
\u
00F6
topnavi.contents
=
Sivuston sis
\u
00E4lt
\u
00F6
topnavi.frontpage
=
Etusivu
topnavi.frontpage
=
Etusivu
topnavi.maps
=
Kartat
topnavi.maps
=
Kartat
...
@@ -549,6 +561,8 @@ voting.allcompos.submitEntry = L\u00E4het\u00E4 entry
...
@@ -549,6 +561,8 @@ voting.allcompos.submitEntry = L\u00E4het\u00E4 entry
voting.allcompos.submitStart
=
Lis
\u
00E4ys auki
voting.allcompos.submitStart
=
Lis
\u
00E4ys auki
voting.allcompos.voteEnd
=
\u
00C4
\u
00E4nestys kiinni
voting.allcompos.voteEnd
=
\u
00C4
\u
00E4nestys kiinni
voting.allcompos.voteStart
=
\u
00C4
\u
00E4nestys auki
voting.allcompos.voteStart
=
\u
00C4
\u
00E4nestys auki
voting.compo.submit
=
L
\u
00E4het
\u
00E4 kappale
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
=
Lis
\u
00E4
\u
00E4 uusi entry compoon
voting.compoentryadd.entryname
=
Nimi
voting.compoentryadd.entryname
=
Nimi
...
@@ -557,6 +571,7 @@ voting.compoentryadd.notes = Huomatuksia
...
@@ -557,6 +571,7 @@ voting.compoentryadd.notes = Huomatuksia
voting.compoentryadd.screenmessage
=
Screenmessage
voting.compoentryadd.screenmessage
=
Screenmessage
voting.compoentryadd.title
=
Lis
\u
00E4
\u
00E4 entry
voting.compoentryadd.title
=
Lis
\u
00E4
\u
00E4 entry
voting.compoentryadd.uploadedFile
=
asdsda
voting.compoentryadd.uploadedFile
=
asdsda
voting.compoentrysave.button
=
Tallenna
voting.create.compoEnd
=
Lopetusaika
voting.create.compoEnd
=
Lopetusaika
voting.create.compoStart
=
Aloitusaika
voting.create.compoStart
=
Aloitusaika
voting.create.createButton
=
Luo
voting.create.createButton
=
Luo
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/shop/ReaderView.java
View file @
a339c32
...
@@ -8,6 +8,9 @@ import javax.faces.model.ListDataModel;
...
@@ -8,6 +8,9 @@ import javax.faces.model.ListDataModel;
import
javax.inject.Inject
;
import
javax.inject.Inject
;
import
javax.inject.Named
;
import
javax.inject.Named
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
fi.insomnia.bortal.beans.ReaderBeanLocal
;
import
fi.insomnia.bortal.beans.ReaderBeanLocal
;
import
fi.insomnia.bortal.beans.UserBeanLocal
;
import
fi.insomnia.bortal.beans.UserBeanLocal
;
import
fi.insomnia.bortal.enums.apps.ShopPermission
;
import
fi.insomnia.bortal.enums.apps.ShopPermission
;
...
@@ -42,10 +45,14 @@ public class ReaderView extends GenericCDIView {
...
@@ -42,10 +45,14 @@ public class ReaderView extends GenericCDIView {
private
UserCardWrapper
neighborUser
;
private
UserCardWrapper
neighborUser
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ReaderView
.
class
);
public
String
createCardForUser
()
{
public
String
createCardForUser
()
{
UserCardWrapper
usr
=
userlist
.
getRowData
();
UserCardWrapper
usr
=
userlist
.
getRowData
();
logger
.
info
(
"Creating card for user {} from event {}"
,
usr
,
event
);
ReaderEvent
card
=
readerbean
.
createCard
(
event
,
usr
.
getUser
());
ReaderEvent
card
=
readerbean
.
createCard
(
event
,
usr
.
getUser
());
// super.addFaceMessage("Created card for user with id: " +
// card.getPrintedCard());
return
null
;
return
null
;
}
}
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/user/AccountEventView.java
View file @
a339c32
...
@@ -2,6 +2,7 @@ package fi.insomnia.bortal.web.cdiview.user;
...
@@ -2,6 +2,7 @@ package fi.insomnia.bortal.web.cdiview.user;
import
javax.ejb.EJB
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.ConversationScoped
;
import
javax.enterprise.context.ConversationScoped
;
import
javax.inject.Inject
;
import
javax.inject.Named
;
import
javax.inject.Named
;
import
fi.insomnia.bortal.beans.AccountEventBeanLocal
;
import
fi.insomnia.bortal.beans.AccountEventBeanLocal
;
...
@@ -20,16 +21,20 @@ public class AccountEventView extends GenericCDIView {
...
@@ -20,16 +21,20 @@ public class AccountEventView extends GenericCDIView {
@EJB
@EJB
private
transient
AccountEventBeanLocal
accounteventbean
;
private
transient
AccountEventBeanLocal
accounteventbean
;
@EJB
private
AccountEvent
accountevent
;
private
AccountEvent
accountevent
;
private
int
accountid
;
private
Integer
accountid
;
@Inject
private
UserView
userview
;
private
boolean
canSave
;
private
boolean
canSave
;
public
void
initView
()
{
public
void
initView
()
{
accountevent
=
accounteventbean
.
find
(
accountid
);
accountevent
=
accounteventbean
.
find
(
getAccountid
()
);
if
(
requirePermissions
(
permbean
.
isCurrentUser
(
accountevent
.
getUser
())
||
permbean
.
hasPermission
(
UserPermission
.
VIEW_ACCOUNTEVENTS
)))
{
if
(
requirePermissions
(
permbean
.
isCurrentUser
(
accountevent
.
getUser
())
||
permbean
.
hasPermission
(
UserPermission
.
VIEW_ACCOUNTEVENTS
)))
{
userview
.
setUser
(
accountevent
.
getUser
());
beginConversation
();
beginConversation
();
setCanSave
(
permbean
.
hasPermission
(
UserPermission
.
MODIFY_ACCOUNTEVENTS
));
setCanSave
(
permbean
.
hasPermission
(
UserPermission
.
MODIFY_ACCOUNTEVENTS
));
}
else
{
}
else
{
...
@@ -38,11 +43,25 @@ public class AccountEventView extends GenericCDIView {
...
@@ -38,11 +43,25 @@ public class AccountEventView extends GenericCDIView {
}
}
public
void
setAccountid
(
int
accountid
)
{
public
String
save
()
{
super
.
addFaceMessage
(
"accountevent.saved"
);
accountevent
=
accounteventbean
.
merge
(
accountevent
);
userview
.
setUser
(
accountevent
.
getUser
());
return
null
;
}
public
String
delete
()
{
accounteventbean
.
delete
(
accountevent
);
return
"/useradmin/accountEvents"
;
}
public
void
setAccountid
(
Integer
accountid
)
{
this
.
accountid
=
accountid
;
this
.
accountid
=
accountid
;
}
}
public
int
getAccountid
()
{
public
Integer
getAccountid
()
{
return
accountid
;
return
accountid
;
}
}
...
@@ -61,4 +80,13 @@ public class AccountEventView extends GenericCDIView {
...
@@ -61,4 +80,13 @@ public class AccountEventView extends GenericCDIView {
public
boolean
isCanSave
()
{
public
boolean
isCanSave
()
{
return
canSave
;
return
canSave
;
}
}
public
UserView
getUserview
()
{
return
userview
;
}
public
void
setUserview
(
UserView
userview
)
{
this
.
userview
=
userview
;
}
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/CompoFileDownloadView.java
0 → 100644
View file @
a339c32
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
voting
;
import
java.io.ByteArrayInputStream
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.RequestScoped
;
import
javax.faces.model.ListDataModel
;
import
javax.inject.Inject
;
import
javax.inject.Named
;
import
org.primefaces.model.DefaultStreamedContent
;
import
fi.insomnia.bortal.beans.VotingBeanLocal
;
import
fi.insomnia.bortal.model.CompoEntry
;
import
fi.insomnia.bortal.model.CompoEntryFile
;
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
@Named
@RequestScoped
public
class
CompoFileDownloadView
extends
GenericCDIView
{
private
static
final
long
serialVersionUID
=
-
262883747402530562L
;
@EJB
private
VotingBeanLocal
votebean
;
@Inject
private
CompoEntry
entry
;
private
ListDataModel
<
CompoEntryFile
>
files
;
private
CompoEntryFile
file
;
private
DefaultStreamedContent
dlfile
;
public
ListDataModel
<
CompoEntryFile
>
getFiles
()
{
if
(
files
==
null
)
{
files
=
new
ListDataModel
<
CompoEntryFile
>(
votebean
.
getEntryFiles
(
entry
));
}
return
files
;
}
public
CompoEntryFile
getFile
()
{
return
file
;
}
public
void
setFile
(
CompoEntryFile
file
)
{
this
.
file
=
file
;
if
(
file
!=
null
)
{
dlfile
=
new
DefaultStreamedContent
(
new
ByteArrayInputStream
(
file
.
getFileData
()),
file
.
getMimeType
(),
file
.
getFileName
());
}
}
public
DefaultStreamedContent
getDlfile
()
{
return
dlfile
;
}
public
void
setDlfile
(
DefaultStreamedContent
dlfile
)
{
this
.
dlfile
=
dlfile
;
}
public
CompoEntry
getEntry
()
{
return
entry
;
}
public
void
setEntry
(
CompoEntry
entry
)
{
this
.
entry
=
entry
;
}
public
void
setFiles
(
ListDataModel
<
CompoEntryFile
>
files
)
{
this
.
files
=
files
;
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/CompoView.java
0 → 100644
View file @
a339c32
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
voting
;
import
java.util.ArrayList
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.ConversationScoped
;
import
javax.enterprise.inject.Produces
;
import
javax.faces.model.ListDataModel
;
import
javax.inject.Named
;
import
org.primefaces.model.UploadedFile
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
fi.insomnia.bortal.beans.PermissionBeanLocal
;
import
fi.insomnia.bortal.beans.VotingBeanLocal
;
import
fi.insomnia.bortal.enums.apps.CompoPermission
;
import
fi.insomnia.bortal.model.Compo
;
import
fi.insomnia.bortal.model.CompoEntry
;
import
fi.insomnia.bortal.model.CompoEntryFile
;
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
@Named
@ConversationScoped
public
class
CompoView
extends
GenericCDIView
{
private
static
final
long
serialVersionUID
=
4166316634472472472L
;
@EJB
private
VotingBeanLocal
votbean
;
@EJB
private
PermissionBeanLocal
permbean
;
private
boolean
manage
;
private
ListDataModel
<
CompoWrapper
>
compolist
;
@Produces
private
CompoEntry
entry
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
CompoView
.
class
);
private
UploadedFile
uploadedFile
;
private
Compo
compo
;
private
Integer
entryId
;
public
ListDataModel
<
CompoWrapper
>
getCompos
()
{
return
compolist
;
}
public
void
initEntryView
()
{
if
(
entry
==
null
)
{
entry
=
votbean
.
findEntry
(
entryId
);
if
(
entry
==
null
||
!
super
.
requirePermissions
(
super
.
hasPermission
(
CompoPermission
.
MANAGE
)
||
permbean
.
isCurrentUser
(
entry
.
getCreator
())))
{
entry
=
null
;
}
else
{
super
.
beginConversation
();
}
}
}
public
String
voteCompo
()
{
compo
=
compolist
.
getRowData
().
getCompo
();
return
"/votes/vote"
;
}
public
String
submitEntry
()
{
setCompo
(
compolist
.
getRowData
().
getCompo
());
setEntry
(
new
CompoEntry
());
getEntry
().
setCompo
(
getCompo
());
return
"/voting/submitEntry"
;
}
public
String
createEntry
()
{
votbean
.
addEntry
(
getEntry
());
return
null
;
}
public
String
saveEntry
()
{
setEntry
(
votbean
.
saveEntry
(
getEntry
()));
return
null
;
}
public
String
submitEntryfile
()
{
CompoEntryFile
cef
=
new
CompoEntryFile
(
getEntry
());
cef
.
setFileData
(
this
.
getUploadedFile
().
getContents
());
cef
.
setFileName
(
getUploadedFile
().
getFileName
());
cef
.
setMimeType
(
getUploadedFile
().
getContentType
());
if
(
getEntry
().
getFiles
()
==
null
)
{
getEntry
().
setFiles
(
new
ArrayList
<
CompoEntryFile
>());
}
getEntry
().
getFiles
().
add
(
cef
);
getEntry
().
setCurrentFile
(
cef
);
setEntry
(
votbean
.
saveEntry
(
getEntry
()));
return
null
;
}
public
void
initListView
()
{
if
(
requirePermissions
(
CompoPermission
.
VIEW_COMPOS
)
&&
compolist
==
null
)
{
compolist
=
CompoWrapper
.
list
(
votbean
.
getCompoList
());
setManage
(
hasPermission
(
CompoPermission
.
MANAGE
));
logger
.
info
(
"Permission to view full compo listing."
);
super
.
beginConversation
();
}
else
{
logger
.
info
(
"Not enough rights to view full compo listing."
);
}
}
public
boolean
isManage
()
{
return
manage
;
}
public
void
setManage
(
boolean
manage
)
{
this
.
manage
=
manage
;
}
public
CompoEntry
getEntry
()
{
return
entry
;
}
public
void
setEntry
(
CompoEntry
entry
)
{
this
.
entry
=
entry
;
}
public
Compo
getCompo
()
{
return
compo
;
}
public
void
setCompo
(
Compo
compo
)
{
this
.
compo
=
compo
;
}
public
UploadedFile
getUploadedFile
()
{
return
uploadedFile
;
}
public
void
setUploadedFile
(
UploadedFile
uploadedFile
)
{
this
.
uploadedFile
=
uploadedFile
;
}
public
Integer
getEntryId
()
{
return
entryId
;
}
public
void
setEntryId
(
Integer
entryId
)
{
this
.
entryId
=
entryId
;
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/CompoWrapper.java
0 → 100644
View file @
a339c32
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
voting
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.List
;
import
javax.faces.model.ListDataModel
;
import
fi.insomnia.bortal.model.Compo
;
public
class
CompoWrapper
{
private
final
Compo
compo
;
public
CompoWrapper
(
Compo
c
)
{
compo
=
c
;
}
public
static
ListDataModel
<
CompoWrapper
>
list
(
List
<
Compo
>
list
)
{
ArrayList
<
CompoWrapper
>
ret
=
new
ArrayList
<
CompoWrapper
>();
for
(
Compo
c
:
list
)
{
ret
.
add
(
new
CompoWrapper
(
c
));
}
return
new
ListDataModel
<
CompoWrapper
>(
ret
);
}
public
boolean
isSubmit
()
{
Calendar
now
=
Calendar
.
getInstance
();
return
now
.
after
(
getCompo
().
getSubmitStart
())
&&
now
.
before
(
getCompo
().
getSubmitEnd
());
}
public
boolean
isVote
()
{
Calendar
now
=
Calendar
.
getInstance
();
return
!
getCompo
().
getHoldVoting
()
&&
now
.
after
(
getCompo
().
getVoteStart
())
&&
now
.
before
(
getCompo
().
getVoteEnd
());
}
public
Compo
getCompo
()
{
return
compo
;
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/VotingCompoListView.java
deleted
100644 → 0
View file @
5af2a9e
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
voting
;
import
java.util.List
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.RequestScoped
;
import
javax.inject.Named
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
fi.insomnia.bortal.beans.VotingBeanLocal
;
import
fi.insomnia.bortal.enums.apps.CompoPermission
;
import
fi.insomnia.bortal.model.Compo
;
import
fi.insomnia.bortal.model.Role
;
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
@Named
@RequestScoped
public
class
VotingCompoListView
extends
GenericCDIView
{
private
static
final
long
serialVersionUID
=
4166316634472472472L
;
@EJB
private
VotingBeanLocal
votbean
;
private
Role
role
;
boolean
curEntries
;
boolean
maxParts
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
VotingCompoListView
.
class
);
public
boolean
isCurEntries
()
{
return
curEntries
;
}
public
void
setCurEntries
(
boolean
curEntries
)
{
this
.
curEntries
=
curEntries
;
}
public
boolean
isMaxParts
()
{
return
maxParts
;
}
public
void
setMaxParts
(
boolean
maxParts
)
{
this
.
maxParts
=
maxParts
;
}
public
List
<
Compo
>
getCompos
()
{
return
votbean
.
getCompoList
();
}
public
void
initView
()
{
if
(
requirePermissions
(
CompoPermission
.
VIEW_COMPOS
)
&&
role
==
null
)
{
curEntries
=
true
;
maxParts
=
true
;
logger
.
info
(
"Permission to view full compo listing."
);
}
else
{
curEntries
=
false
;
maxParts
=
false
;
logger
.
info
(
"Not enough rights to view full compo listing."
);
}
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/converter/CompoFileConverter.java
0 → 100644
View file @
a339c32
package
fi
.
insomnia
.
bortal
.
web
.
converter
;
import
javax.ejb.EJB
;
import
javax.faces.bean.RequestScoped
;
import
javax.inject.Named
;
import
fi.insomnia.bortal.beans.VotingBeanLocal
;
import
fi.insomnia.bortal.model.CompoEntryFile
;
import
fi.insomnia.bortal.utilities.jsf.GenericIntegerEntityConverter
;
@Named
@RequestScoped
public
class
CompoFileConverter
extends
GenericIntegerEntityConverter
<
CompoEntryFile
>
{
@EJB
private
VotingBeanLocal
votebean
;
@Override
protected
CompoEntryFile
find
(
Integer
id
)
{
return
votebean
.
findEntryFile
(
id
);
}
}
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