Package org.cast.cwm.xml

Examples of org.cast.cwm.xml.XmlDocument


  /**
   * Convenience methods to create a link to a page
   */
 
  public BookmarkablePageLink<ISIStandardPage> linkTo (String wicketId, String file, String id) {
    XmlDocument document = xmlService.getDocument(file);
    return linkToPage (wicketId, document==null ? null : document.getById(id));
  }
View Full Code Here


   * @param mStudentUser the default student User if this is a new teacher
   */ 
  public void sendXmlEmail (IModel<User> mUser, String messageId, String uri, String studentPassword) {
    String recipient = mUser.getObject().getEmail();

    XmlDocument emailXml = ISIApplication.get().getEmailContent();
    TransformParameters params = new TransformParameters();
    params.put("subDelimiter", subDelimiter);

    XmlSectionModel sectionModel = new XmlSectionModel(emailXml.getById(messageId));
    Element emailContent = xmlService.getTransformed(sectionModel, ISIApplication.get().getEMAIL_TRANSFORMER(), params)
          .getElement();
   
    // Message substitution variables
    String fullUrl = "";
View Full Code Here

      if (hashLocation > 0) {
        file = href.substring(0, hashLocation);
      } else { // "#ID" or "ID" case:
        file = getModel().getObject().getXmlDocument().getName(); // same file as we're currently viewing
      }
      XmlDocument document = xmlService.getDocument(file);
      String xmlId = href.substring(hashLocation+1);
      XmlSection section = document.getById(xmlId);
      XmlSectionModel mSection = new XmlSectionModel(section);
      return new AuthoredPopupLink(wicketId, xmlId, mSection);
     
    } else if (wicketId.startsWith("noteBackLink_")) {
      // Link back from a note to its (first) noteref.
View Full Code Here

   * @param loc
   * @return
   */
  public ISIXmlSection getSection() {
    if (section == null) {
      XmlDocument document = xmlService.getDocument(fileName);
      if (fileName == null || document == null) {
        log.error("Locator refers to nonexistent content file: " + this);
        return null;
      }
      section = (ISIXmlSection) document.getById(id);
      if (section == null)
        log.error("Locator refers to nonexistent ID: " + this);
    }
    return section;
  }
View Full Code Here

      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) {
View Full Code Here

TOP

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

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.