Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 1017 → Rev 1020

/impl/src/java/pt/estgp/estgweb/Globals.java
1,11 → 1,9
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;
 
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
164,7 → 162,7
 
/*SIGES WEB SERVICES*/
//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());
//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");
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/ConfigurationDaoImpl.java
1,13 → 1,14
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;
 
 
//TODO PRECISA DE CHAMAR UM SERVICO EM VEZ DE SER ASSIM porque esta a abrir transacoes por todo lado
//PRECISA DE SE FAZER UM CHECK A TODO O CODIGO QUE ABRE TRANSACOES FORA DOS SERVICOS
/**
* @author Jorge Machado
* @date 28/Fev/2008
190,11 → 191,18
return load().getNationalInstitutionCode();
}
 
/**
* This method only creates transaction if not already active
* @return
*/
public int getNationalInstitutionCodeCreateTransaction()
{
getCurrentSession().beginTransaction();
//boolean alreadyActive = getCurrentSession().getTransaction().isActive();
//if(!alreadyActive)
getCurrentSession().beginTransaction();
int code = getNationalInstitutionCode();
getCurrentSession().getTransaction().commit();
//if(!alreadyActive)
getCurrentSession().getTransaction().commit();
return code;
}
 
208,7 → 216,7
{
Configuration config = load();
config.setNationalInstitutionCode(instCode);
Globals.NATIONAL_INSTITUTION_CODE = new BigDecimal(instCode);
//Globals.NATIONAL_INSTITUTION_CODE = new BigDecimal(instCode);
}
 
 
222,7 → 230,7
{
getCurrentSession().beginTransaction();
updateNationalInstitutionCode(instCode);
Globals.NATIONAL_INSTITUTION_CODE = new BigDecimal(instCode);
//Globals.NATIONAL_INSTITUTION_CODE = new BigDecimal(instCode);
getCurrentSession().getTransaction().commit();
}
 
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/CourseUnitDaoImpl.java
537,13 → 537,14
 
return createCriteria()
.createAlias("course", "c")
.createAlias("courseUnitEvaluation", "ce")
.add(eq("c.id", courseId))
.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))))
.add(or(isNull("courseUnitEvaluation"),(eq("ce.teacherComplete", false))))
.list();
}
 
/impl/src/web/public/courses/courseSeparators.jsp
1,5 → 1,7
<%@ page import="pt.estgp.estgweb.Globals" %>
<%@ page import="pt.estgp.estgweb.web.WebProxy" %>
<%@ page import="java.math.BigDecimal" %>
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
<%@ 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" %>
10,7 → 12,7
<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>
<h2>${CourseView.name} (<%=DaoFactory.getConfigurationDaoImpl().getNationalInstitutionCodeCreateTransaction()%> / ${CourseView.code})</h2>
 
 
<logic:notEmpty name="CourseView" property="formatedDescription"><p>${CourseView.formatedDescription}</p></logic:notEmpty>
/impl/src/web/public/courses/courseList.jsp
1,6 → 1,8
<%@ page import="pt.estgp.estgweb.domain.views.CourseView" %>
<%@ page import="pt.estgp.estgweb.web.WebProxy" %>
<%@ page import="pt.estgp.estgweb.Globals" %>
<%@ page import="java.math.BigDecimal" %>
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
<%@ 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" %>
15,7 → 17,7
<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>--%>
<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>
<p><a href="<%=request.getContextPath() + "/startLoadCourseSeparators.do?type=" + request.getAttribute("type") + "&courseView.id=" + courseView.getId()%>">${courseView.name}</a> - <%=DaoFactory.getConfigurationDaoImpl().getNationalInstitutionCodeCreateTransaction()%>/${courseView.code} </a></p>
<%--<div style="padding-left:20px;">--%>
<%--<div class="seccao borderLeft" style="display:none;" id="${courseView.id}">--%>
 
/impl/src/web/public/courses/course.jsp
1,5 → 1,7
<%@ page import="pt.estgp.estgweb.Globals" %>
<%@ page import="pt.estgp.estgweb.web.WebProxy" %>
<%@ page import="java.math.BigDecimal" %>
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
<%@ 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" %>
10,7 → 12,7
<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>
<h2>${CourseView.name} (<%=DaoFactory.getConfigurationDaoImpl().getNationalInstitutionCodeCreateTransaction()%> / ${CourseView.code})</h2>
 
<logic:empty name="CourseView" property="cacheWebDocument">
<div class="seccao">
/impl/src/web/public/courses/courseMenuList.jsp
1,4 → 1,6
<%@ page import="pt.estgp.estgweb.Globals" %>
<%@ page import="java.math.BigDecimal" %>
<%@ page import="pt.estgp.estgweb.domain.dao.DaoFactory" %>
<%@ 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" %>
17,7 → 19,7
<logic:iterate id="courseView" name="courses" type="pt.estgp.estgweb.domain.views.CourseView">
<logic:notEmpty name="courseView" property="studiesPlanStreamId">
<li>
<html:link action="/startLoadCourse?type=${type}&courseView.id=${courseView.id}">${courseView.name} (<%=Globals.NATIONAL_INSTITUTION_CODE%>/${courseView.code})</html:link>
<html:link action="/startLoadCourse?type=${type}&courseView.id=${courseView.id}">${courseView.name} (<%=DaoFactory.getConfigurationDaoImpl().getNationalInstitutionCodeCreateTransaction()%>/${courseView.code})</html:link>
</li>
</logic:notEmpty>
</logic:iterate>