Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 406 → Rev 489

/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/MessageResourcesCommon.properties
3,6 → 3,9
# ANNOUNCEMENTS MESSAGE RESOURCES
#
################################################################################
result.turn.off.filters=Limpar Filtros
search.pages.to=a
search.result.creator=Autor
search=Pesquisar
search.form=Formulário de Pesquisa
search.results=Resultados da Pesquisa ({0})
/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
35,6 → 36,9
course.M=Mestrado
course.P=Pós Graduação
course.E=CET
course.C=Acções de Formação de Curta Duração
course.A=Formações Avançadas
course.O=Outras Formações
 
course.Bs=Bacharlatos
course.Ls=Lincenciaturas
/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,53
################################################################################
#
# SRU SOURCES MESSAGE RESOURCES
#
################################################################################
module.SruSource=Pastas Partilhadas do Donald
 
srusource.filter.dirs=Filtrar Resultados por directório
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?
 
 
facet.facetType=Tipo
facet.facetLastModified=Ultima Modificação
facet.facetDir=Directorios
 
facet.facetType=Tipo
facet.facetLastModified=Ultima Modificação
facet.facetDir=Directorios
facet.date=Dia da Última Modificação
facet.year=Ano da Última Modificação
facet.month=Mês da Última Modificação
facet.type=Tipo de Ficheiro
facet.dir=Directório
 
facets=Filtre por Facetas
/impl/conf/language/MessageResources.properties
126,12 → 126,13
fail.role=Lamentamos o incómodo, mas necessita de permissões especiais para aceder a esta área.
fail.owner=Lamentamos o incómodo, mas não tem permissões sobre o objecto ao qual tentou aceder.
fail.timer=Lamentamos o incomodo, mas a acção que tentou efectuar não pode ser executada nesta data.
fail.authenticate=Falhou a autênticação
fail.authenticate=O nome de utilizador ou a palavra passe estão errados. Por favor tente de novo.
 
#palavras comuns
courseunit=Unidade Curricular
grade=Nota
date=Data
last.modification.date=Última modificação
code=Código
none=Nenhum
description=Descrição
308,7 → 309,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 → 324,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
56,6 → 58,8
courseunit.S2=2ª Semestre
courseunit.ALL=Todos os Semestres
courseunit.assignement.delivered.date=Data de Entrega
courseunit.assignement.delivered.date.first.version=Data de Entrega da Primeira Versão
courseunit.assignement.delivered.versions=Total de Versões Entregues
courseunit.assignement.deliver.date=Data Limite de Entrega
courseunit.assignement.deliver.type=Tipo de entrega
courseunit.assignement.deliver.type.zipfile=Ficheiro Comprimido (ZIP)
121,6 → 125,10
 
 
 
courseunits.contentsGrants=Permissões de Consulta dos Ficheiros de Conteúdos
courseunits.contentsGrants.PUBLIC=PUBLICAS
courseunits.contentsGrants.PRIVATE=PRIVADOS A ESTUDANTES E DOCENTES DA UNIDADE
courseunits.contentsGrants.INTERNAL=COMUNIDADE ACADÉMICA
 
 
 
/impl/conf/WEB-INF/struts/struts-courses.xml
23,6 → 23,9
 
<action path="/courses" forward="page.courses"/>
 
<action path="/coursesFromStudentPortal" forward="page.alunosInformacaoAcademicaPortalMenu.courses"/>
 
 
<action path="/startLoadCourse" forward="/courseController.do?dispatch=load"/>
<action path="/courseController"
type="pt.estgp.estgweb.web.controllers.courses.CoursesController"
/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-courses.xml
13,6 → 13,12
<put name="body" value="/public/courses/index.jsp"/>
</definition>
 
<definition name="page.alunosInformacaoAcademicaPortalMenu.courses" extends="page.alunosInformacaoAcademicaPortalMenu.proxy">
<put name="title" value="Cursos"/>
<put name="body" value="/public/courses/index.jsp"/>
</definition>
 
 
<definition name="page.load.course" extends="base.layout1">
<put name="title" value="Curso"/>
<put name="topnav" value="/public/courses/topnavCourse.jsp"/>
/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
152,6 → 152,8
<forward name="utilsLayoutIOnlineConfigurable.ftp" path="page.utilsLayoutIOnlineConfigurable.proxy.ftp"/>
</action>
 
 
 
<!--Portal Forward-->
<action path="/student" forward="page.portal.student"/>
<action path="/futureStudent" forward="page.portal.futureStudent"/>
193,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
30,6 → 30,9
email.courseunit.announcement.subject.pt={0}: {1} (ESTG)
email.courseunit.announcement.subject.en={0}: {1} (ESTG)
 
email.courseunit.work.subject.pt={0}: {1} (ESTG)
email.courseunit.work.subject.en={0}: {1} (ESTG)
 
email.courseunit.blogpost.subject.pt={0}: {1} (ESTG)
email.courseunit.blogpost.subject.en={0}: {1} (ESTG)
 
60,7 → 63,8
module.intranet=true
module.profile=true
module.sms=false
 
module.quotasImpressao=true
module.srusource=true
##################################################
# SMS
#
77,10 → 81,12
##################################################
##Proxy Servers
#If is an HTTP Server needs encoding config if FTP needs user pass config
#This server is the server for unit contents, must be named ionline, it is hardcoded
server.ionline=ftp://www.global.estgp.pt
server.ionline.start.path=
ionline.pass=baco
ionline.user=Baco_web
ionline.use.default.credentials.to.updates.and.deletes=false
 
server.estgp.start.path=
server.estgp=http://deptal.estgp.pt:9090/static
246,6 → 252,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
 
 
 
275,6 → 282,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
299,6 → 307,11
#########################################################################
# Imports SIGoES
#
 
siges.degree.1=L
siges.degree.4=M
siges.degree.8=C
 
national.institution.code=3122
siges.institution.code=1
ws.siges.wsdl=@ws.siges.wsdl@
398,4 → 411,45
 
 
 
########################################
# trabalhos
#
#########################################
#number of days to reminder be present in home tasks after expired work.
work.reminder.until.days.after.expired=10
home.courseunit.last.anouncements.expired.in.days=60
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=
 
 
 
############################################
# SRU Sources Layout Configuration
#
# Example Assessoria.De.Administracao.9685 \ AnoLectivo.2009-2010 \ Semestre1 \ Lingua.E.Cultura.I.Espanhola \ Conteudos
# for this example the following condition :
# directory pattern: .[\\\/]Semestre[12][\\\/]. This regex means *\Semestre1\* or *\Semestre2\* ignoring slash / or \
# the SubTitle Expression is the follow: "([3] - [0])"
#
#The result is this one: ICON filename [kb] (Lingua.E.Cultura.I.Espanhola - Assessoria.De.Administracao.9685)
# @collection@ is a special token to be replaced by collection name
############################################
 
 
srusource.path.condition.pattern.01=.[\\\\\\/]Semestre[12][\\\\\\/].
srusource.path.condition.template.01= ... > <b>{3}</b> > @collection@
 
srusource.path.condition.pattern.99=.
srusource.path.condition.template.99=(@collection@)
 
/impl/conf/template/email/courseUnitWork_en.txt
New file
0,0 → 1,23

# 0 : Course Unit Name
# 1 : Title
# 2 : Text
# 3 : Teacher
#
# Course Unit Assignement
#
Dear Student
 
A new work has been added in:
{0}
 
{1}
 
{2}
 
Best Regards {3}
 
---------------------------------------------
Escola Superior de Tecnologia e Gestão
Instituto Politécnico de Portalegre
http://www.estgp.pt
/impl/conf/template/email/courseUnitWork_pt.txt
New file
0,0 → 1,23

# 0 : Course Unit Name
# 1 : Title
# 2 : Text
# 3 : Teacher
#
# Course Unit Assignement
#
Caro estudante
 
Um novo trabalho foi adicionado na unidade:
{0}
 
{1}
 
{2}
 
Com os melhores cumprimentos {3}
 
---------------------------------------------
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/template/email/courseUnitAnnouncement_en.txt
1,3 → 1,4
 
# 0 : Course Unit Name
# 1 : Title
# 2 : Text
/impl/conf/template/email/courseUnitAnnouncement_pt.txt
1,4 → 1,5
# 0 : Course Unit Name

# 0 : Course Unit Name
# 1 : Title
# 2 : Text
# 3 : Teacher
/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>
1161,6 → 1172,16
<chain name="Logger"/>
</filterChains>
</service>
<service>
<name>LoadCoursesImportYearByType</name>
<implementationClass>pt.estgp.estgweb.services.courses.CoursesService</implementationClass>
<description>Load All Courses</description>
<isTransactional>true</isTransactional>
<defaultMethod>loadCoursesImportYearByType</defaultMethod>
<filterChains>
<chain name="Logger"/>
</filterChains>
</service>
 
 
 
1393,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/utils/StringsUtils.java
30,19 → 30,30
 
public static String getFormatedText(String text)
{
return getFormatedText(text,Integer.MAX_VALUE,Integer.MAX_VALUE);
}
public static String getFormatedText(String text, int maxlines, int maxLineSize)
{
int linesCounter = 1;
int lineSize = 0;
if (text == null || text.trim().length() == 0)
return "";
 
StringBuilder finalFormatedText = new StringBuilder();
boolean newLine = true;
for (int i = 0; i < text.length(); i++)
for (int i = 0; i < text.length() && linesCounter < maxlines; i++)
{
lineSize++;
 
if (newLine && text.charAt(i) == ' ')
{
finalFormatedText.append("&nbsp;");
}
else if (text.charAt(i) == '\n')
{
linesCounter++;
lineSize = 0;
finalFormatedText.append("<br>");
newLine = true;
}
63,6 → 74,13
finalFormatedText.append(text.charAt(i));
newLine = false;
}
 
/*Line Size Simulation*/
if(lineSize > maxLineSize)
{
linesCounter++;
lineSize = 0;
}
}
return finalFormatedText.toString();
}
/impl/src/java/jomm/dao/impl/AbstractDao.java
235,6 → 235,13
}
}
 
public List<CLAZZ> getAll()
{
Session s = getCurrentSession();
Query q = s.createQuery("select * from i where i in class " + getReferenceClass().getName());
return q.list();
}
 
/**
* Return all objects related to the implementation of this DAO with no
* filters.
/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;
45,7 → 46,7
this.lastUpdate = ftpFile.getTimestamp().getTime();
this.name = ftpFile.getName();
this.directory = ftpFile.isDirectory();
this.size = ftpFile.getSize();
this.size = ftpFile.getSize() / 1024;
if(name.lastIndexOf('.')>=0)
this.extension = name.substring(name.lastIndexOf('.'));
if (ftpFile.getType() == FTPFile.DIRECTORY_TYPE)
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/Email.java
27,6 → 27,7
 
private String subject;
private List<String> recipients;
private Message.RecipientType type = Message.RecipientType.TO;
private String from;
private String emailTemplateName;
private List<String> arguments;
41,7 → 42,17
this.arguments = arguments;
}
 
public Email(String subject, List<String> recipients, String from, String mailTemplateName, List<String> arguments, Message.RecipientType type)
{
this.type = type;
this.subject = subject;
this.recipients = recipients;
this.from = from;
this.emailTemplateName = mailTemplateName;
this.arguments = arguments;
}
 
 
public String getSubject()
{
return subject;
90,4 → 101,15
System.out.println(validEmail("e@e.pt"));
System.out.println(validEmail("jmachado@estgp.pt"));
}
 
 
public Message.RecipientType getType()
{
return type;
}
 
public void setType(Message.RecipientType type)
{
this.type = type;
}
}
/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");
82,7 → 108,7
public static final int NUMBER_ANNOUNCEMENT_TYPE_BOTTOM_FLASH_NEWS_INDEX = 2;
public static final int ANNOUNCEMENT_TYPE_TOP_FLASH_NEWS_TIMEOUT = ConfigProperties.getIntProperty("announcements.top.flash.news.timeout.miliseconds");
public static final List<String> ANNOUNCEMENT_NOT_STANDARD = ConfigProperties.getListValues("announcements.not.standard");
public static final int HOME_MAX_COURSE_UNIT_ANNOUNCEMENTS = 3;
 
public static List<String> USER_ROLES = ConfigProperties.getListValues("user.role");
 
public static final String STUDENT_ROLE = ConfigProperties.getProperty("user.student");
166,6 → 192,9
public static final String INTRANET_SETUP_FILE_NAME = ConfigProperties.getProperty("intranet.setup.filename");
 
 
public static final int COURSEUNIT_ASSIGNEMENT_NUMBER_DAYS_REMINDER_AFTER_EXPIRED = ConfigProperties.getIntProperty("work.reminder.until.days.after.expired");
public static final int HOME_MAX_COURSE_UNIT_ANNOUNCEMENTS = ConfigProperties.getIntProperty("home.courseunit.last.anouncements.max");
public static final int HOME_COURSE_UNIT_ANNOUNCEMENTS_EXPIRED_DAYS = ConfigProperties.getIntProperty("home.courseunit.last.anouncements.expired.in.days");
public static final String COURSEUNIT_ASSIGNEMENT_TYPE_NO_FILE = "nofile";
 
public static final String PROFILE_SCHOLAR_DEGREE_SUPERIOR = "superior";
218,6 → 247,13
public static final String EMAIL_COURSEUNIT_ANNOUNCEMENT_TEMPLATE_PT = "courseUnitAnnouncement_pt.txt";
public static final String EMAIL_COURSEUNIT_ANNOUNCEMENT_TEMPLATE_EN = "courseUnitAnnouncement_en.txt";
 
public static final String EMAIL_COURSEUNIT_WORK_SUBJECT_PT = ConfigProperties.getProperty("email.courseunit.work.subject.pt");
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");
public static final String EMAIL_COURSEUNIT_BLOGPOST_TEMPLATE_PT = "courseUnitBlogPost_pt.txt";
/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
1,34 → 1,31
package pt.estgp.estgweb.services.courses;
 
import pt.utl.ist.berserk.logic.serviceManager.IService;
import jomm.utils.FilesUtils;
import org.apache.log4j.Logger;
import org.dom4j.Document;
import pt.estgp.estgweb.Globals;
import pt.estgp.estgweb.domain.Course;
import pt.estgp.estgweb.domain.DomainObjectFactory;
import pt.estgp.estgweb.domain.RepositoryFileImpl;
import pt.estgp.estgweb.domain.UserSession;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.domain.views.CourseView;
import pt.estgp.estgweb.filters.chains.ResourceAccessControlEnum;
import pt.estgp.estgweb.services.data.IRepositoryFile;
import pt.estgp.estgweb.services.data.RepositoryService;
import pt.estgp.estgweb.services.data.IRepositoryFile;
import pt.estgp.estgweb.services.courseunits.LoadCourseUnitAnnouncements;
import pt.estgp.estgweb.services.courseunits.LoadCourseUnitService;
import pt.estgp.estgweb.services.expceptions.ServiceException;
import pt.estgp.estgweb.domain.views.CourseUnitView;
import pt.estgp.estgweb.domain.views.AnnouncementView;
import pt.estgp.estgweb.domain.views.CourseView;
import pt.estgp.estgweb.domain.*;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.filters.chains.ResourceAccessControlEnum;
import pt.estgp.estgweb.services.expceptions.AlreadyExistsException;
import pt.estgp.estgweb.utils.DatesUtils;
import pt.estgp.estgweb.utils.Dom4jUtil;
import pt.estgp.estgweb.utils.DatesUtils;
import pt.estgp.estgweb.Globals;
import org.apache.log4j.Logger;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import pt.utl.ist.berserk.logic.serviceManager.IService;
 
import java.util.List;
import java.util.ArrayList;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.List;
 
import jomm.utils.FilesUtils;
 
/*
* @author Goncalo Luiz gedl [AT] rnl [DOT] ist [DOT] utl [DOT] pt
*
81,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;
}
 
104,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);
}
130,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)
170,7 → 179,7
 
public List<CourseView> loadCoursesImportYearArea(String importYear, String area) throws ServiceException
{
List<Course> courses = DaoFactory.getCourseDaoImpl().findAllOrderByName(importYear,area);
List<Course> courses = DaoFactory.getCourseDaoImpl().findAllOrderByName(importYear,area,null);
List<CourseView> courseViews = new ArrayList<CourseView>();
for(Course c: courses)
{
192,6 → 201,18
}
return courseViews;
}
public List<CourseView> loadCoursesImportYearByType(String type) throws ServiceException
{
String importYearIntranet = DatesUtils.getImportYear();
List<Course> courses = DaoFactory.getCourseDaoImpl().findAllOrderByName(importYearIntranet,null,type);
List<CourseView> courseViews = new ArrayList<CourseView>();
for(Course c: courses)
{
CourseView courseView = new CourseView(c);
courseViews.add(courseView);
}
return courseViews;
}
 
 
 
/impl/src/java/pt/estgp/estgweb/services/courseunits/LoadTeachedUnitsAnnouncementsService.java
6,6 → 6,7
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.services.courseunits.impl.DefaultCourseUnitAnnouncements;
import pt.estgp.estgweb.Globals;
import pt.estgp.estgweb.utils.DatesUtils;
 
import java.util.List;
import java.util.ArrayList;
25,17 → 26,28
return courseUnitAnnouncementsLst;
 
Teacher t = DaoFactory.getTeacherDaoImpl().load(userSession.getUser().getId());
Set<CourseUnit> units = t.getTeachedUnits();
 
DatesUtils.SemestreModerate semestreModerate = DatesUtils.getSemestreModerate();
String semestre = null;
if(semestreModerate == DatesUtils.SemestreModerate.S1)
semestre = "S1";
else if(semestreModerate == DatesUtils.SemestreModerate.S2)
semestre = "S2";
 
List<CourseUnit> units = DaoFactory.getCourseUnitDaoImpl().loadTeachedImportYearSemestreUnits(t.getId(), DatesUtils.getImportYear(),semestre);
 
 
if(units == null)
return courseUnitAnnouncementsLst;
for(CourseUnit c: units)
{
if(c.getAnnouncements() != null && c.getAnnouncements().size()>0)
List<Announcement> announcements = DaoFactory.getCourseUnitAnnouncementDaoImpl().loadLastAnnouncements(c.getId(),Globals.HOME_MAX_COURSE_UNIT_ANNOUNCEMENTS,Globals.HOME_COURSE_UNIT_ANNOUNCEMENTS_EXPIRED_DAYS);
if(announcements != null && announcements.size()>0)
{
DefaultCourseUnitAnnouncements courseUnitAnnouncements = new DefaultCourseUnitAnnouncements();
courseUnitAnnouncements.setCourseUnit(c);
List<AnnouncementView> announcementViews = new ArrayList<AnnouncementView>();
for(Announcement a :c.getAnnouncements())
for(Announcement a :announcements)
{
if(announcementViews.size() > Globals.HOME_MAX_COURSE_UNIT_ANNOUNCEMENTS)
break;
/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);
 
59,6 → 59,7
defaultResult.setSubTitle(courseUnit.getCourseName());
defaultResult.setSubTitleKey(false);
defaultResult.setText(courseUnit.getObjectives());
defaultResult.setDate(courseUnit.getImportYear());
if (from == null)
defaultResult.setUrl("/startLoadCourseUnit.do?id=" + courseUnit.getId());
else
/impl/src/java/pt/estgp/estgweb/services/courseunits/DirectedCoordinatedUnitsService.java
119,7 → 119,7
}
else
{
courses = DaoFactory.getCourseDaoImpl().findAllOrderByName(importYear,area);
courses = DaoFactory.getCourseDaoImpl().findAllOrderByName(importYear,area,null);
}
 
List<CourseView> courseViews = new ArrayList<CourseView>();
/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
6,12 → 6,19
import pt.estgp.estgweb.domain.views.CourseUnitDeliverableView;
import pt.estgp.estgweb.domain.views.BlogView;
import pt.estgp.estgweb.domain.*;
import pt.estgp.estgweb.domain.enums.LangEnum;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.services.expceptions.ServiceException;
import pt.estgp.estgweb.services.data.RepositoryService;
import pt.estgp.estgweb.services.data.IRepositoryFile;
import pt.estgp.estgweb.services.blogs.CreateBlogService;
import pt.estgp.estgweb.services.email.SendEmailService;
import pt.estgp.estgweb.services.email.EMAILJob;
import pt.estgp.estgweb.services.jobs.JobScheduleService;
import pt.estgp.estgweb.filters.chains.ResourceAccessControlEnum;
import pt.estgp.estgweb.filters.exceptions.AccessDeniedException;
import pt.estgp.estgweb.utils.Email;
import pt.estgp.estgweb.Globals;
import org.apache.log4j.Logger;
 
import java.util.List;
51,7 → 58,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
{
73,10 → 83,31
repositoryService.updateRepositoryFile(assignement.getRepositoryStream(), file, contentType, extension, size, name, "courseunit.assignement.file " + courseUnit.getName() + " of " + userSession.getUser().getUsername(), ResourceAccessControlEnum.courseunitDomain);
}
 
 
if(assignement.isStatus())
trySendWorkEmail(assignement,userSession,newWork);
return loadCourseUnitWorks(id,userSession);
}
 
private void trySendWorkEmail(CourseUnitAssignement assignement, UserSession userSession,boolean newWork)
{
CourseUnit c = assignement.getCourseUnit();
List<User> users = new ArrayList<User>();
if(c.getStudents() != null)
users.addAll(c.getStudents());
if(c.getTeachers() != null)
users.addAll(c.getTeachers());
sendWorkEmail(assignement,c.getNormalizedName(), userSession, users,newWork);
}
 
SendEmailService sendEmailService = new SendEmailService();
 
private void sendWorkEmail(CourseUnitAssignement a, String desc, UserSession userSession, List<User> users, boolean newWork)
{
Email e = sendEmailService.getCourseUnitWorkEmail(a, LangEnum.PORTUGUESE,userSession,users,newWork);
EMAILJob emailJob = new EMAILJob(e);
JobScheduleService.getInstance().scheduleNow(emailJob,"CourseUnit Assignement Email:" + desc,userSession);
}
 
public CourseUnitView loadCourseUnitWorks(long id, UserSession userSession) throws ServiceException
{
CourseUnitView cV = loadCourseUnitService.run(id,false,false,false,userSession);
156,16 → 187,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
 
 
176,7 → 221,10
CourseUnitAssignementView courseUnitAssignementView = new CourseUnitAssignementView(assignement,assignement.getDeliverables().size());
for(CourseUnitDeliverable d: assignement.getDeliverables())
{
views.add(new CourseUnitDeliverableView(d,courseUnitAssignementView));
CourseUnitDeliverableView c = new CourseUnitDeliverableView(d,courseUnitAssignementView);
views.add(c);
RepositoryFileImpl repositoryFile = repositoryService.loadView(d.getDeliverableRepositoryStream());
c.setVersions(new ArrayList<RepositoryFileVersion>(repositoryFile.getRepositoryFileVersions()));
}
courseUnitAssignementView.setDeliverables(views);
courseUnitAssignementView.setCourseUnitView(new CourseUnitView(assignement.getCourseUnit()));
/impl/src/java/pt/estgp/estgweb/services/courseunits/LoadSubscribedUnitsAnnouncementsService.java
9,6 → 9,7
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.services.courseunits.impl.DefaultCourseUnitAnnouncements;
import pt.estgp.estgweb.Globals;
import pt.estgp.estgweb.utils.DatesUtils;
 
import java.util.Set;
import java.util.List;
28,17 → 29,26
return courseUnitAnnouncementsLst;
 
Student t = DaoFactory.getStudentDaoImpl().load(userSession.getUser().getId());
Set<CourseUnit> units = t.getSubscribedUnits();
DatesUtils.SemestreModerate semestreModerate = DatesUtils.getSemestreModerate();
String semestre = null;
if(semestreModerate == DatesUtils.SemestreModerate.S1)
semestre = "S1";
else if(semestreModerate == DatesUtils.SemestreModerate.S2)
semestre = "S2";
 
List<CourseUnit> units = DaoFactory.getCourseUnitDaoImpl().loadSubscribedImportYearSemestreUnits(t.getId(), DatesUtils.getImportYear(),semestre);
 
if(units == null)
return courseUnitAnnouncementsLst;
for(CourseUnit c: units)
{
if(c.getAnnouncements() != null && c.getAnnouncements().size() > 0)
List<Announcement> announcements = DaoFactory.getCourseUnitAnnouncementDaoImpl().loadLastAnnouncements(c.getId(),Globals.HOME_MAX_COURSE_UNIT_ANNOUNCEMENTS,Globals.HOME_COURSE_UNIT_ANNOUNCEMENTS_EXPIRED_DAYS);
if(announcements != null && announcements.size() > 0)
{
DefaultCourseUnitAnnouncements courseUnitAnnouncements = new DefaultCourseUnitAnnouncements();
courseUnitAnnouncements.setCourseUnit(c);
List<AnnouncementView> announcementViews = new ArrayList<AnnouncementView>();
for(Announcement a :c.getAnnouncements())
List<AnnouncementView> announcementViews = new ArrayList<AnnouncementView>();
for(Announcement a :announcements)
{
if(announcementViews.size() > Globals.HOME_MAX_COURSE_UNIT_ANNOUNCEMENTS)
break;
/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;
 
/**
53,7 → 54,7
if(Email.validEmail(recipient))
{
valid=true;
message.addRecipient(Message.RecipientType.TO,new InternetAddress(recipient));
message.addRecipient(email.getType(),new InternetAddress(recipient));
}
}
if(valid)
152,10 → 153,15
{
if(Email.validEmail(u.getEmail()))
recipients.add(u.getEmail());
if(Email.validEmail(u.getOutEmail()))
recipients.add(u.getOutEmail());
}
 
String subject = java.text.MessageFormat.format(subjectTxt,new String[]{announcement.getCourseUnit().getNormalizedName(),announcement.getTitle()});
return new Email(subject ,recipients, Globals.SYSTEM_EMAIL_BOX,template,arguments);
String fromEmail = Globals.SYSTEM_EMAIL_BOX;
if(announcement.getOwner() != null && Email.validEmail(announcement.getOwner().getEmail()))
fromEmail = announcement.getOwner().getEmail();
return new Email(subject ,recipients,fromEmail,template,arguments,Message.RecipientType.BCC);
}
 
public Email getCourseUnitBlogPostEmail(BlogPost post, LangEnum langEnum, String from, List<User> users)
185,13 → 191,70
{
if(Email.validEmail(u.getEmail()))
recipients.add(u.getEmail());
if(Email.validEmail(u.getOutEmail()))
recipients.add(u.getOutEmail());
}
 
String subject = java.text.MessageFormat.format(subjectTxt,new String[]{((CourseUnitBlog)post.getBlog()).getCourseUnit().getNormalizedName(),post.getTitle()});
return new Email(subject ,recipients, Globals.SYSTEM_EMAIL_BOX,template,arguments);
String fromEmail = Globals.SYSTEM_EMAIL_BOX;
if(post.getOwner() != null && Email.validEmail(post.getOwner().getEmail()))
fromEmail = post.getOwner().getEmail();
return new Email(subject ,recipients, fromEmail, template,arguments,Message.RecipientType.BCC);
}
 
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)
{
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
{
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;
}
 
List<String> recipients = new ArrayList<String>();
for(User u: users)
{
if(Email.validEmail(u.getEmail()))
recipients.add(u.getEmail());
if(Email.validEmail(u.getOutEmail()))
recipients.add(u.getOutEmail());
}
 
String subject = java.text.MessageFormat.format(subjectTxt,new String[]{assignement.getCourseUnit().getNormalizedName(),assignement.getTitle()});
 
String fromEmail = Globals.SYSTEM_EMAIL_BOX;
if(userSession!= null && userSession.getUser() != null && Email.validEmail(userSession.getUser().getEmail()))
fromEmail = userSession.getUser().getEmail();
return new Email(subject ,recipients,fromEmail,template,arguments,Message.RecipientType.BCC);
}
 
 
 
public Email getNewGradesEmail(List<String[]> grades, LangEnum langEnum, String studentEmail, String studentName)
{
List<String> arguments = new ArrayList<String>();
273,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
72,26 → 72,53
}
 
Aluno d = service.getSiGesWEBSoap().getAlunoInscrito(c, Globals.SIGES_INSTITUTION_CODE, year);
Student t = DaoFactory.getStudentDaoImpl().loadBySigesCode(d.getCodigo().intValue());
User u = DaoFactory.getUserDaoImpl().loadByUsernameOrSigesCode(d.getCodigo().intValue());
Student s = null;
boolean newUser = false;
if (t == null)
if(u != null && !(u instanceof Student))
{
t = DomainObjectFactory.createStudentImpl();
DaoFactory.getStudentDaoImpl().save(t);
logger.warn("Student " + u.getUsername() + "already exist in system, will merge both users");
// Set<Record> records = u.getCreatorRecords();
DaoFactory.getUserDaoImpl().delete(u);
logger.warn("Student " + u.getUsername() + "1");
i = 0;
AbstractDao.getCurrentSession().getTransaction().commit();
 
AbstractDao.getCurrentSession().beginTransaction();
logger.warn("Student " + u.getUsername() + "2");
s = DomainObjectFactory.createStudentImpl();
DaoFactory.getStudentDaoImpl().save(s);
// for(Record r:records)
// {
// r.setOwner(null);
// DaoFactory.getRecordDaoImpl().reattach(r);
// r.setOwner(s);
// }
newUser = true;
}
persist(d, t);
else if(u != null)
{
s = DaoFactory.getStudentDaoImpl().load(u.getId());
}
 
if (s == null)
{
s = DomainObjectFactory.createStudentImpl();
DaoFactory.getStudentDaoImpl().save(s);
newUser = true;
}
persist(d, s, newUser);
//Advising CommonsServicesManager before change password
 
if (newUser)
CommonServicesManager.getInstance().adviseNew(t);
CommonServicesManager.getInstance().adviseNew(s);
 
else
{
String password = t.getPassword();
t.setPassword(null);
CommonServicesManager.getInstance().adviseUpdate(t);
t.setPassword(password);
String password = s.getPassword();
s.setPassword(null);
CommonServicesManager.getInstance().adviseUpdate(s);
s.setPassword(password);
}
}
logMessages.addMessage(new DefaultLogMessage("import.students.terminating", LogMessageTypeEnum.INFO));
115,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)
175,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/sigesimports/ImportCourseService.java
4,6 → 4,7
import org.apache.log4j.Logger;
import pt.estgp.estgweb.Globals;
import pt.estgp.estgweb.utils.DatesUtils;
import pt.estgp.estgweb.utils.ConfigProperties;
import pt.estgp.estgweb.domain.Course;
import pt.estgp.estgweb.domain.CourseUnit;
import pt.estgp.estgweb.domain.DomainObjectFactory;
86,7 → 87,9
// DaoFactory.getCourseDaoImpl().save(c);
}
c.setName(d.getNomeCurso());
c.setDegree(d.getGrauCurso());
String grauBaco = ConfigProperties.getProperty("siges.degree."+d.getGrauCurso());
if(c.getDegree() == null)
c.setDegree(grauBaco);
c.setCode("" + d.getCodigoCurso().intValue());
c.setImportYear(year);
c.setInstitutionalCode("" + d.getCodigoInstituicao().intValue());
/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,11
public int getMaxResultsPage();
public String getQuery();
public String getSearchType();
public String getModuleInternalKey();
public String getDescription();
public List<IFacet> getFacets();
public String getQueryNoEncode();
public String getQueryUtf();
 
 
}
/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/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/common/impl/DefaultResult.java
1,6 → 1,7
package pt.estgp.estgweb.services.common.impl;
 
import pt.estgp.estgweb.services.common.IResult;
import jomm.utils.StringsUtils;
 
/**
* @author Jorge Machado
21,6 → 22,12
private boolean titleKey = false;
private boolean subTitleKey = false;
private boolean textKey = false;
private boolean absoluteUrl = false;
private String date;
private String creator;
private String directory;
private String sizeKb;
private String mime;
 
private LabelGroup subTitlesGroup = null;
 
45,6 → 52,14
this.bestFragments = bestFragments;
}
 
public String getMime() {
return mime;
}
 
public void setMime(String mime) {
this.mime = mime;
}
 
public String getTitle() {
return title;
}
65,6 → 80,13
return text;
}
 
public String getTextSummary()
{
if(text!=null)
return StringsUtils.getFragment(text,300);
return null;
}
 
public String getUrl() {
return url;
}
100,8 → 122,51
return subTitlesGroup;
}
 
 
public String getDate() {
return date;
}
 
public void setDate(String date) {
this.date = date;
}
 
public String getCreator() {
return creator;
}
 
public void setCreator(String creator) {
this.creator = creator;
}
 
public String getDirectory() {
return directory;
}
 
public void setDirectory(String directory) {
this.directory = directory;
}
 
public void setSubTitlesGroup(LabelGroup subTitlesGroup)
{
this.subTitlesGroup = subTitlesGroup;
}
 
 
public boolean isAbsoluteUrl() {
return absoluteUrl;
}
 
public void setAbsoluteUrl(boolean absoluteUrl) {
this.absoluteUrl = absoluteUrl;
}
 
 
public String getSizeKb() {
return sizeKb;
}
 
public void setSizeKb(String sizeKb) {
this.sizeKb = sizeKb;
}
}
/impl/src/java/pt/estgp/estgweb/services/common/impl/DefaultSearchResults.java
3,6 → 3,7
import pt.estgp.estgweb.services.common.ISearchResults;
import pt.estgp.estgweb.services.common.ModuleEnum;
import pt.estgp.estgweb.services.common.IResult;
import pt.estgp.estgweb.services.common.IFacet;
 
import java.util.List;
import java.util.ArrayList;
26,6 → 27,9
private int maxResultsPage;
private String query;
private String searchType;
private String moduleInternalKey = null;
private String description;
private List<IFacet> facets;
 
 
public ModuleEnum getModule() {
116,7 → 120,23
}
return query;
}
public String getQueryUtf() {
try
{
return URIUtil.encodePath(query,"UTF-8");
}
catch (URIException e)
{
e.printStackTrace();
}
return query;
}
public String getQueryNoEncode() {
 
return query;
 
}
 
public void setQuery(String query) {
this.query = query;
}
128,4 → 148,30
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;
}
 
 
public List<IFacet> getFacets() {
return facets;
}
 
public void setFacets(List<IFacet> facets) {
this.facets = facets;
}
}
/impl/src/java/pt/estgp/estgweb/services/common/CommonServicesManager.java
69,21 → 69,34
if (searchType == null)
searchType = SearchTypeEnum.AllWords;
CommonSearchResults commonSearchResults = new CommonSearchResults();
List<ISearchResults> results = new ArrayList<ISearchResults>();
if(query != null && query.trim().length() > 0)
{
 
for (ModuleEnum module : ModuleEnum.values())
{
if (module.getModuleCommonServices() != null)
 
List<ISearchResults> results = new ArrayList<ISearchResults>();
 
for (ModuleEnum module : ModuleEnum.values())
{
ISearchResults iSearchResults = search(userSession, query, searchType, module, 0, from);
if (iSearchResults != null && iSearchResults.getTotalResults() > 0)
if (module.getModuleCommonServices() != null)
{
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);
}
commonSearchResults.setResults(results);
else
{
commonSearchResults.setResults(new ArrayList<ISearchResults>());
}
commonSearchResults.setQuery(query);
commonSearchResults.setSearchType(searchType.getMessageKey());
return commonSearchResults;
104,7 → 117,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 → 125,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 → 141,10
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 → 159,27
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);
}
 
if(defaultResult.getCreator() != null && defaultResult.getCreator().trim().length() > 0)
{
String creator = defaultResult.getCreator();
 
defaultResult.setCreator(LuceneUtils.highlight(defaultResult.getCreator(), query));
if (defaultResult.getCreator() == null || defaultResult.getCreator().length() == 0)
defaultResult.setCreator(creator);
}
}
}
return searchResults;
}
else
return null;
return searchResultsList;
}
catch (FilterRetrieveException e)
{
/impl/src/java/pt/estgp/estgweb/services/common/DefaultFacet.java
New file
0,0 → 1,31
package pt.estgp.estgweb.services.common;
 
import java.util.List;
 
/**
* @author Jorge Machado
* @date 18/Nov/2009
* @time 11:20:10
* @email machadofisher@gmail.com
*/
public class DefaultFacet implements IFacet{
 
String index;
List<IFacetLabel> labels;
 
public String getIndex() {
return index;
}
 
public void setIndex(String index) {
this.index = index;
}
 
public List<IFacetLabel> getLabels() {
return labels;
}
 
public void setLabels(List<IFacetLabel> labels) {
this.labels = labels;
}
}
/impl/src/java/pt/estgp/estgweb/services/common/DefaultFacetLabel.java
New file
0,0 → 1,30
package pt.estgp.estgweb.services.common;
 
/**
* @author Jorge Machado
* @date 18/Nov/2009
* @time 11:21:02
* @email machadofisher@gmail.com
*/
public class DefaultFacetLabel implements IFacetLabel
{
String label;
int ocurrences;
 
 
public String getLabel() {
return label;
}
 
public void setLabel(String label) {
this.label = label;
}
 
public int getOccurrences() {
return ocurrences;
}
 
public void setOccurrences(int ocurrences) {
this.ocurrences = ocurrences;
}
}
/impl/src/java/pt/estgp/estgweb/services/common/IResult.java
17,9 → 17,16
public boolean isSubTitleKey();
public String getBestFragments();
public String getText();
public String getTextSummary();
public boolean isTextKey();
public String getUrl();
public boolean isAbsoluteUrl();
public LabelGroup getSubTitlesGroup();
public String getDate();
public String getCreator();
public String getDirectory();
public String getSizeKb();
public String getMime();
 
/**
* Class to support groups of labels
/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/QueryLanguageChars.java
New file
0,0 → 1,94
package pt.estgp.estgweb.services.common;
 
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.analysis.SimpleAnalyzer;
import org.apache.log4j.Logger;
 
/**
* @author Jorge Machado
* @date 20/Nov/2009
* @time 10:32:07
* @email machadofisher@gmail.com
*/
public enum QueryLanguageChars {
 
SLASH_ESCAPE("\"",false),
PLUS("+",false),
MINUS("-",false),
ANDe ("&&",false),
OR("||",false),
EXCL("!",false),
BRACKET_L("(",true),
BRACKET_R(")",true),
CHAV_L("{",false),
CHAV_R("}",false),
RECT_BRACKETS_L("[",false),
RECT_BRACKETS_R("]",false),
CIRCUNFLEX("^",false),
QUOTE("\"",false),
TIL("~",false),
ASTRISK("*",false),
QUESTION_MARK("?",false),
TWO_DOTS(":",true);
 
String chars;
boolean usual;
private static final Logger logger = Logger.getLogger(QueryLanguageChars.class);
 
private QueryLanguageChars(String chars, boolean usual)
{
this.usual = usual;
this.chars = chars;
}
 
public static String escape(String string)
{
for(QueryLanguageChars chars: values())
{
string = string.replace(chars.chars,"\\" + chars.chars);
}
logger.info("Final Escaped Query: " + string);
return string;
}
 
 
public static boolean containsSpecialNotUsual(String string)
{
for(QueryLanguageChars chars: values())
{
 
if(!chars.usual && string.indexOf(chars.chars) >= 0)
return true;
}
return false;
}
 
public static boolean contains(String string)
{
for(QueryLanguageChars chars: values())
{
if(string.indexOf(chars.chars) >= 0)
return true;
}
return false;
}
 
static QueryParser queryParser = new QueryParser("",new SimpleAnalyzer());
 
 
public static boolean isValid(String query)
{
if(query == null)
return false;
try {
queryParser.parse(query);
return true;
} catch (ParseException e) {
logger.info("bad query for SruSearchService:" + query + " -> " + e.toString());
logger.debug(e,e);
}
return false;
}
 
}
/impl/src/java/pt/estgp/estgweb/services/common/IFacetLabel.java
New file
0,0 → 1,12
package pt.estgp.estgweb.services.common;
 
/**
* @author Jorge Machado
* @date 18/Nov/2009
* @time 11:19:24
* @email machadofisher@gmail.com
*/
public interface IFacetLabel {
public String getLabel();
public int getOccurrences();
}
/impl/src/java/pt/estgp/estgweb/services/common/IFacet.java
New file
0,0 → 1,14
package pt.estgp.estgweb.services.common;
 
import java.util.List;
 
/**
* @author Jorge Machado
* @date 18/Nov/2009
* @time 11:06:18
* @email machadofisher@gmail.com
*/
public interface IFacet {
public String getIndex();
public List<IFacetLabel> getLabels();
}
/impl/src/java/pt/estgp/estgweb/services/ftpservices/FtpRequestForm.java
5,6 → 5,9
import java.io.InputStream;
import java.util.List;
 
import pt.estgp.estgweb.domain.CourseUnit;
import pt.estgp.estgweb.domain.views.CourseUnitView;
 
/**
* @author Jorge
* @date 26/Fev/2009
13,9 → 16,11
public class FtpRequestForm
{
 
CourseUnitView courseUnitView;
boolean savePassword = false;
String startPath;
String serverUrl;
String serverConfName;
 
String username;
String password;
26,6 → 31,22
String folderToDelete;
 
 
public CourseUnitView getCourseUnitView() {
return courseUnitView;
}
 
public void setCourseUnitView(CourseUnitView courseUnitView) {
this.courseUnitView = courseUnitView;
}
 
public String getServerConfName() {
return serverConfName;
}
 
public void setServerConfName(String serverConfName) {
this.serverConfName = serverConfName;
}
 
public boolean isSavePassword()
{
return savePassword;
/impl/src/java/pt/estgp/estgweb/services/ftpservices/FtpService.java
6,10 → 6,10
import pt.estgp.estgweb.services.email.IAddress;
import pt.estgp.estgweb.services.email.impl.DefaultPopEmail;
import pt.estgp.estgweb.services.email.impl.DefaultAddress;
import pt.estgp.estgweb.domain.UserSession;
import pt.estgp.estgweb.domain.UserImpl;
import pt.estgp.estgweb.domain.UserSessionImpl;
import pt.estgp.estgweb.domain.*;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.Globals;
import pt.estgp.estgweb.utils.ConfigProperties;
import pt.estgp.estgweb.web.utils.DatesUtils;
import pt.estgp.estgweb.web.FtpServer;
import org.apache.log4j.Logger;
42,37 → 42,82
 
private static final String FTP_PASSWORD = "pt.estgp.estgweb.services.ftpservices.FtpService.FTP_PASSWORD";
 
 
public String run(FtpRequestForm ftpRequestForm, UserSession userSession) throws IOException
{
if(ftpRequestForm.isSavePassword() && ftpRequestForm.getPassword() != null && ftpRequestForm.getPassword().trim().length() > 0)
{
((UserSessionImpl)userSession).put(FTP_PASSWORD,DesUtils.getInstance().encrypt(ftpRequestForm.getPassword()));
}
String passwordCode = (String) ((UserSessionImpl)userSession).get(FTP_PASSWORD);
 
boolean isStaticAccess = ConfigProperties.getBooleanProperty(ftpRequestForm.getServerConfName()+".use.default.credentials.to.updates.and.deletes");
String password;
if(passwordCode != null)
String username;
//This only works for Contents of CourseUnits, if user uses SavePassword than the password saved will be used
if(!ftpRequestForm.isSavePassword() && isStaticAccess)
{
logger.info("using saved password");
password = DesUtils.getInstance().decrypt(passwordCode);
if(ftpRequestForm.getCourseUnitView() != null)
{
CourseUnitImpl courseUnit = (CourseUnitImpl) DaoFactory.getCourseUnitDaoImpl().load(ftpRequestForm.getCourseUnitView().getId());
if(!courseUnit.isOwnedBy(userSession.getUser(),true))
{
logger.warn("Trying to admin FTP Folder, no permission for username:" + userSession.getUsername());
return "errors.ftp.no.permission";
}
username = ConfigProperties.getProperty(ftpRequestForm.getServerConfName() + ".user");
password = ConfigProperties.getProperty(ftpRequestForm.getServerConfName() + ".pass");
}
else
return "errors.ftp.no.permission";
}
else
{
logger.info("trying pop 3 password");
password = DesUtils.getInstance().decrypt(userSession.getUser().getPop3password());
if(ftpRequestForm.isSavePassword() && ftpRequestForm.getPassword() != null && ftpRequestForm.getPassword().trim().length() > 0)
{
((UserSessionImpl)userSession).put(FTP_PASSWORD,DesUtils.getInstance().encrypt(ftpRequestForm.getPassword()));
}
String passwordCode = (String) ((UserSessionImpl)userSession).get(FTP_PASSWORD);
 
if(passwordCode != null)
{
logger.info("using saved password");
password = DesUtils.getInstance().decrypt(passwordCode);
}
else
{
logger.info("trying pop 3 password");
password = DesUtils.getInstance().decrypt(userSession.getUser().getPop3password());
}
username = ftpRequestForm.getUsername();
if(username == null || username.trim().length() == 0)
username = userSession.getUsername();
}
String username = ftpRequestForm.getUsername();
if(username == null || username.trim().length() == 0)
username = userSession.getUsername();
FtpServer server = FtpServer.getNewServer(ftpRequestForm.getServerUrl(),username,password);
FTPClient client = server.getClient();
String result = "ftp.operation.success";
client.setFileType(FTP.BINARY_FILE_TYPE);
client.changeWorkingDirectory(ftpRequestForm.getStartPath());
if(ftpRequestForm.getFilesToImport() != null)
{
{
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);
 
73,6 → 73,9
defaultResult.setSubTitle(null);
defaultResult.setSubTitleKey(true);
defaultResult.setText(blog.getDescription());
defaultResult.setDate(new java.text.SimpleDateFormat("yyyy.MM.dd").format(blog.getUpdateDate()));
if(blog.getOwner() != null)
defaultResult.setCreator(blog.getOwner().getName());
if(blog instanceof CourseUnitBlog)
defaultResult.setUrl("/user/startLoadBlogFromCourseUnit.do?id=" + blog.getId());
else if(from == null)
/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);
 
72,6 → 72,9
defaultResult.setSubTitle(null);
defaultResult.setSubTitleKey(true);
defaultResult.setText(blogPost.getText());
defaultResult.setDate(new java.text.SimpleDateFormat("yyyy.MM.dd").format(blogPost.getUpdateDate()));
if(blogPost.getOwner() != null)
defaultResult.setCreator(blogPost.getOwner().getName());
MyCalendar myCalendar = new MyCalendar();
if (myCalendar.getMonth() != blogPost.getMonth() || myCalendar.getYear() != blogPost.getYear())
{
/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);
63,6 → 63,9
DefaultResult defaultResult = new DefaultResult();
defaultResult.setTitle(a.getTitle());
defaultResult.setSubTitle("announcements.type." + a.getType());
defaultResult.setDate(new java.text.SimpleDateFormat("yyyy.MM.dd").format(a.getUpdateDate()));
if(a.getOwner() != null)
defaultResult.setCreator(a.getOwner().getName());
defaultResult.setSubTitleKey(true);
defaultResult.setText(a.getText());
if(from == null)
75,6 → 78,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,349
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.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 pt.estgp.estgweb.utils.ConfigProperties;
import pt.estgp.estgweb.Globals;
import org.apache.log4j.Logger;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.analysis.SimpleAnalyzer;
import org.apache.lucene.analysis.Analyzer;
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.util.regex.Pattern;
import java.util.regex.Matcher;
import java.net.URLEncoder;
import java.net.URL;
 
/*
* @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)
{
boolean containsSpecialChars = false;
 
if(!QueryLanguageChars.isValid(search))
return null;
if(QueryLanguageChars.containsSpecialNotUsual(search))
{
containsSpecialChars = true;
}
 
// if(searchType == SearchTypeEnum.ExactPhrase && search.indexOf("AND") < 0)
// search = "\"" + search + "\"";
// if(searchType == SearchTypeEnum.AllWords && search)
// search = search.replace("(","\\(").replace(")","\\)").replace("[","\\[").replace("]","\\]").replace("{","\\{").replace("}","\\}").replace(":","\\:").replace("^","\\^");
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(sruSourceView.getCollectionField()).append(":\"" + collectionView.getCollection() + "\"");
appender = " OR ";
}
String finalQuery = "(" + collectionQuery.toString() + ") AND (" + search + ")";
logger.info("Sru server " + sruSourceView.getName() + " final query: " + finalQuery);
String service = "getSRUResponseWithThisQueryPhraseBoost";
if(containsSpecialChars)
service = "getSRUResponseWithThisQuery";
String sruRequest = sruSourceView.getUrl() + "?query=" + URLEncoder.encode(finalQuery,"UTF-8") + "&verb=" + service + "&startRecord=" + ((page*maxResults)+1) + "&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)
continue;
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);
 
XPath xPathFileName = dom.createXPath("./files:fileName");
xPathFileName.setNamespaceURIs(namespaces);
Element fileName = (Element) xPathFileName.selectSingleNode(doc);
 
XPath xPathFileSize = dom.createXPath("./files:fileSizeKB");
xPathFileSize.setNamespaceURIs(namespaces);
Element fileSizeKB = (Element) xPathFileSize.selectSingleNode(doc);
 
XPath xPathFileType = dom.createXPath("./files:fileType");
xPathFileType.setNamespaceURIs(namespaces);
Element fileType = (Element) xPathFileType.selectSingleNode(doc);
 
XPath xPathFileDateLastModified = dom.createXPath("./files:fileDateLastModified");
xPathFileDateLastModified.setNamespaceURIs(namespaces);
Element fileDateLastModified = (Element) xPathFileDateLastModified.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();
String relativePathStr = ((Element)fileRelativePath).getText();
defaultResult.setTitle(fileName.getText());
defaultResult.setSizeKb(fileSizeKB.getTextTrim());
defaultResult.setDirectory(relativePathStr);
 
 
 
 
defaultResult.setDate(fileDateLastModified.getTextTrim());
defaultResult.setMime(fileType.getTextTrim());
// defaultResult.setSubTitle(courseUnit.getCourseName());
// defaultResult.setSubTitleKey(false);
// defaultResult.setText(courseUnit.getObjectives());
String urlStr = ((Element)fileUrl).getTextTrim();
String[] pathItems = relativePathStr.trim().split("\\\\");
StringBuilder pathBuidler = new StringBuilder();
for(String item: pathItems)
{
if(item.trim().length() > 0)
pathBuidler.append("/").append(URLEncoder.encode(item,"ISO-8859-1").replace("+","%20"));
}
urlStr = urlStr.substring(0,urlStr.length() - (relativePathStr.length())) + pathBuidler.toString();
 
 
defaultResult.setUrl(urlStr);
 
defaultResult.setAbsoluteUrl(true);
 
XPath xPathCollection = dom.createXPath("./files:collection");
xPathFileUrl.setNamespaceURIs(namespaces);
Element collection = (Element) xPathCollection.selectSingleNode(doc);
defaultResult.setSubTitle(formatSubtitle(relativePathStr,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);
}
 
/*Facets*/
List<IFacet> facets = new ArrayList<IFacet>();
XPath xPathFacets = dom.createXPath("//files:facet");
xPathFacets.setNamespaceURIs(namespaces);
List<Element> facetsElems = xPathFacets.selectNodes(dom);
for(Element facetElem: facetsElems)
{
DefaultFacet defaultFacet = new DefaultFacet();
defaultFacet.setLabels(new ArrayList<IFacetLabel>());
defaultFacet.setIndex(facetElem.attribute("name").getValue());
if(!defaultFacet.getIndex().equals("dir") && !defaultFacet.getIndex().equals("facetDir"))
{
XPath xPathFacetLabel = dom.createXPath("./files:facetLabel");
xPathFacetLabel.setNamespaceURIs(namespaces);
List<Element> facetLabelElems = xPathFacetLabel.selectNodes(facetElem);
 
for(Element facetLabelElem: facetLabelElems)
{
DefaultFacetLabel facetLabel = new DefaultFacetLabel();
facetLabel.setOccurrences(Integer.parseInt(facetLabelElem.attribute("ocurr").getValue()));
facetLabel.setLabel(facetLabelElem.getTextTrim());
if(facetLabel.getOccurrences() > 0)
defaultFacet.getLabels().add(facetLabel);
}
if(defaultFacet.getLabels().size()>0)
facets.add(defaultFacet);
}
}
if(facets.size() > 0)
searchResultsSource.setFacets(facets);
}
catch (Throwable e)
{
logger.error(e,e);
}
 
if(searchResultsSource.getResults() != null && searchResultsSource.getResults().size() > 0)
searchResults.add(searchResultsSource);
}
}
return searchResults;
}
 
 
 
 
static HashMap<String, Pattern> patterns = new HashMap<String,Pattern>();
private String formatSubtitle(String path, String collection)
{
path = path.trim();
if(path.startsWith("\\") || path.startsWith("/"))
path = path.substring(1);
List<String> regexProps = ConfigProperties.getListProperties("srusource.path.condition.pattern");
for(String regexProp: regexProps)
{
String id = regexProp.substring(regexProp.lastIndexOf("."));
String patternStr = ConfigProperties.getProperty(regexProp);
 
String template = ConfigProperties.getProperty("srusource.path.condition.template" + id);
Pattern pattern = patterns.get(patternStr);
if(pattern == null)
{
pattern = Pattern.compile(patternStr);
patterns.put(patternStr,pattern);
}
Matcher matcher = pattern.matcher(path);
if(matcher.find())
{
String[] paths = path.split("[\\\\]");
template = template.replace("@collection@", collection);
return java.text.MessageFormat.format(template,paths);
}
}
return "(" + collection + ")";
}
 
 
 
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/enums/CourseUnitContentsGrants.java
New file
0,0 → 1,30
package pt.estgp.estgweb.domain.enums;
 
/**
* @author Jorge Machado
* @date 11/Mai/2010
* @time 15:54:05
* @email machadofisher@gmail.com
*/
public enum CourseUnitContentsGrants {
 
PUBLIC,
PRIVATE,
INTERNAL;
 
private CourseUnitContentsGrants()
{
}
 
public static CourseUnitContentsGrants parse(String grants)
{
if(grants == null)
return PUBLIC;
for(CourseUnitContentsGrants c: values())
{
if(grants.equals(c.name()))
return c;
}
return PUBLIC;
}
}
/impl/src/java/pt/estgp/estgweb/domain/CourseUnitImpl.java
1,5 → 1,7
package pt.estgp.estgweb.domain;
 
import pt.estgp.estgweb.domain.enums.CourseUnitContentsGrants;
 
import java.io.Serializable;
import java.util.List;
 
12,11 → 14,26
*/
public class CourseUnitImpl extends CourseUnit implements ICanManage
{
 
CourseUnitContentsGrants courseUnitContentsGrants = null;
 
public Serializable getSerializable()
{
return getId();
}
 
 
public CourseUnitContentsGrants getCourseUnitContentsGrants() {
if(courseUnitContentsGrants == null)
courseUnitContentsGrants = CourseUnitContentsGrants.parse(super.getContentsGrants());
return courseUnitContentsGrants;
}
 
public void setCourseUnitContentsGrants(CourseUnitContentsGrants courseUnitContentsGrants) {
super.setContentsGrants(courseUnitContentsGrants.name());
this.courseUnitContentsGrants = courseUnitContentsGrants;
}
 
public boolean isValid()
{
return true; //To change body of implemented methods use File | Settings | File Templates.
84,4 → 101,7
return false;
 
}
 
 
}
/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");
86,17 → 92,21
.list();
}
 
public List<Course> findAllOrderByName(String importYear, String area)
public List<Course> findAllOrderByName(String importYear, String area, String type)
{
Criteria c = createCriteria();
if (importYear != null && importYear.length() > 0)
c.add(eq("importYear", importYear));
if (area != null && area.length() > 0)
c.add(eq("area", area));
if (type != null && type.length() > 0)
c.add(eq("degree", type));
return c.addOrder(Order.asc("name"))
.list();
}
 
 
 
public List<String> loadImportYears()
{
Query q = createQuery("select distinct c.importYear from c in class " + Course.class.getName() + " order by c.importYear desc");
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/CourseUnitAnnouncementDaoImpl.java
47,4 → 47,12
.addOrder(Order.desc("saveDate")).list();
}
 
public List<Announcement> loadLastAnnouncements(long courseUnitId, int max, int maxExpiredDays)
{
Date daysBefore = new Date(new Date().getTime() - (maxExpiredDays * 24 * 60 * 60 * 1000));
return createCriteria()
.add(Restrictions.eq("courseUnit.id", courseUnitId))
.add(Restrictions.ge("saveDate",daysBefore))
.addOrder(Order.desc("saveDate")).list();
}
}
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/UserDaoImpl.java
210,4 → 210,9
{
return createCriteria().add(or(or(or(eq("email",email),eq("outEmail",email)),eq("gmail",email)),eq("msn",email))).list();
}
 
public User loadByUsernameOrSigesCode(int sigesCode)
{
return (User) createCriteria().add(or(eq("sigesCode",sigesCode),eq("username","a" + sigesCode))).uniqueResult();
}
}
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/BlogDaoImpl.java
120,16 → 120,18
 
public int countBlogs(String query, SearchTypeEnum searchType, List<String> roles, Object o, boolean internal)
{
Criterion c = DaoUtils.createSearchQuery(query,searchType,"description","title");
Criterion c = DaoUtils.createSearchQuery(query,searchType,"description","title","o.name");
Criteria criteria = createRestrictionsCriteria(roles, internal);
criteria.createAlias("owner","o");
criteria.add(c);
return criteria.list().size();
}
 
public List<Blog> searchBlogs(String query, SearchTypeEnum searchTypeEnum, int maxBlogs, int page, List<String> roles, boolean internal)
{
Criterion c = DaoUtils.createSearchQuery(query, searchTypeEnum, "description", "title");
Criterion c = DaoUtils.createSearchQuery(query, searchTypeEnum, "description", "title","o.name");
Criteria criteria = createRestrictionsCriteria(roles, internal);
criteria.createAlias("owner","o");
criteria.add(c)
.setMaxResults(maxBlogs)
.setFirstResult(page * maxBlogs);
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/StudentDaoImpl.java
28,6 → 28,8
return (Student) createCriteria().add(eq("sigesCode",sigesCode)).uniqueResult();
}
 
 
public Student loadBySigesCode(String sigesCode)
{
return (Student) createCriteria().add(eq("sigesCode",sigesCode)).uniqueResult();
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/BlogPostDaoImpl.java
125,16 → 125,18
 
public int countBlogPosts(String query, SearchTypeEnum searchType, List<String> roles, Object o, boolean internal)
{
Criterion c = DaoUtils.createSearchQuery(query,searchType,"text","title");
Criterion c = DaoUtils.createSearchQuery(query,searchType,"text","title","o.name");
Criteria criteria = createRestrictionsCriteria(roles, internal);
criteria.createAlias("owner","o");
criteria.add(c);
return criteria.list().size();
}
 
public List<BlogPost> searchBlogPosts(String query, SearchTypeEnum searchTypeEnum, int maxBlogs, int page, List<String> roles, boolean internal)
{
Criterion c = DaoUtils.createSearchQuery(query, searchTypeEnum, "text", "title");
Criterion c = DaoUtils.createSearchQuery(query, searchTypeEnum, "text", "title","o.name");
Criteria criteria = createRestrictionsCriteria(roles, internal);
criteria.createAlias("owner","o");
criteria.add(c)
.setMaxResults(maxBlogs)
.setFirstResult(page * maxBlogs);
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/CourseUnitAssignementDaoImpl.java
4,9 → 4,13
import org.hibernate.Query;
import pt.estgp.estgweb.domain.CourseUnitAssignement;
import pt.estgp.estgweb.domain.CourseUnitAssignementImpl;
import pt.estgp.estgweb.Globals;
 
import java.util.List;
import java.util.Date;
 
import jomm.dao.impl.AbstractDao;
 
/**
* @author Jorge Machado
* @date 28/Fev/2008
30,13 → 34,26
 
public List<CourseUnitAssignementImpl> loadActiveAssignements(long userID)
{
Date now = new Date();
Date dDaysBefore = new Date(now.getTime() - (Globals.COURSEUNIT_ASSIGNEMENT_NUMBER_DAYS_REMINDER_AFTER_EXPIRED * 24 * 60 * 60 * 1000 ));
return createCriteria()
.add(ge("deliverDate",dDaysBefore))
.createAlias("courseUnit","cu")
.createAlias("cu.students","cus")
.add(eq("status",true))
.add(eq("cus.id",userID)).list();
}
 
public static void main(String [] args)
{
 
AbstractDao.getCurrentSession().beginTransaction();
List<CourseUnitAssignementImpl> l = new CourseUnitAssignementDaoImpl().loadActiveAssignements(524);
for(CourseUnitAssignement a:l)
System.out.println(a.getTitle() + ":"+ a.getCourseUnit().getName());
AbstractDao.getCurrentSession().getTransaction().commit();
}
 
public List<CourseUnitAssignementImpl> loadDeliveredAssignements(long userID)
{
return createCriteria()
/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
9,6 → 9,7
import pt.estgp.estgweb.utils.DatesUtils;
import pt.estgp.estgweb.Globals;
import static org.hibernate.criterion.Restrictions.*;
import static org.hibernate.criterion.Restrictions.eq;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Order;
import org.hibernate.Criteria;
70,6 → 71,16
.createAlias("students", "st")
.add(eq("st.id", studentId)).addOrder(Order.asc("name")).list();
}
public List<CourseUnit> loadSubscribedImportYearSemestreUnits(long studentId, String importYear, String semestre)
{
Criteria c =createCriteria()
.add(eq("importYear", importYear))
.createAlias("students", "st")
.add(eq("st.id", studentId));
if(semestre != null)
c.add(eq("semestre", semestre));
return c.addOrder(Order.asc("name")).list();
}
 
public List<CourseUnit> loadSubscribedOtherImportYearUnits(long studentId, String importYear)
{
85,6 → 96,20
.add(eq("st.id", teacherId)).addOrder(Order.asc("importYear")).addOrder(Order.asc("name")).list();
}
 
public List<CourseUnit> loadTeachedImportYearSemestreUnits(long teacherId, String importYear, String semestre)
{
Criteria c =createCriteria()
.add(eq("importYear", importYear))
.createAlias("teachers", "st")
.add(eq("st.id", teacherId))
.add(eq("st.id", teacherId));
if(semestre != null)
c.add(eq("semestre", semestre));
return c.addOrder(Order.asc("name")).list();
}
 
 
 
public CourseUnit loadBySigesCodeUnique(String sigesCode)
{
return (CourseUnit) createCriteria().add(eq("code", sigesCode)).uniqueResult();
151,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/DaoUtils.java
12,7 → 12,7
* @see pt.estgp.estgweb.domain.dao
*/
public class DaoUtils
{
{
public static Criterion createSearchQuery(String query, SearchTypeEnum searchTypeEnum, String field1, String field2)
{
44,6 → 44,36
return c;
}
 
public static Criterion createSearchQuery(String query, SearchTypeEnum searchTypeEnum, String field1, String field2,String field3)
{
Criterion c = null;
if (searchTypeEnum == SearchTypeEnum.ExactPhrase)
c = or(or(like(field1, "%" + query + "%"), like(field2, "%" + query + "%")),like(field3, "%" + query + "%"));
else if (searchTypeEnum == SearchTypeEnum.AllWords)
{
String[] fields = query.trim().split(" ");
for (String field : fields)
{
if (c == null)
c = or(or(like(field1, "%" + field + "%"), like(field2, "%" + field + "%")),like(field3, "%" + field + "%"));
else
c = and(c, or(or(like(field1, "%" + field + "%"), like(field2, "%" + field + "%")),like(field3, "%" + field + "%")));
}
}
else
{
String[] fields = query.trim().split(" ");
for (String field : fields)
{
if (c == null)
c = or(or(like(field1, "%" + field + "%"), like(field2, "%" + field + "%")),like(field3, "%" + field + "%"));
else
c = or(c, or(or(like(field1, "%" + field + "%"), like(field2, "%" + field + "%")), like(field3, "%" + field + "%")));
}
}
return c;
}
 
public static Criterion createSearchQuery(String query, SearchTypeEnum searchTypeEnum, String field1)
{
Criterion c = null;
/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();
256,8 → 264,13
public void persistViewInObjectUser(User user)
{
user.setName(name);
user.setAddress(address);
user.setZip(zip);
user.setCountry(country);
user.setEmail(email);
user.setPhonenumber(phonenumber);
user.setOutEmail(outEmail);
 
user.setPop3server(pop3server);
user.setPop3username(pop3username);
if(pop3password != null && pop3password.length()> 0)
265,9 → 278,12
user.setSkype(skype);
user.setGmail(gmail);
user.setMsn(msn);
user.setPhonenumber(phonenumber);
user.setAddress(address);
user.setZip(zip);
user.setOffice(office);
user.setExt(ext);
 
 
 
user.setScholarDegree(scholarDegree);
if(user.getPassword() != null && user.getPassword().length() > 0 && password != null && password.length() > 0)
{
user.setPassword(BytesUtils.getDigestMD5Hex(password));
339,7 → 355,12
}
 
public String getName() {
return name;
if(deleted)
{
return "(Apagado do Sistema) " + name;
}
else
return name;
}
 
public void setName(String name) {
624,6 → 645,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/utils/CourseUnitDeliverableComparator.java
New file
0,0 → 1,49
package pt.estgp.estgweb.domain.views.utils;
 
import pt.estgp.estgweb.domain.RepositoryFileVersion;
import pt.estgp.estgweb.domain.views.CourseUnitDeliverableView;
 
import java.util.Comparator;
 
/**
* @author Jorge Machado
* @date 15/Dez/2009
* @time 18:15:22
* @email machadofisher@gmail.com
*/
public class CourseUnitDeliverableComparator implements Comparator<CourseUnitDeliverableView> {
 
 
public static CourseUnitDeliverableComparator FIRST_VERSION_DESC = new CourseUnitDeliverableComparator(true,true);
public static CourseUnitDeliverableComparator FIRST_VERSION_ASC = new CourseUnitDeliverableComparator(false,true);
public static CourseUnitDeliverableComparator LAST_VERSION_DESC = new CourseUnitDeliverableComparator(true,false);
public static CourseUnitDeliverableComparator LAST_VERSION_ASC = new CourseUnitDeliverableComparator(false,false);
 
int sort;
boolean first;
 
private CourseUnitDeliverableComparator(boolean desc, boolean first)
{
if(desc)
sort = 1;
else
sort = -1;
this.first = first;
}
 
public int compare(CourseUnitDeliverableView o1, CourseUnitDeliverableView o2)
{
if(!first)
{
if(o1.getDeliverDate().getTime() < o2.getDeliverDate().getTime()) return 1 * sort;
else if(o1.getDeliverDate().getTime() < o2.getDeliverDate().getTime()) return -1 * sort;
else return 0;
}
else
{
if(o1.getVersions().get(0).getSaveDate().getTime() < o2.getVersions().get(0).getSaveDate().getTime()) return 1 * sort;
else if(o1.getVersions().get(0).getSaveDate().getTime() < o2.getVersions().get(0).getSaveDate().getTime()) return -1 * sort;
else return 0;
}
}
}
/impl/src/java/pt/estgp/estgweb/domain/views/utils/RepositoryFileVersionComparator.java
New file
0,0 → 1,35
package pt.estgp.estgweb.domain.views.utils;
 
import pt.estgp.estgweb.domain.RepositoryFileVersion;
 
import java.util.Comparator;
 
/**
* @author Jorge Machado
* @date 15/Dez/2009
* @time 18:15:22
* @email machadofisher@gmail.com
*/
public class RepositoryFileVersionComparator implements Comparator<RepositoryFileVersion> {
 
 
public static RepositoryFileVersionComparator DESC = new RepositoryFileVersionComparator(true);
public static RepositoryFileVersionComparator ASC = new RepositoryFileVersionComparator(false);
 
int sort;
 
private RepositoryFileVersionComparator(boolean desc)
{
if(desc)
sort = 1;
else
sort = -1;
}
 
public int compare(RepositoryFileVersion o1, RepositoryFileVersion o2)
{
if(o1.getSaveDate().getTime() < o2.getSaveDate().getTime()) return 1 * sort;
else if(o1.getSaveDate().getTime() < o2.getSaveDate().getTime()) return -1 * sort;
else return 0;
}
}
/impl/src/java/pt/estgp/estgweb/domain/views/BlogPostView.java
29,6 → 29,7
private String text;
private Image image;
private GenericUser owner;
private long ownerId;
private String ownerUsername;
private String ownerName;
private String ownerEmail;
52,6 → 53,7
this.id = blogPost.getId();
this.owner = blogPost.getOwner();
ownerUsername = owner.getUsername();
ownerId = owner.getId();
ownerName = owner.getName();
ownerEmail = owner.getEmail();
this.blogId = blogPost.getBlog().getId();
203,6 → 205,11
return ownerUsername;
}
 
public long getOwnerId()
{
return ownerId;
}
 
public String getOwnerName()
{
return ownerName;
/impl/src/java/pt/estgp/estgweb/domain/views/AnnouncementView.java
371,6 → 371,16
return StringsUtils.getFormatedText(text);
}
 
public String getFormatedTextSummary(int maxLines, int maxLineSize)
{
return StringsUtils.getFormatedText(getText(),maxLines, maxLineSize);
}
 
public Boolean getFormatedTextBiggerThenPermited(int maxLines, int maxLineSize)
{
return StringsUtils.getFormatedText(getText()).length() > StringsUtils.getFormatedText(getText(),maxLines, maxLineSize).length();
}
 
public Boolean getTextBiggerThenPermited()
{
if(getInternalUrlPath() != null && getInternalUrlPath().trim().length()>0)
/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
1,13 → 1,15
package pt.estgp.estgweb.domain.views;
 
import pt.estgp.estgweb.domain.CourseUnitAssignement;
import pt.estgp.estgweb.domain.CourseUnitAssignementImpl;
import pt.estgp.estgweb.domain.CourseUnitDeliverableImpl;
import pt.estgp.estgweb.domain.CourseUnitDeliverable;
import pt.estgp.estgweb.domain.*;
import pt.estgp.estgweb.domain.views.utils.RepositoryFileVersionComparator;
import pt.estgp.estgweb.web.utils.DatesUtils;
import pt.estgp.estgweb.services.data.RepositoryService;
import pt.estgp.estgweb.services.data.IRepositoryFile;
 
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Collections;
 
/**
* @author Jorge Machado
22,9 → 24,13
private String fileStreamId;
private Date deliverDate;
private String deliverDateStr;
private String deliverDateMinutesSecondsStr;
private String deliverDateStrFirstVersion;
private String deliverDateMinutesSecondsStrFirstVersion;
private UserView student;
private String grade;
private String obs;
private List<RepositoryFileVersion> versions;
 
private CourseUnitDeliverable courseUnitDeliverable;
private CourseUnitAssignementView courseUnitAssignementView;
55,8 → 61,18
this.fileStreamId = courseUnitDeliverable.getDeliverableRepositoryStream();
this.deliverDate = courseUnitDeliverable.getDeliverDate();
this.deliverDateStr = DatesUtils.getStringFromDate(deliverDate);
if(courseUnitDeliverable.getStudent() != null)
this.student = new UserView(courseUnitDeliverable.getStudent());
this.deliverDateMinutesSecondsStr = DatesUtils.getStringFromDateWithMinutesAndSeconds(getDeliverDate());
//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;
}
 
97,6 → 113,40
}
 
 
public String getDeliverDateMinutesSecondsStrFirstVersion() {
return deliverDateMinutesSecondsStrFirstVersion;
}
 
public List<RepositoryFileVersion> getVersions() {
return versions;
}
 
public int getVersionsSize() {
if(versions == null)
return 0;
return versions.size();
}
 
public void setVersions(List<RepositoryFileVersion> versions)
{
this.versions = versions;
if(versions != null)
{
Collections.sort(versions, RepositoryFileVersionComparator.DESC);
deliverDateStrFirstVersion = DatesUtils.getStringFromDate(versions.get(0).getSaveDate());
deliverDateMinutesSecondsStrFirstVersion = DatesUtils.getStringFromDateWithMinutesAndSeconds(versions.get(0).getSaveDate());
}
}
 
 
public String getDeliverDateMinutesSecondsStr() {
return deliverDateMinutesSecondsStr;
}
 
public String getDeliverDateStrFirstVersion() {
return deliverDateStrFirstVersion;
}
 
public String getObs()
{
return obs;
148,6 → 198,11
this.deliverDateStr = deliverDateStr;
}
 
public String getDeliverDateStrMinutesSeconds()
{
return deliverDateMinutesSecondsStr;
}
 
private static final long milisecondsof24Hours=24*60*60*1000;
 
public boolean isLateDeliver()
/impl/src/java/pt/estgp/estgweb/domain/views/CourseUnitView.java
9,6 → 9,8
import java.io.Serializable;
import java.util.*;
 
import jomm.utils.StringsUtils;
 
/**
* @author Jorge Machado
* @date 2/Mar/2008
30,6 → 32,7
private String courseName;
private String semestre;
private String importYear;
private String contentsGrants;
private BlogView blog;
private String pathIntranet;
private String normalizedName;
110,6 → 113,7
this.semestre = courseUnit.getSemestre();
this.courseCode = courseUnit.getCourseCode();
this.objectives = courseUnit.getObjectives();
this.contentsGrants = courseUnit.getContentsGrants();
if(courseUnit.getProgramStreamId() != null)
{
programStreamId = courseUnit.getProgramStreamId();
232,6 → 236,14
return courseUnitAssignements;
}
 
public String getContentsGrants() {
return contentsGrants;
}
 
public void setContentsGrants(String contentsGrants) {
this.contentsGrants = contentsGrants;
}
 
public void setId(long id)
{
this.id = id;
260,6 → 272,7
public void persistViewInObject(CourseUnit c)
{
c.setObjectives(objectives);
c.setContentsGrants(contentsGrants);
}
 
public void persistViewAdminInObject(CourseUnit c)
279,6 → 292,11
return objectives;
}
 
public String getFormatedObjectives()
{
return StringsUtils.getFormatedText(objectives);
}
 
public void setObjectives(String objectives)
{
this.objectives = objectives;
/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/utils/DatesUtils.java
19,6 → 19,7
 
private static final Logger logger = Logger.getLogger(DatesUtils.class);
 
private static SimpleDateFormat minutesSecondsDateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
private static SimpleDateFormat filenameDateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
private static SimpleDateFormat userViewDateFormat = new SimpleDateFormat("yyyy/MM/dd");
 
29,6 → 30,13
return userViewDateFormat.format(d);
}
 
public static String getStringFromDateWithMinutesAndSeconds(Date d)
{
if(d == null)
return "";
return minutesSecondsDateFormat.format(d);
}
 
public static String getStringFromDateForFilename(Date d)
{
if(d == null)
/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/FtpServer.java
143,7 → 143,7
int port = url.getPort();
if (port <= 0)
port = 21;
logger.info("Connecting to " + host + "in port:" + port);
logger.info("Connecting to " + host + " in port:" + port);
FtpServer ftpServer = new FtpServer(host, port, user, pass);
servers.put(urlStr, ftpServer);
return ftpServer;
/impl/src/java/pt/estgp/estgweb/web/LayoutController.java
47,6 → 47,7
String server = ConfigProperties.getProperty("server." + serverParameter);
 
 
 
if (serverParameter == null || server == null || server.length() == 0 || path == null || layout == null)
throw new FileNotFoundException("url not found for server:" + server + " and path:" + path);
 
63,6 → 64,8
path = startPath + path;
request.setAttribute("path", path);
request.setAttribute("server", server);
request.setAttribute("serverConfName", serverParameter);
request.setAttribute("requestedStartPath", startPath);
 
String proxyHost = ConfigProperties.getProperty(serverParameter + ".proxy.host");
String proxyPort = ConfigProperties.getProperty(serverParameter + ".proxy.port");
/impl/src/java/pt/estgp/estgweb/web/form/blogs/BlogForm.java
100,9 → 100,9
addMessageWithKeys(errors, httpServletRequest, "errors.required", "blog.description");
if(blogView.getName()!=null)
blogView.setName(blogView.getName().trim());
if(blogView.getName() == null || !StringsUtils.checkLetters09AZazHiffenUnderScore(blogView.getName()))
if(blogView.getName() != null && blogView.getName().trim().length() > 0 && !StringsUtils.checkLetters09AZazHiffenUnderScore(blogView.getName()))
addMessage(errors, httpServletRequest, "blog.bad.name");
else
else if(blogView.getName() != null && blogView.getName().trim().length() > 0)
{
IServiceManager sm;
try
120,7 → 120,8
addMessage(errors, httpServletRequest, "error.500");
}
 
}
}else if(blogView.getName() != null && blogView.getName().trim().length() == 0)
blogView.setName(null);
return errors;
}
 
/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/UserSessionProxy.java
70,5 → 70,10
return (UserSession) request.getAttribute(Globals.USER_SESSION_KEY);
}
 
public static boolean isAuthenticated(HttpServletRequest request)
{
return request.getAttribute(Globals.USER_SESSION_KEY) != null && ((UserSession)request.getAttribute(Globals.USER_SESSION_KEY)).getUser() != null;
}
 
 
}
/impl/src/java/pt/estgp/estgweb/web/FtpManager.java
8,6 → 8,7
import pt.estgp.estgweb.services.ftpservices.FtpRequestForm;
import pt.estgp.estgweb.web.controllers.ApplicationDispatchController;
import pt.estgp.estgweb.web.utils.RequestUtils;
import pt.estgp.estgweb.domain.views.CourseUnitView;
import pt.utl.ist.berserk.logic.serviceManager.IServiceManager;
import pt.utl.ist.berserk.logic.serviceManager.ServiceManager;
 
69,6 → 70,7
String startPath = (String) request.getAttribute(DirWebProxy.FTP_ACTUAL_PATH_KEY);
if (startPath == null)
startPath = (String) request.getAttribute(LayoutController.FTP_ACTUAL_PATH_KEY);
String serverConfName = (String) request.getAttribute("serverConfName");
String savePassword = (String) request.getAttribute("savePassword");
String newFolder = (String) request.getAttribute("newFolder");
String deleteFile = (String) request.getAttribute("deleteFile");
83,6 → 85,10
{
 
FtpRequestForm ftpRequestForm = new FtpRequestForm();
CourseUnitView courseUnitView = (CourseUnitView) request.getAttribute("CourseUnitView");
if(courseUnitView != null)
ftpRequestForm.setCourseUnitView(courseUnitView);
ftpRequestForm.setServerConfName(serverConfName);
ftpRequestForm.setUsername(username);
ftpRequestForm.setPassword(password);
if (savePassword != null && savePassword.trim().length() > 0)
104,7 → 110,6
messageBack.addError(request, result);
else
messageBack.addMessage(request, result);
 
}
catch (Exception e)
{
/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
47,9 → 47,18
{
try
{
 
String query = request.getParameter("query");
if(query != null && query.trim().length() > 0)
{
if(!QueryLanguageChars.isValid(request.getParameter("query")))
query = QueryLanguageChars.escape(query);
}
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{};
Object[] args = new Object[]{request.getParameter("from"), request.getParameter("query"), SearchTypeEnum.parse(request.getParameter("searchType"))};
Object[] args = new Object[]{request.getParameter("from"), query, SearchTypeEnum.parse(request.getParameter("searchType"))};
 
ICommonSearchResults commonSearchResults = (ICommonSearchResults) sm.execute(RequestUtils.getRequester(request, response), "CommonServicesSearch", args, names);
request.setAttribute("ICommonSearchResults", commonSearchResults);
return mapping.findForward("searchResults");
76,7 → 85,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/updates/db/update6.sql
New file
0,0 → 1,2
ALTER TABLE `courseunit` ADD COLUMN `contentsGrants` VARCHAR(100) NOT NULL default 'INTERNAL' AFTER `status`;
ALTER TABLE `courseunit` ADD INDEX `pathIntranetIndex`(`pathIntranet`);
/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
27,6 → 27,7
<property name="programStreamId" type="string" index="programStreamIdIndex" />
<property name="validProgram" type="boolean" index="validProgramIndex"/>
<property name="status" type="boolean" index="statusIndex" />
<property name="contentsGrants" type="string"/>
<many-to-one name="validatorUser" class="pt.estgp.estgweb.domain.Teacher" lazy="false" outer-join="true"/>
<many-to-one name="course" class="pt.estgp.estgweb.domain.Course" lazy="false" outer-join="true"/>
<set name="blogs" cascade="delete" lazy="true" order-by="saveDate asc">
113,6 → 114,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"/>
57,6 → 59,9
<html:option value="M"><bean:message key="course.M"/></html:option>
<html:option value="P"><bean:message key="course.P"/></html:option>
<html:option value="E"><bean:message key="course.E"/></html:option>
<html:option value="A"><bean:message key="course.A"/></html:option>
<html:option value="C"><bean:message key="course.C"/></html:option>
<html:option value="O"><bean:message key="course.O"/></html:option>
</html:select>
* SIGES: <bean:write name="CourseForm" property="courseView.degree"/> - Confirmar Mestrados e Pos graduacoes e informar equipa de desenvolvimento
</td>
/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
85,12 → 85,39
font-size: 1.2em;
margin: 0;
}
.seccao h1 {
border-bottom:1px solid black;
padding:3px;
font-size: 1.3em;
margin: 0;
font-weight:bold;
}
 
h2 {
margin: 0;
.seccao h2 {
background-color: #8ec73f;
padding:2px;
border-bottom:1px solid black;
margin: 0;
font-size: 1em;
font-weight:normal;
padding-left:10px;
}
 
.seccao h3 {
padding:2px;
border-bottom:1px solid black;
font-size: 0.96em;
padding-left:20px;
}
 
.seccao h4 {
padding:2px;
border-bottom:1px solid black;
font-size: 0.9em;
font-weight:normal;
padding-left:35px;
}
 
.pFooter {
background-color: #8EC73F;
font-size: 0.8em;
175,7 → 202,7
}
 
#content h2 a {
font-size: 0.8em;
font-size: 1em;
}
 
#content h2 {
219,7 → 246,7
text-align:left;
}
 
#content a, .files a
#content a, .files a, a
/*, .content a:visited*/
{
color: #4d4d4d;
405,6 → 432,18
*
*****************************************************************/
 
.intranetLayout .searchTab
{
text-align:right;
padding:4px;
padding-bottom:4px;
white-space:nowrap;
margin:0;
}
.intranetLayout .searchTab input[type='text']
{
}
#searchResults li h1 {
 
background-color: #D6F0B2;
414,6 → 453,19
color: black;
}
 
#searchResults li .fragments {
padding-left:30px;
padding-right:10px;
}
#searchResults li .smallGreen {
 
padding-left:10px;
color: green;
text-decoration: none;
FONT: 10px "bitstream vera sans", "Lucida Grande", "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif
 
}
 
#searchResults li a {
cursor: pointer;
}
437,8 → 489,14
margin-top: 10px;
cursor: pointer;
padding-bottom: 0;
FONT: 12px "bitstream vera sans", "Lucida Grande", "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif
}
 
#searchResults li .module .result h2 a, #searchResults #googleModule .result h2, #searchResults #googleModule .result h2 a b i,{
 
FONT: 18px "bitstream vera sans", "Lucida Grande", "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif
}
 
#searchResults li .module .result p {
margin-top: 5px;
cursor: pointer;
854,11 → 912,23
text-align:justify;
}
 
 
 
#flashBottomNews .flashNew{
height:230px;
}
 
.flashNew
{
 
width:100%;
 
}
.flashNew th
{
vertical-align:top;
}
 
.flashNew td
{
background-color: #D3D3D3;
1378,6 → 1448,25
}
 
 
table.quadro
{
width:650px;
border: 1px solid black;
padding: 10px;
}
.quadro td
{
text-align:center;
}
table.quadro th
{
padding-bottom:5px;
}
table.quadro th.side
{
padding:0px;
text-align:left;
}
/*.messages td*/
.dataTable
{
1441,23 → 1530,29
{
border-top:1px solid #8ec73f;
}
.remindersContainer
.remindersContainer, .quotasImpressaoContainer, .messagesContainer, .searchTabContainer
{
vertical-align:top;
padding:0;
border:1px solid #8ec73f;
vertical-align:top;
}
.remindersContainer input { width:85px }
 
.reminders
{
text-align:center;
vertical-align:top;
width:200px;
float:right;
text-align:right;
padding:0;
margin:0;
}
.reminders #reminderForm
.reminders #reminderForm, #quotasImpressao
{
border: 1px solid #8ec73f;
}
#reminderForm
{
border-top: 1px solid #8fc840;
margin-top:4px;
}
.reminders .new input[type="text"]:hover,#activeReminders * img:hover,#expiredReminders * img:hover
1466,7 → 1561,7
}
#reminderForm textarea, #reminderForm table
{
width:100%;
width:95%;
}
#activeReminders, #expiredReminders
{
1474,8 → 1569,8
border-right: 1px solid #8ec73f;
margin-top:10px;
margin-bottom:10px;
margin-left:0;
margin-right:0;
margin-left:1px;
margin-right:1px;
padding-left:0;
padding-bottom:0;
padding-top:0;
1502,6 → 1597,8
.reminders .new .title
{
text-align:right;
padding-top:1px;
padding-right:3px;
}
.reminder
{
1606,5 → 1703,25
.ects
{
background-color:#EBFCD6;
}
}
 
 
 
/*FACETS*/
.facets .title {
background-color: #8EC73F;
color: #FFFFFF;
font-size: 1.2em;
 
}
.facets
{
border-left: 1px solid #8ec73f;
border-bottom: 1px solid #8ec73f;
}
 
.facets table
{
width:100%;
}
 
/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)
{
205,7 → 206,9
var objXmlHttp = null;
if (navigator.userAgent.indexOf("Opera")>=0)
{
alert("This example doesn't work in Opera") ;
objXmlHttp=new XMLHttpRequest();
objXmlHttp.onload=handler;
objXmlHttp.onerror=handler;
return objXmlHttp;
}
if (navigator.userAgent.indexOf("MSIE")>=0)
280,6 → 283,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 → 455,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 → 544,7
 
 
 
 
 
 
 
/impl/src/web/layout/searchForm.jsp
New file
0,0 → 1,93
<%@ 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">
 
 
<%
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\"";
 
 
%>
 
 
 
 
<%
if(request.getParameter("size") == null)
{
%>
<td class="searchTab">
<html:form action="/search" method="post">
<!--<input type="hidden" name="from" value="home"/>-->
<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.replace("\"","&quot;")%>"/>
</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>
<input type="hidden" name="searchType" value="search.type.all"/>
</html:form>
</td>
<%
}
else if(request.getParameter("size").equals("small"))
{
%>
<html:form action="/search" method="post">
<input type="hidden" name="dispatch" value="search"/>
<input type="hidden" name="from" value="Home"/>
<div class="searchTab">
<html:image page="/imgs/lupa.gif" altKey="search"/><input type="text" class="small" name="query" value="<%=query%>"/> <input type="submit" value=">>">
</div>
<input type="hidden" name="searchType" value="search.type.all"/>
</html:form>
<%
}
%>
 
 
</baco:isModuleOn>
/impl/src/web/layout/putIcon.jsp
New file
0,0 → 1,77
<%--
Created by IntelliJ IDEA.
User: Jorge
Date: 19/Nov/2009
Time: 11:22:24
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
String mime = (String) request.getAttribute("ICON_mime");
String label = (String) request.getAttribute("ICON_alt");
 
if(mime != null)
{
if (mime.toLowerCase().endsWith("doc") || mime.toLowerCase().endsWith("docx") || mime.endsWith("rtf"))
{
%>
<img alt="<%=mime%>" src="<%=request.getContextPath()%>/imgs/mime/doc.gif">
<%
}
else if (mime.toLowerCase().endsWith("pdf"))
{
%>
<img alt="<%=mime%>" src="<%=request.getContextPath()%>/imgs/mime/pdf.gif">
<%
}
else if (mime.toLowerCase().endsWith("ppt"))
{
%>
<img alt="<%=mime%>" src="<%=request.getContextPath()%>/imgs/mime/ppt.gif">
<%
}
else if (mime.toLowerCase().endsWith("zip") || mime.endsWith(".gz") || mime.endsWith("tgz"))
{
%>
<img alt="<%=mime%>" src="<%=request.getContextPath()%>/imgs/mime/zip.gif">
<%
}
else if (mime.toLowerCase().endsWith("rar"))
{
%>
<img alt="<%=label%>" src="<%=request.getContextPath()%>/imgs/mime/rar.gif">
<%
}
else if (mime.toLowerCase().endsWith("html") || mime.endsWith("htm"))
{
%>
<img alt="<%=label%>" src="<%=request.getContextPath()%>/imgs/mime/html.gif">
<%
}
else if (mime.toLowerCase().endsWith("xls") || mime.endsWith("xlsx"))
{
%>
<img alt="<%=label%>" src="<%=request.getContextPath()%>/imgs/mime/xls.gif">
<%
}
else if (mime.toLowerCase().endsWith("txt"))
{
%>
<img alt="<%=label%>" src="<%=request.getContextPath()%>/imgs/mime/txt.gif">
<%
}
else if (mime.toLowerCase().endsWith("xml"))
{
%>
<img alt="<%=label%>" src="<%=request.getContextPath()%>/imgs/mime/xml.gif">
<%
}
else
{
%>
<img alt="<%=label%>" src="<%=request.getContextPath()%>/imgs/mime/unknown.gif">
<%
}
}
 
%>
/impl/src/web/layout/navigationTop.jsp
58,10 → 58,10
<ul class="menu">
<li><html:link action="/courses?type=L"><bean:message key="course.Ls"/></html:link></li>
<li><html:link action="/courses?type=M"><bean:message key="course.Ms"/></html:link></li>
<li><a href="http://www.ipportalegre.pt/html1/3Cursos/8Acções%20de%20Formação.aspx ">Acções de Formação de Curta Duração</a></li>
<li><a href="<%=request.getContextPath()%>/proxy/layout4/estgp/public/portal/ensinoCET.html">CET</a></li>
<li><a href="<%=request.getContextPath()%>/proxy/layout4/estgp/public/portal/ensinoFomacoesAvancadas.html">Formações Avançadas </a></li>
<li><a href="<%=request.getContextPath()%>/proxy/layout4/estgp/public/portal/ensinoPosGraduacoes.html">Pós Graduações </a></li>
<li><html:link action="/courses?type=C"><bean:message key="course.C"/></html:link></li>
<li><html:link action="/courses?type=E"><bean:message key="course.E"/></html:link></li>
<li><html:link action="/courses?type=A"><bean:message key="course.A"/></html:link></li>
<li><html:link action="/courses?type=P"><bean:message key="course.P"/></html:link></li>
</ul>
</div>
</li>
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/courses/index.jsp
15,81 → 15,17
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
<%
String type = request.getParameter("type");
request.setAttribute("type",type);
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{};
Object[] args = new Object[]{};
Object[] args = new Object[]{type};
 
List<CourseView> courses = (List<CourseView>) sm.execute(RequestUtils.getRequester(request, response), "LoadCoursesImportYear", args, names);
request.setAttribute("Courses", courses);
List<CourseView> courses = (List<CourseView>) sm.execute(RequestUtils.getRequester(request, response), "LoadCoursesImportYearByType", args, names);
request.setAttribute("courses", courses);
 
List<CourseView> bs = new ArrayList<CourseView>();
List<CourseView> ls = new ArrayList<CourseView>();
List<CourseView> ms = new ArrayList<CourseView>();
List<CourseView> ps = new ArrayList<CourseView>();
List<CourseView> es = new ArrayList<CourseView>();
 
for (CourseView cv : courses)
{
if (cv.getDegree().equals("B"))
bs.add(cv);
else if (cv.getDegree().equals("L"))
ls.add(cv);
else if (cv.getDegree().equals("M"))
ms.add(cv);
else if (cv.getDegree().equals("P"))
ps.add(cv);
else if (cv.getDegree().equals("E"))
es.add(cv);
}
 
String type = request.getParameter("type");
request.setAttribute("type",type);
 
if(type != null && type.equals("B"))
request.setAttribute("bs",bs);
if(type != null && type.equals("L"))
request.setAttribute("ls",ls);
if(type != null && type.equals("M"))
request.setAttribute("ms",ms);
if(type != null && type.equals("P"))
request.setAttribute("ps",ps);
if(type != null && type.equals("E"))
request.setAttribute("es",es);
%>
<div class="seccao" >
<logic:notEmpty name="bs">
<a name="B"></a>
<h2><bean:message key="course.Bs"/></h2>
<%
request.setAttribute("courses",bs);
%>
<jsp:include page="courseList.jsp"/>
</logic:notEmpty>
 
<logic:notEmpty name="ls">
<a name="L"></a>
<h2><bean:message key="course.Ls"/></h2>
<%
request.setAttribute("courses",ls);
%>
<jsp:include page="courseList.jsp"/>
</logic:notEmpty>
 
<logic:notEmpty name="ms">
<a name="M"></a>
<h2><bean:message key="course.Ms"/></h2>
<%
request.setAttribute("courses",ms);
%>
<jsp:include page="courseList.jsp"/>
</logic:notEmpty>
 
<logic:notEmpty name="ps">
<a name="P"></a>
<h2><bean:message key="course.Ps"/></h2>
<%
request.setAttribute("courses",ps);
%>
<jsp:include page="courseList.jsp"/>
</logic:notEmpty>
<h2><bean:message key="course.${type}"/></h2>
<jsp:include page="courseList.jsp"/>
</div>
/impl/src/web/public/courses/courses.jsp
16,73 → 16,12
request.setAttribute("type",type);
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{};
Object[] args = new Object[]{};
List<CourseView> courses = (List<CourseView>) sm.execute(RequestUtils.getRequester(request, response), "LoadCoursesImportYear", args, names);
request.setAttribute("Courses", courses);
List<CourseView> bs = new ArrayList<CourseView>();
List<CourseView> ls = new ArrayList<CourseView>();
List<CourseView> ms = new ArrayList<CourseView>();
List<CourseView> ps = new ArrayList<CourseView>();
List<CourseView> es = new ArrayList<CourseView>();
Object[] args = new Object[]{type};
List<CourseView> courses = (List<CourseView>) sm.execute(RequestUtils.getRequester(request, response), "LoadCoursesImportYearByType", args, names);
request.setAttribute("courses", courses);
request.setAttribute("typeKey","course." + type);
 
for (CourseView cv : courses)
{
if (cv.getDegree().equals("B"))
bs.add(cv);
else if (cv.getDegree().equals("L"))
ls.add(cv);
else if (cv.getDegree().equals("M"))
ms.add(cv);
else if (cv.getDegree().equals("P"))
ps.add(cv);
else if (cv.getDegree().equals("E"))
es.add(cv);
}
 
request.setAttribute("bs", bs);
request.setAttribute("ls", ls);
request.setAttribute("ms", ms);
request.setAttribute("ps", ps);
request.setAttribute("es", es);
%>
 
<jsp:include page="courseMenuList.jsp"/>
 
 
<logic:equal value="B" name="type">
<logic:notEmpty name="bs">
<%
request.setAttribute("typeKey","course.Bs");
request.setAttribute("courses",bs);
%>
<jsp:include page="courseMenuList.jsp"/>
</logic:notEmpty>
</logic:equal>
 
<logic:equal value="L" name="type">
<logic:notEmpty name="ls">
<%
request.setAttribute("typeKey","course.Ls");
request.setAttribute("courses",ls);
%>
<jsp:include page="courseMenuList.jsp"/>
</logic:notEmpty>
</logic:equal>
 
<logic:equal value="M" name="type">
<logic:notEmpty name="ms">
<%
request.setAttribute("typeKey","course.Ms");
request.setAttribute("courses",ms);
%>
<jsp:include page="courseMenuList.jsp"/>
</logic:notEmpty>
</logic:equal>
<logic:equal value="P" name="type">
<logic:notEmpty name="ps">
<%
request.setAttribute("typeKey","course.Ps");
request.setAttribute("courses",ps);
%>
<jsp:include page="courseMenuList.jsp"/>
</logic:notEmpty>
</logic:equal>
/impl/src/web/public/portals/alunos/informacaoAcademicaLinks.jsp
7,10 → 7,10
topNav.setTitle("portal.informacao.academica");
String startLink = Globals.getStartLinkPortalMenu("informacaoAcademicaAlunosPortalMenu");
topNav.addNavPlace(startLink + "/informacaoAcademicaCalendarioEscolar.html"+Globals.PORTAL_ROLE_VIEW_STUDENT, "portal.informacao.academica.calendario.escolar");
topNav.addNavPlace(startLink + "/informacaoAcademicaLicenciaturas.html"+Globals.PORTAL_ROLE_VIEW_STUDENT, "portal.informacao.academica.licenciaturas");
topNav.addNavPlace(startLink + "/informacaoAcademicaMestrados.html"+Globals.PORTAL_ROLE_VIEW_STUDENT, "portal.informacao.academica.mestrados");
topNav.addNavPlace(startLink + "/informacaoAcademicaPosGraduacoes.html"+Globals.PORTAL_ROLE_VIEW_STUDENT, "portal.informacao.academica.pos.graduacoes");
topNav.addNavPlace(startLink + "/informacaoAcademicaCets.html"+Globals.PORTAL_ROLE_VIEW_STUDENT, "portal.informacao.academica.cets");
topNav.addNavPlace("/coursesFromStudentPortal.do" + Globals.PORTAL_ROLE_VIEW_STUDENT + "&type=L", "portal.informacao.academica.licenciaturas");
topNav.addNavPlace("/coursesFromStudentPortal.do" + Globals.PORTAL_ROLE_VIEW_STUDENT + "&type=M", "portal.informacao.academica.mestrados");
topNav.addNavPlace("/coursesFromStudentPortal.do" + Globals.PORTAL_ROLE_VIEW_STUDENT + "&type=P", "portal.informacao.academica.pos.graduacoes");
topNav.addNavPlace("/coursesFromStudentPortal.do" + Globals.PORTAL_ROLE_VIEW_STUDENT + "&type=E", "portal.informacao.academica.cets");
topNav.addNavPlace(startLink + "/informacaoAcademicaMaiores23.html"+Globals.PORTAL_ROLE_VIEW_STUDENT, "portal.informacao.academica.maiores.23");
topNav.addNavPlace(startLink + "/informacaoAcademicaOutrasFormacoes.html"+Globals.PORTAL_ROLE_VIEW_STUDENT, "portal.informacao.academica.outras.formacoes");
%>
/impl/src/web/public/portals/Docentes/informacaoAcademicaLinks.jsp
7,8 → 7,8
topNav.setTitle("portal.informacao.academica");
String startLink = Globals.getStartLinkPortalMenu("informacaoAcademicaDocentesPortalMenu");
topNav.addNavPlace(startLink + "/informacaoAcademicaCalendarioEscolar.html"+Globals.PORTAL_ROLE_VIEW_TEACHER, "portal.informacao.academica.calendario.escolar");
topNav.addNavPlace(startLink + "/informacaoAcademicaLicenciaturas.html"+Globals.PORTAL_ROLE_VIEW_TEACHER, "portal.informacao.academica.licenciaturas");
topNav.addNavPlace(startLink + "/informacaoAcademicaMestrados.html"+Globals.PORTAL_ROLE_VIEW_TEACHER, "portal.informacao.academica.mestrados");
topNav.addNavPlace(startLink + "/informacaoAcademicaPosGraduacoes.html"+Globals.PORTAL_ROLE_VIEW_TEACHER, "portal.informacao.academica.pos.graduacoes");
topNav.addNavPlace(startLink + "/informacaoAcademicaCets.html"+Globals.PORTAL_ROLE_VIEW_TEACHER, "portal.informacao.academica.cets");
topNav.addNavPlace("/coursesFromStudentPortal.do" + Globals.PORTAL_ROLE_VIEW_STUDENT + "&type=L", "portal.informacao.academica.licenciaturas");
topNav.addNavPlace("/coursesFromStudentPortal.do" + Globals.PORTAL_ROLE_VIEW_STUDENT + "&type=M", "portal.informacao.academica.mestrados");
topNav.addNavPlace("/coursesFromStudentPortal.do" + Globals.PORTAL_ROLE_VIEW_STUDENT + "&type=P", "portal.informacao.academica.pos.graduacoes");
topNav.addNavPlace("/coursesFromStudentPortal.do" + Globals.PORTAL_ROLE_VIEW_STUDENT + "&type=E", "portal.informacao.academica.cets");
%>
/impl/src/web/public/portals/futurosAlunos/informacaoAcademicaLinks.jsp
7,10 → 7,10
topNav.setTitle("portal.informacao.academica");
String startLink = Globals.getStartLinkPortalMenu("informacaoAcademicaFuturosAlunosPortalMenu");
topNav.addNavPlace(startLink + "/informacaoAcademicaCalendarioEscolar.html"+Globals.PORTAL_ROLE_VIEW_FUTURE_STUDENT, "portal.informacao.academica.calendario.escolar");
topNav.addNavPlace(startLink + "/informacaoAcademicaLicenciaturas.html"+Globals.PORTAL_ROLE_VIEW_FUTURE_STUDENT, "portal.informacao.academica.licenciaturas");
topNav.addNavPlace(startLink + "/informacaoAcademicaMestrados.html"+Globals.PORTAL_ROLE_VIEW_FUTURE_STUDENT, "portal.informacao.academica.mestrados");
topNav.addNavPlace(startLink + "/informacaoAcademicaPosGraduacoes.html"+Globals.PORTAL_ROLE_VIEW_FUTURE_STUDENT, "portal.informacao.academica.pos.graduacoes");
topNav.addNavPlace(startLink + "/informacaoAcademicaCets.html"+Globals.PORTAL_ROLE_VIEW_FUTURE_STUDENT, "portal.informacao.academica.cets");
topNav.addNavPlace("/coursesFromStudentPortal.do" + Globals.PORTAL_ROLE_VIEW_STUDENT + "&type=L", "portal.informacao.academica.licenciaturas");
topNav.addNavPlace("/coursesFromStudentPortal.do" + Globals.PORTAL_ROLE_VIEW_STUDENT + "&type=M", "portal.informacao.academica.mestrados");
topNav.addNavPlace("/coursesFromStudentPortal.do" + Globals.PORTAL_ROLE_VIEW_STUDENT + "&type=P", "portal.informacao.academica.pos.graduacoes");
topNav.addNavPlace("/coursesFromStudentPortal.do" + Globals.PORTAL_ROLE_VIEW_STUDENT + "&type=E", "portal.informacao.academica.cets");
topNav.addNavPlace(startLink + "/informacaoAcademicaMaiores23.html"+Globals.PORTAL_ROLE_VIEW_FUTURE_STUDENT, "portal.informacao.academica.maiores.23");
topNav.addNavPlace(startLink + "/informacaoAcademicaOutrasFormacoes.html"+Globals.PORTAL_ROLE_VIEW_FUTURE_STUDENT, "portal.informacao.academica.outras.formacoes");
%>
/impl/src/web/public/search/searchResults.jsp
12,7 → 12,7
<baco:isModuleOff module="searchGoogle">
<script language="Javascript" type="text/javascript">
var moduleResults = <%=ICommonSearchResults.getTotalResults()%>;
var query = '<%=ICommonSearchResults.getQuery()%>';
var query = '<%=ICommonSearchResults.getQuery()%>';
var searchType = '<%=ICommonSearchResults.getSearchType()%>';
if (moduleResults == 0 )
{
71,7 → 71,7
gWebSearch.gotoPage(googlePage);
else
{
var searchresults = document.getElementById("googleSearchResults");
var searchresults = getObjectById("googleSearchResults");
searchresults.innerHTML = "";
 
if (gWebSearch.cursor.estimatedResultCount > 0)
142,10 → 142,15
type="pt.estgp.estgweb.services.common.ISearchResults">
<li>
<h1>
<bean:message key="${searchResults.module.messageKey}"/>
<b>(${searchResults.totalResults})</b>
<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 id="${searchResults.module.messageKey}_total">(${searchResults.totalResults})</b>
<a id="${searchResults.module.messageKey}SeeMore"
href="javascript:showOrHideOne('${searchResults.module.messageKey}')">
href="javascript:showOrHideOne('${searchResults.module.messageKey}_${searchResults.moduleInternalKey}')">
<bean:message key="search.see.more"/>
</a>
</h1>
157,71 → 162,199
else
visibility = Globals.HIDDEN;
%>
<div class="module" id="<%=searchResults.getModule().getMessageKey()%>" style="<%=visibility%>">
<div id="${searchResults.module.messageKey}Results">
<logic:iterate id="result" name="searchResults" property="results"
type="pt.estgp.estgweb.services.common.IResult">
<div class="result">
<h2>
<logic:notEmpty name="result" property="url">
<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">
<bean:message key="${result.subTitle}"/>
<div class="module" id="${searchResults.module.messageKey}_${searchResults.moduleInternalKey}" style="<%=visibility%>">
<div align="right" id="turnOffFilters${searchResults.module.messageKey}_${searchResults.moduleInternalKey}" style="<%=Globals.HIDDEN%>;" >
<a onclick="hideOne('turnOffFilters${searchResults.module.messageKey}_${searchResults.moduleInternalKey}');return true;" href="javascript:searchCall('${searchResults.module.messageKey}_${searchResults.moduleInternalKey}Results','${searchResults.query}','${searchResults.searchType}','0','${searchResults.module.messageKey}','${searchResults.moduleInternalKey}','<%=request.getContextPath()%>/search.do')">
<bean:message key="result.turn.off.filters"/>
</a>
</div>
<br/>
<div id="${searchResults.module.messageKey}_${searchResults.moduleInternalKey}Results">
<table cellpadding="0" cellspacing="0" width="100%" style="padding:10px">
<tr>
<td valign="top">
<!--RESULTS-->
<%
int from = searchResults.getPage()*searchResults.getMaxResultsPage() + 1;
 
int to = (searchResults.getPage()+1)*searchResults.getMaxResultsPage();
if(to > searchResults.getTotalResults())
to = searchResults.getTotalResults();
%>
<p><bean:message key="search.pages.found.results"/> <%=from%> <bean:message key="search.pages.to"/> <%=to%> <bean:message key="search.pages.for.about"/> ${searchResults.totalResults}</p>
<logic:iterate id="result" name="searchResults" property="results"
type="pt.estgp.estgweb.services.common.IResult">
<div class="result">
<h2>
<logic:notEmpty name="result" property="mime">
<%
request.setAttribute("ICON_mime",result.getMime());
request.setAttribute("ICON_alt",result.getMime());
%>
<jsp:include page="/layout/putIcon.jsp"/>
</logic:notEmpty>
 
<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="sizeKb">
[${result.sizeKb} KB]
</logic:notEmpty>
<logic:notEmpty name="result" property="subTitle">
<logic:equal value="true" name="result" property="subTitleKey">
<bean:message key="${result.subTitle}"/>
</logic:equal>
<logic:notEqual value="true" name="result" property="subTitleKey">
${result.subTitle}
</logic:notEqual>
</logic:notEmpty>
<logic:notEmpty name="result" property="subTitlesGroup">
(
<%
String subTitleSeparator = "";
%>
<logic:iterate id="subTitleLabel" name="result" property="subTitlesGroup.labels">
<%=subTitleSeparator%>
<logic:equal value="true" name="subTitleLabel" property="key">
<bean:message key="${subTitleLabel.label}"/>
</logic:equal>
<logic:notEqual value="true" name="subTitleLabel" property="key">
${subTitleLabel.label}
</logic:notEqual>
 
<%
subTitleSeparator = ", ";
%>
</logic:iterate>
)
</logic:notEmpty>
</h2>
<logic:notEmpty name="result" property="date">
<p><b><bean:message key="last.modification.date"/>:</b> ${result.date}</p>
</logic:notEmpty>
<logic:notEmpty name="result" property="creator">
<p><b><bean:message key="search.result.creator"/>:</b> ${result.creator}</p>
</logic:notEmpty>
<logic:empty name="result" property="bestFragments">
<p class="fragments">${result.text}</p>
</logic:empty>
<logic:notEmpty name="result" property="bestFragments">
<p class="fragments">${result.bestFragments}</p>
</logic:notEmpty>
 
<logic:notEmpty name="result" property="directory">
<p class="smallGreen">${result.directory}</p>
<p> <bean:message key="srusource.filter.dirs"/> :
<%
String directory = result.getDirectory();
String[] paths = directory.split("[\\\\]");
String finalPath = "";
for(int i = 0; i < paths.length -1;i++)
{
String path = paths[i];
if(path.trim().length() > 0)
{
finalPath += "/" + path;
%>
\
<a href="javascript:searchCall('${searchResults.module.messageKey}_${searchResults.moduleInternalKey}Results','(<%=searchResults.getQueryNoEncode().replace("\"","&quot;")%>) AND dir:&quot;<%=finalPath%>&quot;','${searchResults.searchType}','0','${searchResults.module.messageKey}','${searchResults.moduleInternalKey}','<%=request.getContextPath()%>/search.do')" onclick="showOne('turnOffFilters${searchResults.module.messageKey}_${searchResults.moduleInternalKey}');return true;">
<%=path%>
</a>
<%
}
}
%>
</p>
</logic:notEmpty>
 
 
 
</div>
</logic:iterate>
<p class="pages">
<bean:message key="search.pages"/>
<logic:equal value="true" name="searchResults" property="hasPreviousPage">
<a href="javascript:searchCall('${searchResults.module.messageKey}_${searchResults.moduleInternalKey}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>
<logic:notEqual value="true" name="result" property="subTitleKey">
${result.subTitle}
</logic:notEqual>
)
</logic:notEmpty>
<logic:notEmpty name="result" property="subTitlesGroup">
(
<%
String subTitleSeparator = "";
%>
<logic:iterate id="subTitleLabel" name="result" property="subTitlesGroup.labels">
<%=subTitleSeparator%>
<logic:equal value="true" name="subTitleLabel" property="key">
<bean:message key="${subTitleLabel.label}"/>
</logic:equal>
<logic:notEqual value="true" name="subTitleLabel" property="key">
${subTitleLabel.label}
</logic:notEqual>
${searchResults.page2Screen}
<logic:equal value="true" name="searchResults" property="hasNextPage">
<a href="javascript:searchCall('${searchResults.module.messageKey}_${searchResults.moduleInternalKey}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>
</p>
 
<%
subTitleSeparator = ", ";
%>
</logic:iterate>
)
</logic:notEmpty>
</h2>
 
<p>${result.bestFragments} ...</p>
</div>
</logic:iterate>
<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')">
&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')">
<bean:message key="result.next"/>
&gt;</a>
</logic:equal>
</p>
</div>
</td>
<td valign="top">
<!--FACETS-->
<logic:notEmpty name="searchResults" property="facets">
<div class="facets">
<div class="title" style="white-space:nowrap;"><bean:message key="facets"/></div>
<table class="dataTable">
<logic:iterate id="facet" name="searchResults" property="facets" type="pt.estgp.estgweb.services.common.IFacet">
<tr>
<th colspan="2">
<bean:message key="facet.${facet.index}"/>
</th>
</tr>
<logic:iterate id="label" name="facet" property="labels" type="pt.estgp.estgweb.services.common.IFacetLabel">
<tr>
<td>
<%
if(facet.getIndex().equals("type") || facet.getIndex().equals("facetType"))
{
request.setAttribute("ICON_mime",label.getLabel());
request.setAttribute("ICON_alt",label.getLabel());
%>
<jsp:include page="/layout/putIcon.jsp"/> ${label.label}
<%
}
else
{
%>
${label.label}
<%
}
%>
</td>
<td align="right">
<a href="javascript:searchCall('${searchResults.module.messageKey}_${searchResults.moduleInternalKey}Results','(${searchResults.query}) AND ${facet.index}:&quot;${label.label}&quot;','${searchResults.searchType}','0','${searchResults.module.messageKey}','${searchResults.moduleInternalKey}','<%=request.getContextPath()%>/search.do')" onclick="showOne('turnOffFilters${searchResults.module.messageKey}_${searchResults.moduleInternalKey}');return true;">
${label.occurrences}
</a>
</td>
</tr>
</logic:iterate>
</logic:iterate>
</table>
</div>
</logic:notEmpty>
</td>
</tr>
</table>
</div>
<h3>
<a href="javascript:hide('${searchResults.module.messageKey}','${searchResults.module.messageKey}SeeMore')">Fechar</a>
<a href="javascript:hide('${searchResults.module.messageKey}_${searchResults.moduleInternalKey}','${searchResults.module.messageKey}SeeMore')">Fechar</a>
</h3>
</div>
</li>
/impl/src/web/public/search/searchForm.jsp
26,7 → 26,7
<bean:message key="search"/>
</td>
<td>
<html:text size="100%" styleClass="small" property="query" value=""/>
<html:text size="100%" styleClass="small" property="query" value=""/>
</td>
<td>
<input type="button" onclick="set(this.form,'search');this.form.submit()" value="<bean:message key="search"/>">
/impl/src/web/public/search/searchResultsModule.jsp
1,37 → 1,160
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="pt.estgp.estgweb.services.common.*" %>
<%@ page import="pt.estgp.estgweb.web.Globals" %>
<%@ 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" %>
<jsp:useBean id="ISearchResults" type="pt.estgp.estgweb.services.common.ISearchResults" scope="request"/>
<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>
<logic:notEmpty name="result" property="subTitle">
(
<logic:equal value="true" name="result" property="subTitleKey">
<bean:message key="${result.subTitle}"/>
</logic:equal>
<logic:notEqual value="true" name="result" property="subTitleKey">
${result.subTitle}
</logic:notEqual>
)
<table cellpadding="0" cellspacing="0" width="100%" style="padding:10px">
<tr>
<td valign="top">
<!--RESULTS-->
<%
int from = (ISearchResults.getPage()*ISearchResults.getMaxResultsPage()) + 1;
int to = (ISearchResults.getPage()+1)*ISearchResults.getMaxResultsPage();
if(to > ISearchResults.getTotalResults())
to = ISearchResults.getTotalResults();
%>
<p><bean:message key="search.pages.found.results"/> <%=from%> <bean:message key="search.pages.to"/> <%=to%> <bean:message key="search.pages.for.about"/> ${ISearchResults.totalResults}</p>
<logic:iterate id="result" name="ISearchResults" property="results"
type="pt.estgp.estgweb.services.common.IResult">
<div class="result">
 
<h2>
<logic:notEmpty name="result" property="mime">
<%
request.setAttribute("ICON_mime",result.getMime());
request.setAttribute("ICON_alt",result.getMime());
%>
<jsp:include page="/layout/putIcon.jsp"/>
</logic:notEmpty>
<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="sizeKb">
[${result.sizeKb} KB]
</logic:notEmpty>
<logic:notEmpty name="result" property="subTitle">
(
<logic:equal value="true" name="result" property="subTitleKey">
<bean:message key="${result.subTitle}"/>
</logic:equal>
<logic:notEqual value="true" name="result" property="subTitleKey">
${result.subTitle}
</logic:notEqual>
)
</logic:notEmpty>
</h2>
<logic:notEmpty name="result" property="date">
<p><b><bean:message key="last.modification.date"/>:</b> ${result.date}</p>
</logic:notEmpty>
<logic:notEmpty name="result" property="creator">
<p><b><bean:message key="search.result.creator"/>:</b> ${result.creator}</p>
</logic:notEmpty>
<logic:empty name="result" property="bestFragments">
<p class="fragments">${result.text}</p>
</logic:empty>
<logic:notEmpty name="result" property="bestFragments">
<p class="fragments">${result.bestFragments}</p>
</logic:notEmpty>
<logic:notEmpty name="result" property="directory">
<p class="smallGreen">${result.directory}</p>
<p> <bean:message key="srusource.filter.dirs"/> :
<%
String directory = result.getDirectory();
String[] paths = directory.split("[\\\\]");
String finalPath = "";
for(int i = 0; i < paths.length -1;i++)
{
String path = paths[i];
if(path.trim().length() > 0)
{
finalPath += "/" + path;
%>
\
<a href="javascript:searchCall('${ISearchResults.module.messageKey}_${ISearchResults.moduleInternalKey}Results','(<%=ISearchResults.getQueryNoEncode().replace("\"","&quot;")%>) AND dir:&quot;<%=finalPath%>&quot;','${ISearchResults.searchType}','0','${ISearchResults.module.messageKey}','${ISearchResults.moduleInternalKey}','<%=request.getContextPath()%>/search.do')" onclick="showOne('turnOffFilters${ISearchResults.module.messageKey}_${ISearchResults.moduleInternalKey}');return true;">
<%=path%>
</a>
<%
}
}
%>
</p>
</logic:notEmpty>
</div>
</logic:iterate>
Pages:
<logic:equal value="true" name="ISearchResults" property="hasPreviousPage">
<a href="javascript:searchCall('${ISearchResults.module.messageKey}_${ISearchResults.moduleInternalKey}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}_${ISearchResults.moduleInternalKey}Results','${ISearchResults.query}','${ISearchResults.searchType}','${ISearchResults.nextPage}','${ISearchResults.module.messageKey}','${ISearchResults.moduleInternalKey}','<%=request.getContextPath()%>/search.do')">next &gt;</a>
</logic:equal>
</td>
<td valign="top">
<!--FACETS-->
<logic:notEmpty name="ISearchResults" property="facets">
<div class="facets">
<div class="title" style="white-space:nowrap;"><bean:message key="facets"/></div>
<table class="dataTable">
<logic:iterate id="facet" name="ISearchResults" property="facets" type="pt.estgp.estgweb.services.common.IFacet">
<tr>
<th colspan="2">
<bean:message key="facet.${facet.index}"/>
</th>
</tr>
<logic:iterate id="label" name="facet" property="labels" type="pt.estgp.estgweb.services.common.IFacetLabel">
<tr>
<td>
<%
if(facet.getIndex().equals("type") || facet.getIndex().equals("facetType"))
{
request.setAttribute("ICON_mime",label.getLabel());
request.setAttribute("ICON_alt",label.getLabel());
%>
<jsp:include page="/layout/putIcon.jsp"/>
<%
}
else
{
%>
${label.label}
<%
}
%>
</td>
<td align="right">
<a href="javascript:searchCall('${ISearchResults.module.messageKey}_${ISearchResults.moduleInternalKey}Results','(${ISearchResults.query}) AND ${facet.index}:&quot;${label.label}&quot;','${ISearchResults.searchType}','0','${ISearchResults.module.messageKey}','${ISearchResults.moduleInternalKey}','<%=request.getContextPath()%>/search.do')" onclick="showOne('turnOffFilters${ISearchResults.module.messageKey}_${ISearchResults.moduleInternalKey}');return true;">
${label.occurrences}
</a>
</td>
</tr>
</logic:iterate>
</logic:iterate>
</table>
</div>
</logic:notEmpty>
</h2>
</td>
</tr>
</table>
 
<p>${result.bestFragments} ...</p>
</div>
</logic:iterate>
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>
</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>
</logic:equal>
 
 
/impl/src/web/public/blogs/blog.jsp
189,7 → 189,7
</tr>
<tr>
<td colspan="2" class="pFooter">
Posted by: (${post.ownerUsername}) ${post.ownerName} [AT] ${post.formatedSaveDate}
Posted by: <html:link page="/startProfile.do?userView.id=${post.ownerId}">(${post.ownerUsername}) ${post.ownerName}</html:link> [AT] ${post.formatedSaveDate}
</td>
</tr>
</baco:canLoad>
229,11 → 229,15
<%
String identifier = "" + BlogView.getId();
if(BlogView.getName() != null && BlogView.getName().length() > 0)
identifier = BlogView.getName();
{ identifier = BlogView.getName();
 
%>
<a href="<%=request.getContextPath()%>/blog/<%=identifier%>">
<%=Globals.SITE_URL + "/blog/" + identifier%>
</a>
<%
}
%>
<bean:message key="blog.owner"/>
<a href="mailto:${BlogView.ownerEmail}">${BlogView.owner.name}</a>
<bean:message key="at"/>
/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 width="100%">
<baco:isAuthenticated>
<tr>
<td colspan="2" class="searchTabContainer">
<jsp:include page="/layout/searchForm.jsp?size=small"/>
</td>
</tr>
<tr>
<td colspan="2" class="quotasImpressaoContainer" align="center">
<jsp:include page="/user/quotasImpressao/quotasImpressao.jsp"/>
</td>
</tr>
<tr>
<td colspan="2" class="remindersContainer" align="center">
<jsp:include page="/user/reminders/reminders.jsp"/>
</td>
</tr>
 
<tr>
<td colspan="2" class="messagesContainer" align="center"><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/getFlashNews.jsp
26,20 → 26,21
<table class="container">
<tr>
<td class="textContainer">
<%if(announcementView.getUrl()==null)
<%
if(announcementView.getUrl()==null)
{%>
<h2><a href="<%=request.getContextPath()%>/loadAnnouncement.do?id=<%=announcementView.getId()%>&dispatch=load"><%=announcementView.getTitle()%></a></h2>
<p><a href="<%=request.getContextPath()%>/loadAnnouncement.do?id=<%=announcementView.getId()%>&dispatch=load"><%=announcementView.getTextSummary()%></a></p>
<p><a href="<%=request.getContextPath()%>/loadAnnouncement.do?id=<%=announcementView.getId()%>&dispatch=load"><%=announcementView.getFormatedTextSummary(10,150)%> ... </a></p>
<%}
else if (!announcementView.getTextBiggerThenPermited())
else if (!announcementView.getFormatedTextBiggerThenPermited(10,150))
{%>
<h2><a href="<%=announcementView.getUrl()%>"><%=announcementView.getTitle()%></a></h2>
<p><a href="<%=announcementView.getUrl()%>"><%=announcementView.getText()%></a></p>
<p><a href="<%=announcementView.getUrl()%>"><%=announcementView.getFormatedText()%></a></p>
<%}
else
{%>
<h2><a href="<%=request.getContextPath()%>/loadAnnouncement.do?id=<%=announcementView.getId()%>&dispatch=load"><%=announcementView.getTitle()%></a></h2>
<p><a href="<%=request.getContextPath()%>/loadAnnouncement.do?id=<%=announcementView.getId()%>&dispatch=load"><%=announcementView.getTextSummary()%></a></p>
<p><a href="<%=request.getContextPath()%>/loadAnnouncement.do?id=<%=announcementView.getId()%>&dispatch=load"><%=announcementView.getFormatedTextSummary(10,150)%> ... </a></p>
<%}%>
</td>
<td class="imageContainer">
/impl/src/web/public/announcements/loadAnnouncement.jsp
55,6 → 55,9
</html:link>
</baco:canManage>
</h2>
<logic:notEmpty name="Announcement" property="url">
<p>URL: <html:link page="${Announcement.url}"><script type="text/javascript">document.write((""+document.location).substr(0,(""+document.location).lastIndexOf("/")));</script>${Announcement.url}</html:link></p>
</logic:notEmpty>
<%
AnnouncementStyleEnum styleEnum = Announcement.getStyleEnum();
 
77,6 → 80,7
%>
 
 
 
<p>
<div class="imageAnnouncement">
<%
308,7 → 312,9
</tr>
<logic:notEmpty name="Announcement" property="url">
<tr>
<td colspan="2"> &nbsp;&nbsp;&gt;&gt; <html:link href="${Announcement.url}">${Announcement.url}</html:link></td>
<td colspan="2">
URL: <html:link page="${Announcement.url}"><script type="text/javascript">document.write((""+document.location).substr(0,(""+document.location).lastIndexOf("/")));</script>${Announcement.url}</html:link>
</td>
</tr>
</logic:notEmpty>
<tr>
/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/courseunitassignement.jsp
1,6 → 1,8
<%@ page import="pt.estgp.estgweb.domain.Teacher" %>
<%@ page import="pt.estgp.estgweb.domain.TeacherImpl" %>
<%@ page import="jomm.utils.MessageResources" %>
<%@ page import="java.util.Collections" %>
<%@ page import="pt.estgp.estgweb.domain.views.utils.CourseUnitDeliverableComparator" %>
<%@ 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" %>
95,15 → 97,72
</logic:notEmpty>
</table>
</div>
 
<bean:define id="orderFirst" type="java.lang.String" scope="request" value=""/>
<bean:define id="orderLast" type="java.lang.String" scope="request" value=""/>
 
<%
// String orderFirst = "";
// String orderLast = "";
 
if (request.getParameter("sort") != null) {
String sortBy = request.getParameter("sort");
if (sortBy.equals("firstAsc"))
{
Collections.sort(CourseUnitAssignementView.getDeliverables(), CourseUnitDeliverableComparator.FIRST_VERSION_ASC);
%>
<bean:define id="orderFirst" type="java.lang.String" scope="request" value="firstDesc"/>
<bean:define id="orderLast" type="java.lang.String" scope="request" value="lastAsc"/>
<%
}
else if (sortBy.equals("firstDesc"))
{
Collections.sort(CourseUnitAssignementView.getDeliverables(), CourseUnitDeliverableComparator.FIRST_VERSION_DESC);
%>
<bean:define id="orderFirst" type="java.lang.String" scope="request" value="firstAsc"/>
<bean:define id="orderLast" type="java.lang.String" scope="request" value="lastAsc"/>
<%
}
else if (sortBy.equals("lastAsc"))
{
Collections.sort(CourseUnitAssignementView.getDeliverables(), CourseUnitDeliverableComparator.LAST_VERSION_ASC);
%>
<bean:define id="orderLast" type="java.lang.String" scope="request" value="lastDesc"/>
<bean:define id="orderFirst" type="java.lang.String" scope="request" value="firstAsc"/>
<%
}
else if (sortBy.equals("lastDesc"))
{
Collections.sort(CourseUnitAssignementView.getDeliverables(), CourseUnitDeliverableComparator.LAST_VERSION_DESC);
%>
<bean:define id="orderLast" type="java.lang.String" scope="request" value="lastAsc"/>
<bean:define id="orderFirst" type="java.lang.String" scope="request" value="firstAsc"/>
<%
}
else
{
%>
<bean:define id="orderFirst" type="java.lang.String" scope="request" value="firstAsc"/>
<bean:define id="orderLast" type="java.lang.String" scope="request" value="lastAsc"/>
 
<%
}
}
 
%>
 
<nested:form action="/user/courseUnitControllerFromHome">
<input type="hidden" name="dispatch" value="updateDeliverables">
<html:hidden property="courseUnitAssignementView.id" value="${CourseUnitAssignementView.id}"/>
 
<html:hidden property="courseUnitView.id" value="${CourseUnitView.id}"/>
 
<a name="works"/>
<table class="dataTable">
<tr>
<th><bean:message key="courseunit.assignement.delivered.date"/></th>
<th><bean:message key="courseunit.assignement.delivered.versions"/></th>
<th><html:link action="/user/startLoadCourseUnitAssignementFromHome?courseUnitAssignementView.id=${CourseUnitAssignementView.id}&sort=${orderFirst}#works"><bean:message key="courseunit.assignement.delivered.date.first.version"/></html:link></th>
<th><html:link action="/user/startLoadCourseUnitAssignementFromHome?courseUnitAssignementView.id=${CourseUnitAssignementView.id}&sort=${orderLast}#works"><bean:message key="courseunit.assignement.delivered.date"/></html:link></th>
<th><bean:message key="courseunit.assignement.deliver.time"/></th>
<th><bean:message key="number"/></th>
<th><bean:message key="name"/></th>
113,7 → 172,18
</tr>
<nested:iterate id="deliverable" property="courseUnitAssignementView.deliverables" type="pt.estgp.estgweb.domain.views.CourseUnitDeliverableView">
<tr>
<td>${deliverable.deliverDateStr} </td>
<td align="right">
 
<a href="javascript:showOrHideOne('work${deliverable.id}')">${deliverable.versionsSize}</a>
<div id="work${deliverable.id}" style="display:none;">
<nested:iterate id="version" name="deliverable" property="versions" type="pt.estgp.estgweb.domain.RepositoryFileVersion">
- <bean:message key="courseunit.assignement.deliver.version"/> (${version.saveDate})&nbsp;<br/>
</nested:iterate>
</div>
 
</td>
<td nowrap="nowrap" align="center">${deliverable.deliverDateMinutesSecondsStrFirstVersion} </td>
<td nowrap="nowrap" align="center">${deliverable.deliverDateStrMinutesSeconds} </td>
<logic:equal name="deliverable" property="lateDeliver" value="true">
<td class="statusERROR">
<bean:message key="courseunit.assignement.deliver.time.late"/>
126,7 → 196,7
</logic:notEqual>
<td align="right">${deliverable.student.code}</td>
<td>${deliverable.student.name}</td>
<td><a target="_blank" href="<%=request.getContextPath()%>/repositoryStream/${deliverable.fileStreamId}"><bean:message key="courseunit.assignement.deliver.version"/> (${deliverable.deliverDateStr})</a></td>
<td><a target="_blank" href="<%=request.getContextPath()%>/repositoryStream/${deliverable.fileStreamId}"><bean:message key="courseunit.assignement.deliver.version"/> (${deliverable.deliverDateMinutesSecondsStr})</a></td>
<td>
<nested:hidden property="id"/>
<nested:text property="grade"/>
/impl/src/web/user/courseunits/courseunit.jsp
39,7 → 39,7
<p>
<baco:cantManage name="CourseUnitView">
<logic:present name="CourseUnitView" property="objectives">
${CourseUnitView.objectives}
${CourseUnitView.formatedObjectives}
</logic:present>
<logic:notPresent name="CourseUnitView" property="objectives">
<bean:message key="courseunit.objectives.not.available"/>
49,7 → 49,18
<html:textarea styleClass="textarea" property="courseUnitView.objectives"/>
</baco:canManage>
</p>
<baco:canManage name="CourseUnitView">
<h2><bean:message key="courseunits.contentsGrants"/></h2>
<p>
<html:select property="courseUnitView.contentsGrants">
<%--<html:option value="PUBLIC"><bean:message key="courseunits.contentsGrants.PUBLIC"/></html:option>--%>
<html:option value="INTERNAL"><bean:message key="courseunits.contentsGrants.INTERNAL"/></html:option>
<html:option value="PRIVATE"><bean:message key="courseunits.contentsGrants.PRIVATE"/></html:option>
</html:select>
</p>
</baco:canManage>
<h2><bean:message key="courseunit.programfilepath"/></h2>
<p>
<baco:canManage name="CourseUnitView">
<logic:equal value="false" name="CourseUnitView" property="validProgram">
<html:file property="programFile"/>
/impl/src/web/user/courseunits/menu.jsp
1,4 → 1,13
<%@ 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 import="pt.estgp.estgweb.domain.enums.CourseUnitContentsGrants" %>
<%@ page import="pt.estgp.estgweb.web.UserSessionProxy" %>
<%@ page import="pt.estgp.estgweb.domain.UserImpl" %>
<%@ page import="pt.estgp.estgweb.domain.UserSession" %>
<%@ 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 → 54,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 → 77,83
<html:link action="${user}/startLoadCourseUnitStudents${fromAction}?courseUnitView.id=${CourseUnitView.id}"><bean:message key="courseunit.students"/></html:link>
</li>
 
<%
UserSession userSession = UserSessionProxy.loadUserSessionFromRequest(request);
CourseUnitContentsGrants contentsGrants = CourseUnitContentsGrants.parse(CourseUnitView.getContentsGrants());
if ( contentsGrants == CourseUnitContentsGrants.PUBLIC ||
(contentsGrants == CourseUnitContentsGrants.INTERNAL && UserSessionProxy.isAuthenticated(request)) ||
(contentsGrants == CourseUnitContentsGrants.PRIVATE && UserSessionProxy.isAuthenticated(request) &&
(((UserImpl) ((userSession.getUser()))).isTeacherOfCourseUnit(CourseUnitView.getId()) ||
((UserImpl) ((userSession.getUser()))).isStudentfCourseUnit(CourseUnitView.getId()))))
{
%>
<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>
<%
}
%>
 
<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>
151,55 → 151,55
&nbsp;
 
<%
if (i.getName().endsWith("doc") || i.getName().endsWith("rtf"))
if (i.getName().toLowerCase().endsWith("doc") || i.getName().endsWith("rtf"))
{
%>
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/doc.gif">
<%
}
else if (i.getName().endsWith("pdf"))
else if (i.getName().toLowerCase().endsWith("pdf"))
{
%>
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/pdf.gif">
<%
}
else if (i.getName().endsWith("ppt"))
else if (i.getName().toLowerCase().endsWith("ppt"))
{
%>
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/ppt.gif">
<%
}
else if (i.getName().endsWith("zip") || i.getName().endsWith(".gz") || i.getName().endsWith("tgz"))
else if (i.getName().toLowerCase().endsWith("zip") || i.getName().endsWith(".gz") || i.getName().endsWith("tgz"))
{
%>
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/zip.gif">
<%
}
else if (i.getName().endsWith("rar"))
else if (i.getName().toLowerCase().endsWith("rar"))
{
%>
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/rar.gif">
<%
}
else if (i.getName().endsWith("html") || i.getName().endsWith("htm"))
else if (i.getName().toLowerCase().endsWith("html") || i.getName().endsWith("htm"))
{
%>
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/html.gif">
<%
}
else if (i.getName().endsWith("xls") || i.getName().endsWith("xlsx"))
else if (i.getName().toLowerCase().endsWith("xls") || i.getName().endsWith("xlsx"))
{
%>
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/xls.gif">
<%
}
else if (i.getName().endsWith("txt"))
else if (i.getName().toLowerCase().endsWith("txt"))
{
%>
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/txt.gif">
<%
}
else if (i.getName().endsWith("xml"))
else if (i.getName().toLowerCase().endsWith("xml"))
{
%>
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/xml.gif">
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,24 → 26,23
{
%>
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"/>
 
<baco:isModuleOn module="reminders">
<div class="reminders">
<div id="reminderStatus">
 
</div>
<div class="new">
<div class="title">
<!--<a href="javascript:showOrHide('reminderForm');">-->
51,6 → 50,9
<!--</a>-->
 
</div>
<div id="reminderStatus">
 
</div>
<div id="reminderForm">
<form action="#" name="RemindersForm">
<table>
/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">
235,11 → 252,15
 
<div class="head">
<bean:message key="intranet.my.announcements"/>
<a href="#"><img border="0" onclick="this.src=showOrHide('myAnnouncements','<%=request.getContextPath()%>/imgs/closedbox.gif','<%=request.getContextPath()%>/imgs/openedbox.gif')" src="<%=request.getContextPath()%>/imgs/closedbox.gif" alt="abrir"/></a>
</div>
 
<div id="myAnnouncements" style="display:none;">
<%
if (ownerAnnouncement.size() == 0)
{
%>
 
<div class="zerofound">
<bean:message key="announcement.zero.placed"/>
</div>
249,7 → 270,8
else
{
%>
<table>
 
<table>
<%
for (AnnouncementView a : ownerAnnouncement)
{
284,16 → 306,20
}
%>
</table>
 
<%
}
%>
</div>
</div>
</baco:isModuleOn>
<baco:isModuleOn module="blogs">
<div class="block">
<div class="head">
<bean:message key="intranet.my.blog.posts"/>
<a href="#"><img border="0" onclick="this.src=showOrHide('myPosts','<%=request.getContextPath()%>/imgs/closedbox.gif','<%=request.getContextPath()%>/imgs/openedbox.gif')" src="<%=request.getContextPath()%>/imgs/closedbox.gif" alt="abrir"/></a>
</div>
<div id="myPosts" style="display:none;">
<%
if (ownerBlogs.size() == 0)
{
334,12 → 360,15
<%
}
%>
</div>
</div>
 
<div class="block">
<div class="head">
<bean:message key="intranet.my.blogs"/>
<a href="#"><img border="0" onclick="this.src=showOrHide('myBlogs','<%=request.getContextPath()%>/imgs/closedbox.gif','<%=request.getContextPath()%>/imgs/openedbox.gif')" src="<%=request.getContextPath()%>/imgs/closedbox.gif" alt="abrir"/></a>
</div>
<div id="myBlogs" style="display:none;">
<%
if (ownerBlogs.size() == 0)
{
380,12 → 409,15
<%
}
%>
</div>
</div>
 
<div class="block">
<div class="head">
<bean:message key="intranet.editable.blogs"/>
<a href="#"><img border="0" onclick="this.src=showOrHide('editableBlogs','<%=request.getContextPath()%>/imgs/closedbox.gif','<%=request.getContextPath()%>/imgs/openedbox.gif')" src="<%=request.getContextPath()%>/imgs/closedbox.gif" alt="abrir"/></a>
</div>
<div id="editableBlogs" style="display:none;">
<%
if (editableBlogs.size() == 0)
{
426,6 → 458,7
<%
}
%>
</div>
</div>
</baco:isModuleOn>
 
/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/schema.xml
New file
0,0 → 1,106
<?xml version="1.0" encoding="UTF-8" ?>
 
 
<schema name="example" version="1.2">
 
 
<types>
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>
<fieldType name="int" class="solr.TrieIntField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="float" class="solr.TrieFloatField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="double" class="solr.TrieDoubleField" precisionStep="0" omitNorms="true" positionIncrementGap="0"/>
<fieldType name="date" class="solr.TrieDateField" omitNorms="true" precisionStep="0" positionIncrementGap="0"/>
 
<!-- A Trie based date field for faster date range queries and date faceting. -->
<fieldType name="tdate" class="solr.TrieDateField" omitNorms="true" precisionStep="6" positionIncrementGap="0"/>
 
<fieldType name="text" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.ISOLatin1AccentFilterFactory"/>
<filter class="solr.SnowballPorterFilterFactory" language="Portuguese" protected="protwords.txt"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.ISOLatin1AccentFilterFactory"/>
<filter class="solr.SnowballPorterFilterFactory" language="Portuguese" protected="protwords.txt"/>
</analyzer>
</fieldType>
 
<fieldType name="words" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true"/>
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.ISOLatin1AccentFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
<filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.ISOLatin1AccentFilterFactory"/>
<filter class="solr.SnowballPorterFilterFactory" language="Portuguese" protected="protwords.txt"/>
</analyzer>
</fieldType>
 
 
</types>
<fields>
 
<field name="id" type="string" indexed="true" stored="true" required="true" />
<field name="collection" type="string" indexed="true" stored="true"/>
<field name="text" type="text" indexed="true" multiValued="true" termVectors="true" termPositions="true" termOffsets="true"/>
<field name="fulltext" type="text" indexed="true" stored="true" multiValued="true"/>
<field name="fileDateTimeLastModified" type="string" indexed="true" stored="true"/>
<field name="fileDateLastModified" type="string" indexed="true" stored="true"/>
<field name="fileDateMonthLastModified" type="string" indexed="true" stored="true"/>
<field name="fileDateYearLastModified" type="string" indexed="true" stored="true"/>
<field name="url" type="string" indexed="false" stored="true"/>
<field name="baseUrl" type="string" indexed="true" stored="true"/>
<field name="fileType" type="string" indexed="true" stored="true"/>
<field name="fileSizeKB" type="int" indexed="true" stored="true"/>
<field name="fileRelativePath" type="string" indexed="true" stored="true"/>
<field name="fileAbsolutePath" type="string" indexed="true" stored="true"/>
<field name="fileRelativeDir" type="string" indexed="true" stored="true" multiValued="true"/>
<field name="fileName" type="text" indexed="true" stored="true"/>
<field name="date" type="string" indexed="true" stored="true" multiValued="true"/>
<field name="year" type="string" indexed="true" stored="true" multiValued="true"/>
<field name="month" type="string" indexed="true" stored="true" multiValued="true"/>
<field name="type" type="string" indexed="true" stored="true" multiValued="true"/>
<field name="dir" type="string" indexed="true" stored="true" multiValued="true"/>
 
</fields>
<uniqueKey>id</uniqueKey>
<defaultSearchField>text</defaultSearchField>
<solrQueryParser defaultOperator="OR"/>
<copyField source="fulltext" dest="text"/>
<copyField source="fileName" dest="text"/>
 
<copyField source="fileDateYearLastModified" dest="year"/>
<copyField source="fileDateMonthLastModified" dest="month"/>
<copyField source="fileDateLastModified" dest="date"/>
<copyField source="fileType" dest="type"/>
<copyField source="fileRelativeDir" dest="dir"/>
 
 
 
</schema>
/impl/etc/solr/solrconfig.xml
New file
0,0 → 1,1070
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
 
http://www.apache.org/licenses/LICENSE-2.0
 
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
For more details about configurations options that may appear in this
file, see http://wiki.apache.org/solr/SolrConfigXml.
 
Specifically, the Solr Config can support XInclude, which may make it easier to manage
the configuration. See https://issues.apache.org/jira/browse/SOLR-1167
-->
<config>
<!-- Set this to 'false' if you want solr to continue working after it has
encountered an severe configuration error. In a production environment,
you may want solr to keep working even if one handler is mis-configured.
 
You may also set this to false using by setting the system property:
-Dsolr.abortOnConfigurationError=false
-->
<abortOnConfigurationError>${solr.abortOnConfigurationError:true}</abortOnConfigurationError>
 
<!-- lib directives can be used to instruct Solr to load an Jars identified
and use them to resolve any "plugins" specified in your solrconfig.xml or
schema.xml (ie: Analyzers, Request Handlers, etc...).
 
All directories and paths are resolved relative the instanceDir.
 
If a "./lib" directory exists in your instanceDir, all files found in it
are included as if you had used the following syntax...
<lib dir="./lib" />
-->
<!-- A dir option by itself adds any files found in the directory to the
classpath, this is useful for including all jars in a directory.
-->
<lib dir="../../contrib/extraction/lib" />
<!-- When a regex is specified in addition to a directory, only the files in that
directory which completely match the regex (anchored on both ends)
will be included.
-->
<lib dir="../../dist/" regex="apache-solr-cell-\d.*\.jar" />
<lib dir="../../dist/" regex="apache-solr-clustering-\d.*\.jar" />
<!-- If a dir option (with or without a regex) is used and nothing is found
that matches, it will be ignored
-->
<lib dir="../../contrib/clustering/lib/downloads/" />
<lib dir="../../contrib/clustering/lib/" />
<lib dir="/total/crap/dir/ignored" />
<!-- an exact path can be used to specify a specific file. This will cause
a serious error to be logged if it can't be loaded.
<lib path="../a-jar-that-does-not-exist.jar" />
-->
 
<!-- Used to specify an alternate directory to hold all index data
other than the default ./data under the Solr home.
If replication is in use, this should match the replication configuration. -->
<dataDir>${solr.data.dir:./solr/data}</dataDir>
 
 
<!-- WARNING: this <indexDefaults> section only provides defaults for index writers
in general. See also the <mainIndex> section after that when changing parameters
for Solr's main Lucene index. -->
<indexDefaults>
<!-- Values here affect all index writers and act as a default unless overridden. -->
<useCompoundFile>false</useCompoundFile>
 
<mergeFactor>10</mergeFactor>
<!-- If both ramBufferSizeMB and maxBufferedDocs is set, then Lucene will flush
based on whichever limit is hit first. -->
<!--<maxBufferedDocs>1000</maxBufferedDocs>-->
 
<!-- Sets the amount of RAM that may be used by Lucene indexing
for buffering added documents and deletions before they are
flushed to the Directory. -->
<ramBufferSizeMB>32</ramBufferSizeMB>
<!-- <maxMergeDocs>2147483647</maxMergeDocs> -->
<maxFieldLength>10000</maxFieldLength>
<writeLockTimeout>1000</writeLockTimeout>
<commitLockTimeout>10000</commitLockTimeout>
 
<!--
Expert: Turn on Lucene's auto commit capability. This causes intermediate
segment flushes to write a new lucene index descriptor, enabling it to be
opened by an external IndexReader. This can greatly slow down indexing
speed. NOTE: Despite the name, this value does not have any relation to
Solr's autoCommit functionality
-->
<!--<luceneAutoCommit>false</luceneAutoCommit>-->
 
<!--
Expert: The Merge Policy in Lucene controls how merging is handled by
Lucene. The default in 2.3 is the LogByteSizeMergePolicy, previous
versions used LogDocMergePolicy.
 
LogByteSizeMergePolicy chooses segments to merge based on their size. The
Lucene 2.2 default, LogDocMergePolicy chose when to merge based on number
of documents
 
Other implementations of MergePolicy must have a no-argument constructor
-->
<!--<mergePolicy class="org.apache.lucene.index.LogByteSizeMergePolicy"/>-->
 
<!--
Expert:
The Merge Scheduler in Lucene controls how merges are performed. The
ConcurrentMergeScheduler (Lucene 2.3 default) can perform merges in the
background using separate threads. The SerialMergeScheduler (Lucene 2.2
default) does not.
-->
<!--<mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>-->
 
<!--
This option specifies which Lucene LockFactory implementation to use.
single = SingleInstanceLockFactory - suggested for a read-only index
or when there is no possibility of another process trying
to modify the index.
native = NativeFSLockFactory - uses OS native file locking
simple = SimpleFSLockFactory - uses a plain file for locking
 
(For backwards compatibility with Solr 1.2, 'simple' is the default
if not specified.)
-->
<lockType>native</lockType>
<!--
Expert:
Controls how often Lucene loads terms into memory -->
<!--<termIndexInterval>256</termIndexInterval>-->
</indexDefaults>
 
<mainIndex>
<!-- options specific to the main on-disk lucene index -->
<useCompoundFile>false</useCompoundFile>
<ramBufferSizeMB>32</ramBufferSizeMB>
<mergeFactor>10</mergeFactor>
<!-- Deprecated -->
<!--<maxBufferedDocs>1000</maxBufferedDocs>-->
<!--<maxMergeDocs>2147483647</maxMergeDocs>-->
 
<!-- inherit from indexDefaults <maxFieldLength>10000</maxFieldLength> -->
 
<!-- If true, unlock any held write or commit locks on startup.
This defeats the locking mechanism that allows multiple
processes to safely access a lucene index, and should be
used with care.
This is not needed if lock type is 'none' or 'single'
-->
<unlockOnStartup>false</unlockOnStartup>
<!-- If true, IndexReaders will be reopened (often more efficient) instead
of closed and then opened. -->
<reopenReaders>true</reopenReaders>
 
<!--
Expert:
Controls how often Lucene loads terms into memory. Default is 128 and is likely good for most everyone. -->
<!--<termIndexInterval>256</termIndexInterval>-->
 
<!--
Custom deletion policies can specified here. The class must
implement org.apache.lucene.index.IndexDeletionPolicy.
 
http://lucene.apache.org/java/2_3_2/api/org/apache/lucene/index/IndexDeletionPolicy.html
 
The standard Solr IndexDeletionPolicy implementation supports deleting
index commit points on number of commits, age of commit point and
optimized status.
 
The latest commit point should always be preserved regardless
of the criteria.
-->
<deletionPolicy class="solr.SolrDeletionPolicy">
<!-- The number of commit points to be kept -->
<str name="maxCommitsToKeep">1</str>
<!-- The number of optimized commit points to be kept -->
<str name="maxOptimizedCommitsToKeep">0</str>
<!--
Delete all commit points once they have reached the given age.
Supports DateMathParser syntax e.g.
<str name="maxCommitAge">30MINUTES</str>
<str name="maxCommitAge">1DAY</str>
-->
</deletionPolicy>
 
<!-- To aid in advanced debugging, you may turn on IndexWriter debug logging.
Setting to true will set the file that the underlying Lucene IndexWriter
will write its debug infostream to. -->
<infoStream file="INFOSTREAM.txt">false</infoStream>
 
</mainIndex>
 
<!-- Enables JMX if and only if an existing MBeanServer is found, use this
if you want to configure JMX through JVM parameters. Remove this to disable
exposing Solr configuration and statistics to JMX.
 
If you want to connect to a particular server, specify the agentId
e.g. <jmx agentId="myAgent" />
 
If you want to start a new MBeanServer, specify the serviceUrl
e.g <jmx serviceUrl="service:jmx:rmi:///jndi/rmi://localhost:9999/solr"/>
 
For more details see http://wiki.apache.org/solr/SolrJmx
-->
<jmx />
 
<!-- the default high-performance update handler -->
<updateHandler class="solr.DirectUpdateHandler2">
<!-- A prefix of "solr." for class names is an alias that
causes solr to search appropriate packages, including
org.apache.solr.(search|update|request|core|analysis)
-->
 
<!-- Perform a <commit/> automatically under certain conditions:
maxDocs - number of updates since last commit is greater than this
maxTime - oldest uncommited update (in ms) is this long ago
Instead of enabling autoCommit, consider using "commitWithin"
when adding documents. http://wiki.apache.org/solr/UpdateXmlMessages
<autoCommit>
<maxDocs>10000</maxDocs>
<maxTime>1000</maxTime>
</autoCommit>
-->
 
 
<!-- The RunExecutableListener executes an external command from a
hook such as postCommit or postOptimize.
exe - the name of the executable to run
dir - dir to use as the current working directory. default="."
wait - the calling thread waits until the executable returns. default="true"
args - the arguments to pass to the program. default=nothing
env - environment variables to set. default=nothing
-->
<!-- A postCommit event is fired after every commit or optimize command
<listener event="postCommit" class="solr.RunExecutableListener">
<str name="exe">solr/bin/snapshooter</str>
<str name="dir">.</str>
<bool name="wait">true</bool>
<arr name="args"> <str>arg1</str> <str>arg2</str> </arr>
<arr name="env"> <str>MYVAR=val1</str> </arr>
</listener>
-->
<!-- A postOptimize event is fired only after every optimize command
<listener event="postOptimize" class="solr.RunExecutableListener">
<str name="exe">snapshooter</str>
<str name="dir">solr/bin</str>
<bool name="wait">true</bool>
</listener>
-->
 
</updateHandler>
<!-- Use the following format to specify a custom IndexReaderFactory - allows for alternate
IndexReader implementations.
 
** Experimental Feature **
Please note - Using a custom IndexReaderFactory may prevent certain other features
from working. The API to IndexReaderFactory may change without warning or may even
be removed from future releases if the problems cannot be resolved.
 
** Features that may not work with custom IndexReaderFactory **
The ReplicationHandler assumes a disk-resident index. Using a custom
IndexReader implementation may cause incompatibility with ReplicationHandler and
may cause replication to not work correctly. See SOLR-1366 for details.
 
<indexReaderFactory name="IndexReaderFactory" class="package.class">
Parameters as required by the implementation
</indexReaderFactory >
-->
<!-- To set the termInfosIndexDivisor, do this: -->
<!--<indexReaderFactory name="IndexReaderFactory" class="org.apache.solr.core.StandardIndexReaderFactory">
<int name="termInfosIndexDivisor">12</int>
</indexReaderFactory >-->
 
 
<query>
<!-- Maximum number of clauses in a boolean query... in the past, this affected
range or prefix queries that expanded to big boolean queries - built in Solr
query parsers no longer create queries with this limitation.
An exception is thrown if exceeded. -->
<maxBooleanClauses>1024</maxBooleanClauses>
 
 
<!-- There are two implementations of cache available for Solr,
LRUCache, based on a synchronized LinkedHashMap, and
FastLRUCache, based on a ConcurrentHashMap. FastLRUCache has faster gets
and slower puts in single threaded operation and thus is generally faster
than LRUCache when the hit ratio of the cache is high (> 75%), and may be
faster under other scenarios on multi-cpu systems. -->
<!-- Cache used by SolrIndexSearcher for filters (DocSets),
unordered sets of *all* documents that match a query.
When a new searcher is opened, its caches may be prepopulated
or "autowarmed" using data from caches in the old searcher.
autowarmCount is the number of items to prepopulate. For LRUCache,
the autowarmed items will be the most recently accessed items.
Parameters:
class - the SolrCache implementation LRUCache or FastLRUCache
size - the maximum number of entries in the cache
initialSize - the initial capacity (number of entries) of
the cache. (seel java.util.HashMap)
autowarmCount - the number of entries to prepopulate from
and old cache.
-->
<filterCache
class="solr.FastLRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>
 
<!-- Cache used to hold field values that are quickly accessible
by document id. The fieldValueCache is created by default
even if not configured here.
<fieldValueCache
class="solr.FastLRUCache"
size="512"
autowarmCount="128"
showItems="32"
/>
-->
 
<!-- queryResultCache caches results of searches - ordered lists of
document ids (DocList) based on a query, a sort, and the range
of documents requested. -->
<queryResultCache
class="solr.LRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>
 
<!-- documentCache caches Lucene Document objects (the stored fields for each document).
Since Lucene internal document ids are transient, this cache will not be autowarmed. -->
<documentCache
class="solr.LRUCache"
size="512"
initialSize="512"
autowarmCount="0"/>
 
<!-- If true, stored fields that are not requested will be loaded lazily.
This can result in a significant speed improvement if the usual case is to
not load all stored fields, especially if the skipped fields are large
compressed text fields.
-->
<enableLazyFieldLoading>true</enableLazyFieldLoading>
 
<!-- Example of a generic cache. These caches may be accessed by name
through SolrIndexSearcher.getCache(),cacheLookup(), and cacheInsert().
The purpose is to enable easy caching of user/application level data.
The regenerator argument should be specified as an implementation
of solr.search.CacheRegenerator if autowarming is desired. -->
<!--
<cache name="myUserCache"
class="solr.LRUCache"
size="4096"
initialSize="1024"
autowarmCount="1024"
regenerator="org.mycompany.mypackage.MyRegenerator"
/>
-->
 
<!-- An optimization that attempts to use a filter to satisfy a search.
If the requested sort does not include score, then the filterCache
will be checked for a filter matching the query. If found, the filter
will be used as the source of document ids, and then the sort will be
applied to that.
<useFilterForSortedQuery>true</useFilterForSortedQuery>
-->
 
<!-- An optimization for use with the queryResultCache. When a search
is requested, a superset of the requested number of document ids
are collected. For example, if a search for a particular query
requests matching documents 10 through 19, and queryWindowSize is 50,
then documents 0 through 49 will be collected and cached. Any further
requests in that range can be satisfied via the cache. -->
<queryResultWindowSize>20</queryResultWindowSize>
 
<!-- Maximum number of documents to cache for any entry in the
queryResultCache. -->
<queryResultMaxDocsCached>200</queryResultMaxDocsCached>
 
<!-- a newSearcher event is fired whenever a new searcher is being prepared
and there is a current searcher handling requests (aka registered).
It can be used to prime certain caches to prevent long request times for
certain requests.
-->
<!-- QuerySenderListener takes an array of NamedList and executes a
local query request for each NamedList in sequence. -->
<listener event="newSearcher" class="solr.QuerySenderListener">
<arr name="queries">
<!--
<lst> <str name="q">solr</str> <str name="start">0</str> <str name="rows">10</str> </lst>
<lst> <str name="q">rocks</str> <str name="start">0</str> <str name="rows">10</str> </lst>
<lst><str name="q">static newSearcher warming query from solrconfig.xml</str></lst>
-->
</arr>
</listener>
 
<!-- a firstSearcher event is fired whenever a new searcher is being
prepared but there is no current registered searcher to handle
requests or to gain autowarming data from. -->
<listener event="firstSearcher" class="solr.QuerySenderListener">
<arr name="queries">
<lst> <str name="q">solr rocks</str><str name="start">0</str><str name="rows">10</str></lst>
<lst><str name="q">static firstSearcher warming query from solrconfig.xml</str></lst>
</arr>
</listener>
 
<!-- If a search request comes in and there is no current registered searcher,
then immediately register the still warming searcher and use it. If
"false" then all requests will block until the first searcher is done
warming. -->
<useColdSearcher>false</useColdSearcher>
 
<!-- Maximum number of searchers that may be warming in the background
concurrently. An error is returned if this limit is exceeded. Recommend
1-2 for read-only slaves, higher for masters w/o cache warming. -->
<maxWarmingSearchers>2</maxWarmingSearchers>
 
</query>
 
<!--
Let the dispatch filter handler /select?qt=XXX
handleSelect=true will use consistent error handling for /select and /update
handleSelect=false will use solr1.1 style error formatting
-->
<requestDispatcher handleSelect="true" >
<!--Make sure your system has some authentication before enabling remote streaming! -->
<requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048000" />
 
<!-- Set HTTP caching related parameters (for proxy caches and clients).
To get the behaviour of Solr 1.2 (ie: no caching related headers)
use the never304="true" option and do not specify a value for
<cacheControl>
-->
<!-- <httpCaching never304="true"> -->
<httpCaching lastModifiedFrom="openTime"
etagSeed="Solr">
<!-- lastModFrom="openTime" is the default, the Last-Modified value
(and validation against If-Modified-Since requests) will all be
relative to when the current Searcher was opened.
You can change it to lastModFrom="dirLastMod" if you want the
value to exactly corrispond to when the physical index was last
modified.
 
etagSeed="..." is an option you can change to force the ETag
header (and validation against If-None-Match requests) to be
differnet even if the index has not changed (ie: when making
significant changes to your config file)
 
lastModifiedFrom and etagSeed are both ignored if you use the
never304="true" option.
-->
<!-- If you include a <cacheControl> directive, it will be used to
generate a Cache-Control header, as well as an Expires header
if the value contains "max-age="
 
By default, no Cache-Control header is generated.
 
You can use the <cacheControl> option even if you have set
never304="true"
-->
<!-- <cacheControl>max-age=30, public</cacheControl> -->
</httpCaching>
</requestDispatcher>
 
 
<!-- requestHandler plugins... incoming queries will be dispatched to the
correct handler based on the path or the qt (query type) param.
Names starting with a '/' are accessed with the a path equal to the
registered name. Names without a leading '/' are accessed with:
http://host/app/select?qt=name
If no qt is defined, the requestHandler that declares default="true"
will be used.
-->
<requestHandler name="standard" class="solr.SearchHandler" default="true">
<!-- default values for query parameters -->
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="fl">
id,collection,fileDateYearLastModified,fileRelativeDir,fileDateMonthLastModified,fileDateTimeLastModified,fileDateTimeLastModified,fileDateLastModified,url,fileType,fileSizeKB,fileRelativePath,fileRelativeDir,fileName,score
</str>
<!--
<int name="rows">10</int>
<str name="fl">*</str>
<str name="version">2.1</str>
-->
<!-- example highlighter config, enable per-query with hl=true -->
<str name="hl.fl">fulltext</str>
<!-- for this field, we want no fragmenting, just highlighting -->
<str name="f.fulltext.hl.fragsize">300</str>
<!-- instructs Solr to return the field itself if no query terms are
found -->
<str name="f.name.hl.alternateField">name</str>
<str name="f.fulltext.hl.fragmenter">regex</str> <!-- defined below -->
 
 
 
<!-- omp = Only More Popular -->
<str name="spellcheck.onlyMorePopular">false</str>
<!-- exr = Extended Results -->
<str name="spellcheck.extendedResults">false</str>
<!-- The number of suggestions to return -->
<str name="spellcheck.count">1</str>
</lst>
<arr name="last-components">
<str>spellcheck</str>
</arr>
</requestHandler>
 
<!-- Please refer to http://wiki.apache.org/solr/SolrReplication for details on configuring replication -->
<!-- remove the <lst name="master"> section if this is just a slave -->
<!-- remove the <lst name="slave"> section if this is just a master -->
<!--
<requestHandler name="/replication" class="solr.ReplicationHandler" >
<lst name="master">
<str name="replicateAfter">commit</str>
<str name="replicateAfter">startup</str>
<str name="confFiles">schema.xml,stopwords.txt</str>
</lst>
<lst name="slave">
<str name="masterUrl">http://localhost:8983/solr/replication</str>
<str name="pollInterval">00:00:60</str>
</lst>
</requestHandler>-->
 
<!-- DisMaxRequestHandler allows easy searching across multiple fields
for simple user-entered phrases. It's implementation is now
just the standard SearchHandler with a default query type
of "dismax".
see http://wiki.apache.org/solr/DisMaxRequestHandler
-->
<requestHandler name="dismax" class="solr.SearchHandler" >
<lst name="defaults">
<str name="defType">dismax</str>
<str name="echoParams">explicit</str>
<float name="tie">0.01</float>
<str name="qf">
text^1
</str>
<str name="pf">
text^1
</str>
<str name="mm">
2&lt;-1 5&lt;-2 6&lt;90%
</str>
<str name="fl">
id,score,dc_title,dc_creator,dc_subject,dc_date,dc_type,dc_language
</str>
<int name="ps">100</int>
<str name="q.alt">*:*</str>
<!-- example highlighter config, enable per-query with hl=true -->
<str name="hl.fl">fulltext</str>
<!-- for this field, we want no fragmenting, just highlighting -->
<str name="f.fulltext.hl.fragsize">300</str>
<!-- instructs Solr to return the field itself if no query terms are
found -->
<str name="f.name.hl.alternateField">name</str>
<str name="f.fulltext.hl.fragmenter">regex</str> <!-- defined below -->
 
<!-- omp = Only More Popular -->
<str name="spellcheck.onlyMorePopular">false</str>
<!-- exr = Extended Results -->
<str name="spellcheck.extendedResults">false</str>
<!-- The number of suggestions to return -->
<str name="spellcheck.count">1</str>
</lst>
<arr name="last-components">
<str>spellcheck</str>
</arr>
</requestHandler>
 
<!-- Note how you can register the same handler multiple times with
different names (and different init parameters)
-->
<requestHandler name="partitioned" class="solr.SearchHandler" >
<lst name="defaults">
<str name="defType">dismax</str>
<str name="echoParams">explicit</str>
<str name="qf">text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0</str>
<str name="mm">2&lt;-1 5&lt;-2 6&lt;90%</str>
<!-- This is an example of using Date Math to specify a constantly
moving date range in a config...
-->
<str name="bq">incubationdate_dt:[* TO NOW/DAY-1MONTH]^2.2</str>
</lst>
<!-- In addition to defaults, "appends" params can be specified
to identify values which should be appended to the list of
multi-val params from the query (or the existing "defaults").
 
In this example, the param "fq=instock:true" will be appended to
any query time fq params the user may specify, as a mechanism for
partitioning the index, independent of any user selected filtering
that may also be desired (perhaps as a result of faceted searching).
 
NOTE: there is *absolutely* nothing a client can do to prevent these
"appends" values from being used, so don't use this mechanism
unless you are sure you always want it.
-->
<lst name="appends">
<str name="fq">inStock:true</str>
</lst>
<!-- "invariants" are a way of letting the Solr maintainer lock down
the options available to Solr clients. Any params values
specified here are used regardless of what values may be specified
in either the query, the "defaults", or the "appends" params.
 
In this example, the facet.field and facet.query params are fixed,
limiting the facets clients can use. Faceting is not turned on by
default - but if the client does specify facet=true in the request,
these are the only facets they will be able to see counts for;
regardless of what other facet.field or facet.query params they
may specify.
 
NOTE: there is *absolutely* nothing a client can do to prevent these
"invariants" values from being used, so don't use this mechanism
unless you are sure you always want it.
-->
<lst name="invariants">
<str name="facet.field">cat</str>
<str name="facet.field">manu_exact</str>
<str name="facet.query">price:[* TO 500]</str>
<str name="facet.query">price:[500 TO *]</str>
</lst>
</requestHandler>
 
 
<!--
Search components are registered to SolrCore and used by Search Handlers
By default, the following components are avaliable:
<searchComponent name="query" class="org.apache.solr.handler.component.QueryComponent" />
<searchComponent name="facet" class="org.apache.solr.handler.component.FacetComponent" />
<searchComponent name="mlt" class="org.apache.solr.handler.component.MoreLikeThisComponent" />
<searchComponent name="highlight" class="org.apache.solr.handler.component.HighlightComponent" />
<searchComponent name="stats" class="org.apache.solr.handler.component.StatsComponent" />
<searchComponent name="debug" class="org.apache.solr.handler.component.DebugComponent" />
Default configuration in a requestHandler would look like:
<arr name="components">
<str>query</str>
<str>facet</str>
<str>mlt</str>
<str>highlight</str>
<str>stats</str>
<str>debug</str>
</arr>
 
If you register a searchComponent to one of the standard names, that will be used instead.
To insert components before or after the 'standard' components, use:
<arr name="first-components">
<str>myFirstComponentName</str>
</arr>
<arr name="last-components">
<str>myLastComponentName</str>
</arr>
-->
 
<!-- The spell check component can return a list of alternative spelling
suggestions. -->
<searchComponent name="spellcheck" class="solr.SpellCheckComponent">
 
<str name="queryAnalyzerFieldType">textSpell</str>
<!--<str name="queryAnalyzerFieldType">text</str>-->
<lst name="spellchecker">
<str name="name">default</str>
<str name="field">text</str>
<str name="buildOnCommit">true</str>
<str name="spellcheckIndexDir">./spellchecker</str>
</lst>
<!-- a spellchecker that uses a different distance measure
<lst name="spellchecker">
<str name="name">jarowinkler</str>
<str name="field">text</str>
<str name="distanceMeasure">org.apache.lucene.search.spell.JaroWinklerDistance</str>
<str name="spellcheckIndexDir">./spellchecker2</str>
</lst>
-->
 
<!-- a file based spell checker
<lst name="spellchecker">
<str name="classname">solr.FileBasedSpellChecker</str>
<str name="name">file</str>
<str name="sourceLocation">spellings.txt</str>
<str name="characterEncoding">UTF-8</str>
<str name="spellcheckIndexDir">./spellcheckerFile</str>
</lst>
-->
</searchComponent>
 
<!-- A request handler utilizing the spellcheck component.
#############################################################################
NOTE: This is purely as an example. The whole purpose of the
SpellCheckComponent is to hook it into the request handler that handles (i.e.
the standard or dismax SearchHandler) queries such that a separate request is
not needed to get suggestions.
 
IN OTHER WORDS, THERE IS REALLY GOOD CHANCE THE SETUP BELOW IS NOT WHAT YOU
WANT FOR YOUR PRODUCTION SYSTEM!
#############################################################################
-->
<requestHandler name="/spell" class="solr.SearchHandler" lazy="true">
<lst name="defaults">
<!-- omp = Only More Popular -->
<str name="spellcheck.onlyMorePopular">false</str>
<!-- exr = Extended Results -->
<str name="spellcheck.extendedResults">false</str>
<!-- The number of suggestions to return -->
<str name="spellcheck.count">1</str>
</lst>
<arr name="last-components">
<str>spellcheck</str>
</arr>
</requestHandler>
 
<searchComponent name="tvComponent" class="org.apache.solr.handler.component.TermVectorComponent"/>
<!-- A Req Handler for working with the tvComponent. This is purely as an example.
You will likely want to add the component to your already specified request handlers. -->
<requestHandler name="tvrh" class="org.apache.solr.handler.component.SearchHandler">
<lst name="defaults">
<bool name="tv">true</bool>
</lst>
<arr name="last-components">
<str>tvComponent</str>
</arr>
</requestHandler>
 
<!-- Clustering Component
http://wiki.apache.org/solr/ClusteringComponent
This relies on third party jars which are not included in the release.
To use this component (and the "/clustering" handler)
Those jars will need to be downloaded, and you'll need to set the
solr.cluster.enabled system property when running solr...
java -Dsolr.clustering.enabled=true -jar start.jar
-->
<searchComponent
name="clusteringComponent"
enable="${solr.clustering.enabled:false}"
class="org.apache.solr.handler.clustering.ClusteringComponent" >
<!-- Declare an engine -->
<lst name="engine">
<!-- The name, only one can be named "default" -->
<str name="name">default</str>
<!--
Class name of Carrot2 clustering algorithm. Currently available algorithms are:
* org.carrot2.clustering.lingo.LingoClusteringAlgorithm
* org.carrot2.clustering.stc.STCClusteringAlgorithm
See http://project.carrot2.org/algorithms.html for the algorithm's characteristics.
-->
<str name="carrot.algorithm">org.carrot2.clustering.lingo.LingoClusteringAlgorithm</str>
<!--
Overriding values for Carrot2 default algorithm attributes. For a description
of all available attributes, see: http://download.carrot2.org/stable/manual/#chapter.components.
Use attribute key as name attribute of str elements below. These can be further
overridden for individual requests by specifying attribute key as request
parameter name and attribute value as parameter value.
-->
<str name="LingoClusteringAlgorithm.desiredClusterCountBase">20</str>
</lst>
<lst name="engine">
<str name="name">stc</str>
<str name="carrot.algorithm">org.carrot2.clustering.stc.STCClusteringAlgorithm</str>
</lst>
</searchComponent>
<requestHandler name="/clustering"
enable="${solr.clustering.enabled:false}"
class="solr.SearchHandler">
<lst name="defaults">
<bool name="clustering">true</bool>
<str name="clustering.engine">default</str>
<bool name="clustering.results">true</bool>
<!-- The title field -->
<str name="carrot.title">dc_title</str>
<str name="carrot.url">id</str>
<!-- The field to cluster on -->
<str name="carrot.snippet">features</str>
<!-- produce summaries -->
<bool name="carrot.produceSummary">true</bool>
<!-- the maximum number of labels per cluster -->
<!--<int name="carrot.numDescriptions">5</int>-->
<!-- produce sub clusters -->
<bool name="carrot.outputSubClusters">true</bool>
</lst>
<arr name="last-components">
<str>clusteringComponent</str>
</arr>
</requestHandler>
<!-- Solr Cell: http://wiki.apache.org/solr/ExtractingRequestHandler -->
<requestHandler name="/update/extract" class="org.apache.solr.handler.extraction.ExtractingRequestHandler" startup="lazy">
<lst name="defaults">
<!-- All the main content goes into "text"... if you need to return
the extracted text or do highlighting, use a stored field. -->
<str name="fmap.content">text</str>
<str name="lowernames">true</str>
<str name="uprefix">ignored_</str>
 
<!-- capture link hrefs but ignore div attributes -->
<str name="captureAttr">true</str>
<str name="fmap.a">links</str>
<str name="fmap.div">ignored_</str>
</lst>
</requestHandler>
 
 
<!-- A component to return terms and document frequency of those terms.
This component does not yet support distributed search. -->
<searchComponent name="termsComponent" class="org.apache.solr.handler.component.TermsComponent"/>
 
<requestHandler name="/terms" class="org.apache.solr.handler.component.SearchHandler">
<lst name="defaults">
<bool name="terms">true</bool>
</lst>
<arr name="components">
<str>termsComponent</str>
</arr>
</requestHandler>
 
 
<!-- a search component that enables you to configure the top results for
a given query regardless of the normal lucene scoring.-->
<searchComponent name="elevator" class="solr.QueryElevationComponent" >
<!-- pick a fieldType to analyze queries -->
<str name="queryFieldType">string</str>
<str name="config-file">elevate.xml</str>
</searchComponent>
 
<!-- a request handler utilizing the elevator component -->
<requestHandler name="/elevate" class="solr.SearchHandler" startup="lazy">
<lst name="defaults">
<str name="echoParams">explicit</str>
</lst>
<arr name="last-components">
<str>elevator</str>
</arr>
</requestHandler>
 
 
<!-- Update request handler.
 
Note: Since solr1.1 requestHandlers requires a valid content type header if posted in
the body. For example, curl now requires: -H 'Content-type:text/xml; charset=utf-8'
The response format differs from solr1.1 formatting and returns a standard error code.
To enable solr1.1 behavior, remove the /update handler or change its path
-->
<requestHandler name="/update" class="solr.XmlUpdateRequestHandler" />
 
 
<requestHandler name="/update/javabin" class="solr.BinaryUpdateRequestHandler" />
 
<!--
Analysis request handler. Since Solr 1.3. Use to return how a document is analyzed. Useful
for debugging and as a token server for other types of applications.
 
This is deprecated in favor of the improved DocumentAnalysisRequestHandler and FieldAnalysisRequestHandler
 
<requestHandler name="/analysis" class="solr.AnalysisRequestHandler" />
-->
 
<!--
An analysis handler that provides a breakdown of the analysis process of provided docuemnts. This handler expects a
(single) content stream with the following format:
 
<docs>
<doc>
<field name="id">1</field>
<field name="name">The Name</field>
<field name="text">The Text Value</field>
<doc>
<doc>...</doc>
<doc>...</doc>
...
</docs>
 
Note: Each document must contain a field which serves as the unique key. This key is used in the returned
response to assoicate an analysis breakdown to the analyzed document.
 
Like the FieldAnalysisRequestHandler, this handler also supports query analysis by
sending either an "analysis.query" or "q" request paraemter that holds the query text to be analyized. It also
supports the "analysis.showmatch" parameter which when set to true, all field tokens that match the query
tokens will be marked as a "match".
-->
<requestHandler name="/analysis/document" class="solr.DocumentAnalysisRequestHandler" />
 
<!--
RequestHandler that provides much the same functionality as analysis.jsp. Provides the ability
to specify multiple field types and field names in the same request and outputs index-time and
query-time analysis for each of them.
 
Request parameters are:
analysis.fieldname - The field name whose analyzers are to be used
analysis.fieldtype - The field type whose analyzers are to be used
analysis.fieldvalue - The text for index-time analysis
q (or analysis.q) - The text for query time analysis
analysis.showmatch (true|false) - When set to true and when query analysis is performed, the produced
tokens of the field value analysis will be marked as "matched" for every
token that is produces by the query analysis
-->
<requestHandler name="/analysis/field" class="solr.FieldAnalysisRequestHandler" />
 
 
<!-- CSV update handler, loaded on demand -->
<requestHandler name="/update/csv" class="solr.CSVRequestHandler" startup="lazy" />
 
 
<!--
Admin Handlers - This will register all the standard admin RequestHandlers. Adding
this single handler is equivalent to registering:
<requestHandler name="/admin/luke" class="org.apache.solr.handler.admin.LukeRequestHandler" />
<requestHandler name="/admin/system" class="org.apache.solr.handler.admin.SystemInfoHandler" />
<requestHandler name="/admin/plugins" class="org.apache.solr.handler.admin.PluginInfoHandler" />
<requestHandler name="/admin/threads" class="org.apache.solr.handler.admin.ThreadDumpHandler" />
<requestHandler name="/admin/properties" class="org.apache.solr.handler.admin.PropertiesRequestHandler" />
<requestHandler name="/admin/file" class="org.apache.solr.handler.admin.ShowFileRequestHandler" >
If you wish to hide files under ${solr.home}/conf, explicitly register the ShowFileRequestHandler using:
<requestHandler name="/admin/file" class="org.apache.solr.handler.admin.ShowFileRequestHandler" >
<lst name="invariants">
<str name="hidden">synonyms.txt</str>
<str name="hidden">anotherfile.txt</str>
</lst>
</requestHandler>
-->
<requestHandler name="/admin/" class="org.apache.solr.handler.admin.AdminHandlers" />
 
<!-- ping/healthcheck -->
<requestHandler name="/admin/ping" class="PingRequestHandler">
<lst name="defaults">
<str name="qt">standard</str>
<str name="q">solrpingquery</str>
<str name="echoParams">all</str>
</lst>
</requestHandler>
 
<!-- Echo the request contents back to the client -->
<requestHandler name="/debug/dump" class="solr.DumpRequestHandler" >
<lst name="defaults">
<str name="echoParams">explicit</str> <!-- for all params (including the default etc) use: 'all' -->
<str name="echoHandler">true</str>
</lst>
</requestHandler>
 
<highlighting>
<!-- Configure the standard fragmenter -->
<!-- This could most likely be commented out in the "default" case -->
<fragmenter name="gap" class="org.apache.solr.highlight.GapFragmenter" default="true">
<lst name="defaults">
<int name="hl.fragsize">300</int>
</lst>
</fragmenter>
 
<!-- A regular-expression-based fragmenter (f.i., for sentence extraction) -->
<fragmenter name="regex" class="org.apache.solr.highlight.RegexFragmenter">
<lst name="defaults">
<!-- slightly smaller fragsizes work better because of slop -->
<int name="hl.fragsize">300</int>
<!-- allow 50% slop on fragment sizes -->
<float name="hl.regex.slop">0.5</float>
<!-- a basic sentence pattern -->
<str name="hl.regex.pattern">[-\w ,/\n\"']{20,300}</str>
</lst>
</fragmenter>
 
<!-- Configure the standard formatter -->
<formatter name="html" class="org.apache.solr.highlight.HtmlFormatter" default="true">
<lst name="defaults">
<str name="hl.simple.pre"><![CDATA[<em>]]></str>
<str name="hl.simple.post"><![CDATA[</em>]]></str>
</lst>
</formatter>
</highlighting>
 
<!-- An example dedup update processor that creates the "id" field on the fly
based on the hash code of some other fields. This example has overwriteDupes
set to false since we are using the id field as the signatureField and Solr
will maintain uniqueness based on that anyway.
You have to link the chain to an update handler above to use it ie:
<requestHandler name="/update "class="solr.XmlUpdateRequestHandler">
<lst name="defaults">
<str name="update.processor">dedupe</str>
</lst>
</requestHandler>
-->
<!--
<updateRequestProcessorChain name="dedupe">
<processor class="org.apache.solr.update.processor.SignatureUpdateProcessorFactory">
<bool name="enabled">true</bool>
<str name="signatureField">id</str>
<bool name="overwriteDupes">false</bool>
<str name="fields">name,features,cat</str>
<str name="signatureClass">org.apache.solr.update.processor.Lookup3Signature</str>
</processor>
<processor class="solr.LogUpdateProcessorFactory" />
<processor class="solr.RunUpdateProcessorFactory" />
</updateRequestProcessorChain>
-->
 
 
<!-- queryResponseWriter plugins... query responses will be written using the
writer specified by the 'wt' request parameter matching the name of a registered
writer.
The "default" writer is the default and will be used if 'wt' is not specified
in the request. XMLResponseWriter will be used if nothing is specified here.
The json, python, and ruby writers are also available by default.
 
<queryResponseWriter name="xml" class="org.apache.solr.request.XMLResponseWriter" default="true"/>
<queryResponseWriter name="json" class="org.apache.solr.request.JSONResponseWriter"/>
<queryResponseWriter name="python" class="org.apache.solr.request.PythonResponseWriter"/>
<queryResponseWriter name="ruby" class="org.apache.solr.request.RubyResponseWriter"/>
<queryResponseWriter name="php" class="org.apache.solr.request.PHPResponseWriter"/>
<queryResponseWriter name="phps" class="org.apache.solr.request.PHPSerializedResponseWriter"/>
 
<queryResponseWriter name="custom" class="com.example.MyResponseWriter"/>
-->
 
<!-- XSLT response writer transforms the XML output by any xslt file found
in Solr's conf/xslt directory. Changes to xslt files are checked for
every xsltCacheLifetimeSeconds.
-->
<queryResponseWriter name="xslt" class="org.apache.solr.request.XSLTResponseWriter">
<int name="xsltCacheLifetimeSeconds">5</int>
</queryResponseWriter>
 
 
<!-- example of registering a query parser
<queryParser name="lucene" class="org.apache.solr.search.LuceneQParserPlugin"/>
-->
 
<!-- example of registering a custom function parser
<valueSourceParser name="myfunc" class="com.mycompany.MyValueSourceParser" />
-->
 
<!-- config for the admin interface -->
<admin>
<defaultQuery>solr</defaultQuery>
 
<!-- configure a healthcheck file for servers behind a loadbalancer
<healthcheck type="file">server-enabled</healthcheck>
-->
</admin>
 
</config>
/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/1.3ScriptsDonald.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/solrManager-jar-with-dependencies.jar
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/README
New file
0,0 → 1,5
To index shared folders
 
Use SOLR 1.4 and replace the configuration files
Than install the telHaldler SRU Application to work as bridge with SOLR
Finnaly use the SOLR indexer Manager to preprocess and index folders
/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>
/common/commons/commons-fileupload-1.2.1.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+ application/octet-stream