/impl/importRoutines.xml |
---|
10,6 → 10,11 |
<arg value="201314"/> |
</java> |
</target> |
<target name="sincronizeunits"> |
<java classname="pt.estgp.estgweb.services.sigesimports.SincronizeLastYearCourseUnitProgramsService" classpath="${build.dir.classes}" classpathref="pathToToolsLib"> |
<arg value="201314"/> |
</java> |
</target> |
<target name="teachers"> |
<java classname="pt.estgp.estgweb.services.sigesimports.ImportTeachersService" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
</target> |
/impl/conf/language/MessageResourcesCourse.properties |
---|
88,3 → 88,5 |
course.menu.parceiros=Parceiros |
course.menu.faq=FAQ |
status=Curso Activo |
/impl/conf/log4j.properties |
---|
24,6 → 24,7 |
log4j.logger.org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog=FATAL |
log4j.additivity.org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog=false |
log4j.logger.org.apache.fop=ERROR |
#default category |
log4j.rootLogger = info, defaultLog, stdout |
/impl/conf/berserk/sd.xml |
---|
999,7 → 999,16 |
<filterChains> |
</filterChains> |
</service> |
<service> |
<name>LoadTeachedUnitsYear</name> |
<implementationClass>pt.estgp.estgweb.services.courseunits.LoadTeachedUnitsYearService</implementationClass> |
<description>Load teacher units in given Year</description> |
<isTransactional>true</isTransactional> |
<filterChains> |
</filterChains> |
</service> |
<service> |
<name>LoadSubscribedUnits</name> |
<implementationClass>pt.estgp.estgweb.services.courseunits.LoadSubscribedUnitsService</implementationClass> |
<description>Load student units</description> |
1242,6 → 1251,16 |
<chain name="Logger"/> |
</filterChains> |
</service> |
<service> |
<name>LoadActiveCoursesByType</name> |
<implementationClass>pt.estgp.estgweb.services.courses.CoursesService</implementationClass> |
<description>Load All Courses</description> |
<isTransactional>true</isTransactional> |
<defaultMethod>loadActiveCoursesByType</defaultMethod> |
<filterChains> |
<chain name="Logger"/> |
</filterChains> |
</service> |
/impl/src/java/jomm/utils/PdfUtils.java |
---|
74,13 → 74,16 |
} |
static FopFactory fopFactory = FopFactory.newInstance(); |
static FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); |
// configure foUserAgent as desired |
public static void createPdfFromXml(Source xmlFile, String xslFile, OutputStream pdfFile, Map<String, Object> params) throws IOException, FOPException, TransformerException { |
// configure fopFactory as desired |
FopFactory fopFactory = FopFactory.newInstance(); |
FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); |
// configure foUserAgent as desired |
// Setup output |
OutputStream out = new BufferedOutputStream(pdfFile); |
89,7 → 92,7 |
// Setup XSLT |
Transformer transformer = getTransformer(xslFile,false); |
Transformer transformer = getTransformer(xslFile,true); |
if (params != null) |
for (Map.Entry<String, Object> entry : params.entrySet()) { |
/impl/src/java/pt/estgp/estgweb/utils/DatesUtils.java |
---|
77,6 → 77,18 |
return yearTarget; |
} |
public static String getImportYearFormatted(String year) { |
String year1 = year.substring(0,4); |
int year1Int = Integer.parseInt(year1); |
int year2Int = year1Int + 1; |
String yearTarget = "" + year1Int + "/" + year2Int; |
return yearTarget; |
} |
public static enum SemestreModerate |
{ |
S1, |
196,5 → 208,18 |
{ |
System.out.println(getImportYearBefore("200001")); |
System.out.println(getImportYear()); |
System.out.println(getImportYearFormatted("201314")); |
java.util.List<String> years = new java.util.ArrayList<String>(); |
years.add("201314"); |
years.add("201213"); |
java.util.Collections.sort(years, new java.util.Comparator<String>() |
{ |
public int compare(String o1, String o2) { |
return o2.compareTo(o1); |
} |
}); |
for(String y: years) |
System.out.println(y); |
} |
} |
/impl/src/java/pt/estgp/estgweb/services/courses/CoursesService.java |
---|
214,6 → 214,19 |
return courseViews; |
} |
public List<CourseView> loadActiveCoursesByType(String type) throws ServiceException |
{ |
String importYearIntranet = DatesUtils.getImportYear(); |
List<Course> courses = DaoFactory.getCourseDaoImpl().findAllActiveOrderByNameEvenWithoutCourseUnit(importYearIntranet,null,type); |
List<CourseView> courseViews = new ArrayList<CourseView>(); |
for(Course c: courses) |
{ |
CourseView courseView = new CourseView(c); |
courseViews.add(courseView); |
} |
return courseViews; |
} |
} |
/impl/src/java/pt/estgp/estgweb/services/courseunits/SaveCourseUnitProgram.java |
---|
103,6 → 103,7 |
} |
public void createPdf(CourseUnit cu, List<String> errors,UserSession u) throws IOException, TransformerException, FOPException { |
((CourseUnitProgramImpl)cu.getCourseUnitProgram()).consistNullValues(); |
Document responseDoc = DocumentHelper.createDocument(); |
Namespace namespace = new Namespace("uc", "http://baco.estgp.pt/schemas/courseunits/program/"); |
287,11 → 288,9 |
// Dom4jUtil.writeSout(responseDoc); |
// Dom4jUtil.writeSout(responseDoc); |
System.out.println(""); |
String path = Globals.TMP_DIR + File.separator + cu.getCode() + "-" + cu.getName() + ".pdf"; |
FileOutputStream teste = new FileOutputStream(path); |
Map<String,Object> params = new HashMap<String,Object>(); |
304,7 → 303,9 |
params.put("revisor", u.getUser().getName()); |
PdfUtils.createPdfFromXml(new DOMSource(Dom4jUtil.toW3c(responseDoc)), "pt/estgp/estgweb/services/courseunits/courseunitprogram.fo.xsl", teste,params); |
org.w3c.dom.Document dd = Dom4jUtil.toW3c(responseDoc); |
PdfUtils.createPdfFromXml(new DOMSource(dd), "pt/estgp/estgweb/services/courseunits/courseunitprogram.fo.xsl", teste,params); |
teste.flush(); |
teste.close(); |
332,5 → 333,6 |
cu.setObjectives(cu.getCourseUnitProgram().getCourseUnitProgramPart2().getObjectivos()); |
//Obrigar a ser falso |
} |
} |
/impl/src/java/pt/estgp/estgweb/services/courseunits/LoadTeachedUnitsYearService.java |
---|
New file |
0,0 → 1,30 |
package pt.estgp.estgweb.services.courseunits; |
import pt.estgp.estgweb.domain.CourseUnit; |
import pt.estgp.estgweb.domain.CourseUnitImpl; |
import pt.estgp.estgweb.domain.Teacher; |
import pt.estgp.estgweb.domain.dao.DaoFactory; |
import pt.utl.ist.berserk.logic.serviceManager.IService; |
import java.util.List; |
/** |
* @author Jorge Machado |
* @date 2/Jun/2008 |
* @see pt.estgp.estgweb.services.courseunits |
*/ |
public class LoadTeachedUnitsYearService implements IService |
{ |
public List<CourseUnitImpl> run(long teacherId,String year) |
{ |
Teacher t = DaoFactory.getTeacherDaoImpl().load(teacherId); |
List<CourseUnitImpl> units = DaoFactory.getCourseUnitDaoImpl().loadTeachedImportYearUnits(teacherId,year); |
for(CourseUnit c: units) |
{ |
c.getName(); |
c.getCourse().getName(); |
} |
return units; |
} |
} |
/impl/src/java/pt/estgp/estgweb/services/sigesimports/SincronizeLastYearCourseUnitProgramsService.java |
---|
4,7 → 4,11 |
import org.apache.log4j.Logger; |
import pt.estgp.estgweb.Globals; |
import pt.estgp.estgweb.domain.CourseUnit; |
import pt.estgp.estgweb.domain.CourseUnitProgram; |
import pt.estgp.estgweb.domain.CourseUnitProgramImpl; |
import pt.estgp.estgweb.domain.CourseUnitProgramPart2Impl; |
import pt.estgp.estgweb.domain.dao.DaoFactory; |
import pt.estgp.estgweb.services.courseunits.SaveCourseUnitProgram; |
import pt.estgp.estgweb.services.expceptions.ServiceException; |
import pt.estgp.estgweb.services.logresults.ILogMessages; |
import pt.estgp.estgweb.services.logresults.LogMessageTypeEnum; |
13,6 → 17,7 |
import pt.estgp.estgweb.utils.DatesUtils; |
import pt.utl.ist.berserk.logic.serviceManager.IService; |
import java.util.ArrayList; |
import java.util.List; |
/** |
22,34 → 27,120 |
{ |
private static final Logger logger = Logger.getLogger(SincronizeLastYearCourseUnitProgramsService.class); |
private SincronizeLastYearCourseUnitProgramsService coursesService = new SincronizeLastYearCourseUnitProgramsService(); |
public ILogMessages run(String year) throws ServiceException |
/** |
* DESCRICAO DE SERVICO |
* |
* Unidades sem ficha é-lhes atribuida a ficha do ano anterior, |
* 1º é atribuido o mesmo professor como responsável |
* 2º a Ficha é clonada |
* 3º a Ficha fica com estado de não validada |
* |
* Restrições por ordem de prioridade |
* - Fichas com estado validadas não são clonadas |
* - Fichas invalidas poderão ser clonadas se: |
* - Não existir ficha |
* - ou para fichas já clonadas apenas são clonadas novamente se a condição |
* de entrada cloneOnlyNews for false |
* |
* @param year |
* @param cloneOnlyNews |
* @return |
* @throws ServiceException |
*/ |
public ILogMessages run(String year,boolean cloneOnlyNews) throws ServiceException |
{ |
System.out.println("Using year = " + year); |
System.out.println("Using only news = " + cloneOnlyNews); |
int foundTotal = 0; |
int found = 0; |
int updated=0; |
List<String> foundnprog = new ArrayList<String>(); |
List<String> nfound = new ArrayList<String>(); |
String importYearBefore = DatesUtils.getImportYearBefore(year); |
DefaultLogMessages logMessages = new DefaultLogMessages(); |
try |
{ |
logMessages.addMessage(new DefaultLogMessage("courseunitprograms.sincronization", LogMessageTypeEnum.INFO, "instituicao " + Globals.SIGES_INSTITUTION_CODE)); |
logger.info("S1"); |
List<CourseUnit> units = DaoFactory.getCourseUnitDaoImpl().load(year,"S1"); |
List<CourseUnit> units = DaoFactory.getCourseUnitDaoImpl().loadYear(year); |
for (CourseUnit cu: units) |
{ |
if(cu.getCourseUnitProgram() == null) |
foundTotal++; |
if(cu.getCourseUnitProgram() == null || !cloneOnlyNews) |
{ |
SaveCourseUnitProgram service = new SaveCourseUnitProgram(); |
List<CourseUnit> lista = DaoFactory.getCourseUnitDaoImpl().loadBySigesCodeUnique(cu.getCode(),cu.getCourseCode(),importYearBefore); |
if(lista != null && lista.size() > 0) |
{ |
logger.info("OK - Unit siges: " + cu.getCode() + " without program will try found old to clone"); |
CourseUnit cuOld = lista.get(0); |
if(cuOld.getCourseUnitProgram() != null) |
{ |
found++; |
if(cuOld.getResponsableTeacher() != null && cu.getResponsableTeacher() == null) |
cu.setResponsableTeacher(cuOld.getResponsableTeacher()); |
boolean novaFicha = false; |
if(cu.getCourseUnitProgram() == null) |
{ |
novaFicha = true; |
CourseUnitProgram program = new CourseUnitProgramImpl(); |
DaoFactory.getCourseUnitProgramDaoImpl().save(program); |
program.setCourseUnitProgramPart2(new CourseUnitProgramPart2Impl()); |
DaoFactory.getCourseUnitProgramPart2DaoImpl().save(program.getCourseUnitProgramPart2()); |
cu.setCourseUnitProgram(program); |
cu.setValidProgram(false); |
} |
//So clona a ficha no caso de não estar validada pelo CC |
if(novaFicha || (!cu.isValidProgram() && !cloneOnlyNews)) |
{ |
updated++; |
((CourseUnitProgramImpl)cu.getCourseUnitProgram()).cloneFrom(cuOld.getCourseUnitProgram()); |
List<String> errors = new ArrayList<String>(); |
service.createPdf(cu,errors); |
} |
} |
else |
{ |
foundnprog.add(cu.getCode()); |
} |
} |
else |
{ |
nfound.add(cu.getCode()); |
logger.info("NOT FOUND - Unit siges: " + cu.getCode() + " without program don't have old to clone"); |
} |
} |
cu.setValidProgram(true); |
} |
logger.info("STATS " + year); |
logger.info("Total: " + foundTotal); |
logger.info("Programas alterados: " + updated); |
logger.info("Previous Unit Found with program : " + found); |
logger.info("Previous Unit Found without program: " + foundnprog.size()); |
logger.info("Previous Unit Not Found: " + nfound.size()); |
logger.info("### Found No Prog:"); |
for(String c : foundnprog) |
{ |
logger.info(c); |
} |
logger.info("### Not Found:"); |
for(String c : nfound) |
{ |
logger.info(c); |
} |
} |
catch (Throwable e) |
{ |
67,8 → 158,11 |
String year = DatesUtils.getImportYear(); |
if(args != null && args.length > 0) |
year = args[0]; |
boolean cloneOnlyNews = true; |
if(args != null && args.length > 1) |
cloneOnlyNews = Boolean.parseBoolean(args[1]); |
AbstractDao.getCurrentSession().beginTransaction(); |
new SincronizeLastYearCourseUnitProgramsService().run(year); |
new SincronizeLastYearCourseUnitProgramsService().run(year,cloneOnlyNews); |
AbstractDao.getCurrentSession().getTransaction().commit(); |
} |
/impl/src/java/pt/estgp/estgweb/domain/CourseUnitProgramImpl.java |
---|
17,10 → 17,7 |
import java.io.Serializable; |
import java.net.MalformedURLException; |
import java.sql.SQLException; |
import java.util.ArrayList; |
import java.util.HashMap; |
import java.util.List; |
import java.util.Map; |
import java.util.*; |
import static pt.estgp.estgweb.utils.Dom4jUtil.parse; |
900,4 → 897,53 |
// cu.setValidProgram(valiPrograms); |
// } |
/** |
* |
* Este metodo de clonagem apenas copia valores ddo proprio programa para o programa a clonar |
* |
* @param toClone |
*/ |
public void cloneFrom(CourseUnitProgram toClone) |
{ |
setAdaptacaoObjectivosMetodologia(toClone.getAdaptacaoObjectivosMetodologia()); |
setBibliografia(toClone.getBibliografia()); |
setBibliografiaComplementar(toClone.getBibliografiaComplementar()); |
setCargaHorariaO(toClone.getCargaHorariaO()); |
setCargaHorariaOT(toClone.getCargaHorariaOT()); |
setCargaHorariaPL(toClone.getCargaHorariaPL()); |
setCargaHorariaS(toClone.getCargaHorariaS()); |
setCargaHorariaT(toClone.getCargaHorariaT()); |
setCargaHorariaTC(toClone.getCargaHorariaTC()); |
setCargaHorariaTotal(toClone.getCargaHorariaTotal()); |
setCargaHorariaTP(toClone.getCargaHorariaTP()); |
setDemonstracaoCargaEcts(toClone.getDemonstracaoCargaEcts()); |
setEcts(toClone.getEcts()); |
setGarantiaAvaliacaoFuncaObjectivos(toClone.getGarantiaAvaliacaoFuncaObjectivos()); |
setLingua1(toClone.getLingua1()); |
setLingua2(toClone.getLingua2()); |
setMetodologiasActividadeCientifica(toClone.getMetodologiasActividadeCientifica()); |
setObrigatoria(toClone.getObrigatoria()); |
setPrerequisitos(toClone.getPrerequisitos()); |
if(getSaveDate() == null) |
setSaveDate(new Date()); |
setUpdateDate(new Date()); |
getCourseUnitProgramPart2().setAvaliacaoEspeciaisFrequencia(toClone.getCourseUnitProgramPart2().getAvaliacaoEspeciaisFrequencia()); |
getCourseUnitProgramPart2().setAvaliacaoEspeciaissExame(toClone.getCourseUnitProgramPart2().getAvaliacaoEspeciaissExame()); |
getCourseUnitProgramPart2().setAvaliacaoOrdinariosExame(toClone.getCourseUnitProgramPart2().getAvaliacaoOrdinariosExame()); |
getCourseUnitProgramPart2().setAvaliacaoOrdinariosFrequencia(toClone.getCourseUnitProgramPart2().getAvaliacaoOrdinariosFrequencia()); |
getCourseUnitProgramPart2().setConteudos(toClone.getCourseUnitProgramPart2().getConteudos()); |
getCourseUnitProgramPart2().setDemonstracaoCoerenciaConteudos(toClone.getCourseUnitProgramPart2().getDemonstracaoCoerenciaConteudos()); |
getCourseUnitProgramPart2().setDemonstracaoObjectivosMetodologia(toClone.getCourseUnitProgramPart2().getDemonstracaoObjectivosMetodologia()); |
getCourseUnitProgramPart2().setMetodologiasEnsino(toClone.getCourseUnitProgramPart2().getMetodologiasEnsino()); |
getCourseUnitProgramPart2().setObjectivos(toClone.getCourseUnitProgramPart2().getObjectivos()); |
if(getCourseUnitProgramPart2().getSaveDate() == null) |
getCourseUnitProgramPart2().setSaveDate(new Date()); |
getCourseUnitProgramPart2().setUpdateDate(new Date()); |
} |
} |
/impl/src/java/pt/estgp/estgweb/domain/TeacherImpl.java |
---|
9,6 → 9,8 |
import java.util.ArrayList; |
import java.util.List; |
import java.util.Map; |
import java.util.HashMap; |
/** |
* @author Jorge Machado |
109,6 → 111,59 |
{ |
return getUnitsSemestre("A",getTeachedUnitsCurrentYearView()); |
} |
public List<CourseUnit> getTeachedUnitsViewS1(String year) |
{ |
return getUnitsSemestre("S1",getTeachedUnitsView(year)); |
} |
public List<CourseUnit> getTeachedUnitsViewS2(String year) |
{ |
return getUnitsSemestre("S2",getTeachedUnitsView(year)); |
} |
public List<CourseUnit> getTeachedUnitsViewA(String year) |
{ |
return getUnitsSemestre("A",getTeachedUnitsView(year)); |
} |
Map<String,List<CourseUnit>> teachedUnitsYear = new HashMap<String,List<CourseUnit>>(); |
Map<String,List<Course>> teachedCourseYear = new HashMap<String,List<Course>>(); |
public List<CourseUnit> getTeachedUnitsView(String year) |
{ |
List<CourseUnit> cuYear = teachedUnitsYear.get(year); |
if(cuYear == null) |
{ |
List<Course> lc = new ArrayList<Course>(); |
teachedCourseYear.put(year,lc); |
try |
{ |
IServiceManager sm = ServiceManager.getInstance(); |
String[] names = new String[]{"serializable","year"}; |
Object[] args = new Object[]{getId(),year}; |
cuYear = (List<CourseUnit>) sm.execute(null, "LoadTeachedUnitsYear", args, names); |
if(cuYear == null) |
cuYear = new ArrayList<CourseUnit>(); |
for(CourseUnit c: cuYear) |
{ |
if(!lc.contains(c.getCourse())) |
{ |
lc.add(c.getCourse()); |
} |
} |
teachedUnitsYear.put(year,cuYear); |
} |
catch (Throwable e) |
{ |
logger.error(e,e); |
} |
} |
return cuYear; |
} |
public List<CourseUnit> getTeachedUnitsCurrentYearView() |
{ |
if(teachedUnitsCurrentYearView == null) |
/impl/src/java/pt/estgp/estgweb/domain/views/CourseView.java |
---|
1,18 → 1,17 |
package pt.estgp.estgweb.domain.views; |
import jomm.utils.AutoFillArrayList; |
import jomm.utils.StringsUtils; |
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.web.utils.DatesUtils; |
import pt.estgp.estgweb.Globals; |
import org.apache.log4j.Logger; |
import java.io.Serializable; |
import java.util.ArrayList; |
import java.util.List; |
import java.util.ArrayList; |
import java.io.Serializable; |
import jomm.utils.AutoFillArrayList; |
import jomm.utils.StringsUtils; |
/** |
* @author Jorge Machado |
* @date 2/Mar/2008 |
49,12 → 48,20 |
private String externalSiteServer; |
private String externalSitePath; |
private String validationRole; |
private boolean status; |
private Course course; |
public boolean isStatus() { |
return status; |
} |
public void setStatus(boolean status) { |
this.status = status; |
} |
public Class getReferenceClass() |
{ |
return CourseImpl.class; |
98,7 → 105,7 |
this.cacheWebDocument = course.getCacheWebDocument(); |
this.externalSitePath = course.getExternalSitePath(); |
this.externalSiteServer = course.getExternalSiteServer(); |
this.status = course.isStatus(); |
if(course.getStudiesPlan() != null) |
this.studiesPlanStreamId = course.getStudiesPlan(); |
if(course.getCoordinator() != null) |
132,6 → 139,7 |
c.setExternalSitePath(externalSitePath); |
c.setExternalSiteServer(externalSiteServer); |
c.setValidationRole(validationRole); |
c.setStatus(status); |
if(coordinator != null && coordinator.getId() > 0) |
{ |
Teacher u = DaoFactory.getTeacherDaoImpl().load(coordinator.getId()); |
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/CourseDaoImpl.java |
---|
111,6 → 111,23 |
.list(); |
} |
public List<Course> findAllActiveOrderByNameEvenWithoutCourseUnit(String importYear, String area, String type) |
{ |
Criteria c = createCriteria(); |
/* c.setProjection(Projections.projectionList() |
.add(Projections.distinct(Projections.id())));*/ |
if (importYear != null && importYear.length() > 0) |
c.add(eq("status", true)); |
if (area != null && area.length() > 0) |
c.add(eq("area", area)); |
if (type != null && type.length() > 0) |
c.add(eq("degree", type)); |
return c.addOrder(Order.asc("name")) |
.list(); |
} |
public List<Course> findAllOrderByName(String importYear, String area, String type) |
{ |
Criteria c = createCriteria(); |
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/CourseUnitDaoImpl.java |
---|
55,6 → 55,11 |
return createCriteria().add(eq("importYear", importYear)).add(eq("semestre", semestre)).list(); |
} |
public List<CourseUnit> loadYear(String importYear) |
{ |
return createCriteria().add(eq("importYear", importYear)).list(); |
} |
public List<Long> loadIds(String importYear, String semestre) |
/impl/src/updates/db/update14.sql |
---|
New file |
0,0 → 1,0 |
ALTER TABLE `baco3`.`course` ADD COLUMN `status` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0 AFTER `degree`; |
/impl/src/hbm/pt/estgp/estgweb/domain/Course.hbm.xml |
---|
21,6 → 21,7 |
<property name="externalSiteServer" type="string"/> |
<property name="externalSitePath" type="string"/> |
<property name="degree" type="string"/> |
<property name="status" type="boolean"/> |
<property name="cacheWebDocument" type="text"> |
<column name="cacheWebDocument" sql-type="TEXT"/> |
</property> |
/impl/src/web/admin/courses/course.jsp |
---|
54,6 → 54,17 |
</tr> |
<tr> |
<th> |
<bean:message key="status"/> |
</th> |
<td> |
<html:select property="courseView.degree"> |
<html:option value="false"><bean:message key="yes"/></html:option> |
<html:option value="true"><bean:message key="no"/></html:option> |
</html:select> |
</td> |
</tr> |
<tr> |
<th> |
<bean:message key="course.degree"/> |
</th> |
<td> |
/impl/src/web/public/courses/index.jsp |
---|
21,7 → 21,7 |
String[] names = new String[]{}; |
Object[] args = new Object[]{type}; |
List<CourseView> courses = (List<CourseView>) sm.execute(RequestUtils.getRequester(request, response), "LoadCoursesImportYearByType", args, names); |
List<CourseView> courses = (List<CourseView>) sm.execute(RequestUtils.getRequester(request, response), "LoadActiveCoursesByType", args, names); |
request.setAttribute("courses", courses); |
%> |
/impl/src/web/user/home/teacherUnits.jsp | |
---|---|
--- impl/src/web/user/home/teacher.jsp (revision 767) | |
+++ impl/src/web/user/home/teacher.jsp (revision 790) | |
@@ -6,6 +6,8 @@ | |
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> | |
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %> | |
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> | |
+<%@ page import="java.util.List" %> | |
+<%@ page import="pt.estgp.estgweb.utils.DatesUtils" %> | |
| |
| |
@@ -21,117 +23,171 @@ | |
| |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
+ <% | |
+ java.util.List | |
+ years.add("201314"); | |
+ years.add("201213"); | |
+ | |
+ java.util.Collections.sort(years, new java.util.Comparator | |
+ { | |
+ public int compare(String o1, String o2) { | |
+ return o2.compareTo(o1); | |
+ } | |
+ }); | |
+ | |
+ for(String year: years) | |
+ { | |
+ | |
+ String yearFormatted = pt.estgp.estgweb.utils.DatesUtils.getImportYearFormatted(year); | |
+ | |
+ %> | |
+ | |
+
| |
+ | |
+ | |
+ | |
+ <% | |
+ List | |
+ if(cus == null || cus.size() == 0) | |
+ { | |
+ %> | |
+ } | |
+ else if(cus.size() > 0) | |
+ { | |
+ %> | |
+ | |
<% | |
- String courseCode = ""; | |
- if(unit.getCourse() != null) | |
+ for(pt.estgp.estgweb.domain.CourseUnit unit:cus) | |
{ | |
- 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); | |
- } | |
- } | |
+ request.setAttribute("unit",unit); | |
+ %> | |
+ | |
+ <% | |
+ 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); | |
+ } | |
+ } | |
+ } | |
+ | |
+ %> | |
+ | |
+ | |
+ | |
+ <% | |
} | |
+ %> | |
+ | |
+ <% | |
+ } | |
+ %> | |
- %> | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- <% | |
- String courseCode = ""; | |
- if(unit.getCourse() != null) | |
+ | |
+ | |
+ | |
+ | |
+ <% | |
+ cus = ((pt.estgp.estgweb.domain.TeacherImpl)UserSession.getUser()).getTeachedUnitsViewS2(year); | |
+ if(cus == null || cus.size() == 0) | |
+ { | |
+ %> | |
+ } | |
+ else if(cus.size() > 0) | |
+ { | |
+ %> | |
+ | |
+ <% | |
+ for(pt.estgp.estgweb.domain.CourseUnit unit:cus) | |
{ | |
- 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); | |
- } | |
- } | |
+ request.setAttribute("unit",unit); | |
+ %> | |
+ | |
+ <% | |
+ 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); | |
+ } | |
+ } | |
+ } | |
+ | |
+ %> | |
+ | |
+ | |
+ | |
+ <% | |
} | |
+ %> | |
+ | |
+ <% | |
+ } | |
+ %> | |
- %> | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
+ | |
+ | |
+ | |
+ | |
+ <% | |
+ cus = ((pt.estgp.estgweb.domain.TeacherImpl)UserSession.getUser()).getTeachedUnitsViewA(year); | |
+ if(cus == null || cus.size() == 0) | |
+ { | |
+ %> | |
+ } | |
+ else if(cus.size() > 0) | |
+ { | |
+ %> | |
+ | |
<% | |
- String courseCode = ""; | |
- if(unit.getCourse() != null) | |
+ for(pt.estgp.estgweb.domain.CourseUnit unit:cus) | |
{ | |
- 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); | |
- } | |
- } | |
+ request.setAttribute("unit",unit); | |
+ %> | |
+ | |
+ <% | |
+ 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); | |
+ } | |
+ } | |
+ } | |
+ | |
+ %> | |
+ | |
+ | |
+ | |
+ <% | |
} | |
+ %> | |
+ | |
+ <% | |
+ } | |
+ %> | |
+ | |
+ | |
+ <% | |
+ } | |
+ %> | |
- %> | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
|