Package evolaris.framework.sys.business

Examples of evolaris.framework.sys.business.GroupManager


    super.tearDown();
    HibernateSessions.finishTransaction(session,this.getClass());   
  }
 
  public void _testArchives() {
    GroupManager grp = new GroupManager(Locale.getDefault(), session);
    Blog b = mgr.getBlog("tstblg1", grp.getGroup("administrator"));
    List<Date> a = mgr.getArchives(b);
    System.out.println(a.size());
  }
View Full Code Here


    List<Date> a = mgr.getArchives(b);
    System.out.println(a.size());
  }
 
  public void _testAddLabel() {
    GroupManager grp = new GroupManager(Locale.getDefault(), session);
    Blog b = mgr.getBlog("tstblg1", grp.getGroup("administrator"));
    Article a = b.getArticles().iterator().next();
    mgr.setLabels(a, "test");
    for (Label l : a.getLabels()) {
      System.out.println(l.getLabel());
      for (Article aa : l.getArticles()) {
View Full Code Here

    }
  }

  @SuppressWarnings("unchecked")
  public void _testgetByLabel() {
    GroupManager grp = new GroupManager(Locale.getDefault(), session);
    Blog b = mgr.getBlog("tstblg1", grp.getGroup("administrator"));
    Label lab = mgr.getLabel(b, "demo");
    Collection l = mgr.getArchivedArticles(b, lab);
    assertNotNull(l);
  }
View Full Code Here

    assertNotNull(l);
  }
 
  @SuppressWarnings("unchecked")
  public void _testgetUnlabelled() {
    GroupManager grp = new GroupManager(Locale.getDefault(), session);
    Blog b = mgr.getBlog("tstblg1", grp.getGroup("administrator"));
    Collection l = mgr.getUnlabelledArticles(b);
    assertNotNull(l);
  }
View Full Code Here

  protected Group validGroupFromForm(HttpServletRequest req, F messageSendForm) {
    Long selectedGroupId = messageSendForm.getGroupId();
    if (selectedGroupId == null){
      throw new ConfigurationException("validation of group failed: group ID = null");
    }
    GroupManager groupManager = new GroupManager(locale,session);
    Group group = groupManager.getGroup(selectedGroupId);
    if (group == null){
      throw new ConfigurationException("validation of group failed: group ID = " + selectedGroupId);
    }
    return group;
  }
View Full Code Here

   */
  protected Group prepareGroup(HttpServletRequest req, F messageSendForm) {
    Group group = null;
    Group[] groups = null;
    if (UserManager.isUserInRole(webUser, UserManagerBase.ADMINISTRATOR)) {
      GroupManager groupMgm = new GroupManager(locale,session);
      Long selectedGroupId = messageSendForm.getGroupId();
      if (selectedGroupId == null) {
        // set the group name of the administrator group
        group = webUser.getGroup();
      } else {
        group = groupMgm.getGroup(selectedGroupId);
      }
      // set an array of groups into the request
      groups = groupMgm.getGroups();
    } else {
      group = webUser.getGroup();
      groups = new Group[]{group};
    }
    LOGGER.info("User " + req.getUserPrincipal().getName().toLowerCase() + ": Displaying information for group `" + group.getGroupname() + "`");
View Full Code Here

             
              session=evolaris.framework.database.util.HibernateSessions.startTransaction(this.getClass());
              GameHiber g=GameDao.findGameHiber(gameId,session);
             
              UserManager um=new UserManager(Locale.getDefault(),session);
              GroupManager gm=new GroupManager(Locale.getDefault(),session);
             
             
              User user=um.registerUserByMsisdn(senderMSIDSN, "", gm.getGroup("mGBL"));
             
              //TODO check security - what about new players!?!?!
       
              GameScoreHiber gs=new GameScoreHiber();
              gs.setGame(g);
View Full Code Here

        String webUsername = request.getUserPrincipal().getName().toLowerCase();
        UserManagerBase userManager = new UserManager(Locale.GERMAN, session)
        User webUser = userManager.getUserDetails(webUsername);
        group = webUser.getGroup();
      } else {
        GroupManager groupManager = new GroupManager(Locale.GERMAN, session);
        group = groupManager.getGroup(Long.parseLong(groupId));
      }
      outputGroupLogo(response, group);
    } catch (Throwable t) {
      LOGGER.error("Error when fetching the logo", t);
      HibernateSessions.rollbackTransaction(session,this.getClass());
View Full Code Here

    }
  }
 
  private ActionForward switchCurrentGroup(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    String name = req.getParameter("name");
    GroupManager groupMgr = new GroupManager(locale, session);
    Group group = groupMgr.getGroup(name);
    if (group == null) {
      throw new ConfigurationException("Switching groups failed: No group named `"+name+"` found.");     
    }
    setCurrentGroup(req, resp, group);
    LOGGER.debug("Switched to group `"+name+"`");
View Full Code Here

      req.getSession().setAttribute("webUser", webUser)/* in session for same reason as the menu */
      req.getSession().setAttribute("webUserGroup", group.getGroupname())/* for group-specific css; in session for same reason as the menu */
      req.getSession().setAttribute("webUserGroupClientProject", group.getClientProject().getName())/* for clientProject-specific css; in session for same reason as the menu */
     
      // put groups in session for group select box in menu
      GroupManager groupMgr = new GroupManager(locale, session);
      List<String> groups = new ArrayList<String>();
      for (Group g : groupMgr.getGroups()) {
        groups.add(g.getGroupname());
      }
      req.getSession().setAttribute("sysGroupNames", groups);
      if (req.getSession().getAttribute("sysCurrentGroupName") == null) {
        req.getSession().setAttribute("sysCurrentGroupName", group.getGroupname());      
View Full Code Here

TOP

Related Classes of evolaris.framework.sys.business.GroupManager

Copyright © 2018 www.massapicom. 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.