Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 420 → Rev 457

/impl/conf/language/MessageResourcesIntranet.properties
51,12 → 51,14
intranet.home.curricular=Consulta de Material Curricular
 
 
intranet.quotas.error=<p class="statusERROR">Serviço de quotas de impressão não disponível</p>
intranet.quotas.impressoras=Impressoras
intranet.quotas.disponiveis=Quotas Disponíveis
intranet.quotas.donaldPreto=Donald (Preto)
intranet.quotas.billCor=Bill (Cor)
 
 
 
 
 
 
 
 
 
/impl/conf/language/MessageResourcesEmail.properties
5,11 → 5,13
################################################################################
module.Email=Serviço de Email
pop.no.messages=Não tem mensagens na sua caixa de correio
pop.title=Últimas mensagens de Email<br>Ir para <a target="_blank" href="http://mail.estgp.pt/exchange/{0}">WEBMAIL</a>
pop.title=Ir para <a target="_blank" href="http://mail.estgp.pt/exchange/{0}">WEBMAIL</a>
pop.last.messages=Últimas mensagens de Email
pop.text=Mensagem
pop.from=De
pop.to=Para
pop.subject=Assunto
pop.loading=Carregando mensagens de Email...
pop.date=Recebido
pop.not.configured=O Seu servidor de Email não está configurado
pop.not.configured=A caixa POP do seu servidor de Email não está configurado. A sigla POP refere-se ao protocolo de leitura de mensagens em servidores de email externos. Por favor configure o seu servidor de POP nos seus dados de perfil<br>(exemplo na ESTG:<br> pop = mail.estgp.pt)
pop.danger.messages=Existem mensagens na sua caixa de correio da escola que estão incorrectamente formatadas e que podem prejudicar a vizualização deste sítio. Por favor remova-as da sua caixa para que as restantes possam ser aqui apresentadas.
/impl/conf/language/MessageResourcesCourse.properties
9,6 → 9,7
course.submit.new=Novo Curso
course.updated.success=Curso {0} actualizado com sucesso
course.created.success=Curso {0} criado com sucesso
course.exists=O Curso já existe com esse código e ano
 
course.select=Escolha Curso
course.select.message=Por favor selecione o curso que deseja editar
/impl/conf/language/MessageResourcesProfile.properties
77,6 → 77,7
profile.record.deleted.sucess=Registo apagado com sucesso
profile.email.change=*Para alterar o seu email dirija-se aos serviços centrais
profile.record.confirm.delete=Tem a certeza que deseja apagar esta entrada do curriculum?
profile.confirm.delete=Tem a certeza que deseja apagar este utilizador, (Se for aluno os seus trabalhos de unidades irão manter-se no sistema)?
#Dublin Core Fields
profile.record.file=Ficheiro Electrónico
profile.record.file.access=Acesso ao Ficheiro
/impl/conf/language/MessageResourcesSruSources.properties
New file
0,0 → 1,36
################################################################################
#
# SRU SOURCES MESSAGE RESOURCES
#
################################################################################
module.SruSource=Pastas Partilhadas do Donald
 
srusource=Fontes de Pesquisa SRU (Search and Retrieve via URL)
srusource.create.srusource=Nova fonte SRU
srusource.name=Nome
srusource.zero.collections=De momento não existem colecções atribuidas
srusource.new.collection=Adicione colecção usando este formulário
srusource.admited.roles=Papeis Admitidos
 
srusource.description=Descrição
srusource.url=URL
srusource.collection=Colecção de Pesquisa
srusource.collections=Colecções
srusource.metadataSchema=Esquema de Metadados
srusource.metadataSchema.files=Pastas Partilhadas ESTG
srusource.collection.add=Adicionar Colecção
 
srusource.collectionField=Indice da Colecção No SRU (se não souber coloque: collection)
 
srusource.create.new=Criar nova fonte SRU
srusource.choose.srusources=Escolha uma das Fontes SRU para editar
srusource.edit.srusources=Editar Fontes SRU
srusource.edit.srusource=Editar Fonte SRU
 
srusource.created.success=Fonte SRU criada com sucesso
srusource.edited.success=Fonte SRU editada com sucesso
 
srusource.deleted.sucess=Fonte de SRU apagada com sucesso
srusource.deleted.fail=Falhou a remoção da Fonte de SRU
 
srusource.confirm.delete=Tem a certeza que deseja apagar esta Fonte de SRU?
/impl/conf/language/MessageResources.properties
308,7 → 308,7
 
#Mensagens Status
authentication.ok=Benvindo Fulano
logout.ok=Caro {0}, obrigado por usar o nosso serviço.
logout.ok=Caro/a {0},<br> Obrigado por usar o nosso serviço.
authentication.first.time=Olá bem-vindo, é a primeira vez que que se esta a ligar
authenticate.already.authenticated=O seu usuário já está autênticado
username=Nome de Utilizador
323,6 → 323,7
remove=Remover
yes=Sim
no=Não
url=URL
wait=Aguarde um instante por favor
name=Nome
targets=Papeis
/impl/conf/language/MessageResourcesCourseUnits.properties
7,6 → 7,8
course={0} &gt
courseunit={0}
 
courseunit.menu.unit.old.units=Anos anteriores
courseunit.menu.unit.other.units=Outros Anos
courseunit.menu.unit=Unidade
courseunit.teachers=Corpo Docente
courseunit.objectives=Objectivos da Unidade
/impl/conf/WEB-INF/struts/struts-srusource.xml
New file
0,0 → 1,46
<?xml version="1.0" encoding="UTF-8"?>
 
<!--<!DOCTYPE struts-config PUBLIC-->
<!--"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"-->
<!--"http://struts.apache.org/dtds/struts-config_1_3.dtd">-->
 
<struts-config>
 
 
<form-beans>
<form-bean type="pt.estgp.estgweb.web.form.srusource.SruSourceForm" name="SruSourceForm"/>
</form-beans>
 
<global-exceptions>
</global-exceptions>
 
<global-forwards>
</global-forwards>
 
 
<action-mappings>
 
<!--Mudar o perfil da area de servico pelo administrador-->
 
<action path="/user/startNewSruSourceFromServiceZone" forward="/user/sruSourceFromServiceZone.do?dispatch=newSruSource&amp;from=ServiceZone"/>
<action path="/user/startChooseSruSourceFromServiceZone" forward="page.load.srusources.from.service.zone"/>
<action path="/user/chooseSruSourceFromServiceZone" forward="/user/sruSourceFromServiceZone.do?dispatch=loadSruSource&amp;from=ServiceZone"/>
<action path="/user/deleteSruSourceFromServiceZone" forward="/user/sruSourceFromServiceZone.do?dispatch=delete&amp;from=ServiceZone"/>
deleteSruSourceFromServiceZone
<action path="/user/sruSourceFromServiceZone"
type="pt.estgp.estgweb.web.controllers.srusource.SruSourceController"
name="SruSourceForm"
scope="request"
parameter="dispatch"
validate="false"
input="page.load.srusource.from.service.zone">
<forward name="success" path="page.separators.serviceZone"/>
<forward name="sruSourceData" path="page.load.srusource.from.service.zone"/>
<forward name="loadSruSources" path="page.load.srusources.from.service.zone"/>
<forward name="loadSruSource" path="page.choose.load.srusource.from.service.zone"/>
<forward name="from.add.role" path="page.load.srusource.from.service.zone"/>
</action>
 
</action-mappings>
 
</struts-config>
/impl/conf/WEB-INF/struts/tiles-srusource.xml
New file
0,0 → 1,32
<?xml version="1.0" encoding="UTF-8" ?>
 
<!--<!DOCTYPE tiles-definitions PUBLIC-->
<!--"-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"-->
<!--"http://struts.apache.org/dtds/tiles-config_1_1.dtd">-->
 
 
<tiles-definitions>
 
 
<!--From Service Zone-->
 
<definition name="page.load.srusource.from.service.zone" extends="base.separators">
<put name="title" value="Sru Source" />
<put name="separator" value="4" type="string" />
<put name="topnav" value="/user/serviceZone/topnavCreateSruSource.jsp"/>
<put name="body" value="/admin/srusource/sruSourceData.jsp" />
</definition>
<definition name="page.load.srusources.from.service.zone" extends="base.separators">
<put name="title" value="Choose Sru Source" />
<put name="separator" value="4" type="string" />
<put name="topnav" value="/user/serviceZone/topnavChooseSruSources.jsp"/>
<put name="body" value="/admin/srusource/chooseSruSource.jsp" />
</definition>
<definition name="page.choose.load.srusource.from.service.zone" extends="page.load.srusource.from.service.zone">
<put name="topnav" value="/user/serviceZone/topnavLoadSruSource.jsp"/>
</definition>
 
 
 
</tiles-definitions>
/impl/conf/WEB-INF/struts/struts-announcements.xml
83,6 → 83,7
input="page.submit.announcement"
validate="false">
<forward name="load" path="page.load.announcement"/>
<forward name="success" path="page.welcome"/>
</action>
<action path="/user/startDeleteAnnouncementFromHome" forward="/user/loadAnnouncementFromHome.do?dispatch=delete&amp;from=Home"/>
<action path="/user/startEditAnnouncementFromHome" forward="/user/loadAnnouncementFromHome.do?dispatch=edit&amp;from=Home"/>
/impl/conf/WEB-INF/struts/struts-default.xml
195,7 → 195,8
/WEB-INF/struts/tiles-commons.xml,
/WEB-INF/struts/tiles-intranet.xml,
/WEB-INF/struts/tiles-reminders.xml,
/WEB-INF/struts/tiles-managedidentifier.xml"/>
/WEB-INF/struts/tiles-managedidentifier.xml,
/WEB-INF/struts/tiles-srusource.xml"/>
</plug-in>
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
/impl/conf/WEB-INF/web.xml
143,7 → 143,8
/WEB-INF/struts/struts-commons.xml,
/WEB-INF/struts/struts-intranet.xml,
/WEB-INF/struts/struts-reminders.xml,
/WEB-INF/struts/struts-managedidentifier.xml
/WEB-INF/struts/struts-managedidentifier.xml,
/WEB-INF/struts/struts-srusource.xml
</param-value>
</init-param>
<init-param>
208,6 → 209,10
<servlet-name>repositoryStream</servlet-name>
<servlet-class>pt.estgp.estgweb.web.RepositoryStream</servlet-class>
</servlet>
<servlet>
<servlet-name>ServicosImpressao</servlet-name>
<servlet-class>pt.estgp.estgweb.web.ajaxapis.ServicosImpressao</servlet-class>
</servlet>
 
 
 
272,6 → 277,10
<servlet-name>BlogServlet</servlet-name>
<url-pattern>/blogspot/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ServicosImpressao</servlet-name>
<url-pattern>/user/ajaxapis/ServicosImpressao</url-pattern>
</servlet-mapping>
 
<!--START FILES-->
<welcome-file-list>
/impl/conf/app.properties
63,7 → 63,8
module.intranet=true
module.profile=true
module.sms=false
 
module.quotasImpressao=true
module.srusource=true
##################################################
# SMS
#
249,6 → 250,7
url.stat.ignore.prefix.6=/js/
url.stat.ignore.prefix.7=/auth/
url.stat.ignore.prefix.8=/imageStream
url.stat.ignore.prefix.9=/ajaxapis
 
 
 
278,6 → 280,7
filter.ignore.prefix.4=/css
filter.ignore.prefix.5=/imageStream
filter.ignore.prefix.6=/imgs
filter.ignore.prefix.7=/ajaxapis
 
 
#See java.text.SimpleDateFormat
304,6 → 307,8
#
 
siges.degree.1=L
siges.degree.4=M
siges.degree.8=C
 
national.institution.code=3122
siges.institution.code=1
414,3 → 419,13
home.courseunit.last.anouncements.max=3
 
 
#########################################
# Servicos de Impressao API
#
########################################
impressao.servicos.api=http://www.global.estgp.pt/API/XMLImpressao.asp
impressao.servicos.auth=true
impressao.servicos.auth.user.property=ionline.user
impressao.servicos.auth.pass.property=ionline.pass
impressao.servicos.auth.user=
impressao.servicos.auth.pass=
/impl/conf/template/email/courseUnitWork_en.txt
1,4 → 1,4
 

# 0 : Course Unit Name
# 1 : Title
# 2 : Text
18,6 → 18,6
Best Regards {3}
 
---------------------------------------------
Escola Superior de Tecnologia e Gestão
Instituto Politécnico de Portalegre
Escola Superior de Tecnologia e Gestão
Instituto Politécnico de Portalegre
http://www.estgp.pt
/impl/conf/template/email/courseUnitWork_pt.txt
1,4 → 1,4
 

# 0 : Course Unit Name
# 1 : Title
# 2 : Text
18,6 → 18,6
Com os melhores cumprimentos {3}
 
---------------------------------------------
Escola Superior de Tecnologia e Gestão
Instituto Politécnico de Portalegre
Escola Superior de Tecnologia e Gestão
Instituto Politécnico de Portalegre
http://www.estgp.pt
/impl/conf/template/email/courseUnitWorkChange_en.txt
New file
0,0 → 1,26

# 0 : Course Unit Name
# 1 : Title
# 2 : Text
# 3 : Teacher
# 4 : Deliver Date
# Course Unit Assignement
#
Dear Student
 
WORK MODIFICATION
 
The details of an work were changed in:
{0}
 
{1}
Execution or deliver date: {4}
 
{2}
 
Best Regards {3}
 
---------------------------------------------
Escola Superior de Tecnologia e Gestão
Instituto Politécnico de Portalegre
http://www.estgp.pt
/impl/conf/template/email/courseUnitWorkChange_pt.txt
New file
0,0 → 1,27

# 0 : Course Unit Name
# 1 : Title
# 2 : Text
# 3 : Teacher
# 4 : Deliver Date
# Course Unit Assignement
#
Caro estudante
 
ALTERAÇÃO A TRABALHO
 
Os detalhes de um trabalho foram alterados na unidade:
{0}
 
 
{1}
Data de execução ou entrega: {4}
 
{2}
 
Com os melhores cumprimentos {3}
 
---------------------------------------------
Escola Superior de Tecnologia e Gestão
Instituto Politécnico de Portalegre
http://www.estgp.pt
/impl/conf/berserk/sd.xml
131,6 → 131,7
<chain name="Session"/>
<chain name="AuthenticatedUsers"/>
<chain name="IsInCourseUnit"/>
<chain name="CanAddAnnouncementInCourseUnit"/>
</filterChains>
</service>
<service>
749,6 → 750,16
</filterChains>
</service>
<service>
<name>LoadCourseUnitsBySigesCodes</name>
<implementationClass>pt.estgp.estgweb.services.courseunits.LoadCourseUnitsBySigesCodesService</implementationClass>
<description>Load course old units</description>
<isTransactional>true</isTransactional>
<filterChains>
<chain name="Logger"/>
<chain name="Session"/>
</filterChains>
</service>
<service>
<name>LoadCourseUnitWorks</name>
<implementationClass>pt.estgp.estgweb.services.courseunits.CourseUnitWorkService</implementationClass>
<description>Load course unit works</description>
1403,12 → 1414,63
<!---->
 
 
 
 
<!--SRU Services-->
<service>
<name>LoadSruSourceById</name>
<implementationClass>pt.estgp.estgweb.services.srusources.LoadSruSourceByIdService</implementationClass>
<description>Load SruSource By ID</description>
<isTransactional>true</isTransactional>
<filterChains>
<chain name="Logger"/>
<chain name="Session"/>
<chain name="Admins"/>
</filterChains>
</service>
<service>
<name>LoadSruSources</name>
<implementationClass>pt.estgp.estgweb.services.srusources.LoadSruSourcesService</implementationClass>
<description>Load all SruSources</description>
<isTransactional>true</isTransactional>
<filterChains>
<chain name="Logger"/>
<chain name="Session"/>
<chain name="Admins"/>
</filterChains>
</service>
<service>
<name>SubmitSruSource</name>
<implementationClass>pt.estgp.estgweb.services.srusources.SruSourceService</implementationClass>
<description>Submit SruSource By ID</description>
<isTransactional>true</isTransactional>
<defaultMethod>submit</defaultMethod>
<filterChains>
<chain name="Logger"/>
<chain name="Session"/>
<chain name="Admins"/>
</filterChains>
</service>
<service>
<name>DeleteSruSource</name>
<implementationClass>pt.estgp.estgweb.services.srusources.DeleteSruSourceService</implementationClass>
<description>Delete SruSource By ID</description>
<isTransactional>true</isTransactional>
<filterChains>
<chain name="Logger"/>
<chain name="Session"/>
<chain name="Admins"/>
</filterChains>
</service>
 
 
 
DeleteSruSource
 
 
 
 
 
 
 
</serviceDefinitions>
/impl/conf/berserk/fd.xml
62,6 → 62,16
<isTransactional>false</isTransactional>
</filter>
<filter>
<name>CanAddAnnouncementInCourseUnit</name>
<implementationClass>pt.estgp.estgweb.filters.filters.CanAddAnnouncementInCourseUnit</implementationClass>
<description>
Checks if the requester is in course unit and if can create announcement in it of the requested bean
filter parameter: bean serializable id
filter parameter: bean class
</description>
<isTransactional>false</isTransactional>
</filter>
<filter>
<name>IsStudentInCourseUnitUsersClass</name>
<implementationClass>pt.estgp.estgweb.filters.filters.IsStudentInCourseUnitUsersClass</implementationClass>
<description>
/impl/conf/berserk/fcd.xml
318,6 → 318,13
<invocationTiming>1</invocationTiming>
<filterClass>pt.estgp.estgweb.filters.chains.LoadControlFilter</filterClass>
</filterChain>
<filterChain>
<name>CanAddAnnouncementInCourseUnit</name>
<expression>CanAddAnnouncementInCourseUnit("object.courseUnitView.id")</expression>
<description>Owner of an object Control Chain</description>
<invocationTiming>1</invocationTiming>
<filterClass>pt.estgp.estgweb.filters.chains.LoadControlFilter</filterClass>
</filterChain>
<!--<filterChain>-->
<!--<name>InternalCourseUnitBlog</name>-->
<!--<expression>!(BooleanCheck("serializable","pt.estgp.estgweb.domain.CourseUnitImpl","unitBlog.courseUnitInternal")) || ResourceAccessControlCourseUnit</expression>-->
/impl/src/java/jomm/web/ftp/impl/FtpFile.java
11,6 → 11,7
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
83,6 → 84,32
return name;
}
 
 
public String getNameEncoded() throws URIException
{
return URIUtil.encodePath(name,"ISO-8859-1");
}
 
 
public String getNameEscapedHtml()
{
try {
return jomm.utils.TextToHTMLEnconder.escapeHTML(new String(name.getBytes("ISO-8859-1")));
} catch (UnsupportedEncodingException e) {
logger.error(e,e);
return name;
}
}
public String getNameHtml()
{
try {
return new String(name.getBytes("ISO-8859-1"));
} catch (UnsupportedEncodingException e) {
logger.error(e,e);
return name;
}
}
 
public String getExtension()
{
return extension;
/impl/src/java/jomm/web/ftp/IFile.java
22,6 → 22,9
public InputStream getInputStream() throws IOException;
public Date getLastUpdate();
public String getName();
public String getNameEncoded() throws URIException;
public String getNameEscapedHtml();
public String getNameHtml();
public String getExtension();
public String getName(HttpServletRequest request) throws URIException;
public long getSize();
/impl/src/java/pt/estgp/estgweb/utils/HttpClient.java
New file
0,0 → 1,70
package pt.estgp.estgweb.utils;
 
import jomm.utils.MimeTypeGuesser;
 
import java.io.*;
import java.net.ProtocolException;
import java.net.URL;
import java.net.URLConnection;
import java.net.HttpURLConnection;
 
/**
* @author Jorge Machado
* @date 13/Nov/2009
* @time 17:24:38
* @email machadofisher@gmail.com
*/
public class HttpClient
{
public static InputStream sendFile(String url, File file) throws IOException, ProtocolException {
 
String mimeType = MimeTypeGuesser.getInstance().guessMimeType(file);
 
URL urlSolr = new URL(url);
URLConnection urlConnection = urlSolr.openConnection();
urlConnection.addRequestProperty("Content-type",mimeType);
 
((HttpURLConnection) urlConnection).setRequestMethod("GET");
 
 
urlConnection.setDoInput(true);
urlConnection.setDoOutput(true);
urlConnection.setUseCaches(false);
OutputStream outputStream = new DataOutputStream(urlConnection.getOutputStream());
 
FileInputStream fStream = new FileInputStream(file);
byte[] bytes = new byte[1024];
int read;
while((read = fStream.read(bytes)) >= 0)
{
outputStream.write(bytes,0,read);
}
outputStream.flush();
outputStream.close();
 
return new DataInputStream(urlConnection.getInputStream());
}
 
public static InputStream sendXmlData(String url, String xmlData) throws IOException, ProtocolException {
 
URL urlSolr = new URL(url);
URLConnection urlConnection = urlSolr.openConnection();
urlConnection.addRequestProperty("Content-type","text/xml");
 
((HttpURLConnection) urlConnection).setRequestMethod("GET");
 
 
urlConnection.setDoInput(true);
urlConnection.setDoOutput(true);
urlConnection.setUseCaches(false);
OutputStream outputStream = new DataOutputStream(urlConnection.getOutputStream());
 
outputStream.write(xmlData.getBytes());
 
outputStream.flush();
outputStream.close();
 
return new DataInputStream(urlConnection.getInputStream());
}
 
}
/impl/src/java/pt/estgp/estgweb/Globals.java
49,8 → 49,34
}
}
 
 
 
public static final String INTRANET_IMPRESSAO_SERVICO_API = ConfigProperties.getProperty("impressao.servicos.api");
public static final boolean INTRANET_IMPRESSAO_SERVICO_AUTH = ConfigProperties.getBooleanProperty("impressao.servicos.auth");
 
public static final String INTRANET_IMPRESSAO_SERVICO_AUTH_USER_PROPERTY = ConfigProperties.getProperty("impressao.servicos.auth.user.property");
public static final String INTRANET_IMPRESSAO_SERVICO_AUTH_PASS_PROPERTY = ConfigProperties.getProperty("impressao.servicos.auth.pass.property");
public static String INTRANET_IMPRESSAO_SERVICO_AUTH_USER = ConfigProperties.getProperty("impressao.servicos.auth.user");
public static String INTRANET_IMPRESSAO_SERVICO_AUTH_PASS = ConfigProperties.getProperty("impressao.servicos.auth.pass");
 
static
{
if(INTRANET_IMPRESSAO_SERVICO_AUTH)
{
if(INTRANET_IMPRESSAO_SERVICO_AUTH_USER_PROPERTY != null && INTRANET_IMPRESSAO_SERVICO_AUTH_USER_PROPERTY.length() > 0)
{
INTRANET_IMPRESSAO_SERVICO_AUTH_USER = ConfigProperties.getProperty(INTRANET_IMPRESSAO_SERVICO_AUTH_USER_PROPERTY);
INTRANET_IMPRESSAO_SERVICO_AUTH_PASS = ConfigProperties.getProperty(INTRANET_IMPRESSAO_SERVICO_AUTH_PASS_PROPERTY);
}
else
{
INTRANET_IMPRESSAO_SERVICO_AUTH_USER = ConfigProperties.getProperty("impressao.servicos.auth.user");
INTRANET_IMPRESSAO_SERVICO_AUTH_PASS = ConfigProperties.getProperty("impressao.servicos.auth.pass");
}
}
 
}
 
public static final String INTRANET_CONTENTS = ConfigProperties.getProperty("intranet.contents.dir");
public static final String INTRANET_GRADES = ConfigProperties.getProperty("intranet.grades.dir");
public static final String INTRANET_PRESENCES = ConfigProperties.getProperty("intranet.presences.dir");
225,6 → 251,8
public static final String EMAIL_COURSEUNIT_WORK_SUBJECT_EN = ConfigProperties.getProperty("email.courseunit.work.subject.en");
public static final String EMAIL_COURSEUNIT_WORK_TEMPLATE_PT = "courseUnitWork_pt.txt";
public static final String EMAIL_COURSEUNIT_WORK_TEMPLATE_EN = "courseUnitWork_en.txt";
public static final String EMAIL_COURSEUNIT_WORK_CHANGE_TEMPLATE_PT = "courseUnitWorkChange_pt.txt";
public static final String EMAIL_COURSEUNIT_WORK_CHANGE_TEMPLATE_EN = "courseUnitWorkChange_en.txt";
 
public static final String EMAIL_COURSEUNIT_BLOGPOST_SUBJECT_PT = ConfigProperties.getProperty("email.courseunit.blogpost.subject.pt");
public static final String EMAIL_COURSEUNIT_BLOGPOST_SUBJECT_EN = ConfigProperties.getProperty("email.courseunit.blogpost.subject.en");
/impl/src/java/pt/estgp/estgweb/services/courses/CoursesCommonServices.java
27,7 → 27,7
* <p/>
* Created at 17/Out/2003 , 23:45:24
*/
public class CoursesCommonServices implements IService, IModuleCommonServices
public class CoursesCommonServices extends SingleSearchResults implements IService, IModuleCommonServices
{
private static final Logger logger = Logger.getLogger(CoursesCommonServices.class);
 
/impl/src/java/pt/estgp/estgweb/services/courses/CoursesService.java
14,6 → 14,7
import pt.estgp.estgweb.services.data.IRepositoryFile;
import pt.estgp.estgweb.services.data.RepositoryService;
import pt.estgp.estgweb.services.expceptions.ServiceException;
import pt.estgp.estgweb.services.expceptions.AlreadyExistsException;
import pt.estgp.estgweb.utils.DatesUtils;
import pt.estgp.estgweb.utils.Dom4jUtil;
import pt.utl.ist.berserk.logic.serviceManager.IService;
77,17 → 78,24
 
public CourseView loadCourseByCode(String code, boolean initUnits) throws ServiceException
{
Course c = DaoFactory.getCourseDaoImpl().findCourseByCode(code);
if(c != null)
{
CourseView cV = new CourseView(c,initUnits);
if(c.getStudiesPlan() != null)
try{
Course c = DaoFactory.getCourseDaoImpl().findCourseByCode(code);
if(c != null)
{
RepositoryFileImpl repositoryFile = repositoryService.loadView(c.getStudiesPlan());
cV.setStudiesPlan(repositoryFile);
CourseView cV = new CourseView(c,initUnits);
if(c.getStudiesPlan() != null)
{
RepositoryFileImpl repositoryFile = repositoryService.loadView(c.getStudiesPlan());
cV.setStudiesPlan(repositoryFile);
}
return cV;
}
return cV;
}
catch(Throwable e)
{
logger.error(e + " loading code:" + code,e);
throw new ServiceException("loading code: " + code + " - " + e.toString(),e);
}
return null;
}
 
100,9 → 108,14
{
Course c;
if(courseView.getId() > 0)
{
c = DaoFactory.getCourseDaoImpl().get(courseView.getId());
}
else
{
c = DaoFactory.getCourseDaoImpl().findCourseByCodeAndYear(courseView.getCode(),courseView.getImportYear());
if(c != null)
throw new AlreadyExistsException(AlreadyExistsException.ALREADY_EXISTS_COURSE);
c = DomainObjectFactory.createCourseImpl();
DaoFactory.getCourseDaoImpl().save(c);
}
126,7 → 139,7
try
{
Document dom = Dom4jUtil.parse(stream);
String html = Dom4jUtil.styleDocument(dom, Globals.TEMPLATE_COURSE_XSL_PATH);
String html = Dom4jUtil.styleDocument(dom, Globals.TEMPLATE_COURSE_XSL_PATH);
c.setCacheWebDocument(html);
}
catch (Exception e)
/impl/src/java/pt/estgp/estgweb/services/courseunits/CourseUnitsCommonServices.java
26,7 → 26,7
* <p/>
* Created at 17/Out/2003 , 23:45:24
*/
public class CourseUnitsCommonServices implements IService, IModuleCommonServices
public class CourseUnitsCommonServices extends SingleSearchResults implements IService, IModuleCommonServices
{
private static final Logger logger = Logger.getLogger(CourseUnitsCommonServices.class);
 
/impl/src/java/pt/estgp/estgweb/services/courseunits/LoadCourseUnitsBySigesCodesService.java
New file
0,0 → 1,42
package pt.estgp.estgweb.services.courseunits;
 
import pt.utl.ist.berserk.logic.serviceManager.IService;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.domain.views.CourseUnitSummaryView;
import pt.estgp.estgweb.domain.views.AnnouncementView;
import pt.estgp.estgweb.domain.views.CourseUnitView;
import pt.estgp.estgweb.domain.UserSession;
import pt.estgp.estgweb.domain.RepositoryFile;
import pt.estgp.estgweb.domain.CourseUnitSummary;
import pt.estgp.estgweb.domain.CourseUnit;
import pt.estgp.estgweb.services.expceptions.ServiceException;
import org.apache.log4j.Logger;
 
import java.util.List;
import java.util.ArrayList;
 
/**
* @author Jorge Machado
* @date 18/Nov/2009
* @time 2:50:07
* @email machadofisher@gmail.com
*/
public class LoadCourseUnitsBySigesCodesService implements IService
{
private static final Logger logger = Logger.getLogger(LoadCourseUnitsBySigesCodesService.class);
 
public List<CourseUnitView> run(String code, String courseCode, UserSession userSession) throws ServiceException {
 
List<CourseUnit> courseUnits = DaoFactory.getCourseUnitDaoImpl().loadBySigesCodes(code, courseCode);
 
if(courseUnits == null || courseUnits.size() == 0)
return new ArrayList<CourseUnitView>();
List<CourseUnitView> courseUnitViews = new ArrayList<CourseUnitView>();
for(CourseUnit cU : courseUnits)
{
CourseUnitView cV = new CourseUnitView(cU);
courseUnitViews.add(cV);
}
return courseUnitViews;
}
}
/impl/src/java/pt/estgp/estgweb/services/courseunits/CreateCourseUnitWorksBackupService.java
419,7 → 419,25
{
if (deliverable.getDeliverableRepositoryStream() != null && deliverable.getDeliverableRepositoryStream().length() > 0)
{
String deliverDir = toDir + "/deliverable" + deliverable.getId() + "-" + deliverable.getStudent().getId() + "numero" + deliverable.getStudent().getSigesCode();
BytesUtils.generateHexKey();
String studentId;
String sigesCode;
if(deliverable.getStudent() != null)
{
studentId = "" + deliverable.getStudent().getId();
sigesCode = "" + deliverable.getStudent().getSigesCode();
}
else if(deliverable.getStudentId() > 0)
{
studentId = "" + deliverable.getStudentId();
sigesCode = "desconhecido" + BytesUtils.generateHexKey();
}
else
{
sigesCode = "desconhecido" + BytesUtils.generateHexKey();
studentId = "desconhecido" + BytesUtils.generateHexKey();
}
String deliverDir = toDir + "/deliverable" + deliverable.getId() + "-" + studentId + "-numero" + sigesCode;
new File(deliverDir).mkdirs();
List<IRepositoryFile> iRepositoryFiles = repositoryService.loadVersions(deliverable.getDeliverableRepositoryStream(), userSession);
for (IRepositoryFile iRepositoryFile : iRepositoryFiles)
/impl/src/java/pt/estgp/estgweb/services/courseunits/CourseUnitWorkService.java
57,7 → 57,10
{
CourseUnit courseUnit = DaoFactory.getCourseUnitDaoImpl().get(id);
CourseUnitAssignement assignement;
boolean newWork = true;
if(cUV.getId() > 0)
newWork = false;
if(cUV.getId() > 0)
assignement = DaoFactory.getCourseUnitAssignementDaoImpl().get(cUV.getId());
else
{
80,11 → 83,11
}
 
if(assignement.isStatus())
trySendWorkEmail(assignement,userSession);
trySendWorkEmail(assignement,userSession,newWork);
return loadCourseUnitWorks(id,userSession);
}
 
private void trySendWorkEmail(CourseUnitAssignement assignement, UserSession userSession)
private void trySendWorkEmail(CourseUnitAssignement assignement, UserSession userSession,boolean newWork)
{
CourseUnit c = assignement.getCourseUnit();
List<User> users = new ArrayList<User>();
92,14 → 95,14
users.addAll(c.getStudents());
if(c.getTeachers() != null)
users.addAll(c.getTeachers());
sendWorkEmail(assignement,c.getNormalizedName(), userSession, users);
sendWorkEmail(assignement,c.getNormalizedName(), userSession, users,newWork);
}
 
SendEmailService sendEmailService = new SendEmailService();
 
private void sendWorkEmail(CourseUnitAssignement a, String desc, UserSession userSession, List<User> users)
private void sendWorkEmail(CourseUnitAssignement a, String desc, UserSession userSession, List<User> users, boolean newWork)
{
Email e = sendEmailService.getCourseUnitWorkEmail(a, LangEnum.PORTUGUESE,userSession,users);
Email e = sendEmailService.getCourseUnitWorkEmail(a, LangEnum.PORTUGUESE,userSession,users,newWork);
EMAILJob emailJob = new EMAILJob(e);
JobScheduleService.getInstance().scheduleNow(emailJob,"CourseUnit Assignement Email:" + desc,userSession);
}
183,16 → 186,30
String identifier = repositoryService.storeRepositoryFile(file, contentType, extension, size, name, "courseunit.assignement " + assignement.getCourseUnit().getName() + " of " + userSession.getUser().getUsername(), ResourceAccessControlEnum.courseunitDeliverableDomain,userSession);
deliverable.setDeliverableRepositoryStream(identifier);
deliverable.setCourseUnitAssignement(assignement);
deliverable.setStudent((Student) userSession.getUser());
setStudentWorkDetails(deliverable,userSession);
DaoFactory.getCourseUnitDeliverableDaoImpl().save(deliverable);
}
else
{
setStudentWorkDetails(deliverable,userSession);
repositoryService.updateRepositoryFile(deliverable.getDeliverableRepositoryStream(), file, contentType, extension, size, name, "courseunit.assignement " + assignement.getCourseUnit().getName() + " of " + userSession.getUser().getUsername(), ResourceAccessControlEnum.courseunitDeliverableDomain);
}
deliverable.setDeliverDate(new Date());
return loadCourseUnitWorks(courseUnitId,userSession);
}
 
private void setStudentWorkDetails(CourseUnitDeliverable deliverable, UserSession userSession)
{
deliverable.setStudent((Student) userSession.getUser());
deliverable.setStudentId(userSession.getUser().getId());
deliverable.setStudentUsername(userSession.getUsername());
deliverable.setStudentName(userSession.getUser().getName());
if(userSession.getUser() instanceof SigesUser)
deliverable.setStudentCode("" + ((SigesUser)userSession.getUser()).getSigesCode());
else
logger.error("BACO APPLICATION ERROR Student should be of type SigesUser");
}
 
//todo alterar o dominio de filtragem
 
 
/impl/src/java/pt/estgp/estgweb/services/email/SendEmailService.java
19,6 → 19,7
import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.Date;
import java.text.MessageFormat;
 
/**
201,28 → 202,37
return new Email(subject ,recipients, fromEmail, template,arguments,Message.RecipientType.BCC);
}
 
public Email getCourseUnitWorkEmail(CourseUnitAssignement assignement, LangEnum langEnum, UserSession userSession, List<User> users)
public Email getCourseUnitWorkEmail(CourseUnitAssignement assignement, LangEnum langEnum, UserSession userSession, List<User> users, boolean newWork)
{
List<String> arguments = new ArrayList<String>();
arguments.add(assignement.getCourseUnit().getName());
arguments.add(assignement.getTitle());
arguments.add(assignement.getDescription());
 
if(userSession != null && userSession.getName() != null)
arguments.add(userSession.getName());
else
arguments.add("unknown");
 
arguments.add( DatesUtils.getStringFromDate(assignement.getDeliverDate()));
String subjectTxt;
String template;
 
if(langEnum == LangEnum.PORTUGUESE)
{
template = Globals.EMAIL_COURSEUNIT_WORK_TEMPLATE_PT;
if(newWork)
template = Globals.EMAIL_COURSEUNIT_WORK_TEMPLATE_PT;
else
template = Globals.EMAIL_COURSEUNIT_WORK_CHANGE_TEMPLATE_PT;
subjectTxt = Globals.EMAIL_COURSEUNIT_WORK_SUBJECT_PT;
}
else
{
template = Globals.EMAIL_COURSEUNIT_WORK_TEMPLATE_EN;
if(newWork)
template = Globals.EMAIL_COURSEUNIT_WORK_TEMPLATE_EN;
else
template = Globals.EMAIL_COURSEUNIT_WORK_CHANGE_TEMPLATE_EN;
subjectTxt = Globals.EMAIL_COURSEUNIT_WORK_SUBJECT_EN;
}
 
326,10 → 336,11
 
public static void main(String [] args)
{
List<String[]> grades = new ArrayList<String[]>();
grades.add(new String[]{"Teste","3"});
grades.add(new String[]{"Teste2","4"});
new SendEmailService().sendNewGrades(grades,LangEnum.PORTUGUESE,"jmachado@estgp.pt","jorge Machado");
System.out.println( DatesUtils.getStringFromDate(new Date()));
// List<String[]> grades = new ArrayList<String[]>();
// grades.add(new String[]{"Teste","3"});
// grades.add(new String[]{"Teste2","4"});
// new SendEmailService().sendNewGrades(grades,LangEnum.PORTUGUESE,"jmachado@estgp.pt","jorge Machado");
}
 
}
/impl/src/java/pt/estgp/estgweb/services/email/EmailCommonServices.java
16,7 → 16,7
* @date 22/Mai/2008
* @see pt.estgp.estgweb.services.email
*/
public class EmailCommonServices implements IModuleCommonServices
public class EmailCommonServices extends SingleSearchResults implements IModuleCommonServices
{
 
public int countSearch(String search, SearchTypeEnum searchType, UserSession userSession)
/impl/src/java/pt/estgp/estgweb/services/email/ReadEmailService.java
39,15 → 39,15
 
public List<IPopEmail> run(UserSession userSession)
{
if(!((UserImpl)userSession.getUser()).hasPopConfigured())
if (!((UserImpl) userSession.getUser()).hasPopConfigured())
return null;
 
Properties props = new Properties();
Date d = (Date) ((UserSessionImpl)userSession).get(POP_MAIL_DATE_KEY);
ArrayList<IPopEmail> oldMessages = (ArrayList<IPopEmail>) ((UserSessionImpl)userSession).get(POP_MAIL_MESSAGES_KEY);
if(d != null && oldMessages != null)
Date d = (Date) ((UserSessionImpl) userSession).get(POP_MAIL_DATE_KEY);
ArrayList<IPopEmail> oldMessages = (ArrayList<IPopEmail>) ((UserSessionImpl) userSession).get(POP_MAIL_MESSAGES_KEY);
if (d != null && oldMessages != null)
{
if(System.currentTimeMillis() - d.getTime() < Globals.POP_REFRESH_TIMEOUT_MILISECONDS)
if (System.currentTimeMillis() - d.getTime() < Globals.POP_REFRESH_TIMEOUT_MILISECONDS)
{
return oldMessages;
}
79,67 → 79,80
for (int i = count; i > count - Globals.POP_MAX_MESSAGES && i > 0; i--)
{
 
Message message = inbox.getMessage(i);
DefaultPopEmail popEmail = new DefaultPopEmail();
String date = DatesUtils.getStringFromDate(message.getSentDate());
popEmail.setDate(date);
popEmail.setSubject(message.getSubject());
popEmail.setSubjectFragment(StringsUtils.getFragment(message.getSubject(),Globals.POP_FRAGMENT_TEXT_SIZE));
List<IAddress> addressLst = new ArrayList<IAddress>();
for (Address a : message.getFrom())
try
{
InternetAddress internetAddress = (InternetAddress) a;
DefaultAddress address = new DefaultAddress();
address.setEmail(internetAddress.getAddress());
address.setName(internetAddress.getPersonal());
addressLst.add(address);
}
popEmail.setFrom(addressLst);
Part messagePart = message;
Object content = messagePart.getContent();
if (content instanceof Multipart)
{
messagePart = ((Multipart) content).getBodyPart(0);
}
String contentType = messagePart.getContentType();
if (contentType.startsWith("text/plain") || contentType.startsWith("text/html"))
{
InputStream is = messagePart.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(is,"ISO-8859-1"));
StringBuilder text = new StringBuilder();
StringBuilder textClean = new StringBuilder();
String thisLine = reader.readLine();
while (thisLine != null)
Message message = inbox.getMessage(i);
DefaultPopEmail popEmail = new DefaultPopEmail();
String date = DatesUtils.getStringFromDate(message.getSentDate());
popEmail.setDate(date);
popEmail.setSubject(message.getSubject());
popEmail.setSubjectFragment(StringsUtils.getFragment(message.getSubject(), Globals.POP_FRAGMENT_TEXT_SIZE));
List<IAddress> addressLst = new ArrayList<IAddress>();
for (Address a : message.getFrom())
{
String thisLineTrim = thisLine.trim();
if(thisLineTrim.length() > 0)
InternetAddress internetAddress = (InternetAddress) a;
DefaultAddress address = new DefaultAddress();
address.setEmail(internetAddress.getAddress());
address.setName(internetAddress.getPersonal());
addressLst.add(address);
}
popEmail.setFrom(addressLst);
Part messagePart = message;
 
Object content = null;
try
{
content = messagePart.getContent();
}
catch (Throwable e)
{
content = "ESTG SITE AVISO: Conteudo possivelmente perigoso";
}
 
if (content instanceof Multipart)
{
messagePart = ((Multipart) content).getBodyPart(0);
}
String contentType = messagePart.getContentType();
if (contentType.startsWith("text/plain") || contentType.startsWith("text/html"))
{
InputStream is = messagePart.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(is, "ISO-8859-1"));
StringBuilder text = new StringBuilder();
StringBuilder textClean = new StringBuilder();
String thisLine = reader.readLine();
while (thisLine != null)
{
textClean.append(thisLineTrim);
String thisLineTrim = thisLine.trim();
if (thisLineTrim.length() > 0)
{
textClean.append(thisLineTrim);
}
text.append("<br>").append(thisLine.trim());
thisLine = reader.readLine();
}
text.append("<br>").append(thisLine.trim());
thisLine = reader.readLine();
popEmail.setText(text.toString());
popEmail.setFragment(StringsUtils.getFragment(textClean.toString(), Globals.POP_FRAGMENT_TEXT_SIZE));
}
popEmail.setText(text.toString());
popEmail.setFragment(StringsUtils.getFragment(textClean.toString(),Globals.POP_FRAGMENT_TEXT_SIZE));
popMessages.add(popEmail);
}
popMessages.add(popEmail);
catch (Throwable e)
{
logger.error(e, e);
}
}
inbox.close(false);
store.close();
 
((UserSessionImpl)userSession).put(POP_MAIL_DATE_KEY,new Date());
((UserSessionImpl)userSession).put(POP_MAIL_MESSAGES_KEY,((ArrayList)popMessages));
((UserSessionImpl) userSession).put(POP_MAIL_DATE_KEY, new Date());
((UserSessionImpl) userSession).put(POP_MAIL_MESSAGES_KEY, ((ArrayList) popMessages));
 
return popMessages;
}
catch (MessagingException e)
{
logger.error(e, e);
}
catch (IOException e)
{
logger.error(e, e);
}
return null;
}
}
/impl/src/java/pt/estgp/estgweb/services/sigesimports/ImportStudentsService.java
107,7 → 107,7
DaoFactory.getStudentDaoImpl().save(s);
newUser = true;
}
persist(d, s);
persist(d, s, newUser);
//Advising CommonsServicesManager before change password
 
if (newUser)
142,19 → 142,22
* @param d Aluno
* @param student Student
*/
private void persist(Aluno d, Student student)
private void persist(Aluno d, Student student, boolean newUser)
{
student.setName(d.getNome());
student.setEmail(d.getEmail());
student.setSigesCode(d.getCodigo().intValue());
student.setAddress(d.getMorada());
student.setPhonenumber(StringsUtils.cleanKeepNumbers(d.getTelemovel()));
student.setZip("" + d.getCodigoPostal().intValue());
student.setBi(d.getNumeroBi());
student.setSex(d.getSexo());
student.setUserNameNetpa(d.getUsernameNetpa());
student.setBirthDate(d.getDataNascimento().toGregorianCalendar().getTime());
student.setUsername("a" + d.getCodigo().intValue());
if(newUser)
{
student.setName(d.getNome());
student.setEmail(d.getEmail());
student.setSigesCode(d.getCodigo().intValue());
student.setAddress(d.getMorada());
student.setPhonenumber(StringsUtils.cleanKeepNumbers(d.getTelemovel()));
student.setZip("" + d.getCodigoPostal().intValue());
student.setBi(d.getNumeroBi());
student.setSex(d.getSexo());
student.setUserNameNetpa(d.getUsernameNetpa());
student.setBirthDate(d.getDataNascimento().toGregorianCalendar().getTime());
student.setUsername("a" + d.getCodigo().intValue());
}
 
/*Desta forma as relacoes antigas sao ignoradas cria-se uma lista nova e atribui-se ao Teacher, o Hibernate faz resto e apaga as chaves estrangeiras antigas */
if (d.getDisciplinasInscrito() == null || d.getDisciplinasInscrito().getDisciplina() == null || d.getDisciplinasInscrito().getDisciplina().size() == 0)
202,7 → 205,6
}
else
student.setSubscribedUnits(units);
student.setSubscribedUnits(units);
}
}
 
/impl/src/java/pt/estgp/estgweb/services/sigesimports/ImportTeachersService.java
75,7 → 75,7
logger.info("Importing: (" + t.getUsername() + ") " + t.getName());
try
{
persist(d, t);
persist(d, t, newUser);
}
catch (Exception e)
{
112,20 → 112,20
* @param t teacher
* @throws Exception .
*/
private void persist(Docente d, Teacher t) throws Exception
private void persist(Docente d, Teacher t, boolean newUser) throws Exception
{
try
{
if(t.getName() == null || t.getName().length() == 0)
t.setName(d.getNomeFuncionarioInt());
//Email instituicao
t.setEmail(d.getEmail());
if(t.getEmail() == null || t.getEmail().indexOf("@") < 0)
t.setEmail(d.getEmail());
if (d.getEmail() != null && d.getEmail().endsWith(Globals.EMAIL_LOCAL_SUFFIX))
{
int atIndex = d.getEmail().indexOf("@");
if (atIndex > 0)
t.setUsername(d.getEmail().substring(0, atIndex));
 
}
t.setSigesCode(d.getCodigoFuncionario().intValue());
if(t.getAddress() == null || t.getAddress().length() == 0)
/impl/src/java/pt/estgp/estgweb/services/reminders/RemindersCommonServices.java
21,7 → 21,7
* @time 18:01:54
* @see pt.estgp.estgweb.web
*/
public class RemindersCommonServices implements IService, IModuleCommonServices
public class RemindersCommonServices extends SingleSearchResults implements IService, IModuleCommonServices
{
 
private static final Logger logger = Logger.getLogger(RemindersCommonServices.class);
/impl/src/java/pt/estgp/estgweb/services/common/ISearchResults.java
22,6 → 22,8
public int getMaxResultsPage();
public String getQuery();
public String getSearchType();
public String getModuleInternalKey();
public String getDescription();
 
 
}
/impl/src/java/pt/estgp/estgweb/services/common/impl/DefaultResult.java
21,6 → 21,7
private boolean titleKey = false;
private boolean subTitleKey = false;
private boolean textKey = false;
private boolean absoluteUrl = false;
 
private LabelGroup subTitlesGroup = null;
 
104,4 → 105,13
{
this.subTitlesGroup = subTitlesGroup;
}
 
 
public boolean isAbsoluteUrl() {
return absoluteUrl;
}
 
public void setAbsoluteUrl(boolean absoluteUrl) {
this.absoluteUrl = absoluteUrl;
}
}
/impl/src/java/pt/estgp/estgweb/services/common/impl/DefaultSearchResults.java
26,6 → 26,8
private int maxResultsPage;
private String query;
private String searchType;
private String moduleInternalKey = null;
private String description;
 
 
public ModuleEnum getModule() {
124,8 → 126,25
public String getSearchType() {
return searchType;
}
 
public void setSearchType(String searchType) {
this.searchType = searchType;
}
 
public String getModuleInternalKey() {
return moduleInternalKey;
}
 
public void setModuleInternalKey(String moduleInternalKey) {
this.moduleInternalKey = moduleInternalKey;
}
 
 
public String getDescription() {
return description;
}
 
public void setDescription(String description) {
this.description = description;
}
}
/impl/src/java/pt/estgp/estgweb/services/common/MultipleSearchResults.java
New file
0,0 → 1,31
package pt.estgp.estgweb.services.common;
 
import pt.utl.ist.berserk.logic.serviceManager.IService;
import pt.estgp.estgweb.domain.UserSession;
import pt.estgp.estgweb.services.common.impl.DefaultSearchResults;
 
import java.util.List;
import java.util.ArrayList;
 
/**
* @author Jorge Machado
* @date 18/Nov/2009
* @time 1:10:00
* @email machadofisher@gmail.com
*/
public abstract class MultipleSearchResults implements IService, IModuleCommonServices
{
public ISearchResults search(String search, SearchTypeEnum searchType, int page, int maxResults, UserSession userSession) {
List<ISearchResults> searchResultsList = searchList(null, search, searchType,page,maxResults,userSession);
if(searchResultsList == null || searchResultsList.size() == 0)
return null;
return searchResultsList.get(0);
}
 
public ISearchResults search(String from, String search, SearchTypeEnum searchType, int page, int maxResults, UserSession userSession) {
List<ISearchResults> searchResultsList = searchList(null, from,search, searchType,page,maxResults,userSession);
if(searchResultsList == null || searchResultsList.size() == 0)
return null;
return searchResultsList.get(0);
}
}
/impl/src/java/pt/estgp/estgweb/services/common/CommonServicesManager.java
75,12 → 75,16
{
if (module.getModuleCommonServices() != null)
{
ISearchResults iSearchResults = search(userSession, query, searchType, module, 0, from);
if (iSearchResults != null && iSearchResults.getTotalResults() > 0)
{
results.add(iSearchResults);
commonSearchResults.addMoreResults(iSearchResults.getTotalResults());
}
List<ISearchResults> iSearchResultsList = search(userSession, query, searchType, module,null, 0, from);
if(iSearchResultsList != null && iSearchResultsList.size() > 0)
for(ISearchResults iSearchResults: iSearchResultsList)
{
if (iSearchResults != null && iSearchResults.getTotalResults() > 0)
{
results.add(iSearchResults);
commonSearchResults.addMoreResults(iSearchResults.getTotalResults());
}
}
}
}
commonSearchResults.setResults(results);
104,7 → 108,7
* @return searchResults
* @throws Throwable on not authorized and internal error
*/
public ISearchResults search(UserSession userSession, String query, SearchTypeEnum searchType, ModuleEnum moduleKey, int page, String from) throws Throwable
public List<ISearchResults> search(UserSession userSession, String query, SearchTypeEnum searchType, ModuleEnum moduleKey,String moduleInternalKey, int page, String from) throws Throwable
{
try
{
112,9 → 116,13
// String[] names = new String[]{};
// Object[] args = new Object[]{query, searchType, page, SEARCH_MAX_RESULTS};
 
DefaultSearchResults searchResults = (DefaultSearchResults) moduleKey.getModuleCommonServices().search(from, query, searchType, page, SEARCH_MAX_RESULTS, userSession); //(DefaultSearchResults) sm.execute(requester, moduleKey.getSearchService(), "search", args, names);
if(searchResults!=null)
List<ISearchResults> searchResultsList = moduleKey.getModuleCommonServices().searchList(moduleInternalKey, from, query, searchType, page, SEARCH_MAX_RESULTS, userSession); //(DefaultSearchResults) sm.execute(requester, moduleKey.getSearchService(), "search", args, names);
if(searchResultsList == null || searchResultsList.size() == 0)
return null;
for(ISearchResults iSearchResults: searchResultsList)
{
DefaultSearchResults searchResults = (DefaultSearchResults) iSearchResults;
 
searchResults.setPage(page);
searchResults.setMaxResultsPage(SEARCH_MAX_RESULTS);
searchResults.setQuery(query.replace("'", " "));
124,7 → 132,8
for (IResult result : searchResults.getResults())
{
DefaultResult defaultResult = (DefaultResult) result;
defaultResult.setBestFragments(LuceneUtils.doStandardHighlights(defaultResult.getText(), query, SEARCH_FRAGMENT_SIZE, SEARCH_MAX_FRAGMENTS));
if(defaultResult.getBestFragments() == null || defaultResult.getBestFragments().trim().length() == 0)
defaultResult.setBestFragments(LuceneUtils.doStandardHighlights(defaultResult.getText(), query, SEARCH_FRAGMENT_SIZE, SEARCH_MAX_FRAGMENTS));
if (!defaultResult.isTitleKey())
{
String title = defaultResult.getTitle();
139,16 → 148,18
if (defaultResult.getSubTitle() == null || defaultResult.getSubTitle().length() == 0)
defaultResult.setSubTitle(subTitle);
}
String text = defaultResult.getText();
defaultResult.setText(LuceneUtils.highlight(defaultResult.getText(), query));
if (defaultResult.getText() == null || defaultResult.getText().length() == 0)
defaultResult.setText(text);
if(defaultResult.getText() != null && defaultResult.getText().trim().length() > 0)
{
String text = defaultResult.getText();
 
defaultResult.setText(LuceneUtils.highlight(defaultResult.getText(), query));
if (defaultResult.getText() == null || defaultResult.getText().length() == 0)
defaultResult.setText(text);
}
}
}
return searchResults;
}
else
return null;
return searchResultsList;
}
catch (FilterRetrieveException e)
{
/impl/src/java/pt/estgp/estgweb/services/common/IResult.java
19,6 → 19,7
public String getText();
public boolean isTextKey();
public String getUrl();
public boolean isAbsoluteUrl();
public LabelGroup getSubTitlesGroup();
 
/**
/impl/src/java/pt/estgp/estgweb/services/common/SingleSearchResults.java
New file
0,0 → 1,34
package pt.estgp.estgweb.services.common;
 
import pt.estgp.estgweb.domain.UserSession;
import pt.utl.ist.berserk.logic.serviceManager.IService;
 
import java.util.List;
import java.util.ArrayList;
 
/**
* @author Jorge Machado
* @date 18/Nov/2009
* @time 1:10:00
* @email machadofisher@gmail.com
*/
public abstract class SingleSearchResults implements IService, IModuleCommonServices
{
public List<ISearchResults> searchList(String moduleInternalKey, String search, SearchTypeEnum searchType, int page, int maxResults, UserSession userSession) {
ISearchResults searchResults = search(search, searchType,page,maxResults,userSession);
if(searchResults == null)
return null;
List<ISearchResults> finalResults = new ArrayList<ISearchResults>();
finalResults.add(searchResults);
return finalResults;
}
 
public List<ISearchResults> searchList(String moduleInternalKey, String from, String search, SearchTypeEnum searchType, int page, int maxResults, UserSession userSession) {
ISearchResults searchResults = search(from, search, searchType, page, maxResults, userSession);
if(searchResults == null)
return null;
List<ISearchResults> finalResults = new ArrayList<ISearchResults>();
finalResults.add(searchResults);
return finalResults;
}
}
/impl/src/java/pt/estgp/estgweb/services/common/ModuleEnum.java
9,6 → 9,7
import pt.estgp.estgweb.services.courseunits.CourseUnitsCommonServices;
import pt.estgp.estgweb.services.courses.CoursesCommonServices;
import pt.estgp.estgweb.services.profile.ProfileCommonServices;
import pt.estgp.estgweb.services.srusources.SruSourcesCommonServices;
 
/**
* @author Jorge Machado
28,8 → 29,9
BlogPosts("module.BlogPosts", new BlogPostsCommonServices()),
CourseUnits("module.CourseUnits", new CourseUnitsCommonServices()),
Courses("module.Courses", new CoursesCommonServices()),
Profile("module.Profile", new ProfileCommonServices());
Profile("module.Profile", new ProfileCommonServices()),
// Questionarios("module.Qustionarios", new QuestionariosCommonServices());
SruSource("module.SruSource", new SruSourcesCommonServices());
 
// Events("module.Events",null),
// Blogs("module.Blogs",null),
/impl/src/java/pt/estgp/estgweb/services/common/IModuleCommonServices.java
18,6 → 18,9
public ISearchResults search(String search, SearchTypeEnum searchType, int page, int maxResults, UserSession userSession);
public ISearchResults search(String from, String search, SearchTypeEnum searchType, int page, int maxResults, UserSession userSession);
 
public List<ISearchResults> searchList(String moduleInternalKey, String search, SearchTypeEnum searchType, int page, int maxResults, UserSession userSession);
public List<ISearchResults> searchList(String moduleInternalKey, String from, String search, SearchTypeEnum searchType, int page, int maxResults, UserSession userSession);
 
public int countToDo(UserSession userSession);
public IToDoCat getToDo(UserSession userSession);
public List<IToDo> getAllToDos(UserSession userSession);
/impl/src/java/pt/estgp/estgweb/services/common/CommonServicesService.java
29,11 → 29,16
}
}
 
public ISearchResults searchModule(String from, String query, SearchTypeEnum searchType, ModuleEnum moduleKey, int page,UserSession userSession) throws Throwable
public ISearchResults searchModule(String from, String query, SearchTypeEnum searchType, ModuleEnum moduleKey, String moduleInternalKey, int page,UserSession userSession) throws Throwable
{
try
{
return CommonServicesManager.getInstance().search(userSession, query, searchType,moduleKey,page, from);
//In this case we are allays invoking one specific search source (in MultipleSearchResults services internalKey will be filled and the results come from one
// and one only source)
List<ISearchResults> results = CommonServicesManager.getInstance().search(userSession, query, searchType,moduleKey,moduleInternalKey, page, from);
if(results == null)
return null;
return results.get(0);
}
catch (Throwable throwable)
{
/impl/src/java/pt/estgp/estgweb/services/ftpservices/FtpService.java
72,7 → 72,27
{
for(FileItem item: ftpRequestForm.getFilesToImport())
{
if(!client.storeFile(item.getName(),item.getInputStream()))
 
String name = item.getName();
 
if(name != null)
{
 
if(name.length() > 2 && name.charAt(1)==':')
{
 
String[] names = name.split("\\\\");
 
name = names[names.length - 1];
}
else
{
name = new File(item.getName()).getName();
}
}
 
 
if(!client.storeFile(name,item.getInputStream()))
result = "errors.ftp.no.permission";
}
}
/impl/src/java/pt/estgp/estgweb/services/urlstat/LoadUrlStatService.java
1,10 → 1,12
package pt.estgp.estgweb.services.urlstat;
 
import org.apache.log4j.Logger;
import org.apache.commons.httpclient.util.URIUtil;
import pt.estgp.estgweb.domain.UrlStat;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.services.expceptions.ServiceException;
import pt.utl.ist.berserk.logic.serviceManager.IService;
import jomm.utils.BytesUtils;
 
/**
* @author Jorge Machado
24,7 → 26,8
*/
public UrlStat run(String relativePath) throws ServiceException
{
return DaoFactory.getUrlStatDaoImpl().loadOrNull(relativePath);
String relativePathDigest = BytesUtils.getMD5(relativePath);
return DaoFactory.getUrlStatDaoImpl().loadOrNull(relativePathDigest);
}
 
}
/impl/src/java/pt/estgp/estgweb/services/urlstat/UrlStatService.java
6,11 → 6,14
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.web.filters.UrlStatFilter;
import org.apache.log4j.Logger;
import org.apache.commons.httpclient.util.URIUtil;
import org.apache.commons.httpclient.URIException;
 
import java.util.*;
 
import jomm.dao.impl.AbstractDao;
import jomm.utils.MyCalendar;
import jomm.utils.BytesUtils;
 
/**
* @author Jorge Machado
38,15 → 41,25
Set<Map.Entry<String, UrlStatFilter.IntegerContainer>> set = map.entrySet();
for (Map.Entry<String, UrlStatFilter.IntegerContainer> entry : set)
{
String relativePath = entry.getKey();
// String relativePath = entry.getKey();
String relativePath = BytesUtils.getMD5(entry.getKey());
UrlStatFilter.IntegerContainer ic = entry.getValue();
 
UrlStatImpl urlStat = (UrlStatImpl) DaoFactory.getUrlStatDaoImpl().loadOrNullLockUpgrade(relativePath);
if (urlStat == null)
{
logger.info("url:" + relativePath + " does not exist... creating");
 
urlStat = DomainObjectFactory.createUrlStatImpl();
try
{
urlStat.setName(URIUtil.decode(entry.getKey(),"ISO-8859-1"));
}
catch (URIException e)
{
logger.error(e,e);
}
urlStat.setRelativePath(relativePath);
logger.info("url:" + urlStat.getName() + " does not exist... creating");
urlStat.setStatus(false);
DaoFactory.getUrlStatDaoImpl().save(urlStat);
}
57,7 → 70,7
UrlStatYearImpl urlStatYear = (UrlStatYearImpl) DaoFactory.getUrlStatYearDaoImpl().loadOrNullLockUpgrade(urlStatYearId);
if (urlStatYear == null)
{
logger.info("url:" + relativePath + " first year call does not exist... creating");
logger.info("url:" + urlStat.getName() + " first year call does not exist... creating");
urlStatYear = DomainObjectFactory.createUrlStatYearImpl();
urlStatYear.setId(urlStatYearId);
urlStat.addYear(urlStatYear);
71,7 → 84,7
UrlStatMonthImpl urlStatMonth = (UrlStatMonthImpl) DaoFactory.getUrlStatMonthDaoImpl().loadOrNullLockUpgrade(urlStatMonthId);
if (urlStatMonth == null)
{
logger.info("url:" + relativePath + " first month call does not exist... creating");
logger.info("url:" + urlStat.getName() + " first month call does not exist... creating");
urlStatMonth = DomainObjectFactory.createUrlStatMonthImpl();
urlStatMonth.setId(urlStatMonthId);
urlStatMonth.setDate(new MyCalendar(year, month, 1).getTime());
85,7 → 98,7
UrlStatDayImpl urlStatDay = (UrlStatDayImpl) DaoFactory.getUrlStatDayDaoImpl().loadOrNullLockUpgrade(urlStatDayId);
if (urlStatDay == null)
{
logger.info("url:" + relativePath + " first day call does not exist... creating");
logger.info("url:" + urlStat.getName() + " first day call does not exist... creating");
urlStatDay = DomainObjectFactory.createUrlStatDayImpl();
UrlStatDayId urlStatDayId2 = new UrlStatDayId();
urlStatDayId2.setDay(day);
/impl/src/java/pt/estgp/estgweb/services/urlstat/ResetRelativePathsServiceDigests.java
New file
0,0 → 1,61
package pt.estgp.estgweb.services.urlstat;
 
import pt.utl.ist.berserk.logic.serviceManager.IService;
import pt.estgp.estgweb.services.expceptions.ServiceException;
import org.apache.log4j.Logger;
import org.apache.commons.httpclient.URIException;
import org.apache.commons.httpclient.util.URIUtil;
 
import java.sql.SQLException;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
 
import jomm.dao.impl.AbstractDao;
import jomm.utils.BytesUtils;
 
/**
* @author Jorge Machado
* @date 15/Mar/2008
* @time 6:55:38
* @see pt.estgp.estgweb.services.urlstat
*/
public class ResetRelativePathsServiceDigests implements IService
{
private static final Logger logger = Logger.getLogger(ResetRelativePathsServiceDigests.class);
 
 
public static void main(String[] args) throws ServiceException, URIException, SQLException
{
 
AbstractDao.getCurrentSession().beginTransaction();
PreparedStatement ps = AbstractDao.getCurrentSession().connection().prepareStatement("select relativePath from urlstat");
ResultSet rs = ps.executeQuery();
while(rs.next())
{
PreparedStatement ps1 = AbstractDao.getCurrentSession().connection().prepareStatement("update urlstat set relativePath = ? where relativePath=?");
String relativePath = rs.getString("relativePath");
String encoded= BytesUtils.getMD5(relativePath);
ps1.setString(1,encoded);
ps1.setString(2,relativePath);
ps1.executeUpdate();
ps1.close();
ps1 = AbstractDao.getCurrentSession().connection().prepareStatement("update urlstatday set relativePath = ? where relativePath=?");
ps1.setString(1,encoded);
ps1.setString(2,relativePath);
ps1.executeUpdate();
ps1.close();
ps1 = AbstractDao.getCurrentSession().connection().prepareStatement("update urlstatmonth set relativePath = ? where relativePath=?");
ps1.setString(1,encoded);
ps1.setString(2,relativePath);
ps1.executeUpdate();
ps1.close();
ps1 = AbstractDao.getCurrentSession().connection().prepareStatement("update urlstatyear set relativePath = ? where relativePath=?");
ps1.setString(1,encoded);
ps1.setString(2,relativePath);
ps1.executeUpdate();
ps1.close();
}
AbstractDao.getCurrentSession().getTransaction().commit();
}
 
}
/impl/src/java/pt/estgp/estgweb/services/urlstat/ChartBuilderService.java
21,6 → 21,7
import pt.estgp.estgweb.services.expceptions.ServiceException;
import pt.estgp.estgweb.Globals;
import jomm.utils.DatesUtils;
import jomm.utils.BytesUtils;
import jomm.dao.impl.AbstractDao;
import jomm.web.utils.TestHttpServletRequest;
import pt.utl.ist.berserk.logic.serviceManager.IService;
117,7 → 118,7
{
try
{
relativePath = URIUtil.encodeWithinQuery(relativePath,"ISO-8859-1");
relativePath = BytesUtils.getMD5(URIUtil.encodeWithinQuery(relativePath,"ISO-8859-1"));
}
catch (URIException e)
{
/impl/src/java/pt/estgp/estgweb/services/profile/ProfileCommonServices.java
28,7 → 28,7
* <p/>
* Created at 17/Out/2003 , 23:45:24
*/
public class ProfileCommonServices implements IService, IModuleCommonServices
public class ProfileCommonServices extends SingleSearchResults implements IService, IModuleCommonServices
{
private static final Logger logger = Logger.getLogger(ProfileCommonServices.class);
 
/impl/src/java/pt/estgp/estgweb/services/expceptions/AlreadyExistsException.java
3,6 → 3,7
 
public class AlreadyExistsException extends ServiceException
{
public static final String ALREADY_EXISTS_COURSE = "course";
public static final String ALREADY_EXISTS_USERNAME = "username";
public static final String ALREADY_EXISTS_EMAIL = "email";
 
/impl/src/java/pt/estgp/estgweb/services/blogs/BlogsCommonServices.java
30,7 → 30,7
* Created at 17/Out/2003 , 23:45:24
*
*/
public class BlogsCommonServices implements IService, IModuleCommonServices
public class BlogsCommonServices extends SingleSearchResults implements IService, IModuleCommonServices
{
private static final Logger logger = Logger.getLogger(BlogsCommonServices.class);
 
/impl/src/java/pt/estgp/estgweb/services/blogs/BlogPostsCommonServices.java
28,7 → 28,7
* <p/>
* Created at 17/Out/2003 , 23:45:24
*/
public class BlogPostsCommonServices implements IService, IModuleCommonServices
public class BlogPostsCommonServices extends SingleSearchResults implements IService, IModuleCommonServices
{
private static final Logger logger = Logger.getLogger(BlogPostsCommonServices.class);
 
/impl/src/java/pt/estgp/estgweb/services/announcements/TodoAnnouncementsCommonServices.java
21,7 → 21,7
* @time 18:01:54
* @see pt.estgp.estgweb.web
*/
public class TodoAnnouncementsCommonServices implements IService, IModuleCommonServices
public class TodoAnnouncementsCommonServices extends SingleSearchResults implements IService, IModuleCommonServices
{
 
private static final Logger logger = Logger.getLogger(TodoAnnouncementsCommonServices.class);
/impl/src/java/pt/estgp/estgweb/services/announcements/AnnouncementsCommonServices.java
21,7 → 21,7
* @time 18:01:54
* @see pt.estgp.estgweb.web
*/
public class AnnouncementsCommonServices implements IService, IModuleCommonServices
public class AnnouncementsCommonServices extends SingleSearchResults implements IService, IModuleCommonServices
{
 
private static final Logger logger = Logger.getLogger(AnnouncementsCommonServices.class);
75,6 → 75,8
return searchResults;
}
 
 
 
public int countToDo(UserSession userSession)
{
return 0; //todo To change body of implemented methods use File | Settings | File Templates.
/impl/src/java/pt/estgp/estgweb/services/srusources/LoadSruSourceByIdService.java
New file
0,0 → 1,28
package pt.estgp.estgweb.services.srusources;
 
import pt.utl.ist.berserk.logic.serviceManager.IService;
import pt.estgp.estgweb.services.profile.LoadUserByIdService;
import pt.estgp.estgweb.domain.views.UserView;
import pt.estgp.estgweb.domain.views.SruSourceView;
import pt.estgp.estgweb.domain.UserSession;
import pt.estgp.estgweb.domain.User;
import pt.estgp.estgweb.domain.SruSource;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import org.apache.log4j.Logger;
 
import java.io.Serializable;
 
public class LoadSruSourceByIdService implements IService {
 
private static final Logger logger = Logger.getLogger(LoadSruSourceByIdService.class);
 
 
 
public SruSourceView run(Serializable id, UserSession userSession)
{
SruSource sruSource = DaoFactory.getSruSourceDaoImpl().load(id);
SruSourceView sruSourceView = new SruSourceView(sruSource,sruSource.getCollections());
logger.info("Loading srusource view:" + sruSourceView.getId());
return sruSourceView;
}
}
/impl/src/java/pt/estgp/estgweb/services/srusources/SruSourcesCommonServices.java
New file
0,0 → 1,228
package pt.estgp.estgweb.services.srusources;
 
import pt.utl.ist.berserk.logic.serviceManager.IService;
import pt.estgp.estgweb.services.common.*;
import pt.estgp.estgweb.services.common.impl.DefaultSearchResults;
import pt.estgp.estgweb.services.common.impl.DefaultResult;
import pt.estgp.estgweb.services.common.impl.DefaultToDo;
import pt.estgp.estgweb.services.courseunits.CourseUnitsCommonServices;
import pt.estgp.estgweb.domain.*;
import pt.estgp.estgweb.domain.views.SruSourceView;
import pt.estgp.estgweb.domain.views.SruSourceCollectionView;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.utils.RoleManager;
import pt.estgp.estgweb.utils.Dom4jUtil;
import org.apache.log4j.Logger;
import org.dom4j.DocumentException;
import org.dom4j.Document;
import org.dom4j.XPath;
import org.dom4j.Element;
 
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.net.URLEncoder;
import java.net.URL;
import java.net.MalformedURLException;
import java.io.UnsupportedEncodingException;
 
/*
* @author Goncalo Luiz gedl [AT] rnl [DOT] ist [DOT] utl [DOT] pt
*
*
* Created at 17/Out/2003 , 23:45:24
*
*/
/**
* @author Jorge Machado
* <p/>
* <p/>
* Created at 17/Out/2003 , 23:45:24
*/
public class SruSourcesCommonServices extends MultipleSearchResults implements IService, IModuleCommonServices
{
 
private static final Logger logger = Logger.getLogger(SruSourcesCommonServices.class);
 
 
public int countSearch(String search, SearchTypeEnum searchType, UserSession userSession)
{
return 0;
}
 
public List<ISearchResults> searchList(String moduleInternalKey, String search, SearchTypeEnum searchType, int page, int maxResults, UserSession userSession)
{
return searchList(moduleInternalKey, null, search, searchType, page, maxResults, userSession);
}
 
public List<ISearchResults> searchList(String moduleInternalKey, String from, String search, SearchTypeEnum searchType, int page, int maxResults, UserSession userSession)
{
List<ISearchResults> searchResults = new ArrayList<ISearchResults>();
 
if(userSession.getUser() == null)
return searchResults;
 
//obtain source, in case of internal key means hat we are in the presence of a page search
List<SruSource> sruSources;
List<SruSourceView> admitedSources;
if(moduleInternalKey == null)
{
sruSources = DaoFactory.getSruSourceDaoImpl().findAll();
}
else
{
long sourceId = Long.parseLong(moduleInternalKey);
SruSource sruSource = DaoFactory.getSruSourceDaoImpl().load(sourceId);
sruSources = new ArrayList<SruSource>();
sruSources.add(sruSource);
}
 
//filtering the admited sources
admitedSources = new ArrayList<SruSourceView>();
for(SruSource source: sruSources)
{
List<SruSourceCollection> admitedCollections = new ArrayList<SruSourceCollection>();
 
for(SruSourceCollection sruSourceCollection : source.getCollections())
{
if(sruSourceCollection.getAdmitedRoles() == null || sruSourceCollection.getAdmitedRoles().trim().length() == 0 || RoleManager.hasRole(userSession.getUser(), RoleManager.getRolesFromSerial(sruSourceCollection.getAdmitedRoles())))
{
admitedCollections.add(sruSourceCollection);
}
}
if(admitedCollections.size() > 0)
{
SruSourceView sruSourceView = new SruSourceView(source,admitedCollections);
admitedSources.add(sruSourceView);
}
}
 
if(admitedSources.size() > 0)
{
for(SruSourceView sruSourceView: admitedSources)
{
DefaultSearchResults searchResultsSource = new DefaultSearchResults();
searchResultsSource.setResults(new ArrayList<IResult>());
searchResultsSource.setModuleInternalKey("" + sruSourceView.getId());
searchResultsSource.setModule(ModuleEnum.SruSource);
searchResultsSource.setDescription(sruSourceView.getName());
try
{
StringBuilder collectionQuery = new StringBuilder();
String appender = "";
for(SruSourceCollectionView collectionView: sruSourceView.getCollections())
{
collectionQuery.append(appender).append(collectionView.getCollection());
appender = " OR ";
}
String finalQuery = sruSourceView.getCollectionField() + ":(" + collectionQuery.toString() + ") AND (" + search + ")";
logger.error("Sru server " + sruSourceView.getName() + " final query: " + finalQuery);
String sruRequest = sruSourceView.getUrl() + "?query=" + URLEncoder.encode(finalQuery,"UTF-8") + "&verb=getSRUResponseWithThisQuery&startRecord=" + page + "&maximumRecords=" + maxResults;
URL url = new URL(sruRequest);
Document dom = Dom4jUtil.parse(url);
 
Map<String,String> namespaces = new HashMap<String,String>();
namespaces.put("files","http://www.estgp.pt/sru/solrFilesManager");
namespaces.put("srw","http://www.loc.gov/zing/srw/");
 
XPath xPathNumberOfRecords = dom.createXPath("//srw:numberOfRecords");
xPathNumberOfRecords.setNamespaceURIs(namespaces);
Element numberOfRecords = (Element) xPathNumberOfRecords.selectSingleNode(dom);
if(numberOfRecords == null)
return searchResults;
searchResultsSource.setTotalResults(Integer.parseInt(numberOfRecords.getTextTrim()));
 
XPath xPathRecords = dom.createXPath("//files:doc");
xPathRecords.setNamespaceURIs(namespaces);
List<Element> docs = xPathRecords.selectNodes(dom);
for(Element doc: docs)
{
XPath xPathFileRelativePath = dom.createXPath("./files:fileRelativePath");
xPathFileRelativePath.setNamespaceURIs(namespaces);
Object fileRelativePath = xPathFileRelativePath.selectSingleNode(doc);
if(fileRelativePath != null )
{
XPath xPathFileUrl = dom.createXPath("./files:url");
xPathFileUrl.setNamespaceURIs(namespaces);
Object fileUrl = xPathFileUrl.selectSingleNode(doc);
if(fileUrl != null)
{
 
DefaultResult defaultResult = new DefaultResult();
defaultResult.setTitle(((Element)fileRelativePath).getText());
// defaultResult.setSubTitle(courseUnit.getCourseName());
// defaultResult.setSubTitleKey(false);
// defaultResult.setText(courseUnit.getObjectives());
defaultResult.setUrl(((Element)fileUrl).getTextTrim());
defaultResult.setAbsoluteUrl(true);
 
XPath xPathCollection = dom.createXPath("./files:collection");
xPathFileUrl.setNamespaceURIs(namespaces);
Element collection = (Element) xPathCollection.selectSingleNode(doc);
defaultResult.setSubTitle(collection.getTextTrim());
 
 
XPath xPathFragment = dom.createXPath("./files:snippet/files:fragment");
xPathFragment.setNamespaceURIs(namespaces);
List<Element> fragments = (List<Element>) xPathFragment.selectNodes(doc);
if(fragments != null)
{
defaultResult.setBestFragments("");
for(Element fragment: fragments)
{
defaultResult.setBestFragments(defaultResult.getBestFragments() + " ... " + fragment.getTextTrim().replace("<em>","<b><i>").replace("</em>","</i></b>"));
}
}
searchResultsSource.addResult(defaultResult);
}
else
logger.warn("File retured from SRU without filePath query:" + search + " page:" + page + " path:" + ((Element)fileRelativePath).getText() );
}
else
logger.warn("File retured from SRU without filePath query:" + search + " page:" + page);
}
 
}
catch (Throwable e)
{
logger.error(e,e);
}
 
if(searchResultsSource.getResults() != null && searchResultsSource.getResults().size() > 0)
searchResults.add(searchResultsSource);
}
}
return searchResults;
}
 
 
 
 
 
 
public int countToDo(UserSession userSession)
{
return 0;
}
 
public IToDoCat getToDo(UserSession userSession)
{
return null;
}
 
public List<IToDo> getAllToDos(UserSession userSession)
{
return null;
}/*This method is invoked from object creation*/
 
public void adviseNew(DomainObject object)
{
//To change body of implemented methods use File | Settings | File Templates.
}
 
public void adviseUpdate(DomainObject object)
{
//To change body of implemented methods use File | Settings | File Templates.
}
}
/impl/src/java/pt/estgp/estgweb/services/srusources/SruSourceService.java
New file
0,0 → 1,114
package pt.estgp.estgweb.services.srusources;
 
import pt.utl.ist.berserk.logic.serviceManager.IService;
import pt.estgp.estgweb.services.data.RepositoryService;
import pt.estgp.estgweb.services.expceptions.ServiceException;
import pt.estgp.estgweb.domain.views.CourseView;
import pt.estgp.estgweb.domain.views.SruSourceView;
import pt.estgp.estgweb.domain.views.SruSourceCollectionView;
import pt.estgp.estgweb.domain.*;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import org.apache.log4j.Logger;
 
import java.util.HashSet;
import java.util.List;
import java.util.ArrayList;
 
/*
* @author Goncalo Luiz gedl [AT] rnl [DOT] ist [DOT] utl [DOT] pt
*
*
* Created at 17/Out/2003 , 23:45:24
*
*/
/**
* @author Jorge Machado
*
*
* Created at 17/Out/2003 , 23:45:24
*
*/
public class SruSourceService implements IService
{
 
private static final Logger logger = Logger.getLogger(SruSourceService.class);
 
 
 
public SruSourceView submit(SruSourceView sruSourceView, UserSession userSession) throws ServiceException
{
if(sruSourceView.getId() <= 0)
{
logger.info("Creating new SRU Source with URL: " + sruSourceView.getUrl());
 
SruSource sruSource = DomainObjectFactory.createSruSourceImpl();
sruSourceView.persistViewInObject(sruSource);
sruSource.setCreator(userSession.getUser());
DaoFactory.getSruSourceDaoImpl().save(sruSource);
if(sruSourceView.getCollections() != null)
{
addNewCollections(sruSource,sruSourceView);
}
}
else
{
SruSource sruSource = DaoFactory.getSruSourceDaoImpl().load(sruSourceView.getId());
sruSourceView.persistViewInObject(sruSource);
if(sruSourceView.getCollections() != null)
{
if(sruSource.getCollections() == null || sruSource.getCollections().size() == 0)
{
addNewCollections(sruSource,sruSourceView);
}
else
{
List<SruSourceCollectionView> toAdd = new ArrayList<SruSourceCollectionView>(sruSourceView.getCollections());
List<SruSourceCollection> toRemove = new ArrayList<SruSourceCollection>();
for(SruSourceCollection collection: sruSource.getCollections())
{
boolean found = false;
for(SruSourceCollectionView collectionView: sruSourceView.getCollections())
{
if(collectionView.getId() == collection.getId() || collectionView.getCollection().equals(collection.getCollection()))
{
collectionView.persistViewInObject(collection);
toAdd.remove(collectionView);
found = true;
break;
}
}
if(!found)
{
toRemove.add(collection);
}
}
sruSource.getCollections().removeAll(toRemove);
DaoFactory.getSruSourceCollectionDaoImpl().delete(toRemove);
for(SruSourceCollectionView collectionView: toAdd)
{
addNewCollection(sruSource,collectionView);
}
}
}
}
return sruSourceView;
}
 
private void addNewCollections(SruSource sruSource, SruSourceView sruSourceView)
{
sruSource.setCollections(new HashSet<SruSourceCollection>());
for(SruSourceCollectionView collectionView: sruSourceView.getCollections())
{
addNewCollection(sruSource,collectionView);
}
}
 
private void addNewCollection(SruSource sruSource, SruSourceCollectionView collectionView)
{
SruSourceCollection collection = DomainObjectFactory.createSruSourceCollectionImpl();
collectionView.persistViewInObject(collection);
collection.setSruSource(sruSource);
sruSource.getCollections().add(collection);
DaoFactory.getSruSourceCollectionDaoImpl().save(collection);
}
}
/impl/src/java/pt/estgp/estgweb/services/srusources/DeleteSruSourceService.java
New file
0,0 → 1,26
package pt.estgp.estgweb.services.srusources;
 
import pt.utl.ist.berserk.logic.serviceManager.IService;
import pt.estgp.estgweb.domain.views.SruSourceView;
import pt.estgp.estgweb.domain.UserSession;
import pt.estgp.estgweb.domain.SruSource;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import org.apache.log4j.Logger;
 
import java.io.Serializable;
 
public class DeleteSruSourceService implements IService {
 
private static final Logger logger = Logger.getLogger(DeleteSruSourceService.class);
 
 
 
public Boolean run(Serializable id, UserSession userSession)
{
SruSource sruSource = DaoFactory.getSruSourceDaoImpl().load(id);
 
logger.warn("Deleting srusource view:" + sruSource.getId() + " url:" + sruSource.getUrl());
DaoFactory.getSruSourceDaoImpl().delete(sruSource);
return true;
}
}
/impl/src/java/pt/estgp/estgweb/services/srusources/LoadSruSourcesService.java
New file
0,0 → 1,34
package pt.estgp.estgweb.services.srusources;
 
import pt.utl.ist.berserk.logic.serviceManager.IService;
import pt.estgp.estgweb.domain.views.SruSourceView;
import pt.estgp.estgweb.domain.UserSession;
import pt.estgp.estgweb.domain.SruSource;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import org.apache.log4j.Logger;
 
import java.io.Serializable;
import java.util.List;
import java.util.ArrayList;
 
public class LoadSruSourcesService implements IService {
 
private static final Logger logger = Logger.getLogger(LoadSruSourcesService.class);
 
 
 
public List<SruSourceView> run(UserSession userSession)
{
List<SruSourceView> sruSourceViews = new ArrayList<SruSourceView>();
List<SruSource> sruSources = DaoFactory.getSruSourceDaoImpl().findAll();
if(sruSources == null || sruSources.size() == 0)
return sruSourceViews;
logger.debug("Loading all srusource views:");
for(SruSource sruSource: sruSources)
{
SruSourceView sruSourceView = new SruSourceView(sruSource,sruSource.getCollections());
sruSourceViews.add(sruSourceView);
}
return sruSourceViews;
}
}
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/SruSourceDaoImpl.java
New file
0,0 → 1,35
package pt.estgp.estgweb.domain.dao.impl;
 
import pt.estgp.estgweb.services.common.SearchTypeEnum;
import pt.estgp.estgweb.domain.dao.DaoUtils;
import pt.estgp.estgweb.domain.SruSource;
import pt.estgp.estgweb.domain.User;
import pt.estgp.estgweb.domain.GenericUser;
import pt.estgp.estgweb.domain.SruSourceCollection;
import pt.estgp.estgweb.domain.views.SruSourceView;
import pt.estgp.estgweb.utils.DatesUtils;
import pt.estgp.estgweb.utils.StringsUtils;
import pt.estgp.estgweb.utils.RoleManager;
import org.hibernate.criterion.Criterion;
import static org.hibernate.criterion.Restrictions.eq;
import org.hibernate.Criteria;
 
import java.util.List;
import java.util.ArrayList;
 
/**
* @author Jorge Machado
* @date 13/Nov/2009
* @time 12:22:38
* @email machadofisher@gmail.com
*/
public class SruSourceDaoImpl extends SruSourceDao
{
public static SruSourceDaoImpl getInstance()
{
if (myInstance == null)
myInstance = new SruSourceDaoImpl();
return (SruSourceDaoImpl) myInstance;
}
 
}
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/CourseDaoImpl.java
34,6 → 34,12
return (CourseImpl) createCriteria().add(eq("code", code)).uniqueResult();
}
 
public CourseImpl findCourseByCodeAndYear(String code, String year)
{
return (CourseImpl) createCriteria().add(eq("code", code)).add(eq("importYear", year)).uniqueResult();
}
 
 
public int countCoursesActualYear(String query, SearchTypeEnum searchType)
{
Criterion c = DaoUtils.createSearchQuery(query, searchType, "name", "description");
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/CourseUnitDeliverableDaoImpl.java
2,6 → 2,7
 
import org.hibernate.Query;
import static org.hibernate.criterion.Restrictions.*;
import org.hibernate.criterion.Order;
import pt.estgp.estgweb.domain.CourseUnitDeliverable;
 
/**
41,7 → 42,10
(CourseUnitDeliverable)
createCriteria()
.add(eq("courseUnitAssignement.id",workId))
.add(eq("student.id",studentId)).uniqueResult();
.add(eq("student.id",studentId))
.addOrder(Order.desc("deliverDate"))
.setMaxResults(1)
.uniqueResult();
}
 
public CourseUnitDeliverable loadDeliverableByRepositoryId(String repositoryStreamId)
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/CourseUnitDaoImpl.java
176,7 → 176,17
.add(eq("importYear", year))
.uniqueResult();
}
public List<CourseUnit> loadBySigesCodes(String sigesCode, String courseCode)
{
return (List<CourseUnit>) createCriteria()
.add(eq("code", sigesCode))
.add(eq("courseCode", courseCode))
.addOrder(Order.desc("importYear"))
.list();
}
 
 
 
public List<CourseUnit> loadCourseUnits(long courseId, String semestre, String year, boolean withTeacher, boolean withNoTeacher)
{
Criteria c = createCriteria();
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/SruSourceCollectionDaoImpl.java
New file
0,0 → 1,27
package pt.estgp.estgweb.domain.dao.impl;
 
import pt.estgp.estgweb.domain.SruSource;
import pt.estgp.estgweb.domain.GenericUser;
import pt.estgp.estgweb.utils.RoleManager;
 
import java.util.List;
import java.util.ArrayList;
 
import org.hibernate.Criteria;
 
/**
* @author Jorge Machado
* @date 13/Nov/2009
* @time 12:22:38
* @email machadofisher@gmail.com
*/
public class SruSourceCollectionDaoImpl extends SruSourceCollectionDao
{
public static SruSourceCollectionDaoImpl getInstance()
{
if (myInstance == null)
myInstance = new SruSourceCollectionDaoImpl();
return (SruSourceCollectionDaoImpl) myInstance;
}
 
}
/impl/src/java/pt/estgp/estgweb/domain/dao/DaoFactory.java
187,4 → 187,14
{
return RepositoryFileVersionDaoImpl.getInstance();
}
 
public static SruSourceDaoImpl getSruSourceDaoImpl()
{
return SruSourceDaoImpl.getInstance();
}
 
public static SruSourceCollectionDaoImpl getSruSourceCollectionDaoImpl()
{
return SruSourceCollectionDaoImpl.getInstance();
}
}
/impl/src/java/pt/estgp/estgweb/domain/SruSourceCollectionImpl.java
New file
0,0 → 1,17
package pt.estgp.estgweb.domain;
 
import java.io.Serializable;
 
/**
* @author Jorge Machado
* @date 13/Nov/2009
* @time 12:20:53
* @email machadofisher@gmail.com
*/
public class SruSourceCollectionImpl extends SruSourceCollection
{
public Serializable getSerializable()
{
return getId();
}
}
/impl/src/java/pt/estgp/estgweb/domain/SruSourceImpl.java
New file
0,0 → 1,17
package pt.estgp.estgweb.domain;
 
import java.io.Serializable;
 
/**
* @author Jorge Machado
* @date 13/Nov/2009
* @time 12:20:53
* @email machadofisher@gmail.com
*/
public class SruSourceImpl extends SruSource
{
public Serializable getSerializable()
{
return getId();
}
}
/impl/src/java/pt/estgp/estgweb/domain/views/SruSourceCollectionView.java
New file
0,0 → 1,124
package pt.estgp.estgweb.domain.views;
 
import pt.estgp.estgweb.domain.SruSourceCollection;
import pt.estgp.estgweb.utils.RoleManager;
 
import java.io.Serializable;
import java.util.*;
 
/**
* @author Jorge Machado
* @date 2/Mar/2008
* @time 19:34:49
* @see pt.estgp.estgweb.domain.views
*/
public class SruSourceCollectionView extends DomainObjectView
{
// private static final Logger logger = Logger.getLogger(SruSourceCollectionView.class);
 
 
private long id;
private Date updateDate;
private Date saveDate;
private String collection;
private String admitedRoles;
private SruSourceView sruSourceView;
 
 
public Class getReferenceClass()
{
return SruSourceCollection.class;
}
 
public Serializable getSerializable()
{
return id;
}
 
public SruSourceCollectionView() {
}
 
public SruSourceCollectionView(SruSourceCollection sruSourceCollection, SruSourceView sruSourceView)
{
super(sruSourceCollection);
init(sruSourceCollection,sruSourceView);
}
 
 
private void init(SruSourceCollection sruSourceCollection,SruSourceView sruSourceView)
{
this.id = sruSourceCollection.getId();
this.collection = sruSourceCollection.getCollection();
this.saveDate = sruSourceCollection.getSaveDate();
this.updateDate = sruSourceCollection.getUpdateDate();
this.admitedRoles = sruSourceCollection.getAdmitedRoles();
this.sruSourceView = sruSourceView;
}
 
public void persistViewInObject(SruSourceCollection c)
{
c.setAdmitedRoles(admitedRoles);
c.setCollection(collection);
}
 
 
public long getId()
{
return id;
}
 
public void setId(long id)
{
this.id = id;
}
 
 
public Date getUpdateDate() {
return updateDate;
}
 
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
 
public Date getSaveDate() {
return saveDate;
}
 
public void setSaveDate(Date saveDate) {
this.saveDate = saveDate;
}
 
public String getCollection() {
return collection;
}
 
public void setCollection(String collection) {
this.collection = collection;
}
 
public String getAdmitedRoles() {
return admitedRoles;
}
 
public void setAdmitedRoles(String admitedRoles) {
this.admitedRoles = admitedRoles;
}
 
public SruSourceView getSruSourceView() {
return sruSourceView;
}
 
public void setSruSourceView(SruSourceView sruSourceView) {
this.sruSourceView = sruSourceView;
}
 
 
public List<String> getAdmitedRolesSet()
{
if(admitedRoles != null && admitedRoles.trim().length() > 0)
return RoleManager.getRolesFromSerial(admitedRoles);
else
return new ArrayList<String>();
}
}
/impl/src/java/pt/estgp/estgweb/domain/views/UserView.java
56,6 → 56,9
private String scholarDegree;
private String academicDegree;
 
//This field should be set true when a user View is representing a deleted user
private boolean deleted = false;
 
private List<RecordView> creatorRecords;
private List<RecordView> contributorRecords;
 
69,6 → 72,11
public UserView(User user)
{
super(user);
if(user == null)
{
this.deleted = true;
return;
}
this.user = user;
this.id = user.getId();
this.name=user.getName();
339,7 → 347,12
}
 
public String getName() {
return name;
if(deleted)
{
return "(Apagado do Sistema) " + name;
}
else
return name;
}
 
public void setName(String name) {
624,6 → 637,16
this.ext = ext;
}
 
public boolean isDeleted()
{
return deleted;
}
 
public void setDeleted(boolean deleted)
{
this.deleted = deleted;
}
 
// public List<Course> getCourses()
// {
// if(courses == null)
/impl/src/java/pt/estgp/estgweb/domain/views/SruSourceView.java
New file
0,0 → 1,166
package pt.estgp.estgweb.domain.views;
 
import pt.estgp.estgweb.domain.Course;
import pt.estgp.estgweb.domain.SruSource;
import pt.estgp.estgweb.domain.SruSourceCollection;
 
import java.io.Serializable;
import java.util.*;
 
/**
* @author Jorge Machado
* @date 2/Mar/2008
* @time 19:34:49
* @see pt.estgp.estgweb.domain.views
*/
public class SruSourceView extends DomainObjectView
{
// private static final Logger logger = Logger.getLogger(SruSourceView.class);
 
private long id;
private Date updateDate;
private Date saveDate;
private String name;
private String collectionField;
private String description;
private String url;
private String metadataSchema;
private UserView creator;
private List<SruSourceCollectionView> collections = new ArrayList<SruSourceCollectionView>();
 
 
public Class getReferenceClass()
{
return SruSource.class;
}
 
public Serializable getSerializable()
{
return id;
}
 
public SruSourceView()
{
}
 
public SruSourceView(SruSource sruSource, Collection<SruSourceCollection> collections)
{
super(sruSource);
init(sruSource,collections);
 
}
private void init(SruSource sruSource, Collection<SruSourceCollection> collections)
{
 
this.id = sruSource.getId();
this.saveDate = sruSource.getSaveDate();
this.updateDate = sruSource.getUpdateDate();
this.name = sruSource.getName();
this.collectionField = sruSource.getCollectionField();
this.description = sruSource.getDescription();
this.metadataSchema = sruSource.getMetadataSchema();
this.creator = new UserView(sruSource.getCreator());
this.collections = new ArrayList<SruSourceCollectionView>();
this.url = sruSource.getUrl();
 
for(SruSourceCollection collection: collections)
{
SruSourceCollectionView sruSourceCollectionView = new SruSourceCollectionView(collection,this);
this.collections.add(sruSourceCollectionView);
}
}
 
public void persistViewInObject(SruSource s)
{
s.setDescription(description);
s.setMetadataSchema(metadataSchema);
s.setCollectionField(collectionField);
s.setName(name);
s.setUrl(url);
}
 
 
public long getId()
{
return id;
}
 
public void setId(long id)
{
this.id = id;
}
 
 
public Date getUpdateDate() {
return updateDate;
}
 
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
 
public Date getSaveDate() {
return saveDate;
}
 
public void setSaveDate(Date saveDate) {
this.saveDate = saveDate;
}
 
public String getName() {
return name;
}
 
public void setName(String name) {
this.name = name;
}
 
public String getCollectionField() {
return collectionField;
}
 
public void setCollectionField(String collectionField) {
this.collectionField = collectionField;
}
 
public String getDescription() {
return description;
}
 
public void setDescription(String description) {
this.description = description;
}
 
public String getUrl() {
return url;
}
 
public void setUrl(String url) {
this.url = url;
}
 
public String getMetadataSchema() {
return metadataSchema;
}
 
public void setMetadataSchema(String metadataSchema) {
this.metadataSchema = metadataSchema;
}
 
public UserView getCreator() {
return creator;
}
 
public void setCreator(UserView creator) {
this.creator = creator;
}
 
public List<SruSourceCollectionView> getCollections() {
return collections;
}
 
public void setCollections(List<SruSourceCollectionView> collections) {
this.collections = collections;
}
}
/impl/src/java/pt/estgp/estgweb/domain/views/DomainObjectView.java
33,8 → 33,8
public DomainObjectView(DomainObject obj)
{
this.saveDate = obj.getSaveDate();
 
if(obj != null)
this.saveDate = obj.getSaveDate();
}
 
public String getFormatedSaveDate()
/impl/src/java/pt/estgp/estgweb/domain/views/CourseUnitDeliverableView.java
55,8 → 55,17
this.fileStreamId = courseUnitDeliverable.getDeliverableRepositoryStream();
this.deliverDate = courseUnitDeliverable.getDeliverDate();
this.deliverDateStr = DatesUtils.getStringFromDate(deliverDate);
if(courseUnitDeliverable.getStudent() != null)
this.student = new UserView(courseUnitDeliverable.getStudent());
//if is null will create a userview even if deleted
this.student = new UserView(courseUnitDeliverable.getStudent());
if(this.student.isDeleted() && courseUnitDeliverable.getStudentId() > 0)
{
this.student.setDeleted(true);
this.student.setId(courseUnitDeliverable.getStudentId());
this.student.setUsername(courseUnitDeliverable.getStudentUsername());
this.student.setName(courseUnitDeliverable.getStudentName());
if(courseUnitDeliverable.getStudentCode() != null)
this.student.setCode(Integer.parseInt(courseUnitDeliverable.getStudentCode()));
}
this.courseUnitAssignementView = courseUnitAssignementView;
}
 
/impl/src/java/pt/estgp/estgweb/domain/UrlStatImpl.java
36,17 → 36,17
getYears().add(urlStatYear);
}
 
public String getName()
{
if(super.getName() == null)
try
{
return URIUtil.decode(getRelativePath());
}
catch (URIException e)
{
logger.error(e,e);
}
return super.getName();
}
// public String getName()
// {
// if(super.getName() == null)
// try
// {
// return URIUtil.decode(getRelativePath(),"ISO-8859-1");
// }
// catch (URIException e)
// {
// logger.error(e,e);
// }
// return super.getName();
// }
}
/impl/src/java/pt/estgp/estgweb/domain/DomainObjectFactory.java
200,4 → 200,12
{
return new RepositoryFileVersionImpl();
}
 
public static SruSourceImpl createSruSourceImpl() {
return new SruSourceImpl();
}
 
public static SruSourceCollectionImpl createSruSourceCollectionImpl() {
return new SruSourceCollectionImpl();
}
}
/impl/src/java/pt/estgp/estgweb/filters/filters/CanAddAnnouncementInCourseUnit.java
New file
0,0 → 1,52
package pt.estgp.estgweb.filters.filters;
 
import pt.estgp.estgweb.filters.chains.LoadControlFilter;
import pt.estgp.estgweb.filters.exceptions.NeedAuthenticationException;
import pt.estgp.estgweb.filters.exceptions.AccessDeniedOperationException;
import pt.estgp.estgweb.filters.filters.utils.LoadObjectFromParameters;
import pt.estgp.estgweb.domain.UserSession;
import pt.estgp.estgweb.domain.CourseUnit;
import pt.estgp.estgweb.domain.UserImpl;
import pt.estgp.estgweb.Globals;
import pt.estgp.estgweb.utils.ReflectionBean;
import pt.utl.ist.berserk.ServiceRequest;
import pt.utl.ist.berserk.ServiceResponse;
import pt.utl.ist.berserk.logic.filterManager.FilterParameters;
import pt.utl.ist.berserk.logic.filterManager.exceptions.FilterException;
import org.apache.log4j.Logger;
 
import java.io.Serializable;
 
public class CanAddAnnouncementInCourseUnit extends LoadControlFilter
{
private static final Logger logger = Logger.getLogger(CanAddAnnouncementInCourseUnit.class);
 
public void execute(ServiceRequest request, ServiceResponse response, FilterParameters filterParameters) throws FilterException, Exception
{
 
UserSession userSession = (UserSession) request.getServiceParameters().getParameter(Globals.USER_SESSION_KEY);
 
if(userSession.getUser() == null)
{
logger.info("try access restricted area:" + request.getRequester());
throw new NeedAuthenticationException();
}
 
if(userSession.getUser().isSuperuser())
return;
 
ReflectionBean serializableBean = new ReflectionBean((String) filterParameters.parametersArray()[0]);
Object serializableObjectContainer = request.getServiceParameters().getParameter(serializableBean.getName());
Serializable serializable = (Serializable) serializableBean.invoke(serializableObjectContainer);
if(serializable != null && serializable instanceof Long && ((Long)serializable).intValue() > 0)
{
CourseUnit courseUnit = (CourseUnit) LoadObjectFromParameters.loadObjectFromClassName(CourseUnit.class.getName(),filterParameters,request.getServiceParameters());
 
if(!((UserImpl)userSession.getUser()).isTeacherOfCourseUnit(courseUnit.getId(),true))
{
logger.warn(userSession.getUser().getUsername() + ": try access restricted area");
throw new AccessDeniedOperationException("fail.owner");
}
}
}
}
/impl/src/java/pt/estgp/estgweb/web/ajaxapis/ServicosImpressao.java
New file
0,0 → 1,120
package pt.estgp.estgweb.web.ajaxapis;
 
 
import jomm.utils.StreamsUtils;
import pt.estgp.estgweb.Globals;
import pt.estgp.estgweb.web.UserSessionProxy;
 
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.MalformedURLException;
 
import org.apache.log4j.Logger;
 
/**
* @author Jorge
* @date 24/Mar/2009
* @time 3:25:40
*/
public class ServicosImpressao extends HttpServlet
{
private static final Logger logger = Logger.getLogger(ServicosImpressao.class);
 
protected void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException
{
doPost(httpServletRequest, httpServletResponse);
}
 
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
StringBuffer sbResponse = new StringBuffer();
 
DataOutputStream out;
 
 
try
{
sbResponse = new StringBuffer();
 
java.net.URL programUrl = new java.net.URL(Globals.INTRANET_IMPRESSAO_SERVICO_API + "?username=" + UserSessionProxy.loadUserSession(request,response).getUsername());
 
 
java.net.HttpURLConnection connection = (java.net.HttpURLConnection)programUrl.openConnection();
if(Globals.INTRANET_IMPRESSAO_SERVICO_AUTH)
{
String user = Globals.INTRANET_IMPRESSAO_SERVICO_AUTH_USER;
String pass = Globals.INTRANET_IMPRESSAO_SERVICO_AUTH_PASS;
String encoding = new sun.misc.BASE64Encoder().encode((user + ":" + pass).getBytes());
connection.setRequestProperty ("Authorization", "Basic " + encoding);
}
 
(connection).setRequestMethod("POST");
connection.setDoOutput(true);
connection.setDoInput(true); //Only if you expect to read a response...
connection.setUseCaches(false); //Highly recommended...
connection.setAllowUserInteraction(true);
connection.setFollowRedirects(true);
connection.setInstanceFollowRedirects(true);
connection.setRequestProperty ("Content-Type",
"application/x-www-form-urlencoded");
 
// System.out.println(request.getParameter("request"));
// System.out.println(request.getParameter("showmap"));
 
 
 
// out = new DataOutputStream(connection.getOutputStream());
// String content = "request=" + URLEncoder.encode (request.getParameter("request"))
// + "&showmap=" + URLEncoder.encode (request.getParameter("showmap"));
System.out.println("\n" + "sending form to HTTP server ...");
// out.writeBytes (content);
// out.flush ();
// out.close ();
 
 
// PrintWriter output = new PrintWriter(new OutputStreamWriter(connection.getOutputStream()));
// output.print("request="+ URIUtil.encodeQuery(request.getParameter("request")));
// output.print("&showmap=" + URIUtil.encodeQuery(request.getParameter("showmap")));
// //output.flush();
// output.close();
 
 
BufferedReader rd = new BufferedReader(new InputStreamReader(connection.getInputStream()));
 
String line;
 
while ((line = rd.readLine()) != null)
{
sbResponse.append(line);
}
 
rd.close();
 
} catch (MalformedURLException e)
{
sbResponse.setLength(0);
sbResponse.append(e.getMessage());
e.printStackTrace();
response.sendError(500);
} catch (IOException e)
{
e.printStackTrace();
sbResponse.setLength(0);
sbResponse.append(e.getMessage());
response.sendError(500);
}
catch (Throwable throwable)
{
logger.error(throwable,throwable);
response.sendError(500);
}
 
response.setContentType("text/xml");
PrintWriter pw = new PrintWriter(response.getOutputStream());
pw.write(sbResponse.toString());
pw.close();
}
}
/impl/src/java/pt/estgp/estgweb/web/form/srusource/SruSourceForm.java
New file
0,0 → 1,109
package pt.estgp.estgweb.web.form.srusource;
 
import pt.estgp.estgweb.web.form.AddRolesForm;
import pt.estgp.estgweb.web.utils.DatesUtils;
import pt.estgp.estgweb.domain.views.RecordView;
import pt.estgp.estgweb.domain.views.UserView;
import pt.estgp.estgweb.domain.views.SruSourceView;
import pt.estgp.estgweb.domain.views.SruSourceCollectionView;
import org.apache.struts.upload.FormFile;
import org.apache.struts.action.ActionErrors;
 
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.ArrayList;
 
/**
* @author Fabio
* @date 30/Abr/2008
* @time 17:18:57
* @see pt.estgp.estgweb.web.form.profile
*/
public class SruSourceForm extends AddRolesForm {
 
private SruSourceView sruSourceView = new SruSourceView();
private SruSourceCollectionView sruSourceCollectionView = new SruSourceCollectionView();
private long auxId;
 
 
public SruSourceForm()
{
sruSourceView = new SruSourceView();
}
 
public SruSourceForm(SruSourceView sruSourceView)
{
this.sruSourceView = sruSourceView;
}
 
 
public void reset(org.apache.struts.action.ActionMapping actionMapping, HttpServletRequest request)
{
 
if(request.getParameter("collectionSize") != null)
{
int size = Integer.parseInt(request.getParameter("collectionSize"));
sruSourceView.setCollections(new ArrayList<SruSourceCollectionView>());
for(int i = 0;i < size;i++)
sruSourceView.getCollections().add(new SruSourceCollectionView());
}
}
 
 
public SruSourceView getSruSourceView() {
return sruSourceView;
}
 
public void setSruSourceView(SruSourceView sruSourceView) {
this.sruSourceView = sruSourceView;
}
 
public long getAuxId() {
return auxId;
}
 
public void setAuxId(long auxId) {
this.auxId = auxId;
}
 
public SruSourceCollectionView getSruSourceCollectionView() {
return sruSourceCollectionView;
}
 
public void setSruSourceCollectionView(SruSourceCollectionView sruSourceCollectionView) {
this.sruSourceCollectionView = sruSourceCollectionView;
}
 
public ActionErrors validate(org.apache.struts.action.ActionMapping actionMapping, javax.servlet.http.HttpServletRequest httpServletRequest)
{
ActionErrors errors = new ActionErrors();
if(sruSourceView.getName() == null || sruSourceView.getName().length() == 0)
{
addMessageWithKeys(errors, httpServletRequest, "errors.required","name");
}
if(sruSourceView.getUrl() == null || sruSourceView.getUrl().length() == 0)
{
addMessageWithKeys(errors, httpServletRequest, "errors.required","url");
}
if(sruSourceView.getCollectionField() == null || sruSourceView.getCollectionField().length() == 0)
{
addMessageWithKeys(errors, httpServletRequest, "errors.required","srusource.collectionField");
}
return errors;
}
 
public ActionErrors validateCollection(org.apache.struts.action.ActionMapping actionMapping, javax.servlet.http.HttpServletRequest httpServletRequest)
{
ActionErrors errors = new ActionErrors();
if(sruSourceCollectionView.getCollection() == null || sruSourceCollectionView.getCollection().length() == 0)
{
addMessageWithKeys(errors, httpServletRequest, "errors.required","srusource.collection");
}
if(sruSourceCollectionView.getAdmitedRoles() == null)
{
sruSourceCollectionView.setAdmitedRoles("");
}
 
return errors;
}
}
/impl/src/java/pt/estgp/estgweb/web/controllers/courses/CoursesController.java
9,6 → 9,7
import pt.estgp.estgweb.filters.exceptions.NotFoundException;
import pt.estgp.estgweb.services.courseunits.DirectedCoordinatedCourses;
import pt.estgp.estgweb.services.courseunits.DirectedCoordinatedUnitsService;
import pt.estgp.estgweb.services.expceptions.AlreadyExistsException;
import pt.estgp.estgweb.web.controllers.courseunits.CourseUnitsController;
import pt.estgp.estgweb.web.exceptions.NoCookiesException;
import pt.estgp.estgweb.web.form.courses.CourseForm;
164,6 → 165,20
addMessage(request,"course.created.success","" + cV.getCode());
return mapping.getInputForward();
}
catch (AlreadyExistsException e)
{
addErrorWithKeys(request,"course.exists",e.getMessage());
try
{
load((CourseForm) form,request,response);
return mapping.findForward("submit");
}
catch (Throwable throwable)
{
logger.error(e, e);
return mapping.findForward("error500");
}
}
catch (FilterChainFailedException e)
{
return mapping.findForward("error401");
/impl/src/java/pt/estgp/estgweb/web/controllers/srusource/SruSourceController.java
New file
0,0 → 1,246
package pt.estgp.estgweb.web.controllers.srusource;
 
import pt.estgp.estgweb.web.controllers.AddRolesController;
import pt.estgp.estgweb.web.controllers.profile.ProfileController;
import pt.estgp.estgweb.web.form.AddRolesForm;
import pt.estgp.estgweb.web.form.srusource.SruSourceForm;
import pt.estgp.estgweb.web.form.profile.ProfileForm;
import pt.estgp.estgweb.web.UserSessionProxy;
import pt.estgp.estgweb.web.exceptions.NoCookiesException;
import pt.estgp.estgweb.web.utils.RequestUtils;
import pt.estgp.estgweb.domain.views.UserView;
import pt.estgp.estgweb.domain.views.RecordView;
import pt.estgp.estgweb.domain.views.SruSourceView;
import pt.estgp.estgweb.domain.views.SruSourceCollectionView;
import pt.estgp.estgweb.domain.UserSessionImpl;
import pt.estgp.estgweb.domain.DomainObjectFactory;
import pt.estgp.estgweb.domain.User;
import pt.estgp.estgweb.domain.SruSource;
import pt.estgp.estgweb.services.expceptions.AlreadyExistsException;
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 pt.utl.ist.berserk.logic.serviceManager.exceptions.FilterChainFailedException;
import pt.utl.ist.berserk.logic.serviceManager.exceptions.ServiceManagerException;
import pt.utl.ist.berserk.logic.filterManager.exceptions.InvalidFilterException;
import pt.utl.ist.berserk.logic.filterManager.exceptions.InvalidFilterExpressionException;
import pt.utl.ist.berserk.logic.filterManager.exceptions.IncompatibleFilterException;
import pt.utl.ist.berserk.logic.filterManager.exceptions.FilterRetrieveException;
import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionErrors;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import java.util.List;
import java.util.ArrayList;
import java.util.HashSet;
import java.io.Serializable;
 
/**
* @author Jorge Machado
* @date 26/Fev/2008
* @time 18:01:54
* @see pt.estgp.estgweb.web
*/
public class SruSourceController extends AddRolesController {
 
private static final Logger logger = Logger.getLogger(SruSourceController.class);
private static final String TARGET_ROLES_KEY = AddRolesForm.TARGET_ROLES_KEY;
 
 
public ActionForward editSruSource(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Throwable, ServletException {
SruSourceForm sruSourceForm = (SruSourceForm) form;
ActionErrors errors = sruSourceForm.validate(mapping, request);
if (!errors.isEmpty())
{
// if(sruSourceForm.getSruSourceView().getId() > 0)
// {
// SruSourceView sruSourceView = loadSruSource(sruSourceForm.getSruSourceView().getId(), request, response);
// UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request, response);
// sruSourceForm.setSelectedRoles((List<String>) userSession.get(TARGET_ROLES_KEY));
// }
UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request, response);
sruSourceForm.setSelectedRoles((List<String>) userSession.get(TARGET_ROLES_KEY));
saveMessages(request, errors);
return mapping.getInputForward();
}
SruSourceView sruSourceView = sruSourceForm.getSruSourceView();
// UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request, response);
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{};
Object[] args = new Object[]{sruSourceView};
boolean isNew=false;
if(sruSourceView.getId()<=0 )
isNew = true;
sruSourceView = (SruSourceView) sm.execute(RequestUtils.getRequester(request, response), "SubmitSruSource", args, names);
if(isNew)
addMessage(request, "srusource.created.success");
else
addMessage(request, "srusource.edited.success");
 
return mapping.findForward("success");
}
 
 
 
 
public ActionForward removeCollection(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Throwable, ServletException {
SruSourceForm sruSourceForm = (SruSourceForm) form;
 
UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request, response);
long id = sruSourceForm.getAuxId();
if(sruSourceForm.getSruSourceView().getCollections() != null)
{
for(SruSourceCollectionView collectionView: sruSourceForm.getSruSourceView().getCollections())
{
if(collectionView.getId() == id)
{
sruSourceForm.getSruSourceView().getCollections().remove(collectionView);
sruSourceForm.setSruSourceCollectionView(collectionView);
userSession.remove(TARGET_ROLES_KEY);
userSession.serialize(request,response);
userSession.put(TARGET_ROLES_KEY,((ArrayList<String>)collectionView.getAdmitedRolesSet()));
userSession.serialize(request,response);
sruSourceForm.setSelectedRoles(collectionView.getAdmitedRolesSet());
break;
}
}
}
return mapping.getInputForward();
}
 
 
public ActionForward addSruSourceCollection(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Throwable, ServletException {
SruSourceForm sruSourceForm = (SruSourceForm) form;
ActionErrors errors = sruSourceForm.validateCollection(mapping, request);
if (!errors.isEmpty())
{
UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request, response);
sruSourceForm.setSelectedRoles((List<String>) userSession.get(TARGET_ROLES_KEY));
saveMessages(request, errors);
return mapping.getInputForward();
}
SruSourceView sruSourceView = sruSourceForm.getSruSourceView();
if(sruSourceView.getCollections() == null)
sruSourceView.setCollections(new ArrayList<SruSourceCollectionView>());
SruSourceCollectionView collectionView = sruSourceForm.getSruSourceCollectionView();
 
UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request, response);
collectionView.setAdmitedRoles(RoleManager.getSerialRoles((List<String>) userSession.get(TARGET_ROLES_KEY)));
userSession.remove(TARGET_ROLES_KEY);
userSession.serialize(request,response);
 
sruSourceView.getCollections().add(collectionView);
sruSourceForm.setSruSourceCollectionView(new SruSourceCollectionView());
return mapping.getInputForward();
}
 
 
 
 
 
public ActionForward newSruSource(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Throwable, ServletException
{
try
{
UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request, response);
userSession.put(TARGET_ROLES_KEY,new ArrayList<String>());
userSession.serialize(request, response);
return mapping.findForward("sruSourceData");
}
catch (FilterChainFailedException e)
{
return mapping.findForward("error401");
}
catch (Throwable e)
{
logger.error(e, e);
throw e;
}
}
 
 
 
 
public ActionForward loadSruSource(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Throwable, ServletException {
SruSourceForm sruSourceForm = (SruSourceForm) form;
SruSourceView sruSourceView = loadSruSource(sruSourceForm.getSruSourceView().getId(),request,response);
sruSourceForm.setSruSourceView(sruSourceView);
 
UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request, response);
userSession.remove(TARGET_ROLES_KEY);
userSession.serialize(request,response);
 
return mapping.findForward("loadSruSource");
}
 
 
private SruSourceView loadSruSource(long id, HttpServletRequest request, HttpServletResponse response) throws Throwable, InvalidFilterException, ServiceManagerException, InvalidFilterExpressionException, IncompatibleFilterException, FilterRetrieveException, NoCookiesException {
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{"serializable"};
Object[] args = new Object[]{id};
return (SruSourceView) sm.execute(RequestUtils.getRequester(request, response), "LoadSruSourceById", args, names);
}
 
 
public ActionForward delete(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Throwable, ServletException
{
try
{
 
SruSourceForm sruSourceForm = (SruSourceForm) form;
 
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{"serializable"};
Object[] args = new Object[]{sruSourceForm.getSruSourceView().getId()};
Boolean status = (Boolean) sm.execute(RequestUtils.getRequester(request, response), "DeleteSruSource", args, names);
 
if (status != null && status)
addMessage(request, "srusource.deleted.sucess");
else
addMessage(request, "srusource.deleted.fail");
 
return mapping.findForward("loadSruSources");
}
catch (FilterChainFailedException e)
{
return mapping.findForward("error401");
}
catch (Throwable e)
{
logger.error(e, e);
throw e;
}
}
 
 
}
/impl/src/java/pt/estgp/estgweb/web/controllers/commons/CommonsController.java
76,7 → 76,7
{
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{};
Object[] args = new Object[]{request.getParameter("from"), request.getParameter("query"), SearchTypeEnum.parse(request.getParameter("searchType")), ModuleEnum.parse(request.getParameter("module")), Integer.parseInt(request.getParameter("page"))};
Object[] args = new Object[]{request.getParameter("from"), request.getParameter("query"), SearchTypeEnum.parse(request.getParameter("searchType")), ModuleEnum.parse(request.getParameter("module")),request.getParameter("moduleInternalKey"), Integer.parseInt(request.getParameter("page"))};
ISearchResults searchResults = (ISearchResults) sm.execute(RequestUtils.getRequester(request, response), "CommonServicesSearchModule", args, names);
request.setAttribute("ISearchResults", searchResults);
return mapping.findForward("searchModule");
/impl/src/java/pt/estgp/estgweb/web/filters/UrlStatFilter.java
21,6 → 21,7
import pt.utl.ist.berserk.logic.serviceManager.exceptions.ServiceManagerException;
import pt.utl.ist.berserk.logic.filterManager.exceptions.*;
import jomm.utils.MyCalendar;
import jomm.utils.BytesUtils;
 
/**
* @author Jorge Machado
121,14 → 122,18
}
}
 
logger.info("accessing " + relativePath);
relativePath = URIUtil.encodeWithinQuery(relativePath,"ISO-8859-1");
logger.info("coded to " + relativePath);
if (userSession != null)
{
if (userSession.get(relativePath) != null)
String relativePathDigest = BytesUtils.getMD5(relativePath);
if (userSession.get(relativePathDigest) != null)
{
chain.doFilter(request, response);
return;
}
userSession.put(relativePath, "");
userSession.put(relativePathDigest, "");
try
{
userSession.serialize(hrequest, (HttpServletResponse) response);
140,10 → 145,8
return;
}
}
logger.info("accessing " + relativePath);
relativePath = URIUtil.encodeWithinQuery(relativePath,"ISO-8859-1");
logger.info("coded to " + relativePath);
 
 
IntegerContainer count = urlStat.get(relativePath);
 
if (count == null)
/impl/src/doc/bacoCandidaturaBoasPraticas.doc
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/impl/src/doc/estgweb.eap
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/impl/src/doc/baco.ppt
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/impl/src/doc/Programas0910.doc
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/impl/src/updates/db/update3.sql
New file
0,0 → 1,2
 
ALTER TABLE `courseunitdeliverable` ADD COLUMN `studentId` BIGINT(20) NOT NULL default '0' AFTER `obs` , ADD COLUMN `studentUsername` VARCHAR(255) AFTER `studentId`, ADD COLUMN `studentCode` VARCHAR(255) AFTER `studentUsername`, ADD COLUMN `studentName` VARCHAR(255) AFTER `studentCode`, ADD INDEX `studentUsernameIndex`(`studentUsername`), ADD INDEX `studentNameIndex`(`studentName`), ADD INDEX `studentCodeIndex`(`studentCode`);
/impl/src/updates/db/update4.sql
New file
0,0 → 1,0
ALTER TABLE `urlstat` MODIFY COLUMN `name` TEXT DEFAULT NULL;
/impl/src/updates/db/update5.sql
New file
0,0 → 1,30
DROP TABLE IF EXISTS `sru_source`;
CREATE TABLE `sru_source` (
`id` bigint(20) NOT NULL auto_increment,
`discrimitator` varchar(255) NOT NULL,
`updateDate` datetime NOT NULL,
`saveDate` datetime default NULL,
`name` varchar(255) default NULL,
`collection_field` varchar(255) default NULL,
`description` text,
`url` varchar(255) default NULL,
`metadata_schema` varchar(255) default NULL,
`creator` bigint(20) default NULL,
PRIMARY KEY (`id`),
KEY `creatorFK` (`creator`),
CONSTRAINT `creatorFK` FOREIGN KEY (`creator`) REFERENCES `user` (`id`)
) ENGINE=Innodb DEFAULT CHARSET=latin1;
 
DROP TABLE IF EXISTS `sru_source_collection`;
CREATE TABLE `sru_source_collection` (
`id` bigint(20) NOT NULL auto_increment,
`discrimitator` varchar(255) NOT NULL,
`updateDate` datetime NOT NULL,
`saveDate` datetime default NULL,
`collection` varchar(255) default NULL,
`admited_roles` varchar(255) default NULL,
`sru_source_id` bigint(20) default NULL,
PRIMARY KEY (`id`),
KEY `sru_sourceFK` (`sru_source_id`),
CONSTRAINT `sru_sourceFK` FOREIGN KEY (`sru_source_id`) REFERENCES `sru_source` (`id`)
) ENGINE=Innodb DEFAULT CHARSET=latin1;
/impl/src/hbm/pt/estgp/estgweb/domain/GenericUser.hbm.xml
94,6 → 94,10
<key column="student"/>
<one-to-many class="pt.estgp.estgweb.domain.CourseUnitGrade"/>
</set>
<set name="deliverables" lazy="true" order-by="deliverDate asc">
<key column="student"/>
<one-to-many class="pt.estgp.estgweb.domain.CourseUnitDeliverable"/>
</set>
<subclass name="pt.estgp.estgweb.domain.StudentImpl" discriminator-value="StudentImpl"/>
</subclass>
<subclass name="pt.estgp.estgweb.domain.Teacher">
/impl/src/hbm/pt/estgp/estgweb/domain/SruSource.hbm.xml
New file
0,0 → 1,44
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
 
<hibernate-mapping>
<class name="pt.estgp.estgweb.domain.SruSource" table="sru_source" abstract="true">
<meta attribute="extends">pt.estgp.estgweb.domain.DomainSerializableObject</meta>
<meta attribute="scope-class">public abstract</meta>
<id name="id" type="long">
<generator class="native"/>
</id>
<discriminator column="discrimitator"/>
<timestamp name="updateDate" unsaved-value="null"/>
<property name="saveDate" type="timestamp"/>
<property name="name" type="string"/>
<property name="collectionField" column="collection_field" type="string"/>
<property name="description" type="text"/>
<property name="url" type="string"/>
<property name="metadataSchema" type="string" column="metadata_schema"/>
<many-to-one name="creator" class="pt.estgp.estgweb.domain.User" outer-join="false" lazy="proxy"/>
<set name="collections" order-by="collection asc" lazy="true" cascade="delete">
<key column="sru_source_id"/>
<one-to-many class="pt.estgp.estgweb.domain.SruSourceCollection"/>
</set>
<subclass name="pt.estgp.estgweb.domain.SruSourceImpl" discriminator-value="SruSourceImpl"/>
</class>
 
<class name="pt.estgp.estgweb.domain.SruSourceCollection" table="sru_source_collection" abstract="true">
<meta attribute="extends">pt.estgp.estgweb.domain.DomainSerializableObject</meta>
<meta attribute="scope-class">public abstract</meta>
<id name="id" type="long">
<generator class="native"/>
</id>
<discriminator column="discrimitator"/>
<timestamp name="updateDate" unsaved-value="null"/>
<property name="saveDate" type="timestamp"/>
<property name="collection" type="string"/>
<property name="admitedRoles" type="string" column="admited_roles"/>
<many-to-one name="sruSource" column="sru_source_id" class="pt.estgp.estgweb.domain.SruSource" outer-join="false" lazy="proxy"/>
<subclass name="pt.estgp.estgweb.domain.SruSourceCollectionImpl" discriminator-value="SruSourceCollectionImpl"/>
</class>
</hibernate-mapping>
/impl/src/hbm/pt/estgp/estgweb/domain/UrlStat.hbm.xml
13,7 → 13,7
<discriminator column="discrimitator"/>
<timestamp name="updateDate" unsaved-value="null"/>
<property name="saveDate" type="timestamp"/>
<property name="name" type="string"/>
<property name="name" type="text"/>
<property name="description" type="text"/>
<property name="totalClicks" type="integer"/>
<property name="status" type="boolean"/>
/impl/src/hbm/pt/estgp/estgweb/domain/CourseUnit.hbm.xml
113,6 → 113,10
<property name="deliverDate" type="timestamp"/>
<property name="grade" type="string"/>
<property name="obs" type="text"/>
<property name="studentId" type="long"/>
<property name="studentUsername" type="string"/>
<property name="studentCode" type="string"/>
<property name="studentName" type="string"/>
<property name="deliverableRepositoryStream" type="string" index="deliverableRepositoryStreamIndex"/>
<many-to-one name="courseUnitAssignement" class="pt.estgp.estgweb.domain.CourseUnitAssignement" lazy="false" outer-join="true"/>
<many-to-one name="student" class="pt.estgp.estgweb.domain.Student" lazy="false" outer-join="true"/>
/impl/src/web/imgs/lupa.gif
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/impl/src/web/auth/logoutok.jsp
1,13 → 1,9
<%--
Created by IntelliJ IDEA.
User: User
Date: 28/Fev/2008
Time: 20:16:38
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
 
 
<jomm:beanArgMessage patternMessage="logout.ok" argName0="name"/>
<div class="seccao">
<p class="statusOK">
<jomm:beanArgMessage patternMessage="logout.ok" argName0="name"/>
</p>
</div>
/impl/src/web/admin/profile/profilePersonalData.jsp
161,7 → 161,7
</td>
</tr>
</baco:hasNotRole>
<baco:hasRole role="teacher">
<baco:isAdmin>
<tr>
<th>
<bean:message key="profile.academic.degree"/>
175,7 → 175,7
</html:select>
</td>
</tr>
</baco:hasRole>
</baco:isAdmin>
<tr>
<th>
<bean:message key="bi"/>
/impl/src/web/admin/profile/findUser.jsp
51,7 → 51,7
<td>${userView.name}</td>
<td>${userView.email}</td>
<td><html:link action="/user/startProfileFromSearchUsers?id=${userView.id}"><bean:message key="edit"/></html:link></td>
<td><html:link action="/user/startDeleteProfileFromSearchUsers?id=${userView.id}"><bean:message key="delete"/></html:link></td>
<td><a href="<%=request.getContextPath()%>/user/startDeleteProfileFromSearchUsers.do?id=${userView.id}" onclick="return confirm('<bean:message key="profile.confirm.delete"/>')"><bean:message key="delete"/></a></td>
<td></td>
</tr>
</logic:iterate>
/impl/src/web/admin/courses/course.jsp
8,6 → 8,8
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
<jsp:useBean id="CourseView" type="pt.estgp.estgweb.domain.views.CourseView" scope="request"/>
<html:errors/>
<jomm:messages/>
<html:form action="/user/courseControllerFromServiceZone" enctype="multipart/form-data">
<input type="hidden" name="dispatch" value="submit"/>
<html:hidden property="courseView.id"/>
/impl/src/web/admin/srusource/sruSourceData.jsp
New file
0,0 → 1,173
<%@ page import="java.util.List" %>
<%@ page import="pt.estgp.estgweb.web.form.srusource.SruSourceForm" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
<div id="contentIntranet">
<div id="contentPane">
 
<jomm:messages/>
<html:errors/>
 
 
<html:form action="/user/sruSourceFromServiceZone">
<input type="hidden" name="dispatch" value="editSruSource">
<html:hidden property="sruSourceView.id"/>
<html:hidden property="auxId"/>
<html:hidden property="role"/>
<input type="hidden" name="collectionSize" value="<%=((SruSourceForm)request.getAttribute("SruSourceForm")).getSruSourceView().getCollections().size()%>">
<table class="form">
 
<baco:isAdmin>
<tr>
<th>
<bean:message key="srusource.name"/>
</th>
<td>
<html:text styleClass="text" property="sruSourceView.name" maxlength="250"/>
</td>
</tr>
<tr>
<th>
<bean:message key="srusource.description"/>
</th>
<td>
<html:text styleClass="text" property="sruSourceView.description" maxlength="250"/>
</td>
</tr>
<tr>
<th>
<bean:message key="srusource.url"/>
</th>
<td>
<html:text styleClass="text" property="sruSourceView.url" maxlength="250"/>
(e.g: http://deptal.estgp.pt:8983/telHandler/Handler2)
</td>
</tr>
<tr>
<th>
<bean:message key="srusource.collectionField"/>
</th>
<td>
<html:text styleClass="text" property="sruSourceView.collectionField" maxlength="250"/>
</td>
</tr>
<tr>
<th>
<bean:message key="srusource.metadataSchema"/>
</th>
<td>
<html:select property="sruSourceView.metadataSchema">
<html:option value="files"><bean:message key="srusource.metadataSchema.files"/></html:option>
</html:select>
</td>
</tr>
<tr>
<th><bean:message key="srusource.collections"/></th>
<td>
<table class="dataTable">
 
<logic:notEmpty name="SruSourceForm" property="sruSourceView.collections">
<tr>
<th><bean:message key="srusource.collection"/></th>
<th><bean:message key="srusource.admited.roles"/></th>
</tr>
<nested:iterate id="collectionView" name="SruSourceForm" property="sruSourceView.collections" >
<tr>
<td><bean:write name="collectionView" property="collection"/></td>
<td>
<nested:hidden property="id"/>
<nested:hidden property="collection"/>
<nested:hidden property="admitedRoles"/>
<nested:notEmpty name="collectionView" property="admitedRolesSet">
<nested:iterate id="admitedRole" name="collectionView" property="admitedRolesSet">
<bean:message key="user.role.${admitedRole}"/>,
</nested:iterate>
</nested:notEmpty>
</td>
<td>
<input type="button" class="removeButton" value="" onclick="SruSourceForm.auxId.value='${collectionView.id}';set(this.form,'removeCollection');this.form.submit();">
</td>
</tr>
</nested:iterate>
</logic:notEmpty>
<logic:empty name="SruSourceForm" property="sruSourceView.collections">
<tr>
<td colspan="2">
<bean:message key="srusource.zero.collections"/>
</td>
</tr>
</logic:empty>
</table>
<table style="border:1px solid black">
<tr>
<th colspan="2"><bean:message key="srusource.new.collection"/></th>
</tr>
<tr>
<th><bean:message key="srusource.collection"/></th>
<td>
<html:hidden property="sruSourceCollectionView.id"/>
<html:text property="sruSourceCollectionView.collection"/>
</td>
</tr>
<tr>
<th>
<bean:message key="srusource.admited.roles"/>
</th>
<td>
<html:select property="targetRolesStr">
<logic:present name="SruSourceForm" property="targetRoles">
<logic:iterate id="item" name="SruSourceForm" property="targetRoles">
<jomm:option itemName="item" comparableObjectName="SruSourceForm"
comparableObjectProperty="targetRolesStr">
<jomm:message patternMessage="user.role.{0}" name0="item"/>
</jomm:option>
</logic:iterate>
<input type="button" value="<bean:message key="add"/>" onclick="set(this.form,'addRole');this.form.submit();">
</logic:present>
</html:select>
 
<logic:present name="SruSourceForm" property="selectedRoles">
<logic:notEmpty name="SruSourceForm" property="selectedRoles">
<table class="dataTable removeButton">
<logic:iterate id="item" name="SruSourceForm" property="selectedRoles">
<tr>
<th>
<jomm:message patternMessage="user.role.{0}" name0="item"/>
</th>
<td>
<input type="button" class="removeButton" value=""
onclick="SruSourceForm.role.value='${item}';set(this.form,'removeRole');this.form.submit();">
</td>
</tr>
</logic:iterate>
</table>
</logic:notEmpty>
</logic:present>
</td>
</tr>
<tr>
<td colspan="2">
<input type="button" onclick="set(this.form,'addSruSourceCollection');this.form.submit()" value="<bean:message key="srusource.collection.add"/>"/>
</td>
</tr>
</table>
 
</td>
</tr>
 
</baco:isAdmin>
<tr class="buttons">
<td colspan="2">
<input type="button" onclick="set(this.form,'editSruSource');this.form.submit()"
value="<bean:message key="confirm"/>"/>
</td>
</tr>
</table>
</html:form>
</div>
</div>
/impl/src/web/admin/srusource/chooseSruSource.jsp
New file
0,0 → 1,45
<%@ page import="jomm.utils.MessageResources" %>
<%@ page import="pt.estgp.estgweb.domain.views.SruSourceView" %>
<%@ page import="pt.estgp.estgweb.web.utils.RequestUtils" %>
<%@ page import="pt.utl.ist.berserk.logic.serviceManager.IServiceManager" %>
<%@ page import="pt.utl.ist.berserk.logic.serviceManager.ServiceManager" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
<%
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{};
Object[] args = new Object[]{};
List<SruSourceView> courseViews = (List<SruSourceView>) sm.execute(RequestUtils.getRequester(request, response), "LoadSruSources", args, names);
request.setAttribute("SruSources", courseViews);
%>
<jsp:useBean id="SruSources" type="java.util.List" scope="request"/>
<jomm:messages/>
<html:errors/>
 
<div class="seccao">
<h2><bean:message key="srusource.choose.srusources"/> </h2>
<table class="dataTable">
<tr>
<th><bean:message key="srusource.name"/></th>
<th><bean:message key="srusource.url"/></th>
</tr>
<%
String confirmDelete = MessageResources.getMessage(request, "srusource.confirm.delete");
request.setAttribute("confirmDelete", confirmDelete);
%>
<logic:iterate id="sruSource" name="SruSources" type="pt.estgp.estgweb.domain.views.SruSourceView">
<tr>
<td><html:link action="/user/chooseSruSourceFromServiceZone?sruSourceView.id=${sruSource.id}">${sruSource.name}</html:link></td>
<td>${sruSource.url}</td>
<td><html:link onclick="return confirm('${confirmDelete}')" action="/user/deleteSruSourceFromServiceZone?sruSourceView.id=${sruSource.id}"><bean:message key="delete"/></html:link></td>
</tr>
</logic:iterate>
</table>
</div>
/impl/src/web/css/style.css
881,11 → 881,23
text-align:justify;
}
 
 
 
#flashBottomNews .flashNew{
height:230px;
}
 
.flashNew
{
 
width:100%;
 
}
.flashNew th
{
vertical-align:top;
}
 
.flashNew td
{
background-color: #D3D3D3;
1487,11 → 1499,12
{
border-top:1px solid #8ec73f;
}
.remindersContainer
.remindersContainer, .quotasImpressaoContainer
{
vertical-align:top;
}
.remindersContainer input { width:85px }
 
.reminders
{
vertical-align:top;
1501,7 → 1514,7
padding:0;
margin:0;
}
.reminders #reminderForm
.reminders #reminderForm, #quotasImpressao
{
border: 1px solid #8ec73f;
margin-top:4px;
/impl/src/web/js/ajax.js
33,7 → 33,7
return;
}
var finalParams = "";
var url= navjsp;
var url = location.href.substring(0,location.href.indexOf('/',location.href.indexOf("://")+3)) + navjsp;
if(params != null && params.length > 0)
{
//url=url+"?"+ params;
42,7 → 42,8
var paramsArray = params.split("&");
var i;
var union = '';
for(i = 0; i < paramsArray.length; i++){
for(i = 0; i < paramsArray.length; i++)
{
var parameter = paramsArray[i].split("=");
if(parameter.length == 2)
{
280,6 → 281,13
xmlHttpSearch=GetXmlHttpObject(stateChangedSearchCall);
startRequest(xmlHttpSearch,"dispatch=searchModule&query=" + query + "&searchType=" + searchType + "&page=" + page + "&module=" + module,"",stateChangedSearchCall,"",action);
}
 
function searchCall(div,query,searchType,page,module,moduleInternalKey,action)
{
searchResultsDiv = div;
xmlHttpSearch=GetXmlHttpObject(stateChangedSearchCall);
startRequest(xmlHttpSearch,"dispatch=searchModule&query=" + query + "&searchType=" + searchType + "&page=" + page + "&module=" + module + "&moduleInternalKey=" + moduleInternalKey,"",stateChangedSearchCall,"",action);
}
function stateChangedSearchCall()
{
if (xmlHttpSearch.readyState==4 || xmlHttpSearch.readyState=="complete")
445,10 → 453,84
}
 
 
/******************************
* Cotas de Impressao
******************************/
var quotasDiv;
var xmlHttpQuotas;
var quotasErrorMsg;
var impressorasMsg;
var quotasDisponiveisMsg;
var donaldPretoMsg;
var billCorMsg;
 
function loadQuotas(div,action,_quotasErrorMsg, _impressorasMsg, _quotasDisponiveisMsg, _donaldPretoMsg, _billCorMsg)
{
 
quotasDiv = div;
quotasErrorMsg = _quotasErrorMsg;
impressorasMsg = _impressorasMsg;
quotasDisponiveisMsg = _quotasDisponiveisMsg;
donaldPretoMsg = _donaldPretoMsg;
billCorMsg = _billCorMsg;
if(!xmlHttpQuotas)
xmlHttpQuotas = GetXmlHttpObject(stateChangedLoadQuotasCall);
startRequest(xmlHttpQuotas,"","",stateChangedLoadQuotasCall,"",action);
}
function stateChangedLoadQuotasCall()
{
if (xmlHttpQuotas.readyState==4 || xmlHttpQuotas.readyState=="complete")
{
putQuotasImpressao(xmlHttpQuotas.responseXML);
}
}
 
function putQuotasImpressao(xmlData)
{
if(xmlData == null)
{
getObjectById(quotasDiv).innerHTML=quotasErrorMsg;
}
else
{
var pretoTr = xmlData.getElementsByTagName('preto')[0].getElementsByTagName("tr")[0];
var corTr = xmlData.getElementsByTagName('cor')[0].getElementsByTagName("tr")[0];
if(pretoTr == null || corTr == null)
{
getObjectById(quotasDiv).innerHTML=quotasErrorMsg;
}
else
{
var copiasImpressasPreto = pretoTr.getElementsByTagName('td')[1].getElementsByTagName('font')[0].firstChild.nodeValue;
var copiasDisponiveisPreto = pretoTr.getElementsByTagName('td')[2].getElementsByTagName('font')[0].firstChild.nodeValue;
var copiasImpressasCor = corTr.getElementsByTagName('td')[1].getElementsByTagName('font')[0].firstChild.nodeValue;
var copiasDisponiveisCor = corTr.getElementsByTagName('td')[2].getElementsByTagName('font')[0].firstChild.nodeValue;
var response = "";
response += "<table class=\"dataTable\">\n";
response += " <tr>\n";
response += " <th>" + impressorasMsg + "</th>\n";
response += " <th>" + quotasDisponiveisMsg + "</th>\n";
response += " </tr>\n";
response += " <tr>\n";
response += " <th>" + donaldPretoMsg + "</th>\n";
if(copiasDisponiveisPreto == '0')
response += "<td align=\"right\" style=\"color:red\">"+ copiasDisponiveisPreto +"</td>\n"
else
response += "<td align=\"right\" style=\"color:green\">"+ copiasDisponiveisPreto +"</td>\n"
response += " </tr>\n";
response += " <tr>\n";
response += " <th>" + billCorMsg + "</th>\n";
if(copiasDisponiveisCor == '0')
response += "<td align=\"right\" style=\"color:red\">"+ copiasDisponiveisCor +"</td>\n"
else
response += "<td align=\"right\" style=\"color:green\">"+ copiasDisponiveisCor +"</td>\n"
response += " </tr>\n";
 
response += "</table>\n";
getObjectById(quotasDiv).innerHTML=response;
}
}
}
 
 
 
460,3 → 542,7
 
 
 
 
 
 
 
/impl/src/web/layout/searchForm.jsp
New file
0,0 → 1,88
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
<baco:isModuleOn module="search">
<td class="searchTab">
 
<%
String allChecked = "";
String anyChecked = "";
String phraseChecked = "";
String query = request.getParameter("query");
String searchType = request.getParameter("searchType");
if(query == null)
query = "";
 
allChecked = "checked=\"checked\"";
if(searchType == null)
allChecked = "checked=\"checked\"";
else if(searchType.equals("search.type.all"))
allChecked = "checked=\"checked\"";
else if(searchType.equals("search.type.any"))
anyChecked = "checked=\"checked\"";
else if(searchType.equals("search.type.phrase"))
phraseChecked = "checked=\"checked\"";
 
 
%>
<html:form action="/search" method="post">
 
 
<input type="hidden" name="dispatch" value="search"/>
 
 
<%
if(request.getParameter("size") == null)
{
%>
<table>
<tr>
<td>
<bean:message key="search"/>
</td>
<td>
<input type="text" class="small" name="query" value="<%=query%>"/>
</td>
<td>
<input type="submit" value="<bean:message key="search"/>">
</td>
 
</tr>
<tr>
<td nowrap="nowrap" colspan="3">
<table>
<tr>
<td><input type="radio" name="searchType" value="search.type.all" <%=allChecked%>/></td>
<td><bean:message key="search.type.all"/></td>
<td><input type="radio" name="searchType" value="search.type.any" <%=anyChecked%>/></td>
<td><bean:message key="search.type.any"/></td>
<td><input type="radio" name="searchType" value="search.type.phrase" <%=phraseChecked%>/></td>
<td><bean:message key="search.type.phrase"/></td>
</tr>
</table>
</td>
</tr>
</table>
<%
}
else if(request.getParameter("size").equals("small"))
{
%>
<table>
<tr>
<td style="vertical-align:middle; white-space:nowrap;">
<html:image page="/imgs/lupa.gif" altKey="search"/><input type="text" class="small" name="query" value="<%=query%>"/> <input type="submit" value=">>">
</td>
</tr>
</table>
<input type="hidden" name="searchType" value="search.type.all"/>
<%
}
%>
</html:form>
</td>
</baco:isModuleOn>
/impl/src/web/layout/navigationTop.jsp
81,63 → 81,7
 
 
</td>
<baco:isModuleOn module="search">
<td class="searchTab">
 
<%
String allChecked = "";
String anyChecked = "";
String phraseChecked = "";
String query = request.getParameter("query");
String searchType = request.getParameter("searchType");
if(query == null)
query = "";
 
allChecked = "checked=\"checked\"";
if(searchType == null)
allChecked = "checked=\"checked\"";
else if(searchType.equals("search.type.all"))
allChecked = "checked=\"checked\"";
else if(searchType.equals("search.type.any"))
anyChecked = "checked=\"checked\"";
else if(searchType.equals("search.type.phrase"))
phraseChecked = "checked=\"checked\"";
 
 
%>
<html:form action="/search" method="post">
<input type="hidden" name="dispatch" value="search"/>
<table>
<tr>
<td>
<bean:message key="search"/>
</td>
<td>
<input type="text" class="small" name="query" value="<%=query%>"/>
</td>
<td>
<input type="submit" value="<bean:message key="search"/>">
</td>
 
</tr>
<tr>
<td nowrap="nowrap" colspan="3">
<table>
<tr>
<td><input type="radio" name="searchType" value="search.type.all" <%=allChecked%>/></td>
<td><bean:message key="search.type.all"/></td>
<td><input type="radio" name="searchType" value="search.type.any" <%=anyChecked%>/></td>
<td><bean:message key="search.type.any"/></td>
<td><input type="radio" name="searchType" value="search.type.phrase" <%=phraseChecked%>/></td>
<td><bean:message key="search.type.phrase"/></td>
</tr>
</table>
</td>
</tr>
</table>
</html:form>
</td>
</baco:isModuleOn>
<jsp:include page="searchForm.jsp"/>
</tr>
</table>
</div>
/impl/src/web/public/profile/profileHome.jsp
64,6 → 64,7
if(ProfileForm.getUserView().getUser() instanceof Teacher && ProfileForm.getUserView().getAcademicDegree() != null && ProfileForm.getUserView().getAcademicDegree().trim().length() > 0)
{
%>
<baco:isAdmin>
<tr>
<th>
<bean:message key="profile.academic.degree"/>
72,6 → 73,7
<bean:message key="profile.academic.degree.${ProfileForm.userView.academicDegree}"/>
</td>
</tr>
</baco:isAdmin>
<%
}
%>
/impl/src/web/public/search/searchResults.jsp
142,7 → 142,12
type="pt.estgp.estgweb.services.common.ISearchResults">
<li>
<h1>
<bean:message key="${searchResults.module.messageKey}"/>
<logic:empty name="searchResults" property="description">
<bean:message key="${searchResults.module.messageKey}"/>
</logic:empty>
<logic:notEmpty name="searchResults" property="description">
<bean:write name="searchResults" property="description"/>
</logic:notEmpty>
<b>(${searchResults.totalResults})</b>
<a id="${searchResults.module.messageKey}SeeMore"
href="javascript:showOrHideOne('${searchResults.module.messageKey}')">
164,7 → 169,20
<div class="result">
<h2>
<logic:notEmpty name="result" property="url">
<%
if(result.isAbsoluteUrl())
{
%>
<a href="${result.url}">${result.title}</a>
<%
}
else
{
%>
<a href="<%=request.getContextPath()%>${result.url}">${result.title}</a>
<%
}
%>
</logic:notEmpty>
<logic:empty name="result" property="url">
${result.title}
207,14 → 225,14
<p class="pages">
<bean:message key="search.pages"/>
<logic:equal value="true" name="searchResults" property="hasPreviousPage">
<a href="javascript:searchCall('${searchResults.module.messageKey}Results','${searchResults.query}','${searchResults.searchType}','${searchResults.previousPage}','${searchResults.module.messageKey}','<%=request.getContextPath()%>/search.do')">
<a href="javascript:searchCall('${searchResults.module.messageKey}Results','${searchResults.query}','${searchResults.searchType}','${searchResults.previousPage}','${searchResults.module.messageKey}','${searchResults.moduleInternalKey}','<%=request.getContextPath()%>/search.do')">
&lt;
<bean:message key="result.previous"/>
</a>
</logic:equal>
${searchResults.page2Screen}
<logic:equal value="true" name="searchResults" property="hasNextPage">
<a href="javascript:searchCall('${searchResults.module.messageKey}Results','${searchResults.query}','${searchResults.searchType}','${searchResults.nextPage}','${searchResults.module.messageKey}','<%=request.getContextPath()%>/search.do')">
<a href="javascript:searchCall('${searchResults.module.messageKey}Results','${searchResults.query}','${searchResults.searchType}','${searchResults.nextPage}','${searchResults.module.messageKey}','${searchResults.moduleInternalKey}','<%=request.getContextPath()%>/search.do')">
<bean:message key="result.next"/>
&gt;</a>
</logic:equal>
/impl/src/web/public/search/searchResultsModule.jsp
9,7 → 9,27
<logic:iterate id="result" name="ISearchResults" property="results"
type="pt.estgp.estgweb.services.common.IResult">
<div class="result">
<h2><a href="<%=request.getContextPath()%>${result.url}">${result.title}</a>
 
<h2>
<logic:notEmpty name="result" property="url">
<%
if(result.isAbsoluteUrl())
{
%>
<a href="${result.url}">${result.title}</a>
<%
}
else
{
%>
<a href="<%=request.getContextPath()%>${result.url}">${result.title}</a>
<%
}
%>
</logic:notEmpty>
<logic:empty name="result" property="url">
${result.title}
</logic:empty>
<logic:notEmpty name="result" property="subTitle">
(
<logic:equal value="true" name="result" property="subTitleKey">
25,13 → 45,13
<p>${result.bestFragments} ...</p>
</div>
</logic:iterate>
Pages:
Pages:
<logic:equal value="true" name="ISearchResults" property="hasPreviousPage">
<a href="javascript:searchCall('${ISearchResults.module.messageKey}Results','${ISearchResults.query}','${ISearchResults.searchType}','${ISearchResults.previousPage}','${ISearchResults.module.messageKey}','<%=request.getContextPath()%>/search.do')">&lt; previous</a>
<a href="javascript:searchCall('${ISearchResults.module.messageKey}Results','${ISearchResults.query}','${ISearchResults.searchType}','${ISearchResults.previousPage}','${ISearchResults.module.messageKey}','${ISearchResults.moduleInternalKey}','<%=request.getContextPath()%>/search.do')">&lt; previous</a>
</logic:equal>
${ISearchResults.page2Screen}
<logic:equal value="true" name="ISearchResults" property="hasNextPage">
<a href="javascript:searchCall('${ISearchResults.module.messageKey}Results','${ISearchResults.query}','${ISearchResults.searchType}','${ISearchResults.nextPage}','${ISearchResults.module.messageKey}','<%=request.getContextPath()%>/search.do')">next &gt;</a>
<a href="javascript:searchCall('${ISearchResults.module.messageKey}Results','${ISearchResults.query}','${ISearchResults.searchType}','${ISearchResults.nextPage}','${ISearchResults.module.messageKey}','${ISearchResults.moduleInternalKey}','<%=request.getContextPath()%>/search.do')">next &gt;</a>
</logic:equal>
 
 
/impl/src/web/public/announcements/announcementsPortalRightHome.jsp
New file
0,0 → 1,124
<%@ page import="pt.estgp.estgweb.Globals" %>
<%@ page import="pt.estgp.estgweb.domain.views.AnnouncementView" %>
<%@ page import="pt.estgp.estgweb.web.utils.RequestUtils" %>
<%@ page import="pt.utl.ist.berserk.logic.serviceManager.IServiceManager" %>
<%@ page import="pt.utl.ist.berserk.logic.serviceManager.ServiceManager" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%
IServiceManager sm = ServiceManager.getInstance();
String subTarget = null;
String[] names = new String[]{};
Object[] args = new Object[]{request.getParameter("role"), Globals.ANNOUNCEMENT_TYPE_NEWS, subTarget};
List<AnnouncementView> announcementViews = (List<AnnouncementView>) sm.execute(RequestUtils.getRequester(request, response), "LoadRoleTypeMaxAnnouncements", args, names);
request.setAttribute("Announcements", announcementViews);
 
String fromAction = "";
String user = "";
if(request.getParameter("from")!=null)
{
request.setAttribute("from","from=" + request.getParameter("from"));
user = "/user";
fromAction = "From" + request.getParameter("from");
}
else
{
request.setAttribute("from","");
}
request.setAttribute("user",user);
request.setAttribute("fromAction",fromAction);
 
%>
 
<div class="portalRightAnnouncements">
 
<table>
<baco:isAuthenticated>
<tr>
<td>
<jsp:include page="/layout/searchForm.jsp?size=small"/>
</td>
</tr>
<tr>
<td colspan="2" class="quotasImpressaoContainer">
<jsp:include page="/user/quotasImpressao/quotasImpressao.jsp"/>
</td>
</tr>
<tr>
<td colspan="2" class="remindersContainer">
<jsp:include page="/user/reminders/reminders.jsp"/>
</td>
</tr>
 
<tr>
<td colspan="2" class="messagesContainer"><jsp:include page="/user/pop/messagesContainer.jsp"/></td>
</tr>
</baco:isAuthenticated>
<logic:present name="Announcements">
<logic:notEmpty name="Announcements">
<tr>
<td colspan="2">
<h1><bean:message key="announcements"/></h1>
</td>
</tr>
<logic:iterate id="item" name="Announcements" type="pt.estgp.estgweb.domain.views.AnnouncementView">
<tr>
<td width="25%">
<div class="imageAnnouncementNews">
<baco:ownerImageRole name="item"/>
</div>
</td>
<td>
<div class="portalAnnouncementNews">
<div class="portalAnnouncement">
<logic:empty name="item" property="url">
<div class="portalAnnouncementTitle">
<html:link
action="${user}/startLoadAnnouncement${fromAction}?id=${item.id}">${item.title}</html:link>
</div>
<div class="portalAnnouncementText">
<html:link
action="${user}/startLoadAnnouncement${fromAction}?id=${item.id}">${item.textSummarySmall}</html:link>
</div>
</logic:empty>
<logic:notEmpty name="item" property="url">
<%
if (!item.getTextBiggerThenPermited())
{
%>
<div class="portalAnnouncementTitle">
<html:link href="${item.url}">${item.title}</html:link>
</div>
<div class="portalAnnouncementText">
<html:link href="${item.url}">${item.textSummarySmall}</html:link>
</div>
<%
}
else
{
%>
<div class="portalAnnouncementTitle">
<html:link
action="${user}/startLoadAnnouncement${fromAction}?id=${item.id}">${item.title}</html:link>
</div>
<div class="portalAnnouncementText">
<html:link
action="${user}/startLoadAnnouncement${fromAction}?id=${item.id}">${item.textSummarySmall}</html:link>
</div>
<%}%>
</logic:notEmpty>
</div>
</div>
</td>
 
</tr>
</logic:iterate>
</logic:notEmpty>
</logic:present>
</table>
</div>
/impl/src/web/public/announcements/announcementsPortalRight.jsp
38,16 → 38,6
<div class="portalRightAnnouncements">
 
<table>
<baco:isAuthenticated>
<tr>
<td colspan="2" class="remindersContainer">
<jsp:include page="/user/reminders/reminders.jsp"/>
</td>
</tr>
<tr>
<td colspan="2" class="messagesContainer"><jsp:include page="/user/pop/messagesContainer.jsp"/></td>
</tr>
</baco:isAuthenticated>
<logic:present name="Announcements">
<logic:notEmpty name="Announcements">
<tr>
/impl/src/web/user/quotasImpressao/quotasImpressao.jsp
New file
0,0 → 1,19
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
 
<baco:isModuleOn module="quotasImpressao">
 
<script type="text/javascript" language="JavaScript1.3">
<!--
loadQuotas('quotasImpressao','<%=request.getContextPath()%>/user/ajaxapis/ServicosImpressao','<bean:message key="intranet.quotas.error"/>','<bean:message key="intranet.quotas.impressoras"/>','<bean:message key="intranet.quotas.disponiveis"/>','<bean:message key="intranet.quotas.donaldPreto"/>','<bean:message key="intranet.quotas.billCor"/>');
-->
</script>
 
<div id="quotasImpressao"></div>
 
</baco:isModuleOn>
/impl/src/web/user/courseunits/menu.jsp
1,4 → 1,9
<%@ page import="pt.estgp.estgweb.domain.views.BlogView" %>
<%@ page import="pt.utl.ist.berserk.logic.serviceManager.IServiceManager" %>
<%@ page import="pt.utl.ist.berserk.logic.serviceManager.ServiceManager" %>
<%@ page import="pt.estgp.estgweb.web.utils.RequestUtils" %>
<%@ page import="java.util.List" %>
<%@ page import="pt.estgp.estgweb.utils.DatesUtils" %>
<%@ 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" %>
45,17 → 50,17
<html:link action="${user}/startLoadCourseUnit${fromAction}?courseUnitView.id=${CourseUnitView.id}"><bean:message key="courseunit.menu.home"/></html:link>
</li>
 
<baco:isInCourseUnit courseUnitId="${CourseUnitView.id}">
<baco:isTeacherOfCourseUnit courseUnitId="${CourseUnitView.id}">
<li>
<html:link action="/user/startSubmitAnnouncementFromCourseUnit?announcementView.courseUnitView.id=${CourseUnitView.id}"><bean:message key="courseunit.menu.put.announcement"/></html:link>
</li>
<!--<li>
<a href="<%=request.getContextPath()%>/"><bean:message key="courseunit.menu.put.question"/></a>
<a href="<%=request.getContextPath()%>/"><bean:message key="courseunit.menu.put.question"/></a>
</li>-->
<li>
<a href="<%=request.getContextPath()%>${user}/startLoadCourseUnitWorks${fromAction}.do?courseUnitView.id=${CourseUnitView.id}"><bean:message key="courseunit.menu.assignements"/></a>
</li>
</baco:isInCourseUnit>
</baco:isTeacherOfCourseUnit>
 
 
<li>
68,18 → 73,71
<html:link action="${user}/startLoadCourseUnitStudents${fromAction}?courseUnitView.id=${CourseUnitView.id}"><bean:message key="courseunit.students"/></html:link>
</li>
 
<baco:isAuthenticated>
<li>
<html:link action="/user/startLoadCourseUnitContentsFromHome?courseUnitView.id=${CourseUnitView.id}"><bean:message key="courseunit.menu.contents"/></html:link>
</li>
<li>
<html:link action="/user/startLoadCourseUnitPresencesFromHome?courseUnitView.id=${CourseUnitView.id}"><bean:message key="courseunit.menu.presences"/></html:link>
</li>
<li>
<html:link action="/user/startLoadCourseUnitGradesFromHome?courseUnitView.id=${CourseUnitView.id}"><bean:message key="courseunit.menu.grades"/></html:link>
</li>
</baco:isAuthenticated>
 
<li>
<html:link action="/user/startLoadCourseUnitContentsFromHome?courseUnitView.id=${CourseUnitView.id}"><bean:message key="courseunit.menu.contents"/></html:link>
</li>
<li>
<html:link action="/user/startLoadCourseUnitPresencesFromHome?courseUnitView.id=${CourseUnitView.id}"><bean:message key="courseunit.menu.presences"/></html:link>
</li>
<li>
<html:link action="/user/startLoadCourseUnitGradesFromHome?courseUnitView.id=${CourseUnitView.id}"><bean:message key="courseunit.menu.grades"/></html:link>
</li>
 
 
 
</ul>
</div>
</div>
</div>
</div>
 
 
<%
IServiceManager sm = ServiceManager.getInstance();
 
String[] names = new String[]{};
Object[] args = new Object[]{CourseUnitView.getCode(), CourseUnitView.getCourseCode()};
 
List<pt.estgp.estgweb.domain.views.CourseUnitView> courseUnitViews = (List<pt.estgp.estgweb.domain.views.CourseUnitView>) sm.execute(RequestUtils.getRequester(request, response), "LoadCourseUnitsBySigesCodes", args, names);
if(courseUnitViews.size() > 1)
{
request.setAttribute("OldUnits",courseUnitViews);
}
%>
<logic:present name="OldUnits">
<div class="linkMenuBlock">
<div class="linkMenuBlockTitle">
<%
if (CourseUnitView.getImportYear().equals(DatesUtils.getImportYear()))
{
%>
<bean:message key="courseunit.menu.unit.old.units"/>
<%
}else{
%>
<bean:message key="courseunit.menu.unit.other.units"/>
<%
}
%>
</div>
<div class="linkLeftMenu">
<div class="listClean">
<ul>
<logic:iterate id="item" name="OldUnits">
<li>
<logic:equal value="${CourseUnitView.id}" name="item" property="id">
&gt;${item.importYear}
</logic:equal>
<logic:notEqual value="${CourseUnitView.id}" name="item" property="id">
<html:link action="${user}/startLoadCourseUnit${fromAction}?courseUnitView.id=${item.id}">${item.importYear}</html:link>
</logic:notEqual>
 
</li>
</logic:iterate>
</ul>
</div>
</div>
</div>
</logic:present>
/impl/src/web/user/home.jsp
24,7 → 24,7
<%--</table>--%>
</td>
<td id="rightPagePortal">
<jsp:include page="/public/announcements/announcementsPortalRight.jsp?role=${UserSession.user.roles}&from=Home"/>
<jsp:include page="/public/announcements/announcementsPortalRightHome.jsp?role=${UserSession.user.roles}&from=Home"/>
</td>
</tr>
</table>
44,7 → 44,7
<%--</table>--%>
</td>
<td id="rightPagePortal">
<jsp:include page="/public/announcements/announcementsPortalRight.jsp?role=${UserSession.user.roles}&from=Home"/>
<jsp:include page="/public/announcements/announcementsPortalRightHome.jsp?role=${UserSession.user.roles}&from=Home"/>
</td>
</tr>
</table>
66,7 → 66,7
<%--</table> --%>
</td>
<td id="rightPagePortal">
<jsp:include page="/public/announcements/announcementsPortalRight.jsp?role=all&from=Home"/>
<jsp:include page="/public/announcements/announcementsPortalRightHome.jsp?role=all&from=Home"/>
</td>
</tr>
</table>
/impl/src/web/user/ftpclient/ftpclient.jsp
125,10 → 125,10
<tr class="dir">
<td colspan="3">
 
<a id="FTP_NODE_<%=++counter%>" style="display:none" href="javascript:if(confirmLink('<bean:message key="ftp.comfirm.delete" arg0="${i.name}"/>')){document.FormFtpManager.deleteFolder.value='<%=i.getName()%>';document.FormFtpManager.submit();}"><img border="0" src="<%=request.getContextPath()%>/imgs/delete.gif" alt="apagar"></a>
<a id="FTP_NODE_<%=++counter%>" style="display:none" href="javascript:if(confirmLink('<bean:message key="ftp.comfirm.delete" arg0="${i.nameHtml}"/>')){document.FormFtpManager.deleteFolder.value='<%=i.getNameHtml()%>';document.FormFtpManager.submit();}"><img border="0" src="<%=request.getContextPath()%>/imgs/delete.gif" alt="apagar"></a>
&nbsp;
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/folder.gif">&nbsp;<a
href="<%=i.getName(request)%>"><%=i.getName()%>
href="<%=i.getName(request)%>"><%=i.getNameEscapedHtml()%>
</a>
</td>
</tr>
212,8 → 212,7
<%
}
%>
<a target="_blank" href="<%=i.getCompleteUrl()%>"><%=i.getName()%>
</a>
<a target="_blank" href="<%=i.getCompleteUrl()%>"><%=i.getName()%></a>
 
</td>
<td>
/impl/src/web/user/home/student.jsp
8,13 → 8,13
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/>
<div class="portal">
<logic:notMatch value="StudentImpl" name="UserSession" property="user.class.name">
<ul>
<li class="WARNING">
<logic:notMatch value="StudentImpl" name="UserSession" property="user.class.name">
<bean:message key="profile.bad.profile.student.iregular.user.class"/>
</logic:notMatch>
</li>
</ul>
</logic:notMatch>
<table class="columnTable" width="100%">
<tbody>
<tr>
/impl/src/web/user/home/teacher.jsp
8,13 → 8,13
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/>
<div class="portal">
<logic:notMatch value="TeacherImpl" name="UserSession" property="user.class.name">
<ul>
<li class="WARNING">
<logic:notMatch value="TeacherImpl" name="UserSession" property="user.class.name">
<bean:message key="profile.bad.profile.teacher.iregular.user.class"/>
</logic:notMatch>
<bean:message key="profile.bad.profile.teacher.iregular.user.class"/>
</li>
</ul>
</logic:notMatch>
<table class="columnTable" width="100%">
<tbody>
<tr>
35,7 → 35,7
<ul>
<logic:iterate id="unit" name="UserSession" property="user.teachedUnitsCurrentYearViewS1" 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.courseName} (${unit.courseCode}))</html:link>
</li>
</logic:iterate>
</ul>
/impl/src/web/user/reminders/reminders.jsp
26,15 → 26,16
{
%>
setActiveReminders(<%=reminders.getActiveReminders().size()%>);
<% }
<%
}
if(reminders.getExpiredReminders() != null)
{
%>
setExpiredReminders(<%=reminders.getExpiredReminders().size()%>);
-->
<%
}
%>
-->
</script>
 
<jsp:useBean id="IOwnedReminders" type="pt.estgp.estgweb.services.reminders.IOwnedReminders" scope="request"/>
/impl/src/web/user/serviceZone/serviceZone.jsp
210,6 → 210,23
</ul>
</li>
</baco:isModuleOn>
<baco:isModuleOn module="srusource">
<li>
<bean:message key="srusource"/>
<ul>
<li>
<html:link target="_blank" action="/user/startNewSruSourceFromServiceZone">
<bean:message key="srusource.create.new"/>
</html:link>
</li>
<li>
<html:link target="_blank" action="/user/startChooseSruSourceFromServiceZone">
<bean:message key="srusource.edit.srusources"/>
</html:link>
</li>
</ul>
</li>
</baco:isModuleOn>
</baco:isAdmin>
<baco:hasRole role="identifiersManager,identifiersCollectionCreator">
<baco:isModuleOn module="manageidentifiers">
/impl/src/web/user/serviceZone/topnavCreateSruSource.jsp
New file
0,0 → 1,12
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.util.*"%>
<%@ page import="jomm.web.utils.NavPlace" %>
<%@ page import="jomm.web.utils.NavPlaceServer" %>
<%@ page import="jomm.web.utils.TopNav" %>
<%
TopNav topNav = NavPlaceServer.getInstance().createTopNav(request);
topNav.addNavPlace("/user/startServiceZone.do", "intranet.separator.service.zone.back");
topNav.addNavPlace(null, "srusource.create.srusource");
%>
<jsp:include page="/layout/topnav.jsp"/>
/impl/src/web/user/serviceZone/topnavChooseSruSources.jsp
New file
0,0 → 1,12
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.util.*"%>
<%@ page import="jomm.web.utils.NavPlace" %>
<%@ page import="jomm.web.utils.NavPlaceServer" %>
<%@ page import="jomm.web.utils.TopNav" %>
<%
TopNav topNav = NavPlaceServer.getInstance().createTopNav(request);
topNav.addNavPlace("/user/startServiceZone.do", "intranet.separator.service.zone.back");
topNav.addNavPlace(null, "srusource.choose.srusources");
%>
<jsp:include page="/layout/topnav.jsp"/>
/impl/src/web/user/serviceZone/topnavLoadSruSource.jsp
New file
0,0 → 1,13
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.util.*"%>
<%@ page import="jomm.web.utils.NavPlace" %>
<%@ page import="jomm.web.utils.NavPlaceServer" %>
<%@ page import="jomm.web.utils.TopNav" %>
<%
TopNav topNav = NavPlaceServer.getInstance().createTopNav(request);
topNav.addNavPlace("/user/startServiceZone.do", "intranet.separator.service.zone.back");
topNav.addNavPlace("/user/startChooseSruSourceFromServiceZone.do", "srusource.edit.srusources");
topNav.addNavPlace(null, "srusource.edit.srusource");
%>
<jsp:include page="/layout/topnav.jsp"/>
/impl/src/web/user/pop/messages.jsp
16,7 → 16,10
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/>
<div class="pop">
 
<%
try
{
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{};
Object[] args = new Object[]{};
25,17 → 28,35
if (popMessages == null)
{
%>
<p>
<bean:message key="pop.not.configured"/>
</p>
<table class="messages">
<tr>
<th>
<bean:message key="pop.title" arg0="${UserSession.user.pop3username}"/>
</th>
</tr>
<tr>
<th>
<bean:message key="pop.not.configured"/>
</th>
</tr>
</table
<%
}
else if (popMessages.size() == 0)
{
%>
<p>
<bean:message key="pop.no.messages"/>
</p>
<table class="messages">
<tr>
<th>
<bean:message key="pop.title" arg0="${UserSession.user.pop3username}"/>
</th>
</tr>
<tr>
<th>
<bean:message key="pop.no.messages"/>
</th>
</tr>
</table>
<%
}
else
45,6 → 66,8
<tr>
<th>
<bean:message key="pop.title" arg0="${UserSession.user.pop3username}"/>
<br>
<bean:message key="pop.last.messages"/>
</th>
<%--<th>--%>
<%--<bean:message key="pop.from"/>--%>
112,5 → 135,12
</table>
<%
}
}
catch(Throwable e)
{
%>
<p><bean:message key="pop.danger.messages"/></p>
<%
}
%>
</div>
/impl/etc/solr/conf.zip
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/impl/etc/solr/telHandler.war
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/impl/etc/solr/solrManager.zip
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/impl/etc/todo/todo.txt
1,3 → 1,17
 
 
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Novas Importacoes 200910 Problemas:
- Importações Importar Anos Anteriores
Notas
Sumarios
 
- Interface para aceder a cadeiras antigas
 
- Programas em Falta de anos anteriores não mostra os cursos que transitaram de ano de importacao
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
 
Questão da identificacao dos Noturnos
Listagem de Programas
- Ano > Curso >
/impl/etc/systemDown/top.jpg
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/impl/etc/systemDown/index.jsp
New file
0,0 → 1,95
<%--
Created by IntelliJ IDEA.
User: Jorge
Date: 7/Mai/2009
Time: 11:43:05
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=ISO-8859-1" language="java" %>
<html>
<head>
<title>Sistema temporariamente em Manutenção</title>
<style type="text/css">
<!--
#footer {
HEIGHT: 50px;
PADDING-TOP: 5px;
}
 
#footerStructure TABLE {
BORDER-RIGHT: 0;
BORDER-TOP: 0;
RIGHT: 0;
LEFT: 0;
MARGIN: 0;
BORDER-LEFT: 0;
WIDTH: 100%;
PADDING-TOP: 0;
BORDER-BOTTOM: 0;
TOP: 0;
border-spacing: 0
}
 
#footerStructure TABLE TD {
VERTICAL-ALIGN: top
}
 
#license UL {
COLOR: #4D4D4D;
PADDING-RIGHT: 0;
PADDING-LEFT: 0;
FONT-SIZE: 12px;
TEXT-ALIGN: center;
MARGIN: 0;
LIST-STYLE-TYPE: none;
}
 
#footer #organizations {
}
 
#footer #sponsors {
}
 
#footer a
/*, #footer a:visited */
{
color: #4d4d4d;
}
 
#footer a:hover {
color: #8EC73F;
}
-->
</style>
</head>
<body>
<img src="top.jpg" alt="ESTG">
<h1>O Sistema www.estgp.pt está temporariamente em Manutenção:</h1>
<h2>Pedimos desculpa pelo incómodo que esta paragem lhe possa causar.</h2>
<h2>Tipicamente este tipo de paragem leva apenas alguns minutos. Tentaremos ser breves.</h2>
<h3>A administração - bacodev [AT] estgp [DOT] pt</h3>
 
<div id="footerStructure">
<table>
<tr>
<td width="33%">
<div id="sponsors">
</div>
</td>
<td align="center" width="33%">
<div id="license">
<ul class="copyRightLink">
<li>Copyright © <a href="http://www.estgp.pt">ESTG</a> 2008</li>
<!--<li>Contact ESTG Webmaster at (webmaster [AT] estgp [DOT] pt)</li>-->
</ul>
</div>
</td>
<td width="33%" align="right">
<div id="organizations">
</div>
</td>
</tr>
</table>
</div>
</body>
</html>
/impl/etc/systemDown/WEB-INF/web.xml
New file
0,0 → 1,8
<?xml version="1.0" encoding="UTF-8"?>
 
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
/impl/etc/systemDown/ROOT.war
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream
/impl/build.xml
542,6 → 542,9
<target name="util.task.reset.urlsstats">
<java classname="pt.estgp.estgweb.services.urlstat.ResetRelativePathsService" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>
</target>
<target name="util.task.reset.urlsstats.digests">
<java classname="pt.estgp.estgweb.services.urlstat.ResetRelativePathsServiceDigests" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/>
</target>
 
 
</project>