Package evolaris.platform.smssvc.web.form

Examples of evolaris.platform.smssvc.web.form.TimerEventListForm$DisplayListEntry


  }

  @Override
  public ActionForward cancel(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) {
    // forget the selections, if the user explicitly quits
    TimerEventListForm sendTaskListForm = (TimerEventListForm) form;
    sendTaskListForm.setUserId(null);
    return back(mapping,form,req,resp);
  }
View Full Code Here


   *
   * @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) {

    TimerEventListForm timerEventListForm = (TimerEventListForm) form;
    UserManager userManager = new UserManager(locale, session);

    Group groupToDisplay = getCurrentGroup(req);
    if (Boolean.TRUE.equals(timerEventListForm.getAllGroups()) && UserManager.isUserInRole(webUser, UserManagerBase.ADMINISTRATOR)) {
      groupToDisplay = null;
    }
    User userToDisplay = null;
    Long selectedUserId = timerEventListForm.getUserId() == null ? ALL_ID : timerEventListForm.getUserId();

    if (UserManager.isUserInRole(webUser, UserManagerBase.GROUP_ADMINISTRATOR)) {
      User[] users;
      if (groupToDisplay == null) {
        users = userManager.getUsers(false);
      } else {
        users = userManager.getUsers(groupToDisplay, false)// all users with a username
      }
      if (users.length > MAX_USERLIST_LENGTH) {
        users = new User[0];
      }
      // sort users by username
      Arrays.sort(users, new Comparator<User>() {
        public int compare(User o1, User o2) {
          String n1 = o1.getUsername() != null ? o1.getUsername() : "";
          String n2 = o2.getUsername() != null ? o2.getUsername() : "";
          return n1.compareToIgnoreCase(n2);
        }});
      req.setAttribute("users", users);
    } else {
      selectedUserId = webUser.getId();
      timerEventListForm.setUserId(selectedUserId);
      req.setAttribute("users", new User[]{webUser});
    }
    if (!selectedUserId.equals(ALL_ID)) {
      userToDisplay = userManager.getUserDetails(selectedUserId);
      Hibernate.initialize(userToDisplay); // used to fetch
View Full Code Here

TOP

Related Classes of evolaris.platform.smssvc.web.form.TimerEventListForm$DisplayListEntry

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.