pt.moredata.dataentry
Class JspDataEntryController

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bypt.moredata.dataentry.JspDataEntryController
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class JspDataEntryController
extends javax.servlet.http.HttpServlet

Controlador de uma entrada de dados em jsp. Company MoreData

Version:
$Revision: 1.59 $
Author:
pcarmo
See Also:
Serialized Form

Field Summary
static java.lang.String ACTION_COMMAND_KEY
          Nome do parametro enviado no request que contem o comando a executar na entrada de dados.
static java.lang.String DAOMANAGER_KEY
          Nome do atributo com o qual esta guardado o DAOManager na sessao.
static java.lang.String DATAENTRY_NAME_KEY
          Nome do parametro enviado no request que contem o nome do DataEntry.
static java.lang.String DATAENTRYLOG_KEY
          Nome do atributo com o qual esta guardado o HashMap com o dataEntryLog para cada dataEntry da página
static java.lang.String DATAENTRYPAGELOG_KEY
          Nome do atributo com o qual esta guardado o HashMap com o dataEntryLog para a página
static java.lang.String ERROR_URL_KEY
          Nome do parametro que deve ser passado a esta Servlet com o nome da pagina para onde deve ser direcionado o controlo depois de processado um pedido e caso seja gerado um erro.
static java.lang.String INPUT_TAG_PREFIX
          Prefixo a acrescentar ao atributo name das tags em HTML que contenham valores de celulas do DataEntry.
static java.lang.String JUMP_TO_RECORD_VALUE_KEY
          Nome do parametro enviado no request que contem o numero do registo que deve passar a ser visualizado na entrada de dados.
static java.lang.String NEW_WINDOW_KEY
          Nome do parametro que deve ser passado a esta Servlet com a indicação se o erro deve ser mostrado numa nova janela ou não.
static java.lang.String TABLE_NAME_KEY
          Nome do parametro enviado no request que contem o nome da tabela da entrada de dados.
static java.lang.String TABLE_SERIAL_KEY
          Nome do parametro enviado no request que contem o serialKey da tabela da entrada de dados.
static java.lang.String TARGET_URL_KEY
          Nome do parametro que deve ser passado a esta Servlet com o nome da pagina para onde deve ser direcionado o controlo depois de processado um pedido.
 
Constructor Summary
JspDataEntryController()
           
 
Method Summary
 void destroy()
          Destroys the servlet.
protected  void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handles the HTTP GET method.
protected  void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handles the HTTP POST method.
protected  void forwardRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String forwardTo)
          Redireciona o pedido para uma dada pagina.
static DAOManager getDAOManager(javax.servlet.http.HttpSession session)
          Devolve o gestor de DAOs que esta associada a sessao.
static DataEntryLog getDataEntryLog(javax.servlet.http.HttpSession session, DataEntry dataEntry)
          Read information about the last command executed for a dataentry.
static java.lang.String getHtmlComponentName(java.lang.String componentName)
          Normalize a component name so it can be used in a javascript identifier name.
static LogEntry getLogEntry(javax.servlet.ServletRequest request)
          Read information about the last command executed for a dataentry by the JspDataEntryController.
 java.lang.String getServletInfo()
          Returns a short description of the servlet.
protected  void processCommand()
          Processa um comando sobre a entrada de dados
protected  void processRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Processes requests for both HTTP GET and POST methods.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, 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

INPUT_TAG_PREFIX

public static final java.lang.String INPUT_TAG_PREFIX
Prefixo a acrescentar ao atributo name das tags em HTML que contenham valores de celulas do DataEntry.

See Also:
Constant Field Values

DATAENTRY_NAME_KEY

public static final java.lang.String DATAENTRY_NAME_KEY
Nome do parametro enviado no request que contem o nome do DataEntry.

See Also:
Constant Field Values

TABLE_NAME_KEY

public static final java.lang.String TABLE_NAME_KEY
Nome do parametro enviado no request que contem o nome da tabela da entrada de dados.

See Also:
Constant Field Values

TABLE_SERIAL_KEY

public static final java.lang.String TABLE_SERIAL_KEY
Nome do parametro enviado no request que contem o serialKey da tabela da entrada de dados.

See Also:
Constant Field Values

ACTION_COMMAND_KEY

public static final java.lang.String ACTION_COMMAND_KEY
Nome do parametro enviado no request que contem o comando a executar na entrada de dados.

See Also:
Constant Field Values

JUMP_TO_RECORD_VALUE_KEY

public static final java.lang.String JUMP_TO_RECORD_VALUE_KEY
Nome do parametro enviado no request que contem o numero do registo que deve passar a ser visualizado na entrada de dados.

See Also:
Constant Field Values

TARGET_URL_KEY

public static final java.lang.String TARGET_URL_KEY
Nome do parametro que deve ser passado a esta Servlet com o nome da pagina para onde deve ser direcionado o controlo depois de processado um pedido.

See Also:
Constant Field Values

ERROR_URL_KEY

public static final java.lang.String ERROR_URL_KEY
Nome do parametro que deve ser passado a esta Servlet com o nome da pagina para onde deve ser direcionado o controlo depois de processado um pedido e caso seja gerado um erro.

See Also:
Constant Field Values

NEW_WINDOW_KEY

public static final java.lang.String NEW_WINDOW_KEY
Nome do parametro que deve ser passado a esta Servlet com a indicação se o erro deve ser mostrado numa nova janela ou não.

See Also:
Constant Field Values

DAOMANAGER_KEY

public static final java.lang.String DAOMANAGER_KEY
Nome do atributo com o qual esta guardado o DAOManager na sessao.

See Also:
Constant Field Values

DATAENTRYLOG_KEY

public static final java.lang.String DATAENTRYLOG_KEY
Nome do atributo com o qual esta guardado o HashMap com o dataEntryLog para cada dataEntry da página

See Also:
Constant Field Values

DATAENTRYPAGELOG_KEY

public static final java.lang.String DATAENTRYPAGELOG_KEY
Nome do atributo com o qual esta guardado o HashMap com o dataEntryLog para a página

See Also:
Constant Field Values
Constructor Detail

JspDataEntryController

public JspDataEntryController()
Method Detail

forwardRequest

protected void forwardRequest(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response,
                              java.lang.String forwardTo)
                       throws java.io.IOException,
                              javax.servlet.ServletException
Redireciona o pedido para uma dada pagina.

Parameters:
request - Pedido feito pelo cliente.
response - Resposta a dar ao cliente.
forwardTo - Url da pagina para onde redirecionar o pedido.
Throws:
java.io.IOException - Description of the Exception
javax.servlet.ServletException - Description of the Exception

processCommand

protected void processCommand()
Processa um comando sobre a entrada de dados


processRequest

protected void processRequest(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
                       throws javax.servlet.ServletException,
                              java.io.IOException
Processes requests for both HTTP GET and POST methods.

Parameters:
request - servlet request
response - servlet response
Throws:
javax.servlet.ServletException - Description of the Exception
java.io.IOException - Description of the Exception

doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws javax.servlet.ServletException,
                     java.io.IOException
Handles the HTTP GET method.

Parameters:
request - servlet request
response - servlet response
Throws:
javax.servlet.ServletException - Description of the Exception
java.io.IOException - Description of the Exception

doPost

protected void doPost(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws javax.servlet.ServletException,
                      java.io.IOException
Handles the HTTP POST method.

Parameters:
request - servlet request
response - servlet response
Throws:
javax.servlet.ServletException - Description of the Exception
java.io.IOException - Description of the Exception

getDAOManager

public static DAOManager getDAOManager(javax.servlet.http.HttpSession session)
Devolve o gestor de DAOs que esta associada a sessao. Se nao existir e criada um DAOManager e guardado na sessao.


destroy

public void destroy()
Destroys the servlet.


getServletInfo

public java.lang.String getServletInfo()
Returns a short description of the servlet.

Returns:
The servletInfo value

getDataEntryLog

public static DataEntryLog getDataEntryLog(javax.servlet.http.HttpSession session,
                                           DataEntry dataEntry)
Read information about the last command executed for a dataentry.

Parameters:
session - The session object.
dataEntry - The DataEntry.
Returns:
A DataEntryLog with information about the last command executed for the DataEntry specified.

getLogEntry

public static LogEntry getLogEntry(javax.servlet.ServletRequest request)
Read information about the last command executed for a dataentry by the JspDataEntryController. This method do not return LogEntry for commands executed by the ExecuteActionTag.

Parameters:
request - The ServletRequest object.
Returns:
A DataEntryLog with information about the last command executed for the DataEntry specified.

getHtmlComponentName

public static java.lang.String getHtmlComponentName(java.lang.String componentName)
Normalize a component name so it can be used in a javascript identifier name.

Parameters:
componentName - The component name
Returns:
A normalized component name.