Examples of Manager


Examples of org.olat.basesecurity.Manager

    if (!uhd.getBooleanDataValue(TASK_CHECK_OPEN_QTI_EDITOR_SESSIONS)) {
      Tracing.logAudit("+------------------------------------------+",this.getClass());
      Tracing.logAudit("+... LOCKS FOR OPEN QTI EDITOR SESSIONS ...+",this.getClass());
      Tracing.logAudit("+------------------------------------------+",this.getClass());
      //
      Manager manager = ManagerFactory.getManager();
      RepositoryManager rm = RepositoryManager.getInstance();
      RepositoryEntry myEntry;
      HashMap logmsg = new HashMap();
      VFSContainer qtiTmpDir = new LocalFolderImpl(QTIEditorPackage.getTmpBaseDir());
      VFSContainerFilter foldersOnly = new VFSContainerFilter();
      //folders in ../tmp/qtieditor hold the usernames
      List foldersUsername = qtiTmpDir.getItems(foldersOnly);
      for (Iterator iter = foldersUsername.iterator(); iter.hasNext();) {
        VFSContainer folderOfUser = (VFSContainer) iter.next();
        //the users folders holds folders with ids of OLATResourceable's
        List oResFolders = folderOfUser.getItems(foldersOnly);
        for (Iterator resources = oResFolders.iterator(); resources.hasNext();) {
          VFSContainer folderOfResource = (VFSContainer) resources.next();
          folderOfResource.createChildContainer(QTIEditorPackage.FOLDERNAMEFOR_CHANGELOG);
         
          //these are eiterh surveys or tests
          //try it as testresource then as survey, after this give up
          Long oresId = new Long(folderOfResource.getName());
          FileResource fr = new TestFileResource();
          fr.overrideResourceableId(oresId);
          myEntry = rm.lookupRepositoryEntry(fr,false);
          if(myEntry==null){
            //no qti test found, try the qti survey
            fr = new SurveyFileResource();
            fr.overrideResourceableId(oresId);
            myEntry = rm.lookupRepositoryEntry(fr,false);
          }
          //
          if(myEntry!=null){
            List identites = manager.getVisibleIdentitiesByPowerSearch(folderOfUser.getName(),null,false, null,null,null,null,null);
            if(identites!=null && identites.size()==1){
              //found exact one user, which is the expected case
              //a qti resource was found, update its metadata entry to generate a lock
              String repoEntry = myEntry.getDisplayname();
              String oresIdS = myEntry.getOlatResource().getResourceableId().toString();
View Full Code Here

Examples of org.olat.basesecurity.Manager

   * Create an identity with user permissions
   * @param login
   * @return
   */
  public static final Identity createAndPersistIdentityAsUser(String login) {
    Manager securityManager = ManagerFactory.getManager();
    SecurityGroup group = securityManager.findSecurityGroupByName(Constants.GROUP_OLATUSERS);
    if (group == null) group = securityManager.createAndPersistNamedSecurityGroup(Constants.GROUP_OLATUSERS);
    User user = UserManager.getInstance().createUser("first" + login, "last" + login, login + "@" + maildomain);
    Identity identity = securityManager.createAndPersistIdentityAndUser(login, user, OLATAuthenticationController.PROVIDER_OLAT, login,
        Encoder.encrypt("A6B7C8"));
    securityManager.addIdentityToSecurityGroup(identity, group);
    return identity;
  }
View Full Code Here

Examples of org.olat.basesecurity.Manager

   * Create an identity with author permissions
   * @param login
   * @return
   */
  public static final Identity createAndPersistIdentityAsAuthor(String login) {
    Manager securityManager = ManagerFactory.getManager();
    SecurityGroup group = securityManager.findSecurityGroupByName(Constants.GROUP_AUTHORS);
    if (group == null) group = securityManager.createAndPersistNamedSecurityGroup(Constants.GROUP_AUTHORS);
    User user = UserManager.getInstance().createUser("first" + login, "last" + login, login + "@" + maildomain);
    Identity identity = securityManager.createAndPersistIdentityAndUser(login, user, OLATAuthenticationController.PROVIDER_OLAT, login,
        Encoder.encrypt("A6B7C8"));
    securityManager.addIdentityToSecurityGroup(identity, group);
    return identity;
  }
View Full Code Here

Examples of org.olat.basesecurity.Manager

   * Create an identity with admin permissions
   * @param login
   * @return
   */
  public static final Identity createAndPersistIdentityAsAdmin(String login) {
    Manager securityManager = ManagerFactory.getManager();
    SecurityGroup group = securityManager.findSecurityGroupByName(Constants.GROUP_ADMIN);
    if (group == null) group = securityManager.createAndPersistNamedSecurityGroup(Constants.GROUP_ADMIN);
    User user = UserManager.getInstance().createUser("first" + login, "last" + login, login + "@" + maildomain);
    Identity identity = securityManager.createAndPersistIdentityAndUser(login, user, OLATAuthenticationController.PROVIDER_OLAT, login,
        Encoder.encrypt("A6B7C8"));
    securityManager.addIdentityToSecurityGroup(identity, group);
    return identity;
  }
View Full Code Here

Examples of org.olat.basesecurity.Manager

  public Component getTransactionComponent() {
    return getInitialComponent();
  }

  public void repositoryEntryCreated(RepositoryEntry re) {
    Manager secMgr = ManagerFactory.getManager();
    secMgr.createAndPersistPolicy(re.getOwnerGroup(), Constants.PERMISSION_ADMIN, re.getOlatResource());
  }
View Full Code Here

Examples of org.olat.basesecurity.Manager

      BusinessGroupManager groupManager = BusinessGroupManagerImpl.getInstance();
      BusinessGroup group = groupManager.loadBusinessGroup(groupKey, false);
      // check if the group still exists and the user is really in this group
      // (security, changed group)
      if (group != null && groupManager.isIdentityInBusinessGroup(ureq.getIdentity(), group)) {
        Manager securityManager = ManagerFactory.getManager();
        boolean isCoach = securityManager.isIdentityInSecurityGroup(ureq.getIdentity(), group.getOwnerGroup());
        // create group without admin flag enabled eventhough the user might be
        // coach. the flag is not needed here
        // since the groups knows itself if the user is coach and the user sees
        // only his own groups.
        BGControllerFactory.getInstance().createRunControllerAsTopNavTab(group, ureq, getWindowControl(), /*ual, */false, null);
View Full Code Here

Examples of org.olat.basesecurity.Manager

   * @return The list of identities from this course
   */
  public static List loadUsers(CourseEnvironment courseEnv) {
    List identites = new ArrayList();
    CourseGroupManager gm = courseEnv.getCourseGroupManager();
    Manager securityManager = ManagerFactory.getManager();
    List groups = gm.getAllLearningGroupsFromAllContexts();

    Iterator iter = groups.iterator();
    while (iter.hasNext()) {
      BusinessGroup group = (BusinessGroup) iter.next();
      SecurityGroup participants = group.getPartipiciantGroup();
      List ids = securityManager.getIdentitiesOfSecurityGroup(participants);
      identites.addAll(ids);
    }
    return identites;
  }
View Full Code Here

Examples of org.olat.basesecurity.Manager

   */
  public List<Identity> getIdentitiesWithQtiSerEntry(Long resourceableId, String ident) {   
    List<Identity> identities = new ArrayList<Identity>();
    LocalFolderImpl item = new LocalFolderImpl(new File(FilePersister.getFullPathToCourseNodeDirectory(Long.toString(resourceableId), ident)));
    if (VFSManager.exists(item)) {
      Manager secMgr = ManagerFactory.getManager();
      for (VFSItem identityFolder : item.getItems()) {
        Identity identity = secMgr.findIdentityByName(identityFolder.getName());
        if (identity != null) identities.add(identity);
      }
    }
   
    return identities;
View Full Code Here

Examples of org.olat.basesecurity.Manager

   /**
   * @see org.olat.instantMessaging.InstantMessaging#synchonizeBuddyRoster(org.olat.group.BusinessGroup)
   */
  public boolean synchonizeBuddyRoster(BusinessGroup group) {
    Manager securityManager = ManagerFactory.getManager();
    SecurityGroup owners = group.getOwnerGroup();
    SecurityGroup participants = group.getPartipiciantGroup();
    List<Identity> users = securityManager.getIdentitiesOfSecurityGroup(owners);
    users.addAll(securityManager.getIdentitiesOfSecurityGroup(participants));
   
    int counter = 0;
    List<String> usernames = new ArrayList<String>();
    for (Iterator<Identity> iter = users.iterator(); iter.hasNext();) {
      Identity ident = iter.next();
View Full Code Here

Examples of org.olat.basesecurity.Manager

  public void doIndex(SearchResourceContext parentResourceContext, Object parentObject, OlatFullIndexer indexWriter) throws IOException,
      InterruptedException {
   
    int counter = 0;
    Manager secMgr = ManagerFactory.getManager();
    List<Identity> identities = secMgr.getIdentitiesByPowerSearch(null, null, true, null, null, null, null, null, Identity.STATUS_ACTIV);
    if (log.isDebug()) log.debug("Found " + identities.size() + " active identities to index");
    for (Identity identity : identities) {
      try {
        if (log.isDebug()) log.debug("Indexing identity::" + identity.getName() + " and counter::" + counter);
        // Create a search context for this identity. The search context will open the users visiting card in a new tab
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.