Package org.olat.admin.user

Examples of org.olat.admin.user.UsermanagerUserSearchController


    INode firstNode = tm.getRootNode().getChildAt(0);
    olatMenuTree.setSelectedNodeId(firstNode.getIdent());
    olatMenuTree.addListener(this);

    // we always start with a search controller
    contentCtr = new UsermanagerUserSearchController(ureq, getWindowControl());
    listenTo(contentCtr); // auto dispose later
   
    content = new Panel("content");
    content.setContent(contentCtr.getInitialComponent());
View Full Code Here


        removeAsListenerAndDispose(userAdminCtr);
        userAdminCtr = null;
        // update data model of content controller when of type user search
        // to display correct values of identity
        if (contentCtr instanceof UsermanagerUserSearchController) {
          UsermanagerUserSearchController userSearchCtr = (UsermanagerUserSearchController) contentCtr;
          userSearchCtr.reloadFoundIdentity();
        }
        content.setContent(contentCtr.getInitialComponent());
      }
    }
  }
View Full Code Here

    //these nodes re-create (not stateful) content Controller (contentCtrl)
    //
    removeAsListenerAndDispose(contentCtr);
    if (uobject.equals("usearch") || uobject.equals("useradmin")) {
      activatePaneInDetailView = null;
      contentCtr = new UsermanagerUserSearchController(ureq, getWindowControl());
      listenTo(contentCtr);
      return contentCtr.getInitialComponent();
    }
    else if (uobject.equals("ucreate")) {
      activatePaneInDetailView = null;
      boolean canCreateOLATPassword = false;
      if (ureq.getUserSession().getRoles().isOLATAdmin()) {
        // admin will override configuration
        canCreateOLATPassword = true;
      } else {
        Map configuration = BaseSecurityModule.getConfiguration();
        Boolean canCreatePwdByConfig = (Boolean) configuration.get(BaseSecurityModule.CONFIG_USERMANAGER_CAN_CREATE_PWD);       
        canCreateOLATPassword = canCreatePwdByConfig.booleanValue();
      }
      contentCtr = new UserCreateController(ureq, getWindowControl(), canCreateOLATPassword);
      listenTo(contentCtr);
      return contentCtr.getInitialComponent();
    }
    else if (uobject.equals("usersimport")) {
      activatePaneInDetailView = null;
      boolean canCreateOLATPassword = false;
      if (ureq.getUserSession().getRoles().isOLATAdmin()) {
        // admin will override configuration
        canCreateOLATPassword = true;
      } else {
        Map configuration = BaseSecurityModule.getConfiguration();
        Boolean canCreatePwdByConfig = (Boolean) configuration.get(BaseSecurityModule.CONFIG_USERMANAGER_CAN_CREATE_PWD);       
        canCreateOLATPassword = canCreatePwdByConfig.booleanValue();
      }
      contentCtr = new UserImportController(ureq, getWindowControl(), canCreateOLATPassword);
      listenTo(contentCtr);
      return contentCtr.getInitialComponent();
    }
    else if (uobject.equals("admingroup")) {
      activatePaneInDetailView = "";
      SecurityGroup[] secGroup = {ManagerFactory.getManager().findSecurityGroupByName(Constants.GROUP_ADMIN)};
      contentCtr = new UsermanagerUserSearchController(ureq, getWindowControl(),secGroup, null, null, null, null, Identity.STATUS_VISIBLE_LIMIT, true);
      listenTo(contentCtr);
      return contentCtr.getInitialComponent();
    }
    else if (uobject.equals("authorgroup")) {
      activatePaneInDetailView = "edit.uroles";
      SecurityGroup[] secGroup = {ManagerFactory.getManager().findSecurityGroupByName(Constants.GROUP_AUTHORS)};
      contentCtr = new UsermanagerUserSearchController(ureq, getWindowControl(),secGroup, null, null, null, null, Identity.STATUS_VISIBLE_LIMIT, true);
      listenTo(contentCtr);
      return contentCtr.getInitialComponent();
    }
    else if (uobject.equals("coauthors")) {
      activatePaneInDetailView = "edit.uroles";
      // special case: use user search controller and search for all users that have author rights
      PermissionOnResourceable[] permissions = {new PermissionOnResourceable(Constants.PERMISSION_HASROLE, Constants.ORESOURCE_AUTHOR)};
      UsermanagerUserSearchController myCtr = new UsermanagerUserSearchController(ureq, getWindowControl(),null, permissions, null, null, null, Identity.STATUS_VISIBLE_LIMIT, true);
      // now subtract users that are in the author group to get the co-authors
      Manager secMgr = ManagerFactory.getManager();
      SecurityGroup[] secGroup = {ManagerFactory.getManager().findSecurityGroupByName(Constants.GROUP_AUTHORS)};
      List identitiesFromAuthorGroup = secMgr.getVisibleIdentitiesByPowerSearch(null, null, true, secGroup , null, null, null, null);
      myCtr.removeIdentitiesFromSearchResult(ureq, identitiesFromAuthorGroup);
      contentCtr = myCtr;
      listenTo(contentCtr);
      return contentCtr.getInitialComponent();
    }
    else if (uobject.equals("resourceowners")) {
      activatePaneInDetailView = "edit.uroles";
      PermissionOnResourceable[] permissions = {new PermissionOnResourceable(Constants.PERMISSION_HASROLE, Constants.ORESOURCE_AUTHOR)};
      contentCtr = new UsermanagerUserSearchController(ureq, getWindowControl(),null, permissions, null, null, null, Identity.STATUS_VISIBLE_LIMIT, true);
      listenTo(contentCtr);
      return contentCtr.getInitialComponent();
    }
    else if (uobject.equals("groupmanagergroup")) {
      activatePaneInDetailView = "edit.uroles";
      SecurityGroup[] secGroup = {ManagerFactory.getManager().findSecurityGroupByName(Constants.GROUP_GROUPMANAGERS)};
      contentCtr = new UsermanagerUserSearchController(ureq, getWindowControl(),secGroup, null, null, null, null, Identity.STATUS_VISIBLE_LIMIT, true);
      listenTo(contentCtr);
      return contentCtr.getInitialComponent();
    }
    else if (uobject.equals("usermanagergroup")) {
      activatePaneInDetailView = "edit.uroles";
      SecurityGroup[] secGroup = {ManagerFactory.getManager().findSecurityGroupByName(Constants.GROUP_USERMANAGERS)};
      contentCtr = new UsermanagerUserSearchController(ureq, getWindowControl(),secGroup, null, null, null, null, Identity.STATUS_VISIBLE_LIMIT, true);
      listenTo(contentCtr);
      return contentCtr.getInitialComponent();
    }
    else if (uobject.equals("usergroup")) {
      activatePaneInDetailView = "edit.uroles";
      SecurityGroup[] secGroup = {ManagerFactory.getManager().findSecurityGroupByName(Constants.GROUP_OLATUSERS)};
      contentCtr = new UsermanagerUserSearchController(ureq, getWindowControl(),secGroup, null, null, null, null, Identity.STATUS_VISIBLE_LIMIT, true);
      listenTo(contentCtr);
      return contentCtr.getInitialComponent();
    }   
    else if (uobject.equals("anonymousgroup")) {
      activatePaneInDetailView = "edit.uroles";
      SecurityGroup[] secGroup = {ManagerFactory.getManager().findSecurityGroupByName(Constants.GROUP_ANONYMOUS)};
      contentCtr = new UsermanagerUserSearchController(ureq, getWindowControl(),secGroup, null, null, null, null, Identity.STATUS_VISIBLE_LIMIT, true);
      listenTo(contentCtr);
      return contentCtr.getInitialComponent();
    }
    else if (uobject.equals("logondeniedgroup")) {
      activatePaneInDetailView = "edit.uroles";
      contentCtr = new UsermanagerUserSearchController(ureq, getWindowControl(),null, null, null, null, null, Identity.STATUS_LOGIN_DENIED, true);
      listenTo(contentCtr);
      return contentCtr.getInitialComponent();
    }   
    else if (uobject.equals("deletedusers")) {
      activatePaneInDetailView = "list.deletedusers";
      contentCtr = new UsermanagerUserSearchController(ureq, getWindowControl(),null, null, null, null, null, Identity.STATUS_DELETED, false);
      listenTo(contentCtr);
      return contentCtr.getInitialComponent();
    }
    else if (uobject.equals("created.lastweek")) {
      activatePaneInDetailView = null;
      Calendar cal = Calendar.getInstance();
      cal.add(Calendar.DAY_OF_MONTH, -7);
      Date time = cal.getTime();
      contentCtr = new UsermanagerUserSearchController(ureq, getWindowControl(), null, null, null, time, null, Identity.STATUS_VISIBLE_LIMIT, true);
      listenTo(contentCtr);
      return contentCtr.getInitialComponent();
    }
    else if (uobject.equals("created.lastmonth")) {
      activatePaneInDetailView = null;
      Calendar cal = Calendar.getInstance();
      cal.add(Calendar.MONTH, -1);
      Date time = cal.getTime();
      contentCtr = new UsermanagerUserSearchController(ureq, getWindowControl(), null, null, null, time, null, Identity.STATUS_VISIBLE_LIMIT, true);
      listenTo(contentCtr);
      return contentCtr.getInitialComponent();
    }
    else if (uobject.equals("created.sixmonth")) {
      activatePaneInDetailView = null;
      Calendar cal = Calendar.getInstance();
      cal.add(Calendar.MONTH, -6);
      Date time = cal.getTime();
      contentCtr = new UsermanagerUserSearchController(ureq, getWindowControl(), null, null, null, time, null, Identity.STATUS_VISIBLE_LIMIT, true);
      listenTo(contentCtr);
      return contentCtr.getInitialComponent();
    }
    else if (uobject.equals("created.newUsersNotification")) {
      activatePaneInDetailView = null;
      ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(new OLATResourceable() {
        @Override
        public Long getResourceableId() { return 0l; }
        @Override
        public String getResourceableTypeName() { return "NewIdentityCreated"; }
      });
      WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, getWindowControl())
      contentCtr = new NewUsersNotificationsController(ureq, bwControl);
      listenTo(contentCtr);
      return contentCtr.getInitialComponent();
    }
    else if (uobject.equals("noauthentication")) {
      activatePaneInDetailView = null;
      String[] auth = {null};
      contentCtr = new UsermanagerUserSearchController(ureq, getWindowControl(), null, null, auth, null, null, Identity.STATUS_VISIBLE_LIMIT, true);
      listenTo(contentCtr);
      return contentCtr.getInitialComponent();
    }else if(uobject.equals("userbulkreplayurl")){
      activatePaneInDetailView = null;
      contentCtr = new BulkReplayUserController(ureq, getWindowControl());
View Full Code Here

TOP

Related Classes of org.olat.admin.user.UsermanagerUserSearchController

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.