/impl/conf/language/MessageResourcesCourse.properties |
---|
74,7 → 74,17 |
course.validation.role=Comissão de Curso para validação de Programas |
course.pagina.nao.disponivel=De momento a página à qual acedeu não se encontra disponivel, pedimos desculpa por qualquer incómodo que isto lhe possa causar, a administração foi informada deste facto e irá resolver o problema o mais depressa possivel. |
courseunit.programfile.valid=programa <u>Aprovado</u> pela pela comissão de curso |
course.courseunit.program.validate.todo={0} Unidades por aprovar (programa) |
course.menu.home=Inicio |
course.menu.studiesplan=Plano de Estudos |
course.menu.internacionalicao=Internacionalização |
course.menu.labs=Laboratorios |
course.menu.actividades=Actividades |
course.menu.casos=Casos de sucesso |
course.menu.parceiros=Parceiros |
course.menu.faq=FAQ |
/impl/conf/language/MessageResourcesCourseUnits.properties |
---|
7,6 → 7,8 |
course={0} > |
courseunit={0} |
course.nav.without.arrow={0} |
courseunit.menu.unit.old.units=Anos anteriores |
courseunit.menu.unit.other.units=Outros Anos |
courseunit.menu.unit=Unidade |
/impl/conf/WEB-INF/struts/struts-courses.xml |
---|
26,7 → 26,17 |
<action path="/coursesFromStudentPortal" forward="page.alunosInformacaoAcademicaPortalMenu.courses"/> |
<action path="/startLoadCourse" forward="/courseController.do?dispatch=load"/> |
<action path="/startLoadCourseSeparators" forward="/courseController.do?dispatch=loadSeparators"/> |
<action path="/startLoadCourse" forward="/courseController.do?dispatch=loadSeparators"/> |
<action path="/startLoadMenuCourse" forward="/courseController.do?dispatch=loadMenu"/> |
<action path="/startLoadCourseStudiesPlan" forward="/courseController.do?dispatch=loadPlan"/> |
<!--ESTE E O LINK DO PROGRAMA CURRICULAR--> |
<action path="/courseController" |
type="pt.estgp.estgweb.web.controllers.courses.CoursesController" |
name="CourseForm" |
35,6 → 45,10 |
validate="false" |
input="page.welcome"> |
<forward name="load" path="page.load.course"/> |
<forward name="loadPlan" path="page.load.course.plan"/> |
<forward name="loadSeparators" path="page.load.course.separators"/> |
<forward name="loadMenu" path="page.load.course.menu"/> |
</action> |
<action path="/user/startLoadCoursesProgramsFromServiceZone" forward="/user/courseControllerFromServiceZone.do?dispatch=loadCoursesPrograms&fromDispatch=loadCoursesPrograms&from=ServiceZone&area="/> |
/impl/conf/WEB-INF/struts/tiles-courses.xml |
---|
22,12 → 22,37 |
<definition name="page.load.course" extends="base.layout1"> |
<put name="title" value="Curso"/> |
<put name="topnav" value="/public/courses/topnavCourse.jsp"/> |
<put name="navigation" value="/public/courses/courses.jsp"/> |
<!--<put name="navigation" value="/public/courses/courses.jsp"/>--> |
<put name="navigation" value="/public/courses/courseMenu.jsp"/> |
<put name="body" value="/public/courses/course.jsp"/> |
</definition> |
<definition name="page.load.course.plan" extends="base.layout1"> |
<put name="title" value="Curso"/> |
<put name="topnav" value="/public/courses/topnavCourse.jsp"/> |
<!--<put name="navigation" value="/public/courses/courses.jsp"/>--> |
<put name="navigation" value="/public/courses/courseMenu.jsp"/> |
<put name="body" value="/public/courses/studiesPlan.jsp"/> |
</definition> |
<definition name="page.load.course.separators" extends="base.layout1"> |
<put name="title" value="Curso"/> |
<put name="topnav" value="/public/courses/topnavCourse.jsp"/> |
<put name="navigation" value="/public/courses/courseMenu.jsp"/> |
<put name="body" value="/public/courses/courseSeparators.jsp"/> |
</definition> |
<definition name="page.load.course.menu" extends="base.layout1"> |
<put name="title" value="Curso"/> |
<put name="topnav" value="/public/courses/topnavCourse.jsp"/> |
<put name="navigation" value="/public/courses/courseMenu.jsp"/> |
<put name="body" value="/public/courses/courseMenuLoader.jsp"/> |
</definition> |
<definition name="page.select.course.from.service.zone" extends="page.separators.serviceZone"> |
<put name="title" value="Selecção de Curso"/> |
<put name="topnav" value="/user/serviceZone/topnavSelectCourse.jsp"/> |
62,9 → 87,9 |
</definition> |
</tiles-definitions> |
/impl/conf/app.properties |
---|
98,7 → 98,7 |
estgp.proxy.port= |
server.conteudos.start.path= |
server.conteudos=http://localhost:9090/conteudos |
server.conteudos=http://deptal.estgp.pt:9090/conteudos |
conteudos.encoding=UTF-8 |
conteudos.proxy.host= |
conteudos.proxy.port= |
/impl/src/java/pt/estgp/estgweb/services/courses/CoursesCommonServices.java |
---|
1,18 → 1,21 |
package pt.estgp.estgweb.services.courses; |
import pt.utl.ist.berserk.logic.serviceManager.IService; |
import org.apache.log4j.Logger; |
import pt.estgp.estgweb.Globals; |
import pt.estgp.estgweb.domain.Course; |
import pt.estgp.estgweb.domain.DomainObject; |
import pt.estgp.estgweb.domain.Teacher; |
import pt.estgp.estgweb.domain.UserSession; |
import pt.estgp.estgweb.domain.dao.DaoFactory; |
import pt.estgp.estgweb.services.common.*; |
import pt.estgp.estgweb.services.common.impl.DefaultResult; |
import pt.estgp.estgweb.services.common.impl.DefaultSearchResults; |
import pt.estgp.estgweb.services.common.impl.DefaultResult; |
import pt.estgp.estgweb.services.common.impl.DefaultToDo; |
import pt.estgp.estgweb.services.courseunits.CourseUnitsCommonServices; |
import pt.estgp.estgweb.domain.*; |
import pt.estgp.estgweb.domain.dao.DaoFactory; |
import pt.estgp.estgweb.Globals; |
import pt.estgp.estgweb.utils.DatesUtils; |
import org.apache.log4j.Logger; |
import pt.utl.ist.berserk.logic.serviceManager.IService; |
import java.util.*; |
import java.util.ArrayList; |
import java.util.List; |
/* |
* @author Goncalo Luiz gedl [AT] rnl [DOT] ist [DOT] utl [DOT] pt |
59,7 → 62,7 |
defaultResult.setTitle(course.getName()); |
defaultResult.setText(course.getDescription()); |
if (from == null) |
defaultResult.setUrl("/startLoadCourse.do?courseView.id=" + course.getId()); |
defaultResult.setUrl("/startLoadCourseSeparators.do?courseView.id=" + course.getId()); |
else |
defaultResult.setUrl("/user/startLoadCourseFrom" + from + ".do?courseView.id=" + course.getId()); |
searchResults.addResult(defaultResult); |
/impl/src/java/pt/estgp/estgweb/services/urlstat/UrlStatService.java |
---|
67,52 → 67,59 |
UrlStatYearId urlStatYearId = new UrlStatYearId(); |
urlStatYearId.setUrlStat(urlStat); |
urlStatYearId.setYear(year); |
UrlStatYearImpl urlStatYear = (UrlStatYearImpl) DaoFactory.getUrlStatYearDaoImpl().loadOrNullLockUpgrade(urlStatYearId); |
if (urlStatYear == null) |
{ |
logger.info("url:" + urlStat.getName() + " first year call does not exist... creating"); |
urlStatYear = DomainObjectFactory.createUrlStatYearImpl(); |
urlStatYear.setId(urlStatYearId); |
urlStat.addYear(urlStatYear); |
DaoFactory.getUrlStatYearDaoImpl().save(urlStatYear); |
DaoFactory.getUrlStatDaoImpl().reattach(urlStat); |
} |
try{ |
UrlStatYearImpl urlStatYear = (UrlStatYearImpl) DaoFactory.getUrlStatYearDaoImpl().loadOrNullLockUpgrade(urlStatYearId); |
if (urlStatYear == null) |
{ |
logger.info("url:" + urlStat.getName() + " first year call does not exist... creating"); |
urlStatYear = DomainObjectFactory.createUrlStatYearImpl(); |
urlStatYear.setId(urlStatYearId); |
urlStat.addYear(urlStatYear); |
DaoFactory.getUrlStatYearDaoImpl().save(urlStatYear); |
DaoFactory.getUrlStatDaoImpl().reattach(urlStat); |
} |
UrlStatMonthId urlStatMonthId = new UrlStatMonthId(); |
urlStatMonthId.setMonth(month); |
urlStatMonthId.setUrlStatYear(urlStatYear); |
UrlStatMonthImpl urlStatMonth = (UrlStatMonthImpl) DaoFactory.getUrlStatMonthDaoImpl().loadOrNullLockUpgrade(urlStatMonthId); |
if (urlStatMonth == null) |
{ |
logger.info("url:" + urlStat.getName() + " first month call does not exist... creating"); |
urlStatMonth = DomainObjectFactory.createUrlStatMonthImpl(); |
urlStatMonth.setId(urlStatMonthId); |
urlStatMonth.setDate(new MyCalendar(year, month, 1).getTime()); |
urlStatYear.addMonth(urlStatMonth); |
DaoFactory.getUrlStatMonthDaoImpl().save(urlStatMonth); |
DaoFactory.getUrlStatYearDaoImpl().reattach(urlStatYear); |
UrlStatMonthId urlStatMonthId = new UrlStatMonthId(); |
urlStatMonthId.setMonth(month); |
urlStatMonthId.setUrlStatYear(urlStatYear); |
UrlStatMonthImpl urlStatMonth = (UrlStatMonthImpl) DaoFactory.getUrlStatMonthDaoImpl().loadOrNullLockUpgrade(urlStatMonthId); |
if (urlStatMonth == null) |
{ |
logger.info("url:" + urlStat.getName() + " first month call does not exist... creating"); |
urlStatMonth = DomainObjectFactory.createUrlStatMonthImpl(); |
urlStatMonth.setId(urlStatMonthId); |
urlStatMonth.setDate(new MyCalendar(year, month, 1).getTime()); |
urlStatYear.addMonth(urlStatMonth); |
DaoFactory.getUrlStatMonthDaoImpl().save(urlStatMonth); |
DaoFactory.getUrlStatYearDaoImpl().reattach(urlStatYear); |
} |
UrlStatDayId urlStatDayId = new UrlStatDayId(); |
urlStatDayId.setDay(day); |
urlStatDayId.setUrlStatMonth(urlStatMonth); |
UrlStatDayImpl urlStatDay = (UrlStatDayImpl) DaoFactory.getUrlStatDayDaoImpl().loadOrNullLockUpgrade(urlStatDayId); |
if (urlStatDay == null) |
{ |
logger.info("url:" + urlStat.getName() + " first day call does not exist... creating"); |
urlStatDay = DomainObjectFactory.createUrlStatDayImpl(); |
UrlStatDayId urlStatDayId2 = new UrlStatDayId(); |
urlStatDayId2.setDay(day); |
urlStatDayId2.setUrlStatMonth(urlStatMonth); |
urlStatDay.setId(urlStatDayId2); |
urlStatDay.setDate(new MyCalendar(year, month, day).getTime()); |
urlStatMonth.addDay(urlStatDay); |
DaoFactory.getUrlStatDayDaoImpl().save(urlStatDay); |
} |
urlStat.setTotalClicks(urlStat.getTotalClicks() + ic.getCount()); |
urlStatDay.setTotalClicks(urlStatDay.getTotalClicks() + ic.getCount()); |
urlStatMonth.setTotalClicks(urlStatMonth.getTotalClicks() + ic.getCount()); |
urlStatYear.setTotalClicks(urlStatYear.getTotalClicks() + ic.getCount()); |
} |
UrlStatDayId urlStatDayId = new UrlStatDayId(); |
urlStatDayId.setDay(day); |
urlStatDayId.setUrlStatMonth(urlStatMonth); |
UrlStatDayImpl urlStatDay = (UrlStatDayImpl) DaoFactory.getUrlStatDayDaoImpl().loadOrNullLockUpgrade(urlStatDayId); |
if (urlStatDay == null) |
catch(Throwable e) |
{ |
logger.info("url:" + urlStat.getName() + " first day call does not exist... creating"); |
urlStatDay = DomainObjectFactory.createUrlStatDayImpl(); |
UrlStatDayId urlStatDayId2 = new UrlStatDayId(); |
urlStatDayId2.setDay(day); |
urlStatDayId2.setUrlStatMonth(urlStatMonth); |
urlStatDay.setId(urlStatDayId2); |
urlStatDay.setDate(new MyCalendar(year, month, day).getTime()); |
urlStatMonth.addDay(urlStatDay); |
DaoFactory.getUrlStatDayDaoImpl().save(urlStatDay); |
logger.error("Found error loading URLStat, ignoring error"); |
logger.error(e,e); |
} |
urlStat.setTotalClicks(urlStat.getTotalClicks() + ic.getCount()); |
urlStatDay.setTotalClicks(urlStatDay.getTotalClicks() + ic.getCount()); |
urlStatMonth.setTotalClicks(urlStatMonth.getTotalClicks() + ic.getCount()); |
urlStatYear.setTotalClicks(urlStatYear.getTotalClicks() + ic.getCount()); |
} |
} |
/impl/src/java/pt/estgp/estgweb/domain/views/CourseUnitView.java |
---|
1,16 → 1,14 |
package pt.estgp.estgweb.domain.views; |
import jomm.utils.StringsUtils; |
import org.apache.log4j.Logger; |
import pt.estgp.estgweb.domain.*; |
import pt.estgp.estgweb.domain.dao.DaoFactory; |
import pt.estgp.estgweb.services.courseunits.LoadCourseUnitAnnouncements; |
import pt.estgp.estgweb.services.expceptions.ServiceException; |
import java.io.Serializable; |
import java.util.*; |
import jomm.utils.StringsUtils; |
/** |
* @author Jorge Machado |
* @date 2/Mar/2008 |
411,6 → 409,11 |
public boolean isOwnedBy(GenericUser u, boolean transaction) |
{ |
//return u != null && u instanceof TeacherImpl && ((TeacherImpl)u).hasCourseUnit(getId(), transaction); |
//ALTERACOES REUNIAO BACO CODIGO 01062011 |
//TESTE A COMISSAO DE CURSO NAS CADEIRAS |
return u != null && u instanceof TeacherImpl && ((TeacherImpl)u).hasCourseUnit(getId(), transaction); |
} |
/impl/src/java/pt/estgp/estgweb/web/DirWebProxy.java |
---|
180,6 → 180,7 |
} |
catch (Exception e) |
{ |
logger.error(e,e); |
throw new IOException(e.toString()); |
} |
} |
/impl/src/java/pt/estgp/estgweb/web/WebProxy.java |
---|
1,5 → 1,6 |
package pt.estgp.estgweb.web; |
import org.apache.commons.httpclient.URIException; |
import org.apache.commons.httpclient.util.URIUtil; |
import org.apache.log4j.Logger; |
import pt.estgp.estgweb.utils.ConfigProperties; |
189,8 → 190,14 |
return in; |
} |
public static void main(String[] args) throws URIException { |
String path = "pagina.php?id=asdasd&jj=kk"; |
String pathFinal = path.indexOf("?") >=0 ? URIUtil.encodePath(path.substring(0,path.indexOf("?")), "ISO-8859-1") + "?" +path.substring(path.indexOf("?")+1) : path; |
System.out.println(pathFinal); |
} |
public static void processHttpRequestService(JspWriter out, String server, String path) throws IOException, ServletException |
{ |
String serverUrl = ConfigProperties.getProperty("server." + server); |
String serverEncoding = ConfigProperties.getProperty(server + ".encoding"); |
String confStartPath = ConfigProperties.getProperty("server." + server + ".start.path"); |
200,7 → 207,11 |
try |
{ |
URL url = new URL(serverUrl + URIUtil.encodePath(path, "ISO-8859-1")); |
String pathFinal = path.indexOf("?") >=0 ? URIUtil.encodePath(path.substring(0,path.indexOf("?")), "ISO-8859-1") + path.substring(path.indexOf("?")) : path; |
System.out.println("Getting: " + serverUrl + pathFinal); |
URL url = new URL(serverUrl + pathFinal); |
URLConnection con = url.openConnection(); |
InputStream stream = con.getInputStream(); |
/impl/src/java/pt/estgp/estgweb/web/utils/RequestUtils.java |
---|
1,17 → 1,12 |
package pt.estgp.estgweb.web.utils; |
import pt.estgp.estgweb.web.exceptions.NoCookiesException; |
import pt.estgp.estgweb.web.UserSessionProxy; |
import pt.estgp.estgweb.Globals; |
import pt.estgp.estgweb.web.UserSessionProxy; |
import pt.estgp.estgweb.web.exceptions.NoCookiesException; |
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.Cookie; |
import javax.servlet.http.HttpServletResponse; |
import org.apache.struts.action.ActionMessages; |
import org.apache.struts.action.ActionMessage; |
import jomm.utils.BytesUtils; |
/** |
* @author Jorge Machado |
* @date 29/Fev/2008 |
22,52 → 17,56 |
{ |
public static String getRequester(HttpServletRequest request, HttpServletResponse response) throws NoCookiesException |
{ |
if(request == null) |
return "unknown"; |
if (request.getCookies() == null || request.getCookies().length == 0) |
{ |
Cookie cookie = new Cookie(pt.estgp.estgweb.web.Globals.BACO_SESSION_COOKIE, request.getSession().getId()); |
response.addCookie(cookie); |
return cookie.getValue(); |
} |
else if (request.getCookies() != null && request.getCookies().length > 0) |
{ |
for (Cookie cookie : request.getCookies()) |
{ |
if (cookie.getName().equals(pt.estgp.estgweb.web.Globals.BACO_SESSION_COOKIE)) |
{ |
return cookie.getValue(); |
} |
} |
Cookie cookie = new Cookie(pt.estgp.estgweb.web.Globals.BACO_SESSION_COOKIE, request.getSession().getId()); |
response.addCookie(cookie); |
return cookie.getValue(); |
} |
throw new NoCookiesException(); |
// if(request == null) |
// return "unknown"; |
// if (request.getCookies() == null || request.getCookies().length == 0) |
// { |
// Cookie cookie = new Cookie(pt.estgp.estgweb.web.Globals.BACO_SESSION_COOKIE, request.getSession().getId()); |
// response.addCookie(cookie); |
// return cookie.getValue(); |
// } |
// else if (request.getCookies() != null && request.getCookies().length > 0) |
// { |
// for (Cookie cookie : request.getCookies()) |
// { |
// if (cookie.getName().equals(pt.estgp.estgweb.web.Globals.BACO_SESSION_COOKIE)) |
// { |
// return cookie.getValue(); |
// } |
// } |
// Cookie cookie = new Cookie(pt.estgp.estgweb.web.Globals.BACO_SESSION_COOKIE, request.getSession().getId()); |
// response.addCookie(cookie); |
// return cookie.getValue(); |
// } |
// throw new NoCookiesException(); |
if(request.getSession() != null) |
return request.getSession().getId(); |
return "unkown"; |
} |
public static boolean existRequester(HttpServletRequest request, HttpServletResponse response) throws NoCookiesException |
{ |
if (request.getCookies() == null || request.getCookies().length == 0) |
{ |
Cookie cookie = new Cookie(pt.estgp.estgweb.web.Globals.BACO_SESSION_COOKIE, 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(pt.estgp.estgweb.web.Globals.BACO_SESSION_COOKIE)) |
{ |
return true; |
} |
} |
Cookie cookie = new Cookie(pt.estgp.estgweb.web.Globals.BACO_SESSION_COOKIE, BytesUtils.generateHexKey()); |
response.addCookie(cookie); |
return false; |
} |
throw new NoCookiesException(); |
// if (request.getCookies() == null || request.getCookies().length == 0) |
// { |
// Cookie cookie = new Cookie(pt.estgp.estgweb.web.Globals.BACO_SESSION_COOKIE, 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(pt.estgp.estgweb.web.Globals.BACO_SESSION_COOKIE)) |
// { |
// return true; |
// } |
// } |
// Cookie cookie = new Cookie(pt.estgp.estgweb.web.Globals.BACO_SESSION_COOKIE, BytesUtils.generateHexKey()); |
// response.addCookie(cookie); |
// return false; |
// } |
// throw new NoCookiesException(); |
return true; |
} |
private static final String EMPTY_STRING = ""; |
/impl/src/java/pt/estgp/estgweb/web/Globals.java |
---|
2,8 → 2,6 |
import pt.estgp.estgweb.utils.ConfigProperties; |
import javax.servlet.http.HttpServletRequest; |
/** |
* @author Fabio |
* @date 31/Mar/2008 |
15,7 → 13,7 |
public static final String SITE_URL = ConfigProperties.getProperty("site.url"); |
public static final String BACO_SESSION_COOKIE = "BACOSESSIONID"; |
public static final String BACO_SESSION_COOKIE = "JSESSIONID"; |
private static final String PORTAL_MENU_START_LINK_START = "/proxy/"; |
private static final String PORTAL_MENU_START_LINK_END = "/estgp/public/portal"; |
private static final String PUBLIC_MENU_START_LINK_END = "/estgp/public"; |
/impl/src/java/pt/estgp/estgweb/web/controllers/courses/CoursesController.java |
---|
5,7 → 5,6 |
import org.apache.struts.action.ActionForward; |
import org.apache.struts.action.ActionMapping; |
import pt.estgp.estgweb.domain.views.CourseView; |
import pt.estgp.estgweb.domain.*; |
import pt.estgp.estgweb.filters.exceptions.NotFoundException; |
import pt.estgp.estgweb.services.courseunits.DirectedCoordinatedCourses; |
import pt.estgp.estgweb.services.courseunits.DirectedCoordinatedUnitsService; |
14,8 → 13,6 |
import pt.estgp.estgweb.web.exceptions.NoCookiesException; |
import pt.estgp.estgweb.web.form.courses.CourseForm; |
import pt.estgp.estgweb.web.utils.RequestUtils; |
import pt.estgp.estgweb.web.UserSessionProxy; |
import pt.estgp.estgweb.utils.AreasBelongUtils; |
import pt.utl.ist.berserk.logic.filterManager.exceptions.FilterRetrieveException; |
import pt.utl.ist.berserk.logic.filterManager.exceptions.IncompatibleFilterException; |
import pt.utl.ist.berserk.logic.filterManager.exceptions.InvalidFilterException; |
80,6 → 77,32 |
cF.setCourseView(cV); |
} |
public ActionForward loadPlan(ActionMapping mapping, |
ActionForm form, |
HttpServletRequest request, |
HttpServletResponse response) |
throws ServletException |
{ |
try |
{ |
load((CourseForm) form,request,response); |
return mapping.findForward("loadPlan"); |
} |
catch (FilterChainFailedException e) |
{ |
return mapping.findForward("error401"); |
} |
catch (NotFoundException e) |
{ |
return mapping.findForward("error404"); |
} |
catch (Throwable e) |
{ |
logger.error(e, e); |
return mapping.findForward("error500"); |
} |
} |
public ActionForward load(ActionMapping mapping, |
ActionForm form, |
HttpServletRequest request, |
106,6 → 129,61 |
} |
} |
public ActionForward loadSeparators(ActionMapping mapping, |
ActionForm form, |
HttpServletRequest request, |
HttpServletResponse response) |
throws ServletException |
{ |
try |
{ |
load((CourseForm) form,request,response); |
return mapping.findForward("loadSeparators"); |
} |
catch (FilterChainFailedException e) |
{ |
return mapping.findForward("error401"); |
} |
catch (NotFoundException e) |
{ |
return mapping.findForward("error404"); |
} |
catch (Throwable e) |
{ |
logger.error(e, e); |
return mapping.findForward("error500"); |
} |
} |
public ActionForward loadMenu(ActionMapping mapping, |
ActionForm form, |
HttpServletRequest request, |
HttpServletResponse response) |
throws ServletException |
{ |
try |
{ |
load((CourseForm) form,request,response); |
return mapping.findForward("loadMenu"); |
} |
catch (FilterChainFailedException e) |
{ |
return mapping.findForward("error401"); |
} |
catch (NotFoundException e) |
{ |
return mapping.findForward("error404"); |
} |
catch (Throwable e) |
{ |
logger.error(e, e); |
return mapping.findForward("error500"); |
} |
} |
public ActionForward edit(ActionMapping mapping, |
ActionForm form, |
HttpServletRequest request, |
/impl/src/java/pt/estgp/estgweb/web/filters/CookieFilter.java |
---|
73,7 → 73,10 |
} |
else |
{ |
//ALTERACOES REUNIAO BACO CODIGO 01062011 |
//System.out.println("AQUIIIII>>>"+((HttpServletRequest)request).getContextPath() + ((HttpServletRequest) request).getServletPath() + "?" +((HttpServletRequest) request).getQueryString()); |
((HttpServletResponse)response).sendRedirect(((HttpServletRequest)request).getContextPath() + "/Welcome.do"); |
//((HttpServletResponse)response).sendRedirect(((HttpServletRequest)request).getContextPath() + ((HttpServletRequest) request).getServletPath() + "?" +((HttpServletRequest) request).getQueryString()); |
} |
} |
/impl/src/web/public/courses/courseSeparators.jsp |
---|
New file |
0,0 → 1,31 |
<%@ page import="pt.estgp.estgweb.Globals" %> |
<%@ page import="pt.estgp.estgweb.web.WebProxy" %> |
<%@ page contentType="text/html;charset=UTF-8" language="java" %> |
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
<%@ 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" %> |
<jsp:useBean id="CourseView" type="pt.estgp.estgweb.domain.views.CourseView" scope="request"/> |
<div class="seccao"> |
<h2>${CourseView.name} (<%=Globals.NATIONAL_INSTITUTION_CODE%> / ${CourseView.code})</h2> |
<logic:notEmpty name="CourseView" property="formatedDescription"><p>${courseView.formatedDescription}</p></logic:notEmpty> |
<logic:notEmpty name="CourseView" property="externalSitePath"> |
<% |
WebProxy.processHttpRequestService(out, CourseView.getExternalSiteServer(), CourseView.getExternalSitePath()); |
%> |
</logic:notEmpty> |
<%--<logic:notEmpty name="CourseView" property="cacheWebDocument">--%> |
<%--<h3><bean:message key="course.studies.plan"/></h3>--%> |
<%--<bean:write name="CourseView" property="cacheWebDocument" filter="no"/>--%> |
<%--</logic:notEmpty>--%> |
</div> |
/impl/src/web/public/courses/courseMenu.jsp |
---|
New file |
0,0 → 1,30 |
<%@ page import="pt.estgp.estgweb.Globals" %> |
<%@ page contentType="text/html;charset=UTF-8" language="java" %> |
<%@ page contentType="text/html;charset=UTF-8" language="java" %> |
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
<%@ 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" %> |
<%--<jsp:useBean id="typeKey" type="java.lang.String" scope="request"/>--%> |
<jsp:useBean id="CourseView" type="pt.estgp.estgweb.domain.views.CourseView" scope="request"/> |
<div class="linkMenuBlock"> |
<div class="linkMenuBlockTitle"> |
${CourseView.name}<%--<bean:message key="${typeKey}"/> (<bean:message key="course.studies.plan.users" />)--%> |
</div> |
<div class="linkLeftMenu"> |
<div class="listClean"> |
<ul> |
<li><a href="<%=request.getContextPath() + "/startLoadCourseSeparators.do?content=home&type=" + CourseView.getDegree() + "&courseView.id=" + CourseView.getId()%>"><bean:message key="course.menu.home"/></a></li> |
<li><html:link action="/startLoadCourseStudiesPlan?content=studiesplan&type=${CourseView.degree}&courseView.id=${CourseView.id}"><bean:message key="course.menu.studiesplan"/></html:link></li> |
<li><html:link action="/startLoadMenuCourse?type=${CourseView.degree}&courseView.id=${CourseView.id}&content=internacionalicao"><bean:message key="course.menu.internacionalicao"/></html:link></li> |
<li><html:link action="/startLoadMenuCourse?type=${CourseView.degree}&courseView.id=${CourseView.id}&content=labs"><bean:message key="course.menu.labs"/></html:link></li> |
<li><html:link action="/startLoadMenuCourse?type=${CourseView.degree}&courseView.id=${CourseView.id}&content=actividades"><bean:message key="course.menu.actividades"/></html:link></li> |
<li><html:link action="/startLoadMenuCourse?type=${CourseView.degree}&courseView.id=${CourseView.id}&content=casos"><bean:message key="course.menu.casos"/></html:link></li> |
<li><html:link action="/startLoadMenuCourse?type=${CourseView.degree}&courseView.id=${CourseView.id}&content=parceiros"><bean:message key="course.menu.parceiros"/></html:link></li> |
<li><html:link action="/startLoadMenuCourse?type=${CourseView.degree}&courseView.id=${CourseView.id}&content=faq"><bean:message key="course.menu.faq"/></html:link></li> |
</ul> |
</div> |
</div> |
</div> |
/impl/src/web/public/courses/topnavCourse.jsp |
---|
6,7 → 6,15 |
<% |
TopNav topNav = NavPlaceServer.getInstance().createTopNav(request); |
topNav.addNavPlace("/Welcome.do", "Home"); |
topNav.addNavPlace("/courses.do?type=" + request.getAttribute("type"), "module.Courses"); |
topNav.addNavPlace(null, "course", CourseView.getName()); |
topNav.addNavPlace("/courses.do?type=" + CourseView.getDegree() , "course." + CourseView.getDegree()); |
if(request.getParameter("content")!= null) |
{ |
topNav.addNavPlace("/startLoadCourseSeparators.do?content=home&type=" + CourseView.getDegree() + "&courseView.id=" + CourseView.getId() , "course.nav.without.arrow", CourseView.getName()); |
topNav.addNavPlace(null, "course.menu." + request.getParameter("content")); |
} |
else |
topNav.addNavPlace(null, "course.nav.without.arrow", CourseView.getName()); |
%> |
<jsp:include page="/layout/topnav.jsp"/> |
/impl/src/web/public/courses/studiesPlan.jsp |
---|
New file |
0,0 → 1,34 |
<%@ page import="pt.estgp.estgweb.Globals" %> |
<%@ page import="pt.estgp.estgweb.web.WebProxy" %> |
<%@ page contentType="text/html;charset=UTF-8" language="java" %> |
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
<%@ 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" %> |
<jsp:useBean id="CourseView" type="pt.estgp.estgweb.domain.views.CourseView" scope="request"/> |
<div class="seccao"> |
<h2><bean:message key="course.studies.plan"/></h2> |
<logic:empty name="CourseView" property="cacheWebDocument"> |
<div class="seccao"> |
<h2>Unidades Curriculares</h2> |
<ul> |
<logic:iterate id="courseUnitView" name="CourseView" property="courseUnits" type="pt.estgp.estgweb.domain.views.CourseUnitView"> |
<li> |
${courseUnitView.name} |
</li> |
</logic:iterate> |
</ul> |
</div> |
</logic:empty> |
<logic:notEmpty name="CourseView" property="cacheWebDocument"> |
<bean:write name="CourseView" property="cacheWebDocument" filter="no"/> |
</logic:notEmpty> |
</div> |
/impl/src/web/public/courses/topnavCourses.jsp |
---|
1,12 → 1,10 |
<%@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, "courses"); |
topNav.addNavPlace(null, "course." + request.getParameter("type")); |
%> |
<jsp:include page="/layout/topnav.jsp"/> |
/impl/src/web/public/courses/courseList.jsp |
---|
14,18 → 14,19 |
<logic:iterate id="courseView" name="courses" type="pt.estgp.estgweb.domain.views.CourseView"> |
<logic:notEmpty name="courseView" property="studiesPlanStreamId"> |
<li> |
<p><a href="javascript:showOrHideOne(${courseView.id})">${courseView.name}</a> - <%=Globals.NATIONAL_INSTITUTION_CODE%>/${courseView.code} - (<a href="<%=request.getContextPath() + "/startLoadCourse.do?type=" + request.getAttribute("type") + "&courseView.id=" + courseView.getId()%>"><bean:message key="course.studies.plan.users"/> </a>)</p> |
<div style="padding-left:20px;"> |
<div class="seccao borderLeft" style="display:none;" id="${courseView.id}"> |
<%--<p><a href="javascript:showOrHideOne(${courseView.id})">${courseView.name}</a> - <%=Globals.NATIONAL_INSTITUTION_CODE%>/${courseView.code} - (<a href="<%=request.getContextPath() + "/startLoadCourse.do?type=" + request.getAttribute("type") + "&courseView.id=" + courseView.getId()%>"><bean:message key="course.studies.plan.users"/> </a>)</p>--%> |
<p><a href="<%=request.getContextPath() + "/startLoadCourseSeparators.do?type=" + request.getAttribute("type") + "&courseView.id=" + courseView.getId()%>">${courseView.name}</a> - <%=Globals.NATIONAL_INSTITUTION_CODE%>/${courseView.code} </a></p> |
<%--<div style="padding-left:20px;">--%> |
<%--<div class="seccao borderLeft" style="display:none;" id="${courseView.id}">--%> |
<logic:notEmpty name="courseView" property="formatedDescription"><p>${courseView.formatedDescription}</p></logic:notEmpty> |
<logic:notEmpty name="courseView" property="externalSitePath"> |
<% |
WebProxy.processHttpRequestService(out, courseView.getExternalSiteServer(), courseView.getExternalSitePath()); |
%> |
</logic:notEmpty> |
</div> |
</div> |
<%--<logic:notEmpty name="courseView" property="formatedDescription"><p>${courseView.formatedDescription}</p></logic:notEmpty>--%> |
<%--<logic:notEmpty name="courseView" property="externalSitePath">--%> |
<%--<%--%> |
<%--WebProxy.processHttpRequestService(out, courseView.getExternalSiteServer(), courseView.getExternalSitePath());--%> |
<%--%>--%> |
<%--</logic:notEmpty>--%> |
<%--</div>--%> |
<%--</div>--%> |
</li> |
</logic:notEmpty> |
</logic:iterate> |
/impl/src/web/public/courses/courseMenuLoader.jsp |
---|
New file |
0,0 → 1,36 |
<%@ page import="pt.estgp.estgweb.web.WebProxy" %> |
<%@ page contentType="text/html;charset=UTF-8" language="java" %> |
<%@ page contentType="text/html;charset=UTF-8" language="java" %> |
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
<%@ 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" %> |
<%--<jsp:useBean id="typeKey" type="java.lang.String" scope="request"/>--%> |
<jsp:useBean id="CourseView" type="pt.estgp.estgweb.domain.views.CourseView" scope="request"/> |
<div class="seccao"> |
<% |
String contentsPage = (String) request.getParameter("content"); |
request.setAttribute("contentM",contentsPage); |
%> |
<h2><bean:message key="course.menu.${contentM}"/></h2> |
<% |
try{ |
String pagina = "/pagina.php?nome_id=curso_" + CourseView.getCode() + "_" + contentsPage; |
WebProxy.processHttpRequestService(out,"conteudos", pagina); |
} |
catch(Throwable e) |
{ |
%> |
<p><bean:message key="course.pagina.nao.disponivel"/></p> |
<% |
} |
%> |
</div> |
/impl/src/web/user/home/student.jsp |
---|
1,3 → 1,5 |
<%@ page import="org.hibernate.SQLQuery" %> |
<%@ page import="java.math.BigInteger" %> |
<%@ 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" %> |
7,6 → 9,10 |
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> |
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
<jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/> |
<% |
%> |
<div class="portal"> |
<logic:notMatch value="StudentImpl" name="UserSession" property="user.class.name"> |
<ul> |
62,6 → 68,14 |
</li> |
<li> |
<p><bean:message key="courseunit.semestre"/> 2</p> |
<%--<br/>--%> |
<%--<p>As inscrições para os Exames de 2º Semestre irão ser efectuadas pelo BACO</p>--%> |
<%--<p>Caso se tenha inscrito e não tem intenção de fazer o Exame ou ainda não sabe a sua nota final remova a sua inscrição para regularizar a situação</p>--%> |
<%--<br/>--%> |
<br/> |
<p>O periodo de inscrições terminou</p> |
<br/> |
<logic:present name="UserSession" property="user.subscribedUnitsCurrentYearViewS2"> |
<logic:empty name="UserSession" property="user.subscribedUnitsCurrentYearViewS2"> |
<bean:message key="courseunit.zero.units"/> |
69,10 → 83,135 |
</logic:present> |
<logic:present name="UserSession" property="user.subscribedUnitsCurrentYearViewS2"> |
<logic:notEmpty name="UserSession" property="user.subscribedUnitsCurrentYearViewS2"> |
<%--<table cellpadding="0" cellspacing="0" class="dataTable">--%> |
<%--<tr>--%> |
<%--<th>Exames de 1ª Época</th>--%> |
<%--<th>Inscrito</th>--%> |
<%--<th></th>--%> |
<%--</tr>--%> |
<%--<logic:iterate id="unit" name="UserSession" property="user.subscribedUnitsCurrentYearViewS2" type="pt.estgp.estgweb.domain.CourseUnit">--%> |
<%--<tr>--%> |
<%--<td style="text-align:center; padding:3px">--%> |
<%--${unit.name}--%> |
<%--</td>--%> |
<%--<%--%> |
<%--String courseCode = "";--%> |
<%--if(unit.getCourse() != null)--%> |
<%--{--%> |
<%--String courseName = unit.getCourse().getName();--%> |
<%--String[] words = courseName.split(" ");--%> |
<%--for(String word: words)--%> |
<%--{--%> |
<%--if(word != null && word.length() > 3 && word.charAt(0) >= 'A' && word.charAt(0) <= 'Z' )--%> |
<%--{--%> |
<%--courseCode += word.charAt(0);--%> |
<%--}--%> |
<%--}--%> |
<%--}--%> |
<%--%>--%> |
<%--<%--%> |
<%--org.hibernate.Session sess = jomm.dao.utils.HibernateUtils.getCurrentSession();--%> |
<%--sess.beginTransaction();--%> |
<%--org.hibernate.SQLQuery q = sess.createSQLQuery("select count(*) from inscricoes_exame where courseunit_id = " + unit.getId() + " and user_id = " + UserSession.getUser().getId());--%> |
<%--java.math.BigInteger count = (java.math.BigInteger) q.list().get(0);--%> |
<%--boolean inscrito = false;--%> |
<%--if(count.intValue() > 0)--%> |
<%--{--%> |
<%--inscrito = true;--%> |
<%--}--%> |
<%----%> |
<%--sess.getTransaction().commit();--%> |
<%--if(request.getParameter("inscrever") != null)--%> |
<%--{--%> |
<%--if(!inscrito && request.getParameter("inscrever").equals("true"))--%> |
<%--{--%> |
<%--long courseunit_id=Long.parseLong(request.getParameter("courseunit_id"));--%> |
<%--if(courseunit_id == unit.getId())--%> |
<%--{--%> |
<%--sess = jomm.dao.utils.HibernateUtils.getCurrentSession();--%> |
<%--sess.beginTransaction();--%> |
<%--try--%> |
<%--{--%> |
<%--sess.createSQLQuery("insert into inscricoes_exame (courseunit_id,user_id) VALUES(" + courseunit_id + "," + UserSession.getUser().getId() + ")").executeUpdate();--%> |
<%--}--%> |
<%--catch(Exception e)--%> |
<%--{--%> |
<%--e.printStackTrace();--%> |
<%--}--%> |
<%--sess.flush();--%> |
<%--sess.getTransaction().commit();--%> |
<%--inscrito = true;--%> |
<%--}--%> |
<%--}--%> |
<%--else if(inscrito && request.getParameter("inscrever").equals("false"))--%> |
<%--{--%> |
<%--long courseunit_id=Long.parseLong(request.getParameter("courseunit_id"));--%> |
<%--if(courseunit_id == unit.getId())--%> |
<%--{--%> |
<%--sess = jomm.dao.utils.HibernateUtils.getCurrentSession();--%> |
<%--sess.beginTransaction();--%> |
<%--try--%> |
<%--{--%> |
<%--sess.createSQLQuery("delete from inscricoes_exame where courseunit_id = " + courseunit_id + " and user_id = " + UserSession.getUser().getId()).executeUpdate();--%> |
<%--}--%> |
<%--catch(Exception e)--%> |
<%--{--%> |
<%--e.printStackTrace();--%> |
<%--}--%> |
<%--sess.flush();--%> |
<%--sess.getTransaction().commit();--%> |
<%--inscrito = false;--%> |
<%--}--%> |
<%--}--%> |
<%--}--%> |
<%--if(inscrito)--%> |
<%--{--%> |
<%--%>--%> |
<%--<td style="background-color:green;color:white;text-align:center">Sim</td>--%> |
<%--<td style="text-align:center">--%> |
<%--<form style="padding:0;margin:0" action="<%=request.getContextPath()%>/user/home.do" method="post">--%> |
<%--<input type="hidden" name="inscrever" value="false">--%> |
<%--<input type="hidden" name="courseunit_id" value="${unit.id}">--%> |
<%--<input type="submit" value="Desinscrever" onclick="return confirm('Esta acção vai remover a sua inscrição no Exame de ${unit.name}. Tem a certeza que se deseja remover a sua inscrição no exame da unidade de ${unit.name}?');">--%> |
<%--</form>--%> |
<%--</td>--%> |
<%--<%--%> |
<%--}--%> |
<%--else--%> |
<%--{--%> |
<%--%>--%> |
<%--<td style="text-align:center">Não</td>--%> |
<%--<td style="text-align:center">--%> |
<%--<form style="padding:0;margin:0" action="<%=request.getContextPath()%>/user/home.do" method="post">--%> |
<%--<input type="hidden" name="inscrever" value="true">--%> |
<%--<input type="hidden" name="courseunit_id" value="${unit.id}">--%> |
<%--<input type="submit" value="Inscrever" onclick="return confirm('Esta acção vai inscrevê-lo no Exame de ${unit.name}. Tem a certeza que se deseja inscrever no exame da unidade de ${unit.name}?');">--%> |
<%--</form>--%> |
<%--</td>--%> |
<%--<%--%> |
<%--}--%> |
<%--%>--%> |
<%--</tr>--%> |
<%--</logic:iterate>--%> |
<%--</table>--%> |
<ul> |
<logic:iterate id="unit" name="UserSession" property="user.subscribedUnitsCurrentYearViewS2" type="pt.estgp.estgweb.domain.CourseUnit"> |
<li> |
<% |
<% |
String courseCode = ""; |
if(unit.getCourse() != null) |
{ |
90,6 → 229,7 |
%> |
<html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (<%=courseCode%><%//${unit.courseName} (${unit.courseCode})%>) </html:link> |
<html:link action="/user/startLoadCourseUnitRootFromHome?courseUnitView.id=${unit.id}"><img border="0" alt="Pastas" src="<%=request.getContextPath()%>/imgs/folder.gif"></html:link> |
</li> |
</logic:iterate> |
</ul> |