Package org.olat.core.id

Examples of org.olat.core.id.IdentityEnvironment


  /**
   *
   */
  private void init() {
    store = new HashMap(4);
    identityEnvironment = new IdentityEnvironment();
    singleUserSystemBus = CoordinatorManager.getCoordinator().createSingleUserInstance();
    authenticated = false;
    sessionInfo = null;
    sessionServiceInstances = new HashMap<String, Object>();
  }
View Full Code Here


  private boolean hasAccess(Identity identity, String token, ICourse course, CourseNode node) {
    boolean hasAccess = false;
    if (allowsGuestAccess(course)) {
      hasAccess = true;
    } else {
      IdentityEnvironment ienv = new IdentityEnvironment();
      ienv.setIdentity(identity);
      Roles roles = ManagerFactory.getManager().getRoles(identity);
      ienv.setRoles(roles);
      UserCourseEnvironment userCourseEnv = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
      // Build an evaluation tree
      TreeEvaluation treeEval = new TreeEvaluation();
      NodeEvaluation nodeEval = node.eval(userCourseEnv.getConditionInterpreter(), treeEval);
      if (nodeEval.isVisible() && validAuthentication(identity, token)) {
View Full Code Here

    for (Iterator iter = identitiesAndTheirsScores.iterator(); iter.hasNext();) {
      Object[] identityAndItsScore = (Object[]) iter.next();
      if (identityAndItsScore[0] != null){
       
        if (allowedIdKeys.contains(((Identity)identityAndItsScore[0]).getKey())){
          IdentityEnvironment ienv = new IdentityEnvironment();
          ienv.setIdentity((Identity)identityAndItsScore[0]);
          UserCourseEnvironment uce = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
          String scoreAsString = (String) identityAndItsScore[1];
          if(scoreAsString != null){
            try {
              Float score = Float.valueOf(scoreAsString);
View Full Code Here

    final Structure runStructure = course.getEditorTreeModel().createStructureForPreview();
    final String title = course.getCourseTitle();

    simCourseEnv = new PreviewCourseEnvironment(title, runStructure, psf.getDate(), course.getCourseFolderContainer(), course
        .getCourseBaseContainer(),course.getResourceableId(), cpm, cgm, auditman, am);
    simIdentEnv = new IdentityEnvironment();
    simIdentEnv.setRoles(new Roles(false, false, false, isGlobalAuthor, isGuestOnly, false));
    final Identity ident = new PreviewIdentity();
    simIdentEnv.setIdentity(ident);
    //identity must be set before attributes OLAT-4811
    simIdentEnv.setAttributes(psf.getAttributesMap());
View Full Code Here

   * @param course
   * @return Initialized user course environment
   */
  static UserCourseEnvironment createAndInitUserCourseEnvironment(Identity identity, ICourse course) {
    // create an identenv with no roles, no attributes, no locale
    IdentityEnvironment ienv = new IdentityEnvironment();
    ienv.setIdentity(identity);
    UserCourseEnvironment uce = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
    // Fetch all score and passed and calculate score accounting for the entire
    // course
    uce.getScoreAccounting().evaluateAll();
    return uce;
View Full Code Here

     * the real function evaluation which is used during run time
     */
    String attName = (String) inStack[0];
    String attValue = (String) inStack[1];
   
    IdentityEnvironment ienv = getUserCourseEnv().getIdentityEnvironment();
    Identity ident = ienv.getIdentity();
    Map attributes = ienv.getAttributes();
    if (attributes == null) return ConditionInterpreter.INT_FALSE;
    String value = (String)attributes.get(attName);
   
    boolean match = false;
    if (Tracing.isDebugEnabled(EvalAttributeFunction.class)) {
View Full Code Here

    List nodePassedResults = new ArrayList(identities.size());
   
    for (Iterator iter = identities.iterator(); iter.hasNext();) {
      Identity identity = (Identity) iter.next();
      if (identity != null){ 
        IdentityEnvironment ienv = new IdentityEnvironment();
        ienv.setIdentity(identity);
        ICourse course = CourseFactory.loadCourse(ores);
        UserCourseEnvironment uce = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
        ScoreEvaluation scoreEvaluation = uce.getScoreAccounting().getScoreEvaluation(courseNode);
       
        if(scoreEvaluation == null){
View Full Code Here

        tableContent.append((StringHelper.containsNonWhitespace(value) ? value : na));
        tableContent.append("\t");     
      }

      // create a identenv with no roles, no attributes, no locale
      IdentityEnvironment ienv = new IdentityEnvironment();
      ienv.setIdentity(identity);
      UserCourseEnvironment uce = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
      uce.getScoreAccounting().evaluateAll();
      AssessmentManager am = course.getCourseEnvironment().getAssessmentManager();

      Iterator iterNodes = myNodes.iterator();
View Full Code Here

    List nodeScores = new ArrayList(identities.size());
   
    for (Iterator iter = identities.iterator(); iter.hasNext();) {
      Identity identity = (Identity) iter.next();
      if (identity != null){
        IdentityEnvironment ienv = new IdentityEnvironment();
        ienv.setIdentity(identity);
        ICourse course = CourseFactory.loadCourse(ores);
        UserCourseEnvironment uce = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
        ScoreEvaluation scoreEvaluation = uce.getScoreAccounting().getScoreEvaluation(courseNode);
       
        if (scoreEvaluation == null){
View Full Code Here

    Long nodeId = bcContextEntry.getOLATResourceable().getResourceableId();
    if (log.isDebug()) log.debug("nodeId=" + nodeId );
   
    ICourse course = CourseFactory.loadCourse(repositoryEntry.getOlatResource());
    IdentityEnvironment ienv = new IdentityEnvironment();
    ienv.setIdentity(identity);
    ienv.setRoles(roles);
    UserCourseEnvironment userCourseEnv = new UserCourseEnvironmentImpl(ienv, course.getCourseEnvironment());
    if (log.isDebug()) log.debug("userCourseEnv=" + userCourseEnv + "ienv=" + ienv );
   
    CourseNode rootCn = userCourseEnv.getCourseEnvironment().getRunStructure().getRootNode();
View Full Code Here

TOP

Related Classes of org.olat.core.id.IdentityEnvironment

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.