java.lang.Object
com.semanticcms.core.model.PageRef
- All Implemented Interfaces:
PageReferrer
,Comparable<PageReferrer>
A page reference contains both a book and a path to a page or directory.
Any path to a directory must end with a slash (/).
TODO: Support parameters to a page, child, link, ... Parameters provided in path/page?, param.* attributes, and nested tags - matching/extending AO taglib.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Appends the combination of the book and the path that refers to the page resource within the web application.int
Orders by servletPath.int
boolean
getBook()
the book itself, only available when have access to the referenced book.The name of the book the page is part of.The prefix of the book the page is part of.A PageRef is its own referrer.getPath()
The book-relative path to the page, always starting with a slash (/).getResourceFile
(boolean requireBook, boolean requireFile) the underlying file, only available when have access to the referenced book.Gets the combination of the book and the path that refers to the page resource within the web application.int
hashCode()
Sets the path.toString()
-
Constructor Details
-
PageRef
-
PageRef
-
-
Method Details
-
getPageRef
A PageRef is its own referrer.- Specified by:
getPageRef
in interfacePageReferrer
-
getBookName
The name of the book the page is part of. This will always begin with a slash (/). -
getBookPrefix
The prefix of the book the page is part of. This will be""
for the root book"/"
. -
getPath
The book-relative path to the page, always starting with a slash (/). -
setPath
Sets the path.- Returns:
- this object if path unchanged or a new object representing the new path
-
getBook
the book itself, only available when have access to the referenced book. -
equals
-
hashCode
public int hashCode() -
compareTo
Orders by servletPath.- See Also:
-
compareTo
Description copied from interface:PageReferrer
- Specified by:
compareTo
in interfaceComparable<PageReferrer>
- Specified by:
compareTo
in interfacePageReferrer
- See Also:
-
getServletPath
Gets the combination of the book and the path that refers to the page resource within the web application.- See Also:
-
appendServletPath
Appends the combination of the book and the path that refers to the page resource within the web application.- Throws:
IOException
- See Also:
-
toString
-
getResourceFile
the underlying file, only available when have access to the referenced book.- Parameters:
requireBook
- when true, will always get a File object backrequireFile
- when true, any File object returned will exist on the filesystem- Returns:
- null if not access to book or File of resource path.
- Throws:
IOException
-