org.openpipeline.server.pages
Class LoginPage

java.lang.Object
  extended by org.openpipeline.server.pages.AdminPage
      extended by org.openpipeline.server.pages.LoginPage

public class LoginPage
extends AdminPage


Constructor Summary
LoginPage()
           
 
Method Summary
 boolean isAllowed(String pageName)
          Return true if the current user is allowed to see this page.
 boolean isLoggedIn()
           
 boolean login()
          Log in or log out of the server.
 String menu(String header, String items)
          Show a submenu, limiting the items to what the user is allowed to see
 void setPageContext(javax.servlet.jsp.PageContext pageContext)
           
 String showMenuHeader(String head, String[] pageNames)
          If the user is allowed to see any of the listed pages, return the header.
 String showMenuItem(String item, String pageName)
          If the user is allowed to see the page, return the item, else return "".
 
Methods inherited from class org.openpipeline.server.pages.AdminPage
addMessage, addMessages, checkbox, checkbox, convertParamsToXMLConfig, convertXMLConfigToParams, getBooleanParam, getMessages, getParam, getParam, getParamMap, getParams, handleError, passwordField, populateParams, processPage, radioButton, selectField, selectField, setParam, textArea, textField, textField, textField
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoginPage

public LoginPage()
Method Detail

setPageContext

public void setPageContext(javax.servlet.jsp.PageContext pageContext)

login

public boolean login()
              throws IOException
Log in or log out of the server. Looks for request parameters "logout" to log out and "opuser"/"oppassword" if attempting to log in.

Returns:
true if logged in
Throws:
IOException

isLoggedIn

public boolean isLoggedIn()
                   throws IOException
Throws:
IOException

showMenuItem

public String showMenuItem(String item,
                           String pageName)
                    throws IOException
If the user is allowed to see the page, return the item, else return "".

Parameters:
item - the menu item
pageName - the name of the page to test
Returns:
the item or ""
Throws:
IOException

showMenuHeader

public String showMenuHeader(String head,
                             String[] pageNames)
                      throws IOException
If the user is allowed to see any of the listed pages, return the header.

Parameters:
head - the menu header
pageNames - the name of the pages to test
Returns:
the header or ""
Throws:
IOException

menu

public String menu(String header,
                   String items)
            throws IOException
Show a submenu, limiting the items to what the user is allowed to see

Parameters:
header - submenu header
items - menu items, rows separated with tab and the item/page separated with |
Returns:
the menu for display
Throws:
IOException

isAllowed

public boolean isAllowed(String pageName)
                  throws IOException
Return true if the current user is allowed to see this page.

Parameters:
pageName - the page name, for example, "foo.jsp"
Returns:
true if access allowed
Throws:
IOException