Package edu.odu.cs.cowem.documents.urls
Class DocURLs
- java.lang.Object
-
- edu.odu.cs.cowem.documents.urls.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 booleanapplyTo(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.
-
-
-
Constructor Detail
-
DocURLs
public DocURLs(java.io.File sourceDirectory0, WebsiteProject project0)Create a URL rewriter.- Parameters:
sourceDirectory0- directory containing the document sourceproject0- 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:
applyToin interfaceSpecialURL- Parameters:
link- an element containing a URLlinkAttr- name of the attribute containing the URL- Returns:
- true if the element has been rewritten.
-
-