Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 149 → Rev 152

/impl/conf/WEB-INF/struts/struts-default.xml
10,8 → 10,7
<form-beans>
<!-- Import -->
<!--<form-bean type="pt.estgp.estgweb.web.form.announcements.AnnouncementsForm" name="AnnouncementsForm"/>-->
<form-bean type="pt.estgp.estgweb.web.form.EmptyForm" name="EmptyForm"/>
<form-bean type="pt.estgp.estgweb.web.form.profile.ProfileForm" name="ProfileForm"/>
<form-bean type="pt.estgp.estgweb.web.form.EmptyForm" name="EmptyForm"/>
<!--<form-bean type="com.innovkey.opt.imports.web.ImportForm" name="ImportForm"/>-->
</form-beans>
 
118,7 → 117,7
parameter="dispatch"
validate="false"
input="page.authentication">
<forward name="success" path="page.authentication.ok"/>
<forward name="success" path="page.separators.home"/>
<forward name="logout" path="page.logout.ok"/>
<forward name="firstTimeAuthenticate" path="page.first.time.authenticate"/>
</action>
126,21 → 125,12
<!--Profile-->
<action path="/startEditProfile" forward="/profile.do?dispatch=changeProfile"/>
<action path="/findProfile" forward="page.find.profile"/>
<action path="/profile"
type="pt.estgp.estgweb.web.controllers.profile.ProfileController"
name="ProfileForm"
scope="request"
parameter="dispatch"
validate="false"
input="page.load.profile">
<forward name="success" path="page.welcome"/>
<forward name="load" path="page.load.profile"/>
<forward name="search" path="page.find.profile"/>
</action>
 
 
 
 
 
 
</action-mappings>
<controller processorClass="org.apache.struts.tiles.TilesRequestProcessor" />
<message-resources parameter="MessageResources"/>
158,7 → 148,8
/WEB-INF/struts/tiles-searchusers.xml,
/WEB-INF/struts/tiles-urlstat.xml,
/WEB-INF/struts/tiles-blog.xml,
/WEB-INF/struts/tiles-commons.xml"/>
/WEB-INF/struts/tiles-commons.xml,
/WEB-INF/struts/tiles-intranet.xml"/>
</plug-in>
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
/impl/conf/WEB-INF/struts/struts-intranet.xml
New file
0,0 → 1,41
<?xml version="1.0" encoding="UTF-8"?>
 
<!--<!DOCTYPE struts-config PUBLIC-->
<!--"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"-->
<!--"http://struts.apache.org/dtds/struts-config_1_3.dtd">-->
 
<struts-config>
 
<form-beans>
<form-bean type="pt.estgp.estgweb.web.form.profile.ProfileForm" name="ProfileForm"/>
</form-beans>
 
<global-exceptions>
 
</global-exceptions>
 
<global-forwards>
 
</global-forwards>
 
 
<action-mappings>
 
<action path="/user/home" forward="page.separators.home"/>
 
<action path="/user/serviceZone" forward="page.separators.serviceZone"/>
<action path="/user/profile"
type="pt.estgp.estgweb.web.controllers.profile.ProfileController"
name="ProfileForm"
scope="request"
parameter="dispatch"
validate="false"
input="page.load.profile">
<forward name="success" path="page.separators.home"/>
<forward name="load" path="page.separators.profile"/>
<forward name="search" path="page.find.profile"/><!--ToDo Refazer a organizacao dos servicos administrativos-->
</action>
</action-mappings>
</struts-config>
/impl/conf/WEB-INF/struts/tiles-courseunits.xml
7,12 → 7,8
<tiles-definitions>
 
<definition name="base.separators" extends="base.definition" path="/layout/layoutintranet.jsp">
<put name="separators" value="/layout/separators.jsp" />
</definition>
<definition name="page.separators.home" extends="base.separators">
<put name="body" value="/user/home.jsp" />
</definition>
 
 
 
/impl/conf/WEB-INF/struts/tiles-intranet.xml
New file
0,0 → 1,30
<?xml version="1.0" encoding="UTF-8" ?>
 
<!--<!DOCTYPE tiles-definitions PUBLIC-->
<!--"-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"-->
<!--"http://struts.apache.org/dtds/tiles-config_1_1.dtd">-->
 
<tiles-definitions>
 
<definition name="base.separators" extends="base.definition" path="/layout/layoutintranet.jsp">
<put name="header" value="/layout/headerIntranet.jsp"/>
<put name="navigationTop" value="/layout/topnavempty.jsp"/>
<put name="separators" value="/layout/separators.jsp" />
</definition>
 
 
<definition name="page.separators.serviceZone" extends="base.separators">
<put name="body" value="/user/serviceZone/serviceZone.jsp" />
</definition>
<definition name="page.separators.profile" extends="base.separators">
<put name="body" value="/admin/profile/profile.jsp" />
</definition>
<definition name="page.separators.home" extends="base.separators">
<put name="body" value="/user/home.jsp" />
</definition>
 
</tiles-definitions>
/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>
76,7 → 84,8
/WEB-INF/struts/struts-searchusers.xml,
/WEB-INF/struts/struts-urlstat.xml,
/WEB-INF/struts/struts-blog.xml,
/WEB-INF/struts/struts-commons.xml
/WEB-INF/struts/struts-commons.xml,
/WEB-INF/struts/struts-intranet.xml
</param-value>
</init-param>
<init-param>
/impl/conf/berserk/sd.xml
188,6 → 188,17
<chain name="Session"/>
</filterChains>
</service>
<service>
<name>LoadOwnerAnnouncements</name>
<implementationClass>pt.estgp.estgweb.services.announcements.LoadOwnerAnnouncements</implementationClass>
<description>Load owner Blogs</description>
<isTransactional>true</isTransactional>
<filterChains>
<chain name="Logger"/>
<chain name="Session"/>
<chain name="AuthenticatedUsers"/>
</filterChains>
</service>
 
 
<!--Teste-->
224,6 → 235,28
<chain name="Session"/>
</filterChains>
</service>
<service>
<name>LoadEditableBlogs</name>
<implementationClass>pt.estgp.estgweb.services.blogs.LoadEditableBlogs</implementationClass>
<description>Load editable Blogs</description>
<isTransactional>true</isTransactional>
<filterChains>
<chain name="Logger"/>
<chain name="Session"/>
<chain name="AuthenticatedUsers"/>
</filterChains>
</service>
<service>
<name>LoadOwnerBlogs</name>
<implementationClass>pt.estgp.estgweb.services.blogs.LoadOwnerBlogs</implementationClass>
<description>Load owner Blogs</description>
<isTransactional>true</isTransactional>
<filterChains>
<chain name="Logger"/>
<chain name="Session"/>
<chain name="AuthenticatedUsers"/>
</filterChains>
</service>
 
 
<!--CommonServices-->
/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/services/blogs/LoadEditableBlogs.java
New file
0,0 → 1,36
package pt.estgp.estgweb.services.blogs;
 
import pt.utl.ist.berserk.logic.serviceManager.IService;
import pt.estgp.estgweb.domain.views.BlogView;
import pt.estgp.estgweb.domain.UserSession;
import pt.estgp.estgweb.domain.BlogImpl;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.services.expceptions.ServiceException;
import org.apache.log4j.Logger;
 
import java.util.List;
import java.util.ArrayList;
 
/**
* @author Jorge Machado
* @date 19/Mai/2008
* @see pt.estgp.estgweb.services.blogs
*/
public class LoadEditableBlogs implements IService
{
private static final Logger logger = Logger.getLogger(LoadBlogService.class);
 
public List<BlogView> run(UserSession userSession) throws ServiceException
{
boolean internal = true;
if (userSession.getUser() == null)
internal = false;
List<BlogImpl> blogs = DaoFactory.getBlogDaoImpl().findBlogs(userSession.getUser().getRolesList(), internal);
List<BlogView> blogViews = new ArrayList<BlogView>();
for(BlogImpl b: blogs)
{
blogViews.add(new BlogView(b));
}
return blogViews;
}
}
/impl/src/java/pt/estgp/estgweb/services/blogs/LoadOwnerBlogs.java
New file
0,0 → 1,33
package pt.estgp.estgweb.services.blogs;
 
import pt.utl.ist.berserk.logic.serviceManager.IService;
import pt.estgp.estgweb.domain.views.BlogView;
import pt.estgp.estgweb.domain.UserSession;
import pt.estgp.estgweb.domain.BlogImpl;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.services.expceptions.ServiceException;
import org.apache.log4j.Logger;
 
import java.util.List;
import java.util.ArrayList;
 
/**
* @author Jorge Machado
* @date 19/Mai/2008
* @see pt.estgp.estgweb.services.blogs
*/
public class LoadOwnerBlogs implements IService
{
private static final Logger logger = Logger.getLogger(LoadBlogService.class);
 
public List<BlogView> run(UserSession userSession) throws ServiceException
{
List<BlogImpl> blogs = DaoFactory.getBlogDaoImpl().loadOwnedBlogs(userSession.getUser().getId());
List<BlogView> blogViews = new ArrayList<BlogView>();
for(BlogImpl b: blogs)
{
blogViews.add(new BlogView(b));
}
return blogViews;
}
}
/impl/src/java/pt/estgp/estgweb/services/announcements/LoadOwnerAnnouncements.java
New file
0,0 → 1,36
package pt.estgp.estgweb.services.announcements;
 
import pt.utl.ist.berserk.logic.serviceManager.IService;
import pt.estgp.estgweb.services.blogs.LoadBlogService;
import pt.estgp.estgweb.services.expceptions.ServiceException;
import pt.estgp.estgweb.domain.views.BlogView;
import pt.estgp.estgweb.domain.views.AnnouncementView;
import pt.estgp.estgweb.domain.UserSession;
import pt.estgp.estgweb.domain.BlogImpl;
import pt.estgp.estgweb.domain.AnnouncementImpl;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import org.apache.log4j.Logger;
 
import java.util.List;
import java.util.ArrayList;
 
/**
* @author Jorge Machado
* @date 19/Mai/2008
* @see pt.estgp.estgweb.services.blogs
*/
public class LoadOwnerAnnouncements implements IService
{
private static final Logger logger = Logger.getLogger(LoadBlogService.class);
 
public List<AnnouncementView> run(UserSession userSession) throws ServiceException
{
List<AnnouncementImpl> announcements = DaoFactory.getAnnouncementDaoImpl().loadOwnedAnnouncements(userSession.getUser().getId());
List<AnnouncementView> announcementViews = new ArrayList<AnnouncementView>();
for(AnnouncementImpl announcement: announcements)
{
announcementViews.add(new AnnouncementView(announcement));
}
return announcementViews;
}
}
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/AnnouncementDaoImpl.java
1,8 → 1,6
package pt.estgp.estgweb.domain.dao.impl;
 
import pt.estgp.estgweb.domain.Announcement;
import pt.estgp.estgweb.domain.User;
import pt.estgp.estgweb.domain.GenericUser;
import pt.estgp.estgweb.domain.*;
import pt.estgp.estgweb.services.common.ISearchResults;
import pt.estgp.estgweb.services.common.SearchTypeEnum;
 
24,21 → 22,26
* @time 2:51:06
* @see pt.estgp.estgweb.domain.dao.impl
*/
public class AnnouncementDaoImpl extends AnnouncementDao {
public static AnnouncementDaoImpl getInstance() {
public class AnnouncementDaoImpl extends AnnouncementDao
{
public static AnnouncementDaoImpl getInstance()
{
if (myInstance == null)
myInstance = new AnnouncementDaoImpl();
return (AnnouncementDaoImpl) myInstance;
}
 
public List<Announcement> findAnnouncements(int maxAnnouncements, List<String> roles, String subTarget,boolean internal) {
if (roles == null) {
public List<Announcement> findAnnouncements(int maxAnnouncements, List<String> roles, String subTarget, boolean internal)
{
if (roles == null)
{
roles = new ArrayList<String>();
roles.add("all");
}
Criteria criteria = createCriteria();
Criterion co = null;
for (String role : roles) {
for (String role : roles)
{
Criterion cor = like("targetRoles", "%" + role + "%");
if (co == null)
co = cor;
47,14 → 50,16
}
Criterion coSubTargets = null;
 
if (subTarget == null) {
if (subTarget == null)
{
coSubTargets = isNull("subTargets");
}
else {
else
{
coSubTargets = eq("subTargets", subTarget);
}
if(!internal)
criteria.add(eq("internal",false));
if (!internal)
criteria.add(eq("internal", false));
MyCalendar cNow = new MyCalendar();
MyCalendar calendarWithOutTime = new MyCalendar(cNow.getYear(), cNow.getMonth(), cNow.getDay());
Date now = calendarWithOutTime.getTime();
68,38 → 73,46
return criteria.list();
}
 
public List<Announcement> findAnnouncements(int maxAnnouncements, List<String> roles, String type, String subTarget, boolean internal) {
return findAnnouncements(0, maxAnnouncements, roles, type, subTarget,internal);
public List<Announcement> findAnnouncements(int maxAnnouncements, List<String> roles, String type, String subTarget, boolean internal)
{
return findAnnouncements(0, maxAnnouncements, roles, type, subTarget, internal);
}
 
public List<Announcement> findAnnouncements(int startPage, int maxAnnouncements, List<String> roles, String type, String subTarget,boolean internal) {
Criteria criteria = createMaxAnnouncementsRolesTypeCriteria(maxAnnouncements, roles, type, subTarget,internal);
public List<Announcement> findAnnouncements(int startPage, int maxAnnouncements, List<String> roles, String type, String subTarget, boolean internal)
{
Criteria criteria = createMaxAnnouncementsRolesTypeCriteria(maxAnnouncements, roles, type, subTarget, internal);
return criteria.setFirstResult(maxAnnouncements * startPage).list();
}
 
public int countAnnouncements(int maxAnnouncements, List<String> roles, String type, String subTarget,boolean internal) {
Criteria criteria = createMaxAnnouncementsRolesTypeCriteria(Integer.MAX_VALUE, roles, type, subTarget,internal);
public int countAnnouncements(int maxAnnouncements, List<String> roles, String type, String subTarget, boolean internal)
{
Criteria criteria = createMaxAnnouncementsRolesTypeCriteria(Integer.MAX_VALUE, roles, type, subTarget, internal);
return criteria.list().size();
}
 
private Criteria createMaxAnnouncementsRolesTypeCriteria(int maxAnnouncements, List<String> roles, String type, String subTarget,boolean internal) {
return createMaxAnnouncementsPageRolesTypeCriteria(0, maxAnnouncements, roles, type, subTarget,internal);
private Criteria createMaxAnnouncementsRolesTypeCriteria(int maxAnnouncements, List<String> roles, String type, String subTarget, boolean internal)
{
return createMaxAnnouncementsPageRolesTypeCriteria(0, maxAnnouncements, roles, type, subTarget, internal);
}
 
private Criteria createMaxAnnouncementsPageRolesTypeCriteria(int page, int maxAnnouncements, List<String> roles, String type, String subTarget,boolean internal) {
return createRolesTypeCriteria(roles, type, subTarget,internal)
private Criteria createMaxAnnouncementsPageRolesTypeCriteria(int page, int maxAnnouncements, List<String> roles, String type, String subTarget, boolean internal)
{
return createRolesTypeCriteria(roles, type, subTarget, internal)
.setFirstResult(page * maxAnnouncements)
.setMaxResults(maxAnnouncements);
}
 
private Criteria createRolesTypeCriteria(List<String> roles, String type, String subTarget,boolean internal) {
if (roles == null) {
private Criteria createRolesTypeCriteria(List<String> roles, String type, String subTarget, boolean internal)
{
if (roles == null)
{
roles = new ArrayList<String>();
roles.add("all");
}
Criteria criteria = createCriteria();
Criterion coRole = null;
for (String role : roles) {
for (String role : roles)
{
Criterion cor = like("targetRoles", "%" + role + "%");
if (coRole == null)
coRole = cor;
108,18 → 121,20
}
Criterion coSubTargets = null;
 
if (subTarget == null) {
if (subTarget == null)
{
coSubTargets = isNull("subTargets");
}
else {
else
{
coSubTargets = eq("subTargets", subTarget);
}
if (type != null)
criteria.add(eq("type", type));
 
if(!internal)
criteria.add(eq("internal",false));
if (!internal)
criteria.add(eq("internal", false));
 
MyCalendar cNow = new MyCalendar();
MyCalendar calendarWithOutTime = new MyCalendar(cNow.getYear(), cNow.getMonth(), cNow.getDay());
Date now = calendarWithOutTime.getTime();
153,29 → 168,34
AbstractDao.getCurrentSession().beginTransaction().commit();
}*/
 
public List<Announcement> searchAnnouncements(String query, SearchTypeEnum searchTypeEnum, int maxAnnouncements, int page, List<String> roles, String subTarget,boolean internal) {
public List<Announcement> searchAnnouncements(String query, SearchTypeEnum searchTypeEnum, int maxAnnouncements, int page, List<String> roles, String subTarget, boolean internal)
{
 
Criterion c = createSearchQuery(query, searchTypeEnum);
Criteria criteria = createMaxAnnouncementsPageRolesTypeCriteria(page, maxAnnouncements, roles, null, null,internal);
Criteria criteria = createMaxAnnouncementsPageRolesTypeCriteria(page, maxAnnouncements, roles, null, null, internal);
criteria.add(c);
return criteria.list();
}
 
public int countAnnouncements(String query, SearchTypeEnum searchTypeEnum, List<String> roles, String subTarget,boolean internal) {
public int countAnnouncements(String query, SearchTypeEnum searchTypeEnum, List<String> roles, String subTarget, boolean internal)
{
 
Criterion c = createSearchQuery(query, searchTypeEnum);
Criteria criteria = createRolesTypeCriteria(roles, null, null,internal);
Criteria criteria = createRolesTypeCriteria(roles, null, null, internal);
criteria.add(c);
return criteria.list().size();
}
 
public Criterion createSearchQuery(String query, SearchTypeEnum searchTypeEnum) {
public Criterion createSearchQuery(String query, SearchTypeEnum searchTypeEnum)
{
Criterion c = null;
if (searchTypeEnum == SearchTypeEnum.ExactPhrase)
c = or(like("text", "%" + query + "%"), like("title", "%" + query + "%"));
else if (searchTypeEnum == SearchTypeEnum.AllWords) {
else if (searchTypeEnum == SearchTypeEnum.AllWords)
{
String[] fields = query.split(" ");
for (String field : fields) {
for (String field : fields)
{
if (c == null)
c = or(like("text", "%" + field + "%"), like("title", "%" + field + "%"));
else
183,9 → 203,11
}
 
}
else {
else
{
String[] fields = query.split(" ");
for (String field : fields) {
for (String field : fields)
{
if (c == null)
c = or(like("text", "%" + field + "%"), like("title", "%" + field + "%"));
else
195,4 → 217,8
return c;
}
 
public List<AnnouncementImpl> loadOwnedAnnouncements(long ownerId)
{
return createCriteria().add(eq("owner.id", ownerId)).list();
}
}
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/BlogDaoImpl.java
1,13 → 1,19
package pt.estgp.estgweb.domain.dao.impl;
 
import pt.estgp.estgweb.domain.User;
import pt.estgp.estgweb.domain.BlogImpl;
import pt.estgp.estgweb.domain.Blog;
 
import java.util.List;
import java.util.Date;
import java.util.ArrayList;
import java.io.Serializable;
 
import org.hibernate.HibernateException;
import org.hibernate.criterion.Restrictions;
import org.hibernate.Criteria;
import static org.hibernate.criterion.Restrictions.*;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Order;
import jomm.dao.DaoException;
 
/**
18,7 → 24,9
*/
public class BlogDaoImpl extends BlogDao
{
private BlogDaoImpl(){}
private BlogDaoImpl()
{
}
 
public static BlogDaoImpl getInstance()
{
27,6 → 35,34
return (BlogDaoImpl) myInstance;
}
 
public List<BlogImpl> loadOwnedBlogs(long ownerId)
{
return createCriteria().add(eq("owner.id", ownerId)).list();
}
 
 
public List<BlogImpl> findBlogs(List<String> roles, boolean internal)
{
if (roles == null)
{
roles = new ArrayList<String>();
roles.add("all");
}
Criteria criteria = createCriteria();
Criterion co = null;
for (String role : roles)
{
Criterion cor = like("targetRoles", "%" + role + "%");
if (co == null)
co = cor;
else
co = or(co, cor);
}
if (!internal)
criteria.add(eq("internal", false));
if (co != null)
criteria.add(co);
criteria.add(eq("status", true))
.addOrder(Order.desc("title"));
return criteria.list();
}
}
/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/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/java/pt/estgp/estgweb/web/tags/IsAdminTag.java
10,18 → 10,33
import pt.estgp.estgweb.domain.UserImpl;
import pt.estgp.estgweb.Globals;
 
public class IsAdminTag extends BodyTagSupport {
public class IsAdminTag extends BodyTagSupport
{
 
private static final Logger logger = Logger.getLogger(IsAdminTag.class);
 
 
public int doStartTag() throws JspException {
return EVAL_BODY_TAG;
public int doStartTag() throws JspException
{
if (go())
{
return EVAL_BODY_TAG;
}
else
return SKIP_BODY;
 
}
public int doEndTag() throws JspException {
 
public boolean go()
{
UserSessionImpl userSession = (UserSessionImpl) pageContext.getRequest().getAttribute(Globals.USER_SESSION_KEY);
if(userSession != null && userSession.getUser() != null && (((UserImpl)userSession.getUser()).isSuperuserOrAdmin()))
return userSession != null && userSession.getUser() != null && ((userSession.getUser()).isSuperuserOrAdmin());
}
 
public int doEndTag() throws JspException
{
 
if (go())
{
String toPage = bodyContent.getString().trim();
JspWriter writer = pageContext.getOut();
29,9 → 44,9
{
writer.write(toPage);
}
catch(Exception e)
catch (Exception e)
{
logger.error(e,e);
logger.error(e, e);
throw new JspException(e);
}
}
/impl/src/java/pt/estgp/estgweb/web/tags/CanAddContentTag.java
40,15 → 40,24
 
public int doStartTag() throws JspException
{
return EVAL_BODY_TAG;
if (go())
{
return EVAL_BODY_TAG;
}
else
return SKIP_BODY;
}
public int doEndTag() throws JspException
 
public boolean go() throws JspException
{
 
UserSessionImpl userSession = (UserSessionImpl) pageContext.getRequest().getAttribute(pt.estgp.estgweb.Globals.USER_SESSION_KEY);
IAddContents iAddContents = (IAddContents) RequestUtils.lookup(pageContext, name, property, null);
return iAddContents != null && userSession.getUser() != null && (iAddContents.canAddContent(userSession.getUser()));
}
 
IAddContents iAddContents = (IAddContents) RequestUtils.lookup(pageContext, name, property, null);
if(iAddContents != null && userSession.getUser() != null && (iAddContents.canAddContent(userSession.getUser())))
public int doEndTag() throws JspException
{
if (go())
{
String toPage = bodyContent.getString().trim();
JspWriter writer = pageContext.getOut();
56,13 → 65,12
{
writer.write(toPage);
}
catch(Exception e)
catch (Exception e)
{
logger.error(e,e);
logger.error(e, e);
throw new JspException(e);
}
}
 
// Continue processing this page
return EVAL_PAGE;
}
/impl/src/java/pt/estgp/estgweb/web/tags/IsNotAdminTag.java
18,15 → 18,21
 
public int doStartTag() throws JspException
{
return EVAL_BODY_TAG;
if(go())
return EVAL_BODY_TAG;
else
return SKIP_BODY;
}
 
public int doEndTag() throws JspException
public boolean go()
{
 
UserSessionImpl userSession = (UserSessionImpl) pageContext.getRequest().getAttribute(Globals.USER_SESSION_KEY);
return !(userSession != null && userSession.getUser() != null && (((UserImpl) userSession.getUser()).isSuperuserOrAdmin()));
}
 
if (!(userSession != null && userSession.getUser() != null && (((UserImpl) userSession.getUser()).isSuperuserOrAdmin())))
public int doEndTag() throws JspException
{
if(go())
{
String toPage = bodyContent.getString().trim();
JspWriter writer = pageContext.getOut();
/impl/src/java/pt/estgp/estgweb/web/tags/IsSuperUserTag.java
10,17 → 10,28
import pt.estgp.estgweb.domain.UserImpl;
import pt.estgp.estgweb.Globals;
 
public class IsSuperUserTag extends BodyTagSupport {
public class IsSuperUserTag extends BodyTagSupport
{
 
private static final Logger logger = Logger.getLogger(IsSuperUserTag.class);
 
public int doStartTag() throws JspException {
return EVAL_BODY_TAG;
public int doStartTag() throws JspException
{
if (go())
return EVAL_BODY_TAG;
else
return SKIP_BODY;
}
public int doEndTag() throws JspException {
 
public boolean go()
{
UserSessionImpl userSession = (UserSessionImpl) pageContext.getRequest().getAttribute(Globals.USER_SESSION_KEY);
if(userSession!=null && userSession.getUser() !=null && ((UserImpl)userSession.getUser()).hasRole(Globals.SUPER_USER_ROLE))
return userSession != null && userSession.getUser() != null && (userSession.getUser()).hasRole(Globals.SUPER_USER_ROLE);
}
 
public int doEndTag() throws JspException
{
if (go())
{
String toPage = bodyContent.getString().trim();
JspWriter writer = pageContext.getOut();
28,13 → 39,12
{
writer.write(toPage);
}
catch(Exception e)
catch (Exception e)
{
logger.error(e,e);
logger.error(e, e);
throw new JspException(e);
}
}
 
// Continue processing this page
return EVAL_PAGE;
}
/impl/src/java/pt/estgp/estgweb/web/tags/CanManageTag.java
41,21 → 41,33
this.property = property;
}
 
public int doStartTag() throws JspException {
return EVAL_BODY_TAG;
public int doStartTag() throws JspException
{
if (go())
{
return EVAL_BODY_TAG;
}
else
return SKIP_BODY;
}
public int doEndTag() throws JspException
 
public boolean go() throws JspException
{
 
UserSessionImpl userSession = (UserSessionImpl) pageContext.getRequest().getAttribute(Globals.USER_SESSION_KEY);
 
IOwned owned = (IOwned) RequestUtils.lookup(pageContext, name, property, null);
IInternal iInternal = (IInternal) owned;
if(userSession.getUser() == null && iInternal.isInternal())
{
//do nothing
return false;
}
else if(owned != null && userSession.getUser() != null && (owned.isOwnedBy(userSession.getUser()) || ((UserImpl) userSession.getUser()).isSuperuserOrAdmin()))
else
return owned != null && userSession.getUser() != null && (owned.isOwnedBy(userSession.getUser()) || ((UserImpl) userSession.getUser()).isSuperuserOrAdmin());
}
 
public int doEndTag() throws JspException
{
if(go())
{
String toPage = bodyContent.getString().trim();
JspWriter writer = pageContext.getOut();
63,9 → 75,9
{
writer.write(toPage);
}
catch(Exception e)
catch (Exception e)
{
logger.error(e,e);
logger.error(e, e);
throw new JspException(e);
}
}
/impl/src/java/pt/estgp/estgweb/web/tags/HasRoleTag.java
12,7 → 12,8
import pt.estgp.estgweb.domain.UserSessionImpl;
import pt.estgp.estgweb.domain.UserImpl;
 
public class HasRoleTag extends BodyTagSupport {
public class HasRoleTag extends BodyTagSupport
{
 
private static final Logger logger = Logger.getLogger(HasRoleTag.class);
 
20,21 → 21,33
private String role;
 
 
public String getRole() {
public String getRole()
{
return role;
}
 
public void setRole(String role) {
public void setRole(String role)
{
this.role = role;
}
 
public int doStartTag() throws JspException {
return EVAL_BODY_TAG;
public int doStartTag() throws JspException
{
if(go())
return EVAL_BODY_TAG;
else
return SKIP_BODY;
}
public int doEndTag() throws JspException {
 
public boolean go()
{
UserSessionImpl userSession = (UserSessionImpl) pageContext.getRequest().getAttribute(Globals.USER_SESSION_KEY);
if(userSession!=null && userSession.getUser() !=null && ((UserImpl)userSession.getUser()).hasRole(role))
return userSession != null && userSession.getUser() != null && userSession.getUser().hasRole(role);
}
 
public int doEndTag() throws JspException
{
if (go())
{
String toPage = bodyContent.getString().trim();
JspWriter writer = pageContext.getOut();
42,9 → 55,9
{
writer.write(toPage);
}
catch(Exception e)
catch (Exception e)
{
logger.error(e,e);
logger.error(e, e);
throw new JspException(e);
}
}
/impl/src/java/pt/estgp/estgweb/web/tags/IsAuthenticatedTag.java
10,17 → 10,28
import pt.estgp.estgweb.domain.UserImpl;
import pt.estgp.estgweb.Globals;
 
public class IsAuthenticatedTag extends BodyTagSupport {
public class IsAuthenticatedTag extends BodyTagSupport
{
 
private static final Logger logger = Logger.getLogger(IsAuthenticatedTag.class);
 
public int doStartTag() throws JspException {
return EVAL_BODY_TAG;
public int doStartTag() throws JspException
{
if (go())
return EVAL_BODY_TAG;
else
return SKIP_BODY;
}
public int doEndTag() throws JspException {
 
public boolean go()
{
UserSessionImpl userSession = (UserSessionImpl) pageContext.getRequest().getAttribute(Globals.USER_SESSION_KEY);
if(userSession != null && userSession.getUser() != null)
return userSession != null && userSession.getUser() != null;
}
 
public int doEndTag() throws JspException
{
if (go())
{
String toPage = bodyContent.getString().trim();
JspWriter writer = pageContext.getOut();
28,13 → 39,12
{
writer.write(toPage);
}
catch(Exception e)
catch (Exception e)
{
logger.error(e,e);
logger.error(e, e);
throw new JspException(e);
}
}
 
// Continue processing this page
return EVAL_PAGE;
}
/impl/src/java/pt/estgp/estgweb/web/tags/IsNotAuthenticatedTag.java
9,17 → 9,28
import pt.estgp.estgweb.domain.UserSessionImpl;
import pt.estgp.estgweb.Globals;
 
public class IsNotAuthenticatedTag extends BodyTagSupport {
public class IsNotAuthenticatedTag extends BodyTagSupport
{
 
private static final Logger logger = Logger.getLogger(IsNotAuthenticatedTag.class);
 
public int doStartTag() throws JspException {
return EVAL_BODY_TAG;
public int doStartTag() throws JspException
{
if (go())
return EVAL_BODY_TAG;
else
return SKIP_BODY;
}
public int doEndTag() throws JspException {
 
public boolean go()
{
UserSessionImpl userSession = (UserSessionImpl) pageContext.getRequest().getAttribute(Globals.USER_SESSION_KEY);
if(userSession == null || userSession.getUser() == null)
return userSession == null || userSession.getUser() == null;
}
 
public int doEndTag() throws JspException
{
if (go())
{
String toPage = bodyContent.getString().trim();
JspWriter writer = pageContext.getOut();
27,9 → 38,9
{
writer.write(toPage);
}
catch(Exception e)
catch (Exception e)
{
logger.error(e,e);
logger.error(e, e);
throw new JspException(e);
}
}
/impl/src/web/imgs/exitBig.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/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/profile.jsp
10,7 → 10,7
 
<jomm:messages/>
<%--<jsp:useBean id="ProfileForm" class="pt.estgp.estgweb.web.form.profile.ProfileForm"/>--%>
<html:form action="/profile">
<html:form action="/user/profile">
<input type="hidden" name="dispatch" value="editUser">
<html:hidden property="userView.id"/>
<html:hidden property="role"/>
/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;
807,6 → 810,11
color: red;
}
 
.seccao ul
{
margin: 15px;
}
 
/*Butões*/
 
input[type="text"], input[type="password"] {
/impl/src/web/css/intranet.css
1,3 → 1,24
 
#headerIntranet td.links
{
}
#headerIntranet ul
{
list-style:none;
}
#headerIntranet ul li.exit
{
background-image: url(../imgs/exit.gif);
background-repeat: no-repeat;
background-attachment: scroll;
padding-top: 0.4em;
padding-right: 0.4em;
padding-bottom: 0.4em;
padding-left: 24px;
}
 
/* --- Main Navigation --- */
 
#body,#page
65,11 → 86,11
#testeTop ul li.selected a span { background: url(../images/0corner_right_span_01.gif) top right no-repeat; }
#testeTop ul li.selected a:hover { background: #ebe6d6 url(../images/0corner_left_span_01.gif) top left no-repeat; color: #000; }
#testeTop ul li.selected a:hover span { background: url(../images/0corner_right_span_01.gif) top right no-repeat; color: #000; }
#testeTop li a:hover { background: #23C71F url(../images/0corner_left_light_01.gif) top left repeat-x; }
#testeTop li a:hover { background: #ebd6f6 url(../images/0corner_left_light_01.gif) top left repeat-x; }
#testeTop li a:hover span { background: url(../images/0corner_right_light_01.gif) top right no-repeat; }
 
 
#testeTop a, #testeTop a:visited, #testeTop a:hover
#testeTop * a, #testeTop a:visited, #testeTop li a:hover
{
COLOR:BLACK;
}
/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/headerIntranet.jsp
New file
0,0 → 1,22
<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ 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" %>
<table width="100%" id="headerIntranet">
<tr>
<td class="title">
INTRANET - ESTG (<bean:write name="UserSession" property="user.name"/> online)
</td>
<td class="links">
<ul>
<li class="exit">
<html:link action="/Logout">
<bean:message key="logout"/>
</html:link>
</li>
</ul>
</td>
</tr>
</table>
/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
13,7 → 13,7
 
</head>
<body class="small" marginwidth="0" marginheight="0" bgcolor="#ffffff" topmargin="0" leftmargin="0" onload="horizontal();">
<body class="small" marginwidth="0" marginheight="0" bgcolor="#ffffff" topmargin="0" leftmargin="0">
<div id="body">
<div id="header">
<tiles:insert attribute="header"/>
23,10 → 23,12
<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" />
<table cellpadding="0" cellspacing="0" width="100%">
<tr><td><tiles:insert attribute="separators"/></td></tr>
<tr><td><tiles:insert attribute="body"/></td></tr>
</table>
</td>
</tr>
</table>
/impl/src/web/layout/navigationLeftAdmin.jsp
1,29 → 1,41
<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ 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" %>
<%@ taglib uri="/WEB-INF/tlds/estgweb.tld" prefix="estgweb" %>
<%@ page contentType="text/html; charset=UTF-8" language="java" %>
<%@ 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" %>
<%@ taglib uri="/WEB-INF/tlds/estgweb.tld" prefix="estgweb" %>
 
<div class="linkLeftMenu">
<div class="listClean">
<ul>
<li>
<html:link action="/Welcome"><bean:message key="Home"/></html:link>
</li>
 
 
<estgweb:isNotAuthenticated>
<li>
<html:link action="/StartAuthentication"><bean:message key="authenticate"/></html:link>
<html:link action="/Welcome">
<bean:message key="Home"/>
</html:link>
</li>
<li>
<html:link action="/StartAuthentication">
<bean:message key="authenticate"/>
</html:link>
</li>
</estgweb:isNotAuthenticated>
 
 
<estgweb:isAuthenticated>
<li>
<html:link action="/Logout"><bean:message key="logout"/></html:link>
<html:link action="/user/home">
<bean:message key="Home"/> (<bean:write name="UserSession" property="user.name"/>)
</html:link>
</li>
<li>
<html:link action="/Logout">
<bean:message key="logout"/>
</html:link>
</li>
</estgweb:isAuthenticated>
</ul>
</div>
/impl/src/web/layout/separators.jsp
8,14 → 8,25
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div id="testeTop">
<%
int sep = Integer.parseInt(request.getParameter("separator"));
int sep = 1;
try
{
sep = Integer.parseInt(request.getParameter("separator"));
}
catch(NumberFormatException e)
{}
catch(NullPointerException e)
{}
 
String sep1 = "";
String sep2 = "";
String sep3 = "";
String sep4 = "";
 
String link1 = "href=\"" + request.getContextPath() + "/startTeste2.do?separator=1\"";
String link2 = "href=\"" + request.getContextPath() + "/startTeste2.do?separator=2\"";
String link3 = "href=\"" + request.getContextPath() + "/startTeste2.do?separator=3\"";
String link1 = "href=\"" + request.getContextPath() + "/user/home.do?separator=1\"";
String link2 = "href=\"" + request.getContextPath() + "\"";
String link3 = "href=\"" + request.getContextPath() + "/user/profile.do?separator=3&dispatch=changeProfile\"";
String link4 = "href=\"" + request.getContextPath() + "/user/serviceZone.do?separator=4\"";
 
if(sep == 1)
{
32,6 → 43,11
link3 = "";
sep3 ="class=\"selected\"";
}
else if(sep == 4)
{
link4 = "";
sep4 ="class=\"selected\"";
}
%>
<div id="separators">
<ul>
41,6 → 57,6
</li>
<li <%=sep2%>> <a <%=link2%>> <span>Cadeiras</span> </a></li>
<li <%=sep3%>> <a <%=link3%>><span>Perfil</span> </a></li>
<li <%=sep4%>> <a <%=link4%>><span>HOT SPOT</span> </a></li>
</ul>
</div>
</div>
/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/src/web/public/search/topnavNoResults.jsp
New file
0,0 → 1,15
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="jomm.web.utils.NavPlaceServer"%>
<%@ page import="jomm.web.utils.TopNav" %>
<%@ page import="pt.estgp.estgweb.services.common.ICommonSearchResults" %>
 
<%
TopNav topNav = NavPlaceServer.getInstance().createTopNav(request);
topNav.addNavPlace("/Welcome.do", "Home");
if (request.getParameter("query") != null)
topNav.addNavPlace(null, "search.results", request.getParameter("query") );
else
topNav.addNavPlace(null, "search.results");
%>
<jsp:include page="/layout/topnav.jsp"/>
/impl/src/web/user/home.jsp
1,8 → 1,17
<%--
Created by IntelliJ IDEA.
User: Susana Monteiro
Date: 23/Abr/2008
Time: 15:10:16
To change this template use File | Settings | File Templates.
--%>
 
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/estgweb.tld" prefix="estgweb" %>
<p><bean:message key="authentication.ok"/> <bean:write name="UserSession" property="user.name"/></p>
<estgweb:hasRole role="student">
<jsp:include page="/public/portals/alunos/student.jsp"/>
</estgweb:hasRole>
<estgweb:hasRole role="teacher">
<jsp:include page="/public/portals/Docentes/teacher.jsp"/>
</estgweb:hasRole>
<estgweb:hasRole role="all">
<jsp:include page="/public/portals/Docentes/teacher.jsp"/>
</estgweb:hasRole>
/impl/src/web/user/serviceZone/serviceZone.jsp
New file
0,0 → 1,99
<%@ page import="pt.estgp.estgweb.domain.views.AnnouncementView" %>
<%@ page import="pt.estgp.estgweb.domain.views.BlogView" %>
<%@ page import="pt.estgp.estgweb.web.utils.RequestUtils" %>
<%@ page import="pt.utl.ist.berserk.logic.serviceManager.IServiceManager" %>
<%@ page import="pt.utl.ist.berserk.logic.serviceManager.ServiceManager" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
 
<%
 
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{};
Object[] args = new Object[]{};
List<BlogView> editableBlogs = (List<BlogView>) sm.execute(RequestUtils.getRequester(request, response), "LoadEditableBlogs", args, names);
request.setAttribute("EditableBlogs", editableBlogs);
 
List<BlogView> ownerBlogs = (List<BlogView>) sm.execute(RequestUtils.getRequester(request, response), "LoadOwnerBlogs", args, names);
request.setAttribute("OwnerBlogs", ownerBlogs);
 
List<AnnouncementView> ownerAnnouncement = (List<AnnouncementView>) sm.execute(RequestUtils.getRequester(request, response), "LoadOwnerAnnouncements", args, names);
request.setAttribute("OwnerAnnouncements", ownerAnnouncement);
 
%>
<div id="serviceZone">
<table class="columnTable" width="100%">
<tbody>
<tr>
<td class="column">
 
<div class="block">
<div class="head">
Os meus afazeres
</div>
<ul>
<li>
<a href="#">(validar anúncio) Concurso de Pesca ESTG ...</a>
</li>
<li>
<a href="#">(dúvida PWEM) Professor como é que faço um Filtro ...</a>
</li>
<li>
<a href="#">Questionário de PWEM</a>
</li>
<li>
<a href="#">Questionário de ATSI</a>
</li>
</ul>
</div>
<div class="block">
<div class="head">
Serviços Disponiveis
</div>
<ul>
<li>
<a href="#">Criar um Blog</a>
</li>
<li>
<a href="#">Colocar um Anúncio</a>
</li>
</ul>
</div>
</td>
<td class="column">
<div class="block">
<div class="head">
Blogs onde posso publicar
</div>
<ul>
<li>
<a href="#">Blog de Arquitecturas Tecnoligicas de Sistemas de Informação</a>
</li>
<li>
<a href="#">Blog de Programação WEB e Equipamentos Móveis</a>
</li>
<li>
<a href="#">Blog de Projecto</a>
</li>
</ul>
</div>
</td>
<td class="column">
<div class="block">
<div class="head">
Anuncios das minhas unidades
</div>
<ul>
<li>
<a href="#">Projecto de ATSI entregar até dia 7</a>
</li>
<li>
<a href="#">Projecto de PWEM padrão para programar</a>
</li>
</ul>
</div>
</td>
</tr>
</tbody>
</table>
</div>
/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)