public ActionForward defaultMethodInsertLevel(ActionMapping am, ActionForm af, HttpServletRequest req, HttpServletResponse res,Game g,GameHiber gh,AOGGameHiber ag) {
AOGAuthorForm form=(AOGAuthorForm)af;
//insert at the end by default
AOGGameLevelHiber newOne=new AOGGameLevelHiber();
//get max level number
int max=-1;
ArrayList<AOGGameLevelHiber> levels=form.getOrderedLevels();
for (AOGGameLevelHiber gameLevelHiber : levels) {
if (gameLevelHiber.getLevelNumber()>max) max=gameLevelHiber.getLevelNumber();
}
//insert new one
newOne.setLevelNumber(max+1);
ag.getLevels().add(newOne);
AOGGameLevelDao.persistAOGGameLevelHiber(newOne,session);
ag.setRepublishNeeded(true);
AOGGameDao.updateGame(ag, session);
//add an introduction card to level
AOGGameCardHiber ach=new AOGGameCardHiber();
//fill data
ach.setCardType(AOGGameCardDao.CARD_TYPE_INTRODUCTION);
ach.setCardText(req.getParameter("levelintro"));
ach.setCardNumber(0);
AOGGameCardDao.persistAOGGameCardHiber(ach, session);
newOne.getCards().add(ach);
AOGGameLevelDao.updateGameLevel(newOne, session);
form.setOrderedLevels(AOGGameLevelDao.getOrderedLevelsForGame(ag.getId(),session));