Examples of DBGamesBean


Examples of org.c3s.rpgplayer.db.beans.DBGamesBean

  public void getGameInfo(UrlPart pattern, RedirectControlerInterface redirect) throws IllegalArgumentException, IllegalAccessException, InstantiationException, SQLException, SkipSubLevelsExeption, StopDispatchException {
   
    String subpattern = pattern.getPattern().replaceAll("/", "");
   
    if ("newgame".equals(subpattern)) {
      currentGame.setGameInfo(new DBGamesBean());
    } else {
      DBGamesBean game;
      if ((game = DbAccess.gamesAccess.getByUniqueId(subpattern)) == null) {
        redirect.setRedirect(new DirectRedirect(pattern.getUrlParsed()));
        throw new StopDispatchException();
      }
     
      currentGame.setGameInfo(game);
      currentGame.setFiles(DbAccess.filesAccess.getFilesForGame(game.getGameId()));
    }
   
    ContentObject.getInstance().addPath(pattern.getUrlParsed() + pattern.getPattern(), currentGame.getGameInfo().getName());
  }
View Full Code Here

Examples of org.c3s.rpgplayer.db.beans.DBGamesBean

    logger.debug(Utils.mapToString(data.getRequestData(), ""));
   
    DataMapper mapper = new DataMapper(new StringCast());
   
    GameBean chkGame = (GameBean)data.getData();
    DBGamesBean game = chkGame.getGameInfo();
    mapper.mapFromRow(data.getRequestData(), game);
   
    Map<String, String> errors = new HashMap<String, String>();
    /**
     * Validation
     */
   
    /**
     * /Validation
     */
   
    if (errors.size() == 0) {
      /**
       * Save
       */
      try {
        if (chkGame.getGameInfo().getGameId() == null) {
          DbAccess.gamesAccess.insert(game);
        } else {
          DbAccess.gamesAccess.updateByPrimaryKey(game, game.getGameId());
        }
      } catch (SQLException e) {
        errors.put("common", e.getMessage());
      }
    }
   
    // Files
    try {
      chkGame.clearFiles();
      chkGame.setFiles(updateFiles((Map<String, Object>)data.getRequestData().get("image"), game.getGameId(), errors.size() == 0));
    } catch (SQLException e) {
      errors.put("common", e.getMessage());
    }
   
    return true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.