/impl/conf/language/MessageResourcesAnnouncements.properties |
---|
4,7 → 4,7 |
# |
################################################################################ |
module.Announcements=Anúncios |
a |
announcement.title=Titulo |
announcement.text=Texto |
announcement.startDate=Data de Aparecimento |
14,11 → 14,17 |
announcement.typeAnnouncement=Tipo |
announcement.sendAnnouncementLike=Enviar como |
announcement.priorityAnnouncement=Prioridade |
announcement.linkAnnouncement=Url |
announcement.linkAnnouncement=URL |
announcement.internalLinkAnnouncement=URL interno do sistema |
announcement.target.roles=Pessoas a quem destina |
announcement.created.success=Anúncio criado com sucesso |
announcement.edited.success=Anúncio alterado com sucesso |
announcement.created.success=Anúncio criado com sucesso: <a href="{0}/loadAnnouncement.do?id={1}&dispatch=load">{2}</a> |
announcement.edited.success=Anúncio alterado com sucesso: <a href="{0}/loadAnnouncement.do?id={1}&dispatch=load">{2}</a> |
announcement.deleted.success=Anúncio apagado com sucesso |
announcement.deleted.fail=Não foi possivel apagar o anuncio |
announcement.status=Válido |
announcement.internal=Dominio |
announcement.internal.yes=Interno |
announcement.internal.no=Público |
announcements.type.news=NotÃcias |
31,3 → 37,20 |
announcements.loading=carregando anúncio... |
announcement.style.img.left=Imagem à esquerda do texto no meio |
announcement.style.img.left.top=Imagem à esquerda do texto em cima |
announcement.style.img.left.bottom=Imagem à esquerda do texto em baixo |
announcement.style.img.right=Imagem à direita do texto no meio |
announcement.style.img.right.top=Imagem à direita do texto em cima |
announcement.style.img.right.bottom=Imagem à direita do texto em baixo |
announcement.style.img.top=Imagem no topo do texto ao centro |
announcement.style.img.top.left=Imagem no topo do texto à esquerda |
announcement.style.img.top.right=Imagem no topo do texto à direita |
announcement.style.img.embedded.left=Imagem embebida à esquerda |
announcement.style.img.embedded.right=Imagem embebida à direita |
announcement.internal.url.include.yes=Incluir o conteudo |
announcement.internal.url.include.no=Referênciar o conteudo |
announcement.image.style=Estilo visual |
/impl/conf/language/MessageResources.properties |
---|
93,6 → 93,7 |
at=a |
loading=Carregando |
#Menus |
nav.place.root=raiz |
site.title=Escola Superior de Tecnologia e Gestão |
administration=Administração |
superuser=Super Utilizador |
223,6 → 224,7 |
username=Nome de Utilizador |
password=Password |
submit=Entrar |
edit=Editar |
confirm=Confirmar |
add=Adicionar |
remove=Remover |
230,17 → 232,24 |
no=Não |
#Login |
login.firts.time.name=Nome |
login.first.time.username=Username |
login.first.time.name=Nome |
login.first.time.targets=Papeis |
login.first.time.bi=BI |
login.first.time.address=Morada |
login.first.time.zip=Código Postal |
login.first.time.birthday.date=Data de Nascimento |
login.first.time.country=PaÃs |
login.first.time.email=E-mail |
login.first.time.email.institucion=E-mail Institucional* |
login.first.time.email.institucion2=E-mail Institucional |
login.first.time.email.secundary=E-mail Secundário |
login.first.time.phone.number=Telefone |
#Profile |
profile.edited.sucess=Perfil alterado com sucesso |
profile.enter.first.time=É a primeira vez que se esta a ligar, seja bem-vindo {0} |
profile.edit=Aqui pode editar o seu perfil |
profile.email.change=*Para alterar o seu email dirija-se aos serviços centrais |
profile.search.user=Procurar Utilizador |
#Cursos |
/impl/conf/WEB-INF/struts/struts-default.xml |
---|
137,20 → 137,10 |
<forward name="load" path="page.load.profile"/> |
<forward name="search" path="page.find.profile"/> |
</action> |
<!--<action path="/profileAdmin" |
type="pt.estgp.estgweb.web.controllers.profile.ProfileController" |
name="ProfileForm" |
scope="request" |
parameter="dispatch" |
validate="false" |
input="page.find.profile"> |
<forward name="load" path="page.load.profile"/> |
</action>--> |
</action-mappings> |
<controller processorClass="org.apache.struts.tiles.TilesRequestProcessor" /> |
<message-resources parameter="MessageResources"/> |
/impl/conf/WEB-INF/struts/tiles-courseunits.xml |
---|
7,7 → 7,7 |
<tiles-definitions> |
<definition name="base.separators" extends="base.definition" path="/layout/layoutintranet.jsp"> |
<definition name="base.separators" extends="base.definition" path="/layout/layoutintranet.jsp"> |
<put name="separators" value="/layout/separators.jsp" /> |
</definition> |
<definition name="page.separators.home" extends="base.separators"> |
/impl/conf/WEB-INF/struts/tiles-default.xml |
---|
63,6 → 63,7 |
</definition> |
<definition name="base.layoutCourses" extends="base.definition" path="/layout/layout1.jsp"> |
<put name="topnav" value="/user/courses/topnavCourses.jsp"/> |
<put name="navigation" value="/layout/navigationCourse.jsp" /> |
</definition> |
/impl/conf/WEB-INF/struts/tiles-ftpclient.xml |
---|
9,6 → 9,7 |
<definition name="page.courses" extends="base.layoutCourses"> |
<put name="body" value="/user/courses/courses.jsp"/> |
<put name="topnav" value="/user/courses/topnavCourses.jsp"/> |
</definition> |
</tiles-definitions> |
/impl/conf/WEB-INF/tlds/estgweb.tld |
---|
15,6 → 15,20 |
</attribute> |
</tag> |
<tag> |
<name>canManage</name> |
<tagclass>pt.estgp.estgweb.web.tags.CanManageTag</tagclass> |
<attribute> |
<name>name</name> |
<required>true</required> |
<rtexprvalue>true</rtexprvalue> |
</attribute> |
<attribute> |
<name>property</name> |
<required>false</required> |
<rtexprvalue>false</rtexprvalue> |
</attribute> |
</tag> |
<tag> |
<name>isAuthenticated</name> |
<tagclass>pt.estgp.estgweb.web.tags.IsAuthenticatedTag</tagclass> |
</tag> |
51,7 → 65,7 |
<required>true</required> |
<rtexprvalue>true</rtexprvalue> |
</attribute> |
<attribute> |
<attribute> |
<name>altKey</name> |
<required>false</required> |
<rtexprvalue>false</rtexprvalue> |
62,7 → 76,7 |
<rtexprvalue>false</rtexprvalue> |
</attribute> |
</tag> |
<tag> |
<tag> |
<name>ownerImageRole</name> |
<tagclass>pt.estgp.estgweb.web.tags.OwnerImageRoleTag</tagclass> |
<attribute> |
70,7 → 84,7 |
<required>true</required> |
<rtexprvalue>true</rtexprvalue> |
</attribute> |
<attribute> |
<attribute> |
<name>property</name> |
<required>false</required> |
<rtexprvalue>false</rtexprvalue> |
78,17 → 92,17 |
</tag> |
<!--<tag>--> |
<!--<name>urlStat</name>--> |
<!--<tagclass>pt.estgp.estgweb.web.tags.UrlStatTag</tagclass>--> |
<!--<attribute>--> |
<!--<name>url</name>--> |
<!--<required>true</required>--> |
<!--<rtexprvalue>true</rtexprvalue>--> |
<!--</attribute>--> |
<!--<attribute>--> |
<!--<name>attributes</name>--> |
<!--<required>false</required>--> |
<!--<rtexprvalue>false</rtexprvalue>--> |
<!--</attribute>--> |
<!--<name>urlStat</name>--> |
<!--<tagclass>pt.estgp.estgweb.web.tags.UrlStatTag</tagclass>--> |
<!--<attribute>--> |
<!--<name>url</name>--> |
<!--<required>true</required>--> |
<!--<rtexprvalue>true</rtexprvalue>--> |
<!--</attribute>--> |
<!--<attribute>--> |
<!--<name>attributes</name>--> |
<!--<required>false</required>--> |
<!--<rtexprvalue>false</rtexprvalue>--> |
<!--</attribute>--> |
<!--</tag>--> |
</taglib> |
/impl/conf/app.properties |
---|
2,13 → 2,15 |
use.ldap=@use.ldap@ |
system.language=pt |
#Session Settings |
user.session.timeout.minutes=15 |
user.session.timeout.minutes=30 |
email.server=mail.estgp.pt |
email.user= |
email.password= |
email.from=jmachado@estgp.pt |
email.templates.dir=@email.templates.dir@ |
################################################## |
##Proxy Servers |
#If is an HTTP Server needs encoding config if FTP needs user pass config |
25,6 → 27,9 |
## Kinds of roles |
user.admin=admin |
user.super=all |
user.student=student |
user.teacher=teacher |
user.role.0=all |
user.role.1=admin |
user.role.2=student |
101,7 → 106,10 |
# |
url.stat.tmp.dir=/linkchart |
url.stat.image.expire.interval.time.minutes=15 |
url.stat.click.cache.size=50 |
url.stat.click.cache.timeout=30 |
url.stat.ignore.extension.1=.js |
url.stat.ignore.extension.2=.css |
url.stat.ignore.extension.3=.jpg |
138,5 → 146,11 |
search.best.fragments.max.fragments=3 |
######################################################################### |
# Imports SIGoES |
# |
siges.institution.code=1 |
/impl/conf/berserk/sd.xml |
---|
110,6 → 110,20 |
</filterChains> |
</service> |
<service> |
<name>DeleteAnnouncement</name> |
<implementationClass>pt.estgp.estgweb.services.announcements.DeleteAnnouncementService</implementationClass> |
<description>Delete an Announcement</description> |
<isTransactional>true</isTransactional> |
<filterChains> |
<chain name="Logger"/> |
<chain name="Session"/> |
<!--<chain name="Admins"/>--> |
<chain name="OwnersLoadAnnouncement"/> |
<!--<chain name="ContextObjectTimer"/>--> |
<!--<chain name="ContextStaticTimerExample"/>--> |
</filterChains> |
</service> |
<service> |
<name>LoadAnnouncementView</name> |
<implementationClass>pt.estgp.estgweb.services.announcements.LoadAnnouncementService</implementationClass> |
<description>Load an Announcement view</description> |
118,6 → 132,7 |
<chain name="Logger"/> |
<chain name="Session"/> |
<!--<chain name="Admins"/>--> |
<chain name="InternalAnnouncement"/> |
<chain name="TargetRolesAnnouncement"/> |
</filterChains> |
</service> |
150,6 → 165,7 |
<isTransactional>true</isTransactional> |
<filterChains> |
<chain name="Logger"/> |
<chain name="Session"/> |
</filterChains> |
</service> |
<service> |
223,6 → 239,38 |
</filterChains> |
</service> |
<!--Import Services--> |
<service> |
<name>ImportCourseServices</name> |
<implementationClass>pt.estgp.estgweb.services.sigesimports.ImportCourseService</implementationClass> |
<description>Service to call SiGesWEB Service and import Courses and Course Units</description> |
<isTransactional>true</isTransactional> |
<filterChains> |
<chain name="Logger"/> |
<chain name="Supers"/> |
</filterChains> |
</service> |
<service> |
<name>ImportStudentServices</name> |
<implementationClass>pt.estgp.estgweb.services.sigesimports.ImportStudentService</implementationClass> |
<description>Service to call SiGesWEB Service and import Students and Course Units</description> |
<isTransactional>true</isTransactional> |
<filterChains> |
<chain name="Logger"/> |
<chain name="Supers"/> |
</filterChains> |
</service> |
<service> |
<name>ImportTeacherServices</name> |
<implementationClass>pt.estgp.estgweb.services.sigesimports.ImportTeachersService</implementationClass> |
<description>Service to call SiGesWEB Service and import Teachers and Course Units</description> |
<isTransactional>true</isTransactional> |
<filterChains> |
<chain name="Logger"/> |
<chain name="Supers"/> |
</filterChains> |
</service> |
<!--ProfileServices--> |
<service> |
<name>LoadUserById</name> |
232,6 → 280,7 |
<filterChains> |
<chain name="Logger"/> |
<chain name="Session"/> |
<!-- <chain name="OwnerLoadProfile"/>--> |
</filterChains> |
</service> |
<service> |
242,6 → 291,7 |
<filterChains> |
<chain name="Logger"/> |
<chain name="Session"/> |
<!-- <chain name="OwnerUpdateProfile"/> --> |
</filterChains> |
</service> |
<service> |
/impl/conf/berserk/fd.xml |
---|
24,6 → 24,12 |
<isTransactional>false</isTransactional> |
</filter> |
<filter> |
<name>InternalObject</name> |
<implementationClass>pt.estgp.estgweb.filters.filters.InternalObject</implementationClass> |
<description>Checks if the requested object is internal and if user is authenticated</description> |
<isTransactional>false</isTransactional> |
</filter> |
<filter> |
<name>OwnerUsersClass</name> |
<implementationClass>pt.estgp.estgweb.filters.filters.OwnerUsersClass</implementationClass> |
<description>Checks if the requester contains certain roles</description> |
/impl/conf/berserk/fcd.xml |
---|
27,6 → 27,13 |
<invocationTiming>1</invocationTiming> |
<filterClass>pt.estgp.estgweb.filters.chains.AdminControlFilter</filterClass> |
</filterChain> |
<filterChain> |
<name>Supers</name> |
<expression>AuthenticatedUsers && RoleUsers("super")</expression> |
<description>Super Users Control Chain</description> |
<invocationTiming>1</invocationTiming> |
<filterClass>pt.estgp.estgweb.filters.chains.AdminControlFilter</filterClass> |
</filterChain> |
<!--Generic Owners: need object in service paramenters--> |
<filterChain> |
47,6 → 54,13 |
and referenceClass Name already in 2º filter paramenter |
--> |
<filterChain> |
<name>InternalAnnouncement</name> |
<expression>InternalObject("serializable","pt.estgp.estgweb.domain.Announcement")</expression> |
<description>Check if the object is internal</description> |
<invocationTiming>1</invocationTiming> |
<filterClass>pt.estgp.estgweb.filters.chains.LoadControlFilter</filterClass> |
</filterChain> |
<filterChain> |
<name>TargetRolesAnnouncement</name> |
<expression>TargetRoleUsersClass("serializable","pt.estgp.estgweb.domain.Announcement") || OwnerUsersClass("serializable","pt.estgp.estgweb.domain.Announcement")</expression> |
<description>Owner of an object Control Chain</description> |
88,4 → 102,24 |
<invocationTiming>1</invocationTiming> |
<filterClass>pt.estgp.estgweb.filters.chains.ContextControlFilter</filterClass> |
</filterChain> |
<!--Profile--> |
<filterChain> |
<name>OwnerLoadProfile</name> |
<expression>OwnerUsersClass("serializable","pt.estgp.estgweb.domain.User")</expression> |
<description>Owner of an object Control Chain</description> |
<invocationTiming>1</invocationTiming> |
<filterClass>pt.estgp.estgweb.filters.chains.LoadControlFilter</filterClass> |
</filterChain> |
<filterChain> |
<name>OwnerUpdateProfile</name> |
<expression>OwnerUsersClass("object.serializable","pt.estgp.estgweb.domain.User")</expression> |
<description>Owner of an object Control Chain</description> |
<invocationTiming>1</invocationTiming> |
<filterClass>pt.estgp.estgweb.filters.chains.LoadControlFilter</filterClass> |
</filterChain> |
</filterChainsDefinitions> |
/impl/src/java/jomm/utils/ConfigProperties.java |
---|
119,4 → 119,14 |
{ |
return PropertiesUtils.getListValuesOrderedByPropertyName(getProperties(),propertyPrefix); |
} |
/** |
* @param propertyPrefix to load |
* @return a list of all property names hat starts with the given |
* prefix |
*/ |
public List<String> getListValsOrderedByValue(String propertyPrefix) |
{ |
return PropertiesUtils.getListValuesOrderedByValue(getProperties(),propertyPrefix); |
} |
} |
/impl/src/java/jomm/utils/PropertiesUtils.java |
---|
65,7 → 65,25 |
return props; |
} |
/** |
* @param p to use |
* @param propertyPrefix to find |
* @return a list of values |
*/ |
public static List<String> getListValuesOrderedByValue(Properties p, String propertyPrefix) |
{ |
List<String> props = new ArrayList<String>(); |
List<String> properties = PropertiesUtils.getListProperties(p,propertyPrefix); |
for (Object property1 : properties) |
{ |
String property = (String) property1; |
props.add(p.getProperty(property)); |
} |
Collections.sort(props,StringComparator.getInstance()); |
return props; |
} |
/** |
* Get property and convert it to float |
* |
/impl/src/java/jomm/utils/StringComparator.java |
---|
4,7 → 4,7 |
* |
* @author User |
*/ |
public class StringComparator implements java.util.Comparator |
public class StringComparator implements java.util.Comparator<String> |
{ |
46,8 → 46,8 |
* this fact. The recommended language is "Note: this comparator |
* imposes orderings that are inconsistent with equals." |
* |
* @param o1 the first object to be compared. |
* @param o2 the second object to be compared. |
* @param s1 the first object to be compared. |
* @param s2 the second object to be compared. |
* @return a negative integer, zero, or a positive integer as the |
* first argument is less than, equal to, or greater than the |
* second. |
55,9 → 55,8 |
* being compared by this Comparator. |
* |
*/ |
public int compare(Object o1, Object o2) { |
String s1 = (String) o1; |
String s2 = (String) o2; |
public int compare(String s1, String s2) |
{ |
int compareResult = s2.compareTo(s1); |
if(compareResult > 0) |
return -1; |
65,5 → 64,4 |
return 1; |
return 0; |
} |
} |
/impl/src/java/jomm/web/utils/NavPlace.java |
---|
17,6 → 17,13 |
private String arg0 = null; |
private String arg1 = null; |
public NavPlace(String url,String key) |
{ |
this.url = url; |
this.key = key; |
this.pos = -1; |
} |
/** |
* Creates a new instance of NavPlace |
* |
68,14 → 75,17 |
public String getUrl() |
{ |
if(url != null) |
if(pos >= 0 && url != null) |
{ |
if(url.indexOf("?")>=0) |
return url + "&pos=" + pos; |
else |
return url + "?pos=" + pos; |
} |
return null; |
else |
{ |
return url; |
} |
} |
public void setUrl(String url) |
107,4 → 117,6 |
} |
/impl/src/java/jomm/web/ftp/impl/FtpFile.java |
---|
3,6 → 3,8 |
import java.io.InputStream; |
import java.io.IOException; |
import java.util.Date; |
import java.util.List; |
import java.util.ArrayList; |
import java.net.URL; |
import java.net.MalformedURLException; |
13,6 → 15,7 |
import com.sun.jndi.toolkit.url.UrlUtil; |
import jomm.web.ftp.IFile; |
import jomm.web.ftp.FileType; |
import jomm.web.utils.NavPlace; |
/** |
* @author Jorge Machado |
20,7 → 23,8 |
* @time 17:42:59 |
* @see jomm.web.ftp.impl |
*/ |
public class FtpFile implements IFile { |
public class FtpFile implements IFile |
{ |
private static final Logger logger = Logger.getLogger(FtpFile.class); |
33,22 → 37,22 |
FileType fileType; |
public FtpFile(FTPFile ftpFile,String completeUrl, String path) |
public FtpFile(FTPFile ftpFile, String completeUrl, String path) |
{ |
this.path = path; |
this.completeUrl = completeUrl; |
this.lastUpdate = ftpFile.getTimestamp().getTime(); |
this.name = path.substring(path.lastIndexOf("/")); |
this.name = ftpFile.getName(); |
this.directory = ftpFile.isDirectory(); |
this.size = ftpFile.getSize(); |
if(ftpFile.getType() == FTPFile.DIRECTORY_TYPE) |
if (ftpFile.getType() == FTPFile.DIRECTORY_TYPE) |
fileType = FileType.DIRECTORY; |
else if(ftpFile.getType() == FTPFile.FILE_TYPE) |
else if (ftpFile.getType() == FTPFile.FILE_TYPE) |
fileType = FileType.FILE; |
else if(ftpFile.getType() == FTPFile.UNKNOWN_TYPE) |
else if (ftpFile.getType() == FTPFile.UNKNOWN_TYPE) |
fileType = FileType.UNKNOWN; |
else if(ftpFile.getType() == FTPFile.SYMBOLIC_LINK_TYPE) |
else if (ftpFile.getType() == FTPFile.SYMBOLIC_LINK_TYPE) |
fileType = FileType.LINK; |
} |
61,7 → 65,7 |
} |
catch (MalformedURLException e) |
{ |
logger.error(e,e); |
logger.error(e, e); |
return null; |
} |
72,19 → 76,23 |
return lastUpdate; |
} |
public String getName() { |
public String getName() |
{ |
return name; |
} |
public long getSize() { |
public long getSize() |
{ |
return size; |
} |
public String getOriginalPath() { |
public String getOriginalPath() |
{ |
return path; |
} |
public boolean isDirectory() { |
public boolean isDirectory() |
{ |
return directory; |
} |
98,4 → 106,30 |
{ |
return fileType; |
} |
public List<NavPlace> getNavPlaces() |
{ |
List<NavPlace> navPlaces = new ArrayList<NavPlace>(); |
String[] paths = path.split("/"); |
String url = ""; |
for (int i = paths.length - 1; i >= 0; i--) |
{ |
if(paths[i].trim().length() > 0) |
{ |
NavPlace n; |
if(navPlaces.size() == 0) |
{ |
n = new NavPlace(null,paths[i]); |
} |
else |
{ |
n = new NavPlace(url, paths[i]); |
} |
url += "../"; |
navPlaces.add(0, n); |
} |
} |
return navPlaces; |
} |
} |
/impl/src/java/jomm/web/ftp/IFile.java |
---|
1,8 → 1,11 |
package jomm.web.ftp; |
import jomm.web.utils.NavPlace; |
import java.io.InputStream; |
import java.io.IOException; |
import java.util.Date; |
import java.util.List; |
/** |
* @author Jorge Machado |
21,4 → 24,5 |
public boolean isDirectory(); |
public FileType getType(); |
public String getCompleteUrl(); |
public List<NavPlace> getNavPlaces(); |
} |
/impl/src/java/pt/estgp/estgweb/utils/ConfigProperties.java |
---|
99,4 → 99,14 |
{ |
return getInstance().getListVals(propertyPrefix); |
} |
/** |
* @param propertyPrefix to load |
* @return a list of all values hat starts with the given |
* prefix |
*/ |
public static List<String> getListValuesOrderedByValue(String propertyPrefix) |
{ |
return getInstance().getListValsOrderedByValue(propertyPrefix); |
} |
} |
/impl/src/java/pt/estgp/estgweb/utils/RoleManager.java |
---|
21,6 → 21,7 |
{ |
private static String ROLE_MESSAGE_RESOURCES_PREFIX = "role."; |
public static String ROLE_SEPARATOR = ","; |
private static List<String> roles = null; |
42,7 → 43,7 |
if(u.getRoles() == null || u.getRoles().length() == 0) |
return false; |
String[] roles = u.getRoles().split(","); |
String[] roles = u.getRoles().split(ROLE_SEPARATOR); |
for(String role: roles) |
{ |
if(role.equals(requiredRole)) |
75,7 → 76,7 |
if(roles == null) |
roles = role; |
else |
roles += "," + role; |
roles += ROLE_SEPARATOR + role; |
} |
return roles; |
} |
84,7 → 85,7 |
{ |
if(rolesStr == null) |
return null; |
String[] roles = rolesStr.split(","); |
String[] roles = rolesStr.split(ROLE_SEPARATOR); |
List<String> l = new ArrayList<String>(); |
for(String role: roles) |
{ |
92,4 → 93,12 |
} |
return l; |
} |
public static String catRole(String old, String newRole) |
{ |
if(old == null || old.length() == 0) |
return newRole; |
else |
return old + ROLE_SEPARATOR + newRole; |
} |
} |
/impl/src/java/pt/estgp/estgweb/Globals.java |
---|
3,6 → 3,7 |
import pt.estgp.estgweb.utils.ConfigProperties; |
import java.util.List; |
import java.math.BigDecimal; |
/** |
* @author Jorge Machado |
33,6 → 34,16 |
public static final int NUMBER_ANNOUNCEMENT_TYPE_TOP_FLASH_NEWS_INDEX = 1; |
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 List<String> USER_ROLES = ConfigProperties.getListValues("user.role"); |
public static List<String> USER_ROLES = ConfigProperties.getListValuesOrderedByValue("user.role"); |
public static final String STUDENT_ROLE = ConfigProperties.getProperty("role.student"); |
public static final String TEACHER_ROLE = ConfigProperties.getProperty("role.teacher"); |
public static final BigDecimal SIGES_INSTITUTION_CODE = new BigDecimal(ConfigProperties.getIntProperty("siges.institution.code")); |
public static final long URL_STAT_CHART_EXPIRE_INTERVAL = ConfigProperties.getIntProperty("url.stat.image.expire.interval.time.minutes"); |
public static final String URL_STAT_CHART_TMP_DIR = ConfigProperties.getProperty("url.stat.tmp.dir"); |
public static final int URL_STAT_CACHE_SIZE = ConfigProperties.getIntProperty("url.stat.click.cache.size"); |
public static final long URL_STAT_CACHE_TIMEOUT = ConfigProperties.getIntProperty("url.stat.click.cache.timeout") * 60 * 1000; |
public static final List<String> URL_STAT_IGNORE_EXTENSIONS = ConfigProperties.getListValues("url.stat.ignore.extension"); |
public static final List<String> URL_STAT_IGNORE_PREFIXS = ConfigProperties.getListValues("url.stat.ignore.prefix"); |
} |
/impl/src/java/pt/estgp/estgweb/services/profile/EditUserService.java |
---|
4,6 → 4,7 |
import pt.estgp.estgweb.domain.views.UserView; |
import pt.estgp.estgweb.domain.UserSession; |
import pt.estgp.estgweb.domain.User; |
import pt.estgp.estgweb.domain.UserImpl; |
import pt.estgp.estgweb.domain.dao.DaoFactory; |
import org.apache.log4j.Logger; |
15,9 → 16,22 |
public User run(UserView userView, UserSession userSession) |
{ |
User user=DaoFactory.getUserDaoImpl().get(userView.getSerializable()); |
userView.persistViewInObject(user); |
logger.info("Editing user:" + userView.getId()); |
User user; |
logger.info("Editing user:" + userView.getId()); |
if(((UserImpl) userSession.getUser()).isSuperUserOrAdmin()) |
{ |
user=DaoFactory.getUserDaoImpl().get(userView.getSerializable()); |
userView.persistViewInObjectAdmin(user); |
logger.info("User Edited by:" + userSession.getUser().getName()); |
} |
else |
{ |
user=DaoFactory.getUserDaoImpl().get(userSession.getUser().getSerializable()); |
userView.persistViewInObjectUser(user); |
logger.info("User Edited by:" + userSession.getUser().getName()); |
} |
return user; |
} |
} |
/impl/src/java/pt/estgp/estgweb/services/common/CommonServicesManager.java |
---|
16,6 → 16,7 |
import org.apache.log4j.Logger; |
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.HttpServletResponse; |
import jomm.ir.lucene.LuceneUtils; |
49,8 → 50,8 |
* @return Cluster of Results for each Module with total module results, only return modules with results |
* @throws Throwable on notAuthorized or internal error |
*/ |
public ICommonSearchResults search(HttpServletRequest request, String query, SearchTypeEnum searchType) throws Throwable { |
return search(RequestUtils.getRequester(request), query, searchType); |
public ICommonSearchResults search(HttpServletRequest request,HttpServletResponse response, String query, SearchTypeEnum searchType) throws Throwable { |
return search(RequestUtils.getRequester(request, response), query, searchType); |
} |
/** |
96,8 → 97,8 |
* @throws Throwable on not authorized and internal error |
*/ |
public ISearchResults search(HttpServletRequest request, String query, SearchTypeEnum searchType, String moduleKey, int page) throws Throwable { |
return search(RequestUtils.getRequester(request), query, searchType, ModuleEnum.parse(moduleKey), page); |
public ISearchResults search(HttpServletRequest request,HttpServletResponse response, String query, SearchTypeEnum searchType, String moduleKey, int page) throws Throwable { |
return search(RequestUtils.getRequester(request, response), query, searchType, ModuleEnum.parse(moduleKey), page); |
} |
/** |
196,12 → 197,12 |
return toDoCats; |
} |
public IToDoCat getToDoCats(HttpServletRequest request, String moduleKey) throws Throwable { |
return getToDoCats(RequestUtils.getRequester(request), ModuleEnum.parse(moduleKey)); |
public IToDoCat getToDoCats(HttpServletRequest request, HttpServletResponse response, String moduleKey) throws Throwable { |
return getToDoCats(RequestUtils.getRequester(request, response), ModuleEnum.parse(moduleKey)); |
} |
public IToDoCat getToDoCats(HttpServletRequest request, ModuleEnum module) throws Throwable { |
return getToDoCats(RequestUtils.getRequester(request), module); |
public IToDoCat getToDoCats(HttpServletRequest request, HttpServletResponse response, ModuleEnum module) throws Throwable { |
return getToDoCats(RequestUtils.getRequester(request, response), module); |
} |
/** |
/impl/src/java/pt/estgp/estgweb/services/sigesimports/ImportStudentService.java |
---|
New file |
0,0 → 1,108 |
package pt.estgp.estgweb.services.sigesimports; |
import org.apache.log4j.Logger; |
import pt.estgp.estgweb.services.expceptions.ServiceException; |
import pt.estgp.estgweb.Globals; |
import pt.estgp.estgweb.domain.Student; |
import pt.estgp.estgweb.domain.DomainObjectFactory; |
import pt.estgp.estgweb.domain.CourseUnit; |
import pt.estgp.estgweb.domain.dao.DaoFactory; |
import pt.utl.ist.berserk.logic.serviceManager.IService; |
import pt.ipportalegre.siges.web.services.SiGesWEB; |
import pt.ipportalegre.siges.web.services.ArrayOfDecimal; |
import pt.ipportalegre.siges.web.services.Aluno; |
import java.math.BigDecimal; |
import java.util.List; |
import java.util.Set; |
import java.util.HashSet; |
import jomm.dao.impl.AbstractDao; |
/** |
* @author Jorge Machado |
* @date 11/May/2008 |
* @time 12:51:32 |
* @see pt.estgp.estgweb |
*/ |
public class ImportStudentService implements IService |
{ |
private static final Logger logger = Logger.getLogger(ImportStudentService.class); |
public void run() throws ServiceException { |
//todo passar para um utilitario que cria automaticamente o ano lectivo |
String year = "200708"; |
SiGesWEB service = new SiGesWEB(); |
ArrayOfDecimal codigosAlunos = service.getSiGesWEBSoap().getCodigosAlunosInscritosDaInstituicao(Globals.SIGES_INSTITUTION_CODE,year); |
List<BigDecimal> codigos = codigosAlunos.getDecimal(); |
for(BigDecimal c: codigos) |
{ |
Aluno d = service.getSiGesWEBSoap().getAlunoInscrito(c,Globals.SIGES_INSTITUTION_CODE,year); |
Student t = DaoFactory.getStudentDaoImpl().loadBySigesCode(d.getCodigo().intValue()); |
if(t == null) |
{ |
t = DomainObjectFactory.createStudentImpl(); |
DaoFactory.getStudentDaoImpl().save(t); |
} |
persist(d,t); |
} |
} |
/** |
* Nao esta testado |
* jm |
* @param d Aluno |
* @param t Student |
*/ |
private void persist(Aluno d, Student t) |
{ |
t.setName(d.getNome()); |
t.setEmail(d.getEmail()); |
t.setSigesCode(d.getCodigo().intValue()); |
t.setAddress(d.getMorada()); |
t.setZip(""+d.getCodigoPostal().intValue()); |
t.setBi(d.getNumeroBi()); |
t.setSex(d.getSexo()); |
t.setUserNameNetpa(d.getUsernameNetpa()); |
t.setBirthDate(d.getDataNascimento().toGregorianCalendar().getTime()); |
/*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.getDisciplinas() == null || d.getDisciplinas().getDecimal() == null || d.getDisciplinas().getDecimal().size() == 0) |
logger.warn("ATENTION TEACHER WITH ZERO UNITS: codigoFuncionario " + d.getCodigoFuncionario()); |
else |
{ |
Set<CourseUnit> units = new HashSet<CourseUnit>(); |
for(BigDecimal unitCode: d.getDisciplinas().getDecimal()) |
{ |
List<CourseUnit> l = DaoFactory.getCourseUnitDaoImpl().loadBySigesCode("" + unitCode.intValue()); |
if(l != null) |
units.addAll(l); |
else |
logger.warn("ATENTION SIGES COURSE UNIT NOT FOUND IN BACO STORAGE: curseUnit " + unitCode.intValue()); |
} |
t.setSubscribedUnits();Units(units); |
} |
} |
/** |
* Testar por aqui poi requer Super Role e assim e' autmatico |
* @param args of main |
* @throws ServiceException on error |
public static void main(String[]args) throws ServiceException |
{ |
AbstractDao.getCurrentSession().beginTransaction(); |
new ImportStudentService().run(); |
AbstractDao.getCurrentSession().getTransaction().commit(); |
} |
*/ |
} |
} |
/impl/src/java/pt/estgp/estgweb/services/sigesimports/ImportTeachersService.java |
---|
New file |
0,0 → 1,97 |
package pt.estgp.estgweb.services.sigesimports; |
import pt.utl.ist.berserk.logic.serviceManager.IService; |
import pt.estgp.estgweb.services.expceptions.ServiceException; |
import pt.estgp.estgweb.Globals; |
import pt.estgp.estgweb.domain.dao.DaoFactory; |
import pt.estgp.estgweb.domain.Teacher; |
import pt.estgp.estgweb.domain.DomainObjectFactory; |
import pt.estgp.estgweb.domain.CourseUnit; |
import pt.ipportalegre.siges.web.services.*; |
import org.apache.log4j.Logger; |
import java.util.*; |
import java.math.BigDecimal; |
import jomm.dao.impl.AbstractDao; |
/** |
* @author Jorge Machado |
* @date 11/May/2008 |
* @time 12:51:32 |
* @see pt.estgp.estgweb |
*/ |
public class ImportTeachersService implements IService |
{ |
private static final Logger logger = Logger.getLogger(ImportTeachersService.class); |
public void run() throws ServiceException |
{ |
//todo passar para um utilitario que cria automaticamente o ano lectivo |
String year = "200708"; |
SiGesWEB service = new SiGesWEB(); |
ArrayOfDecimal codigosDocentes = service.getSiGesWEBSoap().getCodigosDocentesInscritosDaInstituicao(Globals.SIGES_INSTITUTION_CODE,year); |
List<BigDecimal> codigos = codigosDocentes.getDecimal(); |
for(BigDecimal c: codigos) |
{ |
Docente d = service.getSiGesWEBSoap().getDocente(c,Globals.SIGES_INSTITUTION_CODE,year); |
Teacher t = DaoFactory.getTeacherDaoImpl().loadBySigesCode(d.getCodigoFuncionario().intValue()); |
if(t == null) |
{ |
t = DomainObjectFactory.createTeacherImpl(); |
DaoFactory.getTeacherDaoImpl().save(t); |
} |
persist(d,t); |
} |
} |
/** |
* Nao esta testado |
* jm |
* @param d docente |
* @param t teacher |
*/ |
private void persist(Docente d, Teacher t) |
{ |
t.setName(d.getNomeFuncionarioInt()); |
t.setEmail(d.getEmail()); |
t.setSigesCode(d.getCodigoFuncionario().intValue()); |
t.setAddress(d.getMorada()); |
t.setZip(""+d.getCodigoPostal().intValue()); |
t.setBi(d.getNumeroBi()); |
t.setEmployerName(d.getNomeFuncionario()); |
t.setAcademicName(d.getNomeAcademico()); |
t.setBirthDate(d.getDataNascimento().toGregorianCalendar().getTime()); |
//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.getDisciplinas() == null || d.getDisciplinas().getDecimal() == null || d.getDisciplinas().getDecimal().size() == 0) |
logger.warn("ATENTION TEACHER WITH ZERO UNITS: codigoFuncionario " + d.getCodigoFuncionario()); |
else |
{ |
Set<CourseUnit> units = new HashSet<CourseUnit>(); |
for(BigDecimal unitCode: d.getDisciplinas().getDecimal()) |
{ |
List<CourseUnit> l = DaoFactory.getCourseUnitDaoImpl().loadBySigesCode("" + unitCode.intValue()); |
if(l != null) |
units.addAll(l); |
else |
logger.warn("ATENTION SIGES COURSE UNIT NOT FOUND IN BACO STORAGE: curseUnit " + unitCode.intValue()); |
} |
t.setTeachedUnits(units); |
} |
} |
/** |
* Testar por aqui poi requer Super Role e assim e' autmatico |
* @param args of main |
* @throws ServiceException on error |
*/ |
public static void main(String[]args) throws ServiceException |
{ |
AbstractDao.getCurrentSession().beginTransaction(); |
new ImportTeachersService().run(); |
AbstractDao.getCurrentSession().getTransaction().commit(); |
} |
} |
/impl/src/java/pt/estgp/estgweb/services/sigesimports/ImportCourseService.java |
---|
6,6 → 6,8 |
import pt.estgp.estgweb.domain.views.BlogView; |
import pt.estgp.estgweb.domain.Blog; |
import pt.estgp.estgweb.domain.UserSession; |
import pt.estgp.estgweb.domain.CourseUnit; |
import pt.estgp.estgweb.domain.DomainObjectFactory; |
import pt.estgp.estgweb.domain.dao.DaoFactory; |
import pt.estgp.estgweb.Globals; |
import pt.ipportalegre.siges.web.services.*; |
14,6 → 16,8 |
import java.util.*; |
import java.math.BigDecimal; |
import jomm.dao.impl.AbstractDao; |
/* |
* @author Goncalo Luiz gedl [AT] rnl [DOT] ist [DOT] utl [DOT] pt |
* |
44,7 → 48,15 |
disciplinasMap.put(d.getCodigo().intValue(),d); |
cursosMap.put(d.getCodigoCurso().intValue(),d); |
System.out.println(d.getNome() + " " + d.getNomeCurso()); |
CourseUnit c = DomainObjectFactory.createCourseUnitImpl(); |
c.setName(d.getNome()); |
c.setInstitutionCode(""+Globals.SIGES_INSTITUTION_CODE); |
c.setCode("" + d.getCodigo().intValue()); |
c.setCourseCode(""+d.getCodigoCurso()); |
c.setCourseName("" + d.getNomeCurso()); |
DaoFactory.getCourseUnitDaoImpl().save(c); |
} |
Set<Map.Entry<Integer,Disciplina>> set = disciplinasMap.entrySet(); |
81,11 → 93,16 |
} |
public static void main(String[]args) throws ServiceException { |
AbstractDao.getCurrentSession().beginTransaction(); |
new ImportCourseService().run(); |
AbstractDao.getCurrentSession().getTransaction().commit(); |
} |
/impl/src/java/pt/estgp/estgweb/services/announcements/LoadRoleTypeMaxAnnouncementsService.java |
---|
30,7 → 30,7 |
private static final Logger logger = Logger.getLogger(LoadRoleTypeMaxAnnouncementsService.class); |
private static final int MAX_ANNOUNCEMENTS = ConfigProperties.getIntProperty("announcements.max.visible"); |
public List<AnnouncementView> run(String roles,String typeNews,String subTarget) |
public List<AnnouncementView> run(String roles,String typeNews,String subTarget,UserSession sess) |
{ |
List<String> targetRoles = new ArrayList<String>(); |
if (roles.contains(",")) |
45,7 → 45,11 |
{ |
targetRoles.add(roles); |
} |
List<Announcement> announcements = DaoFactory.getAnnouncementDaoImpl().findAnnouncements(MAX_ANNOUNCEMENTS,targetRoles,typeNews,subTarget); |
boolean internal = true; |
if(sess.getUser() == null) |
internal = false; |
List<Announcement> announcements = DaoFactory.getAnnouncementDaoImpl().findAnnouncements(MAX_ANNOUNCEMENTS,targetRoles,typeNews,subTarget,internal); |
if(announcements == null) |
return null; |
List<AnnouncementView> announcementViews = new ArrayList<AnnouncementView>(); |
/impl/src/java/pt/estgp/estgweb/services/announcements/AnnouncementsCommonServices.java |
---|
19,43 → 19,46 |
import jomm.dao.impl.AbstractDao; |
/* |
* @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 |
* @date 25/Apr/2008 |
* @time 18:01:54 |
* @see pt.estgp.estgweb.web |
*/ |
public class AnnouncementsCommonServices implements IService, IModuleCommonServices { |
public class AnnouncementsCommonServices implements IService, IModuleCommonServices |
{ |
private static final Logger logger = Logger.getLogger(AnnouncementsCommonServices.class); |
public int countSearch(String search, SearchTypeEnum searchType, UserSession userSession) { |
return 0; //To change body of implemented methods use File | Settings | File Templates. |
public int countSearch(String search, SearchTypeEnum searchType, UserSession userSession) |
{ |
return 0; // todo To change body of implemented methods use File | Settings | File Templates. |
} |
public ISearchResults search(String search, SearchTypeEnum searchType, int page, int maxResults, UserSession userSession) { |
public ISearchResults search(String search, SearchTypeEnum searchType, int page, int maxResults, UserSession userSession) |
{ |
DefaultSearchResults searchResults = new DefaultSearchResults(); |
searchResults.setModule(ModuleEnum.Announcements); |
List<String> roles; |
if (userSession == null || userSession.getUser() == null || ((UserImpl) userSession.getUser()).getRolesList() == null || ((UserImpl) userSession.getUser()).getRolesList().size() == 0) { |
if (userSession == null || userSession.getUser() == null || ((UserImpl) userSession.getUser()).getRolesList() == null || ((UserImpl) userSession.getUser()).getRolesList().size() == 0) |
{ |
roles = new ArrayList<String>(); |
roles.add(Globals.ALL_ROLE); |
} |
else |
roles = ((UserImpl) userSession.getUser()).getRolesList(); |
searchResults.setTotalResults(DaoFactory.getAnnouncementDaoImpl().countAnnouncements(search, searchType, roles, null)); |
if (searchResults.getTotalResults() > 0) { |
List<Announcement> announcements = DaoFactory.getAnnouncementDaoImpl().searchAnnouncements(search, searchType, maxResults, page, roles, null); |
boolean internal = true; |
if (userSession.getUser() == null) |
internal = false; |
searchResults.setTotalResults(DaoFactory.getAnnouncementDaoImpl().countAnnouncements(search, searchType, roles, null,internal)); |
if (searchResults.getTotalResults() > 0) |
{ |
List<Announcement> announcements = DaoFactory.getAnnouncementDaoImpl().searchAnnouncements(search, searchType, maxResults, page, roles, null,internal); |
if (announcements == null) |
return searchResults; |
for (Announcement a : announcements) { |
for (Announcement a : announcements) |
{ |
DefaultResult defaultResult = new DefaultResult(); |
defaultResult.setTitle(a.getTitle()); |
defaultResult.setSubTitle("announcements.type." + a.getType()); |
68,21 → 71,25 |
return searchResults; |
} |
public int countToDo(UserSession userSession) { |
return 0; //To change body of implemented methods use File | Settings | File Templates. |
public int countToDo(UserSession userSession) |
{ |
return 0; //todo To change body of implemented methods use File | Settings | File Templates. |
} |
public IToDoCat getToDo(UserSession userSession) { |
return null; //To change body of implemented methods use File | Settings | File Templates. |
public IToDoCat getToDo(UserSession userSession) |
{ |
return null; //todo To change body of implemented methods use File | Settings | File Templates. |
} |
public static void main(String[] args) { |
public static void main(String[] args) |
{ |
AbstractDao.getCurrentSession().beginTransaction(); |
UserSession sess = new UserSessionImpl(); |
sess.setUser(new UserImpl()); |
sess.getUser().setRoles("all"); |
ISearchResults searchResults = new AnnouncementsCommonServices().search("teste", SearchTypeEnum.AllWords, 0, 10, sess); |
for (IResult result : searchResults.getResults()) { |
for (IResult result : searchResults.getResults()) |
{ |
System.out.println("title:" + result.getTitle()); |
System.out.println("subTitle:" + result.getSubTitle()); |
System.out.println("text:" + result.getText()); |
/impl/src/java/pt/estgp/estgweb/services/announcements/LoadTargetMaxAnnouncementsService.java |
---|
27,7 → 27,10 |
List<String> targetRoles = null; |
if(userSession.getUser() != null) |
targetRoles = userSession.getUser().getTargetRolesList(); |
List<Announcement> announcements = DaoFactory.getAnnouncementDaoImpl().findAnnouncements(MAX_ANNOUNCEMENTS,targetRoles,subTarget); |
boolean internal = true; |
if (userSession.getUser() == null) |
internal = false; |
List<Announcement> announcements = DaoFactory.getAnnouncementDaoImpl().findAnnouncements(MAX_ANNOUNCEMENTS,targetRoles,subTarget,internal); |
if(announcements == null) |
return null; |
List<AnnouncementView> announcementViews = new ArrayList<AnnouncementView>(); |
/impl/src/java/pt/estgp/estgweb/services/announcements/LoadTopFlashNewsIterateService.java |
---|
16,11 → 16,10 |
import java.util.ArrayList; |
/** |
* Created by IntelliJ IDEA. |
* User: Fabio |
* Date: 28/Mar/2008 |
* Time: 11:42:28 |
* To change this template use File | Settings | File Templates. |
* @author Jorge Machado |
* @date 28/Mar/2008 |
* @time 18:01:54 |
* @see pt.estgp.estgweb.web |
*/ |
public class LoadTopFlashNewsIterateService implements IService |
{ |
32,23 → 31,29 |
public AnnouncementView run(String subTarget, UserSession sess) |
{ |
Integer iterator = (Integer) ((UserSessionImpl)sess).get(flashNewsIterator); |
if(iterator == null) |
Integer iterator = (Integer) ((UserSessionImpl) sess).get(flashNewsIterator); |
if (iterator == null) |
iterator = 0; |
int size = DaoFactory.getAnnouncementDaoImpl().countAnnouncements(1,null,Globals.ANNOUNCEMENT_TYPE_TOP_FLASH_NEWS,null); |
iterator = iterator % size; |
List<Announcement> announcements = DaoFactory.getAnnouncementDaoImpl().findAnnouncements(iterator, 1,null,Globals.ANNOUNCEMENT_TYPE_TOP_FLASH_NEWS,subTarget); |
iterator++; |
((UserSessionImpl)sess).put(flashNewsIterator,iterator); |
boolean internal = true; |
if (sess.getUser() == null) |
internal = false; |
int size = DaoFactory.getAnnouncementDaoImpl().countAnnouncements(1, null, Globals.ANNOUNCEMENT_TYPE_TOP_FLASH_NEWS, null, internal); |
if (size != 0) |
{ |
iterator = iterator % size; |
List<Announcement> announcements = DaoFactory.getAnnouncementDaoImpl().findAnnouncements(iterator, 1, null, Globals.ANNOUNCEMENT_TYPE_TOP_FLASH_NEWS, subTarget, internal); |
iterator++; |
((UserSessionImpl) sess).put(flashNewsIterator, iterator); |
if(announcements == null) |
return null; |
logger.info("Loading announcement top flash iterator"); |
if(announcements.size() > 0) |
{ |
AnnouncementView announcementView = new AnnouncementView(announcements.get(0)); |
return announcementView; |
if (announcements == null) |
return null; |
logger.info("Loading announcement top flash iterator"); |
if (announcements.size() > 0) |
{ |
return new AnnouncementView(announcements.get(0)); |
} |
} |
return null; |
} |
58,12 → 63,13 |
//mudei a propriedade log.file build.properties para log.file=${data.dir}/estgweb.log assim ja nao da o erro do log |
//adicionei as libs jsp-api.jar da pasta tomcat/common/lib para nao te falhar os imports nas TAGS aqui no Intellij |
//adiciona sempre todos os jars da common aqui no Intellij faltava-te o activation.jar do jaxb e era preciso para o MimeTypeGuesser |
public static void main(String[] args) throws Throwable { |
public static void main(String[] args) throws Throwable |
{ |
IServiceManager sm = ServiceManager.getInstance(); |
String[] names = new String[]{}; |
Object[] arguments = new Object[]{}; |
AnnouncementView announcementView = (AnnouncementView) sm.execute("testecookie", "LoadTopFlashNewsIterate",arguments,names); |
System.out.println("-->"+announcementView.getTitle()); |
AnnouncementView announcementView = (AnnouncementView) sm.execute("testecookie", "LoadTopFlashNewsIterate", arguments, names); |
System.out.println("-->" + announcementView.getTitle()); |
} |
/impl/src/java/pt/estgp/estgweb/services/announcements/DeleteAnnouncementService.java |
---|
New file |
0,0 → 1,47 |
package pt.estgp.estgweb.services.announcements; |
import pt.utl.ist.berserk.logic.serviceManager.IService; |
import pt.estgp.estgweb.domain.views.AnnouncementView; |
import pt.estgp.estgweb.domain.UserSession; |
import pt.estgp.estgweb.domain.Announcement; |
import pt.estgp.estgweb.domain.DomainObjectFactory; |
import pt.estgp.estgweb.domain.dao.DaoFactory; |
import org.apache.log4j.Logger; |
import java.io.Serializable; |
/* |
* @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 DeleteAnnouncementService implements IService { |
private static final Logger logger = Logger.getLogger(DeleteAnnouncementService.class); |
public Boolean run(Serializable id, UserSession userSession) |
{ |
try |
{ |
logger.info("Deleting announcement:" + id); |
DaoFactory.getAnnouncementDaoImpl().delete(id); |
return true; |
} |
catch(Exception e) |
{ |
logger.error("Can´t delete announcement:"+id +""+e); |
return false; |
} |
} |
} |
/impl/src/java/pt/estgp/estgweb/services/authenticate/AuthenticateService.java |
---|
85,7 → 85,6 |
UserImpl u = DomainObjectFactory.createUserImpl(); |
u.setUsername(username); |
u.setName(getName(map)); |
u.setAddress("urra"); |
u.setRoles(getRoles(map)); |
u.setNewUser(true); |
DaoFactory.getUserDaoImpl().save(u); |
/impl/src/java/pt/estgp/estgweb/services/urlstat/ChartBuilderService.java |
---|
19,7 → 19,6 |
import pt.estgp.estgweb.domain.UrlStatMonth; |
import pt.estgp.estgweb.domain.dao.DaoFactory; |
import pt.estgp.estgweb.services.expceptions.ServiceException; |
import pt.estgp.estgweb.utils.ConfigProperties; |
import pt.estgp.estgweb.Globals; |
import jomm.utils.DatesUtils; |
import jomm.dao.impl.AbstractDao; |
46,8 → 45,8 |
{ |
private static final Logger logger = Logger.getLogger(ChartBuilderService.class); |
public static final long LINK_CHART_EXPIRE_INTERVAL = ConfigProperties.getIntProperty("url.stat.image.expire.interval.time.minutes") * 60 * 1000; |
public static final String LINK_CHART_TMP_DIR = ConfigProperties.getProperty("url.stat.tmp.dir"); |
public static final long LINK_CHART_EXPIRE_INTERVAL = Globals.URL_STAT_CHART_EXPIRE_INTERVAL; |
public static final String LINK_CHART_TMP_DIR = Globals.URL_STAT_CHART_TMP_DIR; |
/** |
* Return file image location |
/impl/src/java/pt/estgp/estgweb/domain/UserManagedRoleImpl.java |
---|
New file |
0,0 → 1,40 |
package pt.estgp.estgweb.domain; |
import java.util.Date; |
import java.util.Set; |
public abstract class UserManagedRoleImpl extends UserImpl |
{ |
public UserManagedRoleImpl() |
{ |
} |
public UserManagedRoleImpl(Date saveDate, boolean superuser, String name, String username, String password, String roles, String address, String zip, String country, String email, String outEmail, String phonenumber, String sex, String bi, Date birthDate, Set<Group> groups, Set<CourseUserAssociation> courses) |
{ |
super(saveDate, superuser, name, username, password, roles, address, zip, country, email, outEmail, phonenumber, sex, bi, birthDate, groups, courses); |
} |
/** |
* |
* @return the managed role of implementation object |
*/ |
public abstract String getManagedRole(); |
/** |
* |
* @return roles of student check first if has student role |
*/ |
public String getRoles() |
{ |
if(super.getRoles() == null) |
super.setRoles(getManagedRole()); |
else if(super.getRoles().indexOf(getManagedRole()) < 0) |
{ |
addRole(getManagedRole()); |
} |
return super.getRoles(); |
} |
} |
/impl/src/java/pt/estgp/estgweb/domain/UserImpl.java |
---|
1,10 → 1,12 |
package pt.estgp.estgweb.domain; |
import pt.estgp.estgweb.utils.RoleManager; |
import pt.estgp.estgweb.Globals; |
import java.io.Serializable; |
import java.util.Date; |
import java.util.List; |
import java.util.ArrayList; |
import java.io.Serializable; |
import java.util.Set; |
/** |
* @author Jorge Machado |
16,45 → 18,62 |
{ |
private boolean newUser = false; |
public UserImpl() |
{ |
} |
public boolean isNewUser() { |
public UserImpl(Date saveDate, boolean superuser, String name, String username, String password, String roles, String address, String zip, String country, String email, String outEmail, String phonenumber, String sex, String bi, Date birthDate, Set<Group> groups, Set<CourseUserAssociation> courses) |
{ |
super(saveDate, superuser, name, username, password, roles, address, zip, country, email, outEmail, phonenumber, sex, bi, birthDate, groups, courses); |
} |
public boolean isNewUser() |
{ |
return newUser; |
} |
public void setNewUser(boolean newUser) { |
public void setNewUser(boolean newUser) |
{ |
this.newUser = newUser; |
} |
} |
/** |
* check if user is in some group |
* |
* @param g to check |
* @return true if belongs to group |
*/ |
public boolean hasGroup(Group g) |
{ |
if(getGroups() == null) |
if (getGroups() == null) |
return false; |
for(Group group: getGroups()) |
for (Group group : getGroups()) |
{ |
if(group.getId() == g.getId()) |
if (group.getId() == g.getId()) |
return true; |
} |
return false; |
} |
public void addRole(String role) |
{ |
setRoles(RoleManager.catRole(getRoles(), role)); |
} |
public boolean hasRole(String r) |
{ |
if(r == null || getRoles() == null || getRoles().length() == 0) |
if (r == null || getRoles() == null || getRoles().length() == 0) |
return false; |
for(String role: RoleManager.getRolesFromSerial(getRoles())) |
for (String role : RoleManager.getRolesFromSerial(getRoles())) |
{ |
if(role.equals(r)) |
if (role.equals(r)) |
return true; |
} |
return false; |
} |
/** |
* |
* @return a list of role Strings |
*/ |
public List<String> getOwnerRoles() |
71,4 → 90,24 |
{ |
return getId(); |
} |
public User getOwner() |
{ |
return this; |
} |
public boolean isSuperUser() |
{ |
return super.isSuperuser() || hasRole(Globals.SUPER_USER_ROLE); |
} |
public boolean isAdmin() |
{ |
return hasRole(Globals.ADMIN_ROLE); |
} |
public boolean isSuperUserOrAdmin() |
{ |
return isSuperUser() || isAdmin(); |
} |
} |
/impl/src/java/pt/estgp/estgweb/domain/UserSessionImpl.java |
---|
14,7 → 14,7 |
import pt.estgp.estgweb.domain.dao.DaoFactory; |
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.HttpSession; |
import javax.servlet.http.HttpServletResponse; |
/** |
* @author Jorge Machado |
232,9 → 232,9 |
* @param request |
* @throws Throwable |
*/ |
public void serialize(HttpServletRequest request) throws Throwable |
public void serialize(HttpServletRequest request, HttpServletResponse response) throws Throwable |
{ |
serialize(RequestUtils.getRequester(request)); |
serialize(RequestUtils.getRequester(request, response)); |
} |
/** |
/impl/src/java/pt/estgp/estgweb/domain/enums/AnnouncementStyleEnum.java |
---|
New file |
0,0 → 1,45 |
package pt.estgp.estgweb.domain.enums; |
/** |
* Created by IntelliJ IDEA. |
* User: Jorge Machado |
* Date: 14/Mai/2008 |
* Time: 12:24:35 |
* To change this template use File | Settings | File Templates. |
*/ |
public enum AnnouncementStyleEnum { |
imgLeft("announcement.style.img.left"), |
imgLeftTop("announcement.style.img.left.top"), |
imgLeftBottom("announcement.style.img.left.bottom"), |
imgRight("announcement.style.img.right"), |
imgRightTop("announcement.style.img.right.top"), |
imgRightBottom("announcement.style.img.right.bottom"), |
imgTop("announcement.style.img.top"), |
imgTopLeft("announcement.style.img.top.left"), |
imgTopRight("announcement.style.img.top.right"), |
imgEmbeddedLeft("announcement.style.img.embedded.left"), |
imgEmbeddedRight("announcement.style.img.embedded.right"); |
private String messageKey; |
private AnnouncementStyleEnum(String messageKey) |
{ |
this.messageKey = messageKey; |
} |
public String getMessageKey() |
{ |
return messageKey; |
} |
public static AnnouncementStyleEnum parse(String type) |
{ |
for(AnnouncementStyleEnum styleEnum: values()) |
{ |
if(styleEnum.getMessageKey().equals(type)) |
return styleEnum; |
} |
return null; |
} |
} |
/impl/src/java/pt/estgp/estgweb/domain/StudentImpl.java |
---|
New file |
0,0 → 1,21 |
package pt.estgp.estgweb.domain; |
import pt.estgp.estgweb.utils.RoleManager; |
import pt.estgp.estgweb.Globals; |
/** |
* @author Jorge Machado |
* @date 28/Fev/2008 |
* @time 12:51:32 |
* @see pt.estgp.estgweb |
*/ |
public class StudentImpl extends Student |
{ |
public static final String STUDENT_ROLE = Globals.STUDENT_ROLE; |
public String getManagedRole() { |
return STUDENT_ROLE; |
} |
} |
/impl/src/java/pt/estgp/estgweb/domain/AnnouncementImpl.java |
---|
1,6 → 1,7 |
package pt.estgp.estgweb.domain; |
import pt.estgp.estgweb.utils.RoleManager; |
import pt.estgp.estgweb.domain.enums.AnnouncementStyleEnum; |
import java.util.Date; |
import java.util.List; |
19,6 → 20,13 |
return super.getOwner(); |
} |
public String getStyle() |
{ |
if(super.getStyle() == null) |
setStyle(AnnouncementStyleEnum.imgEmbeddedLeft.getMessageKey()); |
return super.getStyle(); |
} |
public Serializable getSerializable() |
{ |
return getId(); |
/impl/src/java/pt/estgp/estgweb/domain/views/AnnouncementView.java |
---|
3,6 → 3,7 |
import pt.estgp.estgweb.domain.Announcement; |
import pt.estgp.estgweb.domain.Image; |
import pt.estgp.estgweb.domain.AnnouncementImpl; |
import pt.estgp.estgweb.domain.enums.AnnouncementStyleEnum; |
import pt.estgp.estgweb.utils.RoleManager; |
import pt.estgp.estgweb.utils.ConfigProperties; |
34,7 → 35,12 |
private Date expireDate; |
private Integer counter; |
private boolean status; |
private boolean internal; |
private long ownerID; |
private String style; |
private String internalUrlServer; |
private String internalUrlPath; |
private boolean internalUrlInclude; |
public AnnouncementView() |
{} |
57,6 → 63,11 |
this.expireDate = announcement.getExpireDate(); |
this.choosedOwnerRole = announcement.getChoosedOwnerRole(); |
this.ownerID=announcement.getOwner().getId(); |
this.internalUrlServer = announcement.getInternalUrlServer(); |
this.internalUrlPath = announcement.getInternalUrlPath(); |
this.style = announcement.getStyle(); |
this.internalUrlInclude = announcement.isInternalUrlInclude(); |
this.internal = announcement.isInternal(); |
} |
public void persistViewInObject(Announcement announcement) |
73,9 → 84,59 |
announcement.setStatus(status); |
announcement.setCounter(counter); |
announcement.setChoosedOwnerRole(choosedOwnerRole); |
announcement.setInternalUrlServer(internalUrlServer); |
announcement.setInternalUrlPath(internalUrlPath); |
announcement.setStyle(style); |
announcement.setInternalUrlInclude(internalUrlInclude); |
announcement.setInternal(internal); |
} |
public boolean isInternal() { |
return internal; |
} |
public void setInternal(boolean internal) { |
this.internal = internal; |
} |
public boolean isInternalUrlInclude() { |
return internalUrlInclude; |
} |
public void setInternalUrlInclude(boolean internalUrlInclude) { |
this.internalUrlInclude = internalUrlInclude; |
} |
public String getStyle() { |
return style; |
} |
public AnnouncementStyleEnum getStyleEnum() |
{ |
return AnnouncementStyleEnum.parse(style); |
} |
public void setStyle(String style) { |
this.style = style; |
} |
public String getInternalUrlPath() { |
return internalUrlPath; |
} |
public void setInternalUrlPath(String internalUrlPath) { |
this.internalUrlPath = internalUrlPath; |
} |
public String getInternalUrlServer() { |
return internalUrlServer; |
} |
public void setInternalUrlServer(String internalUrlServer) { |
this.internalUrlServer = internalUrlServer; |
} |
public String getChoosedOwnerRole() { |
return choosedOwnerRole; |
} |
216,6 → 277,38 |
return getText(); |
} |
public String getFormatedText() |
{ |
if(text == null | text.trim().length() == 0) |
return ""; |
String formatedText = text; |
StringBuilder finalFormatedText = new StringBuilder(); |
boolean newLine = true; |
for(int i =0;i<formatedText.length();i++) |
{ |
if(newLine && formatedText.charAt(i) == ' ') |
{ |
finalFormatedText.append(" "); |
} |
else if(formatedText.charAt(i) == '\n') |
{ |
finalFormatedText.append("<br>"); |
newLine = true; |
} |
else if(formatedText.charAt(i) == '\t') |
{ |
finalFormatedText.append(" "); |
} |
else |
{ |
finalFormatedText.append(formatedText.charAt(i)); |
newLine = false; |
} |
} |
return finalFormatedText.toString(); |
} |
public Boolean getHaveAllText() |
{ |
if(getType().equals("top.flash.news")) |
/impl/src/java/pt/estgp/estgweb/domain/views/UserView.java |
---|
21,12 → 21,16 |
{ |
private long id; |
private String name; |
private String userRoles; |
private List<String> userRoles; |
private String address; |
private String zip; |
private String country; |
private String email; |
private String outEmail; |
private String phonenumber; |
private String bi; |
private Date birthDate; |
private String username; |
public UserView() |
{} |
42,10 → 46,14 |
this.country=user.getCountry(); |
this.email=user.getEmail(); |
this.phonenumber=user.getPhonenumber(); |
this.userRoles = user.getRoles(); |
this.userRoles = RoleManager.getRolesFromSerial(user.getRoles()); |
this.outEmail=user.getOutEmail(); |
this.bi=user.getBi(); |
this.birthDate=user.getBirthDate(); |
this.username=user.getUsername(); |
} |
public void persistViewInObject(User user) |
public void persistViewInObjectAdmin(User user) |
{ |
user.setName(name); |
user.setAddress(address); |
53,9 → 61,18 |
user.setCountry(country); |
user.setEmail(email); |
user.setPhonenumber(phonenumber); |
user.setRoles(userRoles); |
user.setRoles(RoleManager.getSerialRoles(userRoles)); |
user.setOutEmail(outEmail); |
user.setBi(bi); |
user.setBirthDate(birthDate); |
user.setUsername(username); |
} |
public void persistViewInObjectUser(User user) |
{ |
user.setOutEmail(outEmail); |
} |
public Class getReferenceClass() |
{ |
return User.class; |
82,11 → 99,11 |
this.name = name; |
} |
public String getUserRoles() { |
public List<String> getUserRoles() { |
return userRoles; |
} |
public void setUserRoles(String userRoles) { |
public void setUserRoles(List<String> userRoles) { |
this.userRoles = userRoles; |
} |
129,4 → 146,36 |
public void setPhonenumber(String phonenumber) { |
this.phonenumber = phonenumber; |
} |
public String getOutEmail() { |
return outEmail; |
} |
public void setOutEmail(String outEmail) { |
this.outEmail = outEmail; |
} |
public String getBi() { |
return bi; |
} |
public void setBi(String bi) { |
this.bi = bi; |
} |
public Date getBirthDate() { |
return birthDate; |
} |
public void setBirthDate(Date birthDate) { |
this.birthDate = birthDate; |
} |
public String getUsername() { |
return username; |
} |
public void setUsername(String username) { |
this.username = username; |
} |
} |
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/AnnouncementDaoImpl.java |
---|
31,7 → 31,7 |
return (AnnouncementDaoImpl) myInstance; |
} |
public List<Announcement> findAnnouncements(int maxAnnouncements, List<String> roles, String subTarget) { |
public List<Announcement> findAnnouncements(int maxAnnouncements, List<String> roles, String subTarget,boolean internal) { |
if (roles == null) { |
roles = new ArrayList<String>(); |
roles.add("all"); |
53,6 → 53,8 |
else { |
coSubTargets = eq("subTargets", subTarget); |
} |
if(!internal) |
criteria.add(eq("internal",false)); |
MyCalendar cNow = new MyCalendar(); |
MyCalendar calendarWithOutTime = new MyCalendar(cNow.getYear(), cNow.getMonth(), cNow.getDay()); |
Date now = calendarWithOutTime.getTime(); |
66,31 → 68,31 |
return criteria.list(); |
} |
public List<Announcement> findAnnouncements(int maxAnnouncements, List<String> roles, String type, String subTarget) { |
return findAnnouncements(0, maxAnnouncements, roles, type, subTarget); |
public List<Announcement> findAnnouncements(int maxAnnouncements, List<String> roles, String type, String subTarget, boolean internal) { |
return findAnnouncements(0, maxAnnouncements, roles, type, subTarget,internal); |
} |
public List<Announcement> findAnnouncements(int startPage, int maxAnnouncements, List<String> roles, String type, String subTarget) { |
Criteria criteria = createMaxAnnouncementsRolesTypeCriteria(maxAnnouncements, roles, type, subTarget); |
public List<Announcement> findAnnouncements(int startPage, int maxAnnouncements, List<String> roles, String type, String subTarget,boolean internal) { |
Criteria criteria = createMaxAnnouncementsRolesTypeCriteria(maxAnnouncements, roles, type, subTarget,internal); |
return criteria.setFirstResult(maxAnnouncements * startPage).list(); |
} |
public int countAnnouncements(int maxAnnouncements, List<String> roles, String type, String subTarget) { |
Criteria criteria = createMaxAnnouncementsRolesTypeCriteria(Integer.MAX_VALUE, roles, type, subTarget); |
public int countAnnouncements(int maxAnnouncements, List<String> roles, String type, String subTarget,boolean internal) { |
Criteria criteria = createMaxAnnouncementsRolesTypeCriteria(Integer.MAX_VALUE, roles, type, subTarget,internal); |
return criteria.list().size(); |
} |
private Criteria createMaxAnnouncementsRolesTypeCriteria(int maxAnnouncements, List<String> roles, String type, String subTarget) { |
return createMaxAnnouncementsPageRolesTypeCriteria(0, maxAnnouncements, roles, type, subTarget); |
private Criteria createMaxAnnouncementsRolesTypeCriteria(int maxAnnouncements, List<String> roles, String type, String subTarget,boolean internal) { |
return createMaxAnnouncementsPageRolesTypeCriteria(0, maxAnnouncements, roles, type, subTarget,internal); |
} |
private Criteria createMaxAnnouncementsPageRolesTypeCriteria(int page, int maxAnnouncements, List<String> roles, String type, String subTarget) { |
return createRolesTypeCriteria(roles, type, subTarget) |
private Criteria createMaxAnnouncementsPageRolesTypeCriteria(int page, int maxAnnouncements, List<String> roles, String type, String subTarget,boolean internal) { |
return createRolesTypeCriteria(roles, type, subTarget,internal) |
.setFirstResult(page * maxAnnouncements) |
.setMaxResults(maxAnnouncements); |
} |
private Criteria createRolesTypeCriteria(List<String> roles, String type, String subTarget) { |
private Criteria createRolesTypeCriteria(List<String> roles, String type, String subTarget,boolean internal) { |
if (roles == null) { |
roles = new ArrayList<String>(); |
roles.add("all"); |
114,6 → 116,10 |
} |
if (type != null) |
criteria.add(eq("type", type)); |
if(!internal) |
criteria.add(eq("internal",false)); |
MyCalendar cNow = new MyCalendar(); |
MyCalendar calendarWithOutTime = new MyCalendar(cNow.getYear(), cNow.getMonth(), cNow.getDay()); |
Date now = calendarWithOutTime.getTime(); |
147,18 → 153,18 |
AbstractDao.getCurrentSession().beginTransaction().commit(); |
}*/ |
public List<Announcement> searchAnnouncements(String query, SearchTypeEnum searchTypeEnum, int maxAnnouncements, int page, List<String> roles, String subTarget) { |
public List<Announcement> searchAnnouncements(String query, SearchTypeEnum searchTypeEnum, int maxAnnouncements, int page, List<String> roles, String subTarget,boolean internal) { |
Criterion c = createSearchQuery(query, searchTypeEnum); |
Criteria criteria = createMaxAnnouncementsPageRolesTypeCriteria(page, maxAnnouncements, roles, null, null); |
Criteria criteria = createMaxAnnouncementsPageRolesTypeCriteria(page, maxAnnouncements, roles, null, null,internal); |
criteria.add(c); |
return criteria.list(); |
} |
public int countAnnouncements(String query, SearchTypeEnum searchTypeEnum, List<String> roles, String subTarget) { |
public int countAnnouncements(String query, SearchTypeEnum searchTypeEnum, List<String> roles, String subTarget,boolean internal) { |
Criterion c = createSearchQuery(query, searchTypeEnum); |
Criteria criteria = createRolesTypeCriteria(roles, null, null); |
Criteria criteria = createRolesTypeCriteria(roles, null, null,internal); |
criteria.add(c); |
return criteria.list().size(); |
} |
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/CourseUnitDaoImpl.java |
---|
1,5 → 1,11 |
package pt.estgp.estgweb.domain.dao.impl; |
import pt.estgp.estgweb.domain.CourseUnit; |
import static org.hibernate.criterion.Restrictions.*; |
import java.util.List; |
import java.util.Set; |
/** |
* @author Jorge Machado |
* @date 28/Fev/2008 |
20,4 → 26,9 |
return (CourseUnitDaoImpl) myInstance; |
} |
public List<CourseUnit> loadBySigesCode(String sigesCode) |
{ |
return createCriteria().add(eq("code",sigesCode)).list(); |
} |
} |
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/TeacherDaoImpl.java |
---|
New file |
0,0 → 1,28 |
package pt.estgp.estgweb.domain.dao.impl; |
import pt.estgp.estgweb.domain.Teacher; |
import static org.hibernate.criterion.Restrictions.*; |
/** |
* @author Jorge Machado |
* @date 28/Fev/2008 |
* @time 2:51:06 |
* @see pt.estgp.estgweb.domain.dao.impl |
*/ |
public class TeacherDaoImpl extends TeacherDao |
{ |
private TeacherDaoImpl(){} |
public static TeacherDaoImpl getInstance() |
{ |
if (myInstance == null) |
myInstance = new TeacherDaoImpl(); |
return (TeacherDaoImpl) myInstance; |
} |
public Teacher loadBySigesCode(int sigesCode) |
{ |
return (Teacher) createCriteria().add(eq("sigesCode",sigesCode)).uniqueResult(); |
} |
} |
/impl/src/java/pt/estgp/estgweb/domain/dao/impl/StudentDaoImpl.java |
---|
New file |
0,0 → 1,29 |
package pt.estgp.estgweb.domain.dao.impl; |
import pt.estgp.estgweb.domain.Student; |
import static org.hibernate.criterion.Restrictions.*; |
/** |
* @author Jorge Machado |
* @date 28/Fev/2008 |
* @time 2:51:06 |
* @see pt.estgp.estgweb.domain.dao.impl |
*/ |
public class StudentDaoImpl extends StudentDao |
{ |
private StudentDaoImpl(){} |
public static StudentDaoImpl getInstance() |
{ |
if (myInstance == null) |
myInstance = new StudentDaoImpl(); |
return (StudentDaoImpl) myInstance; |
} |
public Student loadBySigesCode(int sigesCode) |
{ |
return (Student) createCriteria().add(eq("sigesCode",sigesCode)).uniqueResult(); |
} |
} |
/impl/src/java/pt/estgp/estgweb/domain/dao/DaoFactory.java |
---|
75,12 → 75,23 |
return BlogDaoImpl.getInstance(); |
} |
public static BlogPostDaoImpl getBlogPostDaoImpl() |
public static BlogPostDaoImpl getBlogPostDaoImpl() |
{ |
return BlogPostDaoImpl.getInstance(); |
} |
public static CourseUnitDaoImpl getCourseUnitDaoImpl() |
{ |
return CourseUnitDaoImpl.getInstance(); |
} |
public static TeacherDaoImpl getTeacherDaoImpl() |
{ |
return TeacherDaoImpl.getInstance(); |
} |
public static StudentDaoImpl getStudentDaoImpl() |
{ |
return StudentDaoImpl.getInstance(); |
} |
} |
/impl/src/java/pt/estgp/estgweb/domain/IInternal.java |
---|
New file |
0,0 → 1,11 |
package pt.estgp.estgweb.domain; |
/** |
* @author Jorge Machado |
* @date 15/Mai/2008 |
* @see pt.estgp.estgweb.domain |
*/ |
public interface IInternal |
{ |
public boolean isInternal(); |
} |
/impl/src/java/pt/estgp/estgweb/domain/DomainObjectFactory.java |
---|
92,4 → 92,14 |
{ |
return new CourseUnitImpl(); |
} |
public static TeacherImpl createTeacherImpl() |
{ |
return new TeacherImpl(); |
} |
public static StudentImpl createStudentImpl() |
{ |
return new StudentImpl(); |
} |
} |
/impl/src/java/pt/estgp/estgweb/domain/TeacherImpl.java |
---|
New file |
0,0 → 1,20 |
package pt.estgp.estgweb.domain; |
import pt.estgp.estgweb.Globals; |
/** |
* @author Jorge Machado |
* @date 28/Fev/2008 |
* @time 12:51:32 |
* @see pt.estgp.estgweb |
*/ |
public class TeacherImpl extends Teacher |
{ |
public static final String TEACHER_ROLE = Globals.TEACHER_ROLE; |
public String getManagedRole() { |
return TEACHER_ROLE; |
} |
} |
/impl/src/java/pt/estgp/estgweb/domain/DomainObject.java |
---|
14,7 → 14,7 |
* @time 10:56:46 |
* @see pt.estgp.estgweb.domain |
*/ |
public abstract class DomainObject implements IOwned, IContextTimerObject, ITargetRoles |
public abstract class DomainObject implements IOwned, IContextTimerObject, ITargetRoles, IInternal |
{ |
private static final Date MIN_DATE = new Date(0); |
private static final Date MAX_DATE = new Date(Integer.MAX_VALUE); |
120,4 → 120,9 |
roles.add(ALL_ROLE); |
return roles; |
} |
public boolean isInternal() |
{ |
return true; |
} |
} |
/impl/src/java/pt/estgp/estgweb/filters/filters/InternalObject.java |
---|
New file |
0,0 → 1,31 |
package pt.estgp.estgweb.filters.filters; |
import org.apache.log4j.Logger; |
import pt.estgp.estgweb.domain.IInternal; |
import pt.estgp.estgweb.domain.UserSession; |
import pt.estgp.estgweb.filters.chains.LoadControlFilter; |
import pt.estgp.estgweb.filters.exceptions.NeedAuthenticationException; |
import pt.estgp.estgweb.filters.filters.utils.LoadObjectFromParameters; |
import pt.estgp.estgweb.Globals; |
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; |
public class InternalObject extends LoadControlFilter |
{ |
private static final Logger logger = Logger.getLogger(InternalObject.class); |
public void execute(ServiceRequest request, ServiceResponse response, FilterParameters filterParameters) throws FilterException, Exception |
{ |
UserSession userSession = (UserSession) request.getServiceParameters().getParameter(Globals.USER_SESSION_KEY); |
IInternal iInternal = (IInternal) LoadObjectFromParameters.loadObjectFromClassName((String) filterParameters.getParameter(1),filterParameters,request.getServiceParameters()); |
if(iInternal.isInternal() && userSession.getUser() == null) |
{ |
logger.info("try access restricted area:" + request.getRequester()); |
throw new NeedAuthenticationException(); |
} |
} |
} |
/impl/src/java/pt/estgp/estgweb/web/utils/RequestUtils.java |
---|
3,6 → 3,8 |
import pt.estgp.estgweb.web.exceptions.NoCookiesException; |
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.Cookie; |
import javax.servlet.http.HttpServletResponse; |
import org.apache.struts.action.ActionMessages; |
import org.apache.struts.action.ActionMessage; |
15,11 → 17,29 |
*/ |
public class RequestUtils |
{ |
public static String getRequester(HttpServletRequest request) throws NoCookiesException |
public static String getRequester(HttpServletRequest request, HttpServletResponse response) throws NoCookiesException |
{ |
if(request.getCookies() == null || request.getCookies().length == 0) |
throw new NoCookiesException(); |
return request.getCookies()[0].getValue(); |
{ |
Cookie cookie = new Cookie("bacoSession", request.getSession().getId()); |
response.addCookie(cookie); |
return cookie.getValue(); |
} |
else if(request.getCookies() != null && request.getCookies().length > 0) |
{ |
for(Cookie cookie: request.getCookies()) |
{ |
if(cookie.getName().equals("bacoSession")) |
{ |
return cookie.getValue(); |
} |
} |
Cookie cookie = new Cookie("bacoSession", request.getSession().getId()); |
response.addCookie(cookie); |
return cookie.getValue(); |
} |
throw new NoCookiesException(); |
} |
/impl/src/java/pt/estgp/estgweb/web/LayoutController.java |
---|
37,7 → 37,7 |
private static final Logger logger = Logger.getLogger(LayoutController.class); |
public ActionForward execute(ActionMapping mapping, |
ActionForm form , |
ActionForm form, |
HttpServletRequest request, |
HttpServletResponse response) |
throws IOException, ServletException |
49,17 → 49,15 |
String server = ConfigProperties.getProperty("server." + serverParameter); |
if(serverParameter== null || server == null || server.length()==0 || path == null || layout == null) |
if (serverParameter == null || server == null || server.length() == 0 || path == null || layout == null) |
throw new FileNotFoundException("url not found for server:" + server + " and path:" + path); |
logger.info("requested path:" + path); |
logger.info("requested server:" + server); |
request.setAttribute("path",path); |
request.setAttribute("server",server); |
if(path != null) |
request.setAttribute("path", path); |
request.setAttribute("server", server); |
if (path != null) |
{ |
try |
{ |
68,32 → 66,33 |
con.connect(); |
logger.info("contentPath:" + con.getContentType()); |
// if(con.getContentType() != null && con.getContentType().toLowerCase().indexOf("html") >= 0) |
if(server.startsWith("ftp://")) |
if (server.startsWith("ftp://")) |
{ |
processRequestFtp(request, path,serverParameter,server); |
processRequestFtp(request, path, serverParameter, server); |
return mapping.findForward(layout + ".ftp"); |
} |
else if(path.endsWith("html") || path.endsWith("htm") || path.endsWith("shtml") || path.endsWith("asp") || path.endsWith("jsp") || path.endsWith("aspx") || path.endsWith("/")) |
else |
if (path.endsWith("html") || path.endsWith("htm") || path.endsWith("shtml") || path.endsWith("asp") || path.endsWith("jsp") || path.endsWith("aspx") || path.endsWith("/")) |
{ |
String encoding = ConfigProperties.getProperty(serverParameter + ".encoding"); |
request.setAttribute("encoding",encoding); |
request.setAttribute("encoding", encoding); |
return mapping.findForward(layout); |
} |
else |
{ |
ActionForward forward = new ActionForward(); |
request.setAttribute("useOutputStream","true"); |
request.setAttribute("useOutputStream", "true"); |
forward.setPath("/WebProxy"); |
return forward; |
} |
} |
catch(FileNotFoundException e) |
catch (FileNotFoundException e) |
{ |
throw e; |
} |
catch(Throwable e) |
catch (Throwable e) |
{ |
logger.error(e,e); |
logger.error(e, e); |
throw new IOException(e.toString()); |
} |
} |
104,47 → 103,51 |
} |
protected void processRequestFtp(HttpServletRequest request, String path,String serverStr,String server) |
protected void processRequestFtp(HttpServletRequest request, String path, String serverStr, String server) |
throws ServletException, IOException |
{ |
try |
{ |
String user = ConfigProperties.getProperty(serverStr + ".user"); |
String pass = ConfigProperties.getProperty(serverStr + ".pass"); |
if(path != null) |
if (path != null) |
{ |
FtpServer ftpServer = getServer(server,user,pass); |
FtpServer ftpServer = getServer(server, user, pass); |
FTPClient client = ftpServer.getClient(); |
client.changeWorkingDirectory(URIUtil.encodePath(path,"ISO-8859-1")); |
FTPFile[] files = client.listFiles(); |
client.changeWorkingDirectory(URIUtil.encodePath(path, "ISO-8859-1")); |
FTPFile[] files = client.listFiles(); |
List<IFile> iFiles = new ArrayList<IFile>(); |
for(FTPFile ftpFile : files) |
for (FTPFile ftpFile : files) |
{ |
IFile iFile = new FtpFile(ftpFile,server + path + "/" + ftpFile.getName(),path); |
IFile iFile; |
if (path.endsWith("/")) |
iFile = new FtpFile(ftpFile, server + path + ftpFile.getName(), path); |
else iFile = new FtpFile(ftpFile, server + path + "/" + ftpFile.getName(), path); |
iFiles.add(iFile); |
} |
request.setAttribute("files",iFiles); |
request.setAttribute("files", iFiles); |
client.quit(); |
client.disconnect(); |
client.quit(); |
} |
else |
{ |
throw new FileNotFoundException("url not found for server:" + server + " and path:" + path); |
} |
} |
catch(Throwable e) |
catch (Throwable e) |
{ |
logger.error(e,e); |
logger.error(e, e); |
} |
} |
private static HashMap<String,FtpServer> servers = new HashMap<String,FtpServer>(); |
private static HashMap<String, FtpServer> servers = new HashMap<String, FtpServer>(); |
/** |
* Add a ftpServer to Cache |
* |
* @param urlStr to parse |
* @param user username |
* @param pass password |
* @param user username |
* @param pass password |
* @return ftpServer |
*/ |
private static synchronized FtpServer addServer(String urlStr, String user, String pass) |
154,20 → 157,20 |
URL url = new URL(urlStr); |
String host = url.getHost(); |
int port = url.getPort(); |
if(port <= 0) |
if (port <= 0) |
port = 21; |
logger.info("Connecting to " + host + "in port:" + port); |
FtpServer ftpServer = new FtpServer(host,port,user,pass); |
servers.put(urlStr,ftpServer); |
FtpServer ftpServer = new FtpServer(host, port, user, pass); |
servers.put(urlStr, ftpServer); |
return ftpServer; |
} |
catch (MalformedURLException e) |
{ |
logger.error(e,e); |
logger.error(e, e); |
} |
catch (IOException e) |
{ |
logger.error(e,e); |
logger.error(e, e); |
} |
return null; |
} |
175,8 → 178,8 |
private static FtpServer getServer(String urlStr, String user, String pass) |
{ |
FtpServer ftpServer = servers.get(urlStr); |
if(ftpServer == null) |
ftpServer = addServer(urlStr,user,pass); |
if (ftpServer == null) |
ftpServer = addServer(urlStr, user, pass); |
return ftpServer; |
} |
191,7 → 194,7 |
public FtpServer(String host, int port) |
{ |
this.host = host; |
if(port > 0) |
if (port > 0) |
this.port = port; |
} |
206,43 → 209,51 |
public FTPClient getClient() throws IOException |
{ |
FTPClient ftp = new FTPClient(); |
ftp.connect(host,port); |
if(username != null) |
ftp.connect(host, port); |
if (username != null) |
ftp.user(username); |
if(password != null) |
if (password != null) |
ftp.pass(password); |
return ftp; |
} |
public String getHost() { |
public String getHost() |
{ |
return host; |
} |
public void setHost(String host) { |
public void setHost(String host) |
{ |
this.host = host; |
} |
public int getPort() { |
public int getPort() |
{ |
return port; |
} |
public void setPort(int port) { |
public void setPort(int port) |
{ |
this.port = port; |
} |
public String getUsername() { |
public String getUsername() |
{ |
return username; |
} |
public void setUsername(String username) { |
public void setUsername(String username) |
{ |
this.username = username; |
} |
public String getPassword() { |
public String getPassword() |
{ |
return password; |
} |
public void setPassword(String password) { |
public void setPassword(String password) |
{ |
this.password = password; |
} |
} |
/impl/src/java/pt/estgp/estgweb/web/form/profile/ProfileForm.java |
---|
3,6 → 3,8 |
import pt.estgp.estgweb.domain.User; |
import pt.estgp.estgweb.domain.views.UserView; |
import pt.estgp.estgweb.web.form.ApplicationForm; |
import pt.estgp.estgweb.web.form.AddRolesForm; |
import pt.estgp.estgweb.web.utils.DatesUtils; |
import java.util.List; |
12,11 → 14,13 |
* @time 17:18:57 |
* @see pt.estgp.estgweb.web.form.profile |
*/ |
public class ProfileForm extends ApplicationForm |
{ |
public class ProfileForm extends AddRolesForm { |
private UserView userView; |
private String textToSearch; |
private static List<UserView> usersFind; |
private long userIDToChange; |
private String birthDayDate; |
public ProfileForm() |
{ |
54,5 → 58,32 |
public void setUsersFind(List<UserView> usersFind) { |
ProfileForm.usersFind = usersFind; |
} |
public long getUserIDToChange() { |
return userIDToChange; |
} |
public void setUserIDToChange(long userIDToChange) { |
this.userIDToChange = userIDToChange; |
} |
public String getBirthDayDate() { |
if(userView.getBirthDate()!=null) |
{ |
this.birthDayDate= DatesUtils.getStringFromDate(userView.getBirthDate()); |
return birthDayDate; |
} |
else |
{ |
this.birthDayDate=""; |
return birthDayDate; |
} |
} |
public void setBirthDayDate(String birthDayDate) { |
this.birthDayDate=birthDayDate; |
this.userView.setBirthDate(DatesUtils.getDateFromString(birthDayDate)); |
} |
} |
/impl/src/java/pt/estgp/estgweb/web/UserSessionProxy.java |
---|
1,24 → 1,14 |
package pt.estgp.estgweb.web; |
import pt.estgp.estgweb.domain.UserSession; |
import pt.estgp.estgweb.services.authenticate.AuthenticateException; |
import pt.estgp.estgweb.web.utils.RequestUtils; |
import pt.estgp.estgweb.web.exceptions.NoCookiesException; |
import pt.estgp.estgweb.filters.filters.Session; |
import pt.estgp.estgweb.Globals; |
import pt.utl.ist.berserk.logic.serviceManager.IServiceManager; |
import pt.utl.ist.berserk.logic.serviceManager.ServiceManager; |
import pt.utl.ist.berserk.logic.serviceManager.exceptions.ServiceManagerException; |
import pt.utl.ist.berserk.logic.serviceManager.exceptions.InvalidServiceException; |
import pt.utl.ist.berserk.logic.filterManager.exceptions.*; |
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.HttpServletResponse; |
import org.apache.struts.action.ActionMessages; |
import org.apache.struts.action.ActionMessage; |
import java.util.Date; |
/** |
* @author Jorge Machado |
* @date 29/Fev/2008 |
57,14 → 47,14 |
// return userSession; |
// } |
public static UserSession loadUserSession(HttpServletRequest request) throws Throwable |
public static UserSession loadUserSession(HttpServletRequest request, HttpServletResponse response) throws Throwable |
{ |
try |
{ |
IServiceManager sm = ServiceManager.getInstance(); |
Object[] args = new Object[]{RequestUtils.getRequester(request)}; |
UserSession userSession = (UserSession) sm.execute(RequestUtils.getRequester(request),"LoadUserSession",args); |
Object[] args = new Object[]{RequestUtils.getRequester(request, response)}; |
UserSession userSession = (UserSession) sm.execute(RequestUtils.getRequester(request, response),"LoadUserSession",args); |
request.setAttribute(Globals.USER_SESSION_KEY,userSession); |
return userSession; |
} |
/impl/src/java/pt/estgp/estgweb/web/controllers/profile/ProfileController.java |
---|
1,18 → 1,14 |
package pt.estgp.estgweb.web.controllers.profile; |
import pt.estgp.estgweb.web.controllers.ApplicationDispatchController; |
import pt.estgp.estgweb.web.controllers.authenticate.AuthenticateController; |
import java.io.Serializable; |
import pt.estgp.estgweb.web.controllers.AddRolesController; |
import pt.estgp.estgweb.web.utils.RequestUtils; |
import pt.estgp.estgweb.web.exceptions.NoCookiesException; |
import pt.estgp.estgweb.web.UserSessionProxy; |
import pt.estgp.estgweb.web.form.profile.ProfileForm; |
import pt.estgp.estgweb.domain.UserSession; |
import pt.estgp.estgweb.domain.UserImpl; |
import pt.estgp.estgweb.domain.User; |
import pt.estgp.estgweb.domain.UserSessionImpl; |
import pt.estgp.estgweb.domain.views.UserView; |
import pt.estgp.estgweb.Globals; |
import pt.estgp.estgweb.services.authenticate.AuthenticateException; |
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; |
22,8 → 18,9 |
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.HttpServletResponse; |
import javax.servlet.ServletException; |
import java.io.IOException; |
import java.util.List; |
import java.util.ArrayList; |
import pt.estgp.estgweb.web.form.AddRolesForm; |
/** |
* @author Jorge Machado |
31,9 → 28,11 |
* @time 18:01:54 |
* @see pt.estgp.estgweb.web |
*/ |
public class ProfileController extends ApplicationDispatchController { |
public class ProfileController extends AddRolesController { |
private static final Logger logger = Logger.getLogger(ProfileController.class); |
private static final String TARGET_ROLES_KEY = AddRolesForm.TARGET_ROLES_KEY; |
public ActionForward editUser(ActionMapping mapping, |
ActionForm form , |
46,14 → 45,17 |
UserView userView= profileForm.getUserView(); |
try |
{ |
UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request); |
UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request,response); |
userView.setUserRoles((List<String>) userSession.get(TARGET_ROLES_KEY)); |
IServiceManager sm = ServiceManager.getInstance(); |
String[] names = new String[]{"object"}; |
Object[] args = new Object[]{userView}; |
User user = (User) sm.execute(RequestUtils.getRequester(request),"EditUser",args,names); |
userSession.setUser(user); |
request.setAttribute(Globals.USER_SESSION_KEY,userSession); |
logger.info("Puting new user info in session:" + user.getId()); |
User user = (User) sm.execute(RequestUtils.getRequester(request, response),"EditUser",args,names); |
if(userSession.getUser().getId()==user.getId()){ |
userSession.setUser(user); |
request.setAttribute(Globals.USER_SESSION_KEY,userSession); |
logger.info("Puting new user info in session:" + user.getId()); |
} |
addMessage(request,"profile.edited.sucess"); |
return mapping.findForward("success"); |
} |
75,14 → 77,25 |
throws Throwable, ServletException { |
try |
{ |
UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request); |
ProfileForm profileForm = new ProfileForm(); |
ProfileForm pF = (ProfileForm) form; |
UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request,response); |
String id = request.getParameter("id"); |
long userToLoad; |
if(id!=null) |
userToLoad=Long.valueOf(id); |
else |
userToLoad=userSession.getUser().getId(); |
IServiceManager sm = ServiceManager.getInstance(); |
String[] names = new String[]{"serializable"}; |
Object[] args = new Object[]{userSession.getUser().getId()}; |
UserView uV = (UserView) sm.execute(RequestUtils.getRequester(request),"LoadUserById",args,names); |
profileForm.setUserView(uV); |
request.setAttribute("ProfileForm",profileForm); |
Object[] args = new Object[]{userToLoad}; |
UserView uV = (UserView) sm.execute(RequestUtils.getRequester(request, response),"LoadUserById",args,names); |
pF.setUserView(uV); |
pF.setSelectedRoles(uV.getUserRoles()); |
userSession.put(TARGET_ROLES_KEY, (Serializable) uV.getUserRoles()); |
userSession.serialize(request,response); |
return mapping.findForward("load"); |
} |
catch(FilterChainFailedException e) |
103,13 → 116,14 |
throws Throwable, ServletException { |
try |
{ |
ProfileForm profileForm = (ProfileForm) form; |
ProfileForm fromRequest=(ProfileForm) form; |
ProfileForm profileForm = new ProfileForm(); |
IServiceManager sm = ServiceManager.getInstance(); |
String[] names = new String[]{"serializable"}; |
Object[] args = new Object[]{profileForm.getTextToSearch()}; |
List<UserView> uVs = (List<UserView>) sm.execute(RequestUtils.getRequester(request),"SearchUser",args,names); |
Object[] args = new Object[]{fromRequest.getTextToSearch()}; |
List<UserView> uVs = (List<UserView>) sm.execute(RequestUtils.getRequester(request, response),"SearchUser",args,names); |
profileForm.setUsersFind(uVs); |
request.setAttribute("ProfileForm",profileForm); |
request.setAttribute("ProfileForm",profileForm); |
return mapping.findForward("search"); |
} |
catch(FilterChainFailedException e) |
/impl/src/java/pt/estgp/estgweb/web/controllers/AddRolesController.java |
---|
39,9 → 39,9 |
{ |
try |
{ |
UserSessionImpl sess = (UserSessionImpl) UserSessionProxy.loadUserSession(request); |
UserSessionImpl sess = (UserSessionImpl) UserSessionProxy.loadUserSession(request,response); |
sess.remove(TARGET_ROLES_KEY); |
sess.serialize(request); |
sess.serialize(request,response); |
return mapping.findForward("submit"); |
} |
catch(FilterChainFailedException e) |
64,7 → 64,7 |
try |
{ |
AddRolesForm addRolesForm = (AddRolesForm) form; |
UserSessionImpl sess = (UserSessionImpl) UserSessionProxy.loadUserSession(request); |
UserSessionImpl sess = (UserSessionImpl) UserSessionProxy.loadUserSession(request,response); |
List<String> l = (List<String>) sess.get(TARGET_ROLES_KEY); |
if(l == null) |
l = new ArrayList<String>(); |
73,7 → 73,7 |
{ |
l.add(addRolesForm.getTargetRolesStr()); |
sess.put(TARGET_ROLES_KEY, (Serializable) l); |
sess.serialize(request); |
sess.serialize(request,response); |
} |
else |
{ |
119,7 → 119,7 |
addRolessForm.setTargetRoles(roles); |
addRolessForm.setSelectedRoles(roles); |
sess.put(TARGET_ROLES_KEY, (Serializable) roles); |
sess.serialize(request); |
sess.serialize(request,response); |
return mapping.getInputForward(); |
} |
/impl/src/java/pt/estgp/estgweb/web/controllers/blogs/BlogsController.java |
---|
62,7 → 62,7 |
} |
String[] names = new String[]{"object"}; |
Object[] args = new Object[]{blog}; |
BlogView bV = (BlogView) sm.execute(RequestUtils.getRequester(request), "CreateBlog", args, names); |
BlogView bV = (BlogView) sm.execute(RequestUtils.getRequester(request, response), "CreateBlog", args, names); |
addMessage(request, "blog.created.success", "" + bV.getId()); |
request.setAttribute("BlogView", bV); |
return mapping.findForward("success"); |
71,7 → 71,7 |
IServiceManager sm = ServiceManager.getInstance(); |
String[] names = new String[]{"object"}; |
Object[] args = new Object[]{bV}; |
bV = (BlogView) sm.execute(RequestUtils.getRequester(request), "EditBlog", args, names); |
bV = (BlogView) sm.execute(RequestUtils.getRequester(request, response), "EditBlog", args, names); |
addMessage(request, "blog.edited.success", "" + bV.getId()); |
return mapping.findForward("success"); |
} |
95,7 → 95,7 |
IServiceManager sm = ServiceManager.getInstance(); |
String[] names = new String[]{"serializable"}; |
Object[] args = new Object[]{Long.parseLong(request.getParameter("id"))}; |
BlogView bV = (BlogView) sm.execute(RequestUtils.getRequester(request), "LoadBlog", args, names); |
BlogView bV = (BlogView) sm.execute(RequestUtils.getRequester(request, response), "LoadBlog", args, names); |
request.setAttribute("BlogView", bV); |
return mapping.findForward("success"); |
} |
/impl/src/java/pt/estgp/estgweb/web/controllers/TesteController.java |
---|
2,18 → 2,10 |
import org.apache.log4j.Logger; |
import org.apache.struts.action.*; |
import pt.estgp.estgweb.web.controllers.authenticate.AuthenticateController; |
import pt.estgp.estgweb.web.utils.RequestUtils; |
import pt.estgp.estgweb.web.UserSessionProxy; |
import pt.estgp.estgweb.web.form.TesteForm; |
import pt.estgp.estgweb.web.exceptions.NoCookiesException; |
import pt.estgp.estgweb.services.authenticate.AuthenticateException; |
import pt.estgp.estgweb.domain.UserSession; |
import pt.estgp.estgweb.Globals; |
import pt.utl.ist.berserk.logic.serviceManager.IServiceManager; |
import pt.utl.ist.berserk.logic.serviceManager.ServiceManager; |
import pt.utl.ist.berserk.logic.serviceManager.exceptions.ServiceManagerException; |
import pt.utl.ist.berserk.logic.filterManager.exceptions.*; |
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.HttpServletResponse; |
52,7 → 44,7 |
} |
try |
{ |
sm.execute(RequestUtils.getRequester(request), "TesteSaver", args2); |
sm.execute(RequestUtils.getRequester(request, response), "TesteSaver", args2); |
} |
catch (Throwable e) |
{ |
/impl/src/java/pt/estgp/estgweb/web/controllers/commons/CommonsController.java |
---|
48,7 → 48,7 |
{ |
try |
{ |
ICommonSearchResults commonSearchResults = CommonServicesManager.getInstance().search(request,request.getParameter("query"), SearchTypeEnum.parse(request.getParameter("searchType"))); |
ICommonSearchResults commonSearchResults = CommonServicesManager.getInstance().search(request,response,request.getParameter("query"), SearchTypeEnum.parse(request.getParameter("searchType"))); |
// if(commonSearchResults.getTotalResults() == 0) |
// return mapping.findForward("noresults"); |
request.setAttribute("ICommonSearchResults",commonSearchResults); |
72,7 → 72,7 |
throws Throwable, ServletException { |
try |
{ |
ISearchResults searchResults = CommonServicesManager.getInstance().search(request,request.getParameter("query"), SearchTypeEnum.parse(request.getParameter("searchType")),request.getParameter("module"),Integer.parseInt(request.getParameter("page"))); |
ISearchResults searchResults = CommonServicesManager.getInstance().search(request,response,request.getParameter("query"), SearchTypeEnum.parse(request.getParameter("searchType")),request.getParameter("module"),Integer.parseInt(request.getParameter("page"))); |
request.setAttribute("ISearchResults",searchResults); |
return mapping.findForward("searchModule"); |
} |
/impl/src/java/pt/estgp/estgweb/web/controllers/announcements/AnnouncementsController.java |
---|
10,10 → 10,8 |
import pt.estgp.estgweb.web.utils.RequestUtils; |
import pt.estgp.estgweb.web.utils.DatesUtils; |
import pt.estgp.estgweb.domain.UserSessionImpl; |
import pt.estgp.estgweb.domain.Announcement; |
import pt.estgp.estgweb.domain.DomainObjectFactory; |
import pt.estgp.estgweb.domain.Image; |
import pt.estgp.estgweb.domain.dao.DaoFactory; |
import pt.estgp.estgweb.domain.views.AnnouncementView; |
import pt.utl.ist.berserk.logic.serviceManager.IServiceManager; |
import pt.utl.ist.berserk.logic.serviceManager.ServiceManager; |
28,32 → 26,34 |
/** |
* @author Jorge Machado |
* @author Fabio Velez |
* @date 26/Fev/2008 |
* @time 18:01:54 |
* @see pt.estgp.estgweb.web |
*/ |
public class AnnouncementsController extends AddRolesController { |
public class AnnouncementsController extends AddRolesController |
{ |
private static final Logger logger = Logger.getLogger(AnnouncementsController.class); |
private static final String TARGET_ROLES_KEY = AddRolesForm.TARGET_ROLES_KEY; |
public ActionForward save(ActionMapping mapping, |
ActionForm form , |
ActionForm form, |
HttpServletRequest request, |
HttpServletResponse response) |
throws Throwable, ServletException |
{ |
try |
{ |
Image i2=null; |
Image i=null; |
Image i2 = null; |
Image i = null; |
AnnouncementsForm announcementForm = (AnnouncementsForm) form; |
AnnouncementView view = announcementForm.getAnnouncementView(); |
String finalUrl=""; |
if(!announcementForm.getUrl().equals("")) |
String finalUrl = ""; |
if (!announcementForm.getUrl().equals("")) |
{ |
finalUrl=announcementForm.getUrlProtocol()+announcementForm.getUrl(); |
finalUrl = announcementForm.getUrlProtocol() + announcementForm.getUrl(); |
view.setUrl(finalUrl); |
} |
else |
61,16 → 61,16 |
view.setUrl(null); |
} |
if(announcementForm.getBigImage().getFileSize()!= 0) |
if (announcementForm.getBigImage().getFileSize() != 0) |
{ |
FormFile bigImage = announcementForm.getBigImage(); |
InputStream stream = bigImage.getInputStream(); |
ByteArrayOutputStream b = new ByteArrayOutputStream(); |
int readedBytes; |
byte[] buf = new byte[1024]; |
while((readedBytes = stream.read(buf)) > 0) |
while ((readedBytes = stream.read(buf)) > 0) |
{ |
b.write(buf,0,readedBytes); |
b.write(buf, 0, readedBytes); |
} |
b.close(); |
i = DomainObjectFactory.createImageImpl(); |
83,16 → 83,16 |
} |
if(announcementForm.getSmallImage().getFileSize()!= 0) |
if (announcementForm.getSmallImage().getFileSize() != 0) |
{ |
FormFile smallImage = announcementForm.getSmallImage(); |
InputStream stream2 = smallImage.getInputStream(); |
ByteArrayOutputStream b2 = new ByteArrayOutputStream(); |
int readedBytes2; |
byte[] buf2 = new byte[1024]; |
while((readedBytes2 = stream2.read(buf2)) > 0) |
while ((readedBytes2 = stream2.read(buf2)) > 0) |
{ |
b2.write(buf2,0,readedBytes2); |
b2.write(buf2, 0, readedBytes2); |
} |
b2.close(); |
i2 = DomainObjectFactory.createImageImpl(); |
106,44 → 106,85 |
IServiceManager sm = ServiceManager.getInstance(); |
String[] names = new String[]{"object"}; |
Object[] args = new Object[]{view,i, i2}; |
AnnouncementView aV = (AnnouncementView) sm.execute(RequestUtils.getRequester(request),"CreateAnnouncement",args,names); |
addMessage(request,"announcement.edited.success","" + aV.getId()); |
Object[] args = new Object[]{view, i, i2}; |
boolean newAnnouncement = true; |
if (view.getId() > 0) |
newAnnouncement = false; |
AnnouncementView aV = (AnnouncementView) sm.execute(RequestUtils.getRequester(request, response), "CreateAnnouncement", args, names); |
if (newAnnouncement) |
addMessage(request, "announcement.created.success", request.getContextPath(), "" + aV.getId(), view.getTitle()); |
else |
addMessage(request, "announcement.edited.success", request.getContextPath(), "" + aV.getId(), view.getTitle()); |
return mapping.findForward("success"); |
} |
catch(FilterChainFailedException e) |
catch (FilterChainFailedException e) |
{ |
return mapping.findForward("error401"); |
} |
catch (Throwable e) |
{ |
logger.error(e,e); |
logger.error(e, e); |
throw e; |
} |
} |
public ActionForward edit(ActionMapping mapping, |
ActionForm form , |
ActionForm form, |
HttpServletRequest request, |
HttpServletResponse response) |
throws Throwable, ServletException |
{ |
try |
{ |
UserSessionImpl sess = (UserSessionImpl) UserSessionProxy.loadUserSession(request); |
UserSessionImpl sess = (UserSessionImpl) UserSessionProxy.loadUserSession(request,response); |
IServiceManager sm = ServiceManager.getInstance(); |
String[] names = new String[]{"serializable"}; |
Object[] args = new Object[]{new Long(request.getParameter("id"))}; |
AnnouncementView aV = (AnnouncementView) sm.execute(RequestUtils.getRequester(request),"LoadEditAnnouncement",args,names); |
AnnouncementView aV = (AnnouncementView) sm.execute(RequestUtils.getRequester(request, response), "LoadEditAnnouncement", args, names); |
AnnouncementsForm announcementsForm = (AnnouncementsForm) form; |
announcementsForm.setAnnouncementView(aV); |
announcementsForm.setStartDate(DatesUtils.getStringFromDate(aV.getStartDate())); |
announcementsForm.setExpireDate(DatesUtils.getStringFromDate(aV.getExpireDate())); |
announcementsForm.setSelectedRoles(aV.getTargetRoles()); |
sess.put(TARGET_ROLES_KEY, (Serializable) aV.getTargetRoles()); |
sess.serialize(request); |
sess.serialize(request,response); |
return mapping.getInputForward(); |
} |
catch (FilterChainFailedException e) |
{ |
return mapping.findForward("error401"); |
} |
catch (Throwable e) |
{ |
logger.error(e, e); |
throw e; |
} |
} |
public ActionForward delete(ActionMapping mapping, |
ActionForm form , |
HttpServletRequest request, |
HttpServletResponse response) |
throws Throwable, ServletException |
{ |
try |
{ |
IServiceManager sm = ServiceManager.getInstance(); |
String[] names = new String[]{"serializable"}; |
Object[] args = new Object[]{new Long(request.getParameter("id"))}; |
Boolean status= (Boolean) sm.execute(RequestUtils.getRequester(request, response),"DeleteAnnouncement",args,names); |
if(status) |
{ |
addMessage(request,"announcement.deleted.success","" + request.getParameter("id")); |
return mapping.findForward("success"); |
} |
else |
{ |
addMessage(request,"announcement.deleted.fail","" + request.getParameter("id")); |
return mapping.findForward("success"); |
} |
} |
catch(FilterChainFailedException e) |
{ |
return mapping.findForward("error401"); |
157,7 → 198,7 |
} |
public ActionForward list(ActionMapping mapping, |
ActionForm form , |
ActionForm form, |
HttpServletRequest request, |
HttpServletResponse response) |
throws Throwable, ServletException |
167,23 → 208,23 |
IServiceManager sm = ServiceManager.getInstance(); |
String[] names = new String[]{}; |
Object[] args = new Object[]{}; |
List<AnnouncementView> announcementViews = (List<AnnouncementView>) sm.execute(RequestUtils.getRequester(request),"LoadTargetMaxAnnouncements",args,names); |
request.setAttribute("Announcements",announcementViews); |
List<AnnouncementView> announcementViews = (List<AnnouncementView>) sm.execute(RequestUtils.getRequester(request, response), "LoadTargetMaxAnnouncements", args, names); |
request.setAttribute("Announcements", announcementViews); |
return mapping.findForward("success"); |
} |
catch(FilterChainFailedException e) |
catch (FilterChainFailedException e) |
{ |
return mapping.findForward("error401"); |
} |
catch (Throwable e) |
{ |
logger.error(e,e); |
logger.error(e, e); |
throw e; |
} |
} |
public ActionForward load(ActionMapping mapping, |
ActionForm form , |
ActionForm form, |
HttpServletRequest request, |
HttpServletResponse response) |
throws Throwable, ServletException |
194,17 → 235,17 |
IServiceManager sm = ServiceManager.getInstance(); |
String[] names = new String[]{"serializable"}; |
Object[] args = new Object[]{new Long(id)}; |
AnnouncementView announcementView = (AnnouncementView) sm.execute(RequestUtils.getRequester(request),"LoadAnnouncementView",args,names); |
request.setAttribute("Announcement",announcementView); |
AnnouncementView announcementView = (AnnouncementView) sm.execute(RequestUtils.getRequester(request, response), "LoadAnnouncementView", args, names); |
request.setAttribute("Announcement", announcementView); |
return mapping.findForward("load"); |
} |
catch(FilterChainFailedException e) |
catch (FilterChainFailedException e) |
{ |
return mapping.findForward("error401"); |
} |
catch (Throwable e) |
{ |
logger.error(e,e); |
logger.error(e, e); |
throw e; |
} |
} |
/impl/src/java/pt/estgp/estgweb/web/controllers/authenticate/AuthenticateController.java |
---|
2,34 → 2,23 |
import org.apache.struts.action.*; |
import org.apache.log4j.Logger; |
import pt.estgp.estgweb.web.controllers.announcements.AnnouncementsController; |
import pt.estgp.estgweb.web.controllers.ApplicationController; |
import pt.estgp.estgweb.web.controllers.ApplicationDispatchController; |
import pt.estgp.estgweb.web.utils.RequestUtils; |
import pt.estgp.estgweb.web.exceptions.NoCookiesException; |
import pt.estgp.estgweb.web.UserSessionProxy; |
import pt.estgp.estgweb.web.form.EmptyForm; |
import pt.estgp.estgweb.web.form.profile.ProfileForm; |
import pt.estgp.estgweb.utils.ConfigProperties; |
import pt.estgp.estgweb.services.authenticate.AuthenticateException; |
import pt.estgp.estgweb.Globals; |
import pt.estgp.estgweb.domain.UserSession; |
import pt.estgp.estgweb.domain.User; |
import pt.estgp.estgweb.domain.UserImpl; |
import pt.estgp.estgweb.domain.UserSessionImpl; |
import pt.estgp.estgweb.domain.views.UserView; |
import pt.utl.ist.berserk.logic.serviceManager.IServiceManager; |
import pt.utl.ist.berserk.logic.serviceManager.ServiceManager; |
import pt.utl.ist.berserk.logic.serviceManager.exceptions.ServiceManagerException; |
import pt.utl.ist.berserk.logic.filterManager.exceptions.*; |
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.HttpServletResponse; |
import javax.servlet.ServletException; |
import java.io.IOException; |
import java.io.FileNotFoundException; |
import java.net.URL; |
import java.net.URLConnection; |
/** |
* @author Jorge Machado |
56,7 → 45,7 |
{ |
IServiceManager sm = ServiceManager.getInstance(); |
Object[] args = new Object[]{username,password}; |
UserSession userSession = (UserSession) sm.execute(RequestUtils.getRequester(request),"Authenticate",args); |
UserSession userSession = (UserSession) sm.execute(RequestUtils.getRequester(request, response),"Authenticate",args); |
request.setAttribute(Globals.USER_SESSION_KEY,userSession); |
if(!((UserImpl)userSession.getUser()).isNewUser()) |
return mapping.findForward("success"); |
66,7 → 55,7 |
IServiceManager sm2 = ServiceManager.getInstance(); |
String[] names = new String[]{"serializable"}; |
Object[] args2 = new Object[]{userSession.getUser().getId()}; |
UserView uV = (UserView) sm2.execute(RequestUtils.getRequester(request),"LoadUserById",args2,names); |
UserView uV = (UserView) sm2.execute(RequestUtils.getRequester(request, response),"LoadUserById",args2,names); |
profileForm.setUserView(uV); |
request.setAttribute("ProfileForm",profileForm); |
addMessage(request,"profile.enter.first.time",uV.getName()); |
112,7 → 101,7 |
else |
request.setAttribute("name",userSession.getUser().getUsername()); |
userSession = (UserSession) sm.execute(RequestUtils.getRequester(request),"Logout",args); |
userSession = (UserSession) sm.execute(RequestUtils.getRequester(request, response),"Logout",args); |
request.setAttribute(Globals.USER_SESSION_KEY,userSession); |
return mapping.findForward("logout"); |
} |
/impl/src/java/pt/estgp/estgweb/web/controllers/urlstat/UrlStatController.java |
---|
39,7 → 39,7 |
UrlStatForm urlStatForm = (UrlStatForm) form; |
IServiceManager sm = ServiceManager.getInstance(); |
Object[] args = new Object[]{request, urlStatForm.getRelativePathsStrs(), ChartTypeEnum.parse(urlStatForm.getChartType())}; |
String tmpLocation = (String) sm.execute(RequestUtils.getRequester(request),"BuildChartGetPath",args); |
String tmpLocation = (String) sm.execute(RequestUtils.getRequester(request, response),"BuildChartGetPath",args); |
request.getRequestDispatcher("/tmpStream" + tmpLocation).forward(request,response); |
return null; |
} |
/impl/src/java/pt/estgp/estgweb/web/filters/UrlStatFilter.java |
---|
8,12 → 8,9 |
import java.io.IOException; |
import java.util.HashMap; |
import java.util.Date; |
import java.util.Calendar; |
import java.util.List; |
import pt.estgp.estgweb.domain.UserSessionImpl; |
import pt.estgp.estgweb.domain.UserImpl; |
import pt.estgp.estgweb.domain.UserSession; |
import pt.estgp.estgweb.Globals; |
import pt.estgp.estgweb.utils.ConfigProperties; |
import pt.estgp.estgweb.web.utils.RequestUtils; |
25,8 → 22,7 |
import jomm.utils.MyCalendar; |
/** |
* |
* @author Jorge Machado |
* @author Jorge Machado |
*/ |
public class UrlStatFilter implements Filter |
34,20 → 30,19 |
private static Logger logger = Logger.getLogger(UrlStatFilter.class); |
public static List<String> ignoreEstensions = ConfigProperties.getListValues("url.stat.ignore.extension"); |
public static List<String> ignorePrefixs = ConfigProperties.getListValues("url.stat.ignore.prefix"); |
public static MyCalendar myCalendar = new MyCalendar(); |
public static int day = myCalendar.getDay(); |
public static int month = myCalendar.getMonth(); |
public static int year = myCalendar.getYear(); |
public static final int MAX_MAP_SYZE = 4; |
public static final List<String> URL_STAT_IGNORE_EXTENSIONS = Globals.URL_STAT_IGNORE_EXTENSIONS; |
public static final List<String> URL_STAT_IGNORE_PREFIXS = Globals.URL_STAT_IGNORE_PREFIXS; |
public static final int URL_STAT_CACHE_SIZE = Globals.URL_STAT_CACHE_SIZE; |
public static final long URL_STAT_CACHE_TIMEOUT = Globals.URL_STAT_CACHE_TIMEOUT; |
public static final long SAVE_INTERVAL = 30 * 60 * 1000; |
public static long lastUpdate = new Date().getTime(); |
public static HashMap<String, IntegerContainer> urlStat = new HashMap<String,IntegerContainer>(); |
public static HashMap<String, IntegerContainer> urlStat = new HashMap<String, IntegerContainer>(); |
public UrlStatFilter() |
{ |
59,31 → 54,30 |
} |
/** |
* |
* @param request The servlet request we are processing |
* @param chain The filter chain we are processing |
* |
* @exception java.io.IOException if an input/output error occurs |
* @exception javax.servlet.ServletException if a servlet error occurs |
* @param chain The filter chain we are processing |
* @throws java.io.IOException if an input/output error occurs |
* @throws javax.servlet.ServletException if a servlet error occurs |
*/ |
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) |
throws IOException, ServletException |
{ |
HttpServletRequest hrequest = (HttpServletRequest) request; |
HttpServletResponse hresponse = (HttpServletResponse) response; |
UserSessionImpl userSession = (UserSessionImpl) request.getAttribute(Globals.USER_SESSION_KEY); |
MyCalendar c = new MyCalendar(); |
int nowDay = c.getDay(); |
if(nowDay != day || (c.getTimeInMillis() - lastUpdate > SAVE_INTERVAL)) |
if (nowDay != day || (c.getTimeInMillis() - lastUpdate > URL_STAT_CACHE_TIMEOUT)) |
{ |
try |
{ |
updateStats(hrequest, c.getTimeInMillis()); |
updateStats(hrequest, hresponse, c.getTimeInMillis()); |
} |
catch (Throwable e) |
{ |
logger.error(e,e); |
((HttpServletResponse)response).sendError(500); |
logger.error(e, e); |
((HttpServletResponse) response).sendError(500); |
} |
} |
92,92 → 86,92 |
year = c.getYear(); |
String relativePath = hrequest.getServletPath(); |
if(relativePath == null) |
if (relativePath == null) |
relativePath = ""; |
if(hrequest.getPathInfo() != null && hrequest.getPathInfo().length() > 0) |
if (hrequest.getPathInfo() != null && hrequest.getPathInfo().length() > 0) |
{ |
relativePath += hrequest.getPathInfo(); |
} |
for(String ignore: ignoreEstensions) |
for (String ignore : URL_STAT_IGNORE_EXTENSIONS) |
{ |
if(relativePath.endsWith(ignore)) |
if (relativePath.endsWith(ignore)) |
{ |
chain.doFilter(request,response); |
chain.doFilter(request, response); |
return; |
} |
} |
if(hrequest.getQueryString() != null && hrequest.getQueryString().length() > 0) |
if (hrequest.getQueryString() != null && hrequest.getQueryString().length() > 0) |
relativePath += "?" + hrequest.getQueryString(); |
for(String ignore: ignorePrefixs) |
for (String ignore : URL_STAT_IGNORE_PREFIXS) |
{ |
if(relativePath.startsWith(ignore)) |
if (relativePath.startsWith(ignore)) |
{ |
chain.doFilter(request,response); |
chain.doFilter(request, response); |
return; |
} |
} |
if(userSession != null) |
if (userSession != null) |
{ |
if(userSession.get(relativePath) != null) |
if (userSession.get(relativePath) != null) |
{ |
chain.doFilter(request,response); |
chain.doFilter(request, response); |
return; |
} |
userSession.put(relativePath,""); |
userSession.put(relativePath, ""); |
try |
{ |
userSession.serialize(hrequest); |
userSession.serialize(hrequest, (HttpServletResponse) response); |
} |
catch (Throwable e) |
{ |
logger.error(e,e); |
((HttpServletResponse)response).sendError(500); |
logger.error(e, e); |
((HttpServletResponse) response).sendError(500); |
return; |
} |
} |
logger.info("accessing " + relativePath); |
IntegerContainer count = urlStat.get(relativePath); |
if(count == null) |
if (count == null) |
{ |
try |
{ |
createUrl(hrequest,c.getTimeInMillis(),relativePath); |
createUrl(hrequest, ((HttpServletResponse) response), c.getTimeInMillis(), relativePath); |
} |
catch (Throwable e) |
{ |
logger.error(e,e); |
((HttpServletResponse)response).sendError(500); |
logger.error(e, e); |
((HttpServletResponse) response).sendError(500); |
} |
} |
else |
{ |
count.inc(); |
} |
chain.doFilter(request,response); |
chain.doFilter(request, response); |
} |
public static synchronized void updateStats(HttpServletRequest request, long nowMiliseconds) throws Throwable, InvalidFilterException, ServiceManagerException, InvalidFilterExpressionException, IncompatibleFilterException, FilterRetrieveException, NoCookiesException |
public static synchronized void updateStats(HttpServletRequest request, HttpServletResponse response, long nowMiliseconds) throws Throwable, InvalidFilterException, ServiceManagerException, InvalidFilterExpressionException, IncompatibleFilterException, FilterRetrieveException, NoCookiesException |
{ |
lastUpdate = nowMiliseconds; |
IServiceManager sm = ServiceManager.getInstance(); |
Object[] args = new Object[]{urlStat,year,month,day}; |
sm.execute(RequestUtils.getRequester(request),"UpdateUrlStatistics",args); |
Object[] args = new Object[]{urlStat, year, month, day}; |
sm.execute(RequestUtils.getRequester(request, response), "UpdateUrlStatistics", args); |
urlStat.clear(); |
urlStat = null; |
urlStat = new HashMap<String,IntegerContainer>(); |
urlStat = new HashMap<String, IntegerContainer>(); |
} |
public static synchronized void createUrl(HttpServletRequest request, long nowMiliseconds, String relativePath) throws Throwable, ClassNotIFilterException, ServiceManagerException, InvalidFilterExpressionException, IncompatibleFilterException, FilterRetrieveException, NoCookiesException |
public static synchronized void createUrl(HttpServletRequest request, HttpServletResponse response, long nowMiliseconds, String relativePath) throws Throwable, ClassNotIFilterException, ServiceManagerException, InvalidFilterExpressionException, IncompatibleFilterException, FilterRetrieveException, NoCookiesException |
{ |
if(urlStat.size() >= MAX_MAP_SYZE) |
updateStats(request,nowMiliseconds); |
if (urlStat.size() >= URL_STAT_CACHE_SIZE) |
updateStats(request, response, nowMiliseconds); |
urlStat.put(relativePath, new IntegerContainer(1)); |
} |
190,7 → 184,8 |
{ |
int i; |
public void setI(int i) { |
public void setI(int i) |
{ |
this.i = i; |
} |
/impl/src/java/pt/estgp/estgweb/web/filters/UserSessionFilter.java |
---|
50,7 → 50,7 |
chain.doFilter(request,response); |
try |
{ |
UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(hrequest); |
UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(hrequest,((HttpServletResponse) response)); |
request.setAttribute(Globals.USER_SESSION_KEY,userSession); |
userSession.setIpAddress(request.getRemoteAddr() + " : " + request.getRemoteHost() + " : " + request.getRemotePort()); |
String lang = request.getParameter("language"); |
59,7 → 59,7 |
userSession.setLanguage(lang); |
try |
{ |
userSession.serialize((HttpServletRequest)request); |
userSession.serialize((HttpServletRequest)request,(HttpServletResponse)response); |
} |
catch (Throwable e) |
{ |
/impl/src/java/pt/estgp/estgweb/web/FTPProxy.java |
---|
99,7 → 99,12 |
List<IFile> iFiles = new ArrayList<IFile>(); |
for(FTPFile ftpFile : files) |
{ |
IFile iFile = new FtpFile(ftpFile,server + path + "/" + ftpFile.getName(),path); |
IFile iFile; |
if(path.endsWith("/")) |
iFile = new FtpFile(ftpFile,server + path + ftpFile.getName(),path); |
else |
iFile = new FtpFile(ftpFile,server + path + "/" + ftpFile.getName(),path); |
iFiles.add(iFile); |
} |
request.setAttribute("files",iFiles); |
/impl/src/java/pt/estgp/estgweb/web/tags/IsNotAdminTag.java |
---|
21,7 → 21,8 |
public int doEndTag() throws JspException { |
UserSessionImpl userSession = (UserSessionImpl) pageContext.getRequest().getAttribute(Globals.USER_SESSION_KEY); |
if(userSession == null || userSession.getUser() == null || !(((UserImpl)userSession.getUser()).hasRole(Globals.ADMIN_ROLE) && !((UserImpl)userSession.getUser()).isSuperuser())) |
if(userSession == null || userSession.getUser() == null) |
{ |
String toPage = bodyContent.getString().trim(); |
JspWriter writer = pageContext.getOut(); |
35,6 → 36,20 |
throw new JspException(e); |
} |
} |
else if(!(((UserImpl)userSession.getUser()).hasRole(Globals.ADMIN_ROLE)) && !((UserImpl)userSession.getUser()).isSuperuser()) |
{ |
String toPage = bodyContent.getString().trim(); |
JspWriter writer = pageContext.getOut(); |
try |
{ |
writer.write(toPage); |
} |
catch(Exception e) |
{ |
logger.error(e,e); |
throw new JspException(e); |
} |
} |
// Continue processing this page |
return EVAL_PAGE; |
/impl/src/java/pt/estgp/estgweb/web/tags/CanManageTag.java |
---|
New file |
0,0 → 1,78 |
package pt.estgp.estgweb.web.tags; |
import org.apache.log4j.Logger; |
import org.apache.struts.util.RequestUtils; |
import pt.estgp.estgweb.domain.UserSessionImpl; |
import pt.estgp.estgweb.domain.UserImpl; |
import pt.estgp.estgweb.domain.IOwned; |
import pt.estgp.estgweb.domain.IInternal; |
import pt.estgp.estgweb.Globals; |
import javax.servlet.jsp.tagext.BodyTagSupport; |
import javax.servlet.jsp.JspException; |
import javax.servlet.jsp.JspWriter; |
public class CanManageTag extends BodyTagSupport |
{ |
private static final Logger logger = Logger.getLogger(CanManageTag.class); |
private String name; |
private String property; |
public String getName() |
{ |
return name; |
} |
public void setName(String name) |
{ |
this.name = name; |
} |
public String getProperty() |
{ |
return property; |
} |
public void setProperty(String property) |
{ |
this.property = property; |
} |
public int doStartTag() throws JspException { |
return EVAL_BODY_TAG; |
} |
public int doEndTag() throws JspException |
{ |
UserSessionImpl userSession = (UserSessionImpl) pageContext.getRequest().getAttribute(Globals.USER_SESSION_KEY); |
IOwned owned = (IOwned) RequestUtils.lookup(pageContext, name, property, null); |
IInternal iInternal = (IInternal) owned; |
if(userSession.getUser() == null && iInternal.isInternal()) |
{ |
//do nothing |
} |
else if(owned != null && userSession.getUser() != null && (owned.isOwnedBy(userSession.getUser()) || ((UserImpl) userSession.getUser()).isSuperUserOrAdmin())) |
{ |
String toPage = bodyContent.getString().trim(); |
JspWriter writer = pageContext.getOut(); |
try |
{ |
writer.write(toPage); |
} |
catch(Exception e) |
{ |
logger.error(e,e); |
throw new JspException(e); |
} |
} |
// Continue processing this page |
return EVAL_PAGE; |
} |
} |
/impl/src/java/pt/estgp/estgweb/web/tags/PageUrlStatTag.java |
---|
9,7 → 9,6 |
import javax.servlet.jsp.JspWriter; |
import javax.servlet.http.HttpServletRequest; |
import pt.estgp.estgweb.domain.UserSessionImpl; |
import pt.estgp.estgweb.Globals; |
import pt.estgp.estgweb.web.filters.UrlStatFilter; |
39,7 → 38,7 |
HttpServletRequest hrequest = (HttpServletRequest) pageContext.getRequest(); |
String relativePath = (String) hrequest.getAttribute(Globals.ACTUAL_RELATIVE_PATH); |
for(String ignore: UrlStatFilter.ignorePrefixs) |
for(String ignore: UrlStatFilter.URL_STAT_IGNORE_PREFIXS) |
{ |
if(relativePath.startsWith(ignore)) |
{ |
/impl/src/java/pt/estgp/estgweb/examples/DBInit.java |
---|
24,6 → 24,7 |
AbstractDao.getCurrentSession().beginTransaction(); |
UserImpl user = DomainObjectFactory.createUserImpl(); |
user.setUsername("super"); |
user.setSuperuser(true); |
user.setName("super user"); |
user.setRoles("all,admin"); |
user.setPassword(BytesUtils.getMD5("1")); |
/impl/src/doc/estgweb.eap |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/impl/src/hbm/pt/estgp/estgweb/domain/GenericUser.hbm.xml |
---|
32,7 → 32,11 |
<property name="zip" type="string"/> |
<property name="country" type="string"/> |
<property name="email" type="string"/> |
<property name="outEmail" type="string"/> |
<property name="phonenumber" type="string"/> |
<property name="sex" type="string"/> |
<property name="bi" type="string"/> |
<property name="birthDate" type="date"/> |
<set name="groups" table="group_users"> |
<key column="user_id"/> |
<many-to-many column="group_id" class="pt.estgp.estgweb.domain.Group"/> |
41,7 → 45,34 |
<key column="user_id"/> |
<one-to-many class="pt.estgp.estgweb.domain.CourseUserAssociation"/> |
</set> |
<subclass name="pt.estgp.estgweb.domain.UserImpl" discriminator-value="UserImpl"/> |
<subclass name="pt.estgp.estgweb.domain.UserImpl" discriminator-value="UserImpl"> |
<subclass name="pt.estgp.estgweb.domain.UserManagedRoleImpl"> |
<subclass name="pt.estgp.estgweb.domain.Student"> |
<meta attribute="extends">pt.estgp.estgweb.domain.UserManagedRoleImpl</meta> |
<meta attribute="scope-class">public abstract</meta> |
<property name="sigesCode" type="int"/> |
<property name="userNameNetpa" type="string"/> |
<set name="subscribedUnits" lazy="true"> |
<key column="studentId"/> |
<many-to-many class="pt.estgp.estgweb.domain.CourseUnit" column="courseUnitId"/> |
</set> |
<subclass name="pt.estgp.estgweb.domain.StudentImpl" discriminator-value="StudentImpl"/> |
</subclass> |
<subclass name="pt.estgp.estgweb.domain.Teacher"> |
<meta attribute="extends">pt.estgp.estgweb.domain.UserManagedRoleImpl</meta> |
<meta attribute="scope-class">public abstract</meta> |
<property name="sigesCode" type="int"/> |
<property name="userNameNetpa" type="string"/> |
<property name="academicName" type="string"/> |
<property name="employerName" type="string"/> |
<set name="teachedUnits" lazy="true"> |
<key column="studentId"/> |
<many-to-many class="pt.estgp.estgweb.domain.CourseUnit" column="courseUnitId"/> |
</set> |
<subclass name="pt.estgp.estgweb.domain.TeacherImpl" discriminator-value="TeacherImpl"/> |
</subclass> |
</subclass> |
</subclass> |
</subclass> |
</class> |
</hibernate-mapping> |
/impl/src/hbm/pt/estgp/estgweb/domain/CourseUnit.hbm.xml |
---|
21,7 → 21,7 |
<property name="courseYear" type="string" /> |
<property name="institutionCode" type="string" /> |
<property name="status" type="boolean" /> |
<many-to-one name="courseunit" class="pt.estgp.estgweb.domain.CourseUnit" lazy="false" outer-join="true"/> |
<subclass name="pt.estgp.estgweb.domain.CourseUnitImpl" discriminator-value="CourseUnitImpl"/> |
</class> |
</hibernate-mapping> |
/impl/src/hbm/pt/estgp/estgweb/domain/Announcement.hbm.xml |
---|
22,7 → 22,12 |
<property name="targetRoles" type="text"/> |
<property name="type" type="string" /> |
<property name="url" type="string"/> |
<property name="internalUrlPath" type="string"/> |
<property name="internalUrlServer" type="string"/> |
<property name="internalUrlInclude" type="boolean"/> |
<property name="style" type="string"/> |
<property name="status" type="boolean" /> |
<property name="internal" type="boolean" /> |
<property name="counter" type="integer" /> |
<many-to-one name="bigImage" column="bigImage" class="pt.estgp.estgweb.domain.Image" lazy="no-proxy" outer-join="false" cascade="all" /> |
<many-to-one name="smallImage" column="smallImage" class="pt.estgp.estgweb.domain.Image" lazy="no-proxy" outer-join="false" cascade="all"/> |
/impl/src/web/imgs/folder.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/imgs/mime/txt.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/imgs/mime/gz.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/imgs/mime/rar.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/imgs/mime/tar.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/imgs/mime/htm.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/imgs/mime/7zip.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/imgs/mime/rtf.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/imgs/mime/unknown.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/imgs/mime/xml.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/imgs/mime/zip.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/imgs/mime/ppt.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/imgs/mime/html.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/imgs/mime/tgz.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/imgs/mime/doc.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/imgs/mime/xls.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/imgs/mime/pdf.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/admin/profile/findUser.jsp |
---|
New file |
0,0 → 1,34 |
<%@ 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/struts-nested.tld" prefix="nested" %> |
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %> |
<jsp:useBean id="ProfileForm" class="pt.estgp.estgweb.web.form.profile.ProfileForm"/> |
<jomm:messages/> |
<html:form action="/profile"> |
<input type="hidden" name="dispatch" value="search"> |
<table class="form"> |
<tr> |
<th> |
<bean:message key="profile.search.user"/> |
</th> |
<td> |
<html:text property="textToSearch" maxlength="50"/> |
</td> |
<td> |
<input type="button" onclick="set(this.form,'search');this.form.submit()" value="<bean:message key="search"/>"> |
</td> |
</tr> |
</table> |
<logic:present name="ProfileForm" property="usersFind"> |
<ul> |
<logic:iterate id="userView" name="ProfileForm" property="usersFind" type="pt.estgp.estgweb.domain.views.UserView"> |
<li>${userView.name} <html:link action="/profile?id=${userView.id}&dispatch=changeProfile"><bean:message key="edit"/></html:link></li> |
</logic:iterate> |
</ul> |
</logic:present> |
</html:form> |
/impl/src/web/admin/profile/profile.jsp |
---|
New file |
0,0 → 1,171 |
<%@ page import="java.util.List" %> |
<%@ 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/estgweb.tld" prefix="estgweb" %> |
<jomm:messages/> |
<%--<jsp:useBean id="ProfileForm" class="pt.estgp.estgweb.web.form.profile.ProfileForm"/>--%> |
<html:form action="/profile"> |
<input type="hidden" name="dispatch" value="editUser"> |
<html:hidden property="userView.id"/> |
<html:hidden property="role"/> |
<bean:message key="profile.edit"/> |
<table class="form"> |
<estgweb:isNotAdmin> |
<tr> |
<th> |
<bean:message key="login.first.time.username"/> |
</th> |
<td> |
<html:text property="userView.username" maxlength="250" readonly="true" styleClass="readOnly"/> |
</td> |
</tr> |
</estgweb:isNotAdmin> |
<estgweb:isAdmin> |
<tr> |
<th> |
<bean:message key="login.first.time.username"/> |
</th> |
<td> |
<html:text property="userView.username" maxlength="250"/> |
</td> |
</tr> |
<tr> |
<th> |
<bean:message key="login.first.time.targets"/> |
</th> |
<td> |
<html:select property="targetRolesStr"> |
<logic:present name="ProfileForm" property="targetRoles"> |
<logic:iterate id="item" name="ProfileForm" property="targetRoles"> |
<jomm:option itemName="item" comparableObjectName="ProfileForm" |
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="ProfileForm" property="selectedRoles"> |
<logic:notEmpty name="ProfileForm" property="selectedRoles"> |
<ul> |
<logic:iterate id="item" name="ProfileForm" property="selectedRoles"> |
<li> |
<jomm:message patternMessage="user.role.{0}" name0="item"/> |
<input type="button" value="<bean:message key="remove"/>" |
onclick="ProfileForm.role.value='${item}';set(this.form,'removeRole');this.form.submit();"> |
</li> |
</logic:iterate> |
</ul> |
</logic:notEmpty> |
</logic:present> |
</td> |
</tr> |
</estgweb:isAdmin> |
<tr> |
<th> |
<bean:message key="login.first.time.bi"/> |
</th> |
<td> |
<html:text property="userView.bi" maxlength="250" readonly="true" styleClass="readOnly"/> |
</td> |
</tr> |
<tr> |
<th> |
<bean:message key="login.first.time.birthday.date"/> |
</th> |
<td> |
<html:text property="birthDayDate" maxlength="100" readonly="true" styleClass="readOnly"/> |
</td> |
</tr> |
<tr> |
<th> |
<bean:message key="login.first.time.name"/> |
</th> |
<td> |
<html:text property="userView.name" maxlength="250" readonly="true" styleClass="readOnly"/> |
</td> |
</tr> |
<tr> |
<th> |
<bean:message key="login.first.time.address"/> |
</th> |
<td> |
<html:text property="userView.address" maxlength="250" readonly="true" styleClass="readOnly"/> |
</td> |
</tr> |
<tr> |
<th> |
<bean:message key="login.first.time.zip"/> |
</th> |
<td> |
<html:text property="userView.zip" maxlength="8" readonly="true" styleClass="readOnly"/> |
</td> |
</tr> |
<tr> |
<th> |
<bean:message key="login.first.time.country"/> |
</th> |
<td> |
<html:text property="userView.country" maxlength="100" readonly="true" styleClass="readOnly"/> |
</td> |
</tr> |
<tr> |
<th> |
<bean:message key="login.first.time.phone.number"/> |
</th> |
<td> |
<html:text property="userView.phonenumber" maxlength="250" styleClass="readOnly"/> |
</td> |
</tr> |
<estgweb:isNotAdmin> |
<tr> |
<th> |
<bean:message key="login.first.time.email.institucion"/> |
</th> |
<td> |
<html:text property="userView.email" maxlength="250" readonly="true" styleClass="readOnly"/> |
</td> |
</tr> |
</estgweb:isNotAdmin> |
<estgweb:isAdmin> |
<tr> |
<th> |
<bean:message key="login.first.time.email.institucion2"/> |
</th> |
<td> |
<html:text property="userView.email" maxlength="250"/> |
</td> |
</tr> |
</estgweb:isAdmin> |
<tr> |
<th> |
<bean:message key="login.first.time.email.secundary"/> |
</th> |
<td> |
<html:text property="userView.outEmail" maxlength="250"/> |
</td> |
</tr> |
<estgweb:isNotAdmin> |
<tr> |
<th> |
<bean:message key="profile.email.change"/> |
</th> |
</tr> |
</estgweb:isNotAdmin> |
<tr class="buttons"> |
<td colspan="2"> |
<input type="button" onclick="set(this.form,'editUser');this.form.submit()" |
value="<bean:message key="confirm"/>"/> |
</td> |
</tr> |
</table> |
</html:form> |
/impl/src/web/admin/announcements/submitAnnouncement.jsp |
---|
29,6 → 29,17 |
</html:select> |
</td> |
</tr> |
<tr> |
<th> |
<bean:message key="announcement.internal"/> |
</th> |
<td> |
<html:select property="announcementView.internal"> |
<html:option value="true"><bean:message key="announcement.internal.yes"/></html:option> |
<html:option value="false"><bean:message key="announcement.internal.no"/></html:option> |
</html:select> |
</td> |
</tr> |
</estgweb:isAdmin> |
<tr> |
<th> |
92,11 → 103,11 |
<logic:present name="AnnouncementsForm" property="selectedRoles"> |
<logic:notEmpty name="AnnouncementsForm" property="selectedRoles"> |
<ul> |
<table> |
<logic:iterate id="item" name="AnnouncementsForm" property="selectedRoles"> |
<li><jomm:message patternMessage="user.role.{0}" name0="item"/><input type="button" value="<bean:message key="remove"/>" onclick="AnnouncementsForm.role.value='${item}';set(this.form,'removeRole');this.form.submit();"></li> |
<tr><td><jomm:message patternMessage="user.role.{0}" name0="item"/></td><td><input type="button" value="<bean:message key="remove"/>" onclick="AnnouncementsForm.role.value='${item}';set(this.form,'removeRole');this.form.submit();"></td></tr> |
</logic:iterate> |
</ul> |
</table> |
</logic:notEmpty> |
</logic:present> |
</td> |
148,6 → 159,28 |
<tr> |
<th> |
<bean:message key="announcement.image.style"/> |
</th> |
<td> |
<html:select property="announcementView.style"> |
<html:option value="announcement.style.img.left"><bean:message key="announcement.style.img.left"/></html:option> |
<html:option value="announcement.style.img.left.top"><bean:message key="announcement.style.img.left.top"/></html:option> |
<html:option value="announcement.style.img.left.bottom"><bean:message key="announcement.style.img.left.bottom"/></html:option> |
<html:option value="announcement.style.img.right"><bean:message key="announcement.style.img.right"/></html:option> |
<html:option value="announcement.style.img.right.top"><bean:message key="announcement.style.img.right.top"/></html:option> |
<html:option value="announcement.style.img.right.bottom"><bean:message key="announcement.style.img.right.bottom"/></html:option> |
<html:option value="announcement.style.img.top"><bean:message key="announcement.style.img.top"/></html:option> |
<html:option value="announcement.style.img.top.left"><bean:message key="announcement.style.img.top.left"/></html:option> |
<html:option value="announcement.style.img.top.right"><bean:message key="announcement.style.img.top.right"/></html:option> |
<html:option value="announcement.style.img.embedded.left"><bean:message key="announcement.style.img.embedded.left"/></html:option> |
<html:option value="announcement.style.img.embedded.right"><bean:message key="announcement.style.img.embedded.right"/></html:option> |
</html:select> |
</td> |
</tr> |
<tr> |
<th> |
<bean:message key="announcement.linkAnnouncement"/> |
</th> |
<td> |
159,8 → 192,27 |
<html:text property="url" maxlength="250"/> |
</td> |
</tr> |
<tr> |
<th> |
<bean:message key="announcement.internalLinkAnnouncement"/> |
</th> |
<td> |
<html:select property="announcementView.internalUrlServer"> |
<html:option value="true"><bean:message key="announcement.internal.url.include.yes"/></html:option> |
<html:option value="false"><bean:message key="announcement.internal.url.include.no"/></html:option> |
</html:select> |
<html:text property="announcementView.internalUrlPath"/> |
<html:select property="announcementView.internalUrlServer"> |
<html:option value="estg">ESTG</html:option> |
<html:option value="ionline">IONLINE</html:option> |
</html:select> |
</td> |
</tr> |
<tr> |
<th> |
<bean:message key="announcement.text"/> |
</th> |
<td> |
/impl/src/web/css/style.css |
---|
10,11 → 10,18 |
/****************************Text Size*************************************************/ |
UL |
{ |
margin:0; |
padding:0; |
} |
h1 { |
font-size: 1.2em; |
margin:0; |
} |
h2 { |
margin:0; |
font-size: 1em; |
} |
65,7 → 72,7 |
TD.rightPage, TD.rightPagePortal { |
VERTICAL-ALIGN: top; |
/*WIDTH: 160px;*/ |
/*WIDTH: 160px;*/ |
} |
.rightPagePosition { |
81,7 → 88,7 |
/************************************** Content Structure ********************************/ |
.contentPortal { |
padding-left: 10px; |
} |
.content h2 a { |
93,8 → 100,27 |
} |
#pageStructure .content |
{ |
border: 0; |
border-right:0; |
border-top:0; |
border-bottom:0; |
border: 1px solid #8ec73f ; |
} |
#pageStructure td.content |
{ |
border-left: 1px solid #8ec73f ; |
border-right: 1px solid #8ec73f; |
border-bottom: 1px solid #8ec73f; |
border-top: 1px solid #8ec73f; |
} |
#pageStructure td.rightPage |
{ |
border-top: 1px solid #8ec73f; |
} |
.content .imageAnnouncement img |
{ |
width:341px; |
135,7 → 161,18 |
border-bottom: #8EC73F solid 2px; |
} |
.files |
{ |
padding-left: 10px; |
} |
.files ul |
{ |
margin:0; |
padding:0; |
} |
/*****************************************************************************************/ |
/************************************* Footer Modules ***********************************/ |
211,13 → 248,13 |
} |
#topnav UL { |
margin-top:0; |
margin-left:0; |
PADDING-RIGHT: 0; |
PADDING-LEFT: 0; |
PADDING-BOTTOM: 10px; |
MARGIN: 0; |
WIDTH: 155px; |
LINE-HEIGHT: 1.5em; |
MARGIN-bottom: 2px; |
MARGIN-right: 0; |
PADDING-TOP: 0; |
padding-left: 15px; |
LIST-STYLE-TYPE: none |
} |
361,14 → 398,14 |
.portalLeftAnnouncements table { |
table-layout: fixed; |
/*width: 180px;*/ |
/*width: 180px;*/ |
padding-top: 10px; |
font-size: 0.8em; |
} |
.portalRightAnnouncements table { |
table-layout: fixed; |
/*width: 250px;*/ |
/*width: 250px;*/ |
font-size: 0.8em; |
} |
391,7 → 428,7 |
/* todo FABIO |
todo Left Manus???? ao pe de portalMenus isto esta uma confusao*/ |
.navleftMenu { |
/*width: 180px;*/ |
/*width: 180px;*/ |
padding-left: 10px; |
} |
445,30 → 482,35 |
color: #8EC73F; |
} |
.listClean UL /*Lista sem nada*/ |
.listClean UL, .files UL /*Lista sem nada*/ |
{ |
LIST-STYLE-TYPE: none; |
padding: 0; |
margin-left:5px; |
} |
.listCircleWhite UL /*Lista circulo branco*/ |
{ |
LIST-STYLE-TYPE: circle; |
margin-left:15px; |
} |
.listDecimal UL /*Lista decimal*/ |
{ |
LIST-STYLE-TYPE: decimal; |
margin-left:15px; |
} |
.listDisc UL /*Lista circulo preto*/ |
{ |
LIST-STYLE-TYPE: disc; |
margin-left:15px; |
} |
.listSquare UL /*Lista quadrado preto*/ |
{ |
LIST-STYLE-TYPE: square; |
margin-left:15px; |
} |
.portalLeftAnnouncements img { |
641,9 → 683,13 |
color: #8EC73F; |
} |
.linkLeftMenu ul |
{ |
margin:0; |
padding:0; |
} |
.linkLeftMenu li |
{ |
border-bottom:1px solid #8ec73f; |
} |
.linkLeftMenu li:hover |
651,15 → 697,36 |
} |
#leftMenuModule UL { |
MARGIN: 0; |
/*WIDTH: 155px;*/ |
/*WIDTH: 155px;*/ |
} |
.linkLeftMenu UL li |
{ |
width:110px; |
white-space: nowrap; |
padding-right:3px; |
padding-left:3px; |
} |
.linkMenuBlock |
{ |
margin-top:15px; |
border-left:1px solid #8ec73f; |
} |
.linkMenuBlockTitle, .linkMenuBlock h2 |
{ |
border-bottom:1px solid #8ec73f; |
background-color:#8ec73f; |
color:white; |
white-space:nowrap; |
} |
.linkMenuBlockTitle p, .linkMenuBlock h2 |
{ |
background-color:#8ec73f; |
text-align:right; |
padding-right:2px; |
margin:0; |
} |
/**************************************************************************************/ |
/******************************** Bar Module Color ************************************/ |
696,22 → 763,16 |
.boxHorizontal { |
padding-top: 5px; |
} |
.form th, .boxHorizontal th { |
margin: 0; |
padding-left: 10px; |
padding-top: 3px; |
padding-bottom: 3px; |
padding-right: 15px; |
color: #4d4d4d; |
background-color: #FFFFFF; |
border: 0px solid #793B0D; |
font-size: 0.86em; |
font-weight: bold; |
font-family: Helvetica, sans-serif; |
text-align: left; |
border: 0 solid #793B0D; |
font-weight:normal; |
padding-right:5px; |
text-align:right; |
} |
.form td, .boxHorizontal td { |
747,6 → 808,20 |
width: 100px; |
} |
.form input.readOnly { |
background-color:#cccccc; |
border-top-width: 1px; |
color:#FFFFFF; |
border-right-width: 1px; |
border-bottom-width: 1px; |
border-left-width: 1px; |
border-top-style: solid; |
border-right-style: solid; |
border-bottom-style: solid; |
border-left-style: solid; |
} |
/* PAGE LAYOUTS */ |
.seccao, .seccao p { |
836,8 → 911,8 |
/********************************************** Navigation Menu ********************************/ |
ul.menubar { |
margin: 0px; |
padding: 0px; |
margin: 0; |
padding: 0; |
background-color: #FFFFFF; /* IE6 Bug */ |
font-size: 100%; |
848,6 → 923,7 |
font-size: 0.8em; |
} |
.menu { |
FONT-FAMILY: "Lucida Grande", "Trebuchet MS", "bitstream vera sans", Verdana, Arial, Helvetica, sans-serif; |
font-size: 0.8em; |
894,6 → 970,7 |
{ |
width:100%; |
} |
#menuTop td.searchTab form |
{ |
text-align:right; |
1005,7 → 1082,7 |
position: absolute; |
display: none; |
left: 149px; /* Set 1px less than menu width */ |
top: 0px; |
top: 0; |
} |
ul.menu li.submenu ul { |
/impl/src/web/js/functions.js |
---|
1,6 → 1,5 |
function set(form, value){ |
function set(form, value) |
{ |
form.dispatch.value = value; |
} |
31,3 → 30,30 |
return(new Date(f.DateLastModified).getDate()); |
} |
function horizontal() |
{ |
var navItems = document.getElementById("menu_dropdown").getElementsByTagName("li"); |
for (var i = 0; i < navItems.length; i++) |
{ |
if (navItems[i].className == "submenu") |
{ |
if (navItems[i].getElementsByTagName('ul')[0] != null) |
{ |
navItems[i].onmouseover = function() |
{ |
this.getElementsByTagName('ul')[0].style.display = "block"; |
this.style.backgroundColor="#cccccc"; |
} |
navItems[i].onmouseout = function() |
{ |
this.getElementsByTagName('ul')[0].style.display = "none"; |
this.style.backgroundColor=""; |
} |
} |
} |
} |
} |
/impl/src/web/layout/layout1.jsp |
---|
1,35 → 1,22 |
<%@page contentType="text/html"%> |
<%@page pageEncoding="UTF-8"%> |
<%@ 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" %> |
<%@ page contentType="text/html" %> |
<%@ page pageEncoding="UTF-8" %> |
<%@ 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" %> |
<html:html locale="true"> |
<head> |
<title><bean:message key="site.title"/> - <tiles:getAsString name="title"/> <%=request.getParameter("title")%></title> |
<title> |
<bean:message key="site.title"/> |
- |
<tiles:getAsString name="title"/> |
<%=request.getParameter("title")%> |
</title> |
<jsp:include page="/layout/scripts.jsp"/> |
<script type="text/javascript"> |
function horizontal() { |
var navItems = document.getElementById("menu_dropdown").getElementsByTagName("li"); |
for (var i=0; i< navItems.length; i++) { |
if(navItems[i].className == "submenu") |
{ |
if(navItems[i].getElementsByTagName('ul')[0] != null) |
{ |
navItems[i].onmouseover=function() { |
this.getElementsByTagName('ul')[0].style.display="block";} |
navItems[i].onmouseout=function() {this.getElementsByTagName('ul')[0].style.display="none";} |
} |
} |
} |
} |
</script> |
</head> |
<body class="small" marginwidth="0" marginheight="0" bgcolor="#ffffff" topmargin="0" leftmargin="0" onload="horizontal();"> |
<body class="small" marginwidth="0" marginheight="0" bgcolor="#ffffff" topmargin="0" leftmargin="0" |
onload="horizontal();"> |
<table width="100%"> |
<tr> |
<td align="center"> |
37,17 → 24,19 |
<div id="header"> |
<tiles:insert attribute="header"/> |
</div> |
<table class="pageDefault"> |
<table class="pageDefault" cellpadding="0" cellspacing="0"> |
<tr> |
<td colspan="2"><tiles:insert attribute="navigationTop"/></td> |
<td colspan="2"> |
<tiles:insert attribute="navigationTop"/> |
</td> |
</tr> |
<tr> |
<td id="leftPage"> |
<tiles:insert attribute="navigation" /> |
<tiles:insert attribute="navigation"/> |
</td> |
<td class="content"> |
<tiles:insert attribute="topnav"/> |
<tiles:insert attribute="body" /> |
<tiles:insert attribute="body"/> |
</td> |
</tr> |
</table> |
/impl/src/web/layout/layout2.jsp |
---|
9,25 → 9,7 |
<head> |
<title><bean:message key="site.title"/> - <tiles:getAsString name="title"/></title> |
<jsp:include page="/layout/scripts.jsp"/> |
<script type="text/javascript"> |
function horizontal() { |
var navItems = document.getElementById("menu_dropdown").getElementsByTagName("li"); |
for (var i=0; i< navItems.length; i++) { |
if(navItems[i].className == "submenu") |
{ |
if(navItems[i].getElementsByTagName('ul')[0] != null) |
{ |
navItems[i].onmouseover=function() { |
this.getElementsByTagName('ul')[0].style.display="block";} |
navItems[i].onmouseout=function() {this.getElementsByTagName('ul')[0].style.display="none";} |
} |
} |
} |
} |
</script> |
</head> |
<body class="small" marginwidth="0" marginheight="0" bgcolor="#ffffff" topmargin="0" leftmargin="0" onload="horizontal();"> |
<table width="100%"> |
37,7 → 19,7 |
<div id="header"> |
<tiles:insert attribute="header"/> |
</div> |
<table id="page"> |
<table id="page" cellpadding="0" cellspacing="0"> |
<tr> |
<td><tiles:insert attribute="navigationTop"/></td> |
</tr> |
/impl/src/web/layout/layoutPortal.jsp |
---|
9,25 → 9,7 |
<head> |
<title><bean:message key="site.title"/> - <tiles:getAsString name="title"/></title> |
<jsp:include page="/layout/scripts.jsp"/> |
<script type="text/javascript"> |
function horizontal() { |
var navItems = document.getElementById("menu_dropdown").getElementsByTagName("li"); |
for (var i=0; i< navItems.length; i++) { |
if(navItems[i].className == "submenu") |
{ |
if(navItems[i].getElementsByTagName('ul')[0] != null) |
{ |
navItems[i].onmouseover=function() { |
this.getElementsByTagName('ul')[0].style.display="block";} |
navItems[i].onmouseout=function() {this.getElementsByTagName('ul')[0].style.display="none";} |
} |
} |
} |
} |
</script> |
</head> |
/impl/src/web/layout/layout3.jsp |
---|
9,25 → 9,7 |
<head> |
<title><bean:message key="site.title"/> - <tiles:getAsString name="title"/></title> |
<jsp:include page="/layout/scripts.jsp"/> |
<script type="text/javascript"> |
function horizontal() { |
var navItems = document.getElementById("menu_dropdown").getElementsByTagName("li"); |
for (var i=0; i< navItems.length; i++) { |
if(navItems[i].className == "submenu") |
{ |
if(navItems[i].getElementsByTagName('ul')[0] != null) |
{ |
navItems[i].onmouseover=function() { |
this.getElementsByTagName('ul')[0].style.display="block";} |
navItems[i].onmouseout=function() {this.getElementsByTagName('ul')[0].style.display="none";} |
} |
} |
} |
} |
</script> |
</head> |
<body class="small" marginwidth="0" marginheight="0" bgcolor="#ffffff" topmargin="0" leftmargin="0" onload="horizontal();"> |
<table width="100%"> |
37,7 → 19,7 |
<div id="header"> |
<tiles:insert attribute="header"/> |
</div> |
<table id="page"> |
<table id="page" cellpadding="0" cellspacing="0"> |
<tr> |
<td colspan="2"><tiles:insert attribute="navigationTop"/></td> |
</tr> |
/impl/src/web/layout/layout4.jsp |
---|
9,24 → 9,7 |
<head> |
<title><bean:message key="site.title"/> - <tiles:getAsString name="title"/></title> |
<jsp:include page="/layout/scripts.jsp"/> |
<script type="text/javascript"> |
function horizontal() { |
var navItems = document.getElementById("menu_dropdown").getElementsByTagName("li"); |
for (var i=0; i< navItems.length; i++) { |
if(navItems[i].className == "submenu") |
{ |
if(navItems[i].getElementsByTagName('ul')[0] != null) |
{ |
navItems[i].onmouseover=function() { |
this.getElementsByTagName('ul')[0].style.display="block";} |
navItems[i].onmouseout=function() {this.getElementsByTagName('ul')[0].style.display="none";} |
} |
} |
} |
} |
</script> |
</head> |
38,7 → 21,7 |
<div id="header"> |
<tiles:insert attribute="header"/> |
</div> |
<table id="pageStructure"> |
<table id="pageStructure" cellpadding="0" cellspacing="0"> |
<tr> |
<td colspan="3"><tiles:insert attribute="navigationTop"/></td> |
</tr> |
/impl/src/web/layout/topnav.jsp |
---|
1,29 → 1,33 |
<%@page contentType="text/html"%> |
<%@page pageEncoding="UTF-8"%> |
<%@page import="java.util.*"%> |
<%@page import="jomm.web.utils.NavPlace"%> |
<%@page import="jomm.utils.MessageResources"%> |
<%@ page contentType="text/html" %> |
<%@ page pageEncoding="UTF-8" %> |
<%@ page import="java.util.*" %> |
<%@ page import="jomm.web.utils.NavPlace" %> |
<%@ page import="jomm.utils.MessageResources" %> |
<%@ page import="jomm.web.utils.NavPlaceServer" %> |
<%@ page import="jomm.web.utils.TopNav" %> |
<ul id="topnav"> |
<% |
TopNav topNav = NavPlaceServer.getTopNav(request); |
List<NavPlace> navKeys = topNav.getNavPlaces(); |
for (NavPlace navPlace : navKeys) |
<div id="topnav"> |
<ul> |
<% |
TopNav topNav = NavPlaceServer.getTopNav(request); |
List<NavPlace> navKeys = topNav.getNavPlaces(); |
for (NavPlace navPlace : navKeys) |
{ |
if (navPlace.getUrl() != null) |
{ |
%> |
<li class="navPlace"><a |
href="<%=request.getContextPath() + navPlace.getUrl()%>"><%=navPlace.getMessage(request)%> |
</a> ></li> |
<% |
} |
else |
{ |
if (navPlace.getUrl() != null) { |
%> |
<li class="navPlace"><a |
href="<%=request.getContextPath() + navPlace.getUrl()%>"><%=navPlace.getMessage(request)%> |
</a> ></li> |
<% |
} |
else { |
%> |
<li class="navPlace"><%=navPlace.getMessage(request)%> |
</li> |
<% |
%> |
<li class="navPlace"><%=navPlace.getMessage(request)%> |
</li> |
<% |
} |
} |
} |
%> |
</ul> |
%> |
</ul> |
</div> |
/impl/src/web/layout/navigationLeft.jsp |
---|
12,13 → 12,15 |
<jsp:include page="/layout/navigationLeftMenu.jsp"/> |
<%-- USER MENUS--%> |
<div id="leftMenuModule"> |
<div class="linkLeftMenu"> |
<div class="listClean"> |
<estgweb:isAuthenticated> |
<%--SERVICES--%> |
<estgweb:isAuthenticated> |
<%--SERVICES--%> |
<div class="linkMenuBlock"> |
<h2><bean:message key="services"/></h2> |
<div class="linkLeftMenu"> |
<div class="listClean"> |
<ul> |
<h2><bean:message key="services"/></h2> |
<li> |
<html:link action="/startEditProfile"><bean:message key="edit.profile"/></html:link> |
</li> |
29,24 → 31,28 |
<html:link action="/startSubmitBlog"><bean:message key="submit.blog"/></html:link> |
</li> |
<estgweb:isAdmin> |
<h2><bean:message key="administrative.services"/></h2> |
<li> |
<html:link action="/findProfile"><bean:message key="edit.user.profile"/></html:link> |
</li> |
<h2><bean:message key="administrative.services"/></h2> |
<li> |
<html:link action="/findProfile"><bean:message key="edit.user.profile"/></html:link> |
</li> |
</estgweb:isAdmin> |
<!--OTHER PLACES--> |
<h2><bean:message key="Others"/></h2> |
</div> |
</div> |
</div> |
<div class="linkMenuBlock"> |
<h2><bean:message key="Others"/></h2> |
<div class="linkLeftMenu"> |
<div class="listClean"> |
<!--OTHER PLACES--> |
<ul> |
<li> |
<html:link action="/user/startCourses"><bean:message key="courses"/></html:link> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layout4/estgp/">ESTG SITE TESTE</a> |
</li> |
</ul> |
</estgweb:isAuthenticated> |
</div> |
</div> |
</div> |
</div> |
</estgweb:isAuthenticated> |
</div> |
/impl/src/web/layout/navigationCourse.jsp |
---|
11,54 → 11,62 |
<jsp:include page="/layout/navigationLeftAdmin.jsp"/> |
<p><bean:message key="courses"/></p> |
<ul> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.AA/AnoLectivo.2007-2008/"><bean:message key="course.aa"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.APM/AnoLectivo.2007-2008/"><bean:message key="course.apm"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.Bio/AnoLectivo.2007-2008/"><bean:message key="course.bio"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.CA/AnoLectivo.2007-2008/"><bean:message key="course.ca"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.DAM/AnoLectivo.2007-2008/"><bean:message key="course.dam"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.DC/AnoLectivo.2007-2008/"><bean:message key="course.dc"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.DCTG/AnoLectivo.2007-2008/"><bean:message key="course.dam"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.EC/AnoLectivo.2007-2008/"><bean:message key="course.ec"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.EEM/AnoLectivo.2007-2008/"><bean:message key="course.eem"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.EERA/AnoLectivo.2007-2008/"><bean:message key="course.eera"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.EI/AnoLectivo.2007-2008/"><bean:message key="course.ei"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.GE/AnoLectivo.2007-2008/"><bean:message key="course.ge"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.Gest/AnoLectivo.2007-2008/"><bean:message key="course.gest"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.ID/AnoLectivo.2007-2008/"><bean:message key="course.id"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.MKT/AnoLectivo.2007-2008/"><bean:message key="course.mkt"/></a> |
</li> |
</ul> |
<div class="linkMenuBlock"> |
<div class="linkMenuBlockTitle"> |
<p><bean:message key="courses"/></p> |
</div> |
<div class="linkLeftMenu"> |
<div class="listClean"> |
<ul> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.AA/AnoLectivo.2007-2008/"><bean:message key="course.aa"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.APM/AnoLectivo.2007-2008/"><bean:message key="course.apm"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.Bio/AnoLectivo.2007-2008/"><bean:message key="course.bio"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.CA/AnoLectivo.2007-2008/"><bean:message key="course.ca"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.DAM/AnoLectivo.2007-2008/"><bean:message key="course.dam"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.DC/AnoLectivo.2007-2008/"><bean:message key="course.dc"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.DCTG/AnoLectivo.2007-2008/"><bean:message key="course.dam"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.EC/AnoLectivo.2007-2008/"><bean:message key="course.ec"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.EEM/AnoLectivo.2007-2008/"><bean:message key="course.eem"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.EERA/AnoLectivo.2007-2008/"><bean:message key="course.eera"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.EI/AnoLectivo.2007-2008/"><bean:message key="course.ei"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.GE/AnoLectivo.2007-2008/"><bean:message key="course.ge"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.Gest/AnoLectivo.2007-2008/"><bean:message key="course.gest"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.ID/AnoLectivo.2007-2008/"><bean:message key="course.id"/></a> |
</li> |
<li> |
<a href="<%=request.getContextPath()%>/proxy/layoutCourses/ionline/Curso.MKT/AnoLectivo.2007-2008/"><bean:message key="course.mkt"/></a> |
</li> |
</ul> |
</div> |
</div> |
</div> |
</div> |
/impl/src/web/layout/navigationTop.jsp |
---|
18,7 → 18,6 |
<td> |
<ul id="menu_dropdown" class="menubar"> |
<li class="submenu"><a href="#">Apresentação</a> |
<div class="shadow "> |
<ul class="menu"> |
<li><a href="#">Mensagem do Presidente</a></li> |
32,7 → 31,7 |
</li> |
<li class="submenu"><a href="#">Organização</a> |
<div class="shadow "> |
<div class="shadow"> |
<ul class="menu"> |
<li><a href="#">Assembleia de Representantes</a></li> |
<li><a href="#">Conselho Directivo</a></li> |
/impl/src/web/layout/layoutintranet.jsp |
---|
11,25 → 11,7 |
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath()%>/css/intranet.css"/> |
<jsp:include page="/layout/scripts.jsp"/> |
<script type="text/javascript"> |
function horizontal() { |
var navItems = document.getElementById("menu_dropdown").getElementsByTagName("li"); |
for (var i=0; i< navItems.length; i++) { |
if(navItems[i].className == "submenu") |
{ |
if(navItems[i].getElementsByTagName('ul')[0] != null) |
{ |
navItems[i].onmouseover=function() { |
this.getElementsByTagName('ul')[0].style.display="block";} |
navItems[i].onmouseout=function() {this.getElementsByTagName('ul')[0].style.display="none";} |
} |
} |
} |
} |
</script> |
</head> |
<body class="small" marginwidth="0" marginheight="0" bgcolor="#ffffff" topmargin="0" leftmargin="0" onload="horizontal();"> |
<div id="body"> |
/impl/src/web/public/index.jsp |
---|
11,14 → 11,15 |
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
<% |
IServiceManager sm = ServiceManager.getInstance(); |
String subTarget=null; |
String subTarget = null; |
String[] names = new String[]{}; |
Object[] args = new Object[]{subTarget}; |
int topAnnouncements=1; |
int centerAnnouncements=1; |
int bottomAnnouncements=1; |
List<AnnouncementView> announcementViews = (List<AnnouncementView>) sm.execute(RequestUtils.getRequester(request), "LoadTargetMaxAnnouncements", args, names); |
int topAnnouncements = 1; |
int centerAnnouncements = 1; |
int bottomAnnouncements = 1; |
List<AnnouncementView> announcementViews = (List<AnnouncementView>) sm.execute(RequestUtils.getRequester(request, response), "LoadTargetMaxAnnouncements", args, names); |
request.setAttribute("Announcements", announcementViews); |
%> |
<jomm:messages/> |
137,8 → 138,6 |
<%if(bottomAnnouncements>1 && bottomAnnouncements<=Globals.NUMBER_ANNOUNCEMENT_TYPE_NEW_INDEX) |
{ |
%> |
</tr> |
</table> |
</div> |
<%}%> |
<%if(centerAnnouncements>1 && centerAnnouncements<=Globals.NUMBER_ANNOUNCEMENT_TYPE_BOTTOM_FLASH_NEWS_INDEX) |
/impl/src/web/public/portals/menuPortal.jsp |
---|
10,7 → 10,7 |
if(topNav.getTitle() != null) |
{ |
%> |
<div class="navLeftMenu"> |
<div class="linkMenuBlock"> |
<h2><%=MessageResources.getMessage(request, topNav.getTitle())%></h2> |
<% |
} |
/impl/src/web/public/announcements/announcementsPortalLeft.jsp |
---|
17,10 → 17,10 |
<%@ page contentType="text/html;charset=UTF-8" language="java" %> |
<% |
IServiceManager sm = ServiceManager.getInstance(); |
String subTarget=null; |
String subTarget = null; |
String[] names = new String[]{}; |
Object[] args = new Object[]{request.getParameter("role"), Globals.ANNOUNCEMENT_TYPE_TOP_FLASH_NEWS,subTarget}; |
List<AnnouncementView> announcementViews = (List<AnnouncementView>) sm.execute(RequestUtils.getRequester(request), "LoadRoleTypeMaxAnnouncements", args, names); |
Object[] args = new Object[]{request.getParameter("role"), Globals.ANNOUNCEMENT_TYPE_TOP_FLASH_NEWS, subTarget}; |
List<AnnouncementView> announcementViews = (List<AnnouncementView>) sm.execute(RequestUtils.getRequester(request, response), "LoadRoleTypeMaxAnnouncements", args, names); |
request.setAttribute("Announcements", announcementViews); |
%> |
/impl/src/web/public/announcements/getFlashNews.jsp |
---|
14,12 → 14,12 |
<% |
//String iterator = request.getParameter("iterator"); |
IServiceManager sm = ServiceManager.getInstance(); |
String subTarget=null; |
String subTarget = null; |
// String[] names = new String[]{"iterator"}; |
String[] names = new String[]{}; |
//Object[] arguments = new Object[]{Integer.parseInt(iterator)}; |
Object[] arguments = new Object[]{subTarget}; |
AnnouncementView announcementView = (AnnouncementView) sm.execute(RequestUtils.getRequester(request), "LoadTopFlashNewsIterate", arguments, names); |
AnnouncementView announcementView = (AnnouncementView) sm.execute(RequestUtils.getRequester(request, response), "LoadTopFlashNewsIterate", arguments, names); |
%> |
<table class="container"> |
<tr> |
/impl/src/web/public/announcements/loadAnnouncement.jsp |
---|
1,46 → 1,168 |
<%@ page import="jomm.utils.MessageResources" %> |
<%@ page import="org.apache.struts.util.RequestUtils" %> |
<%@ page import="pt.estgp.estgweb.domain.UserImpl" %> |
<%@ page import="pt.estgp.estgweb.domain.UserSessionImpl" %> |
<%@ page import="pt.estgp.estgweb.domain.enums.AnnouncementStyleEnum" %> |
<%@ page import="pt.estgp.estgweb.web.UserSessionProxy" %> |
<%@ 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/jomm.tld" prefix="jomm" %> |
<%@ 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/jomm.tld" prefix="jomm" %> |
<%@ taglib uri="/WEB-INF/tlds/estgweb.tld" prefix="estgweb" %> |
<jsp:useBean id="Announcement" type="pt.estgp.estgweb.domain.views.AnnouncementView" scope="request"/> |
<% UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request);%> |
<html:link href="http://www.sapo.pt"> </html:link> |
<% UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request, response);%> |
<html:link href="http://www.sapo.pt"></html:link> |
<div class="seccao"> |
<h2>${Announcement.title} |
<%if((userSession.getUser().getId()==Announcement.getOwnerID())||(userSession.getUser().getRoles().contains("all"))||(userSession.getUser().getRoles().contains("admin"))){%> |
<html:link action="/loadAnnouncement?id=${Announcement.id}&dispatch=edit"> Editar</html:link><%}%> |
</h2> |
<p> |
<% |
if(Announcement.getBigImage() != null) |
{ |
%> |
<div class="imageAnnouncement"> |
<img align="left" alt="<%=Announcement.getTitle()%>" src="<%=request.getContextPath()%>/imageStream/<%=Announcement.getBigImage().getId()%>"> |
</div> |
<% |
} |
else if(Announcement.getSmallImage() != null) |
<h2>${Announcement.title} |
<estgweb:canManage name="Announcement"> |
<html:link action="/loadAnnouncement?id=${Announcement.id}&dispatch=edit"> |
<bean:message key="edit"/> |
</html:link> |
<html:link action="/loadAnnouncement?id=${Announcement.id}&dispatch=delete">Apagar</html:link> |
</estgweb:canManage> |
</h2> |
<% |
AnnouncementStyleEnum styleEnum = Announcement.getStyleEnum(); |
String valign = "middle"; |
String align = "center"; |
if(styleEnum == AnnouncementStyleEnum.imgEmbeddedLeft || styleEnum == AnnouncementStyleEnum.imgTopLeft) |
align = "left"; |
else if(styleEnum == AnnouncementStyleEnum.imgEmbeddedRight || styleEnum == AnnouncementStyleEnum.imgTopRight) |
align = "right"; |
if (styleEnum == AnnouncementStyleEnum.imgLeftTop || styleEnum == AnnouncementStyleEnum.imgRightTop) |
valign = "top"; |
else if (styleEnum == AnnouncementStyleEnum.imgLeftBottom || styleEnum == AnnouncementStyleEnum.imgRightBottom) |
valign = "bottom"; |
if (styleEnum == AnnouncementStyleEnum.imgEmbeddedLeft || styleEnum == AnnouncementStyleEnum.imgEmbeddedRight) |
{ |
%> |
%> |
<p> |
<div class="imageAnnouncement"> |
<img align="left" alt="<%=Announcement.getTitle()%>" src="<%=request.getContextPath()%>/imageStream/<%=Announcement.getSmallImage().getId()%>"> |
<% |
if (Announcement.getBigImage() != null) |
{ |
%> |
<img align="<%=align%>" alt="<%=Announcement.getTitle()%>" |
src="<%=request.getContextPath()%>/imageStream/<%=Announcement.getBigImage().getId()%>"> |
<% |
} |
else if (Announcement.getSmallImage() != null) |
{ |
%> |
<img align="<%=align%>" alt="<%=Announcement.getTitle()%>" |
src="<%=request.getContextPath()%>/imageStream/<%=Announcement.getSmallImage().getId()%>"> |
<% |
} |
%> |
</div> |
${Announcement.formatedText} |
<% |
} |
%> |
${Announcement.text} |
<% |
if(Announcement.getUrl()!=null) |
if (Announcement.getUrl() != null) |
{ |
%> |
<html:link href="${Announcement.url}">Ver +</html:link> |
<% |
}%> |
</p> |
</p> |
<% |
} |
else if (styleEnum == AnnouncementStyleEnum.imgTop || styleEnum == AnnouncementStyleEnum.imgTopLeft || styleEnum == AnnouncementStyleEnum.imgTopRight) |
{ |
%> |
<table> |
<tr> |
<td align="<%=align%>"> |
<div class="imageAnnouncement"> |
<% |
if (Announcement.getBigImage() != null) |
{ |
%> |
<img alt="<%=Announcement.getTitle()%>" |
src="<%=request.getContextPath()%>/imageStream/<%=Announcement.getBigImage().getId()%>"> |
<% |
} |
else if (Announcement.getSmallImage() != null) |
{ |
%> |
<img alt="<%=Announcement.getTitle()%>" |
src="<%=request.getContextPath()%>/imageStream/<%=Announcement.getSmallImage().getId()%>"> |
<% |
} |
%> |
</div> |
</td> |
</tr> |
<tr> |
<td>${Announcement.formatedText}</td> |
</tr> |
</table> |
<% |
} |
else if (styleEnum == AnnouncementStyleEnum.imgLeft || styleEnum == AnnouncementStyleEnum.imgLeftTop || styleEnum == AnnouncementStyleEnum.imgLeftBottom) |
{ |
%> |
<table> |
<tr> |
<td valign="<%=valign%>"> |
<div class="imageAnnouncement"> |
<% |
if (Announcement.getBigImage() != null) |
{ |
%> |
<img alt="<%=Announcement.getTitle()%>" |
src="<%=request.getContextPath()%>/imageStream/<%=Announcement.getBigImage().getId()%>"> |
<% |
} |
else if (Announcement.getSmallImage() != null) |
{ |
%> |
<img alt="<%=Announcement.getTitle()%>" |
src="<%=request.getContextPath()%>/imageStream/<%=Announcement.getSmallImage().getId()%>"> |
<% |
} |
%> |
</div> |
</td> |
<td>${Announcement.formatedText}</td> |
</tr> |
</table> |
<% |
} |
else if (styleEnum == AnnouncementStyleEnum.imgRight || styleEnum == AnnouncementStyleEnum.imgRightTop || styleEnum == AnnouncementStyleEnum.imgRightBottom) |
{ |
%> |
<table> |
<tr> |
<td>${Announcement.formatedText}</td> |
<td valign="<%=valign%>"> |
<div class="imageAnnouncement"> |
<% |
if (Announcement.getBigImage() != null) |
{ |
%> |
<img alt="<%=Announcement.getTitle()%>" |
src="<%=request.getContextPath()%>/imageStream/<%=Announcement.getBigImage().getId()%>"> |
<% |
} |
else if (Announcement.getSmallImage() != null) |
{ |
%> |
<img alt="<%=Announcement.getTitle()%>" |
src="<%=request.getContextPath()%>/imageStream/<%=Announcement.getSmallImage().getId()%>"> |
<% |
} |
%> |
</div> |
</td> |
</tr> |
</table> |
<% |
} |
%> |
</div> |
/impl/src/web/public/announcements/announcements.jsp |
---|
9,10 → 9,10 |
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
<% |
IServiceManager sm = ServiceManager.getInstance(); |
String subTarget=null; |
String subTarget = null; |
String[] names = new String[]{}; |
Object[] args = new Object[]{subTarget}; |
List<AnnouncementView> announcementViews = (List<AnnouncementView>) sm.execute(RequestUtils.getRequester(request), "LoadTargetMaxAnnouncements", args, names); |
List<AnnouncementView> announcementViews = (List<AnnouncementView>) sm.execute(RequestUtils.getRequester(request, response), "LoadTargetMaxAnnouncements", args, names); |
request.setAttribute("Announcements", announcementViews); |
%> |
/impl/src/web/public/announcements/announcementsPortalRight.jsp |
---|
20,10 → 20,10 |
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
<% |
IServiceManager sm = ServiceManager.getInstance(); |
String subTarget=null; |
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), "LoadRoleTypeMaxAnnouncements", args, names); |
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); |
%> |
/impl/src/web/user/courses/topnavCourses.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("/Welcome.do", "Home"); |
topNav.addNavPlace(null, "courses"); |
%> |
<jsp:include page="/layout/topnav.jsp"/> |
/impl/src/web/user/courses/courses.jsp |
---|
1,26 → 1,10 |
<%@ page contentType="text/html;charset=UTF-8" language="java" %> |
<p>o espaço <b>eCadeiras</b> constitui um serviço de apoio às actividades lectivas dos cursos da ESTGP. |
O seu principal objectivo consiste em armazenar informação vital ao ensino e |
às actividades da Escola. |
</p> |
<div class="seccao"> |
<h1>Informação:</h1> |
<p>Já foi criada, para cada curso, a |
estrutura de apoio ao ano lectivo 2005.2006, nomeadamente:</p> |
<ul> |
<li>uma pasta para os programas</li> |
<li>uma <u>pasta para receber os conteúdos |
das disciplinas.</u></li> |
</ul> |
<p><i>Os conteúdos do ano lectivo |
2004.2005 continuam disponÃveis apenas para consulta, não podendo ser |
alterados.</i></p> |
<p>Os Docentes que necessitam de uma pasta |
para apoio a disciplinas para o próximo ano lectivo, podem solicitar a |
sua abertura ao Centro Informático.</p> |
<p>o espaço <b>eCadeiras</b> constitui um serviço de apoio às actividades lectivas dos cursos da ESTGP. |
O seu principal objectivo consiste em armazenar informação vital ao ensino e |
às actividades da Escola. |
</p> |
<div class="seccao"> |
<h1>Informação:</h1> |
<p>Já foi criada, para cada curso, a |
37,5 → 21,4 |
para apoio a disciplinas para o próximo ano lectivo, podem solicitar a |
sua abertura ao Centro Informático.</p> |
</div> |
</div> |
/impl/src/web/user/ftpclient/ftpclient.jsp |
---|
1,77 → 1,150 |
<%@ page import="org.apache.commons.net.ftp.FTPFile" %> |
<%@ page import="jomm.web.ftp.IFile" %> |
<%@ page import="java.util.List" %> |
<%@ page import="jomm.web.utils.NavPlace" %> |
<%@ page contentType="text/html;charset=UTF-8" language="java" %> |
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
<% |
List<IFile> iFiles = (List<IFile>) request.getAttribute("files"); |
%> |
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
<div id="topnav"> |
<ul> |
<% |
<div class="files"> |
<ul> |
<% |
for(IFile i: iFiles) |
{ |
if(i.isDirectory()) |
List<IFile> iFiles = (List<IFile>) request.getAttribute("files"); |
if (iFiles != null && iFiles.size() > 0) |
{ |
for (IFile iFile : iFiles) |
{ |
List<NavPlace> navPlaces = iFile.getNavPlaces(); |
String root = "../"; |
if(navPlaces.size() > 1) //if there is only one will be null because is the actual place |
{ |
root += navPlaces.get(0).getUrl(); |
} |
%> |
<li><img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/folder.gif"><a href="<%=i.getName()%>/"><%=i.getName()%></a></li> |
<li class="navPlace"> |
<a href="<%=root%>"><bean:message key="nav.place.root"/></a> / |
</li> |
<% |
} |
} |
for (NavPlace navPlace : navPlaces) |
{ |
if(navPlace.getUrl() == null) |
{ |
%> |
<li class="navPlace"> |
<%=navPlace.getKey()%> |
</li> |
<% |
for(IFile i: iFiles) |
{ |
if(!i.isDirectory()) |
{ |
} |
else |
{ |
%> |
<li> |
<li class="navPlace"> |
<a href="<%=navPlace.getUrl()%>"><%=navPlace.getKey()%></a> / |
</li> |
<% |
} |
} |
break; |
} |
} |
%> |
</ul> |
</div> |
<div class="files"> |
<ul> |
<% |
if(i.getName().endsWith("doc") || i.getName().endsWith("rtf")) |
for (IFile i : iFiles) |
{ |
if (i.isDirectory()) |
{ |
%> |
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/doc.gif"> |
<li><img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/folder.gif"> <a href="<%=i.getName()%>/"><%=i.getName()%></a></li> |
<% |
} |
} |
else if(i.getName().endsWith("pdf")) |
%> |
<% |
for (IFile i : iFiles) |
{ |
if (!i.isDirectory()) |
{ |
%> |
<li> |
<% |
if (i.getName().endsWith("doc") || i.getName().endsWith("rtf")) |
{ |
%> |
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/doc.gif"> |
<% |
} |
else if (i.getName().endsWith("pdf")) |
{ |
%> |
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/pdf.gif"> |
<% |
<% |
} |
else if(i.getName().endsWith("ppt")) |
else if (i.getName().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().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().endsWith("rar")) |
{ |
%> |
%> |
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/rar.gif"> |
<% |
<% |
} |
else if(i.getName().endsWith("txt")) |
else if (i.getName().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")) |
{ |
%> |
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/xls.gif"> |
<% |
} |
else if (i.getName().endsWith("txt")) |
{ |
%> |
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/txt.gif"> |
<% |
} |
else if (i.getName().endsWith("xml")) |
{ |
%> |
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/xml.gif"> |
<% |
} |
else |
{ |
%> |
<img alt="<%=i.getCompleteUrl()%>" src="<%=request.getContextPath()%>/imgs/mime/unknown.gif"> |
<% |
} |
%> |
<a href="<%=i.getCompleteUrl()%>"><%=i.getName()%> |
</a> |
</li> |
<% |
} |
} |
%> |
<a href="<%=i.getCompleteUrl()%>"><%=i.getName()%></a> |
</li> |
<% |
} |
} |
%> |
</ul> |
</ul> |
</div> |
/impl/etc/bugs/waiting/waiting.txt |
---|
--- impl/etc/bugs/resolved/resolved.txt (revision 0) |
+++ impl/etc/bugs/resolved/resolved.txt (revision 145) |
@@ -0,0 +1,34 @@ |
+2008-05-12 11:23:09,548 ERROR UserSessionFilter:doFilter():86 - java.lang.NullPointerException |
+java.lang.NullPointerException |
+ at pt.utl.ist.berserk.storage.FilterChainProxy.getExpression(FilterChainProxy.java:194) |
+ at pt.utl.ist.berserk.logic.filterManager.FilterBroker. |
+ at pt.utl.ist.berserk.logic.filterManager.FilterBrokerFactory.getFilterBroker(FilterBrokerFactory.java:171) |
+ at pt.utl.ist.berserk.logic.serviceManager.ServiceManager$ServiceConfiguration. |
+ at pt.utl.ist.berserk.logic.serviceManager.ServiceManager.registerService(ServiceManager.java:188) |
+ at pt.utl.ist.berserk.logic.serviceManager.ServiceManager.registerServices(ServiceManager.java:171) |
+ at pt.utl.ist.berserk.logic.serviceManager.ServiceManager. |
+ at pt.utl.ist.berserk.logic.serviceManager.ServiceManager.getInstance(ServiceManager.java:199) |
+ at pt.estgp.estgweb.web.UserSessionProxy.loadUserSession(UserSessionProxy.java:65) |
+ at pt.estgp.estgweb.web.filters.UserSessionFilter.doFilter(UserSessionFilter.java:53) |
+ at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) |
+ at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) |
+ at jomm.web.filter.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:49) |
+ at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) |
+ at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) |
+ at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) |
+ at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) |
+ at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) |
+ at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) |
+ at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) |
+ at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) |
+ at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874) |
+ at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) |
+ at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) |
+ at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) |
+ at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) |
+ at java.lang.Thread.run(Thread.java:595) |
+ |
+Resolução: |
+Filter Chain com nome diferente do especificado no serviço |
+ |
+######################################################################################################################################### |
\ No newline at end of file |
/impl/etc/todo/todo.txt |
---|
New file |
0,0 → 1,9 |
#### |
No startEditProfile temos de por uma TopNav |
>>>Aqui pode editar o seu perfil |
#### |
#### |
O Login ainda não vai procurar os users à base de dados |
#### |