Class URLRewriting


  • public class URLRewriting
    extends java.lang.Object
    Implements URL rewriting in course documents. URL rewriting is used to provide stable shorthands for various URLS that will resolve properly even if document sets are moved, and to provide special rewriting of fields such as dates that may need to be flagged for special processing.
    • Constructor Summary

      Constructors 
      Constructor Description
      URLRewriting​(java.io.File sourceDirectory, WebsiteProject project, java.lang.String bbURL)
      Create a URL rewriter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void rewrite​(org.w3c.dom.Document htmlDoc)
      Rewrite href attributes of "a" elements and src attributes of "img" and script elements that match the patterns listed above.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • URLRewriting

        public URLRewriting​(java.io.File sourceDirectory,
                            WebsiteProject project,
                            java.lang.String bbURL)
        Create a URL rewriter.
        Parameters:
        sourceDirectory - directory containing document source
        project - project context, used to determine relative URLs
        bbURL - URL of a Blackboard course
    • Method Detail

      • rewrite

        public final void rewrite​(org.w3c.dom.Document htmlDoc)
        Rewrite href attributes of "a" elements and src attributes of "img" and script elements that match the patterns listed above. Attributes not matching any such pattern are left unchanged.
        Parameters:
        htmlDoc - the DOM of an HTML document.