Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

edu.virtualschool.jwaa.GenericLookAndFeel Class Reference

Collaboration diagram for edu.virtualschool.jwaa.GenericLookAndFeel:

Collaboration graph
[legend]
List of all members.

Detailed Description

Define common formatting standard. References /css/innerPage.css for browsers and /css/print.css for printers.

NOT yet general-purposed: designed to be modifed directly, especially the static string constants which are explicit to specific to virtualschool.edu page layout conventions.

Definition at line 21 of file GenericLookAndFeel.java.

Public Member Functions

 GenericLookAndFeel (String keywords, String description, String author, String email, String version, String copyright, String documentRoot, String selected)
void sendPrefix (GenericPage page) throws Fault
void sendPrefix (GenericPage page, Object title) throws Fault
void sendPostfix (GenericPage page) throws Fault
String computeNavigationBar (GenericPage page)

Public Attributes

String keywords
String description
String author
String email
String version
String copyright
String documentRoot
String pageHeader1
String pageHeader2
String pageTrailer1
String pageTrailer2
final MetaPage firstNavBarRow
SimpleDateFormat date = new SimpleDateFormat("dd MMM yyyy", Locale.US)


Member Function Documentation

String edu.virtualschool.jwaa.GenericLookAndFeel.computeNavigationBar GenericPage  page  ) 
 

Compute a standard navigation bar from PageElement hierarchy.

Parameters:
page 

Definition at line 144 of file GenericLookAndFeel.java.

References edu.virtualschool.jwaa.MetaPage.allowsAccessBy(), edu.virtualschool.jwaa.TreeNode.childrenIterator(), edu.virtualschool.jwaa.MetaPage.defaultAnchor, edu.virtualschool.jwaa.GenericPage.emitLink(), edu.virtualschool.jwaa.GenericPage.getAccount(), edu.virtualschool.jwaa.TreeNode.getRootPath(), edu.virtualschool.jwaa.MetaPage.isSelected, and edu.virtualschool.jwaa.GenericPage.meta.

Referenced by edu.virtualschool.jwaa.GenericLookAndFeel.sendPrefix().

00145   {
00146     int row=1;
00147     AccountAbstraction person = page.getAccount();
00148     StringBuffer buf = new StringBuffer();
00149     ArrayList list = page.meta.getRootPath();
00150     list.add(firstNavBarRow);
00151     for (int i = list.size()-1; i >= 0; i--)
00152     {
00153       Object object = list.get(i);
00154       MetaPage parent = (MetaPage)object;
00155       StringBuffer cells = new StringBuffer();
00156       for (Iterator it = parent.childrenIterator(); it.hasNext(); )
00157       {
00158         MetaPage child = (MetaPage)it.next();
00159         if (child == null || child.defaultAnchor == null || child.defaultAnchor.equals(""))
00160           continue;
00161         else if (child.allowsAccessBy(person)) 
00162         {
00163           cells.append((child.isSelected || list.contains(child)) ?  "  <td class=\"highlight\">" : "  <td>");
00164           cells.append(page.emitLink(child));
00165           cells.append("</td>\n"); 
00166         }
00167       }
00168       if (!cells.toString().equals("")) 
00169         buf.append(
00170 "<table class=\"row"+row+"\" width=\"100%\">\n"+
00171 " <tr>\n"+cells+"\n </tr>\n"+
00172 "</table>\n");
00173       row++;
00174     }
00175     return buf.toString();
00176   }

void edu.virtualschool.jwaa.GenericLookAndFeel.sendPostfix GenericPage  page  )  throws Fault
 

Send the closing html of this page to the browser

Parameters:
page 
Exceptions:
Fault 

Definition at line 135 of file GenericLookAndFeel.java.

00136   {
00137     page.send("</div>");
00138     page.send(pageTrailer1+date.format(TimeUtil.now())+pageTrailer2);
00139   }

void edu.virtualschool.jwaa.GenericLookAndFeel.sendPrefix GenericPage  page,
Object  title
throws Fault
 

Send the opening html of this page to the browser with the specified title.

Parameters:
page The servlet context
title 
Exceptions:
Fault 

Definition at line 121 of file GenericLookAndFeel.java.

References edu.virtualschool.jwaa.GenericLookAndFeel.computeNavigationBar().

00122   {
00123     page.send(pageHeader1+title+pageHeader2);
00124     page.send("<div class=\"navbar\">");
00125     page.send(computeNavigationBar(page));
00126     page.send("</div>");
00127     page.send("<div class=\"title\">\n <h1 align=\"center\">"+title+"</h1>\n</div>\n");
00128     page.send("<div class=\"page\">");
00129   }

void edu.virtualschool.jwaa.GenericLookAndFeel.sendPrefix GenericPage  page  )  throws Fault
 

Send the opening html of this page to the browser with the page's default title text.

Parameters:
page 

Definition at line 110 of file GenericLookAndFeel.java.

00111   {
00112     sendPrefix(page, page.meta.defaultTitle);
00113   }


The documentation for this class was generated from the following file: