no.feide.moria.servlet
Class InformationServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by no.feide.moria.servlet.MoriaServlet
              extended by no.feide.moria.servlet.InformationServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class InformationServlet
extends MoriaServlet

This servlet is responsible for retrieving information about a user, and sending it to information.jsp for display.

Version:
$Revision: 1.33 $
Author:
Eva Indal
See Also:
Serialized Form

Field Summary
private  FileMonitor feideattribsMonitor
          Monitor for the attribute description file.
private  java.util.HashMap feideattribsStored
          A hash map containing all possible attributes for a user.
private  no.feide.moria.log.MessageLogger log
          Used for logging.
private static java.lang.String PRINCIPAL
          Principal name of the service.
private static java.lang.String[] REQUIRED_PARAMETERS
          List of parameters required by InformationServlet.
 
Constructor Summary
InformationServlet()
          Constructor.
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Implements the HttpServlet.doGet method.
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Implements the HttpServlet.doPost method.
private  java.lang.String getAllAttributes()
          Builds a list of all possible user attributes.
 java.util.HashMap getAttribs()
          Implements a simple xml parser that parses the attribute description file into a HashMap with AttribsData instances.
static java.lang.String[] getRequiredParameters()
           
private  java.util.Vector printTableToVector(java.util.Map userData, java.util.ResourceBundle bundle)
          Generates table for a user.
 
Methods inherited from class no.feide.moria.servlet.MoriaServlet
getServletConfig
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

feideattribsStored

private java.util.HashMap feideattribsStored
A hash map containing all possible attributes for a user. Each item in the hashmap maps from an attribute name to an AttribsData class instance


feideattribsMonitor

private FileMonitor feideattribsMonitor
Monitor for the attribute description file.


PRINCIPAL

private static final java.lang.String PRINCIPAL
Principal name of the service. Current value is "info"

See Also:
Constant Field Values

log

private final no.feide.moria.log.MessageLogger log
Used for logging.


REQUIRED_PARAMETERS

private static final java.lang.String[] REQUIRED_PARAMETERS
List of parameters required by InformationServlet.

Current required parameters are:

See Also:
RequestUtil.PROP_COOKIE_LANG, RequestUtil.PROP_COOKIE_LANG_TTL, RequestUtil.PROP_COOKIE_DENYSSO, RequestUtil.PROP_LOGIN_TICKET_PARAM, RequestUtil.PROP_INFORMATION_URL_PREFIX, RequestUtil.PROP_INFORMATION_DESCRIPTIONS, RequestUtil.PIC_LINK
Constructor Detail

InformationServlet

public InformationServlet()
Constructor.

Method Detail

getRequiredParameters

public static java.lang.String[] getRequiredParameters()
Returns:
the required parameters for this servlet.

getAttribs

public final java.util.HashMap getAttribs()
Implements a simple xml parser that parses the attribute description file into a HashMap with AttribsData instances.

See Also:
AttribsData

printTableToVector

private java.util.Vector printTableToVector(java.util.Map userData,
                                            java.util.ResourceBundle bundle)
Generates table for a user. The vector consists of rows of data. Each row has four columns. The first column is the URL link for the user attribute. The second column is the attribute description as presented to the user. The third column is the actual data stored for the attribute, and the fourth columns is either fd_mandatory or fd_optional, as a key for a mandatory or optional attribute.

Parameters:
userData - The user data.
bundle - Resource bundle for language.
Returns:
Vector with table data.

doGet

public final void doGet(javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response)
                 throws javax.servlet.ServletException,
                        java.io.IOException
Implements the HttpServlet.doGet method.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
request - The HTTP request.
response - The HTTP response.
Throws:
java.io.IOException - If getAttribs returns null.
javax.servlet.ServletException - If the Moria controller throws an exception.
See Also:
HttpServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

doPost

public final void doPost(javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpServletResponse response)
                  throws javax.servlet.ServletException,
                         java.io.IOException
Implements the HttpServlet.doPost method.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Parameters:
request - The HTTP request.
response - The HTTP response.
Throws:
java.io.IOException - Required by interface.
javax.servlet.ServletException - If the Moria controller throws an exception.
See Also:
HttpServlet.doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)

getAllAttributes

private java.lang.String getAllAttributes()
Builds a list of all possible user attributes.

Returns:
Comma separated list of attributes.


Copyright © 2001-2006 UNINETT FAS. All Rights Reserved.