Package org.olat.ims.cp.objects

Examples of org.olat.ims.cp.objects.CPResource.addFile()


    } else if (parentElement instanceof CPResource) {
      // parent is a <resource>
      CPResource resource = (CPResource) parentElement;
      if (newElement instanceof CPFile) {
        resource.addFile((CPFile) newElement);
      } else if (newElement instanceof CPDependency) {
        resource.addDependency((CPDependency) newElement);
      } else {
        throw new OLATRuntimeException(CPOrganizations.class, "you can only add <dependency> or <file> elements to a Resource",
            new Exception());
View Full Code Here


        // attached.
        VFSLeaf pageFile = page.getPageFile();
        if (pageFile != null) {
          CPResource res = new CPResource();
          CPFile file = new CPFile(pageFile);
          res.addFile(file);
          // TODO:GW Set type according to file
          res.setType("text/html");
          res.setHref(file.getHref());
          item.setIdentifierRef(res.getIdentifier());
          cpcore.getRootNode().getResources().addResource(res);
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.