Package org.olat.core.id

Examples of org.olat.core.id.Identity


    return filename;
  }
  public String getAuthor() {
    try {
      // try to handle as identity id
      Identity identity = ManagerFactory.getManager().loadIdentityByKey(Long.valueOf(author));
      if (identity == null) {
        return author;
      }
      return identity.getName();
    } catch (NumberFormatException nEx) {
      return author;
    } catch (ObjectNotFoundException oEx) {
      DBFactory.getInstanceForClosing().rollbackAndCloseSession();
      return author;
View Full Code Here


  }
  public String getFileSize() {
    return fileSize;
  }
  public void setAuthor(String author) {
    Identity identity = ManagerFactory.getManager().findIdentityByName(author);
    this.author = identity.getKey().toString();
  }
View Full Code Here

      throw new AssertException("use constructor with course and coursnode");
    }
    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());
View Full Code Here

 
  @Override
  protected void event(UserRequest ureq, Controller source, Event event) {
    if (source == userSearch) {
      UserSearchUIService searchService = (UserSearchUIService) ServiceFactory.getService(UserSearchUIService.class);
      Identity user = searchService.getChosenUser(event);
      String chosenName = user.getName();
      showInfo("user.chosen", chosenName);
     
      // not "servicized" yet...
      //HomePageConfig homePageConfig = HomePageConfigManagerImpl.getInstance().loadConfigFor(chosenName);
      //Controller homepageC = new HomePageDisplayController(ureq, getWindowControl(), homePageConfig);
View Full Code Here

      boolean auth = usess.isAuthenticated();

      if (!auth ||   !ureq.isValidDispatchURI()) {
        // String lang =
        // I18nManager.getInstance().getDefaultLocale().toString();
        Identity ident = ManagerFactory.getManager().findIdentityByName("administrator");

        usess.signOffAndClear();
        usess.setIdentity(ident);
        usess.setRoles(new Roles(true, true, true, true, false, true));
        usess.setLocale(I18nManager.getInstance().getLocaleOrDefault(ident.getUser().getPreferences().getLanguage()));

        // brasato:: was
        // Windows.getWindows(ureq).getWindowManager().getGlobalSettings().setFontSize(
        // identity.getUser().getPreferences().getFontsize() );
        Windows.getWindows(ureq).setAttribute("fontsize", ident.getUser().getPreferences().getFontsize());

        AuthHelper.setSessionInfoFor(ident, OLATAuthenticationController.PROVIDER_OLAT, ureq);
        // put users personal rss token into session
        RSSUtil.putPersonalRssTokenInSession(ureq);
        // confirm signedOn
View Full Code Here

        for (DialogElement element : dialogElements) {
          // do only show entries newer then the ones already seen
          if (element.getDate().after(compareDate)) {
            String filename = element.getFilename();
            String creator = element.getAuthor();
            Identity ident = ManagerFactory.getManager().findIdentityByName(creator);
            Date modDate = element.getDate();

            String desc = translator.translate("notifications.entry", new String[] { filename, NotificationHelper.getFormatedName(ident) });
            String urlToSend = NotificationHelper.getURLFromBusinessPathString(p, p.getBusinessPath());
            String cssClass = CSSHelper.createFiletypeIconCssClassFor(filename);
View Full Code Here

        businessControlString = p.getBusinessPath() + "[Message:";
       
        si = new SubscriptionInfo(getTitleItem(p, translator), null);
        for (Message mInfo : mInfos) {
          String title = mInfo.getTitle();
          Identity creator = mInfo.getCreator();
          Identity modifier = mInfo.getModifier();
          Date modDate = mInfo.getLastModified();
         
          String name;
          if(modifier != null) {
            name = NotificationHelper.getFormatedName(modifier);
View Full Code Here

   
    boolean firstIteration = true;
    int rowNumber = 1;
    Iterator iterIdentities = identities.iterator();
    while (iterIdentities.hasNext()) {
      Identity identity = (Identity) iterIdentities.next();
      String uname = identity.getName();

      tableContent.append(rowNumber);
      tableContent.append("\t");
      tableContent.append(uname);
      tableContent.append("\t");
      // add dynamic user properties
      for (UserPropertyHandler propertyHandler : userPropertyHandlers) {
        String value = propertyHandler.getUserProperty(identity.getUser(), t.getLocale());
        tableContent.append((StringHelper.containsNonWhitespace(value) ? value : na));
        tableContent.append("\t");     
      }

      // create a identenv with no roles, no attributes, no locale
View Full Code Here

    //synchronisation is solved in the LockManager
    LockResult lres;
    PropertyManager pm = PropertyManager.getInstance();
    String derivedLockString = OresHelper.createStringRepresenting(ores, locksubkey);
    long aqTime;
    Identity lockOwner;
    boolean success;
    Property p;

    p = pm.findProperty(null, null, null, CATEGORY_PERSISTENTLOCK, derivedLockString);
    if (p == null) {
View Full Code Here

    //synchronisation is solved in the LockManager
    String derivedLockString = ((LockResultImpl)le).getLockEntry().getKey();
    PropertyManager pm = PropertyManager.getInstance();
    Property p = pm.findProperty(null, null, null, CATEGORY_PERSISTENTLOCK, derivedLockString);
    if (p == null) throw new AssertException("could not release lock: no lock in db, " + derivedLockString);
    Identity ident = le.getOwner();
    Long ownerKey = p.getLongValue();
    if (!ownerKey.equals(ident.getKey())) throw new AssertException("user " + ident.getName()
        + " cannot release lock belonging to user with key " + ownerKey + " on resourcestring " + derivedLockString);
    pm.deleteProperty(p);
  }
View Full Code Here

TOP

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

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.