pfc-prolog-cvs Mailing List for pfc-prolix (Page 7)
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-16 01:10:17
|
Update of /cvsroot/pfc-prolog/prolix/etc In directory sc8-pr-cvs1:/tmp/cvs-serv24607/etc Modified Files: WebClientResources.properties Log Message: Added new funcionality - Now administrator can remove users Index: WebClientResources.properties =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/etc/WebClientResources.properties,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** WebClientResources.properties 15 Aug 2003 12:35:15 -0000 1.15 --- WebClientResources.properties 15 Aug 2003 16:58:17 -0000 1.16 *************** *** 18,21 **** --- 18,22 ---- error.failed.logout=<li>No puede hacer logout: no hay usuario logeado</li> error.registering.user=<li>No coinciden los dos password tecleados</li> + error.removing.program=<li>Error borrando usuario</li> error.no.logged.user=<li>Para realizar esta operación debe hacer login antes</li> error.storing.program=<li>Error guardando programa</li> *************** *** 26,32 **** --- 27,36 ---- error.locating.program=<li>Error en el servidor</li> error.no.data.bean=<li>Error: no hay bean para almacenar los datos</li> + error.retrieving.users=<li>Error buscando usuario/s </li> error.fatal=<li>Algo va muy mal</li> errors.footer=</ul> errors.header=<h3>Se han producido los siguientes errores</h3><ul> + button.enter=Entrar + button.exec=Ejecutar button.load=Cargar button.clear=Limpiar *************** *** 37,40 **** --- 41,45 ---- button.modify=Editar button.delete=Borrar + button.go.manage.users=Administrar usuarios message.load.other.program=Cargar otro programa message.load.other.consult=Cargar otra consulta |
From: <iva...@us...> - 2003-08-16 01:09:20
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/exceptions In directory sc8-pr-cvs1:/tmp/cvs-serv24607/src/org/asturlinux/frade/prolix/exceptions Added Files: CouldNotRemoveUserException.java CouldNotRetrieveUsersException.java Log Message: Added new funcionality - Now administrator can remove users --- NEW FILE: CouldNotRemoveUserException.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 CouldNotRemoveUserException extends Exception { } --- NEW FILE: CouldNotRetrieveUsersException.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 CouldNotRetrieveUsersException extends Exception { } |
From: <iva...@us...> - 2003-08-16 01:08:45
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions In directory sc8-pr-cvs1:/tmp/cvs-serv24607/src/org/asturlinux/frade/prolix/web/actions Added Files: ManageUsersAction.java VisitUsersAction.java Log Message: Added new funcionality - Now administrator can remove users --- NEW FILE: ManageUsersAction.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 org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionForward; import org.apache.struts.action.Action; import javax.servlet.http.HttpSession; import java.io.IOException; import java.util.Locale; import java.util.Vector; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletException; import org.asturlinux.frade.prolix.web.formbeans.ManageUsersFormBean; import org.asturlinux.frade.prolix.ejb.interfaces.AccessControl; import org.asturlinux.frade.prolix.exceptions.NotEnoughtPermissionsException; import org.asturlinux.frade.prolix.exceptions.CouldNotRemoveUserException; import org.apache.struts.util.MessageResources; import org.asturlinux.frade.prolix.exceptions.NoLoggedUserException; import org.asturlinux.frade.prolix.web.beans.UsersBean; import java.util.Collection; import org.asturlinux.frade.prolix.exceptions.CouldNotRetrieveUsersException; import java.rmi.RemoteException; /** * @struts.action name="manageUsersForm" * path="/actions/manageUsers" * scope="request" * input="/admin-users.jsp" * validate="true" * parameter="" * * @struts.action-forward name="success" * path="/admin-users.jsp" * * @struts.action-forward name="failure" * path="/admin-users.jsp" * */ public class ManageUsersAction 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 username = ((ManageUsersFormBean)form).getUsername(); try { HttpSession session = request.getSession(); delete(session,username,errors); } catch (NotEnoughtPermissionsException notAuth) { //PERMISSIONS-MESSAGE errors.add("manage", new ActionError("error.not.enought.permissions")); } catch (NoLoggedUserException noLogged) { errors.add("manage",new ActionError("error.no.logged.user")); } catch (CouldNotRetrieveUsersException cnrpe) { errors.add("manage", new ActionError("error.retrieving.program")); } catch (RemoteException re) { errors.add("manage", new ActionError("error.locating.program")); } catch (CouldNotRemoveUserException cnrue) { errors.add("manage", new ActionError("error.removing.user")); } if (!errors.isEmpty()) { saveErrors(request,errors); return (mapping.findForward("failure")); } return (mapping.findForward("success")); } private void delete(HttpSession session, String username, ActionErrors errors) throws NoLoggedUserException, CouldNotRemoveUserException, CouldNotRetrieveUsersException, NotEnoughtPermissionsException, RemoteException { AccessControl login; login = (AccessControl)session.getAttribute("interpreter"); login.removeUser(username); Collection usersNow; usersNow = login.getAllUsers(); UsersBean ub = (UsersBean)session.getAttribute("userslist"); if (ub == null) { ub = new UsersBean(); } ub.setUsers(usersNow); session.setAttribute("userslist",ub); } } --- NEW FILE: VisitUsersAction.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 org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionForward; import org.apache.struts.action.Action; import javax.servlet.http.HttpSession; import java.io.IOException; import java.util.Locale; import java.util.Vector; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletException; import org.asturlinux.frade.prolix.web.formbeans.ManageProgramsFormBean; import org.asturlinux.frade.prolix.ejb.interfaces.AccessControl; import org.asturlinux.frade.prolix.web.beans.CurrentStateBean; import org.asturlinux.frade.prolix.web.beans.LastConsultsBean; import org.asturlinux.frade.prolix.web.beans.UsersBean; import org.asturlinux.frade.prolix.exceptions.NotEnoughtPermissionsException; import org.asturlinux.frade.prolix.exceptions.CouldNotRetrieveUsersException; import org.apache.struts.util.MessageResources; import org.asturlinux.frade.prolix.exceptions.NoLoggedUserException; import org.asturlinux.frade.prolix.web.beans.LibraryBean; import java.util.Collection; import java.rmi.RemoteException; /** * @struts.action name="visitUsersForm" * path="/actions/visitUsers" * scope="request" * input="/admin.jsp" * validate="true" * parameter="" * * @struts.action-forward name="success" * path="/admin-users.jsp" * * @struts.action-forward name="failure" * path="/admin.jsp" * */ public class VisitUsersAction 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 try { HttpSession session = request.getSession(); AccessControl login; login = (AccessControl)session.getAttribute("interpreter"); Collection users = login.getAllUsers(); UsersBean ub = (UsersBean)session.getAttribute("userslist"); if (ub == null) { ub = new UsersBean(); } ub.setUsers(users); session.setAttribute("userslist",ub); } catch (NotEnoughtPermissionsException notAuth) { //PERMISSIONS-MESSAGE errors.add("manage", new ActionError("error.not.enought.permissions")); } catch (NoLoggedUserException noLogged) { errors.add("manage",new ActionError("error.no.logged.user")); } catch (CouldNotRetrieveUsersException cnrue) { errors.add("manage",new ActionError("error.retrieving.users")); } catch (RemoteException re) { errors.add("manage", new ActionError("error.locating.program")); } if (!errors.isEmpty()) { saveErrors(request,errors); return (mapping.findForward("failure")); } return (mapping.findForward("success")); } } |
From: <iva...@us...> - 2003-08-16 00:27:45
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/beans In directory sc8-pr-cvs1:/tmp/cvs-serv24607/src/org/asturlinux/frade/prolix/web/beans Added Files: UsersBean.java Log Message: Added new funcionality - Now administrator can remove users --- NEW FILE: UsersBean.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.beans; import java.util.Collection; public class UsersBean implements java.io.Serializable { private Collection users; /** * Get the Users value. * @return the Users value. */ public Collection getUsers() { return users; } /** * Set the Users value. * @param newUsers The new Users value. */ public void setUsers(Collection newUsers) { this.users = newUsers; } } |
From: <iva...@us...> - 2003-08-16 00:21:20
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/ejb/sessionjb In directory sc8-pr-cvs1:/tmp/cvs-serv24607/src/org/asturlinux/frade/prolix/ejb/sessionjb Modified Files: AccessControlBean.java Log Message: Added new funcionality - Now administrator can remove users Index: AccessControlBean.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/ejb/sessionjb/AccessControlBean.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AccessControlBean.java 14 Aug 2003 22:42:46 -0000 1.1 --- AccessControlBean.java 15 Aug 2003 16:58:17 -0000 1.2 *************** *** 27,30 **** --- 27,32 ---- import org.asturlinux.frade.prolix.exceptions.FailedLoginException; import org.asturlinux.frade.prolix.exceptions.UsernameNotAvailableException; + import org.asturlinux.frade.prolix.exceptions.CouldNotRetrieveUsersException; + import org.asturlinux.frade.prolix.exceptions.CouldNotRemoveUserException; import org.asturlinux.frade.prolix.ejb.interfaces.UserLocalHome; import org.asturlinux.frade.prolix.ejb.interfaces.StudentRoleHome; *************** *** 43,49 **** import javax.ejb.CreateException; import java.rmi.RemoteException; /** - * Iteration 1: This bean manages communication between JSP <-> interpreter * * --- 45,55 ---- import javax.ejb.CreateException; import java.rmi.RemoteException; + import java.util.Collection; + import java.util.Iterator; + import java.util.LinkedList; + import org.asturlinux.frade.prolix.ejb.interfaces.UserPK; + import javax.ejb.RemoveException; /** * * *************** *** 51,55 **** * type="Stateful" * view-type="remote" ! * jndi-name="org/asturlinux/frade/prolix/ejb/sessionjb/AccessControl" * * @ejb.ejb-ref ejb-name="ejb/AccessControl" --- 57,61 ---- * type="Stateful" * view-type="remote" ! * jndi-name="org/asturlinux/frade/prolix/ejb/sessionjb/AccessControl" * * @ejb.ejb-ref ejb-name="ejb/AccessControl" *************** *** 354,357 **** --- 360,421 ---- else return loggedUser.getPermissions(); + } + + /** + * @ejb.interface-method + */ + public Collection getAllUsers() + throws NoLoggedUserException, NotEnoughtPermissionsException, + CouldNotRetrieveUsersException + { + verifyPermissions(Permissions.Administrator); + + Collection userReferences; + try + { + userReferences = obtainUserHome().findByAll(); + } + catch (NamingException ne) + { + throw new CouldNotRetrieveUsersException(); + } + catch (FinderException fe) + { + throw new CouldNotRetrieveUsersException(); + } + + Collection result = new LinkedList(); + Iterator i = userReferences.iterator(); + while (i.hasNext()) + { + UserLocal ul = (UserLocal)i.next(); + UserValue uv = ul.getUserValue(); + result.add(uv); + } + + return result; + } + + /** + * @ejb.interface-method + */ + public void removeUser(String key) + throws NoLoggedUserException, NotEnoughtPermissionsException, + CouldNotRemoveUserException + + { + verifyPermissions(Permissions.Administrator); + try + { + obtainUserHome().remove(new UserPK(key)); + } + catch (NamingException ne) + { + throw new CouldNotRemoveUserException(); + } + catch (RemoveException re) + { + throw new CouldNotRemoveUserException(); + } } |
From: <iva...@us...> - 2003-08-16 00:13:06
|
Update of /cvsroot/pfc-prolog/prolix/web/css In directory sc8-pr-cvs1:/tmp/cvs-serv23762 Modified Files: prolix.css Log Message: Superficial look changes Index: prolix.css =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/web/css/prolix.css,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** prolix.css 27 Jul 2003 14:20:00 -0000 1.1 --- prolix.css 15 Aug 2003 16:53:37 -0000 1.2 *************** *** 1,17 **** /** - * FIXME: GPL NOTE * ! */ ! body { ! background-color: #8ec984; color: black; } h1 { ! background-color: navy; ! color: red; } --- 1,34 ---- /** * ! * 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 ! * ! **/ body { ! background-color: #9f9264; color: black; + margin: 1cm; } h1 { ! background-color: #f1d700; ! color: #7e6a27; } |
From: <iva...@us...> - 2003-08-15 22:34:41
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/ejb/entityjb In directory sc8-pr-cvs1:/tmp/cvs-serv24607/src/org/asturlinux/frade/prolix/ejb/entityjb Modified Files: UserBean.java Log Message: Added new funcionality - Now administrator can remove users Index: UserBean.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/ejb/entityjb/UserBean.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** UserBean.java 14 Aug 2003 22:39:46 -0000 1.5 --- UserBean.java 15 Aug 2003 16:58:17 -0000 1.6 *************** *** 32,36 **** * @ejb.bean name="User" * type="CMP" ! * local-jndi-name="org/asturlinux/frade/prolix/ejb/entityjb/UserLocal" * view-type="local" * --- 32,36 ---- * @ejb.bean name="User" * type="CMP" ! * local-jndi-name="org/asturlinux/frade/prolix/ejb/entityjb/UserLocal" * view-type="local" * *************** *** 51,55 **** * query="SELECT OBJECT(p) FROM User p * WHERE (p.user = ?1)" ! * */ --- 51,57 ---- * query="SELECT OBJECT(p) FROM User p * WHERE (p.user = ?1)" ! * @ejb.finder signature="java.util.Collection findByAll()" ! * unchecked="true" ! * query="SELECT OBJECT(p) FROM User p" */ |
From: <iva...@us...> - 2003-08-15 22:29:55
|
Update of /cvsroot/pfc-prolog/prolix/web In directory sc8-pr-cvs1:/tmp/cvs-serv24607/web Modified Files: admin-library.jsp admin.jsp login.jsp Added Files: admin-users.jsp Log Message: Added new funcionality - Now administrator can remove users --- NEW FILE: admin-users.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"%> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> <prolix:checkLogin requiredPermissions="administrator"/> <jsp:useBean id="prologData" scope="session" class="org.asturlinux.frade.prolix.web.beans.CurrentStateBean" /> <jsp:useBean id="oldConsults" scope="session" class="org.asturlinux.frade.prolix.web.beans.LastConsultsBean" /> <jsp:useBean id="login" scope="session" class="org.asturlinux.frade.prolix.web.beans.LoginBean"/> <!-- Obtain Home reference--> <ejb:useHome id="prolixHome" type="org.asturlinux.frade.prolix.ejb.interfaces.AccessControlHome" location="org/asturlinux/frade/prolix/ejb/sessionjb/AccessControl" /> <!-- Obtain Bean reference. If don't exist, create new one --> <ejb:useBean id="interpreter" type="org.asturlinux.frade.prolix.ejb.interfaces.AccessControl" scope="session"> <ejb:createBean instance="<%= prolixHome.create() %>" /> </ejb:useBean> <!-- Library Bean --> <jsp:useBean id="library" scope="session" class="org.asturlinux.frade.prolix.web.beans.LibraryBean" /> <!-- Users Bean --> <jsp:useBean id="userslist" scope="session" class="org.asturlinux.frade.prolix.web.beans.UsersBean" /> <% String currentlyLoggedUser = login.getLoggedUser(); %> <html> <head> <title><bean:message key="title.main"/></title> <link rel="stylesheet" href="/prolixjsp/css/prolix.css" type="text/css"/> </head> <!-- False consults to debug --> <body bgcolor="#768FDD"> <h1><bean:message key="title.library"/></h1> <html:form action="/actions/logout"> <bean:message key="message.currently.logged.user"/> <%= currentlyLoggedUser %> <html:submit><bean:message key="button.logout"/></html:submit> </html:form> <table> <tr> <td> <logic:notEmpty name="userslist" property="users"> <html:form action="/actions/manageUsers"> <logic:iterate id="iterator" name="userslist" property="users"> <tr> <table> <tr> <td> <input type=radio name="username" value="<%= ((UserValue)iterator).getUser() %>"> </td> <td> <%= ((UserValue)iterator).getUser() %> </td> </tr> </table> </tr> </logic:iterate> <html:submit><bean:message key="button.delete"/></html:submit> </html:form> </logic:notEmpty> <a href="/prolixjsp/admin.jsp"> <bean:message key="message.go.admin.page"/> </a> </td> </tr> </table> </body> </html> Index: admin-library.jsp =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/web/admin-library.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin-library.jsp 15 Aug 2003 12:35:16 -0000 1.1 --- admin-library.jsp 15 Aug 2003 16:58:18 -0000 1.2 *************** *** 109,113 **** value="delete"> <bean:message key="button.delete"/> </tr> ! <html:submit><bean:message key="button.load"/></html:submit> </html:form> </logic:notEmpty> --- 109,113 ---- value="delete"> <bean:message key="button.delete"/> </tr> ! <html:submit><bean:message key="button.exec"/></html:submit> </html:form> </logic:notEmpty> Index: admin.jsp =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/web/admin.jsp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** admin.jsp 15 Aug 2003 12:35:16 -0000 1.2 --- admin.jsp 15 Aug 2003 16:58:18 -0000 1.3 *************** *** 83,86 **** --- 83,90 ---- </html:form> + <html:form action="/actions/visitUsers"> + <html:submit><bean:message key="button.go.manage.users"/></html:submit> + </html:form> + <html:errors/> </body> Index: login.jsp =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/web/login.jsp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** login.jsp 15 Aug 2003 12:35:16 -0000 1.6 --- login.jsp 15 Aug 2003 16:58:18 -0000 1.7 *************** *** 67,76 **** <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> <br> ! <a href="/prolixjsp/registry.jsp"><bean:message key="message.registry.now"/></a> <html:errors/> --- 67,78 ---- <bean:message key="message.input.password"/> <html:password property="password"/><br> ! <html:submit><bean:message key="button.enter"/></html:submit> <html:reset> <bean:message key="button.clear"/></html:reset> </html:form> <br> ! <a href="/prolixjsp/registry.jsp"> ! <bean:message key="message.registry.now"/> ! </a> <html:errors/> |
From: <iva...@us...> - 2003-08-15 21:55:10
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions In directory sc8-pr-cvs1:/tmp/cvs-serv32607/src/org/asturlinux/frade/prolix/web/actions Modified Files: ChangePasswordAction.java Log Message: Added functionality - Now admin can change his password Index: ChangePasswordAction.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions/ChangePasswordAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ChangePasswordAction.java 14 Aug 2003 22:32:49 -0000 1.1 --- ChangePasswordAction.java 15 Aug 2003 17:46:26 -0000 1.2 *************** *** 31,34 **** --- 31,36 ---- import org.asturlinux.frade.prolix.exceptions.FailedLoginException; import org.asturlinux.frade.prolix.exceptions.UsernameNotAvailableException; + import org.asturlinux.frade.prolix.exceptions.NotEnoughtPermissionsException; + import org.asturlinux.frade.prolix.ejb.entityjb.Permissions; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; *************** *** 52,55 **** --- 54,60 ---- * path="/program.jsp" * + * @struts.action-forward name="success-admin" + * path="/admin.jsp" + * * @struts.action-forward name="failure" * path="/change-password.jsp" *************** *** 70,73 **** --- 75,79 ---- ActionErrors errors = new ActionErrors(); + boolean admin = false; // Take form bean atrributes String newPass = ((ChangePasswordFormBean)form).getNewPassword(); *************** *** 79,82 **** --- 85,90 ---- { login.changePassword(newPass); + login.verifyPermissions(Permissions.Administrator); + admin = true; } else *************** *** 87,90 **** --- 95,102 ---- errors.add("change-password",new ActionError("error.no.logged.user")); } + catch (NotEnoughtPermissionsException nepe) + { + //User is not administrator + } *************** *** 94,97 **** --- 106,113 ---- return (mapping.findForward("failure")); } + + if (admin) + return (mapping.findForward("success-admin")); + return (mapping.findForward("success")); } |
From: <iva...@us...> - 2003-08-15 21:52:53
|
Update of /cvsroot/pfc-prolog/prolix/web In directory sc8-pr-cvs1:/tmp/cvs-serv32607/web Modified Files: admin.jsp Log Message: Added functionality - Now admin can change his password Index: admin.jsp =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/web/admin.jsp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** admin.jsp 15 Aug 2003 16:58:18 -0000 1.3 --- admin.jsp 15 Aug 2003 17:46:26 -0000 1.4 *************** *** 87,90 **** --- 87,94 ---- </html:form> + <a href="/prolixjsp/change-password.jsp"> + <bean:message key="message.change.password"/> + </a> + <html:errors/> </body> |
From: <iva...@us...> - 2003-08-15 12:53:33
|
Update of /cvsroot/pfc-prolog/prolix/etc In directory sc8-pr-cvs1:/tmp/cvs-serv6515/etc Modified Files: WebClientResources.properties Log Message: Added functionality - admin user can delete programs in library Index: WebClientResources.properties =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/etc/WebClientResources.properties,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** WebClientResources.properties 14 Aug 2003 22:50:56 -0000 1.14 --- WebClientResources.properties 15 Aug 2003 12:35:15 -0000 1.15 *************** *** 58,61 **** --- 58,62 ---- message.go.login.page=Pagina de login message.currently.logged.user=Usuario: + message.go.admin.page=Pagina de administrador title.main=Prolix title.consult=Prolix Consulta |
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions In directory sc8-pr-cvs1:/tmp/cvs-serv6515/src/org/asturlinux/frade/prolix/web/actions Modified Files: LoginAction.java ManageProgramsAction.java VisitLibraryAction.java Added Files: VisitLibraryAsAdminAction.java Log Message: Added functionality - admin user can delete programs in library --- NEW FILE: VisitLibraryAsAdminAction.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.IOException; import java.util.Locale; import java.util.Vector; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionError; import org.apache.struts.action.Action; import org.asturlinux.frade.prolix.exceptions.NotEnoughtPermissionsException; import org.apache.struts.util.MessageResources; import org.asturlinux.frade.prolix.web.formbeans.LoadProgramFormBean; import javax.servlet.http.HttpSession; import org.asturlinux.frade.prolix.ejb.interfaces.AccessControl; import org.asturlinux.frade.prolix.web.beans.CurrentStateBean; import org.asturlinux.frade.prolix.web.beans.LibraryBean; import java.util.Collection; import org.asturlinux.frade.prolix.exceptions.NoLoggedUserException; import org.asturlinux.frade.prolix.exceptions.CouldNotRetrieveProgramsException; /** * @struts.action name="visitLibraryAsAdminForm" * path="/actions/visitLibraryAsAdmin" * scope="request" * input="/admin.jsp" * validate="true" * parameter="" * * @struts.action-forward name="success" * path="/admin-library.jsp" * * @struts.action-forward name="failure" * path="/admin.jsp" */ public class VisitLibraryAsAdminAction 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(); AccessControl login; login = (AccessControl)session.getAttribute("interpreter"); if (login != null) { Collection programsInLibrary; programsInLibrary = login.getLibraryManagement().retrieveAllPrograms(); LibraryBean ib = new LibraryBean(); if (ib != null) { ib.setPrograms(programsInLibrary); session.setAttribute("library",ib); } else errors.add("library", new ActionError("error.no.library.jb")); } else errors.add("library",new ActionError("error.no.interpreter")); } catch (NotEnoughtPermissionsException notAuth) { //PERMISSIONS-MESSAGE errors.add("library",new ActionError("error.not.enought.permissions")); } catch (NoLoggedUserException nlue) { errors.add("library",new ActionError("error.no.logged.user")); } catch (CouldNotRetrieveProgramsException cnrpe) { errors.add("library",new ActionError("error.retrieving.program")); } if (!errors.isEmpty()) { saveErrors(request,errors); return (mapping.findForward("failure")); } return (mapping.findForward("success")); } } Index: LoginAction.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions/LoginAction.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LoginAction.java 14 Aug 2003 22:32:49 -0000 1.3 --- LoginAction.java 15 Aug 2003 12:35:16 -0000 1.4 *************** *** 40,43 **** --- 40,44 ---- import org.asturlinux.frade.prolix.web.beans.LoginBean; import org.asturlinux.frade.prolix.exceptions.NoLoggedUserException; + import org.asturlinux.frade.prolix.exceptions.NotEnoughtPermissionsException; /** * @struts.action name="loginForm" *************** *** 51,54 **** --- 52,58 ---- * path="/program.jsp" * + * @struts.action-forward name="success-admin" + * path="/admin.jsp" + * * @struts.action-forward name="failure" * path="/login.jsp" *************** *** 72,75 **** --- 76,81 ---- String user = ((LoginFormBean)form).getUsername(); String pass = ((LoginFormBean)form).getPassword(); + + boolean administrator = false; try { *************** *** 83,90 **** --- 89,101 ---- try { lb.setPermissions(login.getLoggedUserPermissions()); + login.verifyPermissions("administrator"); + administrator = true; } catch (NoLoggedUserException nlue){ throw new FailedLoginException(); //FIXME Fatal error } + catch (NotEnoughtPermissionsException nepe) { + //Logged user dont have admin permissions + } session.setAttribute("login",lb); } *************** *** 106,109 **** --- 117,125 ---- return (mapping.findForward("failure")); } + + if (administrator) + return (mapping.findForward("success-admin")); + + return (mapping.findForward("success")); } Index: ManageProgramsAction.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions/ManageProgramsAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ManageProgramsAction.java 14 Aug 2003 22:32:49 -0000 1.1 --- ManageProgramsAction.java 15 Aug 2003 12:35:16 -0000 1.2 *************** *** 66,72 **** * path="/program.jsp" * ! * @struts.action-forward name="failure" * path="/my-library.jsp" * */ public class ManageProgramsAction extends Action --- 66,78 ---- * path="/program.jsp" * ! * @struts.action-forward name="success-admin-delete" ! * path="/admin-library.jsp" ! * ! * @struts.action-forward name="failure-user" * path="/my-library.jsp" * + * @struts.action-forward name="failure-admin" + * path="/admin-library.jsp" + * */ public class ManageProgramsAction extends Action *************** *** 87,90 **** --- 93,97 ---- String programKey = ((ManageProgramsFormBean)form).getProgramKey(); String actionToDo = ((ManageProgramsFormBean)form).getActionToDo(); + String origin = ((ManageProgramsFormBean)form).getOrigin(); try { *************** *** 126,136 **** { saveErrors(request,errors); ! return (mapping.findForward("failure")); } ! if (actionToDo.equals("delete")) ! return (mapping.findForward("success-delete")); ! else ! return (mapping.findForward("success-modify")); } --- 133,152 ---- { saveErrors(request,errors); ! if (origin.equals("my-library")) ! return (mapping.findForward("failure-user")); ! else ! return (mapping.findForward("failure-admin")); } ! ! if (origin.equals("my-library")) ! { ! if (actionToDo.equals("delete")) ! return (mapping.findForward("success-delete")); ! else ! return (mapping.findForward("success-modify")); ! } ! else //origin == admin-library ! return (mapping.findForward("success-admin-delete")); } Index: VisitLibraryAction.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions/VisitLibraryAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** VisitLibraryAction.java 14 Aug 2003 22:32:49 -0000 1.1 --- VisitLibraryAction.java 15 Aug 2003 12:35:16 -0000 1.2 *************** *** 76,82 **** try { HttpSession session = request.getSession(); ! AccessControl login = (AccessControl)session.getAttribute("interpreter"); if (login != null) { ! Collection programsInLibrary = login.getLibraryManagement().retrieveAllPrograms(); LibraryBean ib = new LibraryBean(); if (ib != null) --- 76,86 ---- try { HttpSession session = request.getSession(); ! ! AccessControl login; ! login = (AccessControl)session.getAttribute("interpreter"); ! if (login != null) { ! Collection programsInLibrary; ! programsInLibrary = login.getLibraryManagement().retrieveAllPrograms(); LibraryBean ib = new LibraryBean(); if (ib != null) |
From: <iva...@us...> - 2003-08-15 12:51:40
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/ejb/sessionjb In directory sc8-pr-cvs1:/tmp/cvs-serv6515/src/org/asturlinux/frade/prolix/ejb/sessionjb Modified Files: LibraryManagementBean.java Log Message: Added functionality - admin user can delete programs in library Index: LibraryManagementBean.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/ejb/sessionjb/LibraryManagementBean.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LibraryManagementBean.java 14 Aug 2003 22:42:46 -0000 1.1 --- LibraryManagementBean.java 15 Aug 2003 12:35:16 -0000 1.2 *************** *** 138,141 **** --- 138,142 ---- CouldNotRetrieveProgramsException { + try { *************** *** 186,192 **** */ public ProgramValue retrieveProgramByTitle(String title) ! throws CouldNotRetrieveProgramsException { ! //FIXME !!!CHECK PERMISSIONS!!! try --- 187,204 ---- */ public ProgramValue retrieveProgramByTitle(String title) ! throws CouldNotRetrieveProgramsException, ! NoLoggedUserException, NotEnoughtPermissionsException { ! try ! { ! //FIXME: check that login is not null (not required if ! // set it in postCreate() method) ! login.verifyPermissions(Permissions.Student); ! } ! catch (RemoteException re) ! { ! throw new CouldNotRetrieveProgramsException(); ! } ! try *************** *** 217,220 **** --- 229,247 ---- throws CouldNotRetrieveProgramsException, NoLoggedUserException { + + try + { + login.verifyPermissions(Permissions.Administrator); + return retrieveAllPrograms(); + } + catch (NotEnoughtPermissionsException nepe) + { + //User is not administrator. Continue normal execution + } + catch (RemoteException re) + { + throw new CouldNotRetrieveProgramsException(); + } + String userOnline; try *************** *** 269,272 **** --- 296,300 ---- // if set it in postCreate method) login.verifyPermissions(Permissions.Student); + //FIXME: verify programs owns to user obtainProgramHome().remove(new ProgramPK(programKey)); } |
From: <iva...@us...> - 2003-08-15 12:47:43
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/formbeans In directory sc8-pr-cvs1:/tmp/cvs-serv6515/src/org/asturlinux/frade/prolix/web/formbeans Modified Files: ManageProgramsFormBean.java Added Files: VisitLibraryAsAdminFormBean.java Log Message: Added functionality - admin user can delete programs in library --- NEW FILE: VisitLibraryAsAdminFormBean.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.ActionMapping; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionErrors; /** * @struts.form name="visitLibraryAsAdminForm" */ public class VisitLibraryAsAdminFormBean extends ActionForm { /** * Redefined methods */ public void reset(ActionMapping mapping, HttpServletRequest request) { } public ActionErrors validate (ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); return errors; } } Index: ManageProgramsFormBean.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/formbeans/ManageProgramsFormBean.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ManageProgramsFormBean.java 14 Aug 2003 22:36:40 -0000 1.1 --- ManageProgramsFormBean.java 15 Aug 2003 12:35:16 -0000 1.2 *************** *** 34,38 **** public class ManageProgramsFormBean extends ActionForm { ! String actionToDo; /** --- 34,38 ---- public class ManageProgramsFormBean extends ActionForm { ! private String actionToDo; /** *************** *** 53,57 **** ! String programKey; /** --- 53,57 ---- ! private String programKey; /** *************** *** 71,74 **** --- 71,94 ---- } + + private String origin; + + /** + * Get the Origin value. + * @return the Origin value. + */ + public String getOrigin() { + return origin; + } + + /** + * Set the Origin value. + * @param newOrigin The new Origin value. + */ + public void setOrigin(String newOrigin) { + this.origin = newOrigin; + } + + /** * Redefined methods |
From: <iva...@us...> - 2003-08-15 12:47:42
|
Update of /cvsroot/pfc-prolog/prolix/web In directory sc8-pr-cvs1:/tmp/cvs-serv6515/web Modified Files: admin.jsp login.jsp my-library.jsp solutions.jsp tree.jsp Added Files: admin-library.jsp Log Message: Added functionality - admin user can delete programs in library --- NEW FILE: admin-library.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"%> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> <jsp:useBean id="prologData" scope="session" class="org.asturlinux.frade.prolix.web.beans.CurrentStateBean" /> <jsp:useBean id="oldConsults" scope="session" class="org.asturlinux.frade.prolix.web.beans.LastConsultsBean" /> <jsp:useBean id="login" scope="session" class="org.asturlinux.frade.prolix.web.beans.LoginBean"/> <!-- Obtain Home reference--> <ejb:useHome id="prolixHome" type="org.asturlinux.frade.prolix.ejb.interfaces.AccessControlHome" location="org/asturlinux/frade/prolix/ejb/sessionjb/AccessControl" /> <!-- Obtain Bean reference. If don't exist, create new one --> <ejb:useBean id="interpreter" type="org.asturlinux.frade.prolix.ejb.interfaces.AccessControl" scope="session"> <ejb:createBean instance="<%= prolixHome.create() %>" /> </ejb:useBean> <!-- Library Bean --> <jsp:useBean id="library" scope="session" class="org.asturlinux.frade.prolix.web.beans.LibraryBean" /> <% String currentlyLoggedUser = login.getLoggedUser(); %> <html> <head> <title><bean:message key="title.main"/></title> <link rel="stylesheet" href="/prolixjsp/css/prolix.css" type="text/css"/> </head> <!-- False consults to debug --> <body bgcolor="#768FDD"> <h1><bean:message key="title.library"/></h1> <html:form action="/actions/logout"> <bean:message key="message.currently.logged.user"/> <%= currentlyLoggedUser %> <html:submit><bean:message key="button.logout"/></html:submit> </html:form> <table> <tr> <td> <logic:notEmpty name="library" property="programs"> <html:form action="/actions/managePrograms"> <logic:iterate id="iterator" name="library" property="programs"> <tr> <table> <tr> <td> <input type=radio name="programKey" value="<%= ((ProgramValue)iterator).getTitle() %>"> </td> <td> <%= ((ProgramValue)iterator).getTitle() %> </td> <td> <%= ((ProgramValue)iterator).getDescription() %> </td> </tr> </table> </tr> </logic:iterate> <html:hidden property="origin" value="admin-library"/> <bean:message key="message.actions.with.programs"/> <tr> <input type=radio name="actionToDo" value="delete"> <bean:message key="button.delete"/> </tr> <html:submit><bean:message key="button.load"/></html:submit> </html:form> </logic:notEmpty> <a href="/prolixjsp/admin.jsp"> <bean:message key="message.go.admin.page"/> </a> </td> </tr> </table> </body> </html> Index: admin.jsp =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/web/admin.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** admin.jsp 14 Aug 2003 22:04:03 -0000 1.1 --- admin.jsp 15 Aug 2003 12:35:16 -0000 1.2 *************** *** 79,82 **** --- 79,86 ---- </html:form> + <html:form action="/actions/visitLibraryAsAdmin"> + <html:submit><bean:message key="button.go.library"/></html:submit> + </html:form> + <html:errors/> </body> Index: login.jsp =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/web/login.jsp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** login.jsp 14 Aug 2003 22:04:03 -0000 1.5 --- login.jsp 15 Aug 2003 12:35:16 -0000 1.6 *************** *** 73,77 **** <br> <a href="/prolixjsp/registry.jsp"><bean:message key="message.registry.now"/></a> ! <a href="/prolixjsp/admin.jsp"><bean:message key="message.registry.professor"/></a> <html:errors/> </body> --- 73,77 ---- <br> <a href="/prolixjsp/registry.jsp"><bean:message key="message.registry.now"/></a> ! <html:errors/> </body> Index: my-library.jsp =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/web/my-library.jsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** my-library.jsp 14 Aug 2003 22:04:03 -0000 1.1 --- my-library.jsp 15 Aug 2003 12:35:16 -0000 1.2 *************** *** 111,114 **** --- 111,115 ---- </tr> <html:submit><bean:message key="button.load"/></html:submit> + <html:hidden property="origin" value="my-library" /> </html:form> </logic:notEmpty> Index: solutions.jsp =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/web/solutions.jsp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** solutions.jsp 14 Aug 2003 22:04:03 -0000 1.17 --- solutions.jsp 15 Aug 2003 12:35:16 -0000 1.18 *************** *** 36,39 **** --- 36,40 ---- <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> + <%@ taglib uri="/WEB-INF/checkLogin.tld" prefix="prolix"%> *************** *** 61,64 **** --- 62,68 ---- String currentlyLoggedUser = login.getLoggedUser(); %> + + <prolix:checkLogin requiredPermissions="student"/> + <html> <head> Index: tree.jsp =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/web/tree.jsp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tree.jsp 14 Aug 2003 22:04:03 -0000 1.4 --- tree.jsp 15 Aug 2003 12:35:16 -0000 1.5 *************** *** 35,38 **** --- 35,39 ---- <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> + <%@ taglib uri="/WEB-INF/checkLogin.tld" prefix="prolix"%> <jsp:useBean id="prologData" scope="session" *************** *** 55,58 **** --- 56,61 ---- <% String currentlyLoggedUser = login.getLoggedUser(); %> + + <prolix:checkLogin requiredPermissions="student"/> <html> |
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/exceptions In directory sc8-pr-cvs1:/tmp/cvs-serv18866 Added Files: CouldNotRemoveProgramException.java CouldNotRetrieveProgramsException.java CouldNotStoreProgramException.java UsernameNotAvailableException.java Log Message: Added new required exceptions --- NEW FILE: CouldNotRemoveProgramException.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 CouldNotRemoveProgramException extends Exception { } --- NEW FILE: CouldNotRetrieveProgramsException.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 CouldNotRetrieveProgramsException extends Exception { } --- NEW FILE: CouldNotStoreProgramException.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 CouldNotStoreProgramException extends Exception { } --- NEW FILE: UsernameNotAvailableException.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 UsernameNotAvailableException extends Exception { } |
From: <iva...@us...> - 2003-08-14 23:44:55
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/tags In directory sc8-pr-cvs1:/tmp/cvs-serv27142/tags Log Message: Directory /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/tags added to the repository |
From: <iva...@us...> - 2003-08-14 23:35:42
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/tags In directory sc8-pr-cvs1:/tmp/cvs-serv27264/tags Added Files: CheckLoginTag.java Log Message: Added tag to check login in web pages --- NEW FILE: CheckLoginTag.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.tags; import javax.servlet.jsp.tagext.TagSupport; import javax.servlet.jsp.JspTagException; import org.asturlinux.frade.prolix.web.beans.LoginBean; import javax.servlet.jsp.JspWriter; import java.io.IOException; import javax.servlet.http.HttpSession; import javax.servlet.ServletException; import javax.servlet.jsp.JspException; public class CheckLoginTag extends TagSupport { static final String loginBeanName = "login"; private String _required; /** * Inherited methods */ public int doStartTag() throws JspTagException { return SKIP_BODY; } public void setRequiredPermissions(String required) { _required = required; } public int doEndTag() throws JspTagException { if (haveEnoughtPermissions()) return EVAL_PAGE; else { try { pageContext.forward("login.jsp"); } catch (ServletException se) { error(); return SKIP_BODY; } catch (IOException se) { error(); return SKIP_BODY; } return SKIP_PAGE; } } private boolean haveEnoughtPermissions() { HttpSession session = pageContext.getSession(); LoginBean lb = (LoginBean)session.getAttribute(loginBeanName); if ((_required == null) || (lb == null)) return false; String myPermissions = lb.getPermissions(); if ((myPermissions == null) || (myPermissions.indexOf(_required) == -1)) return false; return true; } private void error() throws JspTagException { try { JspWriter out = pageContext.getOut(); out.println("<html><body>"); out.println("Error redirecting to login page"); out.println("try: <a href=\"/prolixjsp/login.jsp\"> "); out.println(" Login page "); out.println("</a>"); out.println("</body></html>"); } catch (IOException io) { throw new JspTagException(); } } } |
From: <iva...@us...> - 2003-08-14 23:32:47
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/beans In directory sc8-pr-cvs1:/tmp/cvs-serv21099 Modified Files: CurrentStateBean.java LastConsultsBean.java Log Message: Updated beans Index: CurrentStateBean.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/beans/CurrentStateBean.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CurrentStateBean.java 17 Jul 2003 17:55:17 -0000 1.5 --- CurrentStateBean.java 14 Aug 2003 22:27:25 -0000 1.6 *************** *** 54,57 **** --- 54,59 ---- */ public String getCurrentProgram() { + if (program == null) + return new String(""); return this.program; } Index: LastConsultsBean.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/beans/LastConsultsBean.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LastConsultsBean.java 17 Jul 2003 17:55:17 -0000 1.2 --- LastConsultsBean.java 14 Aug 2003 22:27:25 -0000 1.3 *************** *** 22,26 **** package org.asturlinux.frade.prolix.web.beans; ! import java.util.*; --- 22,27 ---- package org.asturlinux.frade.prolix.web.beans; ! import java.util.Vector; ! *************** *** 44,49 **** this.lastConsults = newLastConsults; } - - - } --- 45,47 ---- |
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/dummy In directory sc8-pr-cvs1:/tmp/cvs-serv24241 Modified Files: PrologContextDummy.java PrologInterpreterDummy.java SubstitutionDummy.java TreeElementDummy.java Log Message: Fixed imports - now import only concrete classes Index: PrologContextDummy.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/dummy/PrologContextDummy.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PrologContextDummy.java 27 Jul 2003 13:40:15 -0000 1.3 --- PrologContextDummy.java 14 Aug 2003 22:49:21 -0000 1.4 *************** *** 23,28 **** package org.asturlinux.frade.dummy; ! import org.asturlinux.frade.prolix.interpreter.exceptions.*; ! import org.asturlinux.frade.prolix.interpreter.interfaces.*; --- 23,37 ---- package org.asturlinux.frade.dummy; ! import org.asturlinux.frade.prolix.interpreter.interfaces.PrologContext; ! import org.asturlinux.frade.prolix.interpreter.exceptions.SyntaxException; ! import org.asturlinux.frade.prolix.interpreter.exceptions.LexicalException; ! import org.asturlinux.frade.prolix.interpreter.exceptions.ProgramAlreadyLoadedException; ! import org.asturlinux.frade.prolix.interpreter.exceptions.ProgramNotLoadedException; ! import org.asturlinux.frade.prolix.interpreter.exceptions.QueryNotLoadedException; ! import org.asturlinux.frade.dummy.TreeElementDummy; ! import org.asturlinux.frade.prolix.interpreter.interfaces.Substitution; ! import org.asturlinux.frade.prolix.interpreter.interfaces.TreeElement; ! ! Index: PrologInterpreterDummy.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/dummy/PrologInterpreterDummy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PrologInterpreterDummy.java 13 Jul 2003 20:46:25 -0000 1.1 --- PrologInterpreterDummy.java 14 Aug 2003 22:49:21 -0000 1.2 *************** *** 21,26 **** **/ package org.asturlinux.frade.dummy; ! import org.asturlinux.frade.prolix.interpreter.interfaces.*; ! import org.asturlinux.frade.prolix.interpreter.exceptions.*; public class PrologInterpreterDummy implements PrologInterpreter --- 21,31 ---- **/ package org.asturlinux.frade.dummy; ! ! import org.asturlinux.frade.prolix.interpreter.interfaces.PrologInterpreter; ! import org.asturlinux.frade.prolix.interpreter.interfaces.PrologContext; ! import org.asturlinux.frade.prolix.interpreter.exceptions.CreateException; ! ! ! public class PrologInterpreterDummy implements PrologInterpreter Index: SubstitutionDummy.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/dummy/SubstitutionDummy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SubstitutionDummy.java 13 Jul 2003 20:46:25 -0000 1.1 --- SubstitutionDummy.java 14 Aug 2003 22:49:21 -0000 1.2 *************** *** 21,26 **** **/ package org.asturlinux.frade.dummy; ! import org.asturlinux.frade.prolix.interpreter.interfaces.*; ! import org.asturlinux.frade.prolix.interpreter.exceptions.*; public class SubstitutionDummy implements Substitution --- 21,28 ---- **/ package org.asturlinux.frade.dummy; ! ! import org.asturlinux.frade.prolix.interpreter.interfaces.Substitution; ! ! public class SubstitutionDummy implements Substitution Index: TreeElementDummy.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/dummy/TreeElementDummy.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TreeElementDummy.java 19 Jul 2003 19:37:51 -0000 1.2 --- TreeElementDummy.java 14 Aug 2003 22:49:21 -0000 1.3 *************** *** 22,27 **** package org.asturlinux.frade.dummy; ! import org.asturlinux.frade.prolix.interpreter.interfaces.*; ! import org.asturlinux.frade.prolix.interpreter.exceptions.*; public class TreeElementDummy --- 22,30 ---- package org.asturlinux.frade.dummy; ! ! import org.asturlinux.frade.prolix.interpreter.interfaces.TreeElementImpl; ! import org.asturlinux.frade.prolix.interpreter.interfaces.TreeElement; ! import org.asturlinux.frade.prolix.interpreter.interfaces.Substitution; ! public class TreeElementDummy |
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions In directory sc8-pr-cvs1:/tmp/cvs-serv21767 Modified Files: LoadConsultAction.java LoadProgramAction.java LoginAction.java LogoutAction.java ResetProgramAction.java SolutionAction.java StepAction.java Added Files: AddProgramAction.java ChangePasswordAction.java CreateProfessorAction.java LoadFromLibraryAction.java LoadMyProgramsAction.java ManageProgramsAction.java RegistryAction.java VisitLibraryAction.java Log Message: Added new actions and updated exitent to new functionalities --- NEW FILE: AddProgramAction.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.IOException; import java.util.Locale; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionError; import org.apache.struts.action.Action; import org.asturlinux.frade.prolix.exceptions.NotEnoughtPermissionsException; import org.apache.struts.util.MessageResources; import org.asturlinux.frade.prolix.web.formbeans.AddProgramFormBean; import javax.servlet.http.HttpSession; import org.asturlinux.frade.prolix.ejb.interfaces.AccessControl; import org.asturlinux.frade.prolix.web.beans.CurrentStateBean; import org.asturlinux.frade.prolix.exceptions.NoLoggedUserException; import org.asturlinux.frade.prolix.exceptions.CouldNotStoreProgramException; /** * @struts.action name="addProgramForm" * path="/actions/addProgram" * scope="request" * input="/consult.jsp" * validate="true" * parameter="" * * @struts.action-forward name="success" * path="/consult.jsp" * * @struts.action-forward name="failure" * path="/consult.jsp" */ public class AddProgramAction 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(); String title = ((AddProgramFormBean)form).getTitle(); String description = ((AddProgramFormBean)form).getDescription(); try { HttpSession session = request.getSession(); AccessControl login = (AccessControl)session.getAttribute("interpreter"); CurrentStateBean ib = (CurrentStateBean)session.getAttribute("prologData"); if (login != null) { if (ib != null) { String program = ib.getCurrentProgram(); login.getLibraryManagement().addProgram(title, program, description); } else errors.add("addprogram", new ActionError("error.program.not.loaded")); } else errors.add("addprogram",new ActionError("error.no.interpreter")); } catch (NotEnoughtPermissionsException notAuth) { //PERMISSIONS-MESSAGE errors.add("addprogram", new ActionError("error.not.enought.permissions")); } catch (NoLoggedUserException notLog) { errors.add("addprogram", new ActionError("error.no.loged.user")); } catch (CouldNotStoreProgramException cnspe) { errors.add("addprogram", new ActionError("error.storing.program")); } if (!errors.isEmpty()) { saveErrors(request,errors); return (mapping.findForward("failure")); } return (mapping.findForward("success")); } } --- NEW FILE: ChangePasswordAction.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 javax.naming.NamingException; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionError; import org.apache.struts.action.Action; import org.asturlinux.frade.prolix.exceptions.FailedLoginException; import org.asturlinux.frade.prolix.exceptions.UsernameNotAvailableException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletException; import java.io.IOException; import java.util.Locale; import org.apache.struts.util.MessageResources; import org.asturlinux.frade.prolix.web.formbeans.ChangePasswordFormBean; import javax.servlet.http.HttpSession; import org.asturlinux.frade.prolix.ejb.interfaces.AccessControl; import org.asturlinux.frade.prolix.exceptions.NoLoggedUserException; /** * @struts.action name="changePasswordForm" * path="/actions/changePassword" * scope="request" * input="/change-password.jsp" * validate="true" * parameter="" * * @struts.action-forward name="success" * path="/program.jsp" * * @struts.action-forward name="failure" * path="/change-password.jsp" */ public class ChangePasswordAction 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 newPass = ((ChangePasswordFormBean)form).getNewPassword(); try { HttpSession session = request.getSession(); AccessControl login = (AccessControl)session.getAttribute("interpreter"); if (login != null) { login.changePassword(newPass); } else errors.add("change-password",new ActionError("error.no.interpreter")); //FIXME Message error } catch (NoLoggedUserException ne) { errors.add("change-password",new ActionError("error.no.logged.user")); } if (!errors.isEmpty()) { saveErrors(request,errors); return (mapping.findForward("failure")); } return (mapping.findForward("success")); } } --- NEW FILE: CreateProfessorAction.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 javax.naming.NamingException; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionError; import org.apache.struts.action.Action; import org.asturlinux.frade.prolix.exceptions.FailedLoginException; import org.asturlinux.frade.prolix.exceptions.UsernameNotAvailableException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletException; import java.io.IOException; import java.util.Locale; import org.apache.struts.util.MessageResources; import org.asturlinux.frade.prolix.web.formbeans.RegistryFormBean; import javax.servlet.http.HttpSession; import org.asturlinux.frade.prolix.ejb.interfaces.AccessControl; import org.asturlinux.frade.prolix.exceptions.NotEnoughtPermissionsException; import org.asturlinux.frade.prolix.web.formbeans.CreateProfessorFormBean; import org.asturlinux.frade.prolix.exceptions.NoLoggedUserException; /** * @struts.action name="createProfessorForm" * path="/actions/createProfessor" * scope="request" * input="/admin.jsp" * validate="true" * parameter="" * * @struts.action-forward name="success" * path="/login.jsp" * * @struts.action-forward name="failure" * path="/admin.jsp" */ public class CreateProfessorAction 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 = ((CreateProfessorFormBean)form).getUsername(); String pass = ((CreateProfessorFormBean)form).getPassword(); try { HttpSession session = request.getSession(); AccessControl login = (AccessControl)session.getAttribute("interpreter"); if (login != null) { login.createProfessor(user,pass); } else errors.add("registryProfessor",new ActionError("error.no.interpreter")); //FIXME Message error } catch (NamingException ne) { errors.add("registryProfessor",new ActionError("error.registering.user")); } catch (javax.ejb.CreateException ejbCe) { errors.add("registryProfessor",new ActionError("error.registering.user")); } catch (UsernameNotAvailableException una) { errors.add("registryProfessor",new ActionError("error.username.registered")); } catch (NotEnoughtPermissionsException nep) { errors.add("registryProfessor",new ActionError("error.not.enought.permissions")); } catch (NoLoggedUserException nlu) { errors.add("registryProfessor",new ActionError("error.no.logged.user")); } if (!errors.isEmpty()) { saveErrors(request,errors); return (mapping.findForward("failure")); } return (mapping.findForward("success")); } } --- NEW FILE: LoadFromLibraryAction.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 org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionForward; import org.apache.struts.action.Action; import org.asturlinux.frade.prolix.exceptions.NotEnoughtPermissionsException; import javax.servlet.http.HttpSession; import java.io.IOException; import java.util.Locale; import java.util.Vector; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletException; import org.asturlinux.frade.prolix.web.formbeans.LoadFromLibraryFormBean; import org.asturlinux.frade.prolix.ejb.interfaces.AccessControl; import org.asturlinux.frade.prolix.web.beans.CurrentStateBean; import org.asturlinux.frade.prolix.web.beans.LastConsultsBean; import org.asturlinux.frade.prolix.interpreter.exceptions.SyntaxException; import org.asturlinux.frade.prolix.interpreter.exceptions.LexicalException; import org.asturlinux.frade.prolix.interpreter.exceptions.ProgramNotLoadedException; import org.apache.struts.util.MessageResources; import org.asturlinux.frade.prolix.exceptions.NoLoggedUserException; import org.asturlinux.frade.prolix.ejb.interfaces.ProgramValue; import org.asturlinux.frade.prolix.exceptions.CouldNotRetrieveProgramsException; /** * @struts.action name="loadFromLibraryForm" * path="/actions/loadFromLibrary" * scope="request" * input="/library.jsp" * validate="true" * parameter="" * * @struts.action-forward name="success" * path="/consult.jsp" * * @struts.action-forward name="failure" * path="/library.jsp" */ public class LoadFromLibraryAction 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 programKey = ((LoadFromLibraryFormBean)form).getProgramKey(); try { HttpSession session = request.getSession(); AccessControl login; login = (AccessControl)session.getAttribute("interpreter"); ProgramValue pv; pv = login.getLibraryManagement().retrieveProgramByTitle(programKey); login.getStudentRole().loadProgram(pv.getSource()); // Save in session current loaded program CurrentStateBean state; state = (CurrentStateBean)session.getAttribute("prologData"); if (state != null) { state.setCurrentProgram(pv.getSource()); } } catch (SyntaxException se) { errors.add("fromLibrary", new ActionError("error.syntax.exception")); } catch (LexicalException le) { errors.add("fromLibrary", new ActionError("error.lexical.exception")); } catch (NotEnoughtPermissionsException notAuth) { //PERMISSIONS-MESSAGE errors.add("fromLibrary", new ActionError("error.not.enought.permissions")); } catch (NoLoggedUserException noLogged) { errors.add("fromLibrary", new ActionError("error.no.logged.user")); } catch (CouldNotRetrieveProgramsException cnrpe) { errors.add("fromLibrary", new ActionError("error.retrieving.program")); } if (!errors.isEmpty()) { saveErrors(request,errors); return (mapping.findForward("success")); } return (mapping.findForward("success")); } } --- NEW FILE: LoadMyProgramsAction.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 org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionForward; import org.apache.struts.action.Action; import org.asturlinux.frade.prolix.exceptions.NotEnoughtPermissionsException; import javax.servlet.http.HttpSession; import java.io.IOException; import java.util.Locale; import java.util.Vector; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletException; import org.asturlinux.frade.prolix.web.formbeans.LoadMyProgramsFormBean; import org.asturlinux.frade.prolix.ejb.interfaces.AccessControl; import org.asturlinux.frade.prolix.web.beans.CurrentStateBean; import org.asturlinux.frade.prolix.web.beans.LastConsultsBean; import org.asturlinux.frade.prolix.web.beans.LibraryBean; import org.apache.struts.util.MessageResources; import org.asturlinux.frade.prolix.exceptions.NoLoggedUserException; import org.asturlinux.frade.prolix.exceptions.CouldNotRetrieveProgramsException; import java.util.Collection; /** * @struts.action name="loadMyProgramsForm" * path="/actions/loadMyPrograms" * scope="request" * input="/library.jsp" * validate="true" * parameter="" * * @struts.action-forward name="success" * path="/my-library.jsp" * * @struts.action-forward name="failure" * path="/library.jsp" */ public class LoadMyProgramsAction 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(); AccessControl login; login = (AccessControl)session.getAttribute("interpreter"); Collection myPrograms; myPrograms = login.getLibraryManagement().retrieveUserPrograms(); LibraryBean ib = (LibraryBean)session.getAttribute("library"); if (ib != null) { ib.setPrograms(myPrograms); session.setAttribute("library",ib); } else errors.add("myLibrary", new ActionError("error.no.library.jb")); } catch (NoLoggedUserException noLogged) { errors.add("myLibrary", new ActionError("error.no.logged.user")); } catch (CouldNotRetrieveProgramsException cnrpe) { errors.add("myLibrary", new ActionError("error.retrieving.program")); } if (!errors.isEmpty()) { saveErrors(request,errors); return (mapping.findForward("failure")); } return (mapping.findForward("success")); } } --- NEW FILE: ManageProgramsAction.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 org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionForward; import org.apache.struts.action.Action; import javax.servlet.http.HttpSession; import java.io.IOException; import java.util.Locale; import java.util.Vector; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletException; import org.asturlinux.frade.prolix.web.formbeans.ManageProgramsFormBean; import org.asturlinux.frade.prolix.ejb.interfaces.AccessControl; import org.asturlinux.frade.prolix.web.beans.CurrentStateBean; import org.asturlinux.frade.prolix.web.beans.LastConsultsBean; import org.asturlinux.frade.prolix.interpreter.exceptions.SyntaxException; import org.asturlinux.frade.prolix.interpreter.exceptions.LexicalException; import org.asturlinux.frade.prolix.interpreter.exceptions.ProgramNotLoadedException; import org.asturlinux.frade.prolix.exceptions.NotEnoughtPermissionsException; import org.asturlinux.frade.prolix.exceptions.CouldNotRemoveProgramException; import org.apache.struts.util.MessageResources; import org.asturlinux.frade.prolix.exceptions.NoLoggedUserException; import org.asturlinux.frade.prolix.web.beans.LibraryBean; import java.util.Collection; import org.asturlinux.frade.prolix.exceptions.CouldNotRetrieveProgramsException; import java.rmi.RemoteException; import org.asturlinux.frade.prolix.ejb.interfaces.ProgramValue; /** * @struts.action name="manageProgramsForm" * path="/actions/managePrograms" * scope="request" * input="/my-library.jsp" * validate="true" * parameter="" * * @struts.action-forward name="success-delete" * path="/my-library.jsp" * * @struts.action-forward name="success-modify" * path="/program.jsp" * * @struts.action-forward name="failure" * path="/my-library.jsp" * */ public class ManageProgramsAction 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 programKey = ((ManageProgramsFormBean)form).getProgramKey(); String actionToDo = ((ManageProgramsFormBean)form).getActionToDo(); try { HttpSession session = request.getSession(); if (actionToDo.equals("delete")) delete(session,programKey,errors); else { if (actionToDo.equals("modify")) modify(session,programKey,errors); } } catch (NotEnoughtPermissionsException notAuth) { //PERMISSIONS-MESSAGE errors.add("manage", new ActionError("error.not.enought.permissions")); } catch (NoLoggedUserException noLogged) { errors.add("manage",new ActionError("error.no.logged.user")); } catch (CouldNotRemoveProgramException noRemove) { errors.add("manage",new ActionError("error.removing.program")); } catch (CouldNotRetrieveProgramsException cnrpe) { errors.add("manage", new ActionError("error.retrieving.program")); } catch (RemoteException re) { errors.add("manage", new ActionError("error.locating.program")); } if (!errors.isEmpty()) { saveErrors(request,errors); return (mapping.findForward("failure")); } if (actionToDo.equals("delete")) return (mapping.findForward("success-delete")); else return (mapping.findForward("success-modify")); } private void delete(HttpSession session, String programKey, ActionErrors errors) throws NoLoggedUserException, CouldNotRetrieveProgramsException, CouldNotRemoveProgramException, NotEnoughtPermissionsException, RemoteException { AccessControl login; login = (AccessControl)session.getAttribute("interpreter"); login.getLibraryManagement().removeProgram(programKey); Collection myPrograms; myPrograms = login.getLibraryManagement().retrieveUserPrograms(); LibraryBean ib = (LibraryBean)session.getAttribute("library"); if (ib != null) { ib.setPrograms(myPrograms); session.setAttribute("library",ib); } else errors.add("myLibrary", new ActionError("error.no.library.jb")); } private void modify(HttpSession session, String programKey, ActionErrors errors) throws NoLoggedUserException, CouldNotRetrieveProgramsException, NotEnoughtPermissionsException, RemoteException { AccessControl login; login = (AccessControl)session.getAttribute("interpreter"); ProgramValue pv; pv = login.getLibraryManagement().retrieveProgramByTitle(programKey); CurrentStateBean cb; cb = (CurrentStateBean)session.getAttribute("prologData"); if (cb != null) cb.setCurrentProgram(pv.getSource()); else errors.add("myLibrary", new ActionError("error.no.data.bean")); } } --- NEW FILE: RegistryAction.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 javax.naming.NamingException; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionError; import org.apache.struts.action.Action; import org.asturlinux.frade.prolix.exceptions.FailedLoginException; import org.asturlinux.frade.prolix.exceptions.UsernameNotAvailableException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletException; import java.io.IOException; import java.util.Locale; import org.apache.struts.util.MessageResources; import org.asturlinux.frade.prolix.web.formbeans.RegistryFormBean; import javax.servlet.http.HttpSession; import org.asturlinux.frade.prolix.ejb.interfaces.AccessControl; import org.asturlinux.frade.prolix.web.beans.LoginBean; import org.asturlinux.frade.prolix.exceptions.NoLoggedUserException; /** * @struts.action name="registryForm" * path="/actions/registry" * scope="request" * input="/registry.jsp" * validate="true" * parameter="" * * @struts.action-forward name="success" * path="/program.jsp" * * @struts.action-forward name="failure" * path="/registry.jsp" */ public class RegistryAction 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 = ((RegistryFormBean)form).getUsername(); String pass = ((RegistryFormBean)form).getPassword(); try { HttpSession session = request.getSession(); AccessControl login = (AccessControl)session.getAttribute("interpreter"); if (login != null) { login.signup(user,pass); LoginBean lb = new LoginBean(); lb.setLoggedUser(user); try { lb.setPermissions(login.getLoggedUserPermissions()); session.setAttribute("login",lb); } catch (NoLoggedUserException nlue) { errors.add("registry", new ActionError("error.fatal")); } } else errors.add("registry",new ActionError("error.no.interpreter")); //FIXME Message error } catch (NamingException ne) { errors.add("registry",new ActionError("error.registering.user")); } catch (javax.ejb.CreateException ejbCe) { errors.add("registry",new ActionError("error.registering.user")); } catch (UsernameNotAvailableException una) { errors.add("registry",new ActionError("error.username.registered")); } if (!errors.isEmpty()) { saveErrors(request,errors); return (mapping.findForward("failure")); } return (mapping.findForward("success")); } } --- NEW FILE: VisitLibraryAction.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.IOException; import java.util.Locale; import java.util.Vector; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionError; import org.apache.struts.action.Action; import org.asturlinux.frade.prolix.exceptions.NotEnoughtPermissionsException; import org.apache.struts.util.MessageResources; import org.asturlinux.frade.prolix.web.formbeans.LoadProgramFormBean; import javax.servlet.http.HttpSession; import org.asturlinux.frade.prolix.ejb.interfaces.AccessControl; import org.asturlinux.frade.prolix.web.beans.CurrentStateBean; import org.asturlinux.frade.prolix.web.beans.LibraryBean; import java.util.Collection; import org.asturlinux.frade.prolix.exceptions.NoLoggedUserException; import org.asturlinux.frade.prolix.exceptions.CouldNotRetrieveProgramsException; /** * @struts.action name="visitLibraryForm" * path="/actions/visitLibrary" * scope="request" * input="/program.jsp" * validate="true" * parameter="" * * @struts.action-forward name="success" * path="/library.jsp" * * @struts.action-forward name="failure" * path="/program.jsp" */ public class VisitLibraryAction 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(); AccessControl login = (AccessControl)session.getAttribute("interpreter"); if (login != null) { Collection programsInLibrary = login.getLibraryManagement().retrieveAllPrograms(); LibraryBean ib = new LibraryBean(); if (ib != null) { ib.setPrograms(programsInLibrary); session.setAttribute("library",ib); } else errors.add("library", new ActionError("error.no.library.jb")); } else errors.add("library",new ActionError("error.no.interpreter")); } catch (NotEnoughtPermissionsException notAuth) { //PERMISSIONS-MESSAGE errors.add("library",new ActionError("error.not.enought.permissions")); } catch (NoLoggedUserException nlue) { errors.add("library",new ActionError("error.no.logged.user")); } catch (CouldNotRetrieveProgramsException cnrpe) { errors.add("library",new ActionError("error.retrieving.program")); } if (!errors.isEmpty()) { saveErrors(request,errors); return (mapping.findForward("failure")); } return (mapping.findForward("success")); } } Index: LoadConsultAction.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions/LoadConsultAction.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** LoadConsultAction.java 6 Aug 2003 21:33:11 -0000 1.13 --- LoadConsultAction.java 14 Aug 2003 22:32:49 -0000 1.14 *************** *** 22,30 **** 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.ActionMapping; import org.apache.struts.action.ActionForm; --- 22,25 ---- *************** *** 33,42 **** import org.apache.struts.action.ActionForward; import org.apache.struts.action.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.NotEnoughtPermissionsException; /** * @struts.action name="loadConsultForm" --- 28,49 ---- import org.apache.struts.action.ActionForward; import org.apache.struts.action.Action; import org.asturlinux.frade.prolix.exceptions.NotEnoughtPermissionsException; + import javax.servlet.http.HttpSession; + import java.io.IOException; + import java.util.Locale; + import java.util.Vector; + import javax.servlet.http.HttpServletRequest; + import javax.servlet.http.HttpServletResponse; + import javax.servlet.ServletException; + import org.asturlinux.frade.prolix.web.formbeans.LoadConsultFormBean; + import org.asturlinux.frade.prolix.ejb.interfaces.AccessControl; + import org.asturlinux.frade.prolix.web.beans.CurrentStateBean; + import org.asturlinux.frade.prolix.web.beans.LastConsultsBean; + import org.asturlinux.frade.prolix.interpreter.exceptions.SyntaxException; + import org.asturlinux.frade.prolix.interpreter.exceptions.LexicalException; + import org.asturlinux.frade.prolix.interpreter.exceptions.ProgramNotLoadedException; + import org.apache.struts.util.MessageResources; + import org.asturlinux.frade.prolix.exceptions.NoLoggedUserException; + /** * @struts.action name="loadConsultForm" *************** *** 75,79 **** try { HttpSession session = request.getSession(); ! CommonUseCase login = (CommonUseCase)session.getAttribute("interpreter"); login.getStudentRole().loadConsult(consult); --- 82,86 ---- try { HttpSession session = request.getSession(); ! AccessControl login = (AccessControl)session.getAttribute("interpreter"); login.getStudentRole().loadConsult(consult); *************** *** 119,122 **** --- 126,133 ---- //PERMISSIONS-MESSAGE errors.add("consult",new ActionError("error.not.enought.permissions")); + } + catch (NoLoggedUserException noLogged) + { + errors.add("consult",new ActionError("error.no.logged.user")); } Index: LoadProgramAction.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions/LoadProgramAction.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** LoadProgramAction.java 6 Aug 2003 21:33:11 -0000 1.13 --- LoadProgramAction.java 14 Aug 2003 22:32:49 -0000 1.14 *************** *** 22,30 **** 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.ActionMapping; import org.apache.struts.action.ActionForm; --- 22,31 ---- package org.asturlinux.frade.prolix.web.actions; ! import java.io.IOException; ! import java.util.Locale; ! import java.util.Vector; ! import javax.servlet.ServletException; ! import javax.servlet.http.HttpServletRequest; ! import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForm; *************** *** 33,42 **** import org.apache.struts.action.ActionError; import org.apache.struts.action.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.NotEnoughtPermissionsException; /** --- 34,46 ---- import org.apache.struts.action.ActionError; import org.apache.struts.action.Action; import org.asturlinux.frade.prolix.exceptions.NotEnoughtPermissionsException; + import org.apache.struts.util.MessageResources; + import org.asturlinux.frade.prolix.web.formbeans.LoadProgramFormBean; + import javax.servlet.http.HttpSession; + import org.asturlinux.frade.prolix.ejb.interfaces.AccessControl; + import org.asturlinux.frade.prolix.web.beans.CurrentStateBean; + import org.asturlinux.frade.prolix.interpreter.exceptions.SyntaxException; + import org.asturlinux.frade.prolix.interpreter.exceptions.LexicalException; + import org.asturlinux.frade.prolix.exceptions.NoLoggedUserException; /** *************** *** 74,78 **** { HttpSession session = request.getSession(); ! CommonUseCase login = (CommonUseCase)session.getAttribute("interpreter"); if (login != null) { --- 78,82 ---- { HttpSession session = request.getSession(); ! AccessControl login = (AccessControl)session.getAttribute("interpreter"); if (login != null) { *************** *** 97,100 **** --- 101,108 ---- //PERMISSIONS-MESSAGE errors.add("program",new ActionError("error.not.enought.permissions")); + } + catch (NoLoggedUserException nle) + { + errors.add("program",new ActionError("error.no.logged.user")); } Index: LoginAction.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions/LoginAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LoginAction.java 6 Aug 2003 21:33:11 -0000 1.2 --- LoginAction.java 14 Aug 2003 22:32:49 -0000 1.3 *************** *** 22,30 **** 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.ActionMapping; import org.apache.struts.action.ActionForm; --- 22,25 ---- *************** *** 33,42 **** import org.apache.struts.action.ActionError; import org.apache.struts.action.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" --- 28,43 ---- import org.apache.struts.action.ActionError; import org.apache.struts.action.Action; import org.asturlinux.frade.prolix.exceptions.FailedLoginException; + import javax.servlet.http.HttpServletRequest; + import javax.servlet.http.HttpServletResponse; + import javax.servlet.ServletException; + import java.io.IOException; + import java.util.Locale; + import org.apache.struts.util.MessageResources; + import org.asturlinux.frade.prolix.web.formbeans.LoginFormBean; + import javax.servlet.http.HttpSession; + import org.asturlinux.frade.prolix.ejb.interfaces.AccessControl; + import org.asturlinux.frade.prolix.web.beans.LoginBean; + import org.asturlinux.frade.prolix.exceptions.NoLoggedUserException; /** * @struts.action name="loginForm" *************** *** 74,84 **** { HttpSession session = request.getSession(); ! CommonUseCase login = (CommonUseCase)session.getAttribute("interpreter"); if (login != null) { login.login(user,pass); } else ! errors.add("login",new ActionError("error.no.interpreter")); //FIXME Message error } catch (FailedLoginException notAuth) --- 75,96 ---- { HttpSession session = request.getSession(); ! AccessControl login = (AccessControl)session.getAttribute("interpreter"); if (login != null) { login.login(user,pass); + LoginBean lb = new LoginBean(); + lb.setLoggedUser(user); + try { + lb.setPermissions(login.getLoggedUserPermissions()); + } + catch (NoLoggedUserException nlue){ + throw new FailedLoginException(); //FIXME Fatal error + } + session.setAttribute("login",lb); } else ! errors.add("login", ! new ActionError("error.no.interpreter")); ! //FIXME Message error } catch (FailedLoginException notAuth) Index: LogoutAction.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions/LogoutAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LogoutAction.java 6 Aug 2003 21:33:11 -0000 1.2 --- LogoutAction.java 14 Aug 2003 22:32:49 -0000 1.3 *************** *** 22,30 **** 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.ActionMapping; import org.apache.struts.action.ActionForm; --- 22,25 ---- *************** *** 33,42 **** import org.apache.struts.action.ActionForward; import org.apache.struts.action.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" --- 28,41 ---- import org.apache.struts.action.ActionForward; import org.apache.struts.action.Action; import org.asturlinux.frade.prolix.exceptions.NoLoggedUserException; + import javax.servlet.http.HttpServletRequest; + import javax.servlet.http.HttpServletResponse; + import javax.servlet.ServletException; + import java.io.IOException; + import java.util.Locale; + import org.apache.struts.util.MessageResources; + import javax.servlet.http.HttpSession; + import org.asturlinux.frade.prolix.ejb.interfaces.AccessControl; + import org.asturlinux.frade.prolix.web.beans.LoginBean; /** * @struts.action name="logoutForm" *************** *** 71,78 **** { HttpSession session = request.getSession(); ! CommonUseCase login = (CommonUseCase)session.getAttribute("interpreter"); if (login != null) { login.logout(); } else --- 70,80 ---- { HttpSession session = request.getSession(); ! AccessControl login = (AccessControl)session.getAttribute("interpreter"); if (login != null) { login.logout(); + LoginBean lb; + lb =(LoginBean)session.getAttribute("login"); + lb.reset(); } else Index: ResetProgramAction.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions/ResetProgramAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ResetProgramAction.java 6 Aug 2003 21:33:11 -0000 1.2 --- ResetProgramAction.java 14 Aug 2003 22:32:49 -0000 1.3 *************** *** 22,30 **** 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.ActionMapping; import org.apache.struts.action.ActionForm; --- 22,25 ---- *************** *** 32,38 **** import org.apache.struts.action.ActionForward; import org.apache.struts.action.Action; ! import org.apache.struts.util.*; ! import org.asturlinux.frade.prolix.web.beans.*; ! import org.asturlinux.frade.prolix.web.formbeans.*; /** --- 27,41 ---- import org.apache.struts.action.ActionForward; import org.apache.struts.action.Action; ! import javax.servlet.http.HttpServletRequest; ! import javax.servlet.http.HttpServletResponse; ! import javax.servlet.ServletException; ! import java.io.IOException; ! import javax.servlet.http.HttpSession; ! import java.util.Locale; ! import org.apache.struts.util.MessageResources; ! import org.asturlinux.frade.prolix.web.beans.CurrentStateBean; ! import org.asturlinux.frade.prolix.web.beans.LastConsultsBean; ! import java.util.Vector; ! /** Index: SolutionAction.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions/SolutionAction.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** SolutionAction.java 6 Aug 2003 21:33:11 -0000 1.10 --- SolutionAction.java 14 Aug 2003 22:32:49 -0000 1.11 *************** *** 22,30 **** 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.ActionMapping; import org.apache.struts.action.ActionForm; --- 22,25 ---- *************** *** 33,42 **** import org.apache.struts.action.Action; import org.apache.struts.action.ActionForward; - 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.NotEnoughtPermissionsException; /** * @struts.action name="solutionsForm" --- 28,45 ---- import org.apache.struts.action.Action; import org.apache.struts.action.ActionForward; import org.asturlinux.frade.prolix.exceptions.NotEnoughtPermissionsException; + import javax.servlet.http.HttpServletRequest; + import javax.servlet.http.HttpServletResponse; + import javax.servlet.ServletException; + import java.io.IOException; + import java.util.Locale; + import org.apache.struts.util.MessageResources; + import org.asturlinux.frade.prolix.web.formbeans.SolutionsFormBean; + import javax.servlet.http.HttpSession; + import org.asturlinux.frade.prolix.ejb.interfaces.AccessControl; + import org.asturlinux.frade.prolix.web.beans.CurrentStateBean; + import org.asturlinux.frade.prolix.interpreter.exceptions.ProgramNotLoadedException; + import org.asturlinux.frade.prolix.interpreter.exceptions.QueryNotLoadedException; + import org.asturlinux.frade.prolix.exceptions.NoLoggedUserException; /** * @struts.action name="solutionsForm" *************** *** 78,82 **** { HttpSession session = request.getSession(); ! CommonUseCase login = (CommonUseCase)session.getAttribute("interpreter"); String result = login.getStudentRole().nextSolution(); CurrentStateBean data = (CurrentStateBean)session.getAttribute("prologData"); --- 81,85 ---- { HttpSession session = request.getSession(); ! AccessControl login = (AccessControl)session.getAttribute("interpreter"); String result = login.getStudentRole().nextSolution(); CurrentStateBean data = (CurrentStateBean)session.getAttribute("prologData"); *************** *** 106,109 **** --- 109,116 ---- //PERMISSIONS-MESSAGE errors.add("solution",new ActionError("error.not.enought.permissions")); + } + catch (NoLoggedUserException nle) + { + errors.add("solution",new ActionError("error.no.logged.user")); } Index: StepAction.java =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/web/actions/StepAction.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** StepAction.java 6 Aug 2003 21:33:11 -0000 1.3 --- StepAction.java 14 Aug 2003 22:32:49 -0000 1.4 *************** *** 22,30 **** 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.ActionMapping; import org.apache.struts.action.ActionForm; --- 22,25 ---- *************** *** 33,42 **** import org.apache.struts.action.ActionForward; import org.apache.struts.action.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.NotEnoughtPermissionsException; /** * @struts.action name="stepForm" --- 28,44 ---- import org.apache.struts.action.ActionForward; import org.apache.struts.action.Action; import org.asturlinux.frade.prolix.exceptions.NotEnoughtPermissionsException; + import javax.servlet.http.HttpServletRequest; + import javax.servlet.http.HttpServletResponse; + import javax.servlet.ServletException; + import java.io.IOException; + import java.util.Locale; + import org.apache.struts.util.MessageResources; + import javax.servlet.http.HttpSession; + import org.asturlinux.frade.prolix.ejb.interfaces.AccessControl; + import org.asturlinux.frade.prolix.web.beans.CurrentStateBean; + import org.asturlinux.frade.prolix.interpreter.exceptions.ProgramNotLoadedException; + import org.asturlinux.frade.prolix.interpreter.exceptions.QueryNotLoadedException; + import org.asturlinux.frade.prolix.exceptions.NoLoggedUserException; /** * @struts.action name="stepForm" *************** *** 56,59 **** --- 58,63 ---- * path="/consult.jsp" * + * @struts.action-forward name="failure" + * path="/login.jsp" */ *************** *** 74,78 **** { HttpSession session = request.getSession(); ! CommonUseCase login = (CommonUseCase)session.getAttribute("interpreter"); String result = login.getStudentRole().step(); CurrentStateBean data = (CurrentStateBean)session.getAttribute("prologData"); --- 78,82 ---- { HttpSession session = request.getSession(); ! AccessControl login = (AccessControl)session.getAttribute("interpreter"); String result = login.getStudentRole().step(); CurrentStateBean data = (CurrentStateBean)session.getAttribute("prologData"); *************** *** 104,107 **** --- 108,116 ---- //FIXME: where we go with these error? return (mapping.findForward("noQuery")); + } + catch (NoLoggedUserException nle) + { + errors.add("consult",new ActionError("error.no.logged.user")); + return (mapping.findForward("failure")); } |
From: <iva...@us...> - 2003-08-14 23:16:38
|
Update of /cvsroot/pfc-prolog/prolix/etc In directory sc8-pr-cvs1:/tmp/cvs-serv24493/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.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** WebClientResources.properties 7 Aug 2003 17:08:07 -0000 1.13 --- WebClientResources.properties 14 Aug 2003 22:50:56 -0000 1.14 *************** *** 10,15 **** --- 10,30 ---- error.void.user=<li>Debe teclear un nombre de usuario</li> error.void.passwd=<li>Debe teclear su password</li> + error.void.passwd.confirmation=<li>Repita el password en la casilla indicada</li> + error.void.title=<li>Debe ponerle título a su programa</li> + error.void.description=<li>Debe escribir una breve descripcion de su programa</li> + error.passwd.mismatch=<li>No coincide el password y la confirmación</li> + error.username.registered=<li>El nombre de usuario ya esta ocupado</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> + error.registering.user=<li>No coinciden los dos password tecleados</li> + error.no.logged.user=<li>Para realizar esta operación debe hacer login antes</li> + error.storing.program=<li>Error guardando programa</li> + error.retrieving.program=<li>Error buscando programa/s</li> + error.removing.program=<li>Error borrando programa</li> + error.program.key=<li>Error con la clave del programa</li> + error.void.action=<li>No hay accion a ejecutar con el programa</li> + error.locating.program=<li>Error en el servidor</li> + error.no.data.bean=<li>Error: no hay bean para almacenar los datos</li> + error.fatal=<li>Algo va muy mal</li> errors.footer=</ul> errors.header=<h3>Se han producido los siguientes errores</h3><ul> *************** *** 19,22 **** --- 34,40 ---- button.step=Avanzar un paso button.logout=Logout + button.go.library=A la biblioteca + button.modify=Editar + button.delete=Borrar message.load.other.program=Cargar otro programa message.load.other.consult=Cargar otra consulta *************** *** 26,33 **** message.input.user=Usuario message.input.password=Password message.registry.now=Registrate ahora title.main=Prolix title.consult=Prolix Consulta title.resultText=Prolix Soluciones title.resultGraphic=Prolix Arbol de resolucion ! --- 44,66 ---- message.input.user=Usuario message.input.password=Password + message.input.password.again=Repita el password + message.input.new.password=Nuevo password message.registry.now=Registrate ahora + message.registry.professor=Registro de un profesor en el sistema + message.input.registry.data=Introduzca los siguientes datos + message.change.password=Cambiar password + message.save.program=Guardar programa en la biblioteca + message.title.program=Título del programa + message.description.program=Descripción del programa + message.go.load.program=Volver a la pagina de carga de programas + message.go.my.library=Ir a mis programas + message.actions.with.programs=Accion a realizar con el programa + message.go.login.page=Pagina de login + message.currently.logged.user=Usuario: title.main=Prolix title.consult=Prolix Consulta title.resultText=Prolix Soluciones title.resultGraphic=Prolix Arbol de resolucion ! title.admin=Prolix Administrador ! title.change.password=Prolix Cambio de clave ! title.library= Prolix Biblioteca |
From: <iva...@us...> - 2003-08-14 23:08:04
|
Update of /cvsroot/pfc-prolog/prolix In directory sc8-pr-cvs1:/tmp/cvs-serv24916 Modified Files: build.xml Log Message: Fixed some task dependences - moved taglibs to other file - reordered and cleaned Index: build.xml =================================================================== RCS file: /cvsroot/pfc-prolog/prolix/build.xml,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** build.xml 7 Aug 2003 11:55:17 -0000 1.48 --- build.xml 14 Aug 2003 22:53:47 -0000 1.49 *************** *** 30,33 **** --- 30,38 ---- <project name="prolix" default="main" basedir="."> + + <!-- =================================================================== --> + <!-- Properties --> + <!-- =================================================================== --> + <property environment="env"/> <property name="jboss.home" value="${env.JBOSS_HOME}" /> *************** *** 41,145 **** <property name="src.release.file.with.libs" value="prolix-src-snapshot-with-libs.jar"/> ! <target name="check-jboss" unless="jboss.home"> ! <fail> ! Property "jboss.home" is not set. Please use the file ! ".ant.properties" in this directory ${basedir} to ! set this property. It must point to the directory which ! contains the following directory: "deploy", "conf", "tmp" ! etc. ! </fail> ! </target> ! ! <target name="wrong-jboss" unless="jboss.present"> ! <fail> ! Property "jboss.home" is set but it does not seem ! to point to the right directory. The file "run.jar" ! must be available at ${jboss.home}/bin. ! </fail> ! </target> ! ! <target name="check-xdoclet" unless="xdoclet.home"> ! <fail> ! Property "xdoclet.home" is not set. Please use the file ! ".ant.properties" in this directory ${basedir} to ! set this property. It must point to the root directory of ! XDoclet distribution. ! </fail> ! </target> ! ! <target name="wrong-xdoclet" unless="xdoclet.present"> ! <fail> ! Property "xdoclet.home" is set but it does not seem ! to point to the right directory. The file "xdoclet.jar" ! must be available at ${xdoclet.home}/lib. ! </fail> ! </target> ! ! <target name="check-environment"> ! <antcall target="check-jboss"/> ! <available property="jboss.present" file="${jboss.home}/bin/run.jar"/> ! <antcall target="wrong-jboss"/> ! <!-- <antcall target="check-xdoclet"/> --> ! <!-- <available property="xdoclet.present" file="${xdoclet.home}/lib/xdoclet.jar"/> ! <antcall target="wrong-xdoclet"/> --> ! </target> ! ! <target name="init" depends="check-environment"> ! <echo message="build.compiler = ${build.compiler}"/> ! <echo message="user.home = ${user.home}"/> ! <echo message="java.home = ${java.home}"/> ! <echo message="ant.home = ${ant.home}"/> ! <echo message="jboss.home = ${jboss.home}"/> ! <echo message="xdoclet.home = ${xdoclet.home}"/> ! <!-- ! <echo message="java.class.path = ${java.class.path}"/> ! --> ! <available property="jdk1.3+" classname="java.lang.StrictMath" /> ! </target> ! ! <property name="jboss.lib" value="${jboss.home}/lib" /> <property name="jboss.tomcat.lib" ! value="${jboss.home}/tomcat-4.1.x/common/lib"/> <property name="jboss.all.lib" value="${jboss.home}/server/all/lib"/> ! <property name="jboss.client" value="${jboss.home}/client" /> ! <!-- Configuration used on JBoss 3 to run your server. There must be ! a directory with the same name under "${jboss.home}/server" --> ! <property name="jboss.configuration" value="default" /> ! <property name="jboss.deploy" ! value="${jboss.home}/server/${jboss.configuration}/deploy" /> ! ! ! <property name="package.path" value="org/asturlinux/frade/prolix" /> ! <property name="src.dir" value="${basedir}/src"/> ! ! <property name="lib.dir" value="${basedir}/lib"/> ! <property name="lib.web.client.dir" value="${lib.dir}/web-client"/> ! <property name="struts.lib.dir" value="${lib.web.client.dir}/WEB-INF/lib"/> ! ! <property name="build.dir" value="${basedir}/build"/> ! <property name="build.generate.dir" value="${build.dir}/generate"/> ! <property name="build.classes.dir" value="${build.dir}/classes"/> ! <property name="build.generate.ejb-conf" value="${build.generate.dir}/ejb-conf"/> ! <property name="build.generate.web-conf" value="${build.generate.dir}/web-conf"/> - <property name="dist.dir" value="${basedir}/dist"/> - <property name="src.web.dir" value="${basedir}/web"/> - <property name="etc.dir" value="${basedir}/etc"/> ! <property name="src.resources.dir" value="${build.generate.dir}/merge"/> ! <!-- Removed properties ! <property name="src.client.dir" value="${src.main.dir}/client"/> ! <property name="build.tmp.dir" value="${build.dir}/tmp"/> ! <property name="build.deploy.dir" value="${build.dir}/deploy"/> ! <property name="build.client.dir" value="${build.dir}/client"/> ! <property name="build.bin.dir" value="${build.dir}/bin"/> ! <property name="src.servlet.dir" value="${src.main.dir}/servlet"/> ! <property name="build.javadocs.dir" value="${build.dir}/docs/api"/> ! <property name="build.war.dir" value="${build.dir}/war"/> ! --> ! ! <path id="xdoclet.path"> <fileset dir="${xdoclet.home}/lib"/> ! </path> <path id="struts.path"> --- 46,89 ---- <property name="src.release.file.with.libs" value="prolix-src-snapshot-with-libs.jar"/> ! <property name="jboss.lib" value="${jboss.home}/lib" /> <property name="jboss.tomcat.lib" ! value="${jboss.home}/tomcat-4.1.x/common/lib"/> <property name="jboss.all.lib" value="${jboss.home}/server/all/lib"/> ! <property name="jboss.client" value="${jboss.home}/client" /> ! <!-- Configuration used on JBoss 3 to run your server. There must be ! a directory with the same name under "${jboss.home}/server" --> ! <property name="jboss.configuration" value="default" /> ! <property name="jboss.deploy" ! value="${jboss.home}/server/${jboss.configuration}/deploy" /> ! ! <property name="package.path" value="org/asturlinux/frade/prolix" /> ! <property name="src.dir" value="${basedir}/src"/> ! ! <property name="lib.dir" value="${basedir}/lib"/> ! <property name="lib.web.client.dir" value="${lib.dir}/web-client"/> ! <property name="struts.lib.dir" value="${lib.web.client.dir}/WEB-INF/lib"/> ! ! <property name="build.dir" value="${basedir}/build"/> ! <property name="build.generate.dir" value="${build.dir}/generate"/> ! <property name="build.classes.dir" value="${build.dir}/classes"/> ! <property name="build.generate.ejb-conf" ! value="${build.generate.dir}/ejb-conf"/> ! <property name="build.generate.web-conf" ! value="${build.generate.dir}/web-conf"/> ! ! <property name="dist.dir" value="${basedir}/dist"/> ! <property name="src.web.dir" value="${basedir}/web"/> ! <property name="etc.dir" value="${basedir}/etc"/> ! ! <property name="src.resources.dir" value="${build.generate.dir}/merge"/> ! <!-- =================================================================== --> ! <!-- Classpaths --> ! <!-- =================================================================== --> ! ! <path id="xdoclet.path"> <fileset dir="${xdoclet.home}/lib"/> ! </path> <path id="struts.path"> *************** *** 156,185 **** </path> <path id="base.path"> ! <path refid="xdoclet.path"/> ! <path refid="struts.path"/> ! <pathelement location="${jboss.client}/jboss-j2ee.jar" /> ! <pathelement location="${jboss.client}/jnp-client.jar" /> ! <pathelement location="${jboss.client}/jbossmq-client.jar" /> ! <pathelement location="${jboss.client}/jbosssx-client.jar" /> ! <pathelement location="${jboss.client}/concurrent.jar" /> ! <pathelement location="${jboss.client}/jaas.jar" /> ! <pathelement location="${jboss.lib}/jboss-jmx.jar" /> ! <pathelement location="${jboss.home}/server/${jboss.configuration}/lib/jbosssx.jar" /> ! <pathelement location="${jboss.home}/server/${jboss.configuration}/lib/mail.jar" /> ! <pathelement location="${build.classes.dir}" /> ! <pathelement location="lib/${interpreter}"/> ! <pathelement location="${jboss.tomcat.lib}/servlet.jar"/> ! <pathelement location="${jboss.all.lib}/xalan.jar"/> ! </path> <path id="dummy.path"> <pathelement location="${lib.dir}/prolix-interpreter-interface.jar"/> </path> ! <!-- =================================================================== --> ! <!-- Generates the necessary EJB classes and deployment descriptors --> ! <!-- =================================================================== --> <target name="xdoclet-generate-ejb" depends="init,prepare"> --- 100,193 ---- </path> + <path id="jboss.path"> + <pathelement location="${jboss.client}/jboss-j2ee.jar" /> + <pathelement location="${jboss.client}/jnp-client.jar" /> + <pathelement location="${jboss.client}/jbossmq-client.jar" /> + <pathelement location="${jboss.client}/jbosssx-client.jar" /> + <pathelement location="${jboss.client}/concurrent.jar" /> + <pathelement location="${jboss.client}/jaas.jar" /> + <pathelement location="${jboss.lib}/jboss-jmx.jar" /> + <pathelement location="${jboss.home}/server/${jboss.configuration}/lib/jbosssx.jar" /> + <pathelement location="${jboss.home}/server/${jboss.configuration}/lib/mail.jar" /> + <pathelement location="${jboss.tomcat.lib}/servlet.jar"/> + <pathelement location="${jboss.all.lib}/xalan.jar"/> + </path> + <path id="base.path"> ! <path refid="xdoclet.path"/> ! <path refid="struts.path"/> ! <path refid="jboss.path"/> ! <pathelement location="${build.classes.dir}" /> ! <pathelement location="lib/${interpreter}"/> ! </path> <path id="dummy.path"> <pathelement location="${lib.dir}/prolix-interpreter-interface.jar"/> </path> + + + <!-- =================================================================== --> + <!-- Environment-related targets --> + <!-- =================================================================== --> + + <target name="check-jboss" unless="jboss.home"> + <fail> + Property "jboss.home" is not set. Please use the file + ".ant.properties" in this directory ${basedir} to + set this property. It must point to the directory which + contains the following directory: "deploy", "conf", "tmp" + etc. + </fail> + </target> ! <target name="wrong-jboss" unless="jboss.present"> ! <fail> ! Property "jboss.home" is set but it does not seem ! to point to the right directory. The file "run.jar" ! must be available at ${jboss.home}/bin. ! </fail> ! </target> ! ! <target name="check-xdoclet" unless="xdoclet.home"> ! <fail> ! Property "xdoclet.home" is not set. Please use the file ! ".ant.properties" in this directory ${basedir} to ! set this property. It must point to the root directory of ! XDoclet distribution. ! </fail> ! </target> ! ! <target name="wrong-xdoclet" unless="xdoclet.present"> ! <fail> ! Property "xdoclet.home" is set but it does not seem ! to point to the right directory. The XDoclet jars ! must be available at ${xdoclet.home}/lib. ! </fail> ! </target> ! ! <target name="check-environment"> ! <antcall target="check-jboss"/> ! <available property="jboss.present" file="${jboss.home}/bin/run.jar"/> ! <antcall target="wrong-jboss"/> ! <antcall target="check-xdoclet"/> ! <available property="xdoclet.present" file="${xdoclet.home}/lib"/> ! <antcall target="wrong-xdoclet"/> ! </target> + <target name="init" depends="check-environment"> + <echo message="build.compiler = ${build.compiler}"/> + <echo message="user.home = ${user.home}"/> + <echo message="java.home = ${java.home}"/> + <echo message="ant.home = ${ant.home}"/> + <echo message="jboss.home = ${jboss.home}"/> + <echo message="xdoclet.home = ${xdoclet.home}"/> + <available property="jdk1.3+" classname="java.lang.StrictMath" /> + </target> + + + <!-- =================================================================== --> + <!-- XDoclet targets --> + <!-- =================================================================== --> + <target name="xdoclet-generate-ejb" depends="init,prepare"> *************** *** 200,204 **** substituteWith="interfaces"/> ! <dataobject/> <entitypk/> <remoteinterface/> --- 208,212 ---- substituteWith="interfaces"/> ! <!-- <dataobject/> --> <entitypk/> <remoteinterface/> *************** *** 206,220 **** <homeinterface/> <localhomeinterface/> <entitycmp/> <session/> - <valueobject/> <utilobject/> - <!-- Beans Deployment descriptor --> <deploymentdescriptor ! destdir="${build.generate.ejb-conf}/META-INF"/> <!-- AS 4/29/02 Do not validate XML files because JBoss 3.0 ! message driven will report an wrong error because it uses the wrong jboss.dtd --> <jboss version="${jboss.version}" --- 214,228 ---- <homeinterface/> <localhomeinterface/> + <valueobject/> <entitycmp/> <session/> <utilobject/> <!-- Beans Deployment descriptor --> <deploymentdescriptor ! destdir="${build.generate.ejb-conf}/META-INF"/> <!-- AS 4/29/02 Do not validate XML files because JBoss 3.0 ! message driven will report an wrong error because it uses the ! wrong jboss.dtd --> <jboss version="${jboss.version}" *************** *** 234,242 **** <classpath refid="xdoclet.path"/> </taskdef> ! ! <!-- Servlets file to merge dir --> ! <copy todir="${src.resources.dir}/xdoclet" file="${etc.dir}/servlets.xml"/> ! <copy todir="${src.resources.dir}/xdoclet" file="${etc.dir}/servlet-mappings.xml"/> ! <webdoclet destdir="${build.generate.web-conf}/WEB-INF" --- 242,254 ---- <classpath refid="xdoclet.path"/> </taskdef> ! ! <!-- files to merge dir --> ! <copy todir="${src.resources.dir}/xdoclet" ! file="${etc.dir}/servlets.xml"/> ! <copy todir="${src.resources.dir}/xdoclet" ! file="${etc.dir}/servlet-mappings.xml"/> ! <copy todir="${src.resources.dir}/xdoclet" ! file="${etc.dir}/taglibs.xml"/> ! <webdoclet destdir="${build.generate.web-conf}/WEB-INF" *************** *** 244,327 **** force="${xdoclet.force}" mergedir="${src.resources.dir}/xdoclet"> ! <fileset dir="${src.dir}"/> ! <deploymentdescriptor displayname="ProlixWebClient" description="Third (at least) approach to web client" sessiontimeout="30"> - - <contextparam - name="CommonUse" - value="org/asturlinux/frade/prolix/ejb/sessionjb/CommonUse"/> - - <!-- XSLT tags --> - <taglib - uri="http://java.sun.com/jstl/fmt" - location="/WEB-INF/fmt.tld"> - </taglib> - - <taglib - uri="http://java.sun.com/jstl/fmt-rt" - location="/WEB-INF/fmt-rt.tld"> - </taglib> - - <taglib - uri="http://java.sun.com/jstl/core" - location="/WEB-INF/c.tld"> - </taglib> - - <taglib - uri="http://java.sun.com/jstl/core-rt" - location="/WEB-INF/c-rt.tld"> - </taglib> ! <taglib ! uri="http://java.sun.com/jstl/sql" ! location="/WEB-INF/sql.tld"> ! </taglib> ! ! <taglib ! uri="http://java.sun.com/jstl/sql-rt" ! location="/WEB-INF/sql-rt.tld"> ! </taglib> ! ! <taglib ! uri="http://java.sun.com/jstl/x" ! location="/WEB-INF/x.tld"> ! </taglib> ! ! <taglib ! uri="http://java.sun.com/jstl/x-rt" ! location="/WEB-INF/x-rt.tld"> ! </taglib> ! ! <!-- ejb management tags --> ! <taglib ! uri="ejbtags" ! location="/WEB-INF/lib/ejbtags.jar"> ! </taglib> ! ! <!-- struts tags --> ! <taglib ! uri="/WEB-INF/struts-bean.tld" ! location="/WEB-INF/struts-bean.tld"> ! </taglib> ! ! <taglib ! uri="/WEB-INF/struts-html.tld" ! location="/WEB-INF/struts-html.tld"> ! </taglib> ! ! <taglib ! uri="/WEB-INF/struts-logic.tld" ! location="/WEB-INF/struts-logic.tld"> ! </taglib> - <taglib - uri="/WEB-INF/struts-template.tld" - location="/WEB-INF/struts-template.tld"> - </taglib> - </deploymentdescriptor> <jbosswebxml/> --- 256,271 ---- force="${xdoclet.force}" mergedir="${src.resources.dir}/xdoclet"> ! <fileset dir="${src.dir}"/> ! <deploymentdescriptor displayname="ProlixWebClient" description="Third (at least) approach to web client" sessiontimeout="30"> ! <contextparam ! name="AcccessControl" ! value="org/asturlinux/frade/prolix/ejb/sessionjb/AccessControl"/> </deploymentdescriptor> <jbosswebxml/> *************** *** 330,395 **** </target> - <!-- =================================================================== --> - <!-- Compiles the source code --> - <!-- =================================================================== --> - - <target name="compile" depends="prepare,xdoclet-generate-ejb,xdoclet-generate-web"> - <javac - destdir="${build.classes.dir}" - debug="on" - deprecation="on" - optimize="on" - classpathref="base.path" - > - <src path="${src.dir}"/> - <src path="${build.generate.dir}"/> - </javac> ! </target> ! ! <!-- =================================================================== --> ! <!-- Targets to create the jar archives --> ! <!-- =================================================================== --> ! ! <target name="jar" depends="package-webclient,package-server,package-consoleclient"> </target> - <target name="prepare"> - <mkdir dir="${build.classes.dir}"/> - <mkdir dir="${build.generate.dir}"/> - <mkdir dir="${dist.dir}"/> - </target> - <!-- JBOSS jar --> <target name="package-server" depends="compile"> <jar jarfile="${dist.dir}/prolix-beans.jar"> <fileset ! dir="${build.classes.dir}" ! includes="${package.path}/ejb/**/**" ! > ! </fileset> <fileset ! dir="${build.generate.ejb-conf}" ! includes="META-INF/**" ! > ! </fileset> <fileset ! dir="${build.classes.dir}" ! includes="${package.path}/interpreter/**/**" ! > ! </fileset> <fileset ! dir="${lib.dir}" ! includes="${interpreter}" ! > ! </fileset> <fileset ! dir="${build.classes.dir}" ! includes="${package.path}/exceptions/**" ! > ! </fileset> ! ! </jar> </target> --- 274,320 ---- </target> ! <!-- =================================================================== --> ! <!-- Java compilation targets --> ! <!-- =================================================================== --> ! ! <target name="compile" depends="prepare,xdoclet-generate-ejb,xdoclet-generate-web"> ! <javac ! destdir="${build.classes.dir}" ! debug="on" ! deprecation="on" ! optimize="on" ! classpathref="base.path"> ! <src path="${src.dir}"/> ! <src path="${build.generate.dir}"/> ! </javac> </target> + <!-- =================================================================== --> + <!-- Packaging targets --> + <!-- =================================================================== --> + + <target name="jar" depends="package-webclient,package-server,package-consoleclient"/> + <!-- JBOSS jar --> <target name="package-server" depends="compile"> <jar jarfile="${dist.dir}/prolix-beans.jar"> <fileset ! dir="${build.classes.dir}" ! includes="${package.path}/ejb/**/**"/> <fileset ! dir="${build.generate.ejb-conf}" ! includes="META-INF/**"/> <fileset ! dir="${build.classes.dir}" ! includes="${package.path}/interpreter/**/**"/> <fileset ! dir="${lib.dir}" ! includes="${interpreter}"/> <fileset ! dir="${build.classes.dir}" ! includes="${package.path}/exceptions/**"/> ! </jar> </target> *************** *** 405,421 **** </jar> </target> ! ! <!-- Interfaces interpreter-prolix jar--> ! <target name="package-interfaces" depends="compile"> ! <jar ! jarfile="${dist.dir}/prolix-interpreter-interface.jar" ! > ! <fileset ! dir="${build.classes.dir}" ! includes="${package.path}/interpreter/**" ! > ! </fileset> ! </jar> ! </target> --- 330,342 ---- </jar> </target> ! ! <!-- Interfaces interpreter-prolix jar--> ! <target name="package-interfaces" depends="compile"> ! <jar jarfile="${dist.dir}/prolix-interpreter-interface.jar"> ! <fileset ! dir="${build.classes.dir}" ! includes="${package.path}/interpreter/**"/> ! </jar> ! </target> *************** *** 424,519 **** <mkdir dir="${build.dir}/WEB-INF"/> <mkdir dir="${build.dir}/WEB-INF/classes"/> - <!-- I'll try to do without a jar - <jar jarfile="${build.dir}/WEB-INF/lib/${struts.jar.file}"> - <fileset - dir="${build.classes.dir}/${package.path}" - includes="web/**/*.class" - > - </fileset> - </jar> - --> <copy file="${etc.dir}/WebClientResources.properties" ! todir="${build.classes.dir}/${package.path}/web"/> ! <war warfile="${dist.dir}/${war.file}" ! webxml="${build.generate.web-conf}/WEB-INF/web.xml" ! basedir="${src.web.dir}" ! includes="**/*.jsp,**/*.tld,**/*.xslt,css/prolix.css" ! > ! <lib ! dir="${lib.web.client.dir}/WEB-INF/lib" ! includes="*.jar" ! > ! </lib> ! <classes ! dir="${build.classes.dir}" ! includes="${package.path}/web/**/*.class, ! ${package.path}/ejb/interfaces/**/*.class, ! ${package.path}/interpreter/exceptions/*.class, ! ${package.path}/web/WebClientResources.properties" ! > ! </classes> ! <webinf ! dir="${build.generate.web-conf}/WEB-INF" ! includes="*.xml" ! excludes="**/web.xml" ! > ! </webinf> ! </war> ! </target> ! <!-- =================================================================== --> ! <!-- To release an snapshot of sourcecode --> ! <!-- =================================================================== --> <target name="snapshot" depends="clean"> <jar jarfile="../${src.release.file}"> <fileset ! dir="${basedir}" ! includes="**/**" ! excludes="**/CVS/**,**/lib/**" ! > ! </fileset> </jar> - <jar jarfile="../${src.release.file.with.libs}"> <fileset ! dir="${basedir}" ! includes="**/**" ! excludes="**/CVS/**" ! > ! </fileset> </jar> <property name="machine" value="iva...@pf..."/> <property name="location" value="/home/groups/p/pf/pfc-prolog/htdocs"/> - <exec executable="scp"> <arg line="../${src.release.file} ${machine}:${location}"/> </exec> - </target> ! <!-- =================================================================== --> ! <!-- Target to deploy and undeploy server and client binary --> ! <!-- =================================================================== --> - <target name="deploy" depends="deploy-server,deploy-webclient"/> ! <target name="deploy-server" depends="jar"> <copy file="${dist.dir}/prolix-beans.jar" todir="${jboss.deploy}"/> </target> ! <target name="deploy-webclient" depends="jar"> <copy file="${dist.dir}/${war.file}" todir="${jboss.deploy}" /> </target> <target name="undeploy-server"> ! <property name="jboss.tmp.dir" value="server/default/tmp/deploy/server/default" /> - <delete file="${jboss.deploy}/prolix-beans.jar"/> </target> --- 345,418 ---- <mkdir dir="${build.dir}/WEB-INF"/> <mkdir dir="${build.dir}/WEB-INF/classes"/> <copy file="${etc.dir}/WebClientResources.properties" ! todir="${build.classes.dir}/${package.path}/web"/> ! <war warfile="${dist.dir}/${war.file}" ! webxml="${build.generate.web-conf}/WEB-INF/web.xml" ! basedir="${src.web.dir}" ! includes="**/*.jsp,**/*.tld,**/*.xslt,css/prolix.css"> ! <lib ! dir="${lib.web.client.dir}/WEB-INF/lib" ! includes="*.jar"/> ! <classes ! dir="${build.classes.dir}" ! includes="${package.path}/web/**/*.class, ! ${package.path}/ejb/interfaces/**/*.class, ! ${package.path}/interpreter/exceptions/*.class, ! ${package.path}/web/WebClientResources.properties"/> ! <webinf ! dir="${build.generate.web-conf}/WEB-INF" ! includes="*.xml" ! excludes="**/web.xml"/> ! </war> ! </target> ! <!-- =================================================================== --> ! <!-- Snapshot creation and publishing --> ! <!-- =================================================================== --> <target name="snapshot" depends="clean"> <jar jarfile="../${src.release.file}"> <fileset ! dir="${basedir}" ! includes="**/**" ! excludes="**/CVS/**,**/lib/**"/> </jar> <jar jarfile="../${src.release.file.with.libs}"> <fileset ! dir="${basedir}" ! includes="**/**" ! excludes="**/CVS/**"/> </jar> + </target> + <target name="snapshot-upload" depends="snapshot"> <property name="machine" value="iva...@pf..."/> <property name="location" value="/home/groups/p/pf/pfc-prolog/htdocs"/> <exec executable="scp"> <arg line="../${src.release.file} ${machine}:${location}"/> </exec> </target> ! <!-- =================================================================== --> ! <!-- Target to deploy and undeploy server and client binary --> ! <!-- =================================================================== --> <target name="deploy" depends="deploy-server,deploy-webclient"/> ! <target name="deploy-server" depends="package-server"> <copy file="${dist.dir}/prolix-beans.jar" todir="${jboss.deploy}"/> </target> ! <target name="deploy-webclient" depends="package-webclient"> <copy file="${dist.dir}/${war.file}" todir="${jboss.deploy}" /> </target> <target name="undeploy-server"> ! <property ! name="jboss.tmp.dir" value="server/default/tmp/deploy/server/default" /> <delete file="${jboss.deploy}/prolix-beans.jar"/> </target> *************** *** 522,528 **** <delete file="${jboss.deploy}/${war.file}"/> </target> - <target name="undeploy" depends="undeploy-webclient,undeploy-server"> - </target> <!-- =================================================================== --> --- 421,427 ---- <delete file="${jboss.deploy}/${war.file}"/> </target> + + <target name="undeploy" depends="undeploy-webclient,undeploy-server"/> <!-- =================================================================== --> *************** *** 530,617 **** <!-- =================================================================== --> ! <target name="create-console-client"> ! <!-- Convert the given paths to Windows --> ! <pathconvert targetos="windows" property="jboss.home.on.windows" > ! <path> ! <pathelement location="${jboss.home}" /> ! </path> ! </pathconvert> ! <pathconvert targetos="windows" property="java.home.on.windows" > ! <path> ! <pathelement location="${java.home}" /> ! </path> ! </pathconvert> ! <!-- Convert the given paths to Unix --> ! <pathconvert targetos="unix" property="jboss.home.on.unix" > ! <path> ! <pathelement location="${jboss.home}" /> ! </path> ! </pathconvert> ! <pathconvert targetos="unix" property="java.home.on.unix" > ! <path> ! <pathelement location="${java.home}" /> ! </path> ! </pathconvert> ! <!-- ! <echo message="JBoss Home on Unix: ${jboss.home.on.unix}"/> ! <echo message="Java Home on Unix: ${java.home.on.unix}"/> ! <filter token="jboss.home" value="${jboss.home.on.windows}"/> ! <filter token="java.home" value="${java.home.on.windows}"/> ! --> <filter token="jboss.home" value="${jboss.home.on.unix}"/> <filter token="java.home" value="${java.home.on.unix}"/> <filter token="dist.dir" value="${dist.dir}"/> <copy todir="${dist.dir}" filtering="yes"> ! <fileset dir="${etc.dir}" includes="run-*-client.sh"> ! </fileset> </copy> ! </target> ! <!-- =================================================================== --> ! <!-- Creates the binary structure --> ! <!-- =================================================================== --> ! ! <target name="main" depends="compile"> ! </target> ! <!-- =================================================================== --> <!-- Cleans up the current build --> <!-- =================================================================== --> <target name="clean" depends="init"> ! <delete dir="${build.dir}"/> <delete dir="${dist.dir}"/> <delete> <fileset dir="." includes="**/*~" defaultexcludes="no" /> </delete> - </target> ! <!-- =================================================================== --> ! <!-- Builds dummy and copy to lib dir and to JBOSS --> ! <!-- =================================================================== --> ! <target name="dummy"> ! <mkdir dir="${build.classes.dir}"/> ! <mkdir dir="${dist.dir}"/> <javac ! srcdir="${src.dir}" ! destdir="${build.classes.dir}" ! includes="org/asturlinux/frade/dummy/*.java" ! classpathref="dummy.path" ! > ! </javac> ! ! <jar jarfile="${dist.dir}/${interpreter}" ! basedir="${build.classes.dir}" ! includes="**/dummy/*.class" ! /> <copy file="${dist.dir}/${interpreter}" ! todir="${lib.dir}" /> ! </target> </project> - --- 429,513 ---- <!-- =================================================================== --> ! <target name="deploy-consoleclient" depends="package-consoleclient"> ! <!-- Convert the given paths to Windows --> ! <pathconvert targetos="windows" property="jboss.home.on.windows" > ! <path> ! <pathelement location="${jboss.home}" /> ! </path> ! </pathconvert> ! <pathconvert targetos="windows" property="java.home.on.windows" > ! <path> ! <pathelement location="${java.home}" /> ! </path> ! </pathconvert> ! <!-- Convert the given paths to Unix --> ! <pathconvert targetos="unix" property="jboss.home.on.unix" > ! <path> ! <pathelement location="${jboss.home}" /> ! </path> ! </pathconvert> ! <pathconvert targetos="unix" property="java.home.on.unix" > ! <path> ! <pathelement location="${java.home}" /> ! </path> ! </pathconvert> <filter token="jboss.home" value="${jboss.home.on.unix}"/> <filter token="java.home" value="${java.home.on.unix}"/> <filter token="dist.dir" value="${dist.dir}"/> <copy todir="${dist.dir}" filtering="yes"> ! <fileset dir="${etc.dir}" includes="run-*-client.sh"/> </copy> ! </target> ! ! <!-- =================================================================== --> ! <!-- Creates the binary structure --> ! <!-- =================================================================== --> ! <target name="main" depends="compile"/> ! ! ! <!-- =================================================================== --> ! <!-- Prepares the build environment --> ! <!-- =================================================================== --> ! ! <target name="prepare"> ! <mkdir dir="${build.classes.dir}"/> ! <mkdir dir="${build.generate.dir}"/> ! <mkdir dir="${dist.dir}"/> ! </target> ! ! ! <!-- =================================================================== --> <!-- Cleans up the current build --> <!-- =================================================================== --> <target name="clean" depends="init"> ! <delete dir="${build.dir}"/> <delete dir="${dist.dir}"/> <delete> <fileset dir="." includes="**/*~" defaultexcludes="no" /> </delete> </target> ! <!-- =================================================================== --> ! <!-- Builds dummy and copy to lib dir and to JBOSS --> ! <!-- =================================================================== --> ! <target name="dummy" depends="prepare"> <javac ! srcdir="${src.dir}" ! destdir="${build.classes.dir}" ! includes="org/asturlinux/frade/dummy/*.java" ! classpathref="dummy.path" /> ! <jar ! jarfile="${dist.dir}/${interpreter}" ! basedir="${build.classes.dir}" ! includes="**/dummy/*.class" /> <copy file="${dist.dir}/${interpreter}" ! todir="${lib.dir}" /> </target> </project> |
From: <iva...@us...> - 2003-08-14 23:07:37
|
Update of /cvsroot/pfc-prolog/prolix/src/org/asturlinux/frade/prolix/ejb/sessionjb In directory sc8-pr-cvs1:/tmp/cvs-serv25350 Removed Files: CommonUseCaseBean.java Log Message: Removed CommonUseCaseBean - now is called AccessControlBean and have a lot of new funcionality --- CommonUseCaseBean.java DELETED --- |
From: <iva...@us...> - 2003-08-14 23:03:53
|
Update of /cvsroot/pfc-prolog/prolix/etc In directory sc8-pr-cvs1:/tmp/cvs-serv24701 Added Files: taglibs.xml Log Message: Moved taglibs from build.xml to this file to merge with xdoclet --- NEW FILE: taglibs.xml --- <!-- taglibs.xml --> <taglib> <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri> <taglib-location>/WEB-INF/fmt.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/fmt-rt</taglib-uri> <taglib-location>/WEB-INF/fmt-rt.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/core</taglib-uri> <taglib-location>/WEB-INF/c.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/core-rt</taglib-uri> <taglib-location>/WEB-INF/c-rt.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri> <taglib-location>/WEB-INF/sql.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/sql-rt</taglib-uri> <taglib-location>/WEB-INF/sql-rt.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/x</taglib-uri> <taglib-location>/WEB-INF/x.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jstl/x-rt</taglib-uri> <taglib-location>/WEB-INF/x-rt.tld</taglib-location> </taglib> <!-- ejb management tags --> <taglib > <taglib-uri>ejbtags</taglib-uri> <taglib-location>/WEB-INF/lib/ejbtags.jar</taglib-location> </taglib> <!-- struts tags --> <taglib> <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri> <taglib-location>/WEB-INF/struts-bean.tld</taglib-location> </taglib> <taglib> <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri> <taglib-location>/WEB-INF/struts-html.tld</taglib-location> </taglib> <taglib> <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri> <taglib-location>/WEB-INF/struts-logic.tld</taglib-location> </taglib> <taglib> <taglib-uri>/WEB-INF/struts-template.tld</taglib-uri> <taglib-location>/WEB-INF/struts-template.tld</taglib-location> </taglib> <!-- prolix tags --> <taglib> <taglib-uri>/WEB-INF/checkLogin.tld</taglib-uri> <taglib-location>/WEB-INF/checkLogin.tld</taglib-location> </taglib> |