Inheritance diagram for edu.virtualschool.jwaa.MetaPage:


Definition at line 18 of file MetaPage.java.
Public Member Functions | |
| MetaPage (Class pageClass, String url, String anchor, String title, MetaPage[] children) | |
| MetaPage (Class pageClass, String url, String anchor, String title) | |
| MetaPage (Class pageClass, String url, String anchor, String title, RoleAbstraction requiredRole) | |
| MetaPage (Class pageClass, String url, String anchor, String title, RoleAbstraction requiredRole, MetaPage[] children) | |
| boolean | isSelected () |
| void | setSelected (boolean yesno) |
| GenericURI | getLink () |
| final String | getAnchor () |
| final String | getTitle () |
| final RoleAbstraction | getRequiredRole () |
| final MetaPage | nextPage () |
| final MetaPage | prevPage () |
| boolean | allowsAccessBy (AccountAbstraction person) |
| String | emitLink (GenericPage ctlr, Object a, Object t, Object[] args) |
| String | emitForm (GenericPage ctlr, Object[] args) |
| final void | forward (GenericPage ctlr) throws IOFault, IgnorableFault, ServletFault |
Package Functions | |
| String | encodeRedirectURL (GenericPage ctlr, String uri) |
| String | encodeURL (GenericPage ctlr, String uri) |
| String | composeURIAndArgs (String uri, Object[] args) |
Package Attributes | |
| final Class | pageClass |
| final String | defaultAnchor |
| final String | defaultTitle |
| final GenericURI | link |
| boolean | isSelected = false |
| final RoleAbstraction | requiredRole |
|
||||||||||||||||||||||||
|
Constructor
Definition at line 38 of file MetaPage.java.
00040 {
00041 this(pageClass, url, anchor, title, null, children);
00042 }
|
|
|
Returns true if this page allows access by the provided person (which may be null or Role.NONE if no one is logged in), else false. Access is allowed if the page specifies no role requirement (requiredRole is null), otherwise disallowed unless someone is logged in (person it not null) and has the required role. Refused requests are logged (along with the person identifier) at WARN priority. Definition at line 148 of file MetaPage.java. References edu.virtualschool.jwaa.AccountAbstraction.hasRole(), and edu.virtualschool.jwaa.AccountAbstraction.isNull(). Referenced by edu.virtualschool.jwaa.GenericLookAndFeel.computeNavigationBar(), edu.virtualschool.jwaa.GenericServlet.doRequest(), and edu.virtualschool.jwaa.xml.Controller.run().
00149 {
00150 boolean allowed = false;
00151 if (requiredRole == null)
00152 allowed = true;
00153 else if (person == null)
00154 allowed = false;
00155 else if (person.isNull())
00156 allowed = false;
00157 else
00158 allowed = person.hasRole(requiredRole);
00159 if (!allowed)
00160 logger.warn(this + " denied access by person " + person);
00161 return allowed;
00162 }
|
|
||||||||||||
|
Return the string representation for this page
Definition at line 171 of file MetaPage.java. References edu.virtualschool.jwaa.GenericPage.httpResponse.
00172 {
00173 HttpServletResponse rsp = ctlr.httpResponse;
00174 String encodedURL = rsp.encodeRedirectURL(uri);
00175 return encodedURL;
00176 }
|
|
|
Return the anchor string for this page
Definition at line 89 of file MetaPage.java.
00090 {
00091 return defaultAnchor;
00092 }
|
|
|
Return the role needed to access this page
Definition at line 106 of file MetaPage.java.
00106 { return requiredRole; }
|
|
|
Return the title string for this page
Definition at line 97 of file MetaPage.java.
00098 {
00099 return defaultTitle;
00100 }
|
|
|
Returns the next page
Definition at line 112 of file MetaPage.java. References edu.virtualschool.jwaa.TreeNode.childrenIterator(), edu.virtualschool.jwaa.TreeNode.getParentNode(), and edu.virtualschool.jwaa.TreeNode.nextSiblingNode().
00113 {
00114 Iterator iterator = childrenIterator();
00115 if (iterator.hasNext())
00116 return (MetaPage)iterator.next();
00117
00118 MetaPage sibling = (MetaPage)nextSiblingNode();
00119 if (sibling != null)
00120 return sibling;
00121
00122 MetaPage parent = (MetaPage)getParentNode();
00123 if (parent != null)
00124 return (MetaPage)parent.nextSiblingNode();
00125 else
00126 return null;
00127 }
|
|
|
Return this page's left sibling
Definition at line 133 of file MetaPage.java. References edu.virtualschool.jwaa.TreeNode.getParentNode(), and edu.virtualschool.jwaa.TreeNode.prevSiblingNode().
00134 {
00135 MetaPage sibling = (MetaPage)prevSiblingNode();
00136 if (sibling != null) return sibling;
00137 return (MetaPage)getParentNode();
00138 }
|