Package org.olat.fileresource.types

Examples of org.olat.fileresource.types.GlossaryResource


        // add a podcast copy
        else if (PodcastFileResource.validate(fResource)) tempFr = new PodcastFileResource(fResourceFileroot, fResource);
        // add a blog copy
        else if (BlogFileResource.validate(fResource)) tempFr = new BlogFileResource(fResourceFileroot, fResource);
        // add a glossary copy
        else if (GlossaryResource.validate(fResource)) tempFr = new GlossaryResource();
        // the following types need unzippedDir
        else if (fResource.getName().toLowerCase().endsWith(".zip")) {
          File fUnzippedDir = unzipFileResource(tempFr);
          if (fUnzippedDir == null) {
            // in case of failure we forward the error message
            throw new AddingResourceException("resource.error.zip");
          }
          if (TestFileResource.validate(fUnzippedDir)) tempFr = new TestFileResource();
          else if (WikiResource.validate(fUnzippedDir)) tempFr = new WikiResource();
          else if (PodcastFileResource.validate(fUnzippedDir)) tempFr = new PodcastFileResource(fResourceFileroot, fUnzippedDir);
          else if (BlogFileResource.validate(fUnzippedDir)) tempFr = new BlogFileResource(fResourceFileroot, fUnzippedDir);
          else if (SurveyFileResource.validate(fUnzippedDir)) tempFr = new SurveyFileResource();
          // CP must be later entry... Test- and SurveyFileResource may contain
          // imsmanifest.xml as well
          else if (ImsCPFileResource.validate(fUnzippedDir)) tempFr = new ImsCPFileResource();
          // scorm and cp now can throw an exception which helps to show a
          // better error message in case
          // of a failure in adding a new resource
          else if (ScormCPFileResource.validate(fUnzippedDir)) tempFr = new ScormCPFileResource();
          // glossary resources are packaged within zip for import/export
          else if (GlossaryResource.validate(fUnzippedDir)) tempFr = new GlossaryResource();
          else {
            // just a generic ZIP file... we can delete the temporary unziped
            // dir...
            throw new AddingResourceException("doesn't matter what error key is declared");
          }
View Full Code Here


   * export easier
   *
   * @return
   */
  public GlossaryResource createGlossary() {
    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);
View Full Code Here

   * @param owner
   * @return
   */
  public static RepositoryEntry doImport(RepositoryEntryImportExport importExport, ICourse course, boolean keepSoftkey, Identity owner) {
    GlossaryManager gm = GlossaryManager.getInstance();
    GlossaryResource resource = gm.createGlossary();
    if (resource == null) {
      Tracing.logError("Error adding glossary directry during repository reference import: " + importExport.getDisplayName(),
          ImportGlossaryReferencesController.class);
      return null;
    }
View Full Code Here

TOP

Related Classes of org.olat.fileresource.types.GlossaryResource

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.