Package evolaris.framework.sys.business

Examples of evolaris.framework.sys.business.GroupManager


   *
   * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
   */
  public ActionForward list(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    long startTime = System.currentTimeMillis();
    GroupManager groupMgm = new GroupManager(locale,session);
    Group[] groups = groupMgm.getGroups();
    long endTime = System.currentTimeMillis();
    req.setAttribute("groups", DisplayableGroupEntry.displayableEntries(groups));

    // No access right check necessary, because only the administrator may use this action
           
View Full Code Here


    UserSet originalUserSet = userSetManager.getUserSet(originalUserSetId);
    if (originalUserSet == null){
      throw new InputException(getResources(req).getMessage(locale, "um.userSetNotFound",  originalUserSetId));
    }
    checkAccessRights(req, originalUserSet.getGroup());
    Group group = new GroupManager(locale,session).getGroup(userSetEnterOrEditForm.getGroupId());
    boolean differentGroup = group != originalUserSet.getGroup();
    if (includeUserAssignments && differentGroup && !userSetEnterOrEditForm.isConfirmationPending() && originalUserSet.getUsers().size() >= 1){
      userSetEnterOrEditForm.setConfirmationPending(true);
      String reallyDuplicate1 = getResources(req).getMessage(locale,"um.reallyDuplicate1");
      String reallyDuplicate2 = getResources(req).getMessage(locale,"um.reallyDuplicate2");
View Full Code Here

   *      org.apache.struts.action.ActionForm,
   *      javax.servlet.http.HttpServletRequest,
   *      javax.servlet.http.HttpServletResponse)
   */
  public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    GroupManager groupManager = new GroupManager(locale,session);
    UserSetManager userSetManager = new UserSetManager(locale,session);
    UserSetEnterOrEditForm userSetEnterOrEditForm = (UserSetEnterOrEditForm) form;
    if (!userSetEnterOrEditForm.isConfirmationPending()){
      String idParameter = req.getParameter("id");
      long id = Long.valueOf(idParameter);
      UserSet userSet = userSetManager.getUserSet(id);
      if (userSet == null){
        throw new InputException(getResources(req).getMessage(locale, "um.userSetNotFound",  id));
      }
      checkAccessRights(req,userSet.getGroup());
      userSetEnterOrEditForm.setOriginalId(id);
      userSetEnterOrEditForm.setId(id);
      userSetEnterOrEditForm.setDescription(userSet.getDescription());
      userSetEnterOrEditForm.setHidden(userSet.getHidden()==1?true:false);
      userSetEnterOrEditForm.setUserSetName(req.isUserInRole(UserManagerBase.ADMINISTRATOR) ? userSet.getName() :  getResources(req).getMessage(locale, "um.Copy") + ": " + userSet.getName());
      Group group = userSet.getGroup();
      userSetEnterOrEditForm.setGroupId(group.getId());
      userSetEnterOrEditForm.setGroupname(group.getGroupname());
      Group[] groups = groupManager.getGroups();
      req.getSession().setAttribute("groups", groups)// must be in session, because the form may be redisplayed on validation errors
    }
    return mapping.findForward("edit");
  }
View Full Code Here

    if (idParam != null) {
      blog = blogMgr.getBlog(Long.parseLong(idParam));
    } else if (codeParam != null && groupParam != null) {
      try {
        long groupId = Long.parseLong(groupParam);
        GroupManager groupMgr = new GroupManager(locale, session);
        Group group = groupMgr.getGroup(groupId);
        blog = blogMgr.getBlog(codeParam, group);
      } catch (Exception e) {
        blog = null;
      }
    } else {
View Full Code Here

    if (idParam != null) {
      blog = blogMgr.getBlog(Long.parseLong(idParam));
    } else if (codeParam != null && groupParam != null) {
      try {
        long groupId = Long.parseLong(groupParam);
        GroupManager groupMgr = new GroupManager(locale, session);
        Group group = groupMgr.getGroup(groupId);
        blog = blogMgr.getBlog(codeParam, group);
      } catch (Exception e) {
        blog = null;
      }
    }
View Full Code Here

    if (idParam != null) {
      blog = blogMgr.getBlog(Long.parseLong(idParam));
    } else if (codeParam != null && groupParam != null) {
      try {
        long groupId = Long.parseLong(groupParam);
        GroupManager groupMgr = new GroupManager(locale, session);
        Group group = groupMgr.getGroup(groupId);
        blog = blogMgr.getBlog(codeParam, group);
      } catch (Exception e) {
        blog = null;
      }
    }
View Full Code Here

        sortOrderDb = evolaris.framework.database.util.SortOrderEnum.desc;
      }
    }
   
    int listFullSize = 0; // the size of the complete result list used for paging
    GroupManager groupMgm = new GroupManager(locale,session);
    User[] users = null;
    if(userListForm.get("displayAll") != null){
      users = groupMgm.getUsers(groupToDisplay, pageNumber, LocalizedAction.PAGE_SIZE, sortCriterion, sortOrderDb,true,filterString);
      listFullSize = groupMgm.getUsers(groupToDisplay,true,filterString).length;
    } else {
      users = groupMgm.getUsers(groupToDisplay, pageNumber, LocalizedAction.PAGE_SIZE, sortCriterion, sortOrderDb,false,filterString);
      listFullSize = groupMgm.getUsers(groupToDisplay,false,filterString).length;
    }
   
    ArrayList<User> list = new ArrayList<User>();
    for(int i=0;i<users.length;i++){
      list.add(users[i]);
View Full Code Here

  }
 
  private Group getGroupParam(HttpServletRequest req) {
    Group group = null;
    String groupParam;
    GroupManager groupMgr = new GroupManager(locale, session);
    if (req.getParameter("group") != null) {
      try {
        groupParam = new String(req.getParameter("group").getBytes(), "UTF-8");
        group = groupMgr.getGroup(groupParam);
        if (group == null) {
          group = webUser != null ? webUser.getGroup() : null;
        }
      } catch (UnsupportedEncodingException e) {
        LOGGER.error(e);
      }
    } else {
      groupParam = (String)req.getSession().getAttribute("restrictBlogsToGroup");
      if (groupParam != null) {
        group = groupMgr.getGroup(groupParam);
      }
    }
    req.getSession().setAttribute("restrictBlogsToGroup", group != null ? group.getGroupname() : null);
    return group;
  }
View Full Code Here

    List<Long> searchResults = (List<Long>)req.getSession().getAttribute("mgblSearchResults");
    if (searchResults == null) {
      searchResults = new ArrayList<Long>();
    }
   
    GroupManager groupMgr = new GroupManager(locale, session);
    BlogManager blogMgr = new BlogManager(locale, session);
    Group mgblGroup = groupMgr.getGroup("mgbl");
    Blog gameBlog = blogMgr.getBlog("mgblgameinstances", mgblGroup);
    List<DisplayableApplicationType> entries = new ArrayList<DisplayableApplicationType>();
    for (Long id : searchResults) {
      Article blogArticle = blogMgr.getArticle(id);
      DisplayableApplicationType entry = new DisplayableApplicationType(blogArticle);
View Full Code Here

   * Must be invoked with id of mgblgamestyles blog or id of mgbl group and blog-code
   * @see BlogAction#view()
   */
  @SuppressWarnings("unchecked")
  protected ActionForward view(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    GroupManager groupMgr = new GroupManager(locale, session);
    BlogManager blogMgr = new BlogManager(locale, session);
    Group mgblGroup = groupMgr.getGroup("mgbl");
    Blog gameStyleBlog = blogMgr.getBlog("mgblgamestyles", mgblGroup);
    if (req.getParameter("id") == null) {
      req.setAttribute("id", Long.toString(gameStyleBlog.getId()));
    }
    super.view(mapping, form, req, resp);
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.