Commit ee9d6ad5 by Tuukka Kivilahti

game code stuff, stashet for computer change

1 parent c8e39a5c
package fi.codecrew.moya.beans;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import fi.codecrew.moya.facade.NewsGroupFacade;
import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.beans.GameBeanLocal;
import fi.codecrew.moya.facade.GameCodeFacade;
import fi.codecrew.moya.facade.GameFacade;
import fi.codecrew.moya.model.EventMap;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.Game;
import fi.codecrew.moya.model.GameCode;
import fi.codecrew.moya.model.LanEvent;
import fi.codecrew.moya.model.Place;
/**
* Session Bean implementation class GameBean
......@@ -14,10 +28,118 @@ import fi.codecrew.moya.beans.GameBeanLocal;
public class GameBean implements GameBeanLocal {
@EJB
private EventBeanLocal eventbean;
GameCodeFacade gameCodeFacade;
@EJB
private NewsGroupFacade ngfacade;
GameFacade gameFacade;
@EJB
EventBeanLocal eventBean;
@EJB
PlaceBeanLocal placeBean;
public GameCode getCode(Place place) {
List<GameCode> codes = place.getGameCodes();
if(codes.size() > 0) {
return codes.get(0);
}
return null;
}
public List<GameCode> findUserCodes(EventUser user) {
ArrayList<GameCode> returnCodes = new ArrayList<GameCode>();
// first get free gamecodes from user places
if(user.getCurrentPlaces() != null) {
for(Place place : user.getCurrentPlaces()) {
for(GameCode placeGameCode : place.getGameCodes()) {
if(placeGameCode.getUser() == null) {
returnCodes.add(placeGameCode);
}
}
}
}
for(GameCode userGameCode : user.getUser().getGameCodes()) {
returnCodes.add(userGameCode);
}
return returnCodes;
}
/**
* Check, and if needed generate code for gamecode.
*
* @param code
*/
private void generateCode(GameCode code) {
if (code.getCode() == null || code.getCode().trim().equals("")) {
if (code.getGame().getCodeUrl() == null || code.getGame().getCodeUrl().trim().equals(""))
return;
try {
URL url = new URL(code.getGame().getCodeUrl());
URLConnection uc;
uc = url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(uc.getInputStream()));
String codeString = "";
String tmpLine;
while ((tmpLine = in.readLine()) != null) {
if (!code.equals("")) {
codeString += "\n";
}
codeString += tmpLine;
}
code.setCode(codeString);
code = gameCodeFacade.merge(code);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
public void accessCode(GameCode code, EventUser user) {
if(code.getUser() != null)
return;
generateCode(code);
if (!code.isAccessed()) {
code.setAccessed(Calendar.getInstance());
code.setUser(user.getUser());
code = gameCodeFacade.merge(code);
user.getUser().getGameCodes().add(code);
}
}
public List<Game> findAll(LanEvent event) {
return event.getGames();
}
public void saveOrCreateGame(Game game) {
if (game.getId() == null) {
game.setEvent(eventBean.getCurrentEvent());
eventBean.getCurrentEvent().getGames().add(game);
gameFacade.create(game);
game = gameFacade.merge(game);
}
else {
game = gameFacade.merge(game);
}
}
/**
* Default constructor.
......@@ -26,4 +148,23 @@ public class GameBean implements GameBeanLocal {
// TODO Auto-generated constructor stub
}
@Override
public void generateCodesForAllPlaces(Game game) {
if(game == null)
return;
LanEvent currentEvent = eventBean.getCurrentEvent();
for(EventMap map : currentEvent.getEventMaps()) {
for(Place place : map.getPlaces()) {
GameCode code = new GameCode(place, game);
gameCodeFacade.create(code);
code = gameCodeFacade.merge(code);
place.getGameCodes().add(code);
}
}
}
}
......@@ -14,6 +14,7 @@ import org.slf4j.LoggerFactory;
import fi.codecrew.moya.enums.apps.BillPermission;
import fi.codecrew.moya.enums.apps.CompoPermission;
import fi.codecrew.moya.enums.apps.ContentPermission;
import fi.codecrew.moya.enums.apps.GamePermission;
import fi.codecrew.moya.enums.apps.MapPermission;
import fi.codecrew.moya.enums.apps.PollPermission;
import fi.codecrew.moya.enums.apps.ShopPermission;
......@@ -259,6 +260,7 @@ public class MenuBean implements MenuBeanLocal {
userTopnavi.addPage(menuitemfacade.findOrCreate("/user/accountEvents"), UserPermission.VIEW_SELF);
userTopnavi.addPage(menuitemfacade.findOrCreate("/place/myGroups"), UserPermission.VIEW_SELF);
userTopnavi.addPage(menuitemfacade.findOrCreate("/user/sendPicture"), UserPermission.VIEW_SELF);
MenuNavigation placemapTopmenu = usernavi.addPage(null, null);
placemapTopmenu.setKey("topnavi.placemap");
......@@ -291,6 +293,11 @@ public class MenuBean implements MenuBeanLocal {
// ShopPermission.SHOP_FOODWAVE);
foodwaveTopmenu.addPage(menuitemfacade.findOrCreate("/foodwave/listProducts"), ShopPermission.SHOP_FOODWAVE).setVisible(false);
foodwaveTopmenu.addPage(menuitemfacade.findOrCreate("/foodwave/ThanksForOrderingFromCounter"), ShopPermission.SHOP_FOODWAVE).setVisible(false);
MenuNavigation gameTopmenu = usernavi.addPage(null, null);
gameTopmenu.setKey("topnavi.game");
gameTopmenu.addPage(menuitemfacade.findOrCreate("/gamecode/viewCodes"), GamePermission.VIEW_OWN_CODES);
MenuNavigation pollTopmenu = usernavi.addPage(null, null);
pollTopmenu.setKey("topnavi.poll");
......@@ -379,6 +386,9 @@ public class MenuBean implements MenuBeanLocal {
foodnavi.addPage(menuitemfacade.findOrCreate("/foodadmin/createTemplate"), ShopPermission.MANAGE_FOODWAVES);
foodnavi.addPage(menuitemfacade.findOrCreate("/foodadmin/editTemplate"), ShopPermission.MANAGE_FOODWAVES).setVisible(false);
MenuNavigation gamenavi = adminnavi.addPage(null, null);
gamenavi.setKey("topnavi.game");
gamenavi.addPage(menuitemfacade.findOrCreate("/gamecode/manageCodes"), GamePermission.MANAGE);
}
@Override
......
......@@ -17,6 +17,7 @@ import fi.codecrew.moya.enums.apps.BillPermission;
import fi.codecrew.moya.enums.apps.CompoPermission;
import fi.codecrew.moya.enums.apps.ContentPermission;
import fi.codecrew.moya.enums.apps.EventPermission;
import fi.codecrew.moya.enums.apps.GamePermission;
import fi.codecrew.moya.enums.apps.IAppPermission;
import fi.codecrew.moya.enums.apps.MapPermission;
import fi.codecrew.moya.enums.apps.PollPermission;
......@@ -91,7 +92,9 @@ import fi.codecrew.moya.model.User;
EventPermission.S_MANAGE_PRIVATE_PROPERTIES,
EventPermission.S_MANAGE_PROPERTIES,
GamePermission.S_MANAGE,
GamePermission.S_VIEW_OWN_CODES
})
@LocalBean
public class PermissionBean implements PermissionBeanLocal {
......@@ -113,11 +116,6 @@ public class PermissionBean implements PermissionBeanLocal {
@EJB
private EventBeanLocal eventbean;
//
// @Override
// public boolean hasPermission(String perm) {
// return context.isCallerInRole(perm);
// }
@Override
public boolean hasPermission(IAppPermission perm) {
......@@ -130,36 +128,7 @@ public class PermissionBean implements PermissionBeanLocal {
}
// @Override
// public boolean fatalPermission(IAppPermission permission, Object...
// failmessage) {
// boolean ret = hasPermission(permission);
// if (!ret) {
// StringBuilder message = new
// StringBuilder().append(" permission: ").append(permission);
// if (failmessage == null || failmessage.length == 0) {
// message.append(" MSG: SessionHandler mbean permission exception: Permission: ")
// .append(permission);
// } else {
// for (Object part : failmessage) {
// message.append(part == null ? "NULL" : part.toString());
// }
// }
// // throw new SecurityException("Foobar");
//
// throw new PermissionDeniedException(loggingbean, getCurrentUser(),
// message.toString());
// }
// return true;
// }
//
// @Override
// public void fatalNotLoggedIn() throws PermissionDeniedException {
// if (!isLoggedIn()) {
// throw new PermissionDeniedException(loggingbean, getCurrentUser(),
// "User is not logged in!");
// }
// }
@Override
public boolean isCurrentUser(User user) {
......@@ -177,8 +146,6 @@ public class PermissionBean implements PermissionBeanLocal {
boolean ret = principal != null && !User.ANONYMOUS_LOGINNAME.equalsIgnoreCase(principal.getName());
logger.info("Checking principal {} against anon: {}", principal, ret);
return ret;
// return !getAnonEventUser().equals(getCurrentUser()) ||
// getCurrentUser().getUser().isSuperadmin();
}
@Override
......
......@@ -267,7 +267,6 @@ public class UserBean implements UserBeanLocal {
public void createNewUser(EventUser user, String password) {
user.getUser().resetPassword(password);
// todo add barcode
user.setEvent(eventBean.getCurrentEvent());
// Tallennetaan olio kantaan...
eventUserFacade.create(user);
......
package fi.codecrew.moya.facade;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;
import fi.codecrew.moya.model.GameCode;
import fi.codecrew.moya.model.GameCode_;
import fi.codecrew.moya.model.News;
import fi.codecrew.moya.model.Place;
@Stateless
@LocalBean
public class GameCodeFacade extends IntegerPkGenericFacade<GameCode> {
public GameCodeFacade() {
super(GameCode.class);
}
public GameCode findByPlace(Place place) {
CriteriaBuilder cb = getEm().getCriteriaBuilder();
CriteriaQuery<GameCode> cq = cb.createQuery(GameCode.class);
Root<GameCode> root = cq.from(GameCode.class);
cq.where(cb.equal(root.get(GameCode_.place), place));
return getSingleNullableResult(getEm().createQuery(cq));
}
}
package fi.codecrew.moya.facade;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import fi.codecrew.moya.model.Game;
@Stateless
@LocalBean
public class GameFacade extends IntegerPkGenericFacade<Game> {
public GameFacade() {
super(Game.class);
}
}
......@@ -54,8 +54,8 @@ public abstract class GenericFacade<C extends ModelInterface> {
}
public void refresh(C usr) {
getEm().refresh(usr);
public void refresh(C entity) {
getEm().refresh(entity);
}
public C find(Integer id) {
......
package fi.codecrew.moya.beans;
import java.util.List;
import javax.ejb.Local;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.Game;
import fi.codecrew.moya.model.GameCode;
import fi.codecrew.moya.model.LanEvent;
import fi.codecrew.moya.model.Place;
@Local
public interface GameBeanLocal {
public GameCode getCode(Place place);
public void accessCode(GameCode code, EventUser user);
public List<Game> findAll(LanEvent event);
public void saveOrCreateGame(Game game);
public List<GameCode> findUserCodes(EventUser user);
public void generateCodesForAllPlaces(Game game);
}
......@@ -104,6 +104,9 @@ public class EventUser extends GenericEntity {
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "createtime", nullable = false, updatable = false)
private Date eventuserCreated;
public EventUser getCreator() {
return creator;
......@@ -443,4 +446,5 @@ public class EventUser extends GenericEntity {
}
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.codecrew.moya.model;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
@Entity
@Table(name = "games")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class Game extends GenericEntity {
private static final long serialVersionUID = 1L;
@Column(name = "name")
private String name;
@Column(name = "description")
private String description;
@Column(name = "code_url")
private String codeUrl;
@JoinColumn(name = "event_id", referencedColumnName = "id")
@ManyToOne
private LanEvent event;
public Game() {
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 getCodeUrl() {
return codeUrl;
}
public void setCodeUrl(String codeUrl) {
this.codeUrl = codeUrl;
}
public LanEvent getEvent() {
return event;
}
public void setEvent(LanEvent event) {
this.event = event;
}
}
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package fi.codecrew.moya.model;
import java.util.Calendar;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
/**
*
*/
@Entity
@Table(name = "gamecodes")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class GameCode extends GenericEntity {
private static final long serialVersionUID = 1L;
@Column(name = "accessed", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Calendar accessed = Calendar.getInstance();
@Column(name = "code")
private String code;
@JoinColumn(name = "game_id", referencedColumnName = "id")
@ManyToOne
private Game game;
@JoinColumn(name = "user_id", referencedColumnName = "id")
@ManyToOne
private User user;
@JoinColumn(name = "place_id", referencedColumnName = "id")
@ManyToOne
private Place place;
public GameCode() {
super();
}
public GameCode(Place place, Game game) {
this();
this.place = place;
this.game = game;
}
public boolean isAccessed() {
return (accessed != null);
}
public Calendar getAccessed() {
return accessed;
}
public void setAccessed(Calendar accessed) {
this.accessed = accessed;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Game getGame() {
return game;
}
public void setGame(Game game) {
this.game = game;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public Place getPlace() {
return place;
}
public void setPlace(Place place) {
this.place = place;
}
}
......@@ -73,6 +73,9 @@ public class LanEvent extends GenericEntity {
@OneToMany(cascade = CascadeType.ALL, mappedBy = "event")
private List<Compo> compos;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "event")
private List<Game> games;
@OneToMany(mappedBy = "event", cascade = CascadeType.ALL)
private List<CardTemplate> cardTemplates;
......@@ -281,4 +284,14 @@ public class LanEvent extends GenericEntity {
this.properties = properties;
}
public List<Game> getGames() {
if(games == null)
games = new ArrayList<Game>();
return games;
}
public void setGames(List<Game> games) {
this.games = games;
}
}
package fi.codecrew.moya.model;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.OrderBy;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
......@@ -86,6 +91,11 @@ public class Place extends GenericEntity {
@JoinColumn(name = "current_eventuser_id", referencedColumnName = EventUser.ID_COLUMN)
@ManyToOne
private EventUser currentUser;
@OneToMany(mappedBy = "place", fetch = FetchType.LAZY)
@OrderBy()
private List<GameCode> gameCodes;
public Place() {
super();
......@@ -278,4 +288,17 @@ public class Place extends GenericEntity {
this.disabled = disabled;
}
public List<GameCode> getGameCodes() {
if(gameCodes == null) {
gameCodes = new ArrayList<GameCode>();
}
return gameCodes;
}
public void setGameCodes(List<GameCode> gameCodes) {
this.gameCodes = gameCodes;
}
}
package fi.codecrew.moya.model;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
......@@ -9,6 +10,7 @@ import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
......@@ -108,6 +110,10 @@ public class User extends GenericEntity implements IUser {
@OrderBy
@PrivateOwned
private List<UserImage> userImageList;
@OneToMany(mappedBy = "user", fetch = FetchType.LAZY)
@OrderBy()
private List<GameCode> gameCodes;
@Transient
private static final Logger logger = LoggerFactory.getLogger(User.class);
......@@ -353,5 +359,17 @@ public class User extends GenericEntity implements IUser {
}
return isAnon;
}
public List<GameCode> getGameCodes() {
if(gameCodes == null)
gameCodes = new ArrayList<GameCode>();
return gameCodes;
}
public void setGameCodes(List<GameCode> gameCodes) {
this.gameCodes = gameCodes;
}
}
......@@ -4,6 +4,7 @@ import fi.codecrew.moya.enums.apps.BillPermission;
import fi.codecrew.moya.enums.apps.CompoPermission;
import fi.codecrew.moya.enums.apps.ContentPermission;
import fi.codecrew.moya.enums.apps.EventPermission;
import fi.codecrew.moya.enums.apps.GamePermission;
import fi.codecrew.moya.enums.apps.IAppPermission;
import fi.codecrew.moya.enums.apps.MapPermission;
import fi.codecrew.moya.enums.apps.PollPermission;
......@@ -23,6 +24,7 @@ public enum BortalApplication {
SALESPOINT(SalespointPermission.class),
COMPO(CompoPermission.class),
EVENT(EventPermission.class),
GAME(GamePermission.class),
;
......
package fi.codecrew.moya.enums.apps;
import fi.codecrew.moya.enums.BortalApplication;
public enum GamePermission implements IAppPermission {
MANAGE,
VIEW_OWN_CODES,
;
public static final String S_MANAGE = "GAME/MANAGE";
public static final String S_VIEW_OWN_CODES = "GAME/VIEW_OWN_CODES";
private final String fullName;
private final String key;
private static final String I18N_HEADER = "bortalApplication.game.";
private GamePermission() {
fullName = new StringBuilder().append(getParent().toString()).append(DELIMITER).append(toString()).toString();
key = I18N_HEADER + name();
}
@Override
public BortalApplication getParent() {
return BortalApplication.GAME;
}
@Override
public String getFullName() {
return fullName;
}
@Override
public String getI18nKey() {
return key;
}
}
<!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:products="http://java.sun.com/jsf/composite/tools/products" xmlns:tools="http://java.sun.com/jsf/composite/tools" xmlns:f="http://java.sun.com/jsf/core">
<h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<f:metadata>
<f:viewParam name="userid" value="#{userView.userid}" />
<f:event type="preRenderView" listener="#{gameCodeView.initView}" />
</f:metadata>
<ui:param name="thispage" value="page.game.list" />
<ui:define name="content">
<h:dataTable border="1" id="games" value="#{gameCodeView.games}" var="game">
<h:column>
<f:facet name="header">
<h:outputText value="${i18n['game.name']}" />
</f:facet>
<h:outputText value="#{game.name}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="edit" />
</f:facet>
<h:commandButton value="muokkaa" action="#{gameCodeView.editSelected}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="GENEROI" />
</f:facet>
<h:commandButton value="generoi kaikille paikoille" action="#{gameCodeView.generateSelectedToAllPlaces}" />
HOX: ei vielä valmis, älä paina, oikeasti!
</h:column>
</h:dataTable>
<h:form>
<h:outputLabel value="name" />
<h:inputText value="#{gameCodeView.currentGame.name}" />
<h:outputLabel value="description" />
<h:inputText value="#{gameCodeView.currentGame.description}" />
<h:outputLabel value="url" />
<h:inputText value="#{gameCodeView.currentGame.codeUrl}" />
<h:commandButton action="#{gameCodeView.saveCurrentGame}" value="save" />
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
<!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:products="http://java.sun.com/jsf/composite/tools/products"
xmlns:tools="http://java.sun.com/jsf/composite/tools" xmlns:f="http://java.sun.com/jsf/core">
<h:body>
<ui:composition template="/layout/#{sessionHandler.layout}/template.xhtml">
<ui:param name="thispage" value="page.game.list" />
<ui:define name="content">
No codes :(
</ui:define>
</ui:composition>
</h:body>
</html>
\ No newline at end of file
package fi.codecrew.moya.web.cdiview.game;
import javax.ejb.EJB;
import javax.enterprise.context.ConversationScoped;
import javax.faces.model.ListDataModel;
import javax.inject.Inject;
import javax.inject.Named;
import fi.codecrew.moya.beans.EventBeanLocal;
import fi.codecrew.moya.beans.GameBeanLocal;
import fi.codecrew.moya.model.EventUser;
import fi.codecrew.moya.model.Game;
import fi.codecrew.moya.web.annotations.SelectedUser;
import fi.codecrew.moya.web.cdiview.GenericCDIView;
@Named
@ConversationScoped
public class GameCodeView extends GenericCDIView {
private static final long serialVersionUID = -8346420143750551402L;
@Inject
@SelectedUser
private EventUser user;
@EJB
EventBeanLocal eventBean;
@EJB
GameBeanLocal gameBean;
ListDataModel<Game> gamesDataModel;
private Game currentGame;
public void initView() {
if(gamesDataModel == null) {
this.currentGame = new Game();
this.currentGame.setEvent(eventBean.getCurrentEvent());
this.gamesDataModel = new ListDataModel<Game>(gameBean.findAll(eventBean.getCurrentEvent()));
this.beginConversation();
}
}
public ListDataModel<Game> getGames() {
return gamesDataModel;
}
public Game getCurrentGame() {
return this.currentGame;
}
public String saveCurrentGame() {
gameBean.saveOrCreateGame(currentGame);
return null;
}
public String generateSelectedToAllPlaces() {
if(gamesDataModel != null && gamesDataModel.isRowAvailable()) {
Game game = gamesDataModel.getRowData();
gameBean.generateCodesForAllPlaces(game);
}
return null;
}
public String editSelected() {
if(gamesDataModel != null && gamesDataModel.isRowAvailable()) {
currentGame = gamesDataModel.getRowData();
}
return "manageCodes";
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!