Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 1458594e
authored
May 13, 2012
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of dev.insomnia.fi:/data/bortal
2 parents
920b089c
cc1b9527
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
190 additions
and
0 deletions
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/OrgRoleBean.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/facade/OrgRoleFacade.java
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/OrgRoleBeanLocal.java
code/LanBortalWeb/WebContent/orgrole/list.xhtml
code/LanBortalWeb/WebContent/resources/cditools/orgrole/list.xhtml
code/LanBortalWeb/WebContent/voting/compolist.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/user/OrgRoleDataView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/VotingCompoAddEntryView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/VotingCompoListView.java
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/beans/OrgRoleBean.java
0 → 100644
View file @
1458594
package
fi
.
insomnia
.
bortal
.
beans
;
import
java.util.List
;
import
javax.ejb.EJB
;
import
javax.ejb.LocalBean
;
import
javax.ejb.Stateless
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
fi.insomnia.bortal.facade.OrgRoleFacade
;
import
fi.insomnia.bortal.model.OrgRole
;
/**
* Session Bean implementation class OrgRoleBean
*/
@Stateless
@LocalBean
public
class
OrgRoleBean
implements
OrgRoleBeanLocal
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
OrgRoleBean
.
class
);
@EJB
private
EventBeanLocal
eventBean
;
@EJB
private
OrgRoleFacade
orgRoleFacade
;
public
OrgRoleBean
()
{
}
@Override
public
List
<
OrgRole
>
listOrgRoles
()
{
return
orgRoleFacade
.
findByOrganizer
(
eventBean
.
getCurrentEvent
()
.
getOrganiser
());
}
}
code/LanBortalBeans/ejbModule/fi/insomnia/bortal/facade/OrgRoleFacade.java
View file @
1458594
...
...
@@ -58,4 +58,13 @@ public class OrgRoleFacade extends IntegerPkGenericFacade<OrgRole> {
return
getEm
().
createQuery
(
cq
).
getResultList
();
}
public
List
<
OrgRole
>
findByOrganizer
(
EventOrganiser
organiser
)
{
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
OrgRole
>
cq
=
cb
.
createQuery
(
OrgRole
.
class
);
Root
<
OrgRole
>
root
=
cq
.
from
(
OrgRole
.
class
);
cq
.
where
(
cb
.
equal
(
root
.
get
(
OrgRole_
.
eventOrganizer
),
organiser
));
return
getEm
().
createQuery
(
cq
).
getResultList
();
}
}
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/OrgRoleBeanLocal.java
0 → 100644
View file @
1458594
package
fi
.
insomnia
.
bortal
.
beans
;
import
java.util.List
;
import
javax.ejb.Local
;
import
fi.insomnia.bortal.model.OrgRole
;
@Local
public
interface
OrgRoleBeanLocal
{
List
<
OrgRole
>
listOrgRoles
();
}
code/LanBortalWeb/WebContent/orgrole/list.xhtml
0 → 100644
View file @
1458594
<!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:orgrole=
"http://java.sun.com/jsf/composite/cditools/orgrole"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
>
<h:body>
<ui:composition
template=
"/layout/#{sessionHandler.layout}/template.xhtml"
>
<ui:param
name=
"thispage"
value=
"page.orgrole.list"
/>
<f:metadata>
<f:event
type=
"preRenderView"
listener=
"#{orgRoleView.permissionRead()}"
/>
</f:metadata>
<ui:define
name=
"content"
>
<orgrole:list
/>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
code/LanBortalWeb/WebContent/resources/cditools/orgrole/list.xhtml
0 → 100644
View file @
1458594
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
xmlns:h=
"http://java.sun.com/jsf/html"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:composite=
"http://java.sun.com/jsf/composite"
xmlns:ui=
"http://java.sun.com/jsf/facelets"
xmlns:c=
"http://java.sun.com/jsp/jstl/core"
xmlns:tools=
"http://java.sun.com/jsf/composite/tools"
>
<composite:interface>
</composite:interface>
<composite:implementation>
<h:form
id=
"orgrolelist"
>
<h:dataTable
border=
"1"
id=
"user"
value=
"#{orgRoleDataView.orgRoles}"
var=
"orgRole"
>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#"
/>
</f:facet>
<h:outputText
value=
"#{orgRole.id}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"#{i18n['orgrole.name']}"
/>
</f:facet>
<h:outputText
value=
"#{orgRole.name}"
/>
</h:column>
<h:column>
<h:link
outcome=
"/orgrole/edit"
value=
"#{i18n['orgrole.edit']}"
>
<f:param
name=
"orgroleid"
value=
"#{orgRole.id}"
/>
</h:link>
</h:column>
</h:dataTable>
</h:form>
</composite:implementation>
</html>
\ No newline at end of file
code/LanBortalWeb/WebContent/voting/compolist.xhtml
View file @
1458594
...
...
@@ -93,6 +93,15 @@
<f:convertDateTime
type=
"both"
pattern=
"dd.MM.yyyy HH:mm"
/>
</h:outputText>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Submit entry"
/>
</f:facet>
<h:link
outcome=
"addentry"
>
<f:param
name=
"compoId"
value=
"#{compo.id}"
/>
Submit entry
</h:link>
</h:column>
</h:dataTable>
</div>
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_en.properties
View file @
1458594
...
...
@@ -526,6 +526,8 @@ userview.userExists = Username already exists! please select another.
viewexpired.body
=
Please login again.
viewexpired.title
=
Login expired. Please login again.
voting.allcompos.description
=
List of all compos and NIIDEN information.
voting.allcompos.header
=
All compos
voting.create.compoEnd
=
End time
voting.create.compoStart
=
Start time
voting.create.createButton
=
Create
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/resources/i18n_fi.properties
View file @
1458594
...
...
@@ -516,6 +516,8 @@ userview.userExists = K\u00E4ytt\u00E4j\u00E4tunnus on jo olemassa. Ole
viewexpired.body
=
Ole hyv
\u
00E4 ja kirjaudu sis
\u
00E4
\u
00E4n uudelleen.
viewexpired.title
=
N
\u
00E4kym
\u
00E4 on vanhentunut
voting.allcompos.description
=
Compojen informaatiot.
voting.allcompos.header
=
Kaikki compot
voting.create.compoEnd
=
Lopetusaika
voting.create.compoStart
=
Aloitusaika
voting.create.createButton
=
Luo
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/user/OrgRoleDataView.java
0 → 100644
View file @
1458594
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
user
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.RequestScoped
;
import
javax.faces.model.ListDataModel
;
import
javax.inject.Named
;
import
fi.insomnia.bortal.beans.OrgRoleBeanLocal
;
import
fi.insomnia.bortal.model.OrgRole
;
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
@Named
@RequestScoped
public
class
OrgRoleDataView
extends
GenericCDIView
{
private
static
final
long
serialVersionUID
=
-
607046631885684171L
;
private
transient
ListDataModel
<
OrgRole
>
orgRoles
;
@EJB
OrgRoleBeanLocal
orgRolesBean
;
public
ListDataModel
<
OrgRole
>
getOrgRoles
()
{
if
(
orgRoles
==
null
)
{
orgRoles
=
new
ListDataModel
<
OrgRole
>(
orgRolesBean
.
listOrgRoles
());
}
return
orgRoles
;
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/VotingCompoAddEntryView.java
View file @
1458594
...
...
@@ -28,6 +28,14 @@ public class VotingCompoAddEntryView {
private
Integer
compoId
;
public
Integer
getCompoId
()
{
return
compoId
;
}
public
void
setCompoId
(
Integer
compoId
)
{
this
.
compoId
=
compoId
;
}
public
UploadedFile
getUploadedFile
()
{
return
uploadedFile
;
}
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/VotingCompoListView.java
View file @
1458594
...
...
@@ -7,6 +7,8 @@ import javax.enterprise.context.RequestScoped;
import
javax.faces.bean.ManagedBean
;
import
javax.inject.Named
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
fi.insomnia.bortal.beans.VotingBeanLocal
;
import
fi.insomnia.bortal.model.Compo
;
...
...
@@ -29,6 +31,8 @@ public class VotingCompoListView extends GenericCDIView {
boolean
curEntries
;
boolean
maxParts
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
VotingCompoListView
.
class
);
public
boolean
isCurEntries
()
{
return
curEntries
;
}
...
...
@@ -55,10 +59,12 @@ public class VotingCompoListView extends GenericCDIView {
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."
);
}
}
...
...
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