Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 249 → Rev 258

/impl/conf/language/MessageResourcesProfile.properties
43,6 → 43,8
profile.grades=Notas
profile.home=Apresentação
profile.curriculum.record=Registo Pessoal de Curriculum
profile.academic.degree.less=Sem Formação Superior
 
edit.profile=Editar Meu Perfil
edit.user.profile=Editar Utilizador
profile.roles=Funções na Instituição
/impl/conf/berserk/sd.xml
841,6 → 841,14
</filterChains>
</service>
<service>
<name>LoadTeachedUnitsCurrentYear</name>
<implementationClass>pt.estgp.estgweb.services.courseunits.LoadTeachedUnitsCurrentYearService</implementationClass>
<description>Load teacher units in currentYear</description>
<isTransactional>true</isTransactional>
<filterChains>
</filterChains>
</service>
<service>
<name>LoadSubscribedUnits</name>
<implementationClass>pt.estgp.estgweb.services.courseunits.LoadSubscribedUnitsService</implementationClass>
<description>Load student units</description>
849,6 → 857,22
</filterChains>
</service>
<service>
<name>LoadSubscribedUnitsCurrentYear</name>
<implementationClass>pt.estgp.estgweb.services.courseunits.LoadSubscribedUnitsCurrentYearService</implementationClass>
<description>Load student units in current Year</description>
<isTransactional>true</isTransactional>
<filterChains>
</filterChains>
</service>
<service>
<name>LoadSubscribedUnitsOldYears</name>
<implementationClass>pt.estgp.estgweb.services.courseunits.LoadSubscribedUnitsOldYearsService</implementationClass>
<description>Load student units in current Year</description>
<isTransactional>true</isTransactional>
<filterChains>
</filterChains>
</service>
<service>
<name>LoadSubscribedUnitsAnnouncements</name>
<implementationClass>pt.estgp.estgweb.services.courseunits.LoadSubscribedUnitsAnnouncementsService</implementationClass>
<description>Load student units</description>
/impl/conf/hibernate.cfg.xml
12,6 → 12,7
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">@hibernate.show.sql@</property>
<property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="connection.pool_size">10</property>
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.timeout">1800</property>
/impl/src/java/pt/estgp/estgweb/services/courseunits/LoadSubscribedUnitsCurrentYearService.java
New file
0,0 → 1,30
package pt.estgp.estgweb.services.courseunits;
 
import pt.utl.ist.berserk.logic.serviceManager.IService;
import pt.estgp.estgweb.domain.CourseUnit;
import pt.estgp.estgweb.domain.Student;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.utils.DatesUtils;
 
import java.util.List;
import java.util.ArrayList;
 
/**
* @author Jorge Machado
* @date 2/Jun/2008
* @see pt.estgp.estgweb.services.courseunits
*/
public class LoadSubscribedUnitsCurrentYearService implements IService
{
public List<CourseUnit> run(long studentId)
{
Student t = DaoFactory.getStudentDaoImpl().load(studentId);
List<CourseUnit> units = DaoFactory.getCourseUnitDaoImpl().loadSubscribedImportYearUnits(studentId, DatesUtils.getImportYear());
for(CourseUnit c: units)
{
c.getName();
c.getCourse().getName();
}
return units;
}
}
/impl/src/java/pt/estgp/estgweb/services/courseunits/LoadTeachedUnitsCurrentYearService.java
New file
0,0 → 1,32
package pt.estgp.estgweb.services.courseunits;
 
import pt.utl.ist.berserk.logic.serviceManager.IService;
import pt.estgp.estgweb.domain.CourseUnitImpl;
import pt.estgp.estgweb.domain.Teacher;
import pt.estgp.estgweb.domain.CourseUnit;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.utils.DatesUtils;
 
import java.util.List;
import java.util.ArrayList;
 
/**
* @author Jorge Machado
* @date 2/Jun/2008
* @see pt.estgp.estgweb.services.courseunits
*/
public class LoadTeachedUnitsCurrentYearService implements IService
{
public List<CourseUnitImpl> run(long teacherId)
{
Teacher t = DaoFactory.getTeacherDaoImpl().load(teacherId);
List<CourseUnitImpl> units = DaoFactory.getCourseUnitDaoImpl().loadTeachedImportYearUnits(teacherId,DatesUtils.getImportYear());
 
for(CourseUnit c: units)
{
c.getName();
c.getCourse().getName();
}
return units;
}
}
/impl/src/java/pt/estgp/estgweb/services/courseunits/LoadSubscribedUnitsOldYearsService.java
New file
0,0 → 1,29
package pt.estgp.estgweb.services.courseunits;
 
import pt.utl.ist.berserk.logic.serviceManager.IService;
import pt.estgp.estgweb.domain.CourseUnit;
import pt.estgp.estgweb.domain.Student;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.utils.DatesUtils;
 
import java.util.List;
 
/**
* @author Jorge Machado
* @date 2/Jun/2008
* @see pt.estgp.estgweb.services.courseunits
*/
public class LoadSubscribedUnitsOldYearsService implements IService
{
public List<CourseUnit> run(long studentId)
{
// Student t = DaoFactory.getStudentDaoImpl().load(studentId);
List<CourseUnit> units = DaoFactory.getCourseUnitDaoImpl().loadSubscribedOtherImportYearUnits(studentId, DatesUtils.getImportYear());
for(CourseUnit c: units)
{
c.getName();
c.getCourse().getName();
}
return units;
}
}
/impl/src/java/pt/estgp/estgweb/services/sigesimports/ImportStudentsService.java
137,7 → 137,6
ArrayOfDisciplina disciplinas = d.getDisciplinasInscrito();
for (Disciplina disciplina : disciplinas.getDisciplina())
{
 
CourseUnit courseUnit = DaoFactory.getCourseUnitDaoImpl().loadBySigesCodeUnique("" + disciplina.getCodigo(),"" + disciplina.getCodigoCurso(),disciplina.getCdDuracao(),disciplina.getCdLectivo());
if(courseUnit == null)
{
153,6 → 152,26
if(((StudentImpl)student).isLocalRemovedUnit(courseUnit))
iter.remove();
}
 
if(student.getSubscribedUnits() != null)
{
for(CourseUnit c: units)
{
boolean isIn = false;
for(CourseUnit tc : student.getSubscribedUnits())
{
if(tc.equals(c))
{
isIn = true;
break;
}
}
if(!isIn)
student.getSubscribedUnits().add(c);
}
}
else
student.setSubscribedUnits(units);
student.setSubscribedUnits(units);
}
}
/impl/src/java/pt/estgp/estgweb/services/sigesimports/ImportTeachersService.java
10,10 → 10,7
import pt.estgp.estgweb.Globals;
import pt.estgp.estgweb.utils.DatesUtils;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.domain.Teacher;
import pt.estgp.estgweb.domain.DomainObjectFactory;
import pt.estgp.estgweb.domain.CourseUnit;
import pt.estgp.estgweb.domain.TeacherImpl;
import pt.estgp.estgweb.domain.*;
import pt.ipportalegre.siges.web.services.*;
import org.apache.log4j.Logger;
 
139,7 → 136,25
if(((TeacherImpl)t).isLocalRemovedUnit(courseUnit))
iter.remove();
}
t.setTeachedUnits(units);
if(t.getTeachedUnits() != null)
{
for(CourseUnit c: units)
{
boolean isIn = false;
for(CourseUnit tc : t.getTeachedUnits())
{
if(tc.equals(c))
{
isIn = true;
break;
}
}
if(!isIn)
t.getTeachedUnits().add(c);
}
}
else
t.setTeachedUnits(units);
}
}
 
/impl/src/java/pt/estgp/estgweb/services/profile/CurriculumService.java
7,7 → 7,9
import pt.estgp.estgweb.domain.*;
import pt.estgp.estgweb.domain.enums.RecordEnum;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.domain.dao.impl.CourseUnitDaoImpl;
import pt.estgp.estgweb.filters.chains.ResourceAccessControlEnum;
import pt.estgp.estgweb.utils.DatesUtils;
import org.apache.log4j.Logger;
 
import java.io.InputStream;
135,7 → 137,7
if(u instanceof Teacher)
{
Teacher teacher = (Teacher) u;
courseUnits = teacher.getTeachedUnits();
courseUnits = new HashSet<CourseUnit>(DaoFactory.getCourseUnitDaoImpl().loadTeachedImportYearUnits(teacher.getId(), DatesUtils.getImportYear()));
}
else if(u instanceof Student)
{
/impl/src/java/pt/estgp/estgweb/domain/StudentImpl.java
26,8 → 26,12
public static final Logger logger = Logger.getLogger(StudentImpl.class);
 
private List<CourseUnit> subscribedUnitsView = null;
private List<CourseUnit> subscribedUnitsCurrentYearView = null;
private List<CourseUnit> subscribedUnitsOldYearsView = null;
private List<CourseUnitAnnouncementImpl> courseUnitAnnouncementsView = null;
private List<Course> subscribedCoursesView = null;
private List<Course> subscribedCoursesCurrentYearView = null;
private List<Course> subscribedCoursesOldYearsView = null;
 
public List<Course> getSubscribedCoursesView()
{
35,6 → 39,18
return subscribedCoursesView;
}
 
public List<Course> getSubscribedCoursesCurrentYearView()
{
getSubscribedUnitsCurrentYearView();
return subscribedCoursesCurrentYearView;
}
 
public List<Course> getSubscribedCoursesOldYearsView()
{
getSubscribedUnitsOldYearsView();
return subscribedCoursesOldYearsView;
}
 
public String getManagedRole() {
return STUDENT_ROLE;
}
68,7 → 84,65
return subscribedUnitsView;
}
 
public List<CourseUnit> getSubscribedUnitsCurrentYearView()
{
if(subscribedUnitsCurrentYearView == null)
{
subscribedCoursesCurrentYearView = new ArrayList<Course>();
try
{
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{"serializable"};
Object[] args = new Object[]{getId()};
subscribedUnitsCurrentYearView = (List<CourseUnit>) sm.execute(null, "LoadSubscribedUnitsCurrentYear", args, names);
if(subscribedUnitsCurrentYearView == null)
subscribedUnitsCurrentYearView = new ArrayList<CourseUnit>();
for(CourseUnit c: subscribedUnitsCurrentYearView)
{
if(!subscribedCoursesCurrentYearView.contains(c.getCourse()))
{
subscribedCoursesCurrentYearView.add(c.getCourse());
}
}
}
catch (Throwable e)
{
logger.error(e,e);
}
}
return subscribedUnitsCurrentYearView;
}
 
public List<CourseUnit> getSubscribedUnitsOldYearsView()
{
if(subscribedUnitsOldYearsView == null)
{
subscribedCoursesOldYearsView = new ArrayList<Course>();
try
{
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{"serializable"};
Object[] args = new Object[]{getId()};
subscribedUnitsOldYearsView = (List<CourseUnit>) sm.execute(null, "LoadSubscribedUnitsOldYears", args, names);
if(subscribedUnitsOldYearsView == null)
subscribedUnitsOldYearsView = new ArrayList<CourseUnit>();
for(CourseUnit c: subscribedUnitsOldYearsView)
{
if(!subscribedCoursesOldYearsView.contains(c.getCourse()))
{
subscribedCoursesOldYearsView.add(c.getCourse());
}
}
}
catch (Throwable e)
{
logger.error(e,e);
}
}
return subscribedUnitsOldYearsView;
}
 
 
public List<CourseUnitAnnouncementImpl> getCourseUnitAnnouncementsView()
{
if(courseUnitAnnouncementsView == null)
/impl/src/java/pt/estgp/estgweb/domain/CourseUnitImpl.java
61,7 → 61,7
 
public boolean isInternal()
{
return true;
return true;
}
 
public CourseUnitBlogImpl getUnitBlog()
70,4 → 70,18
return (CourseUnitBlogImpl) getBlogs().iterator().next();
return null;
}
 
public boolean equals(Object anotherInstance)
{
if(anotherInstance instanceof CourseUnitImpl)
{
CourseUnitImpl anCourseUnit = (CourseUnitImpl) anotherInstance;
return anCourseUnit.getCode() != null && getCode() != null && getCode().equals(anCourseUnit.getCode()) &&
anCourseUnit.getCourseCode() != null && getCourseCode() != null && getCourseCode().equals(anCourseUnit.getCourseCode()) &&
anCourseUnit.getSemestre() != null && getSemestre() != null && getSemestre().equals(anCourseUnit.getSemestre()) &&
anCourseUnit.getImportYear() != null && getImportYear() != null && getImportYear().equals(anCourseUnit.getImportYear());
}
return false;
 
}
}
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/TeacherDaoImpl.java
1,7 → 1,12
package pt.estgp.estgweb.domain.dao.impl;
 
import pt.estgp.estgweb.domain.Teacher;
import pt.estgp.estgweb.domain.CourseUnit;
import pt.estgp.estgweb.domain.CourseUnitImpl;
import static org.hibernate.criterion.Restrictions.*;
 
import java.util.List;
 
/**
* @author Jorge Machado
* @date 28/Fev/2008
23,10 → 28,13
{
return (Teacher) createCriteria().add(eq("sigesCode",sigesCode)).uniqueResult();
}
public Teacher loadByBi(String bi)
 
public Teacher loadByBi(String bi)
{
return (Teacher) createCriteria().add(eq("bi",bi)).uniqueResult();
}
 
 
 
}
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/CourseUnitDaoImpl.java
3,6 → 3,7
import pt.estgp.estgweb.domain.CourseUnit;
import pt.estgp.estgweb.domain.Blog;
import pt.estgp.estgweb.domain.TeacherImpl;
import pt.estgp.estgweb.domain.CourseUnitImpl;
import pt.estgp.estgweb.domain.dao.DaoUtils;
import pt.estgp.estgweb.services.common.SearchTypeEnum;
import pt.estgp.estgweb.utils.DatesUtils;
52,13 → 53,21
{
return createCriteria().add(eq("importYear",importYear))
.createAlias("students","st")
.add(eq("st.id", studentId)).list();
.add(eq("st.id", studentId)).addOrder(Order.asc("name")).list();
}
public List<CourseUnit> loadTeachedImportYearUnits(long studentId, String importYear)
 
public List<CourseUnit> loadSubscribedOtherImportYearUnits(long studentId, String importYear)
{
return createCriteria().add(not(eq("importYear",importYear)))
.createAlias("students","st")
.add(eq("st.id", studentId)).addOrder(Order.asc("name")).list();
}
public List<CourseUnitImpl> loadTeachedImportYearUnits(long teacherId, String importYear)
{
return createCriteria().add(eq("importYear",importYear))
.createAlias("teachers","st")
.add(eq("st.id", studentId)).list();
.add(eq("st.id", teacherId)).addOrder(Order.asc("importYear")).addOrder(Order.asc("name")).list();
}
 
public CourseUnit loadBySigesCodeUnique(String sigesCode)
/impl/src/java/pt/estgp/estgweb/domain/TeacherImpl.java
25,7 → 25,9
public static final Logger logger = Logger.getLogger(TeacherImpl.class);
 
private List<CourseUnit> teachedUnitsView = null;
private List<CourseUnit> teachedUnitsCurrentYearView = null;
private List<Course> teachedCoursesView = null;
private List<Course> teachedCoursesCurrentYearView = null;
 
public TeacherImpl()
{
41,6 → 43,12
getTeachedUnitsView();
return teachedCoursesView;
}
 
public List<Course> getTeachedCoursesCurrenYearView()
{
getTeachedUnitsCurrentYearView();
return teachedCoursesCurrentYearView;
}
public List<CourseUnit> getTeachedUnitsView()
{
71,6 → 79,35
return teachedUnitsView;
}
 
public List<CourseUnit> getTeachedUnitsCurrentYearView()
{
if(teachedUnitsCurrentYearView == null)
{
teachedCoursesCurrentYearView = new ArrayList<Course>();
try
{
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{"serializable"};
Object[] args = new Object[]{getId()};
teachedUnitsCurrentYearView = (List<CourseUnit>) sm.execute(null, "LoadTeachedUnitsCurrentYear", args, names);
if(teachedUnitsCurrentYearView == null)
teachedUnitsCurrentYearView = new ArrayList<CourseUnit>();
for(CourseUnit c: teachedUnitsCurrentYearView)
{
if(!teachedCoursesCurrentYearView.contains(c.getCourse()))
{
teachedCoursesCurrentYearView.add(c.getCourse());
}
}
}
catch (Throwable e)
{
logger.error(e,e);
}
}
return teachedUnitsCurrentYearView;
}
 
public boolean hasCourseUnit(long id)
{
return hasCourseUnit(id,false);
/impl/src/java/pt/estgp/estgweb/domain/views/CourseUnitView.java
100,7 → 100,6
this.code = courseUnit.getCode();
this.importYear = courseUnit.getImportYear();
this.semestre = courseUnit.getSemestre();
this.importYear = courseUnit.getImportYear();
this.courseCode = courseUnit.getCourseCode();
this.objectives = courseUnit.getObjectives();
if(courseUnit.getProgramStreamId() != null)
/impl/src/web/css/style.css
494,8 → 494,9
}
.block ul li ul li
{
padding-left: 10px;
padding-left: 0;
}
 
.block p, .navLeftMenu h2 {
background-color: #8EC73F;
padding-left: 10px;
504,10 → 505,22
}
 
.block ul {
LIST-STYLE-TYPE: none;
padding-left: 10px;
LIST-STYLE-TYPE: square;
padding-left: 15px;
margin-left:0;
}
 
.block ul ul{
LIST-STYLE-TYPE: circle;
padding-left: 15px;
margin-left:0;
}
.block ul li{
padding-top:5px;
padding-left:0;
margin-left:0;
}
 
.block a {
color: #4d4d4d;
text-decoration: none;
/impl/src/web/layout/topnav.jsp
12,10 → 12,15
List<NavPlace> navKeys = topNav.getNavPlaces();
for (NavPlace navPlace : navKeys)
{
 
 
if (navPlace.getUrl() != null)
{
String context = "";
if(navPlace.getUrl().startsWith("/"))
context = request.getContextPath();
%>
<li class="navPlace"><a href="<%=request.getContextPath() + navPlace.getUrl()%>"><%=navPlace.getMessage(request)%></a> &gt;</li>
<li class="navPlace"><a href="<%=context + navPlace.getUrl()%>"><%=navPlace.getMessage(request)%></a> &gt;</li>
<%
}
else
/impl/src/web/layout/separators.jsp
33,7 → 33,7
String link3 = "href=\"" + request.getContextPath() + "/user/startProfile.do\"";
String link4 = "href=\"" + request.getContextPath() + "/user/startServiceZone.do\"";
String link5 = "href=\"" + request.getContextPath() + "/proxy/layoutIOnline/ionline/\"";
String link6 = "href=\"" + request.getContextPath() + "/proxy/layoutIntranetUtils/estgp/intranet/utils.html\"";
String link6 = "href=\"" + request.getContextPath() + "/proxy/layoutIntranetUtils/estgp/intranet/escola/utils.html\"";
 
if(sep == 0)
{
/impl/src/web/public/profile/profileHome.jsp
115,7 → 115,7
<ul>
<logic:iterate id="courseUnit" name="course" property="courseUnits">
<li>
<html:link action="${user}/startLoadCourseUnit${fromAction}?courseUnitView.id=${courseUnit.id}"><bean:write name="courseUnit" property="name"/> (<bean:write name="courseUnit" property="code"/>)</html:link>
(<bean:write name="courseUnit" property="importYear"/>) <html:link action="${user}/startLoadCourseUnit${fromAction}?courseUnitView.id=${courseUnit.id}"><bean:write name="courseUnit" property="name"/> (<bean:write name="courseUnit" property="code"/>)</html:link>
</li>
</logic:iterate>
</ul>
/impl/src/web/templates/intranet/escola/secretaria/documentosApoio.html
85,6 → 85,8
</ul>
</li>
</ul>
 
<a href="teste/teste.html?nav0=Documentos de apoio&navUrl0=../documentosApoio.html%3Fnav0%3DDocumentos de Apoio&nav1=teste">teste</a>
</div>
</div>
</div>
/impl/src/web/user/courseunits/menu.jsp
49,9 → 49,9
<li>
<html:link action="/user/startSubmitAnnouncementFromCourseUnit?announcementView.courseUnitView.id=${CourseUnitView.id}"><bean:message key="courseunit.menu.put.announcement"/></html:link>
</li>
<li>
<!--<li>
<a href="<%=request.getContextPath()%>/"><bean:message key="courseunit.menu.put.question"/></a>
</li>
</li>-->
<li>
<a href="<%=request.getContextPath()%>${user}/startLoadCourseUnitWorks${fromAction}.do?courseUnitView.id=${CourseUnitView.id}"><bean:message key="courseunit.menu.assignements"/></a>
</li>
/impl/src/web/user/home/student.jsp
16,16 → 16,17
<div class="block">
<p><bean:message key="intranet.course.units"/></p>
<ul>
<logic:present name="UserSession" property="user.subscribedUnitsView">
<logic:present name="UserSession" property="user.subscribedUnitsCurrentYearView">
<logic:notEmpty name="UserSession" property="user.subscribedUnitsView">
<logic:iterate id="unit" name="UserSession" property="user.subscribedUnitsView" type="pt.estgp.estgweb.domain.CourseUnit">
<li>
<html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name}</html:link>
<html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.importYear})</html:link>
</li>
</logic:iterate>
</logic:notEmpty>
</logic:present>
</ul>
<!--Can put year all other units in the future calling service user.subscribedUnitsOldYearsView-->
</div>
</td>
</baco:isModuleOn>
/impl/src/web/user/home/teacher.jsp
18,9 → 18,9
<ul>
<logic:present name="UserSession" property="user.teachedUnitsView">
<logic:notEmpty name="UserSession" property="user.teachedUnitsView">
<logic:iterate id="unit" name="UserSession" property="user.teachedUnitsView" type="pt.estgp.estgweb.domain.CourseUnit">
<logic:iterate id="unit" name="UserSession" property="user.teachedUnitsCurrentYearView" type="pt.estgp.estgweb.domain.CourseUnit">
<li>
<html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.courseName})</html:link>
<html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${unit.courseName}) (${unit.importYear})</html:link>
</li>
</logic:iterate>
</logic:notEmpty>
/impl/etc/todo/todo.txt
1,3 → 1,9
 
 
No dia da Instalação:
Pasta de Deliberações CC copy paste
 
 
Configuracoes de Teste
Server ESTGP esta definido para o localhost
Start Path do IOnline esta para a raiz mas para testar unidades tem de apontar para /Erasmus/baco
12,10 → 18,13
Calendario de Exames > passa a pasta ionline
Projectos Finais > criar pasta escola\projectos ionline
Actas do Conselho directivo > ionline com permissões especias
Pasta da Legislação > NovaWeb
Pasta da Legislação > NovaWeb
 
Pasta Bolonha ZIP Pack deploy
Pasta Horarios Criar hierarquia. > Intranet/horarios
 
 
 
Jorge Meu
Tirar o getSerializable de noovo do domainObject e ver de onde devem herdar