Package org.olat.resource

Examples of org.olat.resource.OLATResource


      LayoutMain3ColsController emptyCtr = new LayoutMain3ColsController(ureq, wControl, null, null, null, null);
      return emptyCtr;
    } else {
      // Increment launch counter
      rm.incrementLaunchCounter(entry);
      OLATResource ores = entry.getOlatResource();
      ICourse course = loadCourse(ores);
     
      ContextEntry ce = BusinessControlFactory.getInstance().createContextEntry(entry);
      WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ce, wControl)
     
View Full Code Here


    GlossaryResource resource = new GlossaryResource();
    VFSContainer rootContainer = FileResourceManager.getInstance().getFileResourceRootImpl(resource);
    if (rootContainer == null) return null;
    if (rootContainer.createChildContainer(INTERNAL_FOLDER_NAME) == null) return null;
    OLATResourceManager rm = OLATResourceManager.getInstance();
    OLATResource ores = rm.createOLATResourceInstance(resource);
    rm.saveOLATResource(ores);
    return resource;
  }
View Full Code Here

        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);
          //node forum
          businessPath = "[RepositoryEntry:" + re.getKey() + "][CourseNode:" + courseNodeId + "]";
        } catch (Exception e) {
          businessPath = null;
View Full Code Here

   * @param feedResource
   * @return The feed resourcable after creation on file system
   */
  private OLATResourceable createFeedResource(FeedFileResource feedResource) {
    OLATResourceManager rm = OLATResourceManager.getInstance();
    OLATResource ores = rm.createOLATResourceInstance(feedResource);
    rm.saveOLATResource(ores);
    Feed feed = new Feed(feedResource);
    VFSContainer podcastContainer = getFeedContainer(feedResource);
    VFSLeaf leaf = podcastContainer.createChildLeaf(FEED_FILE_NAME);
    podcastContainer.createChildContainer(MEDIA_DIR);
View Full Code Here

    }

    if (groupContexts.size() == 0) {
      // create new default context if none exists
      BGContextManager contextManager = BGContextManagerImpl.getInstance();
      OLATResource courseResource = OLATResourceManager.getInstance().findOrPersistResourceable(course);
      BGContext context = contextManager.createAndAddBGContextToResource(defaultContextName, courseResource, groupType, null, true);
      groupContexts.add(context);
      doInitGroupmanagement(ureq, context, false);
    } else if (groupContexts.size() == 1) {
      BGContext context = (BGContext) groupContexts.get(0);
View Full Code Here

    courseNodeResourceContext.setTitle(courseNode.getShortTitle());
    courseNodeResourceContext.setDescription(courseNode.getLongTitle());
   
    ScormCourseNode scormNode = (ScormCourseNode)courseNode;
    RepositoryEntry repoEntry = scormNode.getReferencedRepositoryEntry();
    OLATResource ores = repoEntry.getOlatResource();
    File cpRoot = FileResourceManager.getInstance().unzipFileResource(ores);
   
    doIndex(courseNodeResourceContext, indexWriter, cpRoot);
  }
View Full Code Here

    // 1) update context
    DBFactory.getInstance().updateObject(bgContext);
    // 2) reload course contexts for all courses wher this context is used
    List resources = findOLATResourcesForBGContext(bgContext);
    for (Iterator iter = resources.iterator(); iter.hasNext();) {
      OLATResource resource = (OLATResource) iter.next();
      if (resource.getResourceableTypeName().equals(CourseModule.getCourseTypeName())) {
        ICourse course = CourseFactory.loadCourse(resource);
        course.getCourseEnvironment().getCourseGroupManager().initGroupContextsList();
      } else if (resource.getResourceableTypeName().equals("junitcourse")) {
        // do nothing when in junit test mode
      } else {
        throw new AssertException("Currently only course resources allowed in resource to context relations.");
      }
    }
View Full Code Here

      areaManager.deleteBGArea(area);
    }
    // 3) Delete group to resource relations
    List referencingResources = findOLATResourcesForBGContext(bgContext);
    for (Iterator iter = referencingResources.iterator(); iter.hasNext();) {
      OLATResource refRes = (OLATResource) iter.next();
      removeBGContextFromResource(bgContext, refRes);
    }
    // 4) Delete group context
    DBFactory.getInstance().deleteObject(bgContext);
    // 5) Delete security group
View Full Code Here

   */
  public List findRepositoryEntriesForBGContext(BGContext bgContext) {
    List resources = findOLATResourcesForBGContext(bgContext);
    List entries = new ArrayList();
    for (Iterator iter = resources.iterator(); iter.hasNext();) {
      OLATResource resource = (OLATResource) iter.next();
      RepositoryEntry entry = RepositoryManager.getInstance().lookupRepositoryEntry(resource, false);
      if (entry == null) {
        throw new AssertException("No repository entry found for olat resource with TYPE::" + resource.getResourceableTypeName() + " ID::"
            + resource.getResourceableId());
      } else {
        entries.add(entry);
      }
    }
    return entries;
View Full Code Here

      getWindowControl().setError(translator.translate("error.createcopy"));
      fireEvent(ureq, Event.FAILED_EVENT);
      return null;
    }
   
    OLATResource ores = OLATResourceManager.getInstance().findOrPersistResourceable(newResourceable);
    preparedEntry.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);
View Full Code Here

TOP

Related Classes of org.olat.resource.OLATResource

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.