Examples of OLATResource


Examples of org.olat.resource.OLATResource

        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...
View Full Code Here

Examples of org.olat.resource.OLATResource

  /**
   * @see org.olat.basesecurity.Manager#createAndPersistPolicy(org.olat.basesecurity.SecurityGroup, java.lang.String, org.olat.core.id.OLATResourceable
   */
  public Policy createAndPersistPolicy(SecurityGroup secGroup, String permission, OLATResourceable olatResourceable) {
    OLATResource olatResource = orm.findOrPersistResourceable(olatResourceable);
    return createAndPersistPolicyWithResource(secGroup, permission, olatResource);
  }
View Full Code Here

Examples of org.olat.resource.OLATResource

   * @param permission
   * @param olatResourceable
   * @return Policy
   */
  private Policy createAndPersistPolicyIfNotExists(SecurityGroup secGroup, String permission, OLATResourceable olatResourceable) {
    OLATResource olatResource = orm.findOrPersistResourceable(olatResourceable);
    Policy existingPolicy = findPolicy(secGroup, permission, olatResource);
    if (existingPolicy == null) {
      return createAndPersistPolicy(secGroup, permission, olatResource);
    }
    return existingPolicy;
View Full Code Here

Examples of org.olat.resource.OLATResource

  /**
   * @see org.olat.basesecurity.Manager#deletePolicy(org.olat.basesecurity.SecurityGroup, java.lang.String, org.olat.core.id.OLATResourceable
   */
  public void deletePolicy(SecurityGroup secGroup, String permission, OLATResourceable olatResourceable) {    
    OLATResource olatResource = orm.findResourceable(olatResourceable);
    if (olatResource == null) throw new AssertException("cannot delete policy of a null olatresourceable!");
    Policy p = findPolicy(secGroup, permission, olatResource);
    // fj: introduced strict testing here on purpose
    if (p == null) throw new AssertException("findPolicy returned null, cannot delete policy");
    deletePolicy(p);
View Full Code Here

Examples of org.olat.resource.OLATResource

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

Examples of org.olat.resource.OLATResource

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

Examples of org.olat.resource.OLATResource

            + ", title " + cur.getName());
        // launch entry if launchable, otherwise offer it as download / launch
        // it as non-html in browser
        String displayName = cur.getName();
        RepositoryHandler handler = RepositoryHandlerFactory.getInstance().getRepositoryHandler(repoEntry);
        OLATResource ores = repoEntry.getOlatResource();
        if (ores == null) throw new AssertException("repoEntry had no olatresource, repoKey = " + repoEntry.getKey());
        if (repoEntry.getCanLaunch()) {
          // we can create a controller and launch
          // it in OLAT, e.g. if it is a
          // content-packacking or a course
View Full Code Here

Examples of org.olat.resource.OLATResource

      }
      importedRepositoryEntry.setSoftkey(importExport.getSoftkey());
    }

    // Set the resource on the repository entry.
    OLATResource ores = OLATResourceManager.getInstance().findOrPersistResourceable(fileResource);
    importedRepositoryEntry.setOlatResource(ores);
    RepositoryHandler rh = RepositoryHandlerFactory.getInstance().getRepositoryHandler(importedRepositoryEntry);
    importedRepositoryEntry.setCanLaunch(rh.supportsLaunch());

    // create security group
View Full Code Here

Examples of org.olat.resource.OLATResource

      tempFr.overrideResourceableId(resourceableId);
    }

    // add olat resource
    OLATResourceManager rm = OLATResourceManager.getInstance();
    OLATResource ores = rm.findOrPersistResourceable(tempFr);

    // make IMS-Content-Packaging offline readable adding a html-frameset
    if (tempFr instanceof ImsCPFileResource) {
      CPOfflineReadableManager cporm = CPOfflineReadableManager.getInstance();
      cporm.makeCPOfflineReadable(ores, newName);
View Full Code Here

Examples of org.olat.resource.OLATResource

    // delete resources
    File fResourceFileroot = getFileResourceRoot(res);
    FileUtils.deleteDirsAndFiles(fResourceFileroot, true, true);
    // delete resourceable
    OLATResourceManager rm = OLATResourceManager.getInstance();
    OLATResource ores = rm.findResourceable(res);
    if (ores != null) rm.deleteOLATResource(ores);
  }
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.