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 35d1d257
authored
Sep 01, 2013
by
Antti Tonkyra
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement endConversation for GenericCDIBean, tournament stuff
1 parent
e772f104
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
4 deletions
code/MoyaDatabase/src/fi/codecrew/moya/model/TournamentRule.java
code/MoyaWeb/WebContent/tournaments/admin/index.xhtml
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/GenericCDIView.java
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/tournaments/TournamentCreateView.java
code/MoyaDatabase/src/fi/codecrew/moya/model/TournamentRule.java
View file @
35d1d25
...
@@ -21,7 +21,7 @@ import org.eclipse.persistence.annotations.OptimisticLockingType;
...
@@ -21,7 +21,7 @@ import org.eclipse.persistence.annotations.OptimisticLockingType;
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
public
class
TournamentRule
extends
GenericEntity
implements
Serializable
{
public
class
TournamentRule
extends
GenericEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@Column
(
name
=
"name"
)
@Column
(
name
=
"name"
)
private
String
name
;
private
String
name
;
...
@@ -70,6 +70,4 @@ public class TournamentRule extends GenericEntity implements Serializable {
...
@@ -70,6 +70,4 @@ public class TournamentRule extends GenericEntity implements Serializable {
public
void
setTournamentGame
(
TournamentGame
tournamentGame
)
{
public
void
setTournamentGame
(
TournamentGame
tournamentGame
)
{
this
.
tournamentGame
=
tournamentGame
;
this
.
tournamentGame
=
tournamentGame
;
}
}
}
}
code/MoyaWeb/WebContent/tournaments/admin/index.xhtml
View file @
35d1d25
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
</p:column>
</p:column>
</p:dataTable>
</p:dataTable>
<h:form>
<h:form>
<p:commandButton
value=
"#{i18n['tournament.admin.create']}"
action=
"#{tournamentAdminView.create}"
/>
<p:commandButton
value=
"#{i18n['tournament.admin.create']}"
action=
"#{tournamentAdminView.create}"
/>
</h:form>
</h:form>
</ui:define>
</ui:define>
</ui:composition>
</ui:composition>
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/GenericCDIView.java
View file @
35d1d25
...
@@ -41,6 +41,10 @@ public abstract class GenericCDIView implements Serializable {
...
@@ -41,6 +41,10 @@ public abstract class GenericCDIView implements Serializable {
}
}
}
}
public
void
endConversation
()
{
if
(!
conversation
.
isTransient
())
conversation
.
end
();
}
public
boolean
hasPermission
(
IAppPermission
perm
)
{
public
boolean
hasPermission
(
IAppPermission
perm
)
{
// boolean ret =
// boolean ret =
// FacesContext.getCurrentInstance().getExternalContext().isUserInRole(perm.getFullName());
// FacesContext.getCurrentInstance().getExternalContext().isUserInRole(perm.getFullName());
...
...
code/MoyaWeb/src/fi/codecrew/moya/web/cdiview/tournaments/TournamentCreateView.java
View file @
35d1d25
...
@@ -14,6 +14,7 @@ import fi.codecrew.moya.model.TournamentRule;
...
@@ -14,6 +14,7 @@ import fi.codecrew.moya.model.TournamentRule;
import
fi.codecrew.moya.web.cdiview.GenericCDIView
;
import
fi.codecrew.moya.web.cdiview.GenericCDIView
;
import
javax.ejb.EJB
;
import
javax.ejb.EJB
;
import
javax.ejb.Remove
;
import
javax.enterprise.context.ConversationScoped
;
import
javax.enterprise.context.ConversationScoped
;
import
javax.faces.event.ActionEvent
;
import
javax.faces.event.ActionEvent
;
import
javax.inject.Named
;
import
javax.inject.Named
;
...
@@ -63,6 +64,7 @@ public class TournamentCreateView extends GenericCDIView {
...
@@ -63,6 +64,7 @@ public class TournamentCreateView extends GenericCDIView {
tournamentBean
.
createTournament
(
tournament
);
tournamentBean
.
createTournament
(
tournament
);
this
.
endConversation
();
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