Examples of GameTemplateHiber


Examples of si.unimb.cot.mgbl.gamemgmt.datamodel.GameTemplateHiber

//    Blog blog = dbManager.createBlog("mgbl_testteacherstudentuser", readRoles, writeRoles, commentRoles);
//    assertTrue(blog.getId() >= 1);
//  }
 
  public void testCreateGameBlogArticle() {
    GameTemplateHiber template = new GameTemplateHiber();
    template.setGameType("Action");
    GameHiber game = new GameHiber();
    game.setName("title a");
    game.setDescription("content");
   
    Article a = dbManager.createGameBlogArticle(game, null, new String[] {template.getGameType(), "additional label 1", "additional label 2"});
   
    assertTrue(a != null && a.getId() > 0);
  }
View Full Code Here

Examples of si.unimb.cot.mgbl.gamemgmt.datamodel.GameTemplateHiber

    }
    return null;
  }
 
  public static GameTemplate findGameTemplate(Long id, Session hibernateSession) {
    GameTemplateHiber ret=findGameTemplateHiber((long)id, hibernateSession);
    if (ret==null) return null;
    return GameTemplate.asGameTemplateObject(ret);
  }
View Full Code Here

Examples of si.unimb.cot.mgbl.gamemgmt.datamodel.GameTemplateHiber

    if (ret==null) return null;
    return GameTemplate.asGameTemplateObject(ret);
  }

  public static void deleteGameTemplate(long id,Session hibernateSession) {
    GameTemplateHiber gt=findGameTemplateHiber(id,hibernateSession);
    if (gt==null) return;
    Transaction t=null;
    if (USE_TRANSACTIONS_INSIDE) t=hibernateSession.beginTransaction();
    hibernateSession.delete(gt);
    if (t!=null) t.commit();
View Full Code Here

Examples of si.unimb.cot.mgbl.gamemgmt.datamodel.GameTemplateHiber

    if (req.getParameter("cancelChangesSubmit")!=null) {
      form.reset();
      return am.findForward("cancel");
    }
   
    GameTemplateHiber gt=null;
    if (form.isModifyMe()) {
      //modify existing
      gt=GameTemplateDao.findGameTemplateHiber(form.getModifyId(),session);
      if (!SecurityCenter.canIEditGameTemplate(webUser.getId(), gt)) {
        MessageBean.setMyMessage(req, ("Error: Insufficient privileges."));
        form.reset();
        return am.findForward("ok");
      }
    } else {
      //add new
      gt=new GameTemplateHiber();
      if (!SecurityCenter.canICreateGameTemplate(webUser.getId(),session)) {
        MessageBean.setMyMessage(req, ("Error: Insufficient privileges."));
        form.reset();
        return am.findForward("ok");
      }
    }
    gt.setAuthoringHandlerCode(form.getAuthoringHandlerCode());
    gt.setName(form.getName());
    gt.setDescription(form.getDescription());
    //gt.setGameType(form.getGameType());
    gt.setCreator(webUser.getId());
    gt.setLearningGoal(form.getLearningGoal());
    gt.setTargetGroup(form.getTargetGroup());
    gt.setGameType(form.getSelectedArticle()+"");
    gt.setLearningGoal(form.getLearningGoal());
    gt.setTargetGroup(form.getTargetGroup());
    //gt.setLogo(null);
    //gt.setJarContent(null);
    //gt.setParamFileContent(null);
    //gt.setLogoType("image/jpeg");
   
    //TODO save jar file to filesystem! - that file will be used to produce games for mobile phones
   
    if (form.getLogo().getFileName()!=null)
      if (!form.getLogo().getFileName().equals("")) {
        try {
          gt.setLogo(Hibernate.createBlob(form.getLogo().getInputStream()));
          gt.setLogoType(form.getLogo().getContentType());
        } catch (Exception e) {
          // TODO Wo handle exception
        }
      }
//    if (form.getJarContent().getFileName()!=null)
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.