Package org.cast.cwm.xml

Examples of org.cast.cwm.xml.FileResource


    } else { // when the glossary is on
      Resource glossaryResource;
      if (davServer != null) {
        glossaryResource = new DavResource(davServer, getContentDir() + "/" + glossaryFileName);
      } else {
        glossaryResource = new FileResource(new File(getContentDir(), glossaryFileName));
      }
      final XmlDocument glossaryDoc = xmlService.loadXmlDocument("glossary", glossaryResource, new DtbookParser(), null);
     
      // Set up Glossary
      Databinder.ensureSession(new SessionUnit() {
        public Object run(Session sess) {
          glossary = GlossaryService.get().parseXmlGlossaryDocument(glossaryDoc);
          return null;
        }
      });
    }
       
    // Load student content files
    String fileList = appProperties.getProperty("isi.studentContentFiles", DEFAULT_STUDENT_CONTENT_FILE_NAMES).trim();
    studentContentFiles = fileList.split("\\s*,\\s*");   
    documentObservers.add(new XmlDocumentObserver(getSectionElement(), getPageElement())); // Use set so sub-classed applications can add to it as well
    for (String file : studentContentFiles) {
      Resource resource;
      if (davServer != null) {
        log.debug("attempting to load DavResource file = {}", getContentDir() + "/" + file);
        log.debug("loading the DavResource on the Server = {}", davServer);
        resource = new DavResource(davServer, getContentDir() + "/" + file);
      } else {
        log.debug("attempting to load Resource file = {}", getContentDir() + "/" + file);
        resource = new FileResource(new File(getContentDir(), file));
      }
      XmlDocument doc = xmlService.loadXmlDocument(file, resource, new DtbookParser(), documentObservers);
      studentContent.add(doc);
    }
   
    // Load email content files
    if (emailOn) {
      String emailFileName = EMAIL_FILE_NAME;         
      Resource emailResource;
      if (davServer != null) {
        emailResource = new DavResource(davServer, getContentDir() + "/" + emailFileName);
      } else {
        emailResource = new FileResource(new File(getContentDir(), emailFileName));
      }
      emailContent = xmlService.loadXmlDocument("email", emailResource, new DtbookParser(), null);         
    }
    log.debug("Finished loading ISI XML Files");
  }
View Full Code Here


    // Construct transformation pipeline for student content: glossary -> XSL -> unique wicket:ids
    TransformChain transformchain = new TransformChain(
        new XslTransformer(xmlService.findXslResource("strip-class.xsl")),
        new GlossaryTransformer(glossary),
        new FilterElements(),
        new XslTransformer(new FileResource(studentXslFile)),
        new EnsureUniqueWicketIds());
    xmlService.registerTransformer("student", transformchain)
   
    if (emailOn) {
      // For sending emails to users
View Full Code Here

TOP

Related Classes of org.cast.cwm.xml.FileResource

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.