|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.context.support.ApplicationObjectSupport
org.springframework.web.portlet.context.PortletApplicationObjectSupport
org.springframework.web.portlet.handler.PortletContentGenerator
org.springframework.web.portlet.mvc.AbstractController
org.springframework.web.portlet.mvc.BaseCommandController
org.springframework.web.portlet.mvc.AbstractFormController
org.springframework.web.portlet.mvc.SimpleFormController
com.ferri.portlet.contracte.action.ViewContracteAction
public class ViewContracteAction
Controlador de les pantalles de llistat.jsp i manteniment.jsp de la entitat Contracte
Field Summary | |
---|---|
private ClientService |
clientService
|
private ContracteService |
contracteService
|
private FacturaService |
facturaService
|
private static org.apache.commons.logging.Log |
log
|
private static String |
PAGE_LIST
|
private static String |
PAGE_MANT
|
private javax.servlet.ServletContext |
servletContext
|
Fields inherited from class org.springframework.web.portlet.mvc.BaseCommandController |
---|
DEFAULT_COMMAND_NAME |
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
---|
logger |
Constructor Summary | |
---|---|
ViewContracteAction()
|
Method Summary | |
---|---|
private void |
buscar(javax.portlet.PortletRequest request)
Cerca un llistat d'entitats Contracte que compleixin els criteris i ordenació passats per formulari request. |
private void |
creaIntervencions(ContracteDTO dto)
Crea les entitats Intervencio en estat pendent a partir d'una entitat Contracte |
private void |
defecte(javax.portlet.PortletRequest request)
Carrega el llistat amb tots els elements Contracte i l'afegeix a la request. |
private void |
editar(javax.portlet.PortletRequest request)
Carrega una entitat Contracte en request a partir del número pasat també per request. |
private boolean |
elimina(javax.portlet.PortletRequest request)
Elimina una entitat Contracte amb la pk pasada en la request. |
private void |
enviar(javax.portlet.PortletRequest request)
Genera un pdf de l'entitat Contracte, i l'envia com attachment en un mail preformat d'aquesta entitat als destinataris passats per formulari en la request. |
private void |
getClientsAutoComplete(javax.portlet.PortletRequest request)
Carrega un String en el atribut request 'arrayClientAutocomplete' amb la relació de NIF separada per comes de tots els clients amb la forma '"NIF1","NIF2","NIF3",...'. |
ClientService |
getClientService()
|
ContracteService |
getContracteService()
|
FacturaService |
getFacturaService()
|
private void |
getMails(javax.portlet.PortletRequest request)
Metode que cerca els emails vinculats a un client, sempre el seu, i opcionalment el de la gestoria i l'administrador: sempre que es traci d'una comunitat. |
private Integer[] |
getMesAny(int field,
int amount)
Retorna un binomi amb la informació mes/any agafant com a base el mes actual y afegint les unitats de temps pasades. |
private Boolean |
guardar(javax.portlet.PortletRequest request)
Guarda una entitat Contracte, 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 |
setContracteService(ContracteService contracteService)
|
void |
setFacturaService(FacturaService facturaService)
|
void |
setServletContext(javax.servlet.ServletContext servletContext)
|
private void |
signar(javax.portlet.PortletRequest request)
Cambia l'estat de l'entitat Contracte a signat, genera una entitat Factura en estat pendent amb les dades del Contracte, també genera les entitats Intervencio associades al contracte en estat pendent. |
private void |
subElements(javax.portlet.PortletRequest request)
Carrega els llistats d'elements secundaris: Estat, i l'afegeix a la request. |
private boolean |
validaBusqueda(ContracteDTO dto,
javax.portlet.PortletRequest request)
Valida els camps del formulari de cerca en format data per entitats Contracte. |
private boolean |
validaCamps(ContracteDTO dto,
javax.portlet.PortletRequest request)
Valida els camps del formulari de l'entitat Contracte abans de guardar-los. |
Methods inherited from class org.springframework.web.portlet.mvc.SimpleFormController |
---|
doSubmitAction, getFormView, getSuccessView, isFormChangeRequest, onFormChange, onFormChange, onSubmitAction, onSubmitAction, onSubmitAction, onSubmitRender, onSubmitRender, onSubmitRender, processFormSubmission, referenceData, referenceData, renderFormSubmission, setFormView, setSuccessView, showForm, showForm, suppressValidation |
Methods inherited from class org.springframework.web.portlet.mvc.AbstractFormController |
---|
formBackingObject, getCommand, getErrorsForNewForm, getFormSessionAttributeName, getFormSessionAttributeName, getFormSubmitParameterName, getInvalidSubmitParameterName, getRenderParameters, handleActionRequestInternal, handleInvalidSubmit, handleRenderRequestInternal, isBindOnNewForm, isFormSubmission, isInvalidSubmission, isRedirectAction, isSessionForm, onBindOnNewForm, onBindOnNewForm, passRenderParameters, renderInvalidSubmit, setBindOnNewForm, setFormSubmit, setInvalidSubmit, setRedirectAction, setRenderParameters, setSessionForm, showForm, showForm, showNewForm |
Methods inherited from class org.springframework.web.portlet.mvc.BaseCommandController |
---|
bindAndValidate, checkCommand, createBinder, createCommand, getBindingErrorProcessor, getCommandClass, getCommandName, getMessageCodesResolver, getPropertyEditorRegistrars, getRenderCommand, getRenderCommandSessionAttributeName, getRenderErrors, getRenderErrorsSessionAttributeName, getValidator, getValidators, getWebBindingInitializer, initApplicationContext, initBinder, isValidateOnBinding, onBind, onBind, onBindAndValidate, prepareBinder, setBindingErrorProcessor, setCommandClass, setCommandName, setMessageCodesResolver, setPropertyEditorRegistrar, setPropertyEditorRegistrars, setRenderCommandAndErrors, setValidateOnBinding, setValidator, setValidators, setWebBindingInitializer, suppressBinding, useDirectFieldAccess |
Methods inherited from class org.springframework.web.portlet.mvc.AbstractController |
---|
isRenderWhenMinimized, isSynchronizeOnSession, setRenderWhenMinimized, setSynchronizeOnSession |
Methods inherited from class org.springframework.web.portlet.handler.PortletContentGenerator |
---|
applyCacheSeconds, cacheForSeconds, check, checkAndPrepare, checkAndPrepare, getCacheSeconds, isRequireSession, preventCaching, setCacheSeconds, setRequireSession |
Methods inherited from class org.springframework.web.portlet.context.PortletApplicationObjectSupport |
---|
getPortletContext, getTempDir, isContextRequired, setPortletContext |
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
---|
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log log
private ContracteService contracteService
private FacturaService facturaService
private ClientService clientService
private javax.servlet.ServletContext servletContext
private static final String PAGE_MANT
private static final String PAGE_LIST
Constructor Detail |
---|
public ViewContracteAction()
Method Detail |
---|
public void handleActionRequest(javax.portlet.ActionRequest request, javax.portlet.ActionResponse response) throws Exception
handleActionRequest
in interface org.springframework.web.portlet.mvc.Controller
handleActionRequest
in class org.springframework.web.portlet.mvc.AbstractController
Exception
public org.springframework.web.portlet.ModelAndView handleRenderRequest(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response) throws Exception
handleRenderRequest
in interface org.springframework.web.portlet.mvc.Controller
handleRenderRequest
in class org.springframework.web.portlet.mvc.AbstractController
Exception
private void defecte(javax.portlet.PortletRequest request) throws CommonServiceException
request
-
CommonServiceException
private void subElements(javax.portlet.PortletRequest request) throws CommonServiceException
request
-
CommonServiceException
private void getClientsAutoComplete(javax.portlet.PortletRequest request) throws CommonServiceException
request
-
CommonServiceException
private void getMails(javax.portlet.PortletRequest request) throws CommonServiceException
request
- amb la informació, s'afegeis el llistat 'llistaMails' per referencia
CommonServiceException
private boolean elimina(javax.portlet.PortletRequest request) throws Exception
request
-
Exception
private Boolean guardar(javax.portlet.PortletRequest request) throws Exception
request
-
Exception
private void enviar(javax.portlet.PortletRequest request) throws CommonServiceException
request
-
CommonServiceException
private void signar(javax.portlet.PortletRequest request) throws CommonServiceException
request
-
CommonServiceException
private Integer[] getMesAny(int field, int amount)
field
- Unitat de temps de Calendaramount
- valor a incrementar
private void creaIntervencions(ContracteDTO dto) throws CommonServiceException
dto
- ContracteDTO
CommonServiceException
private void editar(javax.portlet.PortletRequest request) throws Exception
request
-
Exception
private void buscar(javax.portlet.PortletRequest request) throws Exception
request
-
Exception
private boolean validaCamps(ContracteDTO dto, javax.portlet.PortletRequest request)
dto
- ContracteDTOrequest
-
private boolean validaBusqueda(ContracteDTO dto, javax.portlet.PortletRequest request)
dto
- ContracteDTOrequest
-
public FacturaService getFacturaService()
public void setFacturaService(FacturaService facturaService)
facturaService
- the facturaService to setpublic ContracteService getContracteService()
public void setContracteService(ContracteService contracteService)
contracteService
- the contracteService to setpublic ClientService getClientService()
public void setClientService(ClientService clientService)
clientService
- the clientService to setpublic void setServletContext(javax.servlet.ServletContext servletContext)
setServletContext
in interface org.springframework.web.context.ServletContextAware
servletContext
- the servletContext to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |