All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.sdi.wap.Site

public interface Site
This abstract Site class should be subclasses to define site-specific information. Typically, these subclasses should publish public final static variables that the rest of the application can use to access Page instances for every web page in the system. Here is a brief example from com.sdi.site.SDISite
public final static String baseDirectory = "/sdi";
public final static String contextName = "/sdi";
public final static String servletName = "/dialog";
public final static NumberFormat moneyFmt = 
NumberFormat.getCurrencyInstance();
public final static SimpleDateFormat dateFmt = 
new SimpleDateFormat("MMM dd, yyyy hh:mm:ss a");
public final static SimpleDateFormat monthFmt = 
new SimpleDateFormat("MMM");
public final static SimpleDateFormat startFmt = 
new SimpleDateFormat("MMM dd");
public final static SimpleDateFormat endFmt = 
new SimpleDateFormat("MMM dd, yyyy");
public static final Page Home = new StaticPage(
"Home",
null,
Role.Null,
"/html/index.htm",
"SDI home page"
);
... and so forth for all static html pages
public final static DynamicPage MyAccount = new DynamicPage(
"Account",
AccountView.class,
"MyAccount",
Role.Customer,
"Your superdistribution account"
);
 
and so forth for all dynamic servlet-based pages.

Author:
Brad Cox: bcox@virtualschool.edu
See Also:
SDISite

Method Index

 o getAccount(View)
Get the currently logged in account.
 o getBaseDirectory()
Get the base directory of the html server.
 o getContextName()
Get the context name used by the servlet engine.
 o getLoginPage()
Return this site's login page.
 o getRefusePage()
Return this site's permission denied page.
 o getServletContext()
 o getServletName()
Get the servlet name
 o htmlPage(View, String)
 o htmlPageClose(View)
 o htmlPageOpen(View)
 o setAccount(Account, View)
Set the currently logged in account.

Methods

 o getAccount
 public abstract Account getAccount(View view) throws Exception
Get the currently logged in account. Subclasses can override this as necessary, but a typical implementation is to store the account in the view's session from which this method can retrieve it.

Returns:
java.lang.String
 o getBaseDirectory
 public abstract String getBaseDirectory()
Get the base directory of the html server.

Returns:
java.lang.String
 o getContextName
 public abstract String getContextName()
Get the context name used by the servlet engine.

Returns:
java.lang.String
 o getLoginPage
 public abstract DynamicPage getLoginPage()
Return this site's login page.

 o getRefusePage
 public abstract DynamicPage getRefusePage()
Return this site's permission denied page.

 o getServletContext
 public abstract ServletContext getServletContext()
 o getServletName
 public abstract String getServletName()
Get the servlet name

Returns:
java.lang.String
 o htmlPage
 public abstract String htmlPage(View view,
                                 String contents) throws Exception
 o htmlPageClose
 public abstract String htmlPageClose(View view)
 o htmlPageOpen
 public abstract String htmlPageOpen(View view) throws Exception
 o setAccount
 public abstract void setAccount(Account account,
                                 View view)
Set the currently logged in account. Subclasses can override this as necessary, but a typical implementation is to store the account in a session variable

Returns:
java.lang.String

All Packages  Class Hierarchy  This Package  Previous  Next  Index