Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Riina Antikainen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 49b442a1
authored
Aug 31, 2013
by
Juho Salli
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'devel' of codecrew.fi:bortal into devel
2 parents
81f2aa0b
afc66ba9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
121 additions
and
13 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/MenuBean.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/MenuitemFacade.java
code/MoyaWeb/WebContent/voting/admincompolist.xhtml
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/MenuBean.java
View file @
49b442a
...
...
@@ -79,7 +79,7 @@ public class MenuBean implements MenuBeanLocal {
usermenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/permissionDenied"
),
null
).
setVisible
(
false
);
usermenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/auth/login"
),
null
).
setVisible
(
false
);
usermenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/auth/loginError"
),
null
).
setVisible
(
false
);
//
usermenu.addPage(menuitemfacade.findOrCreate("/auth/logout"), null).setVisible(false); // disabled
//
usermenu.addPage(menuitemfacade.findOrCreate("/auth/logout"), null).setVisible(false); // disabled
usermenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/auth/logoutResponse"
),
null
).
setVisible
(
false
);
usermenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/auth/resetPassword"
),
null
).
setVisible
(
false
);
usermenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/auth/resetmailSent"
),
null
).
setVisible
(
false
);
...
...
@@ -153,7 +153,9 @@ public class MenuBean implements MenuBeanLocal {
adminroles
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/role/list"
),
UserPermission
.
READ_ROLES
);
adminroles
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/role/create"
),
UserPermission
.
WRITE_ROLES
);
adminroles
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/role/edit"
),
null
).
setVisible
(
false
);
adminroles
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/orgrole/list"
),
UserPermission
.
READ_ORGROLES
);
adminroles
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/orgrole/create"
),
UserPermission
.
WRITE_ORGROLES
);
MenuNavigation
adminEventCards
=
adminuser
.
addPage
(
null
,
null
);
adminEventCards
.
setKey
(
"subnavi.cards"
);
adminEventCards
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/useradmin/listCardTemplates"
),
UserPermission
.
READ_ROLES
);
...
...
@@ -198,8 +200,8 @@ public class MenuBean implements MenuBeanLocal {
MenuNavigation
mapnavi
=
adminPlaces
.
addPage
(
null
,
null
);
mapnavi
.
setKey
(
"topnavi.maps"
);
mapnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/map/list"
),
MapPermission
.
MANAGE_MAPS
);
mapnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/map/create"
),
MapPermission
.
MANAGE_MAPS
);
mapnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/map/list"
),
MapPermission
.
MANAGE_MAPS
);
mapnavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/map/edit"
),
null
).
setVisible
(
false
);
...
...
@@ -218,6 +220,15 @@ public class MenuBean implements MenuBeanLocal {
lognavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/actionlog/messagelist"
),
UserPermission
.
VIEW_ALL
);
lognavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/actionlog/taskview"
),
UserPermission
.
VIEW_ALL
).
setVisible
(
false
);
MenuNavigation
compoMenu
=
adminevent
.
addPage
(
null
,
null
);
compoMenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/voting/admincompolist"
),
CompoPermission
.
VIEW_COMPOS
);
compoMenu
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/voting/create"
),
CompoPermission
.
MANAGE
);
MenuNavigation
gamenavi
=
adminevent
.
addPage
(
null
,
null
);
gamenavi
.
setKey
(
"topnavi.license"
);
gamenavi
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/license/manageCodes"
),
LicensePermission
.
MANAGE
);
adminevent
.
addPage
(
menuitemfacade
.
findOrCreate
(
"/eventorg/list"
),
EventPermission
.
MANAGE_PROPERTIES
);
navifacade
.
create
(
adminmenu
);
...
...
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/MenuitemFacade.java
View file @
49b442a
...
...
@@ -6,6 +6,9 @@ import javax.persistence.criteria.CriteriaBuilder;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Root
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
fi.codecrew.moya.model.Menuitem_
;
import
fi.codecrew.moya.model.Menuitem
;
...
...
@@ -13,6 +16,9 @@ import fi.codecrew.moya.model.Menuitem;
@LocalBean
public
class
MenuitemFacade
extends
IntegerPkGenericFacade
<
Menuitem
>
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
MenuitemFacade
.
class
);
public
MenuitemFacade
()
{
super
(
Menuitem
.
class
);
...
...
@@ -23,17 +29,23 @@ public class MenuitemFacade extends IntegerPkGenericFacade<Menuitem> {
return
null
;
}
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
Menuitem
>
cq
=
cb
.
createQuery
(
Menuitem
.
class
);
Root
<
Menuitem
>
root
=
cq
.
from
(
Menuitem
.
class
);
cq
.
where
(
cb
.
equal
(
root
.
get
(
Menuitem_
.
url
),
url
));
Menuitem
ret
=
super
.
getSingleNullableResult
(
getEm
().
createQuery
(
cq
));
if
(
ret
==
null
)
{
ret
=
new
Menuitem
();
ret
.
setUrl
(
url
);
create
(
ret
);
try
{
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
Menuitem
>
cq
=
cb
.
createQuery
(
Menuitem
.
class
);
Root
<
Menuitem
>
root
=
cq
.
from
(
Menuitem
.
class
);
cq
.
where
(
cb
.
equal
(
root
.
get
(
Menuitem_
.
url
),
url
));
Menuitem
ret
=
super
.
getSingleNullableResult
(
getEm
()
.
createQuery
(
cq
));
if
(
ret
==
null
)
{
ret
=
new
Menuitem
();
ret
.
setUrl
(
url
);
create
(
ret
);
}
return
ret
;
}
catch
(
Throwable
e
)
{
logger
.
warn
(
"Exception menussa"
+
url
,
e
);
}
return
ret
;
return
null
;
}
}
code/MoyaWeb/WebContent/voting/admincompolist.xhtml
0 → 100644
View file @
49b442a
<!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=
"#{sessionHandler.template}"
>
<f:metadata>
<f:event
type=
"preRenderView"
listener=
"#{compoView.initListView()}"
/>
</f:metadata>
<ui:define
name=
"content"
>
<h:outputStylesheet
library=
"style"
name=
"insomnia2/css/actionlog.css"
/>
<h1>
#{i18n['voting.allcompos.header']}
</h1>
<p>
#{i18n['voting.allcompos.description']}
</p>
<h:form>
<h:dataTable
styleClass=
"bordertable"
rowClasses=
"roweven,rowodd"
id=
"compolisttable"
value=
"#{compoView.compos}"
var=
"compo"
>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['voting.allcompos.name']}"
/>
</f:facet>
<h:outputText
value=
"#{compo.name}"
/>
</h:column>
<!-- <h:column rendered="#{compoView.curEntries}"> -->
<!-- <f:facet name="header"> -->
<!-- <h:outputText value="#{i18n['voting.allcompos.curEntries']}" /> -->
<!-- </f:facet> -->
<!-- <h:outputText value="#{compoEntries.size()}" /> -->
<!-- </h:column> -->
<!-- <h:column rendered="#{compoView.maxParts}"> -->
<!-- <f:facet name="header"> -->
<!-- <h:outputText value="#{i18n['voting.allcompos.maxParts']}" /> -->
<!-- </f:facet> -->
<!-- <h:outputText value="#{compo.maxParticipantCount}" /> -->
<!-- </h:column> -->
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['voting.allcompos.startTime']}"
/>
</f:facet>
<h:outputText
value=
"#{compo.startTime.time}"
>
<f:convertDateTime
pattern=
"#{sessionHandler.datetimeFormat}"
timeZone=
"#{sessionHandler.timezone}"
/>
</h:outputText>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['voting.allcompos.voteEnd']}"
/>
</f:facet>
<h:outputText
value=
"#{compo.voteEnd.time}"
>
<f:convertDateTime
pattern=
"#{sessionHandler.datetimeFormat}"
timeZone=
"#{sessionHandler.timezone}"
/>
</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
pattern=
"#{sessionHandler.datetimeFormat}"
timeZone=
"#{sessionHandler.timezone}"
/>
</h:outputText>
</h:column>
<h:column>
<h:commandButton
rendered=
"#{compo.vote or compoView.manage}"
action=
"#{compoView.startVote()}"
value=
"#{i18n['voting.compo.vote']}"
/>
</h:column>
<h:column>
<h:commandButton
rendered=
"#{compo.submit or compoView.manage}"
action=
"#{compoView.submitEntry()}"
value=
"#{i18n['voting.compo.submit']}"
/>
</h:column>
<h:column
rendered=
"#{compoView.manage}"
>
<h:link
outcome=
"details"
value=
"#{i18n['compo.edit']}"
>
<f:param
name=
"compoId"
value=
"#{compo.id}"
/>
</h:link>
</h:column>
</h:dataTable>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
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