pt.despodata.java.webappl
Class GenericController

java.lang.Object
  extended bypt.despodata.java.mvc.Controller
      extended bypt.despodata.java.webappl.GenericController
All Implemented Interfaces:
IController, java.util.Observer

public abstract class GenericController
extends Controller

GenericController.java Controlador generico para uma aplicacao web. Este controlador implementa a logica de controle da aplicacao, para isso, extende a classe pt.despodata.java.mvc.Controller e usa a classe StateMachine. Created: Thu Sep 28 19:54:28 2000

Version:
$Revision: 1.3 $
Author:
Paulo Carmo

Field Summary
static java.lang.String AUTENTICACAO
          Prefixo do nome de um campo do tipo CHECKBOX na lista de registos.
static java.lang.String CHECKBOX_PREFIX
          Prefixo do nome de um campo do tipo CHECKBOX na lista de registos.
static java.lang.String CHECKBOX_SIGNATURE
          Prefixo do nome de um campo do tipo CHECKBOX na lista de registos.
static java.lang.String FICHA
          Ficha de um registo.
static java.lang.String LISTA
          Lista de registos.
static java.lang.String LSTROWNUMBER
           
static int MULTIPART_REQUEST_MAX_FILE_LENGTH
          Dimensao maxima de um ficheiro passado via http.
 
Fields inherited from class pt.despodata.java.mvc.Controller
myModel, myView
 
Constructor Summary
GenericController()
          Constroi um controlador.
GenericController(GenericModel model, GenericView view)
          Constroi um controlador.
 
Method Summary
 void dump()
           
 java.lang.String dumpMachine()
           
 Action getAction(java.lang.String command)
           
 java.lang.String getCommand()
          Devolve o ultimo comando recebido pelo controlador.
 WebPage getCurrentPage()
          Get the value of currentPage.
 java.lang.String getCurrentUrl()
          Devolve o nome da pagina actual.
 FrameSet getFrameSet()
          Devolve o FrameSet currente.
 IModel getMyModel()
          Get the value of myModel.
 IView getMyView()
          Get the value of myView.
 javax.servlet.http.HttpSession getSession()
          Get the value of session.
static java.lang.String getSufix(java.lang.String string, java.lang.String separator)
          Devolve o sufixo de uma string, dado uma string que serve de separador entre o prefixo e o sufixo da string.
 java.lang.String getWhereClause()
          Get the value of whereClause.
 void handleEvent()
          Este metodo serve para tratar as mudancas ocorridas no modelo de dados.
protected abstract  StateMachine initMachine()
          Cria e inicializa a maquina de estados.
protected  boolean isAuthOK()
          Verifica se a a autenticacao foi efectuada com sucesso.
 void processRequest(javax.servlet.http.HttpServletRequest simpleRequest)
          Processa um evento ocorrido na aplicacao.
 void setInput(java.lang.Object input)
           
protected  void setMyModel(IModel v)
          Set the value of myModel.
protected  void setMyView(IView v)
          Set the value of myView.
 void setSession(javax.servlet.http.HttpSession session)
          Updates the session object of the controller.
 
Methods inherited from class pt.despodata.java.mvc.Controller
initialize, setMyModel, setMyView, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LSTROWNUMBER

public static final java.lang.String LSTROWNUMBER

CHECKBOX_SIGNATURE

public static final java.lang.String CHECKBOX_SIGNATURE
Prefixo do nome de um campo do tipo CHECKBOX na lista de registos.

See Also:
Constant Field Values

CHECKBOX_PREFIX

public static final java.lang.String CHECKBOX_PREFIX
Prefixo do nome de um campo do tipo CHECKBOX na lista de registos.


AUTENTICACAO

public static final java.lang.String AUTENTICACAO
Prefixo do nome de um campo do tipo CHECKBOX na lista de registos.

See Also:
Constant Field Values

FICHA

public static final java.lang.String FICHA
Ficha de um registo.

See Also:
Constant Field Values

LISTA

public static final java.lang.String LISTA
Lista de registos.

See Also:
Constant Field Values

MULTIPART_REQUEST_MAX_FILE_LENGTH

public static final int MULTIPART_REQUEST_MAX_FILE_LENGTH
Dimensao maxima de um ficheiro passado via http.

See Also:
Constant Field Values
Constructor Detail

GenericController

public GenericController()
Constroi um controlador.


GenericController

public GenericController(GenericModel model,
                         GenericView view)
Constroi um controlador.

Parameters:
model - O modelo de dados.
view - A vista sobre o modelo de dados.
Method Detail

isAuthOK

protected boolean isAuthOK()
Verifica se a a autenticacao foi efectuada com sucesso.


getSufix

public static java.lang.String getSufix(java.lang.String string,
                                        java.lang.String separator)
Devolve o sufixo de uma string, dado uma string que serve de separador entre o prefixo e o sufixo da string.

Parameters:
string - A string para da qual se pretende obter o sufixo.
separator - Uma string que serve de separador entre o prefixo e o sufixo da string
Returns:
O sufixo de uma string, dado uma string que serve de separador entre o prefixo e o sufixo da string. Se a string for null e devolvido null. Se o separador nao ocorrer na string e devolvido null.

initMachine

protected abstract StateMachine initMachine()
Cria e inicializa a maquina de estados.


setMyModel

protected void setMyModel(IModel v)
Set the value of myModel.

Parameters:
v - Value to assign to myModel.

setMyView

protected void setMyView(IView v)
Set the value of myView.

Parameters:
v - Value to assign to myView.

getCommand

public java.lang.String getCommand()
Devolve o ultimo comando recebido pelo controlador.


getCurrentPage

public WebPage getCurrentPage()
Get the value of currentPage.

Returns:
Value of currentPage.

getCurrentUrl

public java.lang.String getCurrentUrl()
Devolve o nome da pagina actual.

Returns:
O nome de um ficheiro com uma pagina html ou jsp.

getFrameSet

public FrameSet getFrameSet()
Devolve o FrameSet currente.


getMyModel

public IModel getMyModel()
Get the value of myModel.

Overrides:
getMyModel in class Controller
Returns:
Value of myModel.

getMyView

public IView getMyView()
Get the value of myView.

Overrides:
getMyView in class Controller
Returns:
Value of myView.

getSession

public javax.servlet.http.HttpSession getSession()
Get the value of session.

Returns:
Value of session

getWhereClause

public java.lang.String getWhereClause()
Get the value of whereClause.

Returns:
value of whereClause.

handleEvent

public void handleEvent()
Este metodo serve para tratar as mudancas ocorridas no modelo de dados.

Specified by:
handleEvent in interface IController
Specified by:
handleEvent in class Controller

setSession

public void setSession(javax.servlet.http.HttpSession session)
Updates the session object of the controller.

Parameters:
session - Sessao que identifica o utilizador.

processRequest

public void processRequest(javax.servlet.http.HttpServletRequest simpleRequest)
Processa um evento ocorrido na aplicacao.


getAction

public Action getAction(java.lang.String command)

dump

public void dump()

dumpMachine

public java.lang.String dumpMachine()

setInput

public void setInput(java.lang.Object input)