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 5d3fcbb0
authored
May 12, 2012
by
Antti Tonkyra
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of dev.insomnia.fi:/data/bortal
2 parents
8fdabbb1
62422ab9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
5 deletions
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/VotingBeanLocal.java
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Compo.java
code/LanBortalWeb/WebContent/voting/create.xhtml
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/VotingCreateView.java
code/LanBortalBeansClient/ejbModule/fi/insomnia/bortal/beans/VotingBeanLocal.java
View file @
5d3fcbb
...
...
@@ -2,7 +2,9 @@ package fi.insomnia.bortal.beans;
import
javax.ejb.Local
;
import
fi.insomnia.bortal.model.Compo
;
@Local
public
interface
VotingBeanLocal
{
public
void
createCompo
(
Compo
c
);
}
code/LanBortalDatabase/src/fi/insomnia/bortal/model/Compo.java
View file @
5d3fcbb
...
...
@@ -51,7 +51,7 @@ public class Compo extends GenericEntity {
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Calendar
startTime
;
@Column
(
name
=
"compo_
start
"
)
@Column
(
name
=
"compo_
end
"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Calendar
endTime
;
...
...
code/LanBortalWeb/WebContent/voting/create.xhtml
View file @
5d3fcbb
...
...
@@ -55,7 +55,7 @@
<p:calendar
validator=
"#{votingDateValidator.validateSubmit}"
value=
"#{votingCreateView.submitEnd}"
pattern=
"dd/MM/yyyy HH:mm"
id=
"sEnd"
/>
<h:message
for=
"sEnd"
/>
<h:commandButton
value=
"#{i18n['voting.create.createButton']}"
/>
<h:commandButton
action=
"#{votingCreateView.send}"
value=
"#{i18n['voting.create.createButton']}"
/>
</h:panelGrid>
</h:form>
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/voting/VotingCreateView.java
View file @
5d3fcbb
package
fi
.
insomnia
.
bortal
.
web
.
cdiview
.
voting
;
import
java.util.Calendar
;
import
java.util.Date
;
import
javax.ejb.EJB
;
import
javax.enterprise.context.ConversationScoped
;
import
javax.enterprise.context.RequestScoped
;
import
javax.faces.bean.ManagedBean
;
import
javax.faces.bean.RequestScoped
;
import
javax.inject.Named
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.Size
;
...
...
@@ -12,6 +14,7 @@ import javax.validation.constraints.Size;
import
org.hibernate.validator.constraints.Length
;
import
fi.insomnia.bortal.beans.VotingBeanLocal
;
import
fi.insomnia.bortal.model.Compo
;
import
fi.insomnia.bortal.web.cdiview.GenericCDIView
;
@ManagedBean
...
...
@@ -32,8 +35,8 @@ public class VotingCreateView extends GenericCDIView {
private
String
description
;
@Min
(
value
=
1
,
message
=
"{voting.create.participantsError}"
)
private
Integer
maxParticipants
;
private
Date
compoStart
;
private
Date
compoStart
;
private
Date
compoEnd
;
private
Date
voteStart
;
private
Date
voteEnd
;
...
...
@@ -95,5 +98,38 @@ public class VotingCreateView extends GenericCDIView {
this
.
submitEnd
=
submitEnd
;
}
public
String
send
(){
Compo
co
=
new
Compo
();
co
.
setName
(
name
);
co
.
setDescription
(
description
);
co
.
setMaxParticipantCount
(
maxParticipants
);
Calendar
ct
=
Calendar
.
getInstance
();
ct
.
setTime
(
compoStart
);
co
.
setStartTime
(
ct
);
Calendar
ce
=
Calendar
.
getInstance
();
ce
.
setTime
(
compoEnd
);
co
.
setEndTime
(
ce
);
Calendar
vs
=
Calendar
.
getInstance
();
vs
.
setTime
(
voteStart
);
co
.
setVoteStart
(
vs
);
Calendar
ve
=
Calendar
.
getInstance
();
ve
.
setTime
(
voteEnd
);
co
.
setVoteEnd
(
ve
);
Calendar
ss
=
Calendar
.
getInstance
();
ss
.
setTime
(
submitStart
);
co
.
setSubmitStart
(
ss
);
Calendar
se
=
Calendar
.
getInstance
();
se
.
setTime
(
submitEnd
);
co
.
setSubmitEnd
(
se
);
votbean
.
createCompo
(
co
);
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