Package org.olat.user

Examples of org.olat.user.HomePageConfigManager


      // to see the users home page
      Link userLink = (Link) source;
      Object userObject = userLink.getUserObject();
      if (userObject instanceof Identity) {
        Identity chosenIdentity = (Identity) userObject;
        HomePageConfigManager hpcm = HomePageConfigManagerImpl.getInstance();
        OLATResourceable ores = hpcm.loadConfigFor(chosenIdentity.getName());
        DTabs dts = (DTabs) Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
        // was brasato:: DTabs dts = getWindowControl().getDTabs();
        DTab dt = dts.getDTab(ores);
        if (dt == null) {
          // does not yet exist -> create and add
View Full Code Here


  public static Document createDocument(SearchResourceContext searchResourceContext, Identity identity) {   

    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());
   
View Full Code Here

      // TODO:as:a move to own controller (homepage whatever controller)
      if (event instanceof SingleIdentityChosenEvent) {
        SingleIdentityChosenEvent foundEvent = (SingleIdentityChosenEvent) event;
        Identity chosenIdentity = foundEvent.getChosenIdentity();
        if (chosenIdentity != null) {
          HomePageConfigManager hpcm = HomePageConfigManagerImpl.getInstance();
          OLATResourceable ores = hpcm.loadConfigFor(chosenIdentity.getName());
          DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
          //was brasato:: DTabs dts = getWindowControl().getDTabs();
          DTab dt = dts.getDTab(ores);
          if (dt == null) {
            // does not yet exist -> create and add
View Full Code Here

      log.audit("+---------------------------------------------------------------+");
     
      Manager secMgr = ManagerFactory.getManager();
      List<Identity> identitiesList = secMgr.getIdentitiesByPowerSearch(null, null, true, null, null, null,
          null, null, null);
      HomePageConfigManager hpcm = HomePageConfigManagerImpl.getInstance();
      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) {
          log.error("Error during Migration: "+e, e);
View Full Code Here

TOP

Related Classes of org.olat.user.HomePageConfigManager

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.