Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 146 → Rev 151

/impl/conf/language/MessageResources.properties
248,9 → 248,11
#Profile
profile.edited.sucess=Perfil alterado com sucesso
profile.enter.first.time=É a primeira vez que se esta a ligar, seja bem-vindo {0}
profile.edit=Aqui pode editar o seu perfil
profile.edit=Editar Perfil
profile.email.change=*Para alterar o seu email dirija-se aos serviços centrais
profile.search.user=Procurar Utilizador
profile.search.user.not.find=Não foram encontrados registo com esse valor
profile.search.user.find=Foram encontrados {0} registo com esse valor
 
#Cursos
course.aa=Acessoria e Administração
/impl/conf/WEB-INF/struts/tiles-default.xml
271,10 → 271,12
<!-- Profile -->
<definition name="page.load.profile" extends="base.layout1">
<put name="title" value="Edit Profile" />
<put name="topnav" value="/admin/profile/topnavEditProfile.jsp"/>
<put name="body" value="/admin/profile/profile.jsp" />
</definition>
<definition name="page.find.profile" extends="base.layout1">
<put name="title" value="Find User Profile" />
<put name="topnav" value="/admin/profile/topnavSearchProfile.jsp"/>
<put name="body" value="/admin/profile/findUser.jsp" />
</definition>
 
/impl/conf/WEB-INF/web.xml
6,6 → 6,10
 
 
<filter>
<filter-name>CookieFilter</filter-name>
<filter-class>pt.estgp.estgweb.web.filters.CookieFilter</filter-class>
</filter>
<filter>
<filter-name>UserSessionFilter</filter-name>
<filter-class>pt.estgp.estgweb.web.filters.UserSessionFilter</filter-class>
</filter>
35,6 → 39,10
</filter>
 
<filter-mapping>
<filter-name>CookieFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Set-Character-Encoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
/impl/conf/app.properties
19,8 → 19,8
ionline.pass=baco
ionline.user=Baco_web
 
#server.estgp=http://localhost/testes/nova_web
server.estgp=http://localhost:8080/estgweb
server.estgp=http://www.estgp.pt/testes/nova_web
#server.estgp=http://localhost:8080/estgweb
server.estgweb=http://www.estgp.pt/testes/estgweb
estgweb.encoding=UTF-8
estgp.encoding=UTF-8
/impl/src/java/jomm/web/filter/SetCharacterEncodingFilter.java
26,7 → 26,9
import javax.servlet.ServletResponse;
 
public class SetCharacterEncodingFilter implements Filter{
 
private static Logger logger = Logger.getLogger(SetCharacterEncodingFilter.class);
 
private FilterConfig filterConfig = null;
private String encoding = null;
37,6 → 39,7
IOException, ServletException {
 
 
//try{
HttpServletRequest hrequest = (HttpServletRequest) request;
hrequest.getSession().setMaxInactiveInterval(900);
 
47,6 → 50,11
hrequest.setCharacterEncoding(encoding);
}
chain.doFilter(request, response);
/*}
catch (IllegalStateException e)
{
logger.warn(e);
}*/
}
public void init(FilterConfig filterConfig) throws
/impl/src/java/pt/estgp/estgweb/Globals.java
36,8 → 36,8
public static final int ANNOUNCEMENT_TYPE_TOP_FLASH_NEWS_TIMEOUT = ConfigProperties.getIntProperty("announcements.top.flash.news.timeout.miliseconds");
public static List<String> USER_ROLES = ConfigProperties.getListValues("user.role");
 
public static final String STUDENT_ROLE = ConfigProperties.getProperty("role.student");
public static final String TEACHER_ROLE = ConfigProperties.getProperty("role.teacher");
public static final String STUDENT_ROLE = ConfigProperties.getProperty("user.student");
public static final String TEACHER_ROLE = ConfigProperties.getProperty("user.teacher");
public static final BigDecimal SIGES_INSTITUTION_CODE = new BigDecimal(ConfigProperties.getIntProperty("siges.institution.code"));
 
public static final long URL_STAT_CHART_EXPIRE_INTERVAL = ConfigProperties.getIntProperty("url.stat.image.expire.interval.time.minutes");
/impl/src/java/pt/estgp/estgweb/web/utils/RequestUtils.java
8,6 → 8,7
 
import org.apache.struts.action.ActionMessages;
import org.apache.struts.action.ActionMessage;
import jomm.utils.BytesUtils;
 
/**
* @author Jorge Machado
37,8 → 38,31
Cookie cookie = new Cookie("bacoSession", request.getSession().getId());
response.addCookie(cookie);
return cookie.getValue();
}
throw new NoCookiesException();
}
 
public static boolean existRequester(HttpServletRequest request, HttpServletResponse response) throws NoCookiesException
{
if(request.getCookies() == null || request.getCookies().length == 0)
{
Cookie cookie = new Cookie("bacoSession", BytesUtils.generateHexKey());
response.addCookie(cookie);
return false;
}
else if(request.getCookies() != null && request.getCookies().length > 0)
{
for(Cookie cookie: request.getCookies())
{
if(cookie.getName().equals("bacoSession"))
{
return true;
}
}
Cookie cookie = new Cookie("bacoSession",BytesUtils.generateHexKey());
response.addCookie(cookie);
return false;
}
throw new NoCookiesException();
}
 
/impl/src/java/pt/estgp/estgweb/web/controllers/profile/ProfileController.java
32,8 → 32,8
 
private static final Logger logger = Logger.getLogger(ProfileController.class);
private static final String TARGET_ROLES_KEY = AddRolesForm.TARGET_ROLES_KEY;
 
 
public ActionForward editUser(ActionMapping mapping,
ActionForm form ,
HttpServletRequest request,
54,7 → 54,7
if(userSession.getUser().getId()==user.getId()){
userSession.setUser(user);
request.setAttribute(Globals.USER_SESSION_KEY,userSession);
logger.info("Puting new user info in session:" + user.getId());
logger.info("Puting new user info in session:" + user.getId());
}
addMessage(request,"profile.edited.sucess");
return mapping.findForward("success");
95,7 → 95,7
pF.setUserView(uV);
pF.setSelectedRoles(uV.getUserRoles());
userSession.put(TARGET_ROLES_KEY, (Serializable) uV.getUserRoles());
userSession.serialize(request,response);
userSession.serialize(request,response);
return mapping.findForward("load");
}
catch(FilterChainFailedException e)
124,6 → 124,10
List<UserView> uVs = (List<UserView>) sm.execute(RequestUtils.getRequester(request, response),"SearchUser",args,names);
profileForm.setUsersFind(uVs);
request.setAttribute("ProfileForm",profileForm);
if(uVs.size()!=0)
addMessage(request,"profile.search.user.find",""+uVs.size());
else
addMessage(request,"profile.search.user.not.find");
return mapping.findForward("search");
}
catch(FilterChainFailedException e)
/impl/src/java/pt/estgp/estgweb/web/filters/CookieFilter.java
New file
0,0 → 1,52
package pt.estgp.estgweb.web.filters;
 
import pt.estgp.estgweb.web.utils.RequestUtils;
 
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
 
/**
*
* @author Jorge Machado
*/
 
public class CookieFilter implements Filter
{
 
public CookieFilter()
{
}
 
public void init(FilterConfig config)
{
 
}
 
/**
*
* @param request The servlet request we are processing
* @param chain The filter chain we are processing
*
* @exception java.io.IOException if an input/output error occurs
* @exception javax.servlet.ServletException if a servlet error occurs
*/
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException
{
if(RequestUtils.existRequester((HttpServletRequest)request,(HttpServletResponse)response))
{
chain.doFilter(request, response);
}
else
{
((HttpServletResponse)response).sendRedirect(((HttpServletRequest)request).getContextPath() + "/Welcome.do");
}
}
 
public void destroy()
{
// Nothing
}
}
/impl/src/java/pt/estgp/estgweb/web/filters/UserSessionFilter.java
75,6 → 75,10
}
chain.doFilter(request,response);
}
//catch (IllegalStateException e)
//{
// logger.warn(e);
//}
catch (Throwable e)
{
if(e instanceof NoCookiesException)
83,6 → 87,7
}
else
{
 
logger.error(e,e);
((HttpServletResponse)response).sendError(500);
}
/impl/src/web/index.jsp
1,3 → 1,4
<%@ page import="pt.estgp.estgweb.web.utils.RequestUtils" %>
<%@page language="java" contentType="UTF-8" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<logic:forward name="welcome"/>
/impl/src/web/admin/profile/topnavEditProfile.jsp
New file
0,0 → 1,12
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.util.*"%>
<%@ page import="jomm.web.utils.NavPlace" %>
<%@ page import="jomm.web.utils.NavPlaceServer" %>
<%@ page import="jomm.web.utils.TopNav" %>
<%
TopNav topNav = NavPlaceServer.getInstance().createTopNav(request);
topNav.addNavPlace("/Welcome.do", "Home");
topNav.addNavPlace(null, "profile.edit");
%>
<jsp:include page="/layout/topnav.jsp"/>
/impl/src/web/admin/profile/topnavSearchProfile.jsp
New file
0,0 → 1,12
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.util.*"%>
<%@ page import="jomm.web.utils.NavPlace" %>
<%@ page import="jomm.web.utils.NavPlaceServer" %>
<%@ page import="jomm.web.utils.TopNav" %>
<%
TopNav topNav = NavPlaceServer.getInstance().createTopNav(request);
topNav.addNavPlace("/Welcome.do", "Home");
topNav.addNavPlace(null, "profile.search.user");
%>
<jsp:include page="/layout/topnav.jsp"/>
/impl/src/web/admin/profile/findUser.jsp
23,7 → 23,6
</td>
</tr>
</table>
 
<logic:present name="ProfileForm" property="usersFind">
<ul>
<logic:iterate id="userView" name="ProfileForm" property="usersFind" type="pt.estgp.estgweb.domain.views.UserView">
31,4 → 30,5
</logic:iterate>
</ul>
</logic:present>
 
</html:form>
/impl/src/web/admin/profile/profile.jsp
14,7 → 14,6
<input type="hidden" name="dispatch" value="editUser">
<html:hidden property="userView.id"/>
<html:hidden property="role"/>
<bean:message key="profile.edit"/>
 
<table class="form">
<estgweb:isNotAdmin>
/impl/src/web/css/style.css
6,7 → 6,9
 
/****************************Text Size*************************************************/
 
form ul {
 
 
form ul,.errorPage ul {
margin-left: 15px;
}
 
39,7 → 41,7
.pFooter a {
font-style: italic;
}
.content .pFooter a:hover
#content .pFooter a:hover
{
color:white;
}
75,7 → 77,7
PADDING-TOP: 43px;
}
 
TD.rightPage, TD.rightPagePortal {
TD#rightPage, TD.rightPagePortal {
VERTICAL-ALIGN: top; /*WIDTH: 160px;*/
}
 
94,15 → 96,15
 
}
 
.content h2 a {
#content h2 a {
font-size: 0.8em;
}
 
.content h2 {
#content h2 {
font-size: 1em;
}
 
#pageStructure .content {
#pageStructure #content {
border-right: 0;
border-top: 0;
border-bottom: 0;
110,7 → 112,7
margin-right:1px;
}
 
#pageStructure td.content {
#pageStructure td#content {
border-left: 1px solid #8ec73f;
border-right: 1px solid #8ec73f;
border-bottom: 1px solid #8ec73f;
128,25 → 130,26
height: 167px;
}
 
.content .imageAnnouncement img {
#content .imageAnnouncement img {
width: 341px;
height: 167px;
}
 
 
.content {
#content {
border: 1px solid #8ec73f;
text-align:left;
}
 
.content a:link, .content a:visited {
#content a:link, .content a:visited {
color: #4d4d4d;
}
 
.content a:hover {
#content a:hover {
color: #8EC73F
}
 
.content, .contentPortal {
#content, .contentPortal {
LEFT: 0;
RIGHT: 0;
WIDTH: 100%;
508,7 → 511,7
 
/*Isto tem de ser generico o H1 jáe um header nao necessita da classe .header para nada*/
/*Block Titles*/
.content h1, #lastnews h1 {
#content h1, #lastnews h1 {
margin-bottom: 1px;
color: #FFFFFF;
background-color: #8EC73F;
/impl/src/web/layout/errorLayout.jsp
1,30 → 1,43
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
<%@ page contentType="text/html" %>
<%@ page pageEncoding="UTF-8" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
<html:html locale="true">
<head>
<html:base />
<title><bean:message key="site.title"/> - <tiles:getAsString name="title"/></title>
<html:base/>
<title>
<bean:message key="site.title"/>
-
<tiles:getAsString name="title"/>
</title>
<jsp:include page="/layout/scripts.jsp"/>
</head>
<body>
<div id="header">
<tiles:insert attribute="header"/>
</div>
<table id="bigtable">
<table width="100%">
<tr>
<td id="content">
<tiles:insert attribute="body" />
<td align="center">
<div id="body">
<div id="header">
<tiles:insert attribute="header"/>
</div>
<table id="page" width="100%">
<tr>
<td id="content" class="errorPage">
<tiles:insert attribute="body"/>
</td>
</tr>
</table>
<div id="footer">
<tiles:insert attribute="footer"/>
</div>
</div>
</td>
</tr>
</table>
<div id="footer">
<tiles:insert attribute="footer"/>
</div>
</body>
</html:html>
/impl/src/web/layout/layout1.jsp
34,7 → 34,7
<td id="leftPage">
<tiles:insert attribute="navigation"/>
</td>
<td class="content">
<td id="content">
<tiles:insert attribute="topnav"/>
<tiles:insert attribute="body"/>
</td>
/impl/src/web/layout/layout2.jsp
24,7 → 24,7
<td><tiles:insert attribute="navigationTop"/></td>
</tr>
<tr>
<td class="content">
<td id="content">
<tiles:insert attribute="topnav"/>
<tiles:insert attribute="body" />
</td>
/impl/src/web/layout/layoutPortal.jsp
38,7 → 38,7
 
<tiles:insert attribute="body" />
</td>
<td class="rightPagePortal">
<td id="rightPagePortal">
<tiles:insert attribute="navigationRight"/>
</td>
</tr>
/impl/src/web/layout/layout3.jsp
24,11 → 24,11
<td colspan="2"><tiles:insert attribute="navigationTop"/></td>
</tr>
<tr>
<td class="content">
<td id="content">
<tiles:insert attribute="topnav"/>
<tiles:insert attribute="body" />
</td>
<td class="rightPage">
<td id="rightPage">
<tiles:insert attribute="navigation" />
</td>
</tr>
/impl/src/web/layout/layout4.jsp
29,11 → 29,11
<td id="leftPage">
<tiles:insert attribute="navigationLeft" />
</td>
<td class="content">
<td id="content">
<tiles:insert attribute="topnav"/>
<tiles:insert attribute="body" />
</td>
<td class="rightPage">
<td id="rightPage">
<tiles:insert attribute="navigationRight"/>
</td>
</tr>
/impl/src/web/layout/layoutintranet.jsp
23,7 → 23,7
<td><tiles:insert attribute="navigationTop"/></td>
</tr>
<tr>
<td class="content">
<td id="content">
<tiles:insert attribute="topnav"/>
<tiles:insert attribute="separators"/>
<tiles:insert attribute="body" />
/impl/src/web/public/index.jsp
27,7 → 27,7
 
<script type="text/javascript">
<!--
getFlashNews('<%=request.getContextPath()%>/public/announcements/getFlashNews.jsp',<%=Globals.ANNOUNCEMENT_TYPE_TOP_FLASH_NEWS_TIMEOUT%>);
getFlashNews('<%=request.getContextPath()%>/public/announcements/getFlashNews.jsp',<%=Globals.ANNOUNCEMENT_TYPE_TOP_FLASH_NEWS_TIMEOUT%>);
-->
</script>
 
/impl/etc/todo/todo.txt
5,10 → 5,10
Modulo de Gestão de utilizadores Fabio
Eventos com controlo de listagem e controlo de Pagamentos Fabio
 
####
################################### feito #############################
No startEditProfile temos de por uma TopNav Fabio
>>>Aqui pode editar o seu perfil
####
######################################################################
 
####
O Login ainda não vai procurar os users à base de dados Fabio (Fluxograma de identificação, no caso do docente procura pelo email, no aluno por login que ficará preenchido com a importação)