Author: glandais Date: 2008-02-05 14:28:57 +0000 (Tue, 05 Feb 2008) New Revision: 685 Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ExceptionReport.java trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Login.java trunk/simexplorer-is-web/src/main/webapp/ExceptionReport.tml trunk/simexplorer-is-web/src/main/webapp/Login.tml trunk/simexplorer-is-web/src/main/webapp/WEB-INF/app.properties trunk/simexplorer-is-web/src/main/webapp/WEB-INF/app_fr.properties trunk/simexplorer-is/src/site/fr/rst/todo.rst Log: Login message & exception handling Modified: trunk/simexplorer-is/src/site/fr/rst/todo.rst =================================================================== --- trunk/simexplorer-is/src/site/fr/rst/todo.rst 2008-02-05 12:18:09 UTC (rev 684) +++ trunk/simexplorer-is/src/site/fr/rst/todo.rst 2008-02-05 14:28:57 UTC (rev 685) @@ -15,10 +15,6 @@ Client léger ============ - - Explication rejet login - - Internationalisation - - Gestion des exceptions - Consultation ------------ Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ExceptionReport.java =================================================================== --- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ExceptionReport.java 2008-02-05 12:18:09 UTC (rev 684) +++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/ExceptionReport.java 2008-02-05 14:28:57 UTC (rev 685) @@ -84,10 +84,11 @@ if (simException != null) { _unknown = false; this.exception = simException; - + /* _unknown = true; ExceptionAnalysis analysis = analyzer.analyze(exceptionReported); _stack = analysis.getExceptionInfos(); + */ } else { _unknown = true; ExceptionAnalysis analysis = analyzer.analyze(exceptionReported); Modified: trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Login.java =================================================================== --- trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Login.java 2008-02-05 12:18:09 UTC (rev 684) +++ trunk/simexplorer-is-web/src/java/fr/cemagref/simexplorer/is/ui/web/pages/Login.java 2008-02-05 14:28:57 UTC (rev 685) @@ -18,8 +18,11 @@ package fr.cemagref.simexplorer.is.ui.web.pages; import org.apache.tapestry.annotations.ApplicationState; +import org.apache.tapestry.annotations.Component; import org.apache.tapestry.annotations.InjectPage; import org.apache.tapestry.annotations.Persist; +import org.apache.tapestry.corelib.components.Form; +import org.apache.tapestry.corelib.components.TextField; import org.apache.tapestry.ioc.Messages; import org.apache.tapestry.ioc.annotations.Inject; @@ -51,24 +54,28 @@ @Inject private Messages messages; + /** The form. */ + @Component + private Form form; + /** * On success. * * @return the object */ public Object onSuccess() { - Object result = null; try { token = RemoteSecurityService.getAuthentificationService() .loginUser(user, password); - if (token != null) { - result = elementList; + System.out.println(token); + if (token != null && !token.equals("")) { + return elementList; } + form.recordError(messages.get("simexplorer.ui.web.login.invalid")); + return this; } catch (SimExplorerServiceException e) { throw new SimExplorerWebException(e); } - - return result; } /** Modified: trunk/simexplorer-is-web/src/main/webapp/ExceptionReport.tml =================================================================== --- trunk/simexplorer-is-web/src/main/webapp/ExceptionReport.tml 2008-02-05 12:18:09 UTC (rev 684) +++ trunk/simexplorer-is-web/src/main/webapp/ExceptionReport.tml 2008-02-05 14:28:57 UTC (rev 685) @@ -9,7 +9,7 @@ <p>${message:simexplorer.ui.web.error.errorMessage}</p> - <div t:type="t5components/SlidingPanel" closed="true" subject="${message:exceptionDetails}"> + <div t:type="t5components/SlidingPanel" closed="true" subject="${message:simexplorer.ui.web.error.exceptionDetails}"> <div class="t-exception-report" id="errordetail"> <ul> <t:loop source="stack" value="info"> Modified: trunk/simexplorer-is-web/src/main/webapp/Login.tml =================================================================== --- trunk/simexplorer-is-web/src/main/webapp/Login.tml 2008-02-05 12:18:09 UTC (rev 684) +++ trunk/simexplorer-is-web/src/main/webapp/Login.tml 2008-02-05 14:28:57 UTC (rev 685) @@ -8,11 +8,11 @@ <t:errors /> ${message:simexplorer.ui.web.user} : - <input t:type="TextField" t:id="user" + <input t:type="TextField" t:id="userField" t:validate="required,minlength=1" t:value="user" size="30" /> <br /> ${message:simexplorer.ui.web.password} : - <input t:type="PasswordField" t:id="password" + <input t:type="PasswordField" t:id="passwordField" t:validate="required,minlength=1" t:value="password" size="30" /> <br /> <input t:type="Submit" t:value="${message:simexplorer.ui.web.login}" /> Modified: trunk/simexplorer-is-web/src/main/webapp/WEB-INF/app.properties =================================================================== --- trunk/simexplorer-is-web/src/main/webapp/WEB-INF/app.properties 2008-02-05 12:18:09 UTC (rev 684) +++ trunk/simexplorer-is-web/src/main/webapp/WEB-INF/app.properties 2008-02-05 14:28:57 UTC (rev 685) @@ -115,5 +115,6 @@ simexplorer.ui.web.error.unknowException=Unknown exception simexplorer.ui.web.error.errorMessage=An unknown error occured. +simexplorer.ui.web.error.exceptionDetails=Error details simexplorer.ui.web.generatedata=Generate data Modified: trunk/simexplorer-is-web/src/main/webapp/WEB-INF/app_fr.properties =================================================================== --- trunk/simexplorer-is-web/src/main/webapp/WEB-INF/app_fr.properties 2008-02-05 12:18:09 UTC (rev 684) +++ trunk/simexplorer-is-web/src/main/webapp/WEB-INF/app_fr.properties 2008-02-05 14:28:57 UTC (rev 685) @@ -66,6 +66,8 @@ simexplorer.ui.web.layout.install=Générer des données +simexplorer.ui.web.login.invalid=Echec de la connexion + simexplorer.ui.web.back=Retour simexplorer.ui.web.cancel=Annuler simexplorer.ui.web.confirm=Confirmer @@ -115,5 +117,6 @@ simexplorer.ui.web.error.unknowException=Exception inconnue simexplorer.ui.web.error.errorMessage=Une erreur inconnue s'est produite. +simexplorer.ui.web.error.exceptionDetails=Détails de l'erreur simexplorer.ui.web.generatedata=Generate data