Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 726 → Rev 728

/impl/conf/language/MessageResourcesImportSiges.properties
6,10 → 6,13
import.semestre.separated=Importando as disciplinas por Semestre
import.semestre.repeated.S1=Unidade Repetida no 1º semestre
import.semestre.repeated.S2=Unidade Repetida no 2º Semestre
import.semestre.repeated.A=Unidade Repetida Anual
import.semestre.course.units.S1=Importando Unidades Curriculares do 1º Semestre
import.semestre.course.units.S2=Importando Unidades Curriculares do 2º Semestre
import.semestre.course.units.A=Importando Unidades Curriculares Anuais
import.semestre.updating.course.units.S1=Actualizando Unidades Curriculares do 1º Semestre
import.semestre.updating.course.units.S2=Actualizando Unidades Curriculares do 2º Semestre
import.semestre.updating.course.units.A=Actualizando Unidades Curriculares Anuais
import.semestre.updating.courses=Actualizando os Cursos
import.error=Erro na importação
import.students=Importando Estudantes do SiGes
/impl/conf/app.properties
1,6 → 1,7
 
#FICHEIRO DE CONFIGURACOES
 
import.year=201213
tmp.dir=@tmp.dir@
data.dir=@data.dir@
use.ldap=@use.ldap@
9,10 → 10,9
user.session.timeout.minutes=60
site.url=@site.url@
 
import.year=201213
 
email.local.suffix=estgp.pt
email.server=localhost
email.server=127.0.0.1
email.user=
email.password=
email.from=bacodev@estgp.pt
407,6 → 407,7
 
intranet.semestre.S1=Semestre1
intranet.semestre.S2=Semestre2
intranet.semestre.A=Anual
 
intranet.setup.file=@intranet.setup.folders.file@
intranet.setup.users.filename=cursos.txt
/impl/src/java/pt/estgp/estgweb/Globals.java
194,6 → 194,7
 
public static final String INTRANET_SEMESTRE_S1 = ConfigProperties.getProperty("intranet.semestre.S1");
public static final String INTRANET_SEMESTRE_S2 = ConfigProperties.getProperty("intranet.semestre.S2");
public static final String INTRANET_SEMESTRE_A = ConfigProperties.getProperty("intranet.semestre.A");
 
 
public static final String INTRANET_SETUP_FILE = ConfigProperties.getProperty("intranet.setup.file");
/impl/src/java/pt/estgp/estgweb/services/courseunits/CreateCourseUnitDirPackageService.java
1,24 → 1,24
package pt.estgp.estgweb.services.courseunits;
 
import pt.utl.ist.berserk.logic.serviceManager.IService;
import jomm.utils.BytesUtils;
import jomm.utils.FilesUtils;
import jomm.utils.StringsUtils;
import org.apache.log4j.Logger;
import pt.estgp.estgweb.Globals;
import pt.estgp.estgweb.domain.Course;
import pt.estgp.estgweb.domain.CourseUnit;
import pt.estgp.estgweb.domain.Teacher;
import pt.estgp.estgweb.domain.UserSession;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.services.expceptions.ServiceException;
import pt.estgp.estgweb.domain.*;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.utils.DatesUtils;
import pt.estgp.estgweb.Globals;
import org.apache.log4j.Logger;
import pt.utl.ist.berserk.logic.serviceManager.IService;
 
import java.util.List;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
 
import jomm.utils.BytesUtils;
import jomm.utils.StringsUtils;
import jomm.utils.FilesUtils;
import jomm.dao.impl.AbstractDao;
 
/*
* @author Goncalo Luiz gedl [AT] rnl [DOT] ist [DOT] utl [DOT] pt
*
64,11 → 64,14
courseImportYearDir.mkdirs();
new File(courseImportYearPath + "/" + Globals.INTRANET_SEMESTRE_S1).mkdirs();
new File(courseImportYearPath + "/" + Globals.INTRANET_SEMESTRE_S2).mkdirs();
new File(courseImportYearPath + "/" + Globals.INTRANET_SEMESTRE_A).mkdirs();
FilesUtils.copy(CreateCourseUnitDirPackageService.class.getResourceAsStream(Globals.INTRANET_SETUP_FILE),courseImportYearPath + "/" + Globals.INTRANET_SEMESTRE_S1 + "/" + Globals.INTRANET_SETUP_FILE_NAME);
FilesUtils.copy(CreateCourseUnitDirPackageService.class.getResourceAsStream(Globals.INTRANET_SETUP_FILE),courseImportYearPath + "/" + Globals.INTRANET_SEMESTRE_S2 + "/" + Globals.INTRANET_SETUP_FILE_NAME);
FilesUtils.copy(CreateCourseUnitDirPackageService.class.getResourceAsStream(Globals.INTRANET_SETUP_FILE),courseImportYearPath + "/" + Globals.INTRANET_SEMESTRE_A + "/" + Globals.INTRANET_SETUP_FILE_NAME);
 
String callPathS1 = (courseImportYearPathDos + "\\" + Globals.INTRANET_SEMESTRE_S1 + "\\").substring(tmpDir.length() + 1);
String callPathS2 = (courseImportYearPathDos + "\\" + Globals.INTRANET_SEMESTRE_S2 + "\\").substring(tmpDir.length() + 1);
String callPathA = (courseImportYearPathDos + "\\" + Globals.INTRANET_SEMESTRE_A + "\\").substring(tmpDir.length() + 1);
batRunner.write("cd " + back + callPathS1);
back = "..\\..\\..\\";
batRunner.write("\n");
78,8 → 81,13
batRunner.write("\n");
batRunner.write(Globals.INTRANET_SETUP_FILE_NAME + " " + Globals.INTRANET_USERS_SETUP_FILE_NAME);
batRunner.write("\n");
batRunner.write("cd " + back + callPathA);
batRunner.write("\n");
batRunner.write(Globals.INTRANET_SETUP_FILE_NAME + " " + Globals.INTRANET_USERS_SETUP_FILE_NAME);
batRunner.write("\n");
FileWriter confWriterSemestre1 = new FileWriter(courseImportYearPath + "/" + Globals.INTRANET_SEMESTRE_S1 + "/" + Globals.INTRANET_USERS_SETUP_FILE_NAME);
FileWriter confWriterSemestre2 = new FileWriter(courseImportYearPath + "/" + Globals.INTRANET_SEMESTRE_S2 + "/" + Globals.INTRANET_USERS_SETUP_FILE_NAME);
FileWriter confWriterA = new FileWriter(courseImportYearPath + "/" + Globals.INTRANET_SEMESTRE_A + "/" + Globals.INTRANET_USERS_SETUP_FILE_NAME);
 
 
List<CourseUnit> courseUnits = DaoFactory.getCourseUnitDaoImpl().loadByCourse(c.getId(),importYear);
92,11 → 100,16
nowWriter = confWriterSemestre1;
semestre = Globals.INTRANET_SEMESTRE_S1;
}
else
else if(courseUnit.getSemestre().equals("S2"))
{
nowWriter = confWriterSemestre2;
semestre = Globals.INTRANET_SEMESTRE_S2;
}
else
{
nowWriter = confWriterA;
semestre = Globals.INTRANET_SEMESTRE_A;
}
 
String normalizedName = StringsUtils.normalizeResourceName(courseUnit.getName());
String unitPath = courseImportYearPath + "/" + semestre + "/" + normalizedName;
/impl/src/java/pt/estgp/estgweb/services/courseunits/CreateCourseUnitWorksBackupService.java
112,10 → 112,14
{
semestre = Globals.INTRANET_SEMESTRE_S1;
}
else
else if(courseUnit.getSemestre().equals("S2"))
{
semestre = Globals.INTRANET_SEMESTRE_S2;
}
else
{
semestre = Globals.INTRANET_SEMESTRE_A;
}
 
String normalizedName = StringsUtils.normalizeResourceName(courseUnit.getName());
String unitPath = courseImportYearPath + "/" + semestre + "/" + normalizedName;
297,10 → 301,14
{
semestre = Globals.INTRANET_SEMESTRE_S1;
}
else
else if(courseUnit.getSemestre().equals("S2"))
{
semestre = Globals.INTRANET_SEMESTRE_S2;
}
else
{
semestre = Globals.INTRANET_SEMESTRE_A;
}
String normalizedName = StringsUtils.normalizeResourceName(courseUnit.getName());
String unitPath = courseImportYearPath + "/" + semestre + "/" + normalizedName;
copyProgram(courseUnit,unitPath,userSession);
352,10 → 360,14
{
semestre = Globals.INTRANET_SEMESTRE_S1;
}
else
else if (courseUnit.getSemestre().equals("S2"))
{
semestre = Globals.INTRANET_SEMESTRE_S2;
}
else
{
semestre = Globals.INTRANET_SEMESTRE_A;
}
String normalizedName = StringsUtils.normalizeResourceName(courseUnit.getName());
String unitPath = courseImportYearPath + "/" + semestre + "/" + normalizedName;
copyProgram(courseUnit,unitPath,userSession);
/impl/src/java/pt/estgp/estgweb/services/courseunits/ScheduleCourseUnitAnnouncementSmsService.java
65,11 → 65,14
courseImportYearDir.mkdirs();
new File(courseImportYearPath + "/" + Globals.INTRANET_SEMESTRE_S1).mkdirs();
new File(courseImportYearPath + "/" + Globals.INTRANET_SEMESTRE_S2).mkdirs();
new File(courseImportYearPath + "/" + Globals.INTRANET_SEMESTRE_A).mkdirs();
FilesUtils.copy(ScheduleCourseUnitAnnouncementSmsService.class.getResourceAsStream(Globals.INTRANET_SETUP_FILE),courseImportYearPath + "/" + Globals.INTRANET_SEMESTRE_S1 + "/" + Globals.INTRANET_SETUP_FILE_NAME);
FilesUtils.copy(ScheduleCourseUnitAnnouncementSmsService.class.getResourceAsStream(Globals.INTRANET_SETUP_FILE),courseImportYearPath + "/" + Globals.INTRANET_SEMESTRE_S2 + "/" + Globals.INTRANET_SETUP_FILE_NAME);
FilesUtils.copy(ScheduleCourseUnitAnnouncementSmsService.class.getResourceAsStream(Globals.INTRANET_SETUP_FILE),courseImportYearPath + "/" + Globals.INTRANET_SEMESTRE_A + "/" + Globals.INTRANET_SETUP_FILE_NAME);
 
String callPathS1 = (courseImportYearPathDos + "\\" + Globals.INTRANET_SEMESTRE_S1 + "\\").substring(tmpDir.length() + 1);
String callPathS2 = (courseImportYearPathDos + "\\" + Globals.INTRANET_SEMESTRE_S2 + "\\").substring(tmpDir.length() + 1);
String callPathA = (courseImportYearPathDos + "\\" + Globals.INTRANET_SEMESTRE_A + "\\").substring(tmpDir.length() + 1);
batRunner.write("cd " + back + callPathS1);
back = "..\\..\\..\\";
batRunner.write("\n");
79,8 → 82,13
batRunner.write("\n");
batRunner.write(Globals.INTRANET_SETUP_FILE_NAME + " " + Globals.INTRANET_USERS_SETUP_FILE_NAME);
batRunner.write("\n");
batRunner.write("cd " + back + callPathA);
batRunner.write("\n");
batRunner.write(Globals.INTRANET_SETUP_FILE_NAME + " " + Globals.INTRANET_USERS_SETUP_FILE_NAME);
batRunner.write("\n");
FileWriter confWriterSemestre1 = new FileWriter(courseImportYearPath + "/" + Globals.INTRANET_SEMESTRE_S1 + "/" + Globals.INTRANET_USERS_SETUP_FILE_NAME);
FileWriter confWriterSemestre2 = new FileWriter(courseImportYearPath + "/" + Globals.INTRANET_SEMESTRE_S2 + "/" + Globals.INTRANET_USERS_SETUP_FILE_NAME);
FileWriter confWriterA = new FileWriter(courseImportYearPath + "/" + Globals.INTRANET_SEMESTRE_A + "/" + Globals.INTRANET_USERS_SETUP_FILE_NAME);
 
 
List<CourseUnit> courseUnits = DaoFactory.getCourseUnitDaoImpl().loadByCourse(c.getId(),importYear);
93,11 → 101,16
nowWriter = confWriterSemestre1;
semestre = Globals.INTRANET_SEMESTRE_S1;
}
else
else if(courseUnit.getSemestre().equals("S2"))
{
nowWriter = confWriterSemestre2;
semestre = Globals.INTRANET_SEMESTRE_S2;
}
else
{
nowWriter = confWriterA;
semestre = Globals.INTRANET_SEMESTRE_A;
}
 
String normalizedName = StringsUtils.normalizeResourceName(courseUnit.getName());
String unitPath = courseImportYearPath + "/" + semestre + "/" + normalizedName;
/impl/src/java/pt/estgp/estgweb/services/sigesimports/ImportStudentsService.java
261,6 → 261,7
public static void main(String[] args) throws ServiceException
{
String year = DatesUtils.getImportYear();
System.out.println("YEAR:" + year);
if(args != null && args.length > 0)
year = args[0];
new ImportStudentsService().run(year);
/impl/src/java/pt/estgp/estgweb/services/sigesimports/ImportCourseService.java
49,6 → 49,7
HashMap<String, Disciplina> disciplinasMap = new HashMap<String, Disciplina>();
HashMap<String, Disciplina> disciplinasMapS1 = new HashMap<String, Disciplina>();
HashMap<String, Disciplina> disciplinasMapS2 = new HashMap<String, Disciplina>();
HashMap<String, Disciplina> disciplinasMapA = new HashMap<String, Disciplina>();
HashMap<String, Disciplina> cursosMap = new HashMap<String, Disciplina>();
 
/**
68,6 → 69,7
 
importUnitsSemestre(service, "S1", year, disciplinasMap, disciplinasMapS1, cursosMap, logMessages);
importUnitsSemestre(service, "S2", year, disciplinasMap, disciplinasMapS2, cursosMap, logMessages);
importUnitsSemestre(service, "A", year, disciplinasMap, disciplinasMapA, cursosMap, logMessages);
 
/**
* Import Courses
101,6 → 103,7
*/
updateCourseUnits(disciplinasMapS1, "S1",logMessages,year);
updateCourseUnits(disciplinasMapS2, "S2",logMessages,year);
updateCourseUnits(disciplinasMapA, "A",logMessages,year);
}
catch (Throwable e)
{
/impl/src/java/pt/estgp/estgweb/domain/StudentImpl.java
60,6 → 60,12
{
return getUnitsSemestre("S2",getSubscribedUnitsView());
}
 
public List<CourseUnit> getSubscribedUnitsViewA()
{
return getUnitsSemestre("A",getSubscribedUnitsView());
}
 
public List<CourseUnit> getSubscribedUnitsView()
{
if(subscribedUnitsView == null)
97,6 → 103,11
{
return getUnitsSemestre("S2",getSubscribedUnitsCurrentYearView());
}
public List<CourseUnit> getSubscribedUnitsCurrentYearViewA()
{
return getUnitsSemestre("A",getSubscribedUnitsCurrentYearView());
}
 
public List<CourseUnit> getSubscribedUnitsCurrentYearView()
{
if(subscribedUnitsCurrentYearView == null)
/impl/src/java/pt/estgp/estgweb/domain/TeacherImpl.java
1,16 → 1,15
package pt.estgp.estgweb.domain;
 
import jomm.utils.StringsUtils;
import org.apache.log4j.Logger;
import pt.estgp.estgweb.Globals;
import pt.estgp.estgweb.utils.RoleManager;
import pt.utl.ist.berserk.logic.serviceManager.IServiceManager;
import pt.utl.ist.berserk.logic.serviceManager.ServiceManager;
 
import java.util.ArrayList;
import java.util.List;
import java.util.ArrayList;
 
import org.apache.log4j.Logger;
import jomm.utils.StringsUtils;
 
/**
* @author Jorge Machado
* @date 28/Fev/2008
65,6 → 64,10
{
return getUnitsSemestre("S2",getTeachedUnitsView());
}
public List<CourseUnit> getTeachedUnitsViewA()
{
return getUnitsSemestre("A",getTeachedUnitsView());
}
public List<CourseUnit> getTeachedUnitsView()
{
if(teachedUnitsView == null)
102,6 → 105,10
{
return getUnitsSemestre("S2",getTeachedUnitsCurrentYearView());
}
public List<CourseUnit> getTeachedUnitsCurrentYearViewA()
{
return getUnitsSemestre("A",getTeachedUnitsCurrentYearView());
}
public List<CourseUnit> getTeachedUnitsCurrentYearView()
{
if(teachedUnitsCurrentYearView == null)
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/AnnouncementDaoImpl.java
217,7 → 217,7
.add(eq("status", true))
.add(coSubTargets)
.setMaxResults(maxAnnouncements)
.addOrder(Order.desc("saveDate"));
.addOrder(Order.asc("expireDate"));
return criteria.list();
}
 
308,7 → 308,7
.add(or(or(gt("expireDate", now), eq("expireDate", now)), isNull("expireDate")))
.add(eq("status", true))
.add(coSubTargets)
.addOrder(Order.desc("saveDate"));
.addOrder(Order.asc("expireDate"));
return criteria;
}
 
/impl/src/web/admin/courseunits/courseunit.jsp
64,6 → 64,7
<html:select property="courseUnitView.semestre">
<html:option value="S1">S1</html:option>
<html:option value="S2">S2</html:option>
<html:option value="A">A</html:option>
</html:select>
</td>
</tr>
/impl/src/web/user/home/student.jsp
236,6 → 236,44
</logic:notEmpty>
</logic:present>
</li>
 
 
<li>
<p><bean:message key="courseunit.semestre"/> (Anuais)</p>
<logic:present name="UserSession" property="user.subscribedUnitsCurrentYearViewA">
<logic:empty name="UserSession" property="user.subscribedUnitsCurrentYearViewA">
<bean:message key="courseunit.zero.units"/>
</logic:empty>
</logic:present>
<logic:present name="UserSession" property="user.subscribedUnitsCurrentYearViewA">
<logic:notEmpty name="UserSession" property="user.subscribedUnitsCurrentYearViewA">
<ul>
<logic:iterate id="unit" name="UserSession" property="user.subscribedUnitsCurrentYearViewA" type="pt.estgp.estgweb.domain.CourseUnit">
<li>
<%
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);
}
}
}
 
%>
<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>
</logic:notEmpty>
</logic:present>
</li>
</ul>
<!--Can put year all other units in the future calling service user.subscribedUnitsOldYearsView-->
</div>
/impl/src/web/user/home/teacher.jsp
95,6 → 95,42
</logic:notEmpty>
</logic:present>
</li>
<li>
<p><bean:message key="courseunit.semestre"/> (Anual)</p>
<logic:present name="UserSession" property="user.teachedUnitsCurrentYearViewA">
<logic:empty name="UserSession" property="user.teachedUnitsCurrentYearViewA">
<bean:message key="courseunit.zero.units"/>
</logic:empty>
</logic:present>
<logic:present name="UserSession" property="user.teachedUnitsCurrentYearViewA">
<logic:notEmpty name="UserSession" property="user.teachedUnitsCurrentYearViewA">
<ul>
<logic:iterate id="unit" name="UserSession" property="user.teachedUnitsCurrentYearViewA" type="pt.estgp.estgweb.domain.CourseUnit">
<li>
<%
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);
}
}
}
 
%>
<html:link action="/user/startLoadCourseUnitFromHome?id=${unit.id}">${unit.name} (${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>
</logic:notEmpty>
</logic:present>
</li>
</ul>
</div>
<div class="block">
/common/fop/fop.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/common/fop/xalan-2.7.0.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/common/fop/xml-apis-ext-1.3.04.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/common/fop/avalon-framework-4.2.0.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/common/fop/xmlgraphics-commons-1.4.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/common/fop/serializer-2.7.0.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/common/fop/xml-apis-1.3.04.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/common/fop/commons-logging-1.0.4.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/common/fop/commons-io-1.3.1.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/common/fop/dom4j-1.6.1.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/common/fop/xercesImpl-2.7.1.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/common/fop/batik-all-1.7.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/common/dom4j/dom4j-1.4.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/common/dom4j/dom4j-1.6.1.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream