Examples of RepositoryManager


Examples of org.olat.repository.RepositoryManager

    boolean isOLatAdmin = ureq.getUserSession().getRoles().isOLATAdmin();
    boolean isGuestOnly = ureq.getUserSession().getRoles().isGuestOnly();
    boolean isResourceOwner = false;
    if (isOLatAdmin) isResourceOwner = true;
    else {
      RepositoryManager repoMgr = RepositoryManager.getInstance();
      isResourceOwner = repoMgr.isOwnerOfRepositoryEntry(ureq.getIdentity(), repoMgr.lookupRepositoryEntry(res, true));
    }
   
   
    BusinessControl bc = wControl.getBusinessControl();
    ContextEntry ce = bc.popLauncherContextEntry();
View Full Code Here

Examples of org.olat.repository.RepositoryManager

        result.append("0\n0\n");
        result.append(instanceId);
      }
       
    }  else if (command.equals("coursecount")) { // get number of activated courses
      RepositoryManager repoMgr = RepositoryManager.getInstance();
      int allCourses = repoMgr.countByTypeLimitAccess(CourseModule.ORES_TYPE_COURSE, RepositoryEntry.ACC_OWNERS);
      int publishedCourses = repoMgr.countByTypeLimitAccess(CourseModule.ORES_TYPE_COURSE, RepositoryEntry.ACC_USERS);
      result.append(allCourses).append("\n"); // number of all courses
      result.append(publishedCourses).append("\n"); // number of published courses
      result.append("0\n");
      result.append(instanceId);
    }
View Full Code Here

Examples of org.olat.repository.RepositoryManager

    String repoSoftkey = (String) config.get(CPEditController.CONFIG_KEY_REPOSITORY_SOFTKEY);
    if (repoSoftkey == null) {
      if (strict) throw new AssertException("invalid config when being asked for references");
      else return null;
    }
    RepositoryManager rm = RepositoryManager.getInstance();
    RepositoryEntry entry = rm.lookupRepositoryEntryBySoftkey(repoSoftkey, strict);
    // entry can be null only if !strict
    return entry;
  }
View Full Code Here

Examples of org.olat.repository.RepositoryManager

                continue;
              }
            }
          } else if(changedCourseConfig.getGlossarySoftKey()!=null) {
            // update references
            RepositoryManager rm = RepositoryManager.getInstance();
            RepositoryEntry repoEntry = rm.lookupRepositoryEntryBySoftkey(changedCourseConfig.getGlossarySoftKey(), false);
            ReferenceManager.getInstance().addReference(course, repoEntry.getOlatResource(), GlossaryManager.GLOSSARY_REPO_REF_IDENTIFYER);
          }
        }
        //course config transaction fihished
        initialCourseConfig = course.getCourseEnvironment().getCourseConfig().clone();       
View Full Code Here

Examples of org.olat.repository.RepositoryManager

   */
  public void event(UserRequest ureq, Component source, Event event) {
    if (source == forwardButton){
     
      // check if repository entry is still available
      RepositoryManager rm = RepositoryManager.getInstance();
      RepositoryEntry checkEntry = rm.lookupRepositoryEntry(sourceEntry.getKey());
      if (checkEntry == null) { // entry has been deleted meanwhile
        getWindowControl().setError(translator.translate("error.createcopy"));
        fireEvent(ureq, Event.FAILED_EVENT);
        fireEvent(ureq, new EntryChangedEvent(sourceEntry, EntryChangedEvent.DELETED));
        return;
View Full Code Here

Examples of org.olat.repository.RepositoryManager

  /**
   * Implementation normal search: find all repo entries
   * @param ureq
   */
  public void doSearchAll(UserRequest ureq) {
    RepositoryManager rm = RepositoryManager.getInstance();
    Set s = searchForm.getRestrictedTypes();
    List restrictedTypes = (s == null) ? null : new ArrayList(s);
    List entries = rm.genericANDQueryWithRolesRestriction(null, null, null, null, ureq.getUserSession().getRoles(), ureq.getIdentity().getUser().getProperty("institutionalName", null));
    repoTableModel.setEntries(entries);
    tableCtr.modelChanged();
    displaySearchResults(ureq);
  }
View Full Code Here

Examples of org.olat.repository.RepositoryManager

   * @param course
   * @param re
   */
  public UpdateEfficiencyStatementsWorker(OLATResourceable ores) {
    this.ores = ores;
    RepositoryManager rm = RepositoryManager.getInstance();
    RepositoryEntry re = rm.lookupRepositoryEntry(ores, false);
    // get all users who already have an efficiency statement
    identities = EfficiencyStatementManager.getInstance().findIdentitiesWithEfficiencyStatements(re.getKey());
  }
View Full Code Here

Examples of org.olat.repository.RepositoryManager

    // Do set access for owner at the end, because unfinished course should be invisible
    // addedEntry.setAccess(RepositoryEntry.ACC_OWNERS);
    addedEntry.setAccess(0);//Access for nobody
   
    // Set the resource on the repository entry and save the entry.
    RepositoryManager rm = RepositoryManager.getInstance();
    OLATResource ores = OLATResourceManager.getInstance().findOrPersistResourceable(addCallback.getResourceable());
    addedEntry.setOlatResource(ores);
   
    // create security group
    SecurityGroup newGroup = securityManager.createAndPersistSecurityGroup();
    // member of this group may modify member's membership
    securityManager.createAndPersistPolicy(newGroup, Constants.PERMISSION_ACCESS, newGroup);
    // members of this group are always authors also
    securityManager.createAndPersistPolicy(newGroup, Constants.PERMISSION_HASROLE, Constants.ORESOURCE_AUTHOR);
   
    securityManager.addIdentityToSecurityGroup(ureq.getIdentity(), newGroup);
    addedEntry.setOwnerGroup(newGroup);
   
    rm.saveRepositoryEntry(addedEntry);

    detailsController = new RepositoryEditDescriptionController(ureq, getWindowControl(), addedEntry, true);
    detailsController.addControllerListener(this);
    repositoryadd.put("details", detailsController.getInitialComponent());
    // try to get type description based on handlertype
View Full Code Here

Examples of org.olat.repository.RepositoryManager

        msgProperties.setProperty("configInstantMessagingEnabled", String.valueOf(InstantMessagingModule.isEnabled()));
        msgProperties.setProperty("configLanguages", I18nModule.getEnabledLanguageKeys().toString());
        msgProperties.setProperty("configClusterEnabled", String.valueOf(CoordinatorManager.getCoordinator().isClusterMode()));
        msgProperties.setProperty("configDebugginEnabled", String.valueOf(Settings.isDebuging()));
        // Course counts
        RepositoryManager repoMgr = RepositoryManager.getInstance();
        int allCourses = repoMgr.countByTypeLimitAccess(CourseModule.ORES_TYPE_COURSE, RepositoryEntry.ACC_OWNERS);
        int publishedCourses = repoMgr.countByTypeLimitAccess(CourseModule.ORES_TYPE_COURSE, RepositoryEntry.ACC_USERS);
        msgProperties.setProperty("courseCountAll", String.valueOf(allCourses));
        msgProperties.setProperty("courseCountPublished", String.valueOf(publishedCourses));
        // User counts
        Manager secMgr = ManagerFactory.getManager();
        SecurityGroup olatuserGroup = secMgr.findSecurityGroupByName(Constants.GROUP_OLATUSERS);
View Full Code Here

Examples of org.olat.repository.RepositoryManager

    fireEvent(ureq, Event.DONE_EVENT);
  }

  private boolean checkIsRepositoryEntryLaunchable(UserRequest ureq) {
    RepositoryHandler type = RepositoryHandlerFactory.getInstance().getRepositoryHandler(repositoryEntry);
    RepositoryManager rm = RepositoryManager.getInstance();
   
    if (rm.isAllowedToLaunch(ureq, repositoryEntry) || (type.supportsLaunch() && ureq.getUserSession().getRoles().isOLATAdmin())) {
      return true;
    } else if(!rm.isAllowedToLaunch(ureq, repositoryEntry)){
      return false;
    }   
    if (type instanceof CourseHandler) {
      // course
      ICourse course = CourseFactory.loadCourse(repositoryEntry.getOlatResource());
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.