pfc-prolog-cvs Mailing List for pfc-prolix (Page 9)
Status: Beta
Brought to you by:
ivanfrade
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(77) |
Jun
(37) |
Jul
(152) |
Aug
(180) |
Sep
(45) |
Oct
|
Nov
|
Dec
|
---|
From: <iva...@us...> - 2003-08-03 21:35:35
|
Update of /cvsroot/pfc-prolog/prolix/etc In directory sc8-pr-cvs1:/tmp/cvs-serv22275/etc Modified Files: WebClientResources.properties Log Message: Updated users management schema - Addded Permissions class with constants Index: WebClientResources.properties =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/etc/WebClientResources.properties,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** WebClientResources.properties 3 Aug 2003 15:58:42 -0000 1.11 --- WebClientResources.properties 3 Aug 2003 21:35:31 -0000 1.12 *************** *** 26,29 **** --- 26,31 ---- message.input.user=Usuario message.input.password=Password + message.free.access=Acceso libre + message.registry.now=Registrate ahora title.main=Prolix title.consult=Prolix Consulta |
From: <iva...@us...> - 2003-08-03 15:58:47
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/formbeans In directory sc8-pr-cvs1:/tmp/cvs-serv5164/src/org/asturlinux/frade/prolix/web/formbeans Added Files: LogoutFormBean.java Log Message: Added logout funcionatility to webclient --- NEW FILE: LogoutFormBean.java --- /** * * Copyright 2003 Ivan Frade * * This file is part of Prolix. * * Prolix is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Prolix is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Prolix; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * **/ package org.asturlinux.frade.prolix.web.formbeans; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.*; /** * @struts:form name="logoutForm" */ public class LogoutFormBean extends ActionForm { /** * Redefined methods */ public void reset(ActionMapping mapping, HttpServletRequest request) { } public ActionErrors validate (ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); return errors; } } |
From: <iva...@us...> - 2003-08-03 15:58:47
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions In directory sc8-pr-cvs1:/tmp/cvs-serv5164/src/org/asturlinux/frade/prolix/web/actions Added Files: LogoutAction.java Log Message: Added logout funcionatility to webclient --- NEW FILE: LogoutAction.java --- /** * * Copyright 2003 Ivan Frade * * This file is part of Prolix. * * Prolix is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Prolix is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Prolix; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * **/ package org.asturlinux.frade.prolix.web.actions; import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.security.*; import org.apache.struts.action.*; import org.apache.struts.util.*; import org.asturlinux.frade.prolix.web.beans.*; import org.asturlinux.frade.prolix.web.formbeans.*; import org.asturlinux.frade.prolix.ejb.interfaces.*; import org.asturlinux.frade.prolix.interpreter.exceptions.*; import org.asturlinux.frade.prolix.exceptions.NoLoggedUserException; /** * @struts.action name="logoutForm" * path="/actions/logout" * scope="request" * input="/program.jsp" * validate="true" * parameter="" * * @struts.action-forward name="success" * path="/login.jsp" * * @struts.action-forward name="failure" * path="/login.jsp" */ public class LogoutAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // Auxiliar var Locale locale = getLocale(request); MessageResources messages = getResources(request); ActionErrors errors = new ActionErrors(); try { HttpSession session = request.getSession(); ProlixMain interpreter = (ProlixMain)session.getAttribute("interpreter"); if (interpreter != null) { interpreter.logout(); } else errors.add("logout",new ActionError("error.no.interpreter")); } catch (NoLoggedUserException notAuth) { errors.add("logout",new ActionError("error.failed.logout")); } if (!errors.isEmpty()) { saveErrors(request,errors); return (mapping.findForward("failure")); } return (mapping.findForward("success")); } } |
From: <iva...@us...> - 2003-08-03 15:58:47
|
Update of /cvsroot/pfc-prolog/prolix/etc In directory sc8-pr-cvs1:/tmp/cvs-serv5164/etc Modified Files: WebClientResources.properties Log Message: Added logout funcionatility to webclient Index: WebClientResources.properties =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/etc/WebClientResources.properties,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** WebClientResources.properties 3 Aug 2003 14:42:09 -0000 1.10 --- WebClientResources.properties 3 Aug 2003 15:58:42 -0000 1.11 *************** *** 11,14 **** --- 11,15 ---- error.void.passwd=<li>Debe teclear su password</li> error.failed.login=<li>Nombre/clave incorrectos o ya hay alguien logeado</li> + error.failed.logout=<li>No puede hacer logout: no hay usuario logeado</li> errors.footer=</ul> errors.header=<h3>Se han producido los siguientes errores</h3><ul> *************** *** 17,20 **** --- 18,22 ---- button.next.solution=Siguiente solución button.step=Avanzar un paso + button.logout=Logout message.load.other.program=Cargar otro programa message.load.other.consult=Cargar otra consulta |
From: <iva...@us...> - 2003-08-03 15:58:47
|
Update of /cvsroot/pfc-prolog/prolix/web In directory sc8-pr-cvs1:/tmp/cvs-serv5164/web Modified Files: consult.jsp program.jsp solutions.jsp tree.jsp Log Message: Added logout funcionatility to webclient Index: consult.jsp =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/web/consult.jsp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** consult.jsp 27 Jul 2003 14:17:53 -0000 1.19 --- consult.jsp 3 Aug 2003 15:58:42 -0000 1.20 *************** *** 66,69 **** --- 66,72 ---- <h1><bean:message key="title.consult"/></h1> + <html:form action="/actions/logout"> + <html:submit><bean:message key="button.logout"/></html:submit> + </html:form> <table> Index: program.jsp =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/web/program.jsp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** program.jsp 27 Jul 2003 14:17:53 -0000 1.12 --- program.jsp 3 Aug 2003 15:58:42 -0000 1.13 *************** *** 58,61 **** --- 58,67 ---- <body> <h1><bean:message key="title.main"/></h1> + + <html:form action="/actions/logout"> + <html:submit><bean:message key="button.logout"/></html:submit> + </html:form> + + <hr align="left" size="1"> <html:form action="/actions/loadProgram"> Index: solutions.jsp =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/web/solutions.jsp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** solutions.jsp 27 Jul 2003 14:17:53 -0000 1.14 --- solutions.jsp 3 Aug 2003 15:58:42 -0000 1.15 *************** *** 65,68 **** --- 65,72 ---- <body bgcolor="#768FDD"> <h1><bean:message key="title.resultText"/></h1> + <html:form action="/actions/logout"> + <html:submit><bean:message key="button.logout"/></html:submit> + </html:form> + <hr align="left" size="10"> <%= programLoaded %> Index: tree.jsp =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/web/tree.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tree.jsp 27 Jul 2003 14:19:02 -0000 1.1 --- tree.jsp 3 Aug 2003 15:58:42 -0000 1.2 *************** *** 59,62 **** --- 59,65 ---- <body> <h1><bean:message key="title.resultGraphic"/></h1> + <html:form action="/actions/logout"> + <html:submit><bean:message key="button.logout"/></html:submit> + </html:form> <!-- FIXME Here the tree --> |
From: <iva...@us...> - 2003-08-03 14:44:04
|
Update of /cvsroot/pfc-prolog/prolix/web In directory sc8-pr-cvs1:/tmp/cvs-serv27381/web Added Files: login.jsp Log Message: Added login functionality to webclient --- NEW FILE: login.jsp --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- =========================================================== /** * * Copyright 2003 Ivan Frade * * This file is part of Prolix. * * Prolix is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Prolix is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Prolix; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * **/ ============================================================= --> <%@ page import="java.util.*,java.rmi.*,javax.naming.*,javax.rmi.*, java.io.*,javax.ejb.*, org.asturlinux.frade.prolix.ejb.interfaces.*, org.asturlinux.frade.prolix.interpreter.exceptions.*" %> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %> <%@ taglib uri="ejbtags" prefix="ejb" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> <jsp:useBean id="prologData" scope="session" class="org.asturlinux.frade.prolix.web.beans.CurrentStateBean" /> <!-- Obtain Home reference--> <ejb:useHome id="prolixHome" type="org.asturlinux.frade.prolix.ejb.interfaces.ProlixMainHome" location="org/asturlinux/frade/prolix/ejb/sessionjb/ProlixMain" /> <!-- Obtain Bean reference. If don't exist, create new one --> <ejb:useBean id="interpreter" type="org.asturlinux.frade.prolix.ejb.interfaces.ProlixMain" scope="session"> <ejb:createBean instance="<%= prolixHome.create() %>" /> </ejb:useBean> <html> <head> <title><bean:message key="title.main"/></title> <link rel="stylesheet" href="/prolixjsp/css/prolix.css" type="text/css"/> </head> <body> <h1><bean:message key="title.main"/></h1> <hr align="left" size="1"> <html:form action="/actions/login"> <bean:message key="message.input.user"/> <html:text property="username"/><br> <bean:message key="message.input.password"/> <html:password property="password"/><br> <html:submit><bean:message key="button.load"/></html:submit> <html:reset> <bean:message key="button.clear"/></html:reset> </html:form> <html:errors/> </body> </html> |
From: <iva...@us...> - 2003-08-03 14:44:04
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions In directory sc8-pr-cvs1:/tmp/cvs-serv27381/src/org/asturlinux/frade/prolix/web/actions Added Files: LoginAction.java Log Message: Added login functionality to webclient --- NEW FILE: LoginAction.java --- /** * * Copyright 2003 Ivan Frade * * This file is part of Prolix. * * Prolix is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Prolix is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Prolix; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * **/ package org.asturlinux.frade.prolix.web.actions; import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import java.security.*; import org.apache.struts.action.*; import org.apache.struts.util.*; import org.asturlinux.frade.prolix.web.beans.*; import org.asturlinux.frade.prolix.web.formbeans.*; import org.asturlinux.frade.prolix.ejb.interfaces.*; import org.asturlinux.frade.prolix.interpreter.exceptions.*; import org.asturlinux.frade.prolix.exceptions.FailedLoginException; /** * @struts.action name="loginForm" * path="/actions/login" * scope="request" * input="/login.jsp" * validate="true" * parameter="" * * @struts.action-forward name="success" * path="/program.jsp" * * @struts.action-forward name="failure" * path="/login.jsp" */ public class LoginAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // Auxiliar var Locale locale = getLocale(request); MessageResources messages = getResources(request); ActionErrors errors = new ActionErrors(); // Take form bean atrributes String user = ((LoginFormBean)form).getUsername(); String pass = ((LoginFormBean)form).getPassword(); try { HttpSession session = request.getSession(); ProlixMain interpreter = (ProlixMain)session.getAttribute("interpreter"); if (interpreter != null) { interpreter.login(user,pass); } else errors.add("login",new ActionError("error.no.interpreter")); } catch (FailedLoginException notAuth) { errors.add("login",new ActionError("error.failed.login")); } if (!errors.isEmpty()) { saveErrors(request,errors); return (mapping.findForward("failure")); } return (mapping.findForward("success")); } } |
From: <iva...@us...> - 2003-08-03 14:44:04
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/formbeans In directory sc8-pr-cvs1:/tmp/cvs-serv27381/src/org/asturlinux/frade/prolix/web/formbeans Added Files: LoginFormBean.java Log Message: Added login functionality to webclient --- NEW FILE: LoginFormBean.java --- /** * * Copyright 2003 Ivan Frade * * This file is part of Prolix. * * Prolix is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Prolix is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Prolix; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * **/ package org.asturlinux.frade.prolix.web.formbeans; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.*; /** * @struts:form name="loginForm" */ public class LoginFormBean extends ActionForm { private String username; private String password; /** * Gets the value of username * * @return the value of username */ public String getUsername() { return this.username; } /** * Sets the value of username * * @param argUsername Value to assign to this.username */ public void setUsername(String argUsername) { this.username = argUsername; } /** * Gets the value of password * * @return the value of password */ public String getPassword() { return this.password; } /** * Sets the value of password * * @param argPassword Value to assign to this.password */ public void setPassword(String argPassword) { this.password = argPassword; } public ActionErrors validate (ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if ((username == null) || (username.length() < 1)) errors.add("login", new ActionError("error.void.user")); if ((password == null) || (password.length() < 1)) errors.add("login", new ActionError("error.void.passwd")); return errors; } } |
From: <iva...@us...> - 2003-08-03 14:42:11
|
Update of /cvsroot/pfc-prolog/prolix/etc In directory sc8-pr-cvs1:/tmp/cvs-serv27115/etc Modified Files: WebClientResources.properties Log Message: Added new messages Index: WebClientResources.properties =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/etc/WebClientResources.properties,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** WebClientResources.properties 2 Aug 2003 20:30:52 -0000 1.9 --- WebClientResources.properties 3 Aug 2003 14:42:09 -0000 1.10 *************** *** 8,11 **** --- 8,14 ---- error.saving.consult.bean=<li>Error al salvar la consulta en el bean</li> error.not.enought.permissions=<li>No tiene permisos suficientes para esta operación</li> + error.void.user=<li>Debe teclear un nombre de usuario</li> + error.void.passwd=<li>Debe teclear su password</li> + error.failed.login=<li>Nombre/clave incorrectos o ya hay alguien logeado</li> errors.footer=</ul> errors.header=<h3>Se han producido los siguientes errores</h3><ul> *************** *** 19,22 **** --- 22,27 ---- message.return.solutions.page=Volver a la pagina de soluciones message.go.graphic.resolution=Ir a resolucion gráfica + message.input.user=Usuario + message.input.password=Password title.main=Prolix title.consult=Prolix Consulta |
From: <iva...@us...> - 2003-08-02 20:30:55
|
Update of /cvsroot/pfc-prolog/prolix/etc In directory sc8-pr-cvs1:/tmp/cvs-serv13373/etc Modified Files: WebClientResources.properties Log Message: Added to project new exception to login - Message error in Resources Index: WebClientResources.properties =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/etc/WebClientResources.properties,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** WebClientResources.properties 27 Jul 2003 14:07:40 -0000 1.8 --- WebClientResources.properties 2 Aug 2003 20:30:52 -0000 1.9 *************** *** 7,10 **** --- 7,11 ---- error.query.not.loaded=<li>No ha cargado una consulta previamente en el intérprete</li> error.saving.consult.bean=<li>Error al salvar la consulta en el bean</li> + error.not.enought.permissions=<li>No tiene permisos suficientes para esta operación</li> errors.footer=</ul> errors.header=<h3>Se han producido los siguientes errores</h3><ul> |
From: <iva...@us...> - 2003-08-02 20:30:55
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/exceptions In directory sc8-pr-cvs1:/tmp/cvs-serv13373/src/org/asturlinux/frade/prolix/exceptions Added Files: NotEnoughtPermissionsException.java Log Message: Added to project new exception to login - Message error in Resources --- NEW FILE: NotEnoughtPermissionsException.java --- /** * * Copyright 2003 Ivan Frade * * This file is part of Prolix. * * Prolix is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Prolix is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Prolix; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * **/ package org.asturlinux.frade.prolix.exceptions; public class NotEnoughtPermissionsException extends Exception { //FIXME: Code to diferent permissions levels } |
From: <iva...@us...> - 2003-08-02 20:30:55
|
Update of /cvsroot/pfc-prolog/prolix In directory sc8-pr-cvs1:/tmp/cvs-serv13373 Modified Files: build.xml Log Message: Added to project new exception to login - Message error in Resources Index: build.xml =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/build.xml,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** build.xml 2 Aug 2003 15:37:40 -0000 1.45 --- build.xml 2 Aug 2003 20:30:52 -0000 1.46 *************** *** 423,427 **** <include name="${package.path}/interpreter/exceptions/**"/> <include name="${package.path}/ejb/interfaces/**"/> ! <include name="${package.path}/exxceptions/**"/> </fileset> </jar> --- 423,427 ---- <include name="${package.path}/interpreter/exceptions/**"/> <include name="${package.path}/ejb/interfaces/**"/> ! <include name="${package.path}/exceptions/**"/> </fileset> </jar> |
From: <iva...@us...> - 2003-08-02 20:29:20
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/consoleclient In directory sc8-pr-cvs1:/tmp/cvs-serv13116/src/org/asturlinux/frade/prolix/consoleclient Modified Files: ConsoleClient.java Log Message: Added to console client login and logout functionality Index: ConsoleClient.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/consoleclient/ConsoleClient.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ConsoleClient.java 27 Jul 2003 14:08:38 -0000 1.10 --- ConsoleClient.java 2 Aug 2003 20:29:17 -0000 1.11 *************** *** 1,3 **** - /** * --- 1,2 ---- *************** *** 31,35 **** import org.asturlinux.frade.prolix.ejb.interfaces.*; import org.asturlinux.frade.prolix.interpreter.exceptions.*; ! /** --- 30,34 ---- import org.asturlinux.frade.prolix.ejb.interfaces.*; import org.asturlinux.frade.prolix.interpreter.exceptions.*; ! import org.asturlinux.frade.prolix.exceptions.*; /** *************** *** 62,66 **** { System.out.println("ERROR: Naming Exception"); - ne.printStackTrace(); return; } --- 61,64 ---- *************** *** 76,80 **** } ! String[] optionsMenu = {"Load Program", "Get loaded program", "Load Consult", --- 74,79 ---- } ! String[] optionsMenu = {"Login", ! "Load Program", "Get loaded program", "Load Consult", *************** *** 82,85 **** --- 81,85 ---- "Step", "NextSolution", + "Logout", "Exit"}; *************** *** 92,108 **** optionsMenu)) { ! case 1: program(); break; ! case 2: getLoadedProgram(); break; ! case 3: consult(); break; ! case 4: getLoadedConsult(); break; ! case 5: goStep(); break; ! case 6: goNextSolution(); break; ! case 7: otherIteration = false; break; } --- 92,112 ---- optionsMenu)) { ! case 1: doLogin(); break; ! case 2: program(); break; ! case 3: getLoadedProgram(); break; ! case 4: consult(); break; ! case 5: getLoadedConsult(); break; ! case 6: goStep(); break; ! case 7: goNextSolution(); ! break; ! case 8: doLogout(); ! break; ! case 9: otherIteration = false; break; } *************** *** 144,147 **** --- 148,156 ---- System.out.println("Please, write something with sense"); } + catch (NotEnoughtPermissionsException notAuth) + { + //PERMISSIONS-MESSAGE + System.out.println("Sorry, you don't have enought permissions"); + } } *************** *** 187,190 **** --- 196,204 ---- System.out.println("Please, write something with sense"); } + catch (NotEnoughtPermissionsException notAuth) + { + //PERMISSIONS-MESSAGE + System.out.println("Sorry, you don't have enought permissions"); + } } *************** *** 223,226 **** --- 237,246 ---- System.out.println("Remote exception doing an step"); } + catch (NotEnoughtPermissionsException notAuth) + { + //PERMISSIONS-MESSAGE + System.out.println("Sorry, you don't have enought permissions"); + } + } *************** *** 243,248 **** --- 263,309 ---- System.out.println("Remote exception doing an step"); } + catch (NotEnoughtPermissionsException notAuth) + { + //PERMISSIONS-MESSAGE + System.out.println("Sorry, you don't have enought permissions"); + } } + private void doLogin() + { + BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); + try + { + System.out.println("Write your user name: "); + String id = new String(in.readLine()); + System.out.println("Write your password: "); + String pwd = new String(in.readLine()); + interpreter.login(id,pwd); + } + catch (IOException io) + { + System.out.println("IO Exception doing login"); + } + catch (FailedLoginException fe) + { + System.out.println("User not exist, password incorrect or someone already loaded"); + } + } + + private void doLogout() + { + try + { + interpreter.logout(); + } + catch (NoLoggedUserException nlue) + { + System.out.println("Cannot logout: No loged user"); + } + catch (RemoteException re) + { + System.out.println("Remote Exception doing logout"); + } + } } |
From: <iva...@us...> - 2003-08-02 20:28:20
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/ejb/sessionjb In directory sc8-pr-cvs1:/tmp/cvs-serv12985/src/org/asturlinux/frade/prolix/ejb/sessionjb Modified Files: ProlixMainBean.java Log Message: Added login and logout methodsand checked permissions in all other Index: ProlixMainBean.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/ejb/sessionjb/ProlixMainBean.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** ProlixMainBean.java 1 Aug 2003 18:22:39 -0000 1.26 --- ProlixMainBean.java 2 Aug 2003 20:28:18 -0000 1.27 *************** *** 34,37 **** --- 34,39 ---- import org.asturlinux.frade.prolix.exceptions.*; import org.asturlinux.frade.prolix.ejb.interfaces.UserLocalHome; + import org.asturlinux.frade.prolix.ejb.interfaces.UserLocal; + /** * Iteration 1: This bean manages communication between JSP <-> interpreter *************** *** 73,78 **** **/ public void loadProgram(String program) ! throws LexicalException, SyntaxException { _program = program; --- 75,81 ---- **/ public void loadProgram(String program) ! throws LexicalException, SyntaxException, NotEnoughtPermissionsException { + verifyPermissions(); _program = program; *************** *** 116,121 **** **/ public void loadConsult(String consult) ! throws LexicalException, SyntaxException, ProgramNotLoadedException { _consult = consult; --- 119,127 ---- **/ public void loadConsult(String consult) ! throws LexicalException, SyntaxException, ! ProgramNotLoadedException, NotEnoughtPermissionsException { + verifyPermissions(); + _consult = consult; *************** *** 141,146 **** */ public String nextSolution() ! throws ProgramNotLoadedException, QueryNotLoadedException { CheckSolutionVisitor visitor = new CheckSolutionVisitor(); --- 147,155 ---- */ public String nextSolution() ! throws ProgramNotLoadedException, QueryNotLoadedException, ! NotEnoughtPermissionsException { + verifyPermissions(); + CheckSolutionVisitor visitor = new CheckSolutionVisitor(); *************** *** 162,167 **** **/ public String step() ! throws ProgramNotLoadedException, QueryNotLoadedException { TreeElement treeResult = prologCtx.step(); --- 171,179 ---- **/ public String step() ! throws ProgramNotLoadedException, QueryNotLoadedException, ! NotEnoughtPermissionsException { + verifyPermissions(); + TreeElement treeResult = prologCtx.step(); *************** *** 342,346 **** } ! public void visitPreOrder(TreeElement tree, TreeElementVisitor visitor) { /** --- 354,358 ---- } ! private void visitPreOrder(TreeElement tree, TreeElementVisitor visitor) { /** *************** *** 390,394 **** ********************************** **/ ! //private UserLocal user; /** --- 402,406 ---- ********************************** **/ ! private UserLocal loggedUser = null; /** *************** *** 398,405 **** throws FailedLoginException { ! // FIXME login code: Something like ! // loggedUser = obtainUsersHome().findByPrimaryKey(new UserPK(name)); ! // compare User.pass with pass ! // catch FinderException } --- 410,427 ---- throws FailedLoginException { ! try ! { ! if (loggedUser != null) ! throw new FailedLoginException(); ! loggedUser = obtainUserHome().findByLogin(name,pass); ! } ! catch (FinderException fe) ! { ! throw new FailedLoginException(); ! } ! catch (NamingException ne) ! { ! throw new FailedLoginException(); ! } } *************** *** 410,418 **** throws NoLoggedUserException { ! // FIXME logout code: ! // if (loggedUser == null) ! // throw new NoLoggedUserException(); ! // else ! // loggedUser = null; } --- 432,439 ---- throws NoLoggedUserException { ! if (loggedUser == null) ! throw new NoLoggedUserException(); ! else ! loggedUser = null; } *************** *** 426,429 **** --- 447,458 ---- UserLocalHome home = (UserLocalHome)ctx.lookup(UserLocalHome.JNDI_NAME); return home; + } + + private void verifyPermissions() + throws NotEnoughtPermissionsException + { + //FIXME: Very simple permission schema + if (loggedUser == null) + throw new NotEnoughtPermissionsException(); } |
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions In directory sc8-pr-cvs1:/tmp/cvs-serv12693 Modified Files: LoadConsultAction.java LoadProgramAction.java SolutionAction.java StepAction.java Log Message: Updated actions to catch new login exception Index: LoadConsultAction.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions/LoadConsultAction.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** LoadConsultAction.java 27 Jul 2003 14:06:09 -0000 1.11 --- LoadConsultAction.java 2 Aug 2003 20:25:37 -0000 1.12 *************** *** 33,37 **** import org.asturlinux.frade.prolix.ejb.interfaces.*; import org.asturlinux.frade.prolix.interpreter.exceptions.*; ! /** * @struts.action name="loadConsultForm" --- 33,37 ---- import org.asturlinux.frade.prolix.ejb.interfaces.*; import org.asturlinux.frade.prolix.interpreter.exceptions.*; ! import org.asturlinux.frade.prolix.exceptions.NotEnoughtPermissionsException; /** * @struts.action name="loadConsultForm" *************** *** 53,126 **** public class LoadConsultAction extends Action { ! ! public ActionForward execute(ActionMapping mapping, ! ActionForm form, ! HttpServletRequest request, ! HttpServletResponse response) ! throws IOException, ServletException ! { ! // Auxiliar var ! Locale locale = getLocale(request); ! MessageResources messages = getResources(request); ! ActionErrors errors = new ActionErrors(); ! ! // Take form bean atrributes ! String consult = ((LoadConsultFormBean)form).getConsult(); ! try ! { ! HttpSession session = request.getSession(); ! ProlixMain interpreter = (ProlixMain)session.getAttribute("interpreter"); ! interpreter.loadConsult(consult); ! ! // Save in session current loaded consult ! CurrentStateBean state = (CurrentStateBean)session.getAttribute("prologData"); ! if (state != null) { ! state.setCurrentConsult(consult); ! state.setCurrentResult(null); } - - // To remember last consults: - LastConsultsBean lastConsults = (LastConsultsBean)session.getAttribute("oldConsults"); - if (lastConsults != null) - { - Vector lastest = lastConsults.getLastConsults(); - - //First time can be null - if (lastest == null) - lastest = new Vector(); - - if (!lastest.contains(consult)) - { - - if (lastest.add(consult)) - lastConsults.setLastConsults(lastest); - else - errors.add("consult",new ActionError("error.saving.consult.bean")); - - } - } - } - catch (SyntaxException se) - { - errors.add("consult",new ActionError("error.syntax.exception")); - } - catch (LexicalException le) - { - errors.add("consult",new ActionError("error.lexical.exception")); - } - catch (ProgramNotLoadedException pnle) - { - errors.add("consult",new ActionError("error.program.not.loaded")); - } - if (!errors.isEmpty()) - { - saveErrors(request,errors); return (mapping.findForward("success")); ! } ! ! return (mapping.findForward("success")); ! } } --- 53,127 ---- public class LoadConsultAction extends Action { ! ! public ActionForward execute(ActionMapping mapping, ! ActionForm form, ! HttpServletRequest request, ! HttpServletResponse response) ! throws IOException, ServletException ! { ! // Auxiliar var ! Locale locale = getLocale(request); ! MessageResources messages = getResources(request); ! ActionErrors errors = new ActionErrors(); ! // Take form bean atrributes ! String consult = ((LoadConsultFormBean)form).getConsult(); ! ! try { ! HttpSession session = request.getSession(); ! ProlixMain interpreter = (ProlixMain)session.getAttribute("interpreter"); ! interpreter.loadConsult(consult); ! ! // Save in session current loaded consult ! CurrentStateBean state = (CurrentStateBean)session.getAttribute("prologData"); ! if (state != null) ! { ! state.setCurrentConsult(consult); ! state.setCurrentResult(null); ! } ! ! // To remember last consults: ! LastConsultsBean lastConsults = (LastConsultsBean)session.getAttribute("oldConsults"); ! if (lastConsults != null) { ! Vector lastest = lastConsults.getLastConsults(); ! ! //First time can be null ! if (lastest == null) ! lastest = new Vector(); ! ! if (!lastest.contains(consult)) { ! if (lastest.add(consult)) ! lastConsults.setLastConsults(lastest); ! else ! errors.add("consult",new ActionError("error.saving.consult.bean")); ! } ! } ! } ! catch (SyntaxException se) { ! errors.add("consult",new ActionError("error.syntax.exception")); ! } ! catch (LexicalException le) ! { ! errors.add("consult",new ActionError("error.lexical.exception")); ! } ! catch (ProgramNotLoadedException pnle) ! { ! errors.add("consult",new ActionError("error.program.not.loaded")); ! } ! catch (NotEnoughtPermissionsException notAuth) ! { ! //PERMISSIONS-MESSAGE ! errors.add("consult",new ActionError("error.not.enought.permissions")); ! } ! ! ! if (!errors.isEmpty()) ! { ! saveErrors(request,errors); ! return (mapping.findForward("success")); } return (mapping.findForward("success")); ! } } Index: LoadProgramAction.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions/LoadProgramAction.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** LoadProgramAction.java 17 Jul 2003 17:55:17 -0000 1.11 --- LoadProgramAction.java 2 Aug 2003 20:25:37 -0000 1.12 *************** *** 33,36 **** --- 33,37 ---- import org.asturlinux.frade.prolix.ejb.interfaces.*; import org.asturlinux.frade.prolix.interpreter.exceptions.*; + import org.asturlinux.frade.prolix.exceptions.NotEnoughtPermissionsException; /** *************** *** 87,90 **** --- 88,97 ---- errors.add("program",new ActionError("error.lexical.exception")); } + catch (NotEnoughtPermissionsException notAuth) + { + //PERMISSIONS-MESSAGE + errors.add("program",new ActionError("error.not.enought.permissions")); + } + Index: SolutionAction.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions/SolutionAction.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SolutionAction.java 27 Jul 2003 14:12:35 -0000 1.8 --- SolutionAction.java 2 Aug 2003 20:25:37 -0000 1.9 *************** *** 33,37 **** import org.asturlinux.frade.prolix.ejb.interfaces.*; import org.asturlinux.frade.prolix.interpreter.exceptions.*; ! /** * @struts.action name="solutionsForm" --- 33,37 ---- import org.asturlinux.frade.prolix.ejb.interfaces.*; import org.asturlinux.frade.prolix.interpreter.exceptions.*; ! import org.asturlinux.frade.prolix.exceptions.NotEnoughtPermissionsException; /** * @struts.action name="solutionsForm" *************** *** 97,100 **** --- 97,106 ---- return (mapping.findForward("noQuery")); } + catch (NotEnoughtPermissionsException notAuth) + { + //PERMISSIONS-MESSAGE + errors.add("solution",new ActionError("error.not.enought.permissions")); + } + if (origin.equals("tree")) Index: StepAction.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions/StepAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StepAction.java 27 Jul 2003 14:15:32 -0000 1.1 --- StepAction.java 2 Aug 2003 20:25:37 -0000 1.2 *************** *** 33,37 **** import org.asturlinux.frade.prolix.ejb.interfaces.*; import org.asturlinux.frade.prolix.interpreter.exceptions.*; ! /** * @struts.action name="stepForm" --- 33,37 ---- import org.asturlinux.frade.prolix.ejb.interfaces.*; import org.asturlinux.frade.prolix.interpreter.exceptions.*; ! import org.asturlinux.frade.prolix.exceptions.NotEnoughtPermissionsException; /** * @struts.action name="stepForm" *************** *** 93,96 **** --- 93,104 ---- return (mapping.findForward("noQuery")); } + catch (NotEnoughtPermissionsException notAuth) + { + //PERMISSIONS-MESSAGE + errors.add("consult",new ActionError("error.not.enought.permissions")); + //FIXME: where we go with these error? + return (mapping.findForward("noQuery")); + } + return (mapping.findForward("success")); |
From: <iva...@us...> - 2003-08-02 20:23:01
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/ejb/entityjb In directory sc8-pr-cvs1:/tmp/cvs-serv12375/src/org/asturlinux/frade/prolix/ejb/entityjb Modified Files: UserBean.java Log Message: Fixed sql query and problems in descriptor Index: UserBean.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/ejb/entityjb/UserBean.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UserBean.java 2 Aug 2003 15:33:07 -0000 1.2 --- UserBean.java 2 Aug 2003 20:22:58 -0000 1.3 *************** *** 36,45 **** * @ejb.value-object name="User" * match="*" */ - - //FIXME could be something in this way - // -ejb.finder signature="java.util.Collection findByLogin(String idUser)" - // unchecked="true" - // query="SELECT OBJECT(p) FROM Users p WHERE p.login = ?1" public abstract class UserBean implements EntityBean --- 36,47 ---- * @ejb.value-object name="User" * match="*" + * + * @ejb.finder signature="org.asturlinux.frade.prolix.ejb.interfaces.UserLocal + * findByLogin(java.lang.String idUser, java.lang.String pass)" + * unchecked="true" + * query="SELECT OBJECT(p) FROM User p + * WHERE (p.user = ?1 AND p.pass = ?2)" + * */ public abstract class UserBean implements EntityBean |
From: <iva...@us...> - 2003-08-02 15:41:42
|
Update of /cvsroot/pfc-prolog/prolix/etc In directory sc8-pr-cvs1:/tmp/cvs-serv3002/etc Modified Files: servlet-mappings.xml servlets.xml Log Message: Updated merge files removing info now generated by xdoclet Index: servlet-mappings.xml =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/etc/servlet-mappings.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** servlet-mappings.xml 27 Jul 2003 14:22:30 -0000 1.2 --- servlet-mappings.xml 2 Aug 2003 15:41:39 -0000 1.3 *************** *** 6,11 **** </servlet-mapping> - <servlet-mapping> - <servlet-name>treeServlet</servlet-name> - <url-pattern>*.tree</url-pattern> - </servlet-mapping> --- 6,7 ---- Index: servlets.xml =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/etc/servlets.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** servlets.xml 27 Jul 2003 14:22:30 -0000 1.3 --- servlets.xml 2 Aug 2003 15:41:39 -0000 1.4 *************** *** 28,34 **** </servlet> <servlet> <servlet-name>treeServlet</servlet-name> <servlet-class>org.asturlinux.frade.prolix.web.servlets.TreeServlet</servlet-class> ! </servlet> \ No newline at end of file --- 28,36 ---- </servlet> + + <!-- Added xdoclet tags in source, but seems don't work --> <servlet> <servlet-name>treeServlet</servlet-name> <servlet-class>org.asturlinux.frade.prolix.web.servlets.TreeServlet</servlet-class> ! </servlet> |
From: <iva...@us...> - 2003-08-02 15:37:42
|
Update of /cvsroot/pfc-prolog/prolix In directory sc8-pr-cvs1:/tmp/cvs-serv2443 Modified Files: build.xml Log Message: Added servlets in xdoclet filesets - Include new exceptions in server and console-client jars Index: build.xml =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/build.xml,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** build.xml 1 Aug 2003 18:22:39 -0000 1.44 --- build.xml 2 Aug 2003 15:37:40 -0000 1.45 *************** *** 265,268 **** --- 265,271 ---- <include name="**/*Bean.java"/> </fileset> + <fileset dir="${src.ejb.dir}"> + <include name="**/*Servlet.java"/> + </fileset> <deploymentdescriptor *************** *** 404,407 **** --- 407,416 ---- > </fileset> + <fileset + dir="${build.classes.dir}" + includes="${package.path}/exceptions/**" + > + </fileset> + </jar> </target> *************** *** 414,417 **** --- 423,427 ---- <include name="${package.path}/interpreter/exceptions/**"/> <include name="${package.path}/ejb/interfaces/**"/> + <include name="${package.path}/exxceptions/**"/> </fileset> </jar> |
From: <iva...@us...> - 2003-08-02 15:33:09
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/ejb/entityjb In directory sc8-pr-cvs1:/tmp/cvs-serv1934/src/org/asturlinux/frade/prolix/ejb/entityjb Modified Files: UserBean.java Log Message: Throwed an interface required exception - now compiles Index: UserBean.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/ejb/entityjb/UserBean.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** UserBean.java 1 Aug 2003 18:22:39 -0000 1.1 --- UserBean.java 2 Aug 2003 15:33:07 -0000 1.2 *************** *** 76,79 **** --- 76,80 ---- */ public UserPK ejbCreate(org.asturlinux.frade.prolix.ejb.interfaces.UserValue uv) + throws CreateException { //setPass(uv.getPass()); |
From: <iva...@us...> - 2003-08-02 15:31:22
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/servlets In directory sc8-pr-cvs1:/tmp/cvs-serv1696/src/org/asturlinux/frade/prolix/web/servlets Modified Files: TreeServlet.java Log Message: Added xdoclet tags to generate servlet info in web.xml Index: TreeServlet.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/servlets/TreeServlet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TreeServlet.java 30 Jul 2003 20:12:49 -0000 1.2 --- TreeServlet.java 2 Aug 2003 15:31:19 -0000 1.3 *************** *** 7,10 **** --- 7,15 ---- import org.asturlinux.frade.prolix.web.servlets.SvgGenerator; + /** + * @web.servlet name="treeServlet" + * + * @web.servlet-mapping url-pattern="*.tree" + */ public class TreeServlet extends HttpServlet { *************** *** 21,25 **** PrintWriter out = response.getWriter(); SvgGenerator comeOn = new SvgGenerator(); ! //FIXME Current Result can be null out.println(comeOn.transform(bean.getCurrentResult())); --- 26,30 ---- PrintWriter out = response.getWriter(); SvgGenerator comeOn = new SvgGenerator(); ! //FIXME Current Result can be null ¿¿?? out.println(comeOn.transform(bean.getCurrentResult())); |
From: <iva...@us...> - 2003-08-01 18:22:42
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/exceptions In directory sc8-pr-cvs1:/tmp/cvs-serv10893/src/org/asturlinux/frade/prolix/exceptions Added Files: FailedLoginException.java NoLoggedUserException.java Log Message: Added EntityBean and exceptions beggining with login-users functionality --- NEW FILE: FailedLoginException.java --- /** * * Copyright 2003 Ivan Frade * * This file is part of Prolix. * * Prolix is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Prolix is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Prolix; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * **/ package org.asturlinux.frade.prolix.exceptions; public class FailedLoginException extends Exception { } --- NEW FILE: NoLoggedUserException.java --- /** * * Copyright 2003 Ivan Frade * * This file is part of Prolix. * * Prolix is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Prolix is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Prolix; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * **/ package org.asturlinux.frade.prolix.exceptions; public class NoLoggedUserException extends Exception { } |
From: <iva...@us...> - 2003-08-01 18:22:42
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/ejb/sessionjb In directory sc8-pr-cvs1:/tmp/cvs-serv10893/src/org/asturlinux/frade/prolix/ejb/sessionjb Modified Files: ProlixMainBean.java Log Message: Added EntityBean and exceptions beggining with login-users functionality Index: ProlixMainBean.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/ejb/sessionjb/ProlixMainBean.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** ProlixMainBean.java 27 Jul 2003 13:59:50 -0000 1.25 --- ProlixMainBean.java 1 Aug 2003 18:22:39 -0000 1.26 *************** *** 32,36 **** import org.asturlinux.frade.prolix.interpreter.exceptions.*; import org.asturlinux.frade.prolix.interpreter.interfaces.*; ! /** * Iteration 1: This bean manages communication between JSP <-> interpreter --- 32,37 ---- import org.asturlinux.frade.prolix.interpreter.exceptions.*; import org.asturlinux.frade.prolix.interpreter.interfaces.*; ! import org.asturlinux.frade.prolix.exceptions.*; ! import org.asturlinux.frade.prolix.ejb.interfaces.UserLocalHome; /** * Iteration 1: This bean manages communication between JSP <-> interpreter *************** *** 67,70 **** --- 68,72 ---- private boolean lastSolution = false; + /** * @ejb:interface-method *************** *** 381,384 **** --- 383,429 ---- { obtainPrologContext(); + } + + + /* *********************************** + * Login Logout methods + ********************************** **/ + + //private UserLocal user; + + /** + * @ejb:interface-method + **/ + public void login(String name, String pass) + throws FailedLoginException + { + // FIXME login code: Something like + // loggedUser = obtainUsersHome().findByPrimaryKey(new UserPK(name)); + // compare User.pass with pass + // catch FinderException + } + + /** + * @ejb:interface-method + **/ + public void logout() + throws NoLoggedUserException + { + // FIXME logout code: + // if (loggedUser == null) + // throw new NoLoggedUserException(); + // else + // loggedUser = null; + } + + /** + * Private method to retrieve entity bean factory + */ + private UserLocalHome obtainUserHome() + throws NamingException + { + InitialContext ctx = new InitialContext(); + UserLocalHome home = (UserLocalHome)ctx.lookup(UserLocalHome.JNDI_NAME); + return home; } |
From: <iva...@us...> - 2003-08-01 18:22:42
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/ejb/entityjb In directory sc8-pr-cvs1:/tmp/cvs-serv10893/src/org/asturlinux/frade/prolix/ejb/entityjb Added Files: UserBean.java Log Message: Added EntityBean and exceptions beggining with login-users functionality --- NEW FILE: UserBean.java --- /** * * Copyright 2003 Ivan Frade * * This file is part of Prolix. * * Prolix is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Prolix is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Prolix; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * **/ package org.asturlinux.frade.prolix.ejb.entityjb; import javax.ejb.*; import org.asturlinux.frade.prolix.ejb.interfaces.UserPK; /** * Entity bean to users * * @ejb.bean name="User" * type="CMP" * local-jndi-name="org/asturlinux/frade/prolix/ejb/entityjb/UserLocal" * view-type="local" * * * @ejb.value-object name="User" * match="*" */ //FIXME could be something in this way // -ejb.finder signature="java.util.Collection findByLogin(String idUser)" // unchecked="true" // query="SELECT OBJECT(p) FROM Users p WHERE p.login = ?1" public abstract class UserBean implements EntityBean { /** * @ejb.pk-field * @ejb.persistent-field * @ejb.interface-method * * @jboss.jdbc-type VARCHAR * @jboss.sql-type VARCHAR(10) * */ public abstract String getUser(); // setter not interfaz method public abstract void setUser(String idUser); /** * @ejb.persistent-field * @ejb.interface-method * * @jboss.jdbc-type VARCHAR * @jboss.sql-type VARCHAR(10) * */ public abstract String getPass(); public abstract void setPass(String newPass); /** * ??????? */ public UserPK ejbCreate(org.asturlinux.frade.prolix.ejb.interfaces.UserValue uv) { //setPass(uv.getPass()); //setUserValue(uv); return null; } public void ejbPostCreate(org.asturlinux.frade.prolix.ejb.interfaces.UserValue u) { } public abstract org.asturlinux.frade.prolix.ejb.interfaces.UserValue getUserValue(); public abstract void setUserValue(org.asturlinux.frade.prolix.ejb.interfaces.UserValue value); } |
From: <iva...@us...> - 2003-08-01 18:22:42
|
Update of /cvsroot/pfc-prolog/prolix In directory sc8-pr-cvs1:/tmp/cvs-serv10893 Modified Files: build.xml Log Message: Added EntityBean and exceptions beggining with login-users functionality Index: build.xml =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/build.xml,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** build.xml 27 Jul 2003 13:35:58 -0000 1.43 --- build.xml 1 Aug 2003 18:22:39 -0000 1.44 *************** *** 221,227 **** <homeinterface/> <localhomeinterface/> ! <!-- <entitypk/> ! <entigtybmp/> ! <entitycmp/> --> <session/> <valueobject/> --- 221,227 ---- <homeinterface/> <localhomeinterface/> ! <entitypk/> ! <!-- <entigtybmp/> --> ! <entitycmp/> <session/> <valueobject/> |
From: <iva...@us...> - 2003-08-01 18:07:45
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/servlets In directory sc8-pr-cvs1:/tmp/cvs-serv3193/src/org/asturlinux/frade/prolix/web/servlets Modified Files: SvgGenerator.java Log Message: Svg adapt rectangle size to contained text Index: SvgGenerator.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/servlets/SvgGenerator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SvgGenerator.java 30 Jul 2003 20:12:49 -0000 1.1 --- SvgGenerator.java 1 Aug 2003 18:07:41 -0000 1.2 *************** *** 4,9 **** import java.io.Writer; import java.io.IOException; - //import java.io.FileWriter; - //import java.io.FileReader; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; --- 4,7 ---- *************** *** 22,26 **** public class SvgGenerator { - /*************************** * Search methods --- 20,23 ---- *************** *** 92,99 **** public static final int marginX = 10; ! public static final int marginY = 5; public static final int nodeSizeX = 60; public static final int nodeSizeY = 40; private Dimension drawNode(Node raiz, String number, Point leftTopCorner, --- 89,98 ---- public static final int marginX = 10; ! public static final int marginY = 15; public static final int nodeSizeX = 60; public static final int nodeSizeY = 40; + public int currentNodeSizeX = nodeSizeX; + private Dimension drawNode(Node raiz, String number, Point leftTopCorner, *************** *** 106,117 **** Dimension boundingBox = new Dimension(0,0); ! int childYBaseLine = leftTopCorner.y+marginY+nodeSizeY; - //Vector childPoints = new Vector(); Vector childBoxes = new Vector(); for (int i = 0; i < result2.length ; i++) { String destiny = result2[i].getAttributes().getNamedItem("destiny").getNodeValue(); ! Point childPoint = new Point(leftTopCorner.x+ boundingBox.width, childYBaseLine); Dimension currentChildBoundingBox = drawNode(raiz,destiny,childPoint,output); --- 105,116 ---- Dimension boundingBox = new Dimension(0,0); ! int childYBaseLine = leftTopCorner.y + marginY + nodeSizeY; Vector childBoxes = new Vector(); for (int i = 0; i < result2.length ; i++) { String destiny = result2[i].getAttributes().getNamedItem("destiny").getNodeValue(); ! Point childPoint = new Point(leftTopCorner.x + boundingBox.width, ! childYBaseLine); Dimension currentChildBoundingBox = drawNode(raiz,destiny,childPoint,output); *************** *** 123,131 **** boundingBox.width = Math.max(boundingBox.width, ! nodeSizeX); boundingBox.height += nodeSizeY + marginY; System.out.println("Aqui pinto la cajita"); ! Point nodePoint = new Point(boundingBox.width / 2 + leftTopCorner.x , leftTopCorner.y ); --- 122,131 ---- boundingBox.width = Math.max(boundingBox.width, ! Math.max(nodeSizeX, currentNodeSizeX)); boundingBox.height += nodeSizeY + marginY; System.out.println("Aqui pinto la cajita"); ! Point nodePoint = new Point(boundingBox.width / 2 ! + leftTopCorner.x , leftTopCorner.y ); *************** *** 145,151 **** try { ! output.write("<path d=\"M " + (origen.x + nodeSizeX/2) + " " + (origen.y+nodeSizeY) ! + " L " + (destino.origin.x + destino.size.width/2 + nodeSizeX/2) + " " + destino.origin.y + "\" \n"); output.write("id=\"" + origen.x*origen.y + "\"\n"); --- 145,153 ---- try { ! output.write("<path d=\"M " ! + origen.x // + currentNodeSizeX / 2 + " " + (origen.y+nodeSizeY) ! + " L " ! + (destino.origin.x + destino.size.width/2) + " " + destino.origin.y + "\" \n"); output.write("id=\"" + origen.x*origen.y + "\"\n"); *************** *** 169,194 **** try { output.write("<rect \n " ! + "width=\"" + nodeSizeX + "\" \n" ! + "height=\"" + nodeSizeY + "\" \n" ! + "x=\"" + leftTopPoint.x + "\" \n" ! + "y=\"" + leftTopPoint.y + "\" \n" ! + "id=\""+node.getAttributes().getNamedItem("number").getNodeValue()+"\" \n" ! + "style=\"fill:#00ca00;fill-opacity:1;\" " ! + "/> \n"); - Node label = node.getAttributes().getNamedItem("label"); if (label != null) output.write("<text \n" ! + "x=\"" + (leftTopPoint.x + nodeSizeX/10) + "\" \n" ! + "y=\"" + (leftTopPoint.y + nodeSizeY/2 ) + "\" \n" ! + "id=\"text" + node.getAttributes().getNamedItem("number").getNodeValue() + "\">\n" ! + "<tspan id=\"" + node.getAttributes().getNamedItem("number").getNodeValue() ! + "\" >\n" + label.getNodeValue() ! + "</tspan>" + "</text>"); --- 171,205 ---- try { + Node label = node.getAttributes().getNamedItem("label"); + String text; + if (label != null) + { + text = label.getNodeValue(); + currentNodeSizeX = Math.max(text.length() * 7, nodeSizeX); + } + + output.write("<rect \n " ! + " width=\"" + currentNodeSizeX + "\" \n" ! + " height=\"" + nodeSizeY + "\" \n" ! + " x=\"" + (leftTopPoint.x - (currentNodeSizeX / 2)) + "\" \n" ! + " y=\"" + leftTopPoint.y + "\" \n" ! + " id=\""+node.getAttributes().getNamedItem("number").getNodeValue()+"\" \n" ! + " style=\"fill:#00ca00;fill-opacity:1;\" " ! + " /> \n"); ! if (label != null) output.write("<text \n" ! + " x=\"" + (leftTopPoint.x - currentNodeSizeX/2.5) + "\" \n" ! + " y=\"" + (leftTopPoint.y + nodeSizeY/2 ) + "\" \n" ! + " id=\"text" + node.getAttributes().getNamedItem("number").getNodeValue() + "\">\n" ! + " <tspan id=\"" + node.getAttributes().getNamedItem("number").getNodeValue() ! + "\" >\n " + label.getNodeValue() ! + "\n </tspan>\n" + "</text>"); *************** *** 203,209 **** ***/ ! private void initWriter(Writer w) throws IOException { w.write("<?xml version=\"1.0\" " + "encoding=\"UTF-8\" standalone=\"no\"?>\n" --- 214,221 ---- ***/ ! private String svgInit(int height, int width) throws IOException { + StringWriter w = new StringWriter(); w.write("<?xml version=\"1.0\" " + "encoding=\"UTF-8\" standalone=\"no\"?>\n" *************** *** 213,223 **** w.write("<svg xmlns=\"http://www.w3.org/2000/svg\"\n " + " xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n " ! + " version=\"1\"\n " + " x=\"30\" y=\"30\">\n "); } ! private void finishWriter(Writer w) throws IOException { ! w.write("\n</svg>\n"); } --- 225,238 ---- w.write("<svg xmlns=\"http://www.w3.org/2000/svg\"\n " + " xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n " ! + " version=\"1\"\n " ! + " x=\"30\" y=\"30\"\n " ! + " height=\"" + height + "\" width=\"" + width + "\"> \n"); ! return w.toString(); } ! private String svgEnd() throws IOException { ! return new String("\n</svg>\n"); } *************** *** 238,242 **** // Works with generic Writer. StringWriter svg = new StringWriter(); - initWriter(svg); Dimension total = drawNode(document,"1",new Point(30,30),svg); --- 253,256 ---- *************** *** 244,251 **** + total.height); ! finishWriter(svg); ! svg.close(); System.out.println("Pues no paso nada malo"); ! return svg.toString(); } catch (FactoryConfigurationError e) { --- 258,264 ---- + total.height); ! String result = svgInit(total.height, total.width).concat(svg.toString()).concat(svgEnd()); System.out.println("Pues no paso nada malo"); ! return result; } catch (FactoryConfigurationError e) { |