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 d9cdc68a
authored
May 11, 2013
by
Tuukka Kivilahti
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'devel' of codecrew.fi:bortal into devel
2 parents
4d00867f
6dedebc5
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
512 additions
and
1 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/TournamentFacade.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/TournamentGameFacade.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/TournamentMatchFacade.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/TournamentMatchResultFacade.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/TournamentParticipantFacade.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/TournamentRuleFacade.java
code/MoyaDatabase/src/fi/codecrew/moya/model/Tournament.java
code/MoyaDatabase/src/fi/codecrew/moya/model/TournamentGame.java
code/MoyaDatabase/src/fi/codecrew/moya/model/TournamentMatch.java
code/MoyaDatabase/src/fi/codecrew/moya/model/TournamentMatchResult.java
code/MoyaDatabase/src/fi/codecrew/moya/model/TournamentParticipant.java
code/MoyaDatabase/src/fi/codecrew/moya/model/TournamentRule.java
code/MoyaUtilities/src/fi/codecrew/moya/enums/MatchStatus.java
code/MoyaUtilities/src/fi/codecrew/moya/enums/TournamentStatus.java
code/MoyaUtilities/src/fi/codecrew/moya/enums/TournamentType.java
code/MoyaWeb/WebContent/WEB-INF/web.xml
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/TournamentFacade.java
0 → 100644
View file @
d9cdc68
package
fi
.
codecrew
.
moya
.
facade
;
import
javax.ejb.LocalBean
;
import
javax.ejb.Stateless
;
import
fi.codecrew.moya.model.Tournament
;
@Stateless
@LocalBean
public
class
TournamentFacade
extends
IntegerPkGenericFacade
<
Tournament
>
{
public
TournamentFacade
()
{
super
(
Tournament
.
class
);
}
}
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/TournamentGameFacade.java
0 → 100644
View file @
d9cdc68
package
fi
.
codecrew
.
moya
.
facade
;
import
javax.ejb.LocalBean
;
import
javax.ejb.Stateless
;
import
fi.codecrew.moya.model.TournamentGame
;
@Stateless
@LocalBean
public
class
TournamentGameFacade
extends
IntegerPkGenericFacade
<
TournamentGame
>
{
public
TournamentGameFacade
()
{
super
(
TournamentGame
.
class
);
}
}
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/TournamentMatchFacade.java
0 → 100644
View file @
d9cdc68
package
fi
.
codecrew
.
moya
.
facade
;
import
javax.ejb.LocalBean
;
import
javax.ejb.Stateless
;
import
fi.codecrew.moya.model.TournamentMatch
;
@Stateless
@LocalBean
public
class
TournamentMatchFacade
extends
IntegerPkGenericFacade
<
TournamentMatch
>
{
public
TournamentMatchFacade
()
{
super
(
TournamentMatch
.
class
);
}
}
\ No newline at end of file
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/TournamentMatchResultFacade.java
0 → 100644
View file @
d9cdc68
package
fi
.
codecrew
.
moya
.
facade
;
import
javax.ejb.LocalBean
;
import
javax.ejb.Stateless
;
import
fi.codecrew.moya.model.TournamentMatchResult
;
@Stateless
@LocalBean
public
class
TournamentMatchResultFacade
extends
IntegerPkGenericFacade
<
TournamentMatchResult
>
{
public
TournamentMatchResultFacade
()
{
super
(
TournamentMatchResult
.
class
);
}
}
\ No newline at end of file
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/TournamentParticipantFacade.java
0 → 100644
View file @
d9cdc68
package
fi
.
codecrew
.
moya
.
facade
;
import
javax.ejb.LocalBean
;
import
javax.ejb.Stateless
;
import
fi.codecrew.moya.model.TournamentParticipant
;
@Stateless
@LocalBean
public
class
TournamentParticipantFacade
extends
IntegerPkGenericFacade
<
TournamentParticipant
>
{
public
TournamentParticipantFacade
()
{
super
(
TournamentParticipant
.
class
);
}
}
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/TournamentRuleFacade.java
0 → 100644
View file @
d9cdc68
package
fi
.
codecrew
.
moya
.
facade
;
import
javax.ejb.LocalBean
;
import
javax.ejb.Stateless
;
import
fi.codecrew.moya.model.TournamentRule
;
@Stateless
@LocalBean
public
class
TournamentRuleFacade
extends
IntegerPkGenericFacade
<
TournamentRule
>
{
public
TournamentRuleFacade
()
{
super
(
TournamentRule
.
class
);
}
}
code/MoyaDatabase/src/fi/codecrew/moya/model/Tournament.java
0 → 100644
View file @
d9cdc68
package
fi
.
codecrew
.
moya
.
model
;
import
fi.codecrew.moya.enums.TournamentStatus
;
import
fi.codecrew.moya.enums.TournamentType
;
import
fi.codecrew.moya.model.GenericEntity
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
import
javax.persistence.*
;
import
org.eclipse.persistence.annotations.OptimisticLocking
;
import
org.eclipse.persistence.annotations.OptimisticLockingType
;
/**
* Entity implementation class for Entity: Tournament
*
*/
@Entity
@Table
(
name
=
"tournaments"
)
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
public
class
Tournament
extends
GenericEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Column
(
name
=
"talyn_tournament_id"
,
nullable
=
true
)
private
Integer
talynTournamentId
;
@JoinColumn
(
name
=
"event_id"
,
nullable
=
false
)
private
LanEvent
lanEvent
;
@Column
(
name
=
"tournament_name"
)
private
String
tournamentName
;
@Column
(
name
=
"registration_opens_at"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Date
registrationOpensAt
;
@Column
(
name
=
"registration_closes_at"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Date
registrationClosesAt
;
@Column
(
name
=
"begins_at"
)
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Date
beginsAt
;
@Column
(
name
=
"tournament_type"
)
@Enumerated
(
EnumType
.
STRING
)
private
TournamentType
tournamentType
;
@Column
(
name
=
"tournament_status"
)
@Enumerated
(
EnumType
.
STRING
)
private
TournamentStatus
tournamentStatus
;
@JoinColumn
(
name
=
"tournament_root"
)
private
TournamentMatch
tournamentRoot
;
@Column
(
name
=
"players_per_match"
)
private
Integer
playersPerMatch
;
@Column
(
name
=
"players_per_team"
)
private
Integer
playersPerTeam
;
@OneToMany
@OrderBy
(
"id ASC"
)
private
List
<
Tournament
>
subTournaments
;
public
Tournament
()
{
super
();
}
public
Integer
getTalynTournamentId
()
{
return
talynTournamentId
;
}
public
void
setTalynTournamentId
(
Integer
talynTournamendId
)
{
this
.
talynTournamentId
=
talynTournamendId
;
}
public
String
getTournamentName
()
{
return
tournamentName
;
}
public
void
setTournamentName
(
String
tournamentName
)
{
this
.
tournamentName
=
tournamentName
;
}
public
Date
getRegistrationOpensAt
()
{
return
registrationOpensAt
;
}
public
void
setRegistrationOpensAt
(
Date
registrationOpensAt
)
{
this
.
registrationOpensAt
=
registrationOpensAt
;
}
public
Date
getRegistrationClosesAt
()
{
return
registrationClosesAt
;
}
public
void
setRegistrationClosesAt
(
Date
registrationClosesAt
)
{
this
.
registrationClosesAt
=
registrationClosesAt
;
}
public
TournamentType
getTournamentType
()
{
return
tournamentType
;
}
public
void
setTournamentType
(
TournamentType
tournamentType
)
{
this
.
tournamentType
=
tournamentType
;
}
}
code/MoyaDatabase/src/fi/codecrew/moya/model/TournamentGame.java
0 → 100644
View file @
d9cdc68
package
fi
.
codecrew
.
moya
.
model
;
import
static
javax
.
persistence
.
FetchType
.
LAZY
;
import
fi.codecrew.moya.enums.TournamentType
;
import
fi.codecrew.moya.model.GenericEntity
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
import
javax.persistence.*
;
import
org.eclipse.persistence.annotations.OptimisticLocking
;
import
org.eclipse.persistence.annotations.OptimisticLockingType
;
/**
* Entity implementation class for Entity: Tournament
*
*/
@Entity
@Table
(
name
=
"tournament_games"
)
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
public
class
TournamentGame
extends
GenericEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Column
(
name
=
"name"
)
private
String
name
;
@Column
(
name
=
"description"
)
private
String
description
;
@Lob
@Column
(
name
=
"game_image"
)
@Basic
(
fetch
=
LAZY
)
private
byte
[]
gameImage
;
@Column
(
name
=
"expected_single_game_duration"
)
private
Integer
expectedSingleGameDuration
;
@JoinColumn
(
name
=
"event_id"
,
nullable
=
false
)
private
LanEvent
lanEvent
;
@OneToMany
private
List
<
TournamentRule
>
availableRules
;
public
TournamentGame
()
{
super
();
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
List
<
TournamentRule
>
getAvailableRules
()
{
return
availableRules
;
}
public
void
setAvailableRules
(
List
<
TournamentRule
>
availableRules
)
{
this
.
availableRules
=
availableRules
;
}
}
code/MoyaDatabase/src/fi/codecrew/moya/model/TournamentMatch.java
0 → 100644
View file @
d9cdc68
package
fi
.
codecrew
.
moya
.
model
;
import
fi.codecrew.moya.enums.MatchStatus
;
import
fi.codecrew.moya.model.GenericEntity
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
import
javax.persistence.*
;
import
org.eclipse.persistence.annotations.OptimisticLocking
;
import
org.eclipse.persistence.annotations.OptimisticLockingType
;
/**
* Entity implementation class for Entity: Match
*
*/
@Entity
@Table
(
name
=
"matches"
)
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
public
class
TournamentMatch
extends
GenericEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@OneToMany
private
List
<
TournamentMatch
>
sourceMatches
;
@ManyToMany
private
List
<
TournamentParticipant
>
matchParticipants
;
@Column
(
name
=
"play_count_max"
)
private
Integer
playCountMax
=
1
;
@Column
(
name
=
"play_count"
)
private
Integer
playCount
;
@Column
(
name
=
"match_status"
)
@Enumerated
(
EnumType
.
STRING
)
private
MatchStatus
matchStatus
;
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Date
startTime
;
@Temporal
(
TemporalType
.
TIMESTAMP
)
private
Date
endTime
;
@OneToMany
@OrderBy
(
"rank"
)
private
List
<
TournamentMatchResult
>
matchResults
;
public
TournamentMatch
()
{
super
();
}
public
List
<
TournamentMatch
>
getSourceMatches
()
{
return
sourceMatches
;
}
public
void
setSourceMatches
(
List
<
TournamentMatch
>
sourceMatches
)
{
this
.
sourceMatches
=
sourceMatches
;
}
public
List
<
TournamentParticipant
>
getMatchParticipants
()
{
return
matchParticipants
;
}
public
void
setMatchParticipants
(
List
<
TournamentParticipant
>
matchParticipants
)
{
this
.
matchParticipants
=
matchParticipants
;
}
public
List
<
TournamentMatchResult
>
getMatchResults
()
{
return
matchResults
;
}
public
void
setMatchResults
(
List
<
TournamentMatchResult
>
matchResults
)
{
this
.
matchResults
=
matchResults
;
}
}
code/MoyaDatabase/src/fi/codecrew/moya/model/TournamentMatchResult.java
0 → 100644
View file @
d9cdc68
package
fi
.
codecrew
.
moya
.
model
;
import
java.io.Serializable
;
import
javax.persistence.*
;
import
org.eclipse.persistence.annotations.OptimisticLocking
;
import
org.eclipse.persistence.annotations.OptimisticLockingType
;
/**
* Entity implementation class for Entity: MatchResult
*
*/
@Entity
@Table
(
name
=
"match_results"
)
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
public
class
TournamentMatchResult
extends
GenericEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Column
(
name
=
"score"
)
private
Integer
score
;
@Column
(
name
=
"rank"
)
private
Integer
rank
;
@JoinColumn
(
name
=
"tournament_participant"
)
private
TournamentParticipant
tournamentParticipant
;
public
TournamentMatchResult
()
{
super
();
}
public
Integer
getScore
()
{
return
score
;
}
public
void
setScore
(
Integer
score
)
{
this
.
score
=
score
;
}
public
Integer
getRank
()
{
return
rank
;
}
public
void
setRank
(
Integer
rank
)
{
this
.
rank
=
rank
;
}
public
TournamentParticipant
getTournamentParticipant
()
{
return
tournamentParticipant
;
}
public
void
setTournamentParticipant
(
TournamentParticipant
tournamentParticipant
)
{
this
.
tournamentParticipant
=
tournamentParticipant
;
}
}
code/MoyaDatabase/src/fi/codecrew/moya/model/TournamentParticipant.java
0 → 100644
View file @
d9cdc68
package
fi
.
codecrew
.
moya
.
model
;
import
fi.codecrew.moya.model.GenericEntity
;
import
java.io.Serializable
;
import
java.util.List
;
import
javax.persistence.*
;
import
org.eclipse.persistence.annotations.OptimisticLocking
;
import
org.eclipse.persistence.annotations.OptimisticLockingType
;
/**
* Entity implementation class for Entity: TournamentParticipant
*
*/
@Entity
@Table
(
name
=
"tournament_participants"
)
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
public
class
TournamentParticipant
extends
GenericEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@JoinColumn
(
name
=
"participator"
)
private
EventUser
participator
;
@OneToMany
private
List
<
EventUser
>
teamMembers
;
public
TournamentParticipant
()
{
super
();
}
}
code/MoyaDatabase/src/fi/codecrew/moya/model/TournamentRule.java
0 → 100644
View file @
d9cdc68
package
fi
.
codecrew
.
moya
.
model
;
import
static
javax
.
persistence
.
FetchType
.
LAZY
;
import
fi.codecrew.moya.enums.TournamentType
;
import
fi.codecrew.moya.model.GenericEntity
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
import
javax.persistence.*
;
import
org.eclipse.persistence.annotations.OptimisticLocking
;
import
org.eclipse.persistence.annotations.OptimisticLockingType
;
/**
* Entity implementation class for Entity: Tournament
*
*/
@Entity
@Table
(
name
=
"tournament_rules"
)
@OptimisticLocking
(
type
=
OptimisticLockingType
.
CHANGED_COLUMNS
)
public
class
TournamentRule
extends
GenericEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Column
(
name
=
"name"
)
private
String
name
;
@Lob
@Column
(
name
=
"description"
)
private
String
description
;
@Lob
@Column
(
name
=
"rules"
)
private
String
rules
;
@ManyToOne
@JoinColumn
(
name
=
"tournament_game_id"
)
private
TournamentGame
tournamentGame
;
public
TournamentRule
()
{
super
();
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
public
String
getRules
()
{
return
rules
;
}
public
void
setRules
(
String
rules
)
{
this
.
rules
=
rules
;
}
}
code/MoyaUtilities/src/fi/codecrew/moya/enums/MatchStatus.java
0 → 100644
View file @
d9cdc68
package
fi
.
codecrew
.
moya
.
enums
;
public
enum
MatchStatus
{
UNFINISHED
,
FINISHED
}
code/MoyaUtilities/src/fi/codecrew/moya/enums/TournamentStatus.java
0 → 100644
View file @
d9cdc68
package
fi
.
codecrew
.
moya
.
enums
;
public
enum
TournamentStatus
{
SETUP
,
IN_PROGRESS
,
COMPLETED
}
code/MoyaUtilities/src/fi/codecrew/moya/enums/TournamentType.java
0 → 100644
View file @
d9cdc68
package
fi
.
codecrew
.
moya
.
enums
;
public
enum
TournamentType
{
SINGLE_ELIMINATION
,
DOUBLE_ELIMINATION
}
code/MoyaWeb/WebContent/WEB-INF/web.xml
View file @
d9cdc68
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<context-param>
<context-param>
<param-name>
javax.faces.PROJECT_STAGE
</param-name>
<param-name>
javax.faces.PROJECT_STAGE
</param-name>
<!-- Production | Development -->
<!-- Production | Development -->
<param-value>
Development
</param-value>
<param-value>
Production
</param-value>
</context-param>
</context-param>
<context-param>
<context-param>
<param-name>
javax.faces.FACELETS_SKIP_COMMENTS
</param-name>
<param-name>
javax.faces.FACELETS_SKIP_COMMENTS
</param-name>
...
...
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