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
-
getAccount(View)
- Get the currently logged in account.
-
getBaseDirectory()
- Get the base directory of the html server.
-
getContextName()
- Get the context name used by the servlet engine.
-
getLoginPage()
- Return this site's login page.
-
getRefusePage()
- Return this site's permission denied page.
-
getServletContext()
-
-
getServletName()
- Get the servlet name
-
htmlPage(View, String)
-
-
htmlPageClose(View)
-
-
htmlPageOpen(View)
-
-
setAccount(Account, View)
- Set the currently logged in account.
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
getBaseDirectory
public abstract String getBaseDirectory()
- Get the base directory of the html server.
- Returns:
- java.lang.String
getContextName
public abstract String getContextName()
- Get the context name used by the servlet engine.
- Returns:
- java.lang.String
getLoginPage
public abstract DynamicPage getLoginPage()
- Return this site's login page.
getRefusePage
public abstract DynamicPage getRefusePage()
- Return this site's permission denied page.
getServletContext
public abstract ServletContext getServletContext()
getServletName
public abstract String getServletName()
- Get the servlet name
- Returns:
- java.lang.String
htmlPage
public abstract String htmlPage(View view,
String contents) throws Exception
htmlPageClose
public abstract String htmlPageClose(View view)
htmlPageOpen
public abstract String htmlPageOpen(View view) throws Exception
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