/impl/importRoutines.xml |
---|
New file |
0,0 → 1,19 |
<?xml version="1.0" encoding="UTF-8"?> |
<project name="estgweb-import" basedir="." default="help"> |
<import file="build.xml"/> |
<target name="courses"> |
<java classname="pt.estgp.estgweb.services.sigesimports.ImportCourseService" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
</target> |
<target name="teachers"> |
<java classname="pt.estgp.estgweb.services.sigesimports.ImportTeachersService" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
</target> |
<target name="students"> |
<java classname="pt.estgp.estgweb.services.sigesimports.ImportStudentsService" classpath="${build.dir.classes}" classpathref="pathToToolsLib"/> |
</target> |
</project> |
/impl/conf/log4j.properties |
---|
26,7 → 26,7 |
#default category |
log4j.rootLogger = info, defaultLog, stdout |
log4j.rootLogger = @log.level@, defaultLog, stdout |
### enable the following line if you want to track down connection ### |
### leakages when using DriverManagerConnectionProvider ### |
/impl/conf/app.properties |
---|
59,6 → 59,10 |
sms.courseunit.announcement.only.profs=true |
sms.new.grades=true |
##################################################### |
## |
## Job Deamon seconds |
job.deamon.sleep.seconds=30 |
################################################## |
##Proxy Servers |
66,13 → 70,13 |
server.ionline=ftp://www.global.estgp.pt |
#server.ionline.start.path= |
#TODO USAR a de baixo quando testar as unidades curriculares |
server.ionline.start.path=/Eramus/Baco |
server.ionline.start.path= |
#server.ionline.start.path=/Eramus/Baco |
ionline.pass=baco |
ionline.user=Baco_web |
server.estgp=http://www.estgp.pt |
estgp.encoding=ISO-8859-1 |
#server.estgp.start.path=/templates |
server.estgp.start.path=/testes/nova_web |
#server.estgp=http://www.estgp.pt/testes/nova_web |
/impl/conf/hibernate.cfg.xml |
---|
10,15 → 10,17 |
<property name="connection.password">@database.password@</property> |
<property name="connection.autocommit">false</property> |
<property name="dialect">org.hibernate.dialect.MySQLDialect</property> |
<property name="hibernate.connection.autoReconnect">true</property> |
<property name="hibernate.connection.autoReconnectForPools">true</property> |
<property name="show_sql">@hibernate.show.sql@</property> |
<property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property> |
<property name="connection.pool_size">10</property> |
<!--<property name="connection.pool_size">2</property>--> |
<property name="hibernate.transaction.auto_close_session">true</property> |
<property name="hibernate.connection.release_mode ">after_transaction</property> |
<!--<property name="hibernate.c3p0.min_size">5</property>--> |
<!--<property name="hibernate.c3p0.max_size">20</property>--> |
<!--<property name="hibernate.c3p0.timeout">1800</property>--> |
<!--<property name="hibernate.max_statements">50</property>--> |
<property name="hibernate.connection.release_mode">after_transaction</property> |
<property name="hibernate.c3p0.min_size">2</property> |
<property name="hibernate.c3p0.max_size">30</property> |
<property name="hibernate.c3p0.timeout">500</property> |
<property name="hibernate.max_statements">50</property> |
<!--<property name="current_session_context_class">org.hibernate.context.CurrentSessionContext</property>--> |
29,4 → 31,4 |
{0} |
</session-factory> |
</hibernate-configuration> |
</hibernate-configuration> |
/impl/src/java/jomm/utils/StreamsUtils.java |
---|
37,6 → 37,7 |
public static void inputStream2File(InputStream stream, File f) throws IOException |
{ |
f.getParentFile().mkdirs(); |
FileOutputStream out = new FileOutputStream(f); |
inputStream2OutputStream(stream,out); |
} |
/impl/src/java/pt/estgp/estgweb/utils/Email.java |
---|
8,6 → 8,8 |
import java.util.Properties; |
import java.util.List; |
import java.util.ArrayList; |
import java.util.regex.Pattern; |
import java.util.regex.Matcher; |
import java.text.MessageFormat; |
import java.io.Serializable; |
64,4 → 66,28 |
{ |
return arguments; |
} |
public static boolean validEmail(String email) |
{ |
if(email == null) |
return false; |
Pattern p = Pattern.compile(".+@.+\\.[a-z]+"); |
//Match the given string with the pattern |
Matcher m = p.matcher(email); |
//check whether match is found |
return m.matches(); |
} |
public static void main( String[] args ) |
{ |
System.out.println(validEmail("")); |
System.out.println(validEmail("d.@")); |
System.out.println(validEmail("asd@.")); |
System.out.println(validEmail("a.sd@.p")); |
System.out.println(validEmail("@t.pt")); |
System.out.println(validEmail("e@.e")); |
System.out.println(validEmail("e@")); |
System.out.println(validEmail("e@e.pt")); |
System.out.println(validEmail("jmachado@estgp.pt")); |
} |
} |
/impl/src/java/pt/estgp/estgweb/Globals.java |
---|
146,6 → 146,7 |
public static final boolean SMS_COURSEUNIT_ANNOUNCEMENT_ONLY_PROFS = ConfigProperties.getBooleanProperty("sms.courseunit.announcement.only.profs"); |
public static final int JOB_DEAMON_SLEEP_SECONDS=ConfigProperties.getIntProperty("job.deamon.sleep.seconds"); |
public static final String MODULE_STATUS_PREFIX = "module."; |
public static final boolean MODULE_STATUS_ANNOUNCEMENTS = ConfigProperties.getBooleanProperty("module.announcements"); |
/impl/src/java/pt/estgp/estgweb/services/email/SendEmailService.java |
---|
47,19 → 47,27 |
// Create message |
MimeMessage message = new MimeMessage(session); |
// Set the recipients of the message |
for (String recipient : email.getRecipients()) { |
message.addRecipient(Message.RecipientType.TO, |
new InternetAddress(recipient)); |
boolean valid = false; |
for (String recipient : email.getRecipients()) |
{ |
if(Email.validEmail(recipient)) |
{ |
valid=true; |
message.addRecipient(Message.RecipientType.TO,new InternetAddress(recipient)); |
} |
} |
String content = TemplateUtils.getOrLoadTemplate(Globals.TEMPLATE_EMAIL_PATH + "/" + email.getEmailTemplateName()); |
// Format the mail message |
String fullMessage = MessageFormat.format(content, email.getArguments().toArray()); |
if(valid) |
{ |
String content = TemplateUtils.getOrLoadTemplate(Globals.TEMPLATE_EMAIL_PATH + "/" + email.getEmailTemplateName()); |
// Format the mail message |
String fullMessage = MessageFormat.format(content, email.getArguments().toArray()); |
message.setFrom(new InternetAddress(email.getFrom())); |
message.setSubject(email.getSubject()); |
message.setText(fullMessage); |
message.setFrom(new InternetAddress(email.getFrom())); |
message.setSubject(email.getSubject()); |
message.setText(fullMessage); |
Transport.send(message); |
Transport.send(message); |
} |
} |
catch(MessagingException e) |
{ |
142,7 → 150,8 |
List<String> recipients = new ArrayList<String>(); |
for(User u: users) |
{ |
recipients.add(u.getEmail()); |
if(Email.validEmail(u.getEmail())) |
recipients.add(u.getEmail()); |
} |
String subject = java.text.MessageFormat.format(subjectTxt,new String[]{announcement.getCourseUnit().getNormalizedName(),announcement.getTitle()}); |
/impl/src/java/pt/estgp/estgweb/services/jobs/JobDeamon.java |
---|
3,6 → 3,7 |
import org.apache.log4j.Logger; |
import pt.estgp.estgweb.domain.dao.DaoFactory; |
import pt.estgp.estgweb.domain.Job; |
import pt.estgp.estgweb.Globals; |
import jomm.dao.impl.AbstractDao; |
import java.util.List; |
34,7 → 35,7 |
j.setExecuted(true); |
} |
AbstractDao.getCurrentSession().getTransaction().commit(); |
Thread.sleep(3000); |
Thread.sleep(Globals.JOB_DEAMON_SLEEP_SECONDS*1000); |
} |
catch (InterruptedException e) |
{ |
/impl/src/java/pt/estgp/estgweb/services/blogs/CreateBlogService.java |
---|
2,6 → 2,7 |
import pt.utl.ist.berserk.logic.serviceManager.IService; |
import pt.estgp.estgweb.services.expceptions.ServiceException; |
import pt.estgp.estgweb.services.data.ImageManager; |
import pt.estgp.estgweb.domain.*; |
import pt.estgp.estgweb.domain.views.BlogView; |
import pt.estgp.estgweb.domain.dao.DaoFactory; |
36,6 → 37,11 |
Blog b; |
if(bV.getId() <= 0) |
{ |
if(bV.getImage() != null) |
{ |
DaoFactory.getImageDaoImpl().save(bV.getImage()); |
ImageManager.store((ImageImpl) bV.getImage()); |
} |
if(bV.getCourseUnitView() != null) |
{ |
CourseUnit c = DaoFactory.getCourseUnitDaoImpl().get(bV.getCourseUnitView().getId()); |
58,6 → 64,15 |
else |
{ |
b = DaoFactory.getBlogDaoImpl().get(bV.getSerializable()); |
if(bV.getImage() != null && b.getImage() != null) |
DaoFactory.getImageDaoImpl().delete(b.getImage().getId()); |
if(bV.getImage() != null) |
{ |
DaoFactory.getImageDaoImpl().save(bV.getImage()); |
ImageManager.store((ImageImpl) bV.getImage()); |
b.setImage(bV.getImage()); |
} |
} |
if(userSession.getUser() != null && userSession.getUser().isSuperuserOrAdmin()) |
bV.persistViewInObjectByAdmin(b); |
/impl/src/java/pt/estgp/estgweb/services/blogs/CreateBlogPostService.java |
---|
3,10 → 3,7 |
import pt.utl.ist.berserk.logic.serviceManager.IService; |
import pt.estgp.estgweb.domain.views.BlogView; |
import pt.estgp.estgweb.domain.views.BlogPostView; |
import pt.estgp.estgweb.domain.Blog; |
import pt.estgp.estgweb.domain.UserSession; |
import pt.estgp.estgweb.domain.DomainObjectFactory; |
import pt.estgp.estgweb.domain.BlogPostImpl; |
import pt.estgp.estgweb.domain.*; |
import pt.estgp.estgweb.domain.dao.DaoFactory; |
import pt.estgp.estgweb.services.expceptions.ServiceException; |
import pt.estgp.estgweb.services.data.ImageManager; |
54,13 → 51,9 |
DaoFactory.getImageDaoImpl().delete(bP.getImage().getId()); |
} |
if(bPV.getImage() != null) |
{ |
byte[] bytes = bPV.getImage().getImage(); |
bPV.getImage().setImage(null); |
{ |
DaoFactory.getImageDaoImpl().save(bPV.getImage()); |
bPV.getImage().setImage(bytes); |
ImageManager.store(bPV.getImage()); |
bPV.getImage().setImage(null); |
ImageManager.store((ImageImpl) bPV.getImage()); |
} |
/impl/src/java/pt/estgp/estgweb/services/data/ResourceManager.java |
---|
5,6 → 5,7 |
import java.io.*; |
import jomm.utils.StreamsUtils; |
import org.apache.log4j.Logger; |
/** |
* @author Jorge Machado |
14,15 → 15,48 |
public class ResourceManager |
{ |
public static final int DOCS_IN_PATH = 1000; |
public static final int DOCS_FIRST_DIR_LEN = 20; |
public static void saveResource(InputStream stream, String resourcePath, long id) throws IOException |
{ |
StreamsUtils.inputStream2File(stream,new File(Globals.DATA_DIR + resourcePath + "/" + id)); |
StreamsUtils.inputStream2File(stream, new File(Globals.DATA_DIR + resourcePath + getDocumentPathById(id))); |
} |
public static InputStream getResource(String resourcePath,long id) throws FileNotFoundException |
public static InputStream getResource(String resourcePath, long id) throws FileNotFoundException |
{ |
return new FileInputStream(Globals.DATA_DIR + resourcePath + "/" + id); |
return new FileInputStream(Globals.DATA_DIR + resourcePath + getDocumentPathById(id)); |
} |
public static void setAllChars(char c, char[] dir) |
{ |
for (int i = 0; i < dir.length; i++) |
{ |
dir[i] = c; |
} |
} |
public static void copyCharsToArray(char[] dir, String str) |
{ |
int dirLen = dir.length; |
int strLen = str.length(); |
for (int i = 0; i < strLen; i++) |
{ |
dir[dirLen - i - 1] = str.charAt(strLen - i - 1); |
} |
} |
public static String getDocumentPathById(long id) |
{ |
char[] dir = new char[DOCS_FIRST_DIR_LEN]; |
setAllChars('0', dir); |
long dirNumber = id / DOCS_IN_PATH; |
dirNumber = dirNumber * DOCS_IN_PATH; |
String dirNumberStr = "" + dirNumber; |
copyCharsToArray(dir, dirNumberStr); |
dirNumberStr = new String(dir); |
return "/" + dirNumberStr + "/" + id; |
} |
} |
/impl/src/java/pt/estgp/estgweb/services/data/ImageManager.java |
---|
1,6 → 1,7 |
package pt.estgp.estgweb.services.data; |
import pt.estgp.estgweb.domain.Image; |
import pt.estgp.estgweb.domain.ImageImpl; |
import java.io.ByteArrayInputStream; |
import java.io.IOException; |
19,10 → 20,12 |
private static final Logger logger = Logger.getLogger(ImageManager.class); |
public static boolean store(Image img) |
public static boolean store(ImageImpl img) |
{ |
try |
{ |
if(img.getId() <= 0) |
logger.error("Image arrive with out identifier: save it first"); |
ResourceManager.saveResource(new ByteArrayInputStream(img.getImage()), IMAGES_RESOURCE_PATH, img.getId()); |
return true; |
} |
/impl/src/java/pt/estgp/estgweb/services/announcements/CreateAnnouncementService.java |
---|
6,6 → 6,7 |
import pt.estgp.estgweb.services.jobs.JobScheduleService; |
import pt.estgp.estgweb.services.email.EMAILJob; |
import pt.estgp.estgweb.services.email.SendEmailService; |
import pt.estgp.estgweb.services.data.ImageManager; |
import pt.estgp.estgweb.domain.*; |
import pt.estgp.estgweb.domain.enums.LangEnum; |
import pt.estgp.estgweb.domain.dao.DaoFactory; |
49,6 → 50,19 |
announcementView.persistViewInObject(a); |
a.setOwner(userSession.getUser()); |
a.setSaveDate(new Date()); |
if(imageBig != null) |
{ |
DaoFactory.getImageDaoImpl().save(imageBig); |
ImageManager.store((ImageImpl) imageBig); |
((ImageImpl)imageBig).setImage(null); |
} |
if(imageSmall != null) |
{ |
DaoFactory.getImageDaoImpl().save(imageSmall); |
ImageManager.store((ImageImpl) imageSmall); |
((ImageImpl)imageSmall).setImage(null); |
} |
a.setBigImage(imageBig); |
a.setSmallImage(imageSmall); |
if(a.getTargetRoles() == null || a.getTargetRoles().length() == 0) |
56,18 → 70,23 |
} |
else |
{ |
a= DaoFactory.getAnnouncementDaoImpl().get(announcementView.getSerializable()); |
a = DaoFactory.getAnnouncementDaoImpl().get(announcementView.getSerializable()); |
if(imageBig != null) |
{ |
try |
if(a.getBigImage() != null) |
{ |
DaoFactory.getImageDaoImpl().delete(a.getBigImage().getId()); |
// try |
// { |
DaoFactory.getImageDaoImpl().delete(a.getBigImage().getId()); |
// } |
// catch(Exception e) |
// { |
// logger.info("Announcement:" + announcementView.getId() + "do not have imageBig!"); |
// } |
} |
catch(Exception e) |
{ |
logger.info("Announcement:" + announcementView.getId() + "do not have imageBig!"); |
} |
DaoFactory.getImageDaoImpl().save(imageBig); |
ImageManager.store((ImageImpl) imageBig); |
announcementView.setBigImage(imageBig); |
} |
else |
79,20 → 98,25 |
} |
catch(Exception e) |
{ |
logger.info("ImageBig form announcement:" + announcementView.getId() + "do not exist!"); |
logger.debug("ImageBig form announcement:" + announcementView.getId() + "do not exist!"); |
} |
} |
if(imageSmall!=null) |
{ |
try |
if(a.getSmallImage() != null) |
{ |
// try |
// { |
DaoFactory.getImageDaoImpl().delete(a.getSmallImage().getId()); |
// } |
// catch(Exception e) |
// { |
// logger.info("Announcement:" + announcementView.getId() + "do not have smallBig!"); |
// } |
} |
catch(Exception e) |
{ |
logger.info("Announcement:" + announcementView.getId() + "do not have smallBig!"); |
} |
DaoFactory.getImageDaoImpl().save(imageSmall); |
ImageManager.store((ImageImpl) imageSmall); |
announcementView.setSmallImage(imageSmall); |
} |
else |
/impl/src/java/pt/estgp/estgweb/domain/ImageImpl.java |
---|
10,9 → 10,22 |
*/ |
public class ImageImpl extends Image |
{ |
public Serializable getSerializable() |
private byte[] image; |
public Serializable getSerializable() |
{ |
return getId(); |
} |
public byte[] getImage() |
{ |
return image; |
} |
public void setImage(byte[] image) |
{ |
this.image = image; |
} |
} |
/impl/src/java/pt/estgp/estgweb/domain/views/UserView.java |
---|
358,6 → 358,25 |
return email; |
} |
public String getSafeEmail() |
{ |
if(email != null) |
{ |
String safe =email.replace("@", " [ AT ] ").replace("."," [ DOT ] "); |
StringBuilder result = new StringBuilder(); |
result.append("<script type=\"text/javascript\" language=\"JavaScript\">\n"); |
for(int i = 0;i< safe.length();i++) |
{ |
char c = safe.charAt(i); |
if(c != '\'') |
result.append("document.write('").append(c).append("');\n"); |
} |
result.append("</script>"); |
return result.toString(); |
} |
return email; |
} |
public void setEmail(String email) { |
this.email = email; |
} |
/impl/src/java/pt/estgp/estgweb/web/utils/ProxyUtils.java |
---|
20,32 → 20,39 |
public static String getTopImageLink(HttpServletRequest request) |
{ |
String pathIfo = request.getPathInfo(); |
String queryString = request.getQueryString(); |
if(request.getServletPath().equals("/proxy")) |
{ |
String finalFileCandidate1 = pathIfo.substring(0,pathIfo.lastIndexOf("/")) + "/top.jpg"; |
String finalFileCandidate2 = pathIfo.substring(0,pathIfo.lastIndexOf(".")) + ".jpg"; |
int lastIndexOfDot = pathIfo.lastIndexOf("."); |
String finalFileCandidate2 = null; |
if(lastIndexOfDot >= 0) |
finalFileCandidate2 = pathIfo.substring(0,lastIndexOfDot) + ".jpg"; |
String protocol = request.getRequestURL().substring(0,request.getRequestURL().indexOf("://")); |
String finalFileCandidate1total = protocol + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/proxy" + finalFileCandidate1; |
String finalFileCandidate2total = protocol + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/proxy" + finalFileCandidate2; |
String finalFileCandidate2total = null; |
if(finalFileCandidate2 != null) |
finalFileCandidate2total = protocol + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/proxy" + finalFileCandidate2; |
try |
{ |
URL url = new URL(finalFileCandidate2total); |
url.openConnection().getInputStream(); |
return request.getContextPath() + "/proxy" + finalFileCandidate2; |
} |
catch (MalformedURLException e) |
{ |
logger.error("BAD TOP IMAGE URL 2: " + finalFileCandidate2total); |
} |
catch (IOException e) |
{ |
logger.debug("candidate 2 don't exist: " + finalFileCandidate2total); |
} |
if(finalFileCandidate2 != null) |
try |
{ |
URL url = new URL(finalFileCandidate2total); |
url.openConnection().getInputStream(); |
return request.getContextPath() + "/proxy" + finalFileCandidate2; |
} |
catch (MalformedURLException e) |
{ |
logger.error("BAD TOP IMAGE URL 2: " + finalFileCandidate2total); |
} |
catch (IOException e) |
{ |
logger.debug("candidate 2 don't exist: " + finalFileCandidate2total); |
} |
try |
{ |
/impl/src/java/pt/estgp/estgweb/web/utils/DomainUtils.java |
---|
2,6 → 2,7 |
import pt.estgp.estgweb.domain.Image; |
import pt.estgp.estgweb.domain.DomainObjectFactory; |
import pt.estgp.estgweb.domain.ImageImpl; |
import org.apache.struts.upload.FormFile; |
import org.apache.log4j.Logger; |
import jomm.utils.StreamsUtils; |
30,7 → 31,7 |
logger.error(e,e); |
return null; |
} |
Image i = DomainObjectFactory.createImageImpl(); |
ImageImpl i = DomainObjectFactory.createImageImpl(); |
i.setImage(bytes); |
i.setContentType(image.getContentType()); |
i.setSize(image.getFileSize()); |
/impl/src/java/pt/estgp/estgweb/web/ImageStream.java |
---|
1,7 → 1,9 |
package pt.estgp.estgweb.web; |
import pt.estgp.estgweb.domain.Image; |
import pt.estgp.estgweb.domain.ImageImpl; |
import pt.estgp.estgweb.domain.dao.impl.ImageDaoImpl; |
import pt.estgp.estgweb.domain.dao.DaoFactory; |
import pt.estgp.estgweb.services.data.ImageManager; |
import java.io.*; |
33,7 → 35,7 |
long id = Long.parseLong(imageRequarired.trim()); |
AbstractDao.getCurrentSession().beginTransaction(); |
Image image = new ImageDaoImpl().get(id); |
ImageImpl image = (ImageImpl) DaoFactory.getImageDaoImpl().get(id); |
try |
{ |
response.setContentType(image.getContentType()); |
/impl/src/java/pt/utl/ist/berserk/storage/hibernate/HibernateTransactionBroker.java |
---|
41,7 → 41,7 |
public void commitTransaction() throws StorageException |
{ |
HibernateUtils.getCurrentSession().getTransaction().commit(); |
HibernateUtils.getCurrentSession().close(); |
// HibernateUtils.getCurrentSession().close(); |
} |
50,7 → 50,7 |
Session sess = HibernateUtils.getCurrentSession(); |
Transaction t = sess.getTransaction(); |
t.rollback(); |
sess.close(); |
// sess.close(); |
} |
public void lockRead(List list) throws StorageException |
/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 |
---|
16,6 → 16,7 |
<property name="superuser" type="boolean"/> |
<property name="name" type="string" index="nameIndex"/> |
<property name="roles" type="string" index="rolesIndex"/> |
<many-to-one name="image" column="image" class="pt.estgp.estgweb.domain.Image" lazy="no-proxy" outer-join="false" cascade="all"/> |
<subclass name="pt.estgp.estgweb.domain.GenericUserImpl"> |
<subclass name="pt.estgp.estgweb.domain.Group"> |
<meta attribute="scope-class">public abstract</meta> |
53,15 → 54,15 |
<key column="user_id"/> |
<one-to-many class="pt.estgp.estgweb.domain.CourseUserAssociation"/> |
</set> |
<set name="creatorRecords" lazy="true" order-by="recordId" table="creatorRecords"> |
<set name="creatorRecords" lazy="true" order-by="recordId" table="creatorrecords"> |
<key column="creatorId"/> |
<many-to-many class="pt.estgp.estgweb.domain.Record" column="recordId"/> |
</set> |
<set name="contributorRecords" lazy="true" order-by="recordId" table="contributorRecords"> |
<set name="contributorRecords" lazy="true" order-by="recordId" table="contributorrecords"> |
<key column="contributorId"/> |
<many-to-many class="pt.estgp.estgweb.domain.Record" column="recordId"/> |
</set> |
<set name="managedIdentifierCollectionsManager" lazy="true" table="managedIdentifierCollectionManagers"> |
<set name="managedIdentifierCollectionsManager" lazy="true" table="managedidentifiercollectionmanagers"> |
<key column="managerId"/> |
<many-to-many class="pt.estgp.estgweb.domain.ManagedIdentifierCollection" column="collectionId"/> |
</set> |
97,7 → 98,7 |
<property name="unitCheck" type="boolean"/> |
<property name="academicDegree" type="string"/> |
<property name="localRemovedTeachedUnits" type="string"/> |
<set name="teachedUnits" lazy="true" order-by="courseUnitId" table="teachedUnits"> |
<set name="teachedUnits" lazy="true" order-by="courseUnitId" table="teachedunits"> |
<key column="teacherId"/> |
<many-to-many class="pt.estgp.estgweb.domain.CourseUnit" column="courseUnitId"/> |
</set> |
/impl/src/hbm/pt/estgp/estgweb/domain/Record.hbm.xml |
---|
4,7 → 4,7 |
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> |
<hibernate-mapping> |
<class name="pt.estgp.estgweb.domain.Record" table="profileRecord" abstract="true"> |
<class name="pt.estgp.estgweb.domain.Record" table="profilerecord" abstract="true"> |
<meta attribute="extends">pt.estgp.estgweb.domain.OwnedDomainObject</meta> |
<meta attribute="scope-class">public abstract</meta> |
<id name="id" type="long"> |
24,11 → 24,11 |
<property name="identifier" type="string"/> |
<property name="repositoryStream" type="string" index="repositoryStreamIndex"/> |
<many-to-one name="owner" class="pt.estgp.estgweb.domain.GenericUser" lazy="false" outer-join="true"/> |
<set name="creators" lazy="true" table="creatorRecords"> |
<set name="creators" lazy="true" table="creatorrecords"> |
<key column="recordId"/> |
<many-to-many class="pt.estgp.estgweb.domain.User" column="creatorId"/> |
</set> |
<set name="contributors" lazy="true" table="contributorRecords"> |
<set name="contributors" lazy="true" table="contributorrecords"> |
<key column="recordId"/> |
<many-to-many class="pt.estgp.estgweb.domain.User" column="contributorId"/> |
</set> |
/impl/src/hbm/pt/estgp/estgweb/domain/RepositoryFile.hbm.xml |
---|
4,7 → 4,7 |
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> |
<hibernate-mapping> |
<class name="pt.estgp.estgweb.domain.RepositoryFile" table="repositoryFile" abstract="true"> |
<class name="pt.estgp.estgweb.domain.RepositoryFile" table="repositoryfile" abstract="true"> |
<meta attribute="extends">pt.estgp.estgweb.domain.OwnedDomainObject</meta> |
<meta attribute="scope-class">public abstract</meta> |
<id name="id" type="long"> |
24,7 → 24,7 |
<subclass name="pt.estgp.estgweb.domain.RepositoryFileImpl" discriminator-value="RepositoryFileImpl"/> |
</class> |
<class name="pt.estgp.estgweb.domain.RepositoryFileVersion" table="repositoryFileVersion" abstract="true"> |
<class name="pt.estgp.estgweb.domain.RepositoryFileVersion" table="repositoryfileversion" abstract="true"> |
<meta attribute="extends">pt.estgp.estgweb.domain.DomainSerializableObject</meta> |
<meta attribute="scope-class">public abstract</meta> |
<id name="id" type="long"> |
/impl/src/hbm/pt/estgp/estgweb/domain/Image.hbm.xml |
---|
17,7 → 17,6 |
<property name="contentType" type="string"/> |
<property name="size" type="int"/> |
<property name="description" type="text"/> |
<property name="image" type="binary" length="4194304"/> |
<subclass name="pt.estgp.estgweb.domain.ImageImpl" discriminator-value="ImageImpl"/> |
</class> |
</hibernate-mapping> |
/impl/src/hbm/pt/estgp/estgweb/domain/CourseUnit.hbm.xml |
---|
4,7 → 4,7 |
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> |
<hibernate-mapping> |
<class name="pt.estgp.estgweb.domain.CourseUnit" table="courseUnit" abstract="true"> |
<class name="pt.estgp.estgweb.domain.CourseUnit" table="courseunit" abstract="true"> |
<meta attribute="extends">pt.estgp.estgweb.domain.DomainSerializableObject</meta> |
<meta attribute="scope-class">public abstract</meta> |
<id name="id" type="long"> |
31,7 → 31,7 |
<key column="courseUnit"/> |
<one-to-many class="pt.estgp.estgweb.domain.CourseUnitBlog" /> |
</set> |
<set name="teachers" lazy="true" table="teachedUnits"> |
<set name="teachers" lazy="true" table="teachedunits"> |
<key column="courseUnitId"/> |
<many-to-many class="pt.estgp.estgweb.domain.TeacherImpl" column="teacherId"/> |
</set> |
54,7 → 54,7 |
<subclass name="pt.estgp.estgweb.domain.CourseUnitImpl" discriminator-value="CourseUnitImpl"/> |
</class> |
<class name="pt.estgp.estgweb.domain.CourseUnitQuestion" table="courseUnitQuestion" abstract="true"> |
<class name="pt.estgp.estgweb.domain.CourseUnitQuestion" table="courseunitquestion" abstract="true"> |
<meta attribute="extends">pt.estgp.estgweb.domain.OwnedDomainObject</meta> |
<meta attribute="scope-class">public abstract</meta> |
<id name="id" type="long"> |
71,7 → 71,7 |
<subclass name="pt.estgp.estgweb.domain.CourseUnitQuestionImpl" discriminator-value="CourseUnitQuestionImpl"/> |
</class> |
<class name="pt.estgp.estgweb.domain.CourseUnitAssignement" table="courseUnitAssignement" abstract="true"> |
<class name="pt.estgp.estgweb.domain.CourseUnitAssignement" table="courseunitassignement" abstract="true"> |
<meta attribute="extends">pt.estgp.estgweb.domain.DomainSerializableObject</meta> |
<meta attribute="scope-class">public abstract</meta> |
<id name="id" type="long"> |
95,7 → 95,7 |
<subclass name="pt.estgp.estgweb.domain.CourseUnitAssignementImpl" discriminator-value="CourseUnitAssignementImpl"/> |
</class> |
<class name="pt.estgp.estgweb.domain.CourseUnitDeliverable" table="courseUnitDeliverable" abstract="true"> |
<class name="pt.estgp.estgweb.domain.CourseUnitDeliverable" table="courseunitdeliverable" abstract="true"> |
<meta attribute="extends">pt.estgp.estgweb.domain.DomainSerializableObject</meta> |
<meta attribute="scope-class">public abstract</meta> |
<id name="id" type="long"> |
113,7 → 113,7 |
<subclass name="pt.estgp.estgweb.domain.CourseUnitDeliverableImpl" discriminator-value="CourseUnitDeliverableImpl"/> |
</class> |
<class name="pt.estgp.estgweb.domain.CourseUnitGrade" table="courseUnitGrade" abstract="true"> |
<class name="pt.estgp.estgweb.domain.CourseUnitGrade" table="courseunitgrade" abstract="true"> |
<meta attribute="extends">pt.estgp.estgweb.domain.DomainSerializableObject</meta> |
<meta attribute="scope-class">public abstract</meta> |
<id name="id" type="long"> |
132,7 → 132,7 |
<subclass name="pt.estgp.estgweb.domain.CourseUnitGradeImpl" discriminator-value="CourseUnitGradeImpl"/> |
</class> |
<!--<class name="pt.estgp.estgweb.domain.CourseUnit" table="courseUnitAssignement" abstract="true">--> |
<!--<class name="pt.estgp.estgweb.domain.CourseUnit" table="courseunitassignement" abstract="true">--> |
<!--<meta attribute="extends">pt.estgp.estgweb.domain.DomainSerializableObject</meta>--> |
<!--<meta attribute="scope-class">public abstract</meta>--> |
<!--<id name="id" type="long">--> |
/impl/src/hbm/pt/estgp/estgweb/domain/IdentifiersManagement.hbm.xml |
---|
4,7 → 4,7 |
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> |
<hibernate-mapping> |
<class name="pt.estgp.estgweb.domain.ManagedIdentifier" table="managedIdentifier" abstract="true"> |
<class name="pt.estgp.estgweb.domain.ManagedIdentifier" table="managedidentifier" abstract="true"> |
<meta attribute="extends">pt.estgp.estgweb.domain.OwnedDomainObject</meta> |
<meta attribute="scope-class">public abstract</meta> |
<id name="id" type="long"> |
20,7 → 20,7 |
<subclass name="pt.estgp.estgweb.domain.ManagedIdentifierImpl" discriminator-value="ManagedIdentifierImpl"/> |
</class> |
<class name="pt.estgp.estgweb.domain.ManagedIdentifierCollection" table="managedIdentifierCollection" abstract="true"> |
<class name="pt.estgp.estgweb.domain.ManagedIdentifierCollection" table="managedidentifiercollection" abstract="true"> |
<meta attribute="extends">pt.estgp.estgweb.domain.OwnedDomainObject</meta> |
<meta attribute="scope-class">public abstract</meta> |
<id name="id" type="long"> |
33,7 → 33,7 |
<property name="sequenceNumber" type="long"/> |
<property name="description" type="text"/> |
<many-to-one name="owner" class="pt.estgp.estgweb.domain.GenericUser" lazy="false" outer-join="true"/> |
<set name="managers" lazy="true" table="managedIdentifierCollectionManagers"> |
<set name="managers" lazy="true" table="managedIdentifiercollectionmanagers"> |
<key column="collectionId"/> |
<many-to-many class="pt.estgp.estgweb.domain.User" column="managerId"/> |
</set> |
/impl/src/web/admin/courseunits/courseunit.jsp |
---|
84,11 → 84,11 |
<bean:message key="courseunit.teachers"/> |
</th> |
<td> |
<logic:lessEqual value="0" name="courseunit.id"> |
<logic:lessEqual value="0" name="CourseUnitView" property="id"> |
<i><bean:message key="courseunit.to.add.teachers.save.first"/></i> |
</logic:lessEqual> |
<logic:greaterThan value="0" name="courseunit.id"> |
<logic:greaterThan value="0" name="CourseUnitView" property="id"> |
<html:select property="teacherId"> |
<logic:present name="CourseUnitsForm" property="teachers"> |
<logic:iterate id="teacher" name="CourseUnitsForm" property="teachers" type="pt.estgp.estgweb.domain.views.UserView"> |
128,11 → 128,11 |
</th> |
<td> |
<logic:lessEqual value="0" name="courseunit.id"> |
<logic:lessEqual value="0" name="CourseUnitView" property="id"> |
<i><bean:message key="courseunit.to.add.students.save.first"/></i> |
</logic:lessEqual> |
<logic:greaterThan value="0" name="courseunit.id"> |
<logic:greaterThan value="0" name="CourseUnitView" property="id"> |
<html:text styleClass="text" property="studentCode"/> |
<input type="button" value="<bean:message key="add"/>" |
onclick="set(this.form,'addStudent');this.form.submit();"> |
/impl/src/web/js/functions.js |
---|
71,3 → 71,5 |
{ |
return confirm(msg); |
} |
/impl/src/web/public/profile/profileHome.jsp |
---|
81,7 → 81,7 |
<bean:message key="email.institucion"/> |
</th> |
<td> |
<bean:write name="ProfileForm" property="userView.email"/> |
${ProfileForm.userView.safeEmail} |
</td> |
</tr> |
/impl/src/web/user/courseunits/courseunit.jsp |
---|
85,7 → 85,7 |
<html:link action="${user}/startLoadTeacherCourseUnit${fromAction}?code=${teacher.code}&courseUnitView.id=${CourseUnitView.id}">${teacher.name}</html:link> |
</td> |
<td> |
${teacher.email} |
${teacher.safeEmail} |
</td> |
</tr> |
</logic:iterate> |
/impl/src/web/user/courseunits/students.jsp |
---|
44,7 → 44,7 |
${student.username} |
</td> |
<td> |
${student.email} |
${student.safeEmail} |
</td> |
</tr> |
</logic:iterate> |
/impl/build.properties |
---|
11,7 → 11,7 |
database.catalog=estgweb |
database.username=root |
database.password= |
database.connection.url=jdbc:mysql://${database.host}:${database.port}/${database.catalog}?useUnicode=true&characterEncoding=UTF-8 |
database.connection.url=jdbc:mysql://${database.host}:${database.port}/${database.catalog}?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true |
hibernate.show.sql=false |
use.ldap=true |
104,7 → 104,8 |
log4j.properties=${conf.dir}/${log4j.properties.filename} |
#log file confirguration |
log.file=${data.dir}/estgweb.log |
log.file=${data.dir}/../estgweb-local.log |
log.level=info |
#email templates |
email.templates.dir=/template/email |
175,4 → 176,4 |
#Google Service Specific Configuration |
ws.google.package=com.google.api.ws.clients |
ws.google.package=com.google.api.ws.clients |
/impl/build.xml |
---|
1,4 → 1,4 |
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
<project name="estgweb" basedir="." default="help"> |
29,6 → 29,8 |
--> |
<!--caso queiramos apagar os pregen hbm delPreGenAppScripts--> |
<target name="all" depends="clean,initDirs,createConfigurationFiles,generateHibernateDomainObjects,generateHibernateDaoClasses,build,generateHibernateSql,build.war,dbInit"/> |
<target name="allWebNode" depends="clean,initDirs,createConfigurationFiles,generateHibernateDomainObjects,generateHibernateDaoClasses,build.war"/> |
<target name="dataNode" depends="clean,initDirs,createConfigurationFiles,generateHibernateDomainObjects,generateHibernateDaoClasses,build,generateHibernateSql"/> |
<!-- |
98,19 → 100,19 |
<target name="tomcat.redeployContext" depends="tomcat.undeploy,build.war" > |
<echo message="${tomcat.manager}"/> |
<tomcat.install url="${tomcat.manager}" path="${tomcat.context.path.install}" |
config="file:/${basedir}/${dist.dir}/estgweb.xml" |
config="file:${basedir}/${dist.dir}/estgweb.xml" |
username="${tomcat.username}" password="${tomcat.password}" /> |
</target> |
<target name="tomcat.deploy" depends="build.war" > |
<echo message="${tomcat.manager}"/> |
<target name="tomcat.deploy" depends="war" > |
<echo message="${tomcat.manager} path:${tomcat.context.path.install} warfile:file:${basedir}/${dist.dir}/${tomcat.war.file}"/> |
<tomcat.deploy url="${tomcat.manager}" path="${tomcat.context.path.install}" |
war="file:/${basedir}/${dist.dir}/${tomcat.war.file}" |
war="file:${basedir}/${dist.dir}/${tomcat.war.file}" |
username="${tomcat.username}" password="${tomcat.password}" /> |
</target> |
<target name="tomcat.redeploy" depends="tomcat.undeploy,build.war"> |
<echo message="${tomcat.manager}"/> |
<target name="tomcat.redeploy" depends="tomcat.undeploy,war"> |
<echo message="${tomcat.manager} path:${tomcat.context.path.install} warfile:file:${basedir}/${dist.dir}/${tomcat.war.file}"/> |
<tomcat.deploy url="${tomcat.manager}" path="${tomcat.context.path.install}" |
war="file:/${basedir}/${dist.dir}/${tomcat.war.file}" |
war="file:${basedir}/${dist.dir}/${tomcat.war.file}" |
username="${tomcat.username}" password="${tomcat.password}" /> |
</target> |
<target name="tomcat.undeploy"> |
144,7 → 146,7 |
<antcall target="createConfigurationFiles"/> |
</target> |
<target name="compile" depends="initDirs" description="Compile All"> |
<javac encoding="UTF-8" source="1.5" target="1.5" destdir="${build.dir.classes}" debug="false" optimize="true" fork="true" deprecation="false" verbose="false" failonerror="true"> |
<javac encoding="UTF-8" source="1.5" target="1.5" destdir="${build.dir.classes}" debug="true" optimize="true" fork="true" deprecation="true" verbose="true" failonerror="true"> |
<src path="${src.dir}"/> |
<src path="${gen.dir.java}"/> |
<classpath refid="pathToToolsLib"/> |
195,7 → 197,7 |
</replace> |
</target> |
<target name="build.war" depends="build,dist" description="Make war distribution"> |
<target name="build.war" depends="dist" description="Make war distribution"> |
<mkdir dir="${build.dir.war}"/> |
<mkdir dir="${build.dir.war}/WEB-INF"/> |
<mkdir dir="${build.dir.war}/WEB-INF/lib"/> |
374,6 → 376,7 |
</replace> |
<replace file="${build.dir.classes}/${log4j.properties.filename}"> |
<replacefilter token="@log.file@" value="${log.file}"/> |
<replacefilter token="@log.level@" value="${log.level}"/> |
</replace> |
<replace file="${build.dir.scripts}/${scripts.setenv.file}"> |
<replacefilter token="@tomcat.home@" value="${tomcat.home}"/> |