Examples of RepositoryManager


Examples of org.olat.repository.RepositoryManager

      } catch (NumberFormatException e) {
        Tracing.createLoggerFor(InstitutionPortletRunController.class).error(e.getMessage());
      }

      if (polyLink.getLinkType().equals(InstitutionPortlet.TYPE_COURSE)) {
        RepositoryManager rm = RepositoryManager.getInstance();
        RepositoryEntry re = null;

        // id corresponding to the conditions set for this user
        if (polyLink != null && resultIDForUser != null) re = rm.lookupRepositoryEntry(resultIDForUser);

        // if ressource is not available choose default link
        if (re == null && defaultID != null) re = rm.lookupRepositoryEntry(defaultID);

        if (re != null) {
          if (!rm.isAllowedToLaunch(ureq, re)) {
            getWindowControl().setWarning(translate("warn.cantlaunch"));
          } else {
            OLATResourceable ores = re.getOlatResource();
            DTabs dts = (DTabs)Windows.getWindows(ureq).getWindow(ureq).getAttribute("DTabs");
            DTab dt = dts.getDTab(ores);
View Full Code Here

Examples of org.olat.repository.RepositoryManager

    String repoSoftkey = (String) config.get(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();
    return rm.lookupRepositoryEntryBySoftkey(repoSoftkey, strict);
  }
View Full Code Here

Examples of org.olat.repository.RepositoryManager

   * @see org.olat.course.nodes.CourseNode#getReferencedRepositoryEntry()
   */
  public RepositoryEntry getReferencedRepositoryEntry() {
    this.config = getModuleConfiguration();
    String repoSoftkey = (String) config.get(CONFIG_KEY_REPOSITORY_SOFTKEY);
    RepositoryManager rm = RepositoryManager.getInstance();
    RepositoryEntry entry = rm.lookupRepositoryEntryBySoftkey(repoSoftkey, false);
    return entry;
  }
View Full Code Here

Examples of org.olat.repository.RepositoryManager

   */
  public static RepositoryEntry getWikiRepoReference(ModuleConfiguration config, boolean strict) {
    if (config == null) throw new AssertException("missing config in wiki course node");
    String repoSoftkey = (String) config.get(WikiEditController.CONFIG_KEY_REPOSITORY_SOFTKEY);
    if (repoSoftkey == null) throw new AssertException("invalid config when being asked for references");
    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

    String repoSoftkey = (String) config.get(WikiEditController.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

  /**
   * @see org.olat.navigation.SiteInstance#createController(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl)
   */
  public MainLayoutController createController(UserRequest ureq, WindowControl wControl) {
    RepositoryManager rm = RepositoryManager.getInstance();
    RepositoryEntry entry = rm.lookupRepositoryEntryBySoftkey(repositorySoftKey, true);
    ICourse course = CourseFactory.loadCourse(entry.getOlatResource());
    RunMainController c = new RunMainController(ureq, wControl, course, null, false, true);   
    // needed for css style reasons: a site own the whole content area and needs either to use a MenuAndToolController for the 3-columns layout or,
    // like here, the contentOnlyController
    //ContentOnlyController coc = new ContentOnlyController(ureq, wControl, c);
View Full Code Here

Examples of org.olat.repository.RepositoryManager

      } else {
        try {
          String courseNodeId = courseNode.substring(0, courseNode.indexOf(':'));
          Long resId = publisher.getResId();
          ICourse course = CourseFactory.loadCourse(resId);
          RepositoryManager rm = RepositoryManager.getInstance();
          OLATResource rsrc = OLATResourceManager.getInstance().findResourceable(course.getResourceableId(), course.getResourceableTypeName());
          RepositoryEntry re = rm.lookupRepositoryEntry(rsrc, true);
          businessPath = "[RepositoryEntry:" + re.getKey() + "][CourseNode:" + courseNodeId + "]";
        } catch (Exception e) {
          businessPath = null;
          //if something went wrong, like error while loading course...
          logWarn("error while processing resid: "+publisher.getResId(), e);
View Full Code Here

Examples of org.olat.repository.RepositoryManager

      ZipUtil.unzip(new LocalFileImpl(fExportedFile), sfContainer);
    else
      Tracing.logWarn("The actual contents of the shared folder were not found in the export.", ImportSharedfolderReferencesController.class);
   
    // create repository entry
    RepositoryManager rm = RepositoryManager.getInstance();
    RepositoryEntry importedRepositoryEntry = rm.createRepositoryEntryInstance(owner.getName());
    importedRepositoryEntry.setDisplayname(importExport.getDisplayName());
    importedRepositoryEntry.setResourcename(importExport.getResourceName());
    importedRepositoryEntry.setDescription(importExport.getDescription());
    if (keepSoftkey)
      importedRepositoryEntry.setSoftkey(importExport.getSoftkey());
   
    // Set the resource on the repository entry.
    OLATResource ores = OLATResourceManager.getInstance().findOrPersistResourceable(resource);
    importedRepositoryEntry.setOlatResource(ores);
    RepositoryHandler rh = RepositoryHandlerFactory.getInstance().getRepositoryHandler(importedRepositoryEntry);
    importedRepositoryEntry.setCanLaunch(rh.supportsLaunch());
   
    // create security group
    Manager securityManager = ManagerFactory.getManager();
    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(owner, newGroup);
    importedRepositoryEntry.setOwnerGroup(newGroup);
    rm.saveRepositoryEntry(importedRepositoryEntry);
   
    if (!keepSoftkey) {
      // set the new shared folder reference
      CourseConfig courseConfig = course.getCourseEnvironment().getCourseConfig();
      courseConfig.setSharedFolderSoftkey(importedRepositoryEntry.getSoftkey());
View Full Code Here

Examples of org.olat.repository.RepositoryManager

    }

    // BEGIN EFFICIENCY STATEMENT
    // create all efficiency statements for all users in all courses
    if (! uhd.getBooleanDataValue(TASK_EFFICIENCY_STATEMENT_DONE)) {
      RepositoryManager rm = RepositoryManager.getInstance();
      EfficiencyStatementManager esm = EfficiencyStatementManager.getInstance();
      // get all course repository entries
      List entries = rm.queryByType(CourseModule.ORES_TYPE_COURSE);
      Iterator iter = entries.iterator();
      while (iter.hasNext()) {
        RepositoryEntry re = (RepositoryEntry) iter.next();
        // load course from entry
        ICourse course = CourseFactory.loadCourse(re.getOlatResource());
View Full Code Here

Examples of org.olat.repository.RepositoryManager

   * @param ores
   * @param orga
   */
  private void setOrgaTitleToRepoEntryTitle(OLATResourceable ores, CPOrganization orga) {
    // Set the title of the organization to the title of the resource.
    RepositoryManager resMgr = RepositoryManager.getInstance();
    RepositoryEntry cpEntry = resMgr.lookupRepositoryEntry(ores, false);
    if (cpEntry != null) {
      String title = cpEntry.getDisplayname();
      orga.setTitle(title);
    }
  }
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.