Examples of HomePageConfig


Examples of org.olat.user.HomePageConfig

    UserManager userMgr = UserManager.getInstance();
    User user = identity.getUser();
   
    HomePageConfigManager homepageMgr = HomePageConfigManagerImpl.getInstance();
    HomePageConfig publishConfig = homepageMgr.loadConfigFor(identity.getName());

    IdentityDocument identityDocument = new IdentityDocument();
    identityDocument.setTitle(identity.getName());
    identityDocument.setCreatedDate(user.getCreationDate());
   
    // loop through all user properties and collect the content string and the last modified
    List<UserPropertyHandler> userPropertyHanders = userMgr.getUserPropertyHandlersFor(IdentityDocument.class.getName(), false);
    StringBuilder content = new StringBuilder();
    for (UserPropertyHandler userPropertyHandler : userPropertyHanders) {
      String propertyName = userPropertyHandler.getName();
      // only index fields the user has published!
      if (publishConfig.isEnabled(propertyName)) {
        String value = user.getProperty(propertyName, I18nModule.getDefaultLocale());
        if (value != null) {
          content.append(value).append(" ");
        }
      }
    }
    // user text
    String text = publishConfig.getTextAboutMe();
    if (StringHelper.containsNonWhitespace(text)) {
      text = FilterFactory.getHtmlTagsFilter().filter(text);
      content.append(text).append(' ');
    }
    // finally use the properties as the content for this identity
View Full Code Here

Examples of org.olat.user.HomePageConfig

    userDetailsVC.contextPut("identity", this.currentIdentity);
    Translator babel = UserManager.getInstance().getPropertyHandlerTranslator(userTrans);
    if (homePageDisplayController != null) {
      removeAsListenerAndDispose(homePageDisplayController);
    }
    HomePageConfig homePageConfig = HomePageConfigManagerImpl.getInstance().loadConfigFor(currentIdentity.getName());
    homePageDisplayController = new HomePageDisplayController(ureq, getWindowControl(), homePageConfig);
    listenTo(homePageDisplayController);
    userDetailsVC.put("userdetailsform", homePageDisplayController.getInitialComponent());
    // 2. expose the owner groups of the identity
    if (flags.isEnabled(BGConfigFlags.GROUP_OWNERS)) {
View Full Code Here

Examples of org.olat.user.HomePageConfig

        // (UserSearchController's javadoc shows when which event is fired)
        SingleIdentityChosenEvent uce = (SingleIdentityChosenEvent) event;

        // prepare the homepage configuration for this user
        Identity identity = uce.getChosenIdentity();
        HomePageConfig homePageConfig = HomePageConfigManagerImpl.getInstance().loadConfigFor(
            identity.getName()
        );

        // create the controller with this configuration
        homepageC = new HomePageDisplayController(ureq, getWindowControl(), homePageConfig);
View Full Code Here

Examples of org.olat.user.HomePageConfig

      int counter = 0;
      if (log.isDebug()) log.info("Migrating homepage-bio for " + identitiesList.size() + " identities.");

      for (Identity identity : identitiesList) {
        try{
          HomePageConfig hpcfg = hpcm.loadConfigFor(identity.getName());
          String oldBio = hpcfg.getTextAboutMe();
          if (StringHelper.containsNonWhitespace(oldBio)){
            String newBio = migrateStringSavely(oldBio);
            hpcfg.setTextAboutMe(newBio);
            hpcm.saveConfigTo(identity.getName(), hpcfg);
            counter++;
          }
          DBFactory.getInstance().intermediateCommit();
        } catch (Exception e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.