Package org.olat.core.logging

Examples of org.olat.core.logging.OLATRuntimeException


      log.debug("creating folders and move files and updating properties to default values took: (milliseconds)"+(end-start));
    }
  }

  private void throwError(OLATResourceable ores) {
    throw new OLATRuntimeException(this.getClass(), "Unable to create wiki folder structure for resource: " + ores.getResourceableId(),
        null);
  }
View Full Code Here


      OutputStream os = leaf.getOutputStream(false);
      p.store(os, "wiki page meta properties");
      os.close();
      // if (incrementVersion) page.incrementVersion();
    } catch (IOException e) {
      throw new OLATRuntimeException(WikiManager.class, "failed to save wiki page properties for page with id: " + page.getPageId() + " and olatresource: " + ores.getResourceableId(), e);
    }
    page.setViewCount(0); //reset view count of the page
   
    //update cache to inform all nodes about the change
    if (wikiCache!=null) {
View Full Code Here

    if (leaf == null) leaf = wikiContentContainer.createChildLeaf(page.getPageId() + "." + WIKI_PROPERTIES_SUFFIX);
    Properties p = getPageProperties(page);
    try {
      p.store(leaf.getOutputStream(false), "wiki page meta properties");
    } catch (IOException e) {
      throw new OLATRuntimeException(WikiManager.class, "failed to save wiki page properties for page with id: " + page.getPageId() +" and olatresource: " + ores.getResourceableId(), e);
    }
  }
View Full Code Here

    try {
      String encoded = new String(Base64.encodeBase64(pageName.getBytes("utf-8")), "us-ascii");
      encoded = encoded.replace('/', '_'); //base64 can contain "/" so we have to replace them
      return encoded;
    } catch (UnsupportedEncodingException e) {
      throw new OLATRuntimeException(WikiManager.class, "Encoding UTF-8 not supported by your platform!", e);
    }
  }
View Full Code Here

    // at this point we know the filelocation for our xstream-sco-score file (FIXME:fj: do better
   
    // even if we do not show the menu, we need to build parse the manifest
    // and find the first node to display at startup
    File mani = new File(cpRoot, "imsmanifest.xml");
    if (!mani.exists()) { throw new OLATRuntimeException("error.manifest.missing", null, PACKAGE, "CP " + cpRoot.getAbsolutePath()
        + " has no imsmanifest", null); }
    treeModel = new ScormCPManifestTreeModel(mani, scormAdapter.getScoItemsStatus());

    menuTree = new MenuTree("cpDisplayTree");
    menuTree.setTreeModel(treeModel);
View Full Code Here

      AbstractParser parser = new JFlexParser(input);
      parsedDoc = parser.parseHTML(wikiComp.getWikiContent());
    } catch (UnsupportedEncodingException e) {
      //encoding utf-8 should be ok
    } catch (Exception e) {
      throw new OLATRuntimeException(this.getClass(), "error while rendering wiki page with content:"+ wikiComp.getWikiContent(), e);
    }
    // Use global js math formatter for latex formulas
    sb.append(Formatter.formatLatexFormulas(parsedDoc.getContent()));
    sb.append("</div>");
    //set targets of media, image and external links to target "_blank"
View Full Code Here

      _sequencerModel.setDefaultOrg("");
    }
    try {
      _sequencerModel.saveDocument(true);
    } catch (IOException ex) {
      throw new OLATRuntimeException(this.getClass(), "Could not save package status.", ex);
    }
    // throw an exception if no items were found in the manifest
    if (!_hasItemsToPlay) { throw new NoItemFoundException(NoItemFoundException.NO_ITEM_FOUND_MSG); }
  }
View Full Code Here

        scoModel.setDocument(theModel);
        scoModel.setFile(scoFile);
        try {
          scoModel.saveDocument();
        } catch (IOException ex) {
          throw new OLATRuntimeException(this.getClass(), "Could not save sco settings.", ex);         
        }
      }
    }
    Iterator it = element.getChildren().iterator();
    while (it.hasNext()) {
View Full Code Here

    //System.out.println("System.out.println - findCourseNodeProperty");
    if(forumKeyProp!=null) {
      // Forum does already exist, load forum with key from properties
      Long forumKey = forumKeyProp.getLongValue();
      theForum = fom.loadForum(forumKey);
      if (theForum == null) { throw new OLATRuntimeException(FOCourseNode.class, "Tried to load forum with key " + forumKey.longValue() + " in course "
        + userCourseEnv.getCourseEnvironment().getCourseResourceableId() + " for node " + thisCourseNode.getIdent()
        + " as defined in course node property but forum manager could not load forum.", null); }
    } else {
      //creates resourceable from FOCourseNode.class and the current node id as key
      OLATResourceable courseNodeResourceable = OresHelper.createOLATResourceableInstance(FOCourseNode.class, new Long(this.getIdent()));
      Codepoint.codepoint(FOCourseNode.class, "beforeDoInSync");   
      //System.out.println("System.out.println - beforeDoInSync");
      //o_clusterOK by:ld
      theForum = CoordinatorManager.getCoordinator().getSyncer().doInSync(courseNodeResourceable, new SyncerCallback<Forum>(){
        public Forum execute() {
        Forum forum = null;
        Long forumKey;             
        Codepoint.codepoint(FOCourseNode.class,"doInSync");
        //System.out.println("Codepoint - doInSync");
        Property forumKeyProperty = cpm.findCourseNodeProperty(thisCourseNode, null, null, FORUM_KEY);       
        if (forumKeyProperty == null) {
          // First call of forum, create new forum and save forum key as property         
          forum = fom.addAForum();
          forumKey = forum.getKey();
          forumKeyProperty = cpm.createCourseNodePropertyInstance(thisCourseNode, null, null, FORUM_KEY, null, forumKey, null, null);
          cpm.saveProperty(forumKeyProperty)
          //System.out.println("Forum added");
        } else {
          // Forum does already exist, load forum with key from properties
          forumKey = forumKeyProperty.getLongValue();
          forum = fom.loadForum(forumKey);
          if (forum == null) { throw new OLATRuntimeException(FOCourseNode.class, "Tried to load forum with key " + forumKey.longValue() + " in course "
              + userCourseEnv.getCourseEnvironment().getCourseResourceableId() + " for node " + thisCourseNode.getIdent()
              + " as defined in course node property but forum manager could not load forum.", null); }
          }
        //System.out.println("Forum already exists");
        return forum;
View Full Code Here

      bis = new BufferedInputStream(in);
      XMLParser xmlParser = new XMLParser(new IMSEntityResolver());
      doc = xmlParser.parse(bis, false);
    }
    catch (IOException e) {
      throw new OLATRuntimeException(ScormCPManifestTreeModel.class, "could not read and parse from file "+documentF.getAbsolutePath(),e);
    }
    finally {
      try {
        if (in != null)   in.close();
        if (bis != null) bis.close();
View Full Code Here

TOP

Related Classes of org.olat.core.logging.OLATRuntimeException

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.