com.ferri.portlet.client.action
Class ViewClientAction

java.lang.Object
  extended by com.ferri.portlet.client.action.ViewClientAction
All Implemented Interfaces:
org.springframework.web.portlet.mvc.Controller

public class ViewClientAction
extends Object
implements org.springframework.web.portlet.mvc.Controller

Controlador de les pantalles de llistat.jsp i manteniment.jsp de la entitat Client

Author:
dferri

Field Summary
private  ClientService clientService
           
private  GestoriaService gestoriaService
           
private static org.apache.commons.logging.Log log
           
private static String PAGE_LIST
           
private static String PAGE_MANT
           
 
Constructor Summary
ViewClientAction()
           
 
Method Summary
private  void buscar(javax.portlet.PortletRequest request)
          Cerca un llistat d'entitats Client que compleixin els criteris i ordenació passats per formulari request.
private  void defecte(javax.portlet.PortletRequest request)
          Carrega el llistat amb tots els elements Client i l'afegeix a la request.
private  void editar(javax.portlet.PortletRequest request)
          Carrega una entitat Client en request a partir del nif pasat també per request.
private  boolean elimina(javax.portlet.PortletRequest request)
          Elimina una entitat Client amb la pk pasada en la request.
 ClientService getClientService()
           
 GestoriaService getGestoriaService()
           
private  Boolean guardar(javax.portlet.PortletRequest request)
          Guarda una entitat Client, previa validació, amb tots els camps del forumlari pasats per request: pot crear-lo de nou si no existeix o actualitzar-lo si esxisteix.
 void handleActionRequest(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response)
           
 org.springframework.web.portlet.ModelAndView handleRenderRequest(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)
           
 void setClientService(ClientService clientService)
           
 void setGestoriaService(GestoriaService gestoriaService)
           
private  void subElements(javax.portlet.PortletRequest request)
          Carrega els llistats d'elements secundaris: TipusClient, Gestories i Administradors per cada gestoria i els afegeix a la request.
private  boolean validaCamps(ClientDTO dto, javax.portlet.PortletRequest request)
          Valida els camps del formulari de l'entitat Client abans de guardar-los.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

clientService

private ClientService clientService

gestoriaService

private GestoriaService gestoriaService

PAGE_MANT

private static final String PAGE_MANT
See Also:
Constant Field Values

PAGE_LIST

private static final String PAGE_LIST
See Also:
Constant Field Values
Constructor Detail

ViewClientAction

public ViewClientAction()
Method Detail

handleActionRequest

public void handleActionRequest(javax.portlet.ActionRequest request,
                                javax.portlet.ActionResponse response)
                         throws Exception
Specified by:
handleActionRequest in interface org.springframework.web.portlet.mvc.Controller
Throws:
Exception

handleRenderRequest

public org.springframework.web.portlet.ModelAndView handleRenderRequest(javax.portlet.RenderRequest request,
                                                                        javax.portlet.RenderResponse response)
                                                                 throws Exception
Specified by:
handleRenderRequest in interface org.springframework.web.portlet.mvc.Controller
Throws:
Exception

defecte

private void defecte(javax.portlet.PortletRequest request)
              throws CommonServiceException
Carrega el llistat amb tots els elements Client i l'afegeix a la request.

Parameters:
request -
Throws:
CommonServiceException

subElements

private void subElements(javax.portlet.PortletRequest request)
                  throws CommonServiceException
Carrega els llistats d'elements secundaris: TipusClient, Gestories i Administradors per cada gestoria i els afegeix a la request.

Parameters:
request -
Throws:
CommonServiceException

elimina

private boolean elimina(javax.portlet.PortletRequest request)
                 throws Exception
Elimina una entitat Client amb la pk pasada en la request.

Parameters:
request -
Returns:
boolean resultat
Throws:
Exception

guardar

private Boolean guardar(javax.portlet.PortletRequest request)
                 throws Exception
Guarda una entitat Client, previa validació, amb tots els camps del forumlari pasats per request: pot crear-lo de nou si no existeix o actualitzar-lo si esxisteix.

Parameters:
request -
Returns:
boolean resultat
Throws:
Exception

editar

private void editar(javax.portlet.PortletRequest request)
             throws Exception
Carrega una entitat Client en request a partir del nif pasat també per request.

Parameters:
request -
Throws:
Exception

buscar

private void buscar(javax.portlet.PortletRequest request)
             throws Exception
Cerca un llistat d'entitats Client que compleixin els criteris i ordenació passats per formulari request. El llistat resultant es passat per request.

Parameters:
request -
Throws:
Exception

validaCamps

private boolean validaCamps(ClientDTO dto,
                            javax.portlet.PortletRequest request)
Valida els camps del formulari de l'entitat Client abans de guardar-los. Si troba errors son afegits per request.

Parameters:
dto - ClientDTO
request -
Returns:
boolean resultat

getClientService

public ClientService getClientService()
Returns:
the clientService

setClientService

public void setClientService(ClientService clientService)
Parameters:
clientService - the clientService to set

getGestoriaService

public GestoriaService getGestoriaService()
Returns:
the gestoriaService

setGestoriaService

public void setGestoriaService(GestoriaService gestoriaService)
Parameters:
gestoriaService - the gestoriaService to set