Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 1010 → Rev 1017

/impl/conf/app.properties
460,9 → 460,9
siges.degree.4=M
siges.degree.8=C
 
national.institution.code=3122
siges.institution.code=1
ws.siges.wsdl=@ws.siges.wsdl@
# DONT USE ANY MORE NOW IS IN CONFIGURATION DAO national.institution.code=3122
# DONT USE ANY MORE NOW IS IN CONFIGURATION DAO siges.institution.code=1
# DONT USE ANY MORE NOW IS IN CONFIGURATION DAO ws.siges.wsdl=@ws.siges.wsdl@
ws.siges.target.namespace=@ws.siges.target.namespace@
 
ws.siges.secret=deptal1232007estg.
/impl/src/java/pt/estgp/estgweb/Globals.java
1,6 → 1,7
package pt.estgp.estgweb;
 
import pt.estgp.estgweb.domain.DirectoryImpl;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.services.directories.DirectoryService;
import pt.estgp.estgweb.utils.ConfigProperties;
 
162,9 → 163,10
public static final List<String> DEPARTAMENTOS = ConfigProperties.getListValues("departamento");
 
/*SIGES WEB SERVICES*/
public static final BigDecimal NATIONAL_INSTITUTION_CODE = new BigDecimal(ConfigProperties.getIntProperty("national.institution.code"));
public static final BigDecimal SIGES_INSTITUTION_CODE = new BigDecimal(ConfigProperties.getIntProperty("siges.institution.code"));
public static final String SIGES_WEBSERVICE_WSDL = ConfigProperties.getProperty("ws.siges.wsdl");
//NAO É URGENTE PARA ACTUALIZACOES VAMOS DEIXAR CARREGAR DA BD E NAS ACTUALIZAÇOES MUDA AQUI
public static BigDecimal NATIONAL_INSTITUTION_CODE = new BigDecimal(DaoFactory.getConfigurationDaoImpl().getNationalInstitutionCodeCreateTransaction());
// DONT USE NOW IN CONFIGURATION DAO public static final BigDecimal SIGES_INSTITUTION_CODE = new BigDecimal(ConfigProperties.getIntProperty("siges.institution.code"));
// DONT USE ANY MORE NOW IS IN CONFIGURATION DAOpublic static final String SIGES_WEBSERVICE_WSDL = ConfigProperties.getProperty("ws.siges.wsdl");
public static final String SIGES_WEBSERVICE_TARGET_NAMESPACE = ConfigProperties.getProperty("ws.siges.target.namespace");
public static final String SIGES_WEBSERVICE_SECRET = ConfigProperties.getProperty("ws.siges.secret");
 
/impl/src/java/pt/estgp/estgweb/services/courseunits/SaveCourseUnitEvaluation.java
87,10 → 87,17
if(cupv.isFechar())
{
evaluation.setClosed(true);
evaluation.setTeacherComplete(true);
}
else if(cupv.isTeacherComplete())
{
evaluation.setTeacherComplete(true);
}
else
{
evaluation.setClosed(false);
//TODO TIRAR ISTO NO PROXIMO ANO
evaluation.setTeacherComplete(true);
}
 
createPdf(evaluation,c,usession,errors);
124,6 → 131,41
return cupv;
}
 
//TODO TEACHER COMPLETE OPEN
public CourseUnitEvaluationView setTeacherIncomplete(Long coursUnitId, UserSession usession) throws ServiceException {
 
CourseUnit c = DaoFactory.getCourseUnitDaoImpl().get(coursUnitId);
CourseUnitEvaluation evaluation = c.getCourseUnitEvaluation();
//So responsaveis e profs desdemente que a avaliação nao esteja fechada
//caso contrario so coordenadores
boolean isTeacherOfCourseUnitAndEvaluationNotClosed =
usession.getUser() instanceof Teacher
&&
(
((Teacher)usession.getUser()).isTeacherOfCourseUnit(c.getId(),true)
||
c.getResponsableTeacher()!=null && usession.getUser().getId() == c.getResponsableTeacher().getId()
)
&& !evaluation.isClosed();
 
boolean isCoordinatorOrCourseCommission =
usession.getUser() instanceof Teacher
&&
(
usession.getUser().hasRole(c.getCourse().getValidationRole())
||
((usession.getUser()) == c.getCourse().getCoordinator())
);
 
 
if(isTeacherOfCourseUnitAndEvaluationNotClosed || isCoordinatorOrCourseCommission)
{
evaluation.setTeacherComplete(false);
}
CourseUnitEvaluationView cupv = new CourseUnitEvaluationView(evaluation);
return cupv;
}
 
public void createPdf(CourseUnitEvaluation cuv, CourseUnit cu, UserSession userSession,List<String> errors) throws IOException, TransformerException, FOPException {
 
 
/impl/src/java/pt/estgp/estgweb/services/courseunits/CreateCourseUnitAdminService.java
1,7 → 1,6
package pt.estgp.estgweb.services.courseunits;
 
import org.apache.log4j.Logger;
import pt.estgp.estgweb.Globals;
import pt.estgp.estgweb.domain.CourseUnit;
import pt.estgp.estgweb.domain.DomainObjectFactory;
import pt.estgp.estgweb.domain.UserSession;
49,7 → 48,7
}
cUV.persistViewAdminInObject(courseUnit);
 
courseUnit.setInstitutionCode("" + Globals.SIGES_INSTITUTION_CODE.intValue());
courseUnit.setInstitutionCode("" + DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode());
//por o curso
//por os profs
//por alunos
/impl/src/java/pt/estgp/estgweb/services/sigesimports/ImportGradesService.java
22,6 → 22,7
import pt.utl.ist.berserk.logic.serviceManager.IService;
 
import javax.xml.namespace.QName;
import java.math.BigDecimal;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;
44,15 → 45,16
public ILogMessages run(String year) throws ServiceException
{
DefaultLogMessages logMessages = new DefaultLogMessages();
logMessages.addMessage(new DefaultLogMessage("import.grades", LogMessageTypeEnum.INFO, "instituicao " + Globals.SIGES_INSTITUTION_CODE));
logMessages.addMessage(new DefaultLogMessage("import.grades", LogMessageTypeEnum.INFO, "instituicao " + DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode()));
logger.info("starting grades import");
try
{
AbstractDao.getCurrentSession().beginTransaction();
String WSDL = DaoFactory.getConfigurationDaoImpl().getSigesWebServicesWsdl();
SiGesWEB service;
try
{
service = new SiGesWEB(new URL(Globals.SIGES_WEBSERVICE_WSDL), new QName(Globals.SIGES_WEBSERVICE_TARGET_NAMESPACE, "SiGesWEB"));
service = new SiGesWEB(new URL(WSDL), new QName(Globals.SIGES_WEBSERVICE_TARGET_NAMESPACE, "SiGesWEB"));
}
catch (MalformedURLException e)
{
60,7 → 62,7
logger.fatal(e, e);
return logMessages;
}
ArrayOfNota arrayOfNotas = service.getSiGesWEBSoap().getNotas(Globals.SIGES_INSTITUTION_CODE, year);
ArrayOfNota arrayOfNotas = service.getSiGesWEBSoap().getNotas(new BigDecimal(DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode()), year);
List<Nota> notas = arrayOfNotas.getNota();
int i = 0;
for (Nota nota : notas)
/impl/src/java/pt/estgp/estgweb/services/sigesimports/ImportSumaries.java
24,6 → 24,7
import pt.utl.ist.berserk.logic.serviceManager.IService;
 
import javax.xml.namespace.QName;
import java.math.BigDecimal;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
49,15 → 50,16
public ILogMessages run(String year) throws ServiceException
{
DefaultLogMessages logMessages = new DefaultLogMessages();
logMessages.addMessage(new DefaultLogMessage("import.summaries", LogMessageTypeEnum.INFO, "instituicao " + Globals.SIGES_INSTITUTION_CODE));
logMessages.addMessage(new DefaultLogMessage("import.summaries", LogMessageTypeEnum.INFO, "instituicao " + DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode()));
logger.info("starting summaries import");
try
{
AbstractDao.getCurrentSession().beginTransaction();
String WSDL = DaoFactory.getConfigurationDaoImpl().getSigesWebServicesWsdl();
SiGesWEB service;
try
{
service = new SiGesWEB(new URL(Globals.SIGES_WEBSERVICE_WSDL), new QName(Globals.SIGES_WEBSERVICE_TARGET_NAMESPACE, "SiGesWEB"));
service = new SiGesWEB(new URL(WSDL), new QName(Globals.SIGES_WEBSERVICE_TARGET_NAMESPACE, "SiGesWEB"));
}
catch (MalformedURLException e)
{
87,7 → 89,7
//comentario de teste
try
{
arrayOfAulas = service.getSiGesWEBSoap().getAulas(Globals.SIGES_INSTITUTION_CODE, year,c.getCode(),DatesUtils.getSemestre());
arrayOfAulas = service.getSiGesWEBSoap().getAulas(new BigDecimal(DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode()), year,c.getCode(),DatesUtils.getSemestre());
break;
}
catch(Throwable t)
/impl/src/java/pt/estgp/estgweb/services/sigesimports/ImportStudentsService.java
70,15 → 70,16
logger.info(msgS);
 
DefaultLogMessages logMessages = new DefaultLogMessages();
logMessages.addMessage(new DefaultLogMessage("import.students", LogMessageTypeEnum.INFO, "instituicao " + Globals.SIGES_INSTITUTION_CODE));
logMessages.addMessage(new DefaultLogMessage("import.students", LogMessageTypeEnum.INFO, "instituicao " + DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode()));
 
try
{
SiGesWEB service;
String WSDL = DaoFactory.getConfigurationDaoImpl().getSigesWebServicesWsdl();
try
{
serviceLogInfo("STARTING WEB SERVICE AT " + Globals.SIGES_WEBSERVICE_WSDL);
service = new SiGesWEB(new URL(Globals.SIGES_WEBSERVICE_WSDL), new QName(Globals.SIGES_WEBSERVICE_TARGET_NAMESPACE, "SiGesWEB"));
serviceLogInfo("STARTING WEB SERVICE AT " + WSDL);
service = new SiGesWEB(new URL(WSDL), new QName(Globals.SIGES_WEBSERVICE_TARGET_NAMESPACE, "SiGesWEB"));
}
catch (MalformedURLException e)
{
88,7 → 89,7
return logMessages;
}
 
ArrayOfDecimal codigosAlunos = service.getSiGesWEBSoap().getCodigosAlunosInscritosDaInstituicao(Globals.SIGES_INSTITUTION_CODE, year);
ArrayOfDecimal codigosAlunos = service.getSiGesWEBSoap().getCodigosAlunosInscritosDaInstituicao(new BigDecimal(DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode()), year);
List<BigDecimal> codigos = codigosAlunos.getDecimal();
int i = 1;
 
103,7 → 104,7
AbstractDao.getCurrentSession().beginTransaction();
}
 
Aluno alunoSiges = service.getSiGesWEBSoap().getAlunoInscrito(c, Globals.SIGES_INSTITUTION_CODE, year);
Aluno alunoSiges = service.getSiGesWEBSoap().getAlunoInscrito(c, new BigDecimal(DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode()), year);
User u = DaoFactory.getUserDaoImpl().loadByUsernameOrSigesCode(alunoSiges.getCodigo().intValue());
Student s = null;
boolean newUser = false;
/impl/src/java/pt/estgp/estgweb/services/sigesimports/LoadSumariesToPDF.java
24,6 → 24,7
import pt.utl.ist.berserk.logic.serviceManager.IService;
 
import javax.xml.namespace.QName;
import java.math.BigDecimal;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
66,7 → 67,7
}
AbstractDao.getCurrentSession().beginTransaction();
CourseUnit c = DaoFactory.getCourseUnitDaoImpl().get(courseUnitId);
ArrayOfAula arrayOfAulas = service.getSiGesWEBSoap().getAulas(Globals.SIGES_INSTITUTION_CODE, c.getImportYear(),c.getCode(),c.getSemestre());
ArrayOfAula arrayOfAulas = service.getSiGesWEBSoap().getAulas(new BigDecimal(DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode()), c.getImportYear(),c.getCode(),c.getSemestre());
 
if(arrayOfAulas != null && arrayOfAulas.getAula() != null)
{
99,15 → 100,16
public ILogMessages run(String year) throws ServiceException
{
DefaultLogMessages logMessages = new DefaultLogMessages();
logMessages.addMessage(new DefaultLogMessage("import.summaries", LogMessageTypeEnum.INFO, "instituicao " + Globals.SIGES_INSTITUTION_CODE));
logMessages.addMessage(new DefaultLogMessage("import.summaries", LogMessageTypeEnum.INFO, "instituicao " + DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode()));
logger.info("starting summaries import");
try
{
AbstractDao.getCurrentSession().beginTransaction();
String WSDL = DaoFactory.getConfigurationDaoImpl().getSigesWebServicesWsdl();
SiGesWEB service;
try
{
service = new SiGesWEB(new URL(Globals.SIGES_WEBSERVICE_WSDL), new QName(Globals.SIGES_WEBSERVICE_TARGET_NAMESPACE, "SiGesWEB"));
service = new SiGesWEB(new URL(WSDL), new QName(Globals.SIGES_WEBSERVICE_TARGET_NAMESPACE, "SiGesWEB"));
}
catch (MalformedURLException e)
{
137,7 → 139,7
//comentario de teste
try
{
arrayOfAulas = service.getSiGesWEBSoap().getAulas(Globals.SIGES_INSTITUTION_CODE, year,c.getCode(),DatesUtils.getSemestre());
arrayOfAulas = service.getSiGesWEBSoap().getAulas(new BigDecimal(DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode()), year,c.getCode(),DatesUtils.getSemestre());
break;
}
catch(Throwable t)
/impl/src/java/pt/estgp/estgweb/services/sigesimports/SincronizeLastYearCourseUnitProgramsService.java
3,7 → 3,6
import jomm.dao.impl.AbstractDao;
import org.apache.fop.apps.FOPException;
import org.apache.log4j.Logger;
import pt.estgp.estgweb.Globals;
import pt.estgp.estgweb.domain.*;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.domain.views.CourseUnitView;
77,7 → 76,7
DefaultLogMessages logMessages = new DefaultLogMessages();
try
{
logMessages.addMessage(new DefaultLogMessage("courseunitprograms.sincronization", LogMessageTypeEnum.INFO, "instituicao " + Globals.SIGES_INSTITUTION_CODE));
logMessages.addMessage(new DefaultLogMessage("courseunitprograms.sincronization", LogMessageTypeEnum.INFO, "instituicao " + DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode()));
serviceLogInfo(logMessages.getLastMessage());
 
int i = 0;
/impl/src/java/pt/estgp/estgweb/services/sigesimports/ImportTeachersService.java
73,15 → 73,16
logger.info(msgS);
 
DefaultLogMessages logMessages = new DefaultLogMessages();
logMessages.addMessage(new DefaultLogMessage("import.teachers", LogMessageTypeEnum.INFO, "instituicao " + Globals.SIGES_INSTITUTION_CODE));
logMessages.addMessage(new DefaultLogMessage("import.teachers", LogMessageTypeEnum.INFO, "instituicao " + DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode()));
 
try
{
String WSDL = DaoFactory.getConfigurationDaoImpl().getSigesWebServicesWsdl();
SiGesWEB service;
try
{
serviceLogInfo("STARTING WEB SERVICE AT " + Globals.SIGES_WEBSERVICE_WSDL);
service = new SiGesWEB(new URL(Globals.SIGES_WEBSERVICE_WSDL), new QName(Globals.SIGES_WEBSERVICE_TARGET_NAMESPACE, "SiGesWEB"));
serviceLogInfo("STARTING WEB SERVICE AT " + WSDL);
service = new SiGesWEB(new URL(WSDL), new QName(Globals.SIGES_WEBSERVICE_TARGET_NAMESPACE, "SiGesWEB"));
}
catch (MalformedURLException e)
{
90,7 → 91,7
serviceLogFatal(logMessages.getLastMessage(), e);
return logMessages;
}
ArrayOfDecimal codigosDocentes = service.getSiGesWEBSoap().getCodigosDocentesInscritosDaInstituicao(Globals.SIGES_INSTITUTION_CODE, year);
ArrayOfDecimal codigosDocentes = service.getSiGesWEBSoap().getCodigosDocentesInscritosDaInstituicao(new BigDecimal(DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode()), year);
List<BigDecimal> codigos = codigosDocentes.getDecimal();
 
int i = 1;
107,7 → 108,7
}
 
 
Docente d = service.getSiGesWEBSoap().getDocente(c, Globals.SIGES_INSTITUTION_CODE, year);
Docente d = service.getSiGesWEBSoap().getDocente(c, new BigDecimal(DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode()), year);
logger.info("Codigo Funcionario Importado: SIGES(" + d.getCodigoFuncionario().intValue() + ") email IPP SIGES: " + d.getEmail());
logger.info("SIGES IMPORTED INFO: " + docenteToString(d));
Teacher t = DaoFactory.getTeacherDaoImpl().loadBySigesCode(d.getCodigoFuncionario().intValue());
/impl/src/java/pt/estgp/estgweb/services/sigesimports/ImportCourseService.java
25,6 → 25,7
import pt.utl.ist.berserk.logic.serviceManager.IService;
 
import javax.xml.namespace.QName;
import java.math.BigDecimal;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.*;
52,7 → 53,7
DefaultLogMessages logMessages = new DefaultLogMessages();
try
{
logMessages.addMessage(new DefaultLogMessage("import.semestre.separated", LogMessageTypeEnum.INFO, "instituicao " + Globals.SIGES_INSTITUTION_CODE));
logMessages.addMessage(new DefaultLogMessage("import.semestre.separated", LogMessageTypeEnum.INFO, "instituicao " + DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode()));
serviceLogInfo(logMessages.getLastMessage());
 
HashMap<String, Disciplina> disciplinasMap = new HashMap<String, Disciplina>();
65,10 → 66,11
* Build Course Units Maps
*/
SiGesWEB service;
String WSDL = DaoFactory.getConfigurationDaoImpl().getSigesWebServicesWsdl();
try
{
serviceLogInfo("STARTING WEB SERVICE AT " + Globals.SIGES_WEBSERVICE_WSDL);
service = new SiGesWEB(new URL(Globals.SIGES_WEBSERVICE_WSDL), new QName(Globals.SIGES_WEBSERVICE_TARGET_NAMESPACE, "SiGesWEB"));
serviceLogInfo("STARTING WEB SERVICE AT " + WSDL);
service = new SiGesWEB(new URL(WSDL), new QName(Globals.SIGES_WEBSERVICE_TARGET_NAMESPACE, "SiGesWEB"));
}
catch (MalformedURLException e)
{
182,7 → 184,7
logMessages.addMessage(new DefaultLogMessage("import.semestre.course.units." + semestre, LogMessageTypeEnum.INFO));
serviceLogInfo("importing " + semestre + " course units");
logger.info("importing " + semestre + " course units");
ArrayOfDisciplina arrayOfDisciplina = service.getSiGesWEBSoap().getDisciplinasDaInstituicaoSemestre(Globals.SIGES_INSTITUTION_CODE, year, semestre);
ArrayOfDisciplina arrayOfDisciplina = service.getSiGesWEBSoap().getDisciplinasDaInstituicaoSemestre(new BigDecimal(DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode()), year, semestre);
List<Disciplina> disciplinas = arrayOfDisciplina.getDisciplina();
for (Disciplina d : disciplinas)
{
224,7 → 226,7
newUnits++;
}
c.setName(d.getNome());
c.setInstitutionCode("" + Globals.SIGES_INSTITUTION_CODE);
c.setInstitutionCode("" + DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode());
c.setCode("" + d.getCodigo().intValue());
c.setCourseCode("" + d.getCodigoCurso());
c.setCourseName("" + d.getNomeCurso());
/impl/src/java/pt/estgp/estgweb/services/sigesimports/ImportSumariesJson.java
39,6 → 39,7
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
71,7 → 72,7
logger.info(msgS);
 
DefaultLogMessages logMessages = new DefaultLogMessages();
logMessages.addMessage(new DefaultLogMessage("import.summaries", LogMessageTypeEnum.INFO, "instituicao " + Globals.SIGES_INSTITUTION_CODE));
logMessages.addMessage(new DefaultLogMessage("import.summaries", LogMessageTypeEnum.INFO, "instituicao " + DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode()));
serviceLogInfo(logMessages.getLastMessage());
 
 
85,10 → 86,11
{
 
SiGesWEB service;
String WSDL = DaoFactory.getConfigurationDaoImpl().getSigesWebServicesWsdl();
try
{
serviceLogInfo("STARTING WEB SERVICE AT " + Globals.SIGES_WEBSERVICE_WSDL);
service = new SiGesWEB(new URL(Globals.SIGES_WEBSERVICE_WSDL), new QName(Globals.SIGES_WEBSERVICE_TARGET_NAMESPACE, "SiGesWEB"));
serviceLogInfo("STARTING WEB SERVICE AT " + WSDL);
service = new SiGesWEB(new URL(WSDL), new QName(Globals.SIGES_WEBSERVICE_TARGET_NAMESPACE, "SiGesWEB"));
}
catch (Throwable e)
{
130,7 → 132,7
//comentario de teste
try
{
arrayOfAulas = service.getSiGesWEBSoap().getAulas(Globals.SIGES_INSTITUTION_CODE, year,c.getCode(),semestre);
arrayOfAulas = service.getSiGesWEBSoap().getAulas(new BigDecimal(DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode()), year,c.getCode(),semestre);
break;
}
catch(Throwable t)
/impl/src/java/pt/estgp/estgweb/services/sms/SmsService.java
1,5 → 1,6
package pt.estgp.estgweb.services.sms;
 
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.utl.ist.berserk.logic.serviceManager.IService;
import pt.estgp.estgweb.services.expceptions.ServiceException;
import pt.estgp.estgweb.Globals;
26,9 → 27,10
try
{
SiGesWEB service;
String WSDL = DaoFactory.getConfigurationDaoImpl().getSigesWebServicesWsdl();
try
{
service = new SiGesWEB(new URL(Globals.SIGES_WEBSERVICE_WSDL), new QName(Globals.SIGES_WEBSERVICE_TARGET_NAMESPACE, "SiGesWEB"));
service = new SiGesWEB(new URL(WSDL), new QName(Globals.SIGES_WEBSERVICE_TARGET_NAMESPACE, "SiGesWEB"));
}
catch (MalformedURLException e)
{
/impl/src/java/pt/estgp/estgweb/domain/CourseUnitProgramImpl.java
5,7 → 5,6
import org.dom4j.*;
import org.hibernate.NonUniqueResultException;
import org.hibernate.Session;
import pt.estgp.estgweb.Globals;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.services.courseunits.SaveCourseUnitProgram;
 
624,7 → 623,7
cu.setCode(line.codigoSIGESUnidade);
cu.setCourseCode(line.codigoCurso);
cu.setName(line.nomeUnidadeCurricular);
cu.setInstitutionCode("" + Globals.SIGES_INSTITUTION_CODE);
cu.setInstitutionCode("" + DaoFactory.getConfigurationDaoImpl().getSigesInstitutionCode());
 
setCourse(cu, line);
DaoFactory.getCourseUnitDaoImpl().save(cu);
/impl/src/java/pt/estgp/estgweb/domain/views/CourseUnitSummaryView.java
4,6 → 4,7
import pt.estgp.estgweb.web.utils.DatesUtils;
 
import java.io.Serializable;
import java.util.Date;
 
/**
* @author Jorge Machado
27,6 → 28,7
private String codigoAula;
private String codigoSumario;
private String codigoSala;
private Date originalDate;
 
 
public CourseUnitSummaryView() {
44,6 → 46,7
this.title = summary.getTitulo();
this.description = summary.getDescricao();
this.date = DatesUtils.getStringFromDate(summary.getDataAula());
this.originalDate = summary.getDataAula();
this.number = summary.getNumeroAula();
this.students = summary.getAlunosPresentes();
this.horas = summary.getNumeroHoras();
51,6 → 54,7
this.codigoAula = summary.getCodigoAula();
this.codigoSumario = summary.getCodigoSumario();
this.codigoSala = summary.getCodigoSalaAula();
 
}
 
// public void persistViewInObject(Announcement announcement)
94,6 → 98,10
return date;
}
 
public Date getOriginalDate() {
return originalDate;
}
 
public int getStudents()
{
return students;
/impl/src/java/pt/estgp/estgweb/domain/views/CourseUnitEvaluationView.java
18,6 → 18,7
 
private CourseUnitEvaluation courseUnitEvaluation;
private boolean fechar = false;
private boolean teacherComplete = false;
 
public Class getReferenceClass()
{
74,4 → 75,12
public void setFechar(boolean fechar) {
this.fechar = fechar;
}
 
public boolean isTeacherComplete() {
return teacherComplete;
}
 
public void setTeacherComplete(boolean teacherComplete) {
this.teacherComplete = teacherComplete;
}
}
/impl/src/java/pt/estgp/estgweb/domain/views/CourseUnitView.java
482,10 → 482,12
* @return sumaries or null if there are no summaries in Json
*/
 
int lateSummaries = 0;
 
public List<CourseUnitSummaryView> getSummariesFromJson() {
public synchronized List<CourseUnitSummaryView> getSummariesFromJson() {
if(summariesFromJson != null)
return summariesFromJson;
lateSummaries = 0;
summariesFromJson = new ArrayList<CourseUnitSummaryView>();
if(summariesJson != null && summariesJson.length() > 0)
{
496,10 → 498,20
{
JSONObject summary = summaries.getJSONObject(i);
CourseUnitSummaryImpl sum = DomainObjectFactory.createCourseUnitSummaryImpl();
 
if(sum.updateWithJson(summary)){
CourseUnitSummaryView view = new CourseUnitSummaryView(sum);
summariesFromJson.add(view);
}
else
{
CourseUnitSummaryView view = new CourseUnitSummaryView(sum);
if(view.getNumber() < 0 && view.getOriginalDate().getTime() < System.currentTimeMillis())
{
System.out.println(view.getNumber() + " " + view.getDate() + " " + view.getOriginalDate());
lateSummaries++;
}
}
}
} catch (JSONException e) {
logger.error(e,e);
520,6 → 532,13
return null;
}
 
public int getLateSummaries()
{
getSummariesFromJson();
return lateSummaries;
 
}
 
public void setSummariesJson(String summariesJson) {
this.summariesJson = summariesJson;
}
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/ConfigurationDaoImpl.java
1,8 → 1,10
package pt.estgp.estgweb.domain.dao.impl;
 
import pt.estgp.estgweb.Globals;
import pt.estgp.estgweb.domain.Configuration;
import pt.estgp.estgweb.domain.ConfigurationImpl;
 
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
 
29,7 → 31,10
Configuration configuration = new ConfigurationImpl();
configuration.setInterfaceImportYear("201516");
configuration.setImportsDefaultImportYear("201516");
configuration.setImportsDefaultImportYear("http://172.20.100.5:8080/SigesWeb/SiGesWEB.asmx?wsdl");
configuration.setCourseUnitEvaluationActiveYear("201415");
configuration.setSaveDate(new Date());
configuration.setSigesInstitutionCode(1);
save(configuration);
return configuration;
}
94,5 → 99,131
return importYear;
}
 
public String getCourseUnitEvaluationActiveYear()
{
return load().getCourseUnitEvaluationActiveYear();
}
 
public String getCourseUnitEvaluationActiveYearCreateTransaction()
{
getCurrentSession().beginTransaction();
String activeYear = getCourseUnitEvaluationActiveYear();
getCurrentSession().getTransaction().commit();
return activeYear;
}
 
public void updateCourseUnitEvaluationActiveYear(String activeYear)
{
Configuration config = load();
config.setCourseUnitEvaluationActiveYear(activeYear);
}
 
public void updateCourseUnitEvaluationActiveYearCreateTransaction(String activeYear)
{
getCurrentSession().beginTransaction();
updateCourseUnitEvaluationActiveYear(activeYear);
getCurrentSession().getTransaction().commit();
}
 
 
 
public String getSigesWebServicesWsdl()
{
return load().getSigesWebServicesWsdl();
}
 
public String getSigesWebServicesWsdlCreateTransaction()
{
getCurrentSession().beginTransaction();
String wsdl = getSigesWebServicesWsdl();
getCurrentSession().getTransaction().commit();
return wsdl;
}
 
public void updateSigesWebServicesWsdl(String wsdl)
{
Configuration config = load();
config.setSigesWebServicesWsdl(wsdl);
}
 
public void updateSigesWebServicesWsdlCreateTransaction(String wsdl)
{
getCurrentSession().beginTransaction();
updateSigesWebServicesWsdl(wsdl);
getCurrentSession().getTransaction().commit();
}
 
 
 
public int getSigesInstitutionCode()
{
return load().getSigesInstitutionCode();
}
 
public int getInstitutionCodeCreateTransaction()
{
getCurrentSession().beginTransaction();
int code = getSigesInstitutionCode();
getCurrentSession().getTransaction().commit();
return code;
}
 
public void updateSigesInstitutionCode(int instCode)
{
Configuration config = load();
config.setSigesInstitutionCode(instCode);
}
 
public void updateSigesInstitutionCodeCreateTransaction(int instCode)
{
getCurrentSession().beginTransaction();
updateSigesInstitutionCode(instCode);
getCurrentSession().getTransaction().commit();
}
 
 
 
 
 
public int getNationalInstitutionCode()
{
return load().getNationalInstitutionCode();
}
 
public int getNationalInstitutionCodeCreateTransaction()
{
getCurrentSession().beginTransaction();
int code = getNationalInstitutionCode();
getCurrentSession().getTransaction().commit();
return code;
}
 
/**
* Not problematic update only for interfaces
* Will not work only in MultiWebServer environment
* in that case needs a restart
* @param instCode
*/
public void updateNationalInstitutionCode(int instCode)
{
Configuration config = load();
config.setNationalInstitutionCode(instCode);
Globals.NATIONAL_INSTITUTION_CODE = new BigDecimal(instCode);
}
 
 
/**
* Not problematic update only for interfaces
* Will not work only in MultiWebServer environment
* in that case needs a restart
* @param instCode
*/
public void updateNationalInstitutionCodeCreateTransaction(int instCode)
{
getCurrentSession().beginTransaction();
updateNationalInstitutionCode(instCode);
Globals.NATIONAL_INSTITUTION_CODE = new BigDecimal(instCode);
getCurrentSession().getTransaction().commit();
}
 
}
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/CourseUnitDaoImpl.java
495,13 → 495,17
 
public List<CourseUnit> loadMissingEvaluationValidateGivenCourse(long courseId)
{
if(DaoFactory.getConfigurationDaoImpl().getCourseUnitEvaluationActiveYear()==null)
return new ArrayList<CourseUnit>();
 
return createCriteria()
.createAlias("course", "c")
.createAlias("courseUnitEvaluation", "ce")
.add(eq("c.id", courseId))
.add(not(eq("importYear", DaoFactory.getConfigurationDaoImpl().getInterfaceImportYear())))
.add(ge("importYear", "201415"))
.add(eq("importYear", DaoFactory.getConfigurationDaoImpl().getCourseUnitEvaluationActiveYear()))
//.add(ge("importYear", "201415"))//FirstYear where there was configurations
.add((eq("ce.closed", false)))
.add((eq("ce.teacherComplete", true)))
.list();
}
 
528,12 → 532,18
 
public List<CourseUnit> loadMissingEvaluation(long courseId)
{
if(DaoFactory.getConfigurationDaoImpl().getCourseUnitEvaluationActiveYear()==null)
return new ArrayList<CourseUnit>();
 
return createCriteria()
.createAlias("course", "c")
.add(eq("c.id", courseId))
.add(not(eq("importYear", DaoFactory.getConfigurationDaoImpl().getInterfaceImportYear())))
.add(ge("importYear", "201415"))
.add(isNull("courseUnitEvaluation"))
.add(eq("importYear", DaoFactory.getConfigurationDaoImpl().getCourseUnitEvaluationActiveYear()))
//.add(not(eq("importYear", DaoFactory.getConfigurationDaoImpl().getInterfaceImportYear())))
//.add(ge("importYear", "201415" ))
//.add(isNull("courseUnitEvaluation"))
//todo novo testar
.add(or(isNull("courseUnitEvaluation"),(eq("courseUnitEvaluation.teacherComplete", false))))
.list();
}
 
/impl/src/java/pt/estgp/estgweb/web/FtpServer.java
209,6 → 209,7
@Override
public boolean storeFile(String remote, InputStream local) throws IOException
{
logger.info("FTP store Timeout protection of " + FTP_DATA_STORE_TIMEOUT_SECONDS + " seconds");
this.remote = remote;
this.local = local;
Thread t = new Thread(this);
219,13 → 220,12
Thread.sleep(1000);
if(!t.isAlive())
{
if(this.isConnected())
break;
break;
}
}
if(!this.isConnected())
if(t.isAlive())
{
logger.info("Not Connected will interrupt");
logger.info("Timeout expired will interrupt");
t.interrupt();
return false;
}
/impl/src/updates/version/release2015-11.txt
45,3 → 45,32
- todo tirar os todo job dos envios de emails e sends to ionline
 
- todo Configurações possiveis de ir para BD
 
 
 
- todo relembrar
AVALIACAO CURRICULAR
 
- ANO DE AVALIACAO CURRICULAR ATIVO
- FALTA METER OS IF NAS PAGINAS DE EDIÇAO PARA nao deixar ng mecher se o ano nao estiver ativo
- falta testar os DAO par as queries que mudaram para uso da variavel ano ativo
- Falta actualizar base de dados com o campo novo do ATIVO
- Falta meter a amarelo os relatorios do Ano Activo e meter qq coisa como so consulta nos nao ativos
- Falta meter IF's na home para não aparecer nada de trabalho relacionado com o s lembreter dos programas
 
-FALTA o SEMESTRE ACTIVO na avaliação que deverá ter TODOS, S1, S2, A, S1 A ou S2 A
 
 
- campo teacherComplete default TRUE não incfluencia as queries porque estará sempre a true e nunca e metido a false
a menos que seja a pedido especifico do DOCENTE frase no JSP CANCELAR ENTREGA MAS PARA JA BOTAO DESAPARECE e depois volta a ser aberto
-query de por validar obriga teacherComplete a ser true no CourseUnitDao
loadMissingEvaluationValidateGivenCourse
e na outra query loadMissingEvaluation
de não feitos passou a ser or NULL or teacherComplete = false neste momento falta testar o metodo onde a query hibernte
tem o seguinte:
.add(or(isNull("courseUnitEvaluation"),(eq("courseUnitEvaluation.teacherComplete", false))))
 
 
meter ftp server ionline configurável
 
ver o que fazer com o POP se vai ou nao ao gmail
/impl/src/hbm/pt/estgp/estgweb/domain/CourseUnit.hbm.xml
246,6 → 246,10
<timestamp source="db" name="updateDate" unsaved-value="null"/>
<property name="saveDate" type="timestamp"/>
<property name="closed" type="boolean"/>
<!-- todo update aos do ano anterior para meter todos os evaluations salvos com teacherComplete = true -->
<property name="teacherComplete" type="boolean">
<column name="teacherComplete" default="true"/>
</property>
<property name="numAlunosInscritos" type="text"/>
<property name="numAlunosSemElementosAvaliacao" type="integer"/>
 
/impl/src/hbm/pt/estgp/estgweb/domain/Configuration.hbm.xml
14,8 → 14,22
<timestamp source="db" name="updateDate" unsaved-value="null"/>
<property name="saveDate" type="timestamp"/>
<property name="interfaceImportYear" type="string"/>
 
<!-- IMPORTS CONFIGS -->
<property name="importsDefaultImportYear" type="string"/>
<property name="sigesWebServicesWsdl" type="string"/>
<property name="sigesWebServicesWsdl" type="string">
<column name="sigesWebServicesWsdl" default="http://172.20.100.5:8080/SigesWeb/SiGesWEB.asmx?wsdl"/>
</property>
<property name="sigesInstitutionCode" type="integer">
<column name="sigesInstitutionCode" default="1"/>
</property>
<property name="nationalInstitutionCode" type="integer">
<column name="nationalInstitutionCode" default="3122"/>
</property>
 
<!--CourseUnitEvaluation formatImportYear-->
<property name="courseUnitEvaluationActiveYear" type="string"/>
 
<subclass name="pt.estgp.estgweb.domain.ConfigurationImpl" discriminator-value="ConfigurationImpl"/>
</class>
</hibernate-mapping>
/impl/src/web/user/courseunits/courseunit.jsp
262,7 → 262,16
</div>
<div class="seccao">
<h2><bean:message key="courseunit.summaries"/></h2>
<p><a href="<%=request.getContextPath()%>/ftpProxyStream/ionline${CourseUnitView.sumariosPathFileIntranet}">Descarregar PDF</a></p>
<logic:notEmpty name="CourseUnitView" property="summariesFromJson">
<p><a href="<%=request.getContextPath()%>/ftpProxyStream/ionline${CourseUnitView.sumariosPathFileIntranet}">Descarregar PDF</a></p>
<logic:greaterThan value="0" name="CourseUnitView" property="lateSummaries">
<p style="background-color: yellow">Tem <bean:write name="CourseUnitView" property="lateSummaries"/>
<logic:equal name="CourseUnitView" property="lateSummaries" value="1">Sumário</logic:equal>
<logic:greaterThan name="CourseUnitView" property="lateSummaries" value="1">Sumários</logic:greaterThan>
por preencher.
<a target="_blank" href="http://netpa.ipportalegre.pt">Aceda ao NETPA para regularizar</a></p>
</logic:greaterThan>
</logic:notEmpty>
 
 
<logic:notEmpty name="CourseUnitView" property="summariesFromJson">
/impl/build-web-services.xml
14,48 → 14,48
<target name="ws.generate-siges-client" depends="initDirs">
<copy file="${ws.client.binding.dir}/${ws.siges.binding.file}" todir="${build.dir.ws}" overwrite="true"/>
<replace file="${build.dir.ws}/${ws.siges.binding.file}" encoding="UTF-8">
<replacefilter token="@wsdl.client@" value="${ws.siges.wsdl}"/>
<replacefilter token="@target.namespace@" value="${ws.siges.target.namespace}"/>
<replacefilter token="@ws.package@" value="${ws.siges.package}"/>
</replace>
<wsimport
debug="${ws.debug}"
verbose="${ws.verbose}"
keep="${ws.keep}"
extension="${ws.extension}"
destdir="${gen.dir.java}"
wsdl="${ws.siges.wsdl}">
<binding dir="${build.dir.ws}" includes="${ws.client.binding.file}"/>
</wsimport>
<delete>
<fileset dir="${gen.dir.java}">
<include name="**/*.class"/>
</fileset>
</delete>
</target>
<replacefilter token="@wsdl.client@" value="${ws.siges.wsdl}"/>
<replacefilter token="@target.namespace@" value="${ws.siges.target.namespace}"/>
<replacefilter token="@ws.package@" value="${ws.siges.package}"/>
</replace>
<wsimport
debug="${ws.debug}"
verbose="${ws.verbose}"
keep="${ws.keep}"
extension="${ws.extension}"
destdir="${gen.dir.java}"
wsdl="${ws.siges.wsdl}">
<binding dir="${build.dir.ws}" includes="${ws.client.binding.file}"/>
</wsimport>
<delete>
<fileset dir="${gen.dir.java}">
<include name="**/*.class"/>
</fileset>
</delete>
</target>
 
<!-- <target name="ws.generate-google-client">
<property name="config_target" location="${ws.conf.dir}"/>
<copy file="${ws.conf.dir}/GoogleSearch-config.xml" tofile="${build.dir.ws}/GoogleSearch-config.xml" filtering="on" encoding="UTF-8" overwrite="true">
<filterset>
<filter token="CONFIG_ABSOLUTE_PATH" value="${config_target}"/>
<filter token="package" value="${ws.google.package}"/>
</filterset>
</copy>
<wscompile
verbose="true"
debug="true"
xPrintStackTrace="true"
xSerializable="true"
optimize="true"
fork="true"
keep="true"
client="true"
import="false"
base="${build.dir.classes}" sourceBase="${gen.dir.java}" mapping="${build.dir.ws}/GoogleSearch-mapping.xml" config="${build.dir.ws}/GoogleSearch-config.xml">
<classpath refid="pathToToolsLib"/>
</wscompile>
</target>-->
<property name="config_target" location="${ws.conf.dir}"/>
<copy file="${ws.conf.dir}/GoogleSearch-config.xml" tofile="${build.dir.ws}/GoogleSearch-config.xml" filtering="on" encoding="UTF-8" overwrite="true">
<filterset>
<filter token="CONFIG_ABSOLUTE_PATH" value="${config_target}"/>
<filter token="package" value="${ws.google.package}"/>
</filterset>
</copy>
<wscompile
verbose="true"
debug="true"
xPrintStackTrace="true"
xSerializable="true"
optimize="true"
fork="true"
keep="true"
client="true"
import="false"
base="${build.dir.classes}" sourceBase="${gen.dir.java}" mapping="${build.dir.ws}/GoogleSearch-mapping.xml" config="${build.dir.ws}/GoogleSearch-config.xml">
<classpath refid="pathToToolsLib"/>
</wscompile>
</target>-->
 
<target name="test">
<java classname="pt.ipp.siges.web.services.clients.Test" classpath="${build.dir.classes}" classpathref="pathToToolsLibRoutines"/>
/impl/build.properties
172,8 → 172,10
ws.client.features=explicitcontext,useonewayoperations
#Siges Service Specific Configuration
ws.siges.package=pt.ipp.siges.web.services.clients
#ws.siges.wsdl=http://172.20.100.5:8080/SigesWeb/SiGesWEB.asmx?wsdl
ws.siges.wsdl=http://localhost:8080/SigesWeb/SiGesWEB.asmx?wsdl
#DONT USE ANY MORE NOW IS IN CONFIGURATION DATABASE ONLY FOR BUILD WEB-SERVICES
ws.siges.wsdl=http://172.20.100.5:8080/SigesWeb/SiGesWEB.asmx?wsdl
#DONT USE ANY MORE NOW IS IN CONFIGURATION DATABASE
#ws.siges.wsdl=http://localhost:8080/SigesWeb/SiGesWEB.asmx?wsdl
ws.siges.target.namespace=http://www.ipportalegre.pt/siges/web/services
ws.siges.binding.file=siges-client.xml
 
/impl/build.xml
424,7 → 424,7
<replacefilter token="@email.templates.dir@" value="${email.templates.dir}"/>
<replacefilter token="@use.ldap@" value="${use.ldap}"/>
<replacefilter token="@site.url@" value="${site.url}"/>
<replacefilter token="@ws.siges.wsdl@" value="${ws.siges.wsdl}"/>
<!-- DONT USE ANY MORE NOW IS IN CONFIGURATION DAO <replacefilter token="@ws.siges.wsdl@" value="${ws.siges.wsdl}"/>-->
<replacefilter token="@ws.siges.target.namespace@" value="${ws.siges.target.namespace}"/>
<replacefilter token="@intranet.setup.folders.file@" value="${build.dir.relative.intranet.setup.folders.file}"/>
<replacefilter token="@intranet.setup.folders.filename@" value="${intranet.setup.folders.filename}"/>