org.opencms.workplace
Class CmsLogin

java.lang.Object
  extended by org.opencms.jsp.CmsJspBean
      extended by org.opencms.jsp.CmsJspActionElement
          extended by org.opencms.jsp.CmsJspLoginBean
              extended by org.opencms.workplace.CmsLogin

public class CmsLogin
extends CmsJspLoginBean

Handles the login of Users to the OpenCms workplace.

Since:
6.0.0

Field Summary
static int ACTION_DISPLAY
          Action constant: Default action, display the dialog.
static int ACTION_LOGIN
          Action constant: Login successful.
static int ACTION_LOGOUT
          Action constant: Logout.
static String PARAM_ACTION_GETOULIST
          The parameter name for the "getoulist" action.
static String PARAM_ACTION_LOGIN
          The parameter name for the "login" action.
static String PARAM_ACTION_LOGOUT
          The parameter name for the "logout" action.
static String PARAM_FORM
          The html id for the login form.
static String PARAM_OUFQN
          The parameter name for the organizational unit.
static String PARAM_OUSEARCH
          The parameter name for the search organizational unit.
static String PARAM_PASSWORD
          The parameter name for the password.
static String PARAM_PCTYPE
          The parameter name for the PC type.
static String PARAM_PREDEF_OUFQN
          The parameter name for the organizational unit.
static String PARAM_USERNAME
          The parameter name for the user name.
static String PARAM_WPDATA
          The parameter name for the workplace data.
static String PCTYPE_PRIVATE
          PC type constant: private PC.
static String PCTYPE_PUBLIC
          PC type constant: public PC.
 
Fields inherited from class org.opencms.jsp.CmsJspActionElement
NOT_INITIALIZED
 
Constructor Summary
CmsLogin(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Public constructor for login page.
 
Method Summary
protected  void appendDefaultLoginScript(StringBuffer html, CmsMessageContainer message)
          Appends the JavaScript for the login screen to the given HTML buffer.
protected  void appendDirectEditOpenerScript(StringBuffer html)
          Appends the JavaScript that opens the Direct Edit window after a successful login to the given HTML buffer.
protected  void appendId(StringBuffer html, String id)
          Appends the HTML form name/id code for the given id to the given html.
protected  void appendWorkplaceOpenerScript(StringBuffer html, String requestedResource, CmsMessageContainer message)
          Appends the JavaScript that opens the Workplace window after a successful login to the given HTML buffer.
 String buildOrgUnitSelector()
          Returns the HTML code for selecting an organizational unit.
 String displayDialog()
          Returns the HTML for the login dialog in it's current state.
protected  String displayLoginForm()
          Returns the HTML for the login form.
protected  javax.servlet.http.Cookie getCookie(String name)
          Returns the cookie with the given name, if not cookie is found a new one is created.
 void getCookieData()
          Gets the login info from the cookies.
 String getFormLink()
          Returns the link to the form that contains the login element.
 String getJsonOrgUnitList()
          Returns the available organizational units as JSON array string.
protected  List<CmsOrganizationalUnit> getOus()
          Returns all organizational units in the system.
protected  String getPreDefOuFqn()
          Returns the predefined organizational unit fqn.
protected  void setCookie(javax.servlet.http.Cookie cookie)
          Sets the cookie in the response.
 void setCookieData()
          Sets the login cookies.
 
Methods inherited from class org.opencms.jsp.CmsJspLoginBean
getLoginException, getUser, getUserName, isLoggedIn, isLoginSuccess, login, login, login, logout
 
Methods inherited from class org.opencms.jsp.CmsJspActionElement
editable, editable, editable, editableManualClose, editableManualOpen, getContent, getContent, getMessages, getMessages, getMessages, getMessages, getNavigation, getNavigationUri, img, img, include, include, include, include, include, include, includeSilent, includeSilent, includeSilent, includeSilent, info, label, link, link, properties, properties, property, property, property, property, template, template, template, toAbsolute, user
 
Methods inherited from class org.opencms.jsp.CmsJspBean
getCmsObject, getController, getJspContext, getMessage, getRequest, getRequestContext, getResponse, handleException, init, isNotInitialized, isSupressingExceptions, setContentType, setStatus, setSupressingExceptions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_DISPLAY

public static final int ACTION_DISPLAY
Action constant: Default action, display the dialog.

See Also:
Constant Field Values

ACTION_LOGIN

public static final int ACTION_LOGIN
Action constant: Login successful.

See Also:
Constant Field Values

ACTION_LOGOUT

public static final int ACTION_LOGOUT
Action constant: Logout.

See Also:
Constant Field Values

PARAM_ACTION_GETOULIST

public static final String PARAM_ACTION_GETOULIST
The parameter name for the "getoulist" action.

See Also:
Constant Field Values

PARAM_ACTION_LOGIN

public static final String PARAM_ACTION_LOGIN
The parameter name for the "login" action.

See Also:
Constant Field Values

PARAM_ACTION_LOGOUT

public static final String PARAM_ACTION_LOGOUT
The parameter name for the "logout" action.

See Also:
Constant Field Values

PARAM_FORM

public static final String PARAM_FORM
The html id for the login form.

See Also:
Constant Field Values

PARAM_OUFQN

public static final String PARAM_OUFQN
The parameter name for the organizational unit.

See Also:
Constant Field Values

PARAM_OUSEARCH

public static final String PARAM_OUSEARCH
The parameter name for the search organizational unit.

See Also:
Constant Field Values

PARAM_PASSWORD

public static final String PARAM_PASSWORD
The parameter name for the password.

See Also:
Constant Field Values

PARAM_PCTYPE

public static final String PARAM_PCTYPE
The parameter name for the PC type.

See Also:
Constant Field Values

PARAM_PREDEF_OUFQN

public static final String PARAM_PREDEF_OUFQN
The parameter name for the organizational unit.

See Also:
Constant Field Values

PARAM_USERNAME

public static final String PARAM_USERNAME
The parameter name for the user name.

See Also:
Constant Field Values

PARAM_WPDATA

public static final String PARAM_WPDATA
The parameter name for the workplace data.

See Also:
Constant Field Values

PCTYPE_PRIVATE

public static final String PCTYPE_PRIVATE
PC type constant: private PC.

See Also:
Constant Field Values

PCTYPE_PUBLIC

public static final String PCTYPE_PUBLIC
PC type constant: public PC.

See Also:
Constant Field Values
Constructor Detail

CmsLogin

public CmsLogin(javax.servlet.jsp.PageContext context,
                javax.servlet.http.HttpServletRequest req,
                javax.servlet.http.HttpServletResponse res)
Public constructor for login page.

Parameters:
context - the JSP page context object
req - the JSP request
res - the JSP response
Method Detail

buildOrgUnitSelector

public String buildOrgUnitSelector()
Returns the HTML code for selecting an organizational unit.

Returns:
the HTML code for selecting an organizational unit

displayDialog

public String displayDialog()
                     throws IOException
Returns the HTML for the login dialog in it's current state.

Returns:
the HTML for the login dialog
Throws:
IOException - in case a redirect fails

getCookieData

public void getCookieData()
Gets the login info from the cookies.


getFormLink

public String getFormLink()
Description copied from class: CmsJspLoginBean
Returns the link to the form that contains the login element.

Overrides:
getFormLink in class CmsJspLoginBean
Returns:
the link to the form that contains the login element
See Also:
CmsJspLoginBean.getFormLink()

getJsonOrgUnitList

public String getJsonOrgUnitList()
Returns the available organizational units as JSON array string.

Returns:
the available organizational units as JSON array string

setCookieData

public void setCookieData()
Sets the login cookies.


appendDefaultLoginScript

protected void appendDefaultLoginScript(StringBuffer html,
                                        CmsMessageContainer message)
Appends the JavaScript for the login screen to the given HTML buffer.

Parameters:
html - the HTML buffer to append the script to
message - the message to display after an unsuccessful login

appendDirectEditOpenerScript

protected void appendDirectEditOpenerScript(StringBuffer html)
Appends the JavaScript that opens the Direct Edit window after a successful login to the given HTML buffer.

Parameters:
html - the html buffer to append the script to

appendId

protected void appendId(StringBuffer html,
                        String id)
Appends the HTML form name/id code for the given id to the given html.

Parameters:
html - the html where to append the id to
id - the id to append

appendWorkplaceOpenerScript

protected void appendWorkplaceOpenerScript(StringBuffer html,
                                           String requestedResource,
                                           CmsMessageContainer message)
Appends the JavaScript that opens the Workplace window after a successful login to the given HTML buffer.

Parameters:
html - the html buffer to append the script to
requestedResource - the requested resource to open in a new window
message - the message to display if the originally requested resource is not available

displayLoginForm

protected String displayLoginForm()
Returns the HTML for the login form.

Returns:
the HTML for the login form

getCookie

protected javax.servlet.http.Cookie getCookie(String name)
Returns the cookie with the given name, if not cookie is found a new one is created.

Parameters:
name - the name of the cookie
Returns:
the cookie

getOus

protected List<CmsOrganizationalUnit> getOus()
Returns all organizational units in the system.

Returns:
a list of CmsOrganizationalUnit objects

getPreDefOuFqn

protected String getPreDefOuFqn()
Returns the predefined organizational unit fqn.

This is normally selected by url, and set by the CmsWorkplaceLoginHandler.

Returns:
the predefined organizational unit fqn

setCookie

protected void setCookie(javax.servlet.http.Cookie cookie)
Sets the cookie in the response.

Parameters:
cookie - the cookie to set