Class DocURLs

  • All Implemented Interfaces:
    SpecialURL

    public class DocURLs
    extends java.lang.Object
    implements SpecialURL
    Implements URL rewriting in course documents. doc:foo where foo contains no '/' or '.' characters and matches a document set name in a group DIR baseURL/DIR/foo/index.html doc:foo where foo contains one or more '/' or '.' characters and matches a file (presumably a secondary document or listing) in a group DIR, baseURL/DIR/foo.html docex:foo same as doc:foo, except during epub package generation when such links are ignored when choosing files to include in the e-book (useful for excluding "private" documents such as assignments)
    • Constructor Summary

      Constructors 
      Constructor Description
      DocURLs​(java.io.File sourceDirectory0, WebsiteProject project0)
      Create a URL rewriter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean applyTo​(org.w3c.dom.Element link, java.lang.String linkAttr)
      Checks to see if a linking element (a or img) uses a special protocol label and, if so, attempts to rewrite the element.
      • Methods inherited from class java.lang.Object

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

      • DocURLs

        public DocURLs​(java.io.File sourceDirectory0,
                       WebsiteProject project0)
        Create a URL rewriter.
        Parameters:
        sourceDirectory0 - directory containing the document source
        project0 - context info on document set locations
    • Method Detail

      • applyTo

        public final boolean applyTo​(org.w3c.dom.Element link,
                                     java.lang.String linkAttr)
        Checks to see if a linking element (a or img) uses a special protocol label and, if so, attempts to rewrite the element.
        Specified by:
        applyTo in interface SpecialURL
        Parameters:
        link - an element containing a URL
        linkAttr - name of the attribute containing the URL
        Returns:
        true if the element has been rewritten.