Package org.olat.modules.scorm.server.servermodels

Examples of org.olat.modules.scorm.server.servermodels.ScoDocument


  }
 
  private void collectData(String username, VFSContainer scoFolder, ScormExportVisitor visitor) {
    List<VFSItem> contents = scoFolder.getItems(new XMLFilter());
    for(VFSItem file:contents) {
      ScoDocument document = new ScoDocument(null);
      try {
        if(file instanceof LocalFileImpl) {
          document.loadDocument(((LocalFileImpl)file).getBasefile());
        }
        else {
          logger.warn("Cannot use this type of VSFItem to load a SCO Datamodel: " + file.getClass().getName(), null);
          continue;
        }

        String[][] scoModel = document.getScoModel();
        ScoDatas parsedDatas = parseScoModel(file.getName(), username, scoModel);
        visitor.visit(parsedDatas);
      } catch (Exception e) {
        logger.error("Cannot load a SCO Datamodel", e);
      }
View Full Code Here


  private List<CmiData> collectData(VFSContainer scoFolder) {
    List<CmiData> datas = new ArrayList<CmiData>();
   
    List<VFSItem> contents = scoFolder.getItems(new XMLFilter());
    for(VFSItem file:contents) {
      ScoDocument document = new ScoDocument(null);
      try {
        if(file instanceof LocalFileImpl) {
          document.loadDocument(((LocalFileImpl)file).getBasefile());
        }
        else {
          logger.warn("Cannot use this type of VSFItem to load a SCO Datamodel: " + file.getClass().getName(), null);
          continue;
        }
       
        String fileName = file.getName();
        String itemId = fileName.substring(0, fileName.length() - 4);
        String[][] scoModel = document.getScoModel();
        for(String[] line:scoModel) {
          datas.add(new CmiData(itemId, line[0], line[1]));
        }
      } catch (Exception e) {
        logger.error("Cannot load a SCO Datamodel", e);
View Full Code Here

    public void loadInModel() {
        // if this is a sco then we need to access the
        // cmi data model we created when importing the package
        if (isItemSco()) {
            if (_scoitemID != null) {
                ScoDocument anSco = new ScoDocument(settings);
                anSco.loadDocument(_scoitemID);
                _scoDataModel = anSco;
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.olat.modules.scorm.server.servermodels.ScoDocument

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.