Package org.olat.user

Examples of org.olat.user.UserManager


       
        back6 = LinkFactory.createLinkBack(step6VC, this);
       
        GenericObjectArrayTableDataModel feedbackDataModel = new GenericObjectArrayTableDataModel(rowsFeedbackStep, numOfLines);
       
        UserManager um = UserManager.getInstance();
        Manager secMgr = ManagerFactory.getManager();
       
        BulkActionModule bam = new BulkActionModule();
        BulkAction ba = (BulkAction) bulkActions.get(bulkType);

        // TODO: as:b may be add additional class hierarchy (ask pb !!!)
        if ((ba instanceof BulkActionSetNodeScore)){
          ((BulkActionSetNodeScore) ba).setCourseNode((AssessableCourseNode)currentCourseNode);
        }else if ((ba instanceof BulkActionSetNodePassed)){
          ((BulkActionSetNodePassed) ba).setCourseNode((AssessableCourseNode)currentCourseNode);
        }else if ((ba instanceof BulkActionSetNodeUserComment)){
          ((BulkActionSetNodeUserComment) ba).setCourseNode((AssessableCourseNode)currentCourseNode);
        }
       
        List identitiesAndTheirAssessments = new ArrayList(feedbackDataModel.getRowCount());
        // read values from the column which the user has defined as olat key (e.g. username)
        // and add them to a list.
        for(int i = 0; i < feedbackDataModel.getRowCount(); i ++ ){
          String val = (String) feedbackDataModel.getValueAt(i, selectedColForOlatKey);
          val = val.trim();
          String assessment = (String) feedbackDataModel.getValueAt(i, colForBulk);
          Identity identity = null;

          if (selectedOlatKey == 0){ // username
              identity = secMgr.findIdentityByName(val);
          }else if (selectedOlatKey == 1) { // email
            identity = um.findIdentityByEmail(val);
          }
          identitiesAndTheirAssessments.add(new Object[]{identity,assessment});
        }
        List bulkResults = bam.apply(identitiesAndTheirAssessments, ba);
       
View Full Code Here


    cd0
        .setIsPopUpWindowAction(true,
            "height=700, width=900, location=no, menubar=no, resizable=yes, status=no, scrollbars=yes, toolbar=no");
    tableCtr.addColumnDescriptor(cd0);
    colCount++;
    UserManager um = UserManager.getInstance();
    // followed by the users fields
    for (int i = 0; i < userPropertyHandlers.size(); i++) {
      UserPropertyHandler userPropertyHandler = userPropertyHandlers.get(i);
      boolean visible = um.isMandatoryUserProperty(usageIdentifyer, userPropertyHandler);
      tableCtr.addColumnDescriptor(visible, userPropertyHandler.getColumnDescriptor(i + 1, null, getLocale()));
      colCount++;
    }
    // in the end the last login and creation date
    tableCtr.addColumnDescriptor(false, new DefaultColumnDescriptor("table.identity.lastlogin", colCount, null, getLocale()));
View Full Code Here

    private SingleSelection setStatus;

    public UserBulkChangeStepForm01(UserRequest ureq, WindowControl control, Form rootForm, StepsRunContext runContext) {
      super(ureq, control, rootForm, runContext, LAYOUT_VERTICAL, null);
      // use custom translator with fallback to user properties translator
      UserManager um = UserManager.getInstance();
      setTranslator(um.getPropertyHandlerTranslator(getTranslator()));
      flc.setTranslator(getTranslator());
      initForm(ureq);
    }
View Full Code Here

    private FormLayoutContainer textContainer;

    public UserBulkChangeStepForm02(UserRequest ureq, WindowControl control, Form rootForm, StepsRunContext runContext) {
      super(ureq, control, rootForm, runContext, LAYOUT_VERTICAL, null);
      // use custom translator with fallback to user properties translator
      UserManager um = UserManager.getInstance();
      setTranslator(um.getPropertyHandlerTranslator(getTranslator()));
      flc.setTranslator(getTranslator());
      initForm(ureq);
    }
View Full Code Here

  }
 
  private void doExport(UserRequest ureq, ScormCourseNode node) {
    ICourse course = CourseFactory.loadCourse(courseId);
    exportDir = CourseFactory.getOrCreateDataExportDirectory(ureq.getIdentity(), course.getCourseTitle());
    UserManager um = UserManager.getInstance();
    charset = um.getUserCharset(ureq.getIdentity());
   
    ScormExportManager sreManager = ScormExportManager.getInstance();
    targetFileName = sreManager.exportResults(course.getCourseEnvironment(), node, getTranslator(), exportDir, charset);
  }
View Full Code Here

        finishedVC = new VelocityContainer("finished", VELOCITY_ROOT + "/finished.html", trans, this);
        backLinkFin = LinkFactory.createLinkBack(finishedVC, this);
       
        GenericObjectArrayTableDataModel sepValFinModel = new GenericObjectArrayTableDataModel(rowsFourthStep, numOfLines);
         
        UserManager um = UserManager.getInstance();
        Manager secMgr = ManagerFactory.getManager();
       
        BulkActionModule bam = new BulkActionModule();
        BulkAction ba = (BulkAction) bulkActions.get(bulk);
        List identities = new ArrayList(sepValFinModel.getRowCount());
       
        // read values from the column which the user has defined as olat key (e.g. username)
        // and add them to a list.
        for(int i = 0; i < sepValFinModel.getRowCount(); i ++ ){
          String val = (String) sepValFinModel.getValueAt(i, selectedColForOlatKey);
          val = val.trim();
          Identity identity = null;

          if (selectedOlatKey == 0) { // matrikelnumber
            Map<String, String> searchValue = new HashMap<String, String>();
            searchValue.put(UserConstants.INSTITUTIONALUSERIDENTIFIER, val);
            List identitiesFoundByInst = ManagerFactory.getManager().getIdentitiesByPowerSearch(null, searchValue, true, null, null, null, null, null, null);
            //FIXME:as:b error handling if there is more than one identity found by institutionalUserIdentifier
            // see also in BulkAssessmentWizardController
            if (identitiesFoundByInst.size() == 1){
              identity = (Identity) identitiesFoundByInst.get(0);
            }
          }else if (selectedOlatKey == 1){ // username
              identity = secMgr.findIdentityByName(val);
          }else if (selectedOlatKey == 2) { // email
            identity = um.findIdentityByEmail(val);
          }
          identities.add(identity);
        }
        // get results from the user chosen bulk action for every identity
        List bulkResults = bam.apply(identities, ba);
View Full Code Here

    private FormLink selectAllLink;
    private FormLink uncheckallLink;

    public DeletStepForm00(UserRequest ureq, WindowControl control, Form rootForm, StepsRunContext runContext) {
      super(ureq, control, rootForm, runContext, LAYOUT_VERTICAL, null);
      UserManager um = UserManager.getInstance();
      setTranslator(um.getPropertyHandlerTranslator(getTranslator()));
      initForm(ureq);
      addToRunContext("hasIdentitiesToDelete", hasIdentitesToDelete);
      addToRunContext("identitiesToDelete", identitiesToDelete);
    }
View Full Code Here

  private void doStep2(UserRequest ureq) {
    String nodeTitle = courseNode.getShortTitle();
    vcStep2 = new VelocityContainer("replacewizard_step2", VELOCITY_ROOT + "/replacewizard_step2.html", translator, this);
    if (results != null && results.size() > 0) {
      exportDir = CourseFactory.getOrCreateDataExportDirectory(ureq.getIdentity(), course.getCourseTitle());
      UserManager um = UserManager.getInstance();
      String charset = um.getUserCharset(ureq.getIdentity());
      QTIExportManager qem = QTIExportManager.getInstance();
      Long repositoryRef = results.get(0).getResultSet().getRepositoryRef();
      QTIObjectTreeBuilder qotb = new QTIObjectTreeBuilder(repositoryRef);
      List qtiItemObjectList = qotb.getQTIItemObjectList();
      QTIExportFormatter formatter = new QTIExportFormatterCSVType1(ureq.getLocale(), "\t", "\"", "\\", "\r\n", false);
View Full Code Here

    private FlexiTableDataModel tableDataModel;
    private List<Identity> identitiesToDelete;

    public DeletStepForm01(UserRequest ureq, WindowControl control, Form rootForm, StepsRunContext runContext) {
      super(ureq, control, rootForm, runContext, LAYOUT_VERTICAL, null);
      UserManager um = UserManager.getInstance();
      setTranslator(um.getPropertyHandlerTranslator(getTranslator()));
      initForm(ureq);
    }
View Full Code Here

          if (ident != null) {
            // ignore existing accounts, add info message
            idents.add(ident);
          } else {
            // no identity/user yet, create
            UserManager um = UserManager.getInstance();
            UserPropertyHandler userPropertyHandler;
            String thisKey = "";
            String thisValue = "";
            // check that no user with same login name is already in list
            for (Iterator<List<String>> it_news = newIdents.iterator(); it_news.hasNext();) {
              List<String> singleUser = it_news.next();
              if (singleUser.get(1).equalsIgnoreCase(login)) {
                textAreaElement.setErrorKey("error.login.douplicate", new String[] { String.valueOf(i + 1), login });
                importDataError = true;
                break;
              }
            }

            List<String> ud = new ArrayList<String>();
            // insert fix fields: login, pwd, lang from above
            ud.add("false"); // used for first column in model (user existing)
            ud.add(login);
            ud.add(pwd);
            ud.add(lang);

            for (int j = 0; j < userPropertyHandlers.size(); j++) {
              userPropertyHandler = userPropertyHandlers.get(j);
              thisKey = userPropertyHandler.getName();
              // last columns may be empty if not mandatory
              if (parts.length <= columnId) {
                thisValue = "";
              } else {
                thisValue = parts[columnId].trim();
              }
              boolean isMandatoryField = um.isMandatoryUserProperty(usageIdentifyer, userPropertyHandler);
              if (isMandatoryField && !StringHelper.containsNonWhitespace(thisValue)) {
                textAreaElement.setErrorKey("error.mandatory", new String[] { String.valueOf(i + 1), translate(userPropertyHandler.i18nFormElementLabelKey()) });
                importDataError = true;
                break;
              }
View Full Code Here

TOP

Related Classes of org.olat.user.UserManager

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.