org.mycore.frontend.servlets
Class MCRUserServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.mycore.frontend.servlets.MCRServlet
              extended by org.mycore.frontend.servlets.MCRUserServlet
All Implemented Interfaces:
Serializable, Servlet, ServletConfig

public class MCRUserServlet
extends MCRServlet

This servlet provides a web interface for the user management of the mycore system.

Version:
$Revision: 1.1 $ $Date: 2008/04/11 09:09:38 $
Author:
Detlev Degenhardt
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mycore.frontend.servlets.MCRServlet
BASE_URL_ATTRIBUTE, trustedProxies
 
Constructor Summary
MCRUserServlet()
           
 
Method Summary
protected  void changePwd(MCRServletJob job)
          This method handles the "ChangePwd" (change password) mode.
protected  Document createJdomDocBase(MCRServletJob job)
          creates a jdom document with elements needed by all modes this servlet can run.
protected  void createPwdDialog(MCRServletJob job)
          This method handles the "CreatePwdDialog" mode.
 void doGetPost(MCRServletJob job)
          This method overrides doGetPost of MCRServlet and handles HTTP requests.
protected  void doLayout(MCRServletJob job, String style, Document jdomDoc)
          Gather information about the XML document to be shown and the corresponding XSLT stylesheet and redirect the request to the LayoutServlet
 void init()
           
protected  void selectTask(MCRServletJob job)
          This method handles the "Select" mode.
protected  void showUser(MCRServletJob job)
          This method handles the "ShowUser" mode.
 
Methods inherited from class org.mycore.frontend.servlets.MCRServlet
buildRedirectURL, doGet, doGet, doPost, doPost, generateActiveLinkErrorpage, generateErrorPage, getBaseURL, getLastModified, getLayoutService, getProperty, getRemoteAddr, getServletBaseURL, getSession, handleException, initTrustedProxies, render, reportException, think
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MCRUserServlet

public MCRUserServlet()
Method Detail

init

public void init()
          throws ServletException
Overrides:
init in class MCRServlet
Throws:
ServletException

doGetPost

public void doGetPost(MCRServletJob job)
               throws IOException
This method overrides doGetPost of MCRServlet and handles HTTP requests. Depending on the request parameter "mode" this method delegates the request to different methods of this servlet.

Overrides:
doGetPost in class MCRServlet
Parameters:
job - The MCRServletJob instance
Throws:
IOException - for java I/O errors.
ServletException - for errors from the servlet engine.

changePwd

protected void changePwd(MCRServletJob job)
                  throws IOException
This method handles the "ChangePwd" (change password) mode. The change password dialog of the presentation layer must provide three passwords in the http request: The new password, an repetition of the new password and (for security reasons) the old password again. This method checks if the old password is correct and if both new passwords are equal. If so, the password is changed and the control flow is routed to the presentation of possible task for the current user. If not, error messages are displayed.

Parameters:
job - The MCRServletJob instance
Throws:
IOException - for java I/O errors.
ServletException - for errors from the servlet engine.

createPwdDialog

protected void createPwdDialog(MCRServletJob job)
                        throws IOException
This method handles the "CreatePwdDialog" mode. It is nothing more than choosing the right stylesheet.

Parameters:
job - The MCRServletJob instance
Throws:
IOException - for java I/O errors.
ServletException - for errors from the servlet engine.

selectTask

protected void selectTask(MCRServletJob job)
                   throws IOException
This method handles the "Select" mode. Depending on the privileges of the current user a list of possible tasks is collected as an XML representation and forwarded to the LayoutServlet.

Parameters:
job - The MCRServletJob instance
Throws:
IOException - for java I/O errors.
ServletException - for errors from the servlet engine.

showUser

protected void showUser(MCRServletJob job)
                 throws IOException
This method handles the "ShowUser" mode. The current user is retrieved from the user manager and its XML representation is forwarded to the LayoutServlet.

Parameters:
job - The MCRServletJob instance
Throws:
IOException - for java I/O errors.
ServletException - for errors from the servlet engine.

createJdomDocBase

protected Document createJdomDocBase(MCRServletJob job)
creates a jdom document with elements needed by all modes this servlet can run.

Parameters:
job - The MCRServletJob instance
Returns:
jdom document

doLayout

protected void doLayout(MCRServletJob job,
                        String style,
                        Document jdomDoc)
                 throws IOException
Gather information about the XML document to be shown and the corresponding XSLT stylesheet and redirect the request to the LayoutServlet

Parameters:
job - The MCRServletJob instance
style - String value to select the correct XSL stylesheet
jdomDoc - The XML representation to be presented by the LayoutServlet
Throws:
ServletException - for errors from the servlet engine.
IOException - for java I/O errors.