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 eda91b75
authored
May 12, 2012
by
Juho Salli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compolist-juttuja
1 parent
5d3fcbb0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
144 additions
and
42 deletions
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/VotingBeanLocal.java
code/LanBortalWeb/WebContent/WEB-INF/faces-config.xml
code/LanBortalWeb/WebContent/voting/compolist.xhtml
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/VotingCompoListView.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/VotingCreateView.java
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/VotingBeanLocal.java
View file @
eda91b7
package
fi
.
insomnia
.
bortal
.
beans
;
package
fi
.
insomnia
.
bortal
.
beans
;
import
java.util.List
;
import
javax.ejb.Local
;
import
javax.ejb.Local
;
import
fi.insomnia.bortal.model.Compo
;
import
fi.insomnia.bortal.model.Compo
;
...
@@ -7,4 +9,5 @@ import fi.insomnia.bortal.model.Compo;
...
@@ -7,4 +9,5 @@ import fi.insomnia.bortal.model.Compo;
@Local
@Local
public
interface
VotingBeanLocal
{
public
interface
VotingBeanLocal
{
public
void
createCompo
(
Compo
c
);
public
void
createCompo
(
Compo
c
);
public
List
<
Compo
>
getCompoList
();
}
}
code/LanBortalWeb/WebContent/WEB-INF/faces-config.xml
View file @
eda91b7
...
@@ -117,6 +117,15 @@
...
@@ -117,6 +117,15 @@
<redirect
/>
<redirect
/>
</navigation-case>
</navigation-case>
</navigation-rule>
</navigation-rule>
<navigation-rule>
<display-name>
voting/create
</display-name>
<from-view-id>
/voting/create.xhtml
</from-view-id>
<navigation-case>
<from-outcome>
success
</from-outcome>
<to-view-id>
/voting/compolist.xhtml
</to-view-id>
<redirect
/>
</navigation-case>
</navigation-rule>
</faces-config>
</faces-config>
...
...
code/LanBortalWeb/WebContent/voting/compolist.xhtml
View file @
eda91b7
<!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:tools=
"http://java.sun.com/jsf/composite/cditools"
xmlns:f=
"http://java.sun.com/jsf/core"
xmlns:p=
"http://primefaces.org/ui"
>
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="#{newsListView.initView}" /-->
<!-- <f:event type="preRenderView" listener="#{votingCompoListView.initView}" /> -->
</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>
<div
class=
"clearfix"
></div>
<div
id=
"compolist"
>
</ui:define>
</ui:composition>
<h:dataTable
styleClass=
"bordertable"
rowClasses=
"roweven,rowodd"
id=
"compolisttable"
value=
"#{votingCompoListView.compos}"
var=
"compo"
>
</h:body>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Name"
/>
</f:facet>
<h:outputText
value=
"#{compo.name}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Kuvaus"
/>
</f:facet>
<h:outputText
value=
"#{compo.description}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Max parts"
/>
</f:facet>
<h:outputText
value=
"#{compo.maxParticipantCount}"
/>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Start time"
/>
</f:facet>
<h:outputText
value=
"#{compo.startTime.time}"
>
<f:convertDateTime
type=
"both"
pattern=
"dd.MM.yyyy HH:mm"
/>
</h:outputText>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"End time"
/>
</f:facet>
<h:outputText
value=
"#{compo.endTime.time}"
>
<f:convertDateTime
type=
"both"
pattern=
"dd.MM.yyyy HH:mm"
/>
</h:outputText>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Vote start"
/>
</f:facet>
<h:outputText
value=
"#{compo.voteStart.time}"
>
<f:convertDateTime
type=
"both"
pattern=
"dd.MM.yyyy HH:mm"
/>
</h:outputText>
</h:column>
<h:column>
<f:facet
name=
"header"
>
<h:outputText
value=
"Vote end"
/>
</f:facet>
<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=
"Submit start"
/>
</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=
"Submit end"
/>
</f:facet>
<h:outputText
value=
"#{compo.submitEnd.time}"
>
<f:convertDateTime
type=
"both"
pattern=
"dd.MM.yyyy HH:mm"
/>
</h:outputText>
</h:column>
</h:dataTable>
</div>
</ui:define>
</ui:composition>
</h:body>
</html>
</html>
\ No newline at end of file
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/VotingCompoListView.java
View file @
eda91b7
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
voting
;
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
voting
;
import
javax.faces.bean.RequestScoped
;
import
javax.inject.Named
;
import
java.util.List
;
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
import
javax.ejb.EJB
;
import
javax.faces.bean.ManagedBean
;
@Named
import
javax.faces.bean.RequestScoped
;
@RequestScoped
import
javax.inject.Named
;
public
class
VotingCompoListView
extends
GenericCDIView
{
import
fi.insomnia.bortal.beans.VotingBeanLocal
;
/**
import
fi.insomnia.bortal.model.Compo
;
*
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
*/
private
static
final
long
serialVersionUID
=
4166316634472472472L
;
@ManagedBean
@Named
}
@RequestScoped
public
class
VotingCompoListView
extends
GenericCDIView
{
/**
*
*/
private
static
final
long
serialVersionUID
=
4166316634472472472L
;
@EJB
private
VotingBeanLocal
votbean
;
public
List
<
Compo
>
getCompos
()
{
return
votbean
.
getCompoList
();
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/VotingCreateView.java
View file @
eda91b7
...
@@ -128,7 +128,7 @@ public class VotingCreateView extends GenericCDIView {
...
@@ -128,7 +128,7 @@ public class VotingCreateView extends GenericCDIView {
se
.
setTime
(
submitEnd
);
se
.
setTime
(
submitEnd
);
co
.
setSubmitEnd
(
se
);
co
.
setSubmitEnd
(
se
);
votbean
.
createCompo
(
co
);
votbean
.
createCompo
(
co
);
return
"success
.
"
;
return
"success"
;
}
}
...
...
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