Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 722 → Rev 726

/impl/conf/language/MessageResources.properties
168,6 → 168,7
Others=Outras Ligações
authenticate=Intranet
logout=Sair
submit.comunicationfolder=Pasta de comunicação
submit.announcement=Colocar Anúncio
submit.todo.announcement=Colocar a fazer
todo.announcement=A fazer
/impl/conf/WEB-INF/struts/struts-default.xml
202,7 → 202,8
/WEB-INF/struts/tiles-reminders.xml,
/WEB-INF/struts/tiles-managedidentifier.xml,
/WEB-INF/struts/tiles-srusource.xml,
/WEB-INF/struts/tiles-survey.xml"/> <!-- Duarte Santos -->
/WEB-INF/struts/tiles-survey.xml,
/WEB-INF/struts/tiles-comunicationfolder.xml"/> <!-- Duarte Santos -->
</plug-in>
 
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
/impl/conf/WEB-INF/struts/struts-comunicationfolder.xml
New file
0,0 → 1,43
<?xml version="1.0" encoding="UTF-8"?>
 
<!--<!DOCTYPE struts-config PUBLIC-->
<!--"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"-->
<!--"http://struts.apache.org/dtds/struts-config_1_3.dtd">-->
 
<struts-config>
 
<form-beans>
<form-bean type="pt.estgp.estgweb.web.form.comunicationfolder.ComunicationFolderForm" name="ComunicationFolderForm"/>
</form-beans>
 
<global-exceptions>
 
</global-exceptions>
 
<global-forwards>
 
</global-forwards>
 
<action-mappings>
 
<!--<action path="/user/startSubmitBlogFromServiceZone" forward="/user/blogsControllerFromServiceZone.do?dispatch=start&amp;from=ServiceZone"/>-->
<!--<action path="/user/startDeleteBlogFromServiceZone" forward="/user/blogsControllerFromServiceZone.do?dispatch=delete&amp;from=ServiceZone"/>-->
<!--<action path="/user/startEditBlogFromServiceZone" forward="/user/blogsControllerFromServiceZone.do?dispatch=edit&amp;from=ServiceZone"/>-->
<!--<action path="/user/startLoadBlogFromServiceZone" forward="/user/blogsControllerFromServiceZone.do?dispatch=load&amp;from=ServiceZone"/>-->
<!--<action path="/user/startLoadBlogMonthFromServiceZone" forward="/user/blogsControllerFromServiceZone.do?dispatch=loadMonth&amp;from=ServiceZone"/>-->
<action path="/user/comunicationfolderController"
type="pt.estgp.estgweb.web.controllers.comunicationfolder.ComunicationFolderController"
name="ComunicationFolderForm"
scope="request"
parameter="dispatch"
validate="false"
input="page.separators.serviceZone">
<forward name="comunicationFolder" path="page.submit.comunicationfolder.from.serviceZone"/>
<!--<forward name="submit" path="page.submit.blog.from.serviceZone"/>-->
<!--<forward name="loadMonth" path="page.load.blog.month.from.serviceZone"/>-->
<forward name="from.add.role" path="page.submit.comunicationfolder.from.serviceZone"/>
</action>
 
</action-mappings>
 
</struts-config>
/impl/conf/WEB-INF/struts/tiles-comunicationfolder.xml
New file
0,0 → 1,15
<?xml version="1.0" encoding="UTF-8" ?>
 
<!--<!DOCTYPE tiles-definitions PUBLIC-->
<!--"-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"-->
<!--"http://struts.apache.org/dtds/tiles-config_1_1.dtd">-->
 
<tiles-definitions>
 
<definition name="page.submit.comunicationfolder.from.serviceZone" extends="page.separators.serviceZone">
<put name="title" value="Pastas de comunicação"/>
<put name="topnav" value="/user/serviceZone/topnavCreateComunicationFolder.jsp"/>
<put name="body" value="/admin/comunicationfolder/comunicationfolder.jsp"/>
</definition>
</tiles-definitions>
/impl/conf/WEB-INF/web.xml
145,7 → 145,8
/WEB-INF/struts/struts-reminders.xml,
/WEB-INF/struts/struts-managedidentifier.xml,
/WEB-INF/struts/struts-srusource.xml,
/WEB-INF/struts/struts-survey.xml <!-- Duarte Santos -->
/WEB-INF/struts/struts-survey.xml, <!-- Duarte Santos -->
/WEB-INF/struts/struts-comunicationfolder.xml
</param-value>
</init-param>
<init-param>
/impl/conf/app.properties
9,6 → 9,7
user.session.timeout.minutes=60
site.url=@site.url@
 
import.year=201213
 
email.local.suffix=estgp.pt
email.server=localhost
398,6 → 399,8
#importSecondYearFormat {1}
importFinalFormat={0}{1}
 
importFinalFormatProgram={0}/{1}
 
importFirstYearFormatIntranet=yyyy
importSecondYearFormatIntranet=yyyy
importFinalFormatIntranet=AnoLectivo.{0}-{1}
/impl/src/java/jomm/utils/PdfUtils.java
New file
0,0 → 1,128
package jomm.utils;
 
import org.apache.fop.apps.*;
 
import javax.xml.transform.*;
import javax.xml.transform.sax.SAXResult;
import javax.xml.transform.stream.StreamSource;
import java.io.*;
import java.net.URL;
import java.util.Hashtable;
import java.util.Map;
 
/**
* User: ngraca
* Date: 2/4/11
* Time: 12:51 PM
*/
public class PdfUtils {
 
// public static void createPdfFromXml(File xmlFile, File xslFile, File pdfFile) throws IOException, FOPException, TransformerException {
// createPdfFromXml(xmlFile, xslFile, pdfFile, null);
// }
 
// public static void createPdfFromXml(File xmlFile, File xslFile, File pdfFile, Map<String, Object> params) throws IOException, FOPException, TransformerException {
// OutputStream out = null;
// try {
// out = new FileOutputStream(pdfFile);
// createPdfFromXml(new StreamSource(xmlFile), xslFile.getAbsolutePath(), out, params);
// }
// finally {
// assert out != null;
// out.close();
// }
// }
 
public static void createPdfFromXml(Source xmlFile, String xslFile, OutputStream pdfFile) throws IOException, FOPException, TransformerException {
createPdfFromXml(xmlFile, xslFile, pdfFile, null);
}
 
// public static void createPdfFromXml(Source xmlFile, String xslFile, File pdfFile) throws IOException, FOPException, TransformerException {
// OutputStream out = null;
// try {
// out = new FileOutputStream(pdfFile);
// createPdfFromXml(xmlFile, xslFile, out, null);
// }
// finally {
// assert out != null;
// out.close();
// }
// }
//
//
 
 
private static TransformerFactory transFact = TransformerFactory.newInstance();
private static Map<String, Templates> templates = new Hashtable<String, Templates>();
 
private static Transformer getTransformer(String xsltFile, boolean cache) throws TransformerConfigurationException, IOException {
Templates tpl = null;
if (cache)
tpl = templates.get(xsltFile);
if (tpl == null) {
// System.out.println("PdfUtils: Entrou no getTransformer");
URL url = Thread.currentThread().getContextClassLoader().getResource(xsltFile);
Source xsltSource;
if(xsltFile.indexOf("http://")>=0 || xsltFile.indexOf("ftp://")>=0 || xsltFile.indexOf("https://")>= 0)
xsltSource = new StreamSource(new File(url.getPath()));
else
xsltSource = new StreamSource(new File( url.getPath().replace("%20"," ")));
tpl = transFact.newTemplates(xsltSource);
templates.put(xsltFile, tpl);
}
return tpl.newTransformer();
 
}
 
public static void createPdfFromXml(Source xmlFile, String xslFile, OutputStream pdfFile, Map<String, Object> params) throws IOException, FOPException, TransformerException {
// configure fopFactory as desired
FopFactory fopFactory = FopFactory.newInstance();
 
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
// configure foUserAgent as desired
 
// Setup output
OutputStream out = new BufferedOutputStream(pdfFile);
 
// Construct fop with desired output format
Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out);
 
// Setup XSLT
 
Transformer transformer = getTransformer(xslFile,false);
 
if (params != null)
for (Map.Entry<String, Object> entry : params.entrySet()) {
transformer.setParameter(entry.getKey(), entry.getValue());
}
 
// Resulting SAX events (the generated FO) must be piped through to FOP
Result res = new SAXResult(fop.getDefaultHandler());
 
// Start XSLT transformation and FOP processing
transformer.transform(xmlFile, res);
 
out.close();
}
 
 
public static void main(String[] args) {
try {
// URL url = Thread.currentThread().getContextClassLoader().getResource("pt/modiplace/rfid/apis/admin/interfaces/interfaces.fo.xsl");
// Source xsltSource = new StreamSource(new File(url.getPath()));
 
createPdfFromXml(new StreamSource(new File("c:\\test.xml")), "pt/modiplace/rfid/apis/admin/interfaces/interfaces.fo.xsl", new FileOutputStream(new File("c:\\test.pdf")));
}
catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
catch (FOPException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
catch (TransformerException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
}
 
}
/impl/src/java/pt/estgp/estgweb/utils/DatesUtils.java
23,28 → 23,30
static SimpleDateFormat SIGES_importFirstYearFormatIntranet = new SimpleDateFormat(Globals.SIGES_importFirstYearFormatIntranet);
static SimpleDateFormat SIGES_importSecondYearFormatIntranet = new SimpleDateFormat(Globals.SIGES_importSecondYearFormatIntranet);
static MessageFormat SIGES_importFinalFormatIntranet = new MessageFormat(Globals.SIGES_importFinalFormatIntranet);
static MessageFormat SIGES_importFinalFormatProgram = new MessageFormat(Globals.SIGES_importFinalFormatProgram);
 
public static String getImportYear()
{
MyCalendar mc = new MyCalendar();
int month = mc.getMonth();
MyCalendar firstYear;
MyCalendar secondYear;
if(month <= 8)
{
firstYear = new MyCalendar(mc.getYear() - 1,1,1);
secondYear = new MyCalendar(mc.getYear(),1,1);
}
else
{
firstYear = new MyCalendar(mc.getYear(),1,1);
secondYear = new MyCalendar(mc.getYear()+1,1,1);
}
 
String firstYearStr = SIGES_importFirstYearFormat.format(firstYear.getTime());
String secondYearStr = SIGES_importSecondYearFormat.format(secondYear.getTime());
 
return getFormatedImportYear(firstYearStr,secondYearStr,SIGES_importFinalFormat);
return ConfigProperties.getProperty("import.year");
// MyCalendar mc = new MyCalendar();
// int month = mc.getMonth();
// MyCalendar firstYear;
// MyCalendar secondYear;
// if(month <= 9)
// {
// firstYear = new MyCalendar(mc.getYear() - 1,1,1);
// secondYear = new MyCalendar(mc.getYear(),1,1);
// }
// else
// {
// firstYear = new MyCalendar(mc.getYear(),1,1);
// secondYear = new MyCalendar(mc.getYear()+1,1,1);
// }
//
// String firstYearStr = SIGES_importFirstYearFormat.format(firstYear.getTime());
// String secondYearStr = SIGES_importSecondYearFormat.format(secondYear.getTime());
//
// return getFormatedImportYear(firstYearStr,secondYearStr,SIGES_importFinalFormat);
}
 
public static String getSemestre()
121,6 → 123,12
return getFormatedImportYear(importYear.substring(0,4),decadeStr+importYear.substring(4,6),SIGES_importFinalFormatIntranet);
}
 
public static String getImportYearPrograms(String importYear)
{
 
return getFormatedImportYear(importYear.substring(0,4),importYear.substring(4,6),SIGES_importFinalFormatProgram);
}
 
public static String getFormatedImportYear(String firstYearStr, String secondYearStr, MessageFormat finalFormat)
{
String[] years = {firstYearStr,secondYearStr};
172,6 → 180,6
 
public static void main(String [] args)
{
System.out.println(getImportYears(10));
System.out.println(getImportYear());
}
}
/impl/src/java/pt/estgp/estgweb/utils/Dom4jUtil.java
4,22 → 4,25
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.io.*;
import org.xml.sax.*;
import org.xml.sax.ErrorHandler;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import pt.estgp.estgweb.Globals;
 
import javax.xml.transform.*;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamSource;
import java.io.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
import java.util.HashMap;
 
import pt.estgp.estgweb.Globals;
import javax.xml.transform.TransformerFactory;
 
 
 
/**
* Class Description
*
264,6 → 267,18
return tpl.newTransformer();
}
 
 
public static org.w3c.dom.Document toW3c(org.dom4j.Document dom4jDoc) throws TransformerException {
TransformerFactory transformerFactory = TransformerFactory.newInstance();
SAXSource source = new DocumentSource(dom4jDoc);
DOMResult result = new DOMResult();
 
Transformer transformer = transformerFactory.newTransformer();
 
transformer.transform(source, result);
return (org.w3c.dom.Document) result.getNode();
}
 
public static void main(String [] args) throws Exception
{
 
/impl/src/java/pt/estgp/estgweb/Globals.java
190,6 → 190,8
public static final String SIGES_importSecondYearFormatIntranet = ConfigProperties.getProperty("importSecondYearFormatIntranet");
public static final String SIGES_importFinalFormatIntranet = ConfigProperties.getProperty("importFinalFormatIntranet");
 
public static final String SIGES_importFinalFormatProgram = ConfigProperties.getProperty("importFinalFormatProgram");
 
public static final String INTRANET_SEMESTRE_S1 = ConfigProperties.getProperty("intranet.semestre.S1");
public static final String INTRANET_SEMESTRE_S2 = ConfigProperties.getProperty("intranet.semestre.S2");
 
/impl/src/java/pt/estgp/estgweb/services/courseunits/courseunitprogram.fo.xsl
New file
0,0 → 1,238
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:uc="http://baco.estgp.pt/schemas/courseunits/program/">
 
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="A4Vertical" page-width="210mm" page-height="297mm"
margin-top="1cm" margin-bottom="1cm" margin-left="1cm" margin-right="1cm"
reference-orientation="0">
<fo:region-body region-name="body" margin-top="20mm" margin-bottom="10mm" margin-right="0"
margin-left="0"/>
 
<fo:region-before region-name="header" extent="15mm"/>
<fo:region-after region-name="footer" extent="1cm"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="A4HorizontalRot" page-width="210mm" page-height="297mm"
margin-top="0.5cm" margin-bottom="0.5cm" margin-left="0.5cm" margin-right="0.5cm"
reference-orientation="90">
<fo:region-body region-name="body" margin-top="20mm" margin-bottom="10mm" margin-right="0"
margin-left="0"/>
<fo:region-before region-name="header" extent="15mm"/>
<fo:region-after region-name="footer" extent="1cm"/>
</fo:simple-page-master>
<fo:simple-page-master master-name="A4Horizontal" page-width="297mm" page-height="210mm"
margin-top="0.5cm" margin-bottom="0.5cm" margin-left="0.5cm"
margin-right="0.5cm">
<fo:region-body region-name="body" margin-top="20mm" margin-bottom="15mm" margin-right="0"
margin-left="0"/>
<fo:region-before region-name="header" extent="15mm"/>
<fo:region-after region-name="footer" extent="1cm"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="pages">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-reference="pages" page-position="any"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
 
<!--LAYOUT DE PAGINA ESCOLHIDO-->
<fo:page-sequence master-reference="A4Vertical" initial-page-number="auto">
<xsl:call-template name="page"/>
</fo:page-sequence>
 
 
</fo:root>
</xsl:template>
 
 
<xsl:template name="page">
<fo:static-content flow-name="header">
 
<fo:block text-align="left" >
<fo:table width="100%" table-layout="fixed" border-bottom="1px solid black">
<fo:table-column column-width="100%"/>
 
 
<fo:table-body>
<fo:table-row>
<fo:table-cell >
<fo:block>
 
</fo:block>
</fo:table-cell>
 
</fo:table-row>
 
</fo:table-body>
</fo:table>
 
</fo:block>
 
 
</fo:static-content>
<fo:static-content flow-name="footer">
 
<fo:table width="100%" table-layout="fixed" border-top="1px solid black" font-size="6.5pt" >
<fo:table-column column-width="20%"/>
<fo:table-column column-width="80%" />
 
 
<fo:table-body>
<fo:table-row>
<fo:table-cell padding-top="3pt">
<fo:block>
<xsl:value-of select="//uc:UnidadeCurricular/@uc:data"/> / Página <fo:page-number/>
</fo:block>
<fo:block font-size="5pt">
ESTG.SA.23-Rev.0
</fo:block>
 
</fo:table-cell>
<fo:table-cell padding-top="3pt" >
<fo:block font-size="6pt" text-align="right">
http://www.estgp.pt | gerado pela plataforma baco® 2012
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
 
</fo:static-content>
<fo:flow flow-name="body">
<fo:block>
<xsl:apply-templates select="//uc:UnidadeCurricular"/>
</fo:block>
</fo:flow>
</xsl:template>
 
<xsl:template match="/uc:UnidadeCurricular">
<fo:table table-layout="fixed" border="0px solid black" margin="0.5em" font-size="8.5pt">
<xsl:call-template name="gen_cols"/>
<fo:table-body text-align="left">
 
<xsl:call-template name="gen_header"/>
 
<xsl:call-template name="gen_line"/>
 
</fo:table-body>
</fo:table>
</xsl:template>
 
<xsl:template name="gen_cols">
<fo:table-column column-width="15em" />
<fo:table-column/>
</xsl:template>
 
 
 
 
<xsl:template name="gen_header">
<!--<fo:table-row background-color="#000" color="#FFF" height="7mm">-->
<!--<fo:table-cell border="1px solid black" display-align="center" >-->
<!--<fo:block text-align="center" >Pos</fo:block>-->
<!--</fo:table-cell>-->
<!--<fo:table-cell border="1px solid black" display-align="center" >-->
<!--<fo:block text-align="center">Pos. Esc.</fo:block>-->
<!--</fo:table-cell>-->
<!--</fo:table-row>-->
</xsl:template>
 
 
 
 
 
 
 
 
 
 
<xsl:template name="gen_line">
 
<xsl:call-template name="tableWhiteLine">
<xsl:with-param name="label">Ano Lectivo</xsl:with-param>
<xsl:with-param name="value"><xsl:value-of select="//uc:anoLectivo"/></xsl:with-param>
</xsl:call-template>
 
<xsl:call-template name="tableWhiteLine">
<xsl:with-param name="label">Curso</xsl:with-param>
<xsl:with-param name="value"><xsl:value-of select="//uc:curso"/></xsl:with-param>
</xsl:call-template>
 
<xsl:call-template name="tableWhiteLine">
<xsl:with-param name="label">Unidade Curricular</xsl:with-param>
<xsl:with-param name="value"><xsl:value-of select="//uc:unidadeCurricular"/></xsl:with-param>
</xsl:call-template>
 
<xsl:call-template name="tableWhiteLine">
<xsl:with-param name="label">Responsável</xsl:with-param>
<xsl:with-param name="value"><xsl:value-of select="//uc:responsavel"/> / <xsl:value-of select="//uc:responsavelEmail"/></xsl:with-param>
</xsl:call-template>
 
 
<xsl:call-template name="tableGrayLine">
<xsl:with-param name="label">Objetivos da aprendizagem (conhecimentos, apetidões e competências) a desenvolver pelos estudantes, operacionalização dos objetivos e medição do seu grau de cumprimento)</xsl:with-param>
<xsl:with-param name="value"><xsl:value-of select="//uc:objetivosDaAprendizagem"/></xsl:with-param>
</xsl:call-template>
 
 
</xsl:template>
 
<xsl:template name="tableWhiteLine">
<xsl:param name="label"/>
<xsl:param name="value"/>
<xsl:call-template name="tableLine">
<xsl:with-param name="label"><xsl:value-of select="$label"/></xsl:with-param>
<xsl:with-param name="value"><xsl:value-of select="$value"/></xsl:with-param>
<xsl:with-param name="bgcolor">#FFF</xsl:with-param>
<xsl:with-param name="color">#000</xsl:with-param>
</xsl:call-template>
</xsl:template>
 
<xsl:template name="tableGrayLine">
<xsl:param name="label"/>
<xsl:param name="value"/>
<xsl:call-template name="tableLine">
<xsl:with-param name="label"><xsl:value-of select="$label"/></xsl:with-param>
<xsl:with-param name="value"><xsl:value-of select="$value"/></xsl:with-param>
<xsl:with-param name="bgcolor">#AAA</xsl:with-param>
<xsl:with-param name="color">#FFF</xsl:with-param>
</xsl:call-template>
</xsl:template>
 
<xsl:template name="tableLine">
<xsl:param name="label"/>
<xsl:param name="value"/>
<xsl:param name="bgcolor"/>
<xsl:param name="color"/>
<fo:table-row >
<xsl:attribute name="background-color">
<xsl:value-of select="$bgcolor"/>
</xsl:attribute>
<xsl:attribute name="color">
<xsl:value-of select="$color"/>
</xsl:attribute>
<fo:table-cell border-right="1px solid black" padding-right="0.1em" display-align="center" >
<fo:block text-align="right" padding="3pt" font-weight="bold">
<xsl:value-of select="$label"/>
</fo:block>
</fo:table-cell>
<fo:table-cell background-color="#FFF" color="#000" border="1px solid gray" padding-right="0.1em" display-align="center">
<fo:block text-align="left" padding="3pt">
<xsl:value-of select="$value"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
 
</xsl:template>
 
 
 
 
 
 
 
</xsl:stylesheet>
/impl/src/java/pt/estgp/estgweb/services/sigesimports/ImportStudentsService.java
73,7 → 73,7
 
Aluno d = service.getSiGesWEBSoap().getAlunoInscrito(c, Globals.SIGES_INSTITUTION_CODE, year);
User u = DaoFactory.getUserDaoImpl().loadByUsernameOrSigesCode(d.getCodigo().intValue());
Student s = null;
Student s = null;
boolean newUser = false;
if(u != null && !(u instanceof Student))
{
/impl/src/java/pt/estgp/estgweb/services/sigesimports/ImportCourseService.java
149,7 → 149,7
if (c == null)
{
c = DomainObjectFactory.createCourseUnitImpl();
DaoFactory.getCourseUnitDaoImpl().save(c);DaoFactory.getCourseUnitDaoImpl().save(c);
DaoFactory.getCourseUnitDaoImpl().save(c);
}
c.setName(d.getNome());
c.setInstitutionCode("" + Globals.SIGES_INSTITUTION_CODE);
/impl/src/java/pt/estgp/estgweb/domain/ComunicationFolderImpl.java
New file
0,0 → 1,44
package pt.estgp.estgweb.domain;
 
import pt.estgp.estgweb.utils.RoleManager;
 
import java.io.Serializable;
import java.util.List;
 
/**
* @author Jorge Machado
* @date 2/Mar/2008
* @time 10:27:25
* @see pt.estgp.estgweb.domain
*/
public class ComunicationFolderImpl extends ComunicationFolder implements ITargetRoles
{
 
public Serializable getSerializable()
{
return getId();
}
 
 
 
public String getChoosedOwnerRole() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
 
 
 
/**
* Not implemented
* @return null
*/
public List<String> getOwnerRoles()
{
return null;
}
 
 
public List<String> getTargetRolesList()
{
return RoleManager.getRolesFromSerial(getTargetRoles());
}
}
/impl/src/java/pt/estgp/estgweb/domain/StudentImpl.java
1,15 → 1,14
package pt.estgp.estgweb.domain;
 
import jomm.utils.StringsUtils;
import org.apache.log4j.Logger;
import pt.estgp.estgweb.Globals;
import pt.utl.ist.berserk.logic.serviceManager.IServiceManager;
import pt.utl.ist.berserk.logic.serviceManager.ServiceManager;
 
import java.util.*;
import java.util.ArrayList;
import java.util.List;
 
import org.apache.log4j.Logger;
import jomm.utils.StringsUtils;
import com.lowagie.text.pdf.hyphenation.TernaryTree;
 
/**
* @author Jorge Machado
* @date 28/Fev/2008
/impl/src/java/pt/estgp/estgweb/domain/CourseUnitProgramImpl.java
New file
0,0 → 1,400
package pt.estgp.estgweb.domain;
 
import jomm.dao.utils.HibernateUtils;
import jomm.utils.PdfUtils;
import org.apache.fop.apps.FOPException;
import org.dom4j.*;
import org.hibernate.Session;
import pt.estgp.estgweb.Globals;
import pt.estgp.estgweb.domain.dao.DaoFactory;
import pt.estgp.estgweb.utils.DatesUtils;
import pt.estgp.estgweb.utils.Dom4jUtil;
 
import javax.xml.transform.TransformerException;
import javax.xml.transform.dom.DOMSource;
import java.io.*;
import java.net.MalformedURLException;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import static pt.estgp.estgweb.utils.Dom4jUtil.parse;
 
/**
* @author Jorge Machado
* @date 8/Jul/2008
* @see pt.estgp.estgweb.domain
*/
public class CourseUnitProgramImpl extends CourseUnitProgram
{
public Serializable getSerializable()
{
return getId();
}
 
public static class CourseUnitInputLine
{
 
String codigoCurso;
 
String codigoSIGESUnidade;
String ano;
String semestre;
String nomeUnidadeCurricular;
 
String codSIGESDocenteResponsavel;
String nomeDocenteResponsavel;
String emailDocenteResponsavel;
 
String codigoSIGESDocente1;
String outroDocente1;
String docenteEmail1;
 
String codigoSIGESDocente2;
String outroDocente2;
String docenteEmail2;
 
String codigoSIGESDocente3;
String outroDocente3;
String docenteEmail3;
 
String codigoSIGESDocente4;
String outroDocente4;
String docenteEmail4;
 
String objetivosDaAprendizagem;
String conteudosProgramaticos;
String demonstracaoCoerenciaConteudosObjectivos;
String metodologiasEnsino;
String alunosOrdinariosPorFrequencia;
String alunosOrdinariosPorExame;
String alunosMobilidadeAlunosComEstatutoEspecialPorFrequencia;
String alunosMobilidadeAlunosComEstatutoEspecialPorExame;
String demonstracaoDaCoerenciaMetodologiasObjectivos;
String bibliografiaPrincipal;
String adaptacaoMetodologiasObjectivos;
String verificacaoCargaECTS;
String avaliacaoFuncaoObjectivos;
String metodologiasFacilitamParticipacaoCientificas;
 
String ects;
String preRequisitos;
String obrigatoria;
String lingua1;
String lingua2;
 
@Override
public String toString() {
return "CourseUnitInputLine{" +
"codigoCurso='" + codigoCurso + '\'' +
", codigoSIGESUnidade='" + codigoSIGESUnidade + '\'' +
", ano='" + ano + '\'' +
", semestre='" + semestre + '\'' +
", nomeUnidadeCurricular='" + nomeUnidadeCurricular + '\'' +
", codSIGESDocenteResponsavel='" + codSIGESDocenteResponsavel + '\'' +
", nomeDocenteResponsavel='" + nomeDocenteResponsavel + '\'' +
", emailDocenteResponsavel='" + emailDocenteResponsavel + '\'' +
", codigoSIGESDocente1='" + codigoSIGESDocente1 + '\'' +
", outroDocente1='" + outroDocente1 + '\'' +
", docenteEmail1='" + docenteEmail1 + '\'' +
", codigoSIGESDocente2='" + codigoSIGESDocente2 + '\'' +
", outroDocente2='" + outroDocente2 + '\'' +
", docenteEmail2='" + docenteEmail2 + '\'' +
", codigoSIGESDocente3='" + codigoSIGESDocente3 + '\'' +
", outroDocente3='" + outroDocente3 + '\'' +
", docenteEmail3='" + docenteEmail3 + '\'' +
", codigoSIGESDocente4='" + codigoSIGESDocente4 + '\'' +
", outroDocente4='" + outroDocente4 + '\'' +
", docenteEmail4='" + docenteEmail4 + '\'' +
", objetivosDaAprendizagem='" + objetivosDaAprendizagem + '\'' +
", conteudosProgramaticos='" + conteudosProgramaticos + '\'' +
", demonstracaoCoerenciaConteudosObjectivos='" + demonstracaoCoerenciaConteudosObjectivos + '\'' +
", metodologiasEnsino='" + metodologiasEnsino + '\'' +
", alunosOrdinariosPorFrequencia='" + alunosOrdinariosPorFrequencia + '\'' +
", alunosOrdinariosPorExame='" + alunosOrdinariosPorExame + '\'' +
", alunosMobilidadeAlunosComEstatutoEspecialPorFrequência='" + alunosMobilidadeAlunosComEstatutoEspecialPorFrequencia + '\'' +
", alunosMobilidadeAlunosComEstatutoEspecialPorExame='" + alunosMobilidadeAlunosComEstatutoEspecialPorExame + '\'' +
", demonstracaoDaCoerenciaMetodologiasObjectivos='" + demonstracaoDaCoerenciaMetodologiasObjectivos + '\'' +
", bibliografiaPrincipal='" + bibliografiaPrincipal + '\'' +
", adaptacaoMetodologiasObjectivos='" + adaptacaoMetodologiasObjectivos + '\'' +
", verificacaoCargaECTS='" + verificacaoCargaECTS + '\'' +
", avaliacaoFuncaoObjectivos='" + avaliacaoFuncaoObjectivos + '\'' +
", metodologiasFacilitamParticipacaoCientificas='" + metodologiasFacilitamParticipacaoCientificas + '\'' +
", ects='" + ects + '\'' +
", preRequisitos='" + preRequisitos + '\'' +
", obrigatoria='" + obrigatoria + '\'' +
", lingua1='" + lingua1 + '\'' +
", lingua2='" + lingua2 + '\'' +
'}';
}
}
 
 
 
public static void main(String[] args) throws IOException, MalformedURLException, DocumentException, SQLException, TransformerException, FOPException {
 
List<CourseUnitInputLine> unitsLines = new ArrayList<CourseUnitInputLine>();
Document dom = parse(new FileInputStream(new File("D:\\Jorge\\Documents\\estg\\projectos\\Fichas Curriculares Baco\\APM (1).xml")));
 
Dom4jUtil.writeSout(dom);
 
List<String>[] lista = new ArrayList[43];
 
Map<String,String> namespaces = new HashMap<String,String>();
namespaces.put("m","urn:schemas-microsoft-com:office:spreadsheet");
 
XPath xPath = dom.createXPath("//m:Row");
xPath.setNamespaceURIs(namespaces);
List<Element> rows = xPath.selectNodes(dom.getRootElement());
 
for(int r = 3; r < 46; r++)
{
lista[r - 3] = new ArrayList<String>();
Element row = rows.get(r);
XPath xPathCells = dom.createXPath("m:Cell");
xPathCells.setNamespaceURIs(namespaces);
List<Element> cells = xPathCells.selectNodes(row);
for(int i = 6; i < cells.size();i++)
{
Element cell = cells.get(i);
XPath xPathData = dom.createXPath("m:Data");
xPathData.setNamespaceURIs(namespaces);
Element data = (Element) xPathData.selectSingleNode(cell);
if(data!=null)
{
String text = data.getText();
lista[r-3].add(text);
}
else
lista[r-3].add("");
}
}
int maxUnits = lista[0].size();
for(int unit = 0; unit < maxUnits; unit++)
{
CourseUnitInputLine courseUnitInputLine = new CourseUnitInputLine();
courseUnitInputLine.codigoCurso = lista[0].get(unit);
courseUnitInputLine.codigoSIGESUnidade = lista[2].get(unit);
courseUnitInputLine.ano = lista[3].get(unit);
courseUnitInputLine.semestre = lista[4].get(unit);
courseUnitInputLine.nomeUnidadeCurricular = lista[5].get(unit);
 
courseUnitInputLine.codSIGESDocenteResponsavel = lista[7].get(unit);
courseUnitInputLine.nomeDocenteResponsavel = lista[8].get(unit);
courseUnitInputLine.emailDocenteResponsavel = lista[9].get(unit);
 
courseUnitInputLine.codigoSIGESDocente1 = lista[10].get(unit);
courseUnitInputLine.outroDocente1 = lista[11].get(unit);
courseUnitInputLine.docenteEmail1 = lista[12].get(unit);
 
courseUnitInputLine.codigoSIGESDocente2 = lista[13].get(unit);
courseUnitInputLine.outroDocente2 = lista[14].get(unit);
courseUnitInputLine.docenteEmail2 = lista[15].get(unit);
 
courseUnitInputLine.codigoSIGESDocente3 = lista[16].get(unit);
courseUnitInputLine.outroDocente3 = lista[17].get(unit);
courseUnitInputLine.docenteEmail3 = lista[18].get(unit);
 
courseUnitInputLine.codigoSIGESDocente4 = lista[19].get(unit);
courseUnitInputLine.outroDocente4 = lista[20].get(unit);
courseUnitInputLine.docenteEmail4 = lista[21].get(unit);
 
courseUnitInputLine.objetivosDaAprendizagem = lista[22].get(unit);
courseUnitInputLine.conteudosProgramaticos = lista[23].get(unit);
courseUnitInputLine.demonstracaoCoerenciaConteudosObjectivos = lista[24].get(unit);
courseUnitInputLine.metodologiasEnsino = lista[25].get(unit);
courseUnitInputLine.alunosOrdinariosPorFrequencia = lista[26].get(unit);
courseUnitInputLine.alunosOrdinariosPorExame = lista[27].get(unit);
courseUnitInputLine.alunosMobilidadeAlunosComEstatutoEspecialPorFrequencia = lista[28].get(unit);
courseUnitInputLine.alunosMobilidadeAlunosComEstatutoEspecialPorExame = lista[29].get(unit);
courseUnitInputLine.demonstracaoDaCoerenciaMetodologiasObjectivos = lista[30].get(unit);
courseUnitInputLine.bibliografiaPrincipal = lista[31].get(unit);
courseUnitInputLine.adaptacaoMetodologiasObjectivos = lista[33].get(unit);
courseUnitInputLine.verificacaoCargaECTS = lista[34].get(unit);
courseUnitInputLine.avaliacaoFuncaoObjectivos = lista[35].get(unit);
courseUnitInputLine.metodologiasFacilitamParticipacaoCientificas = lista[36].get(unit);
courseUnitInputLine.ects = lista[38].get(unit);
courseUnitInputLine.preRequisitos = lista[39].get(unit);
courseUnitInputLine.obrigatoria = lista[40].get(unit);
courseUnitInputLine.lingua1 = lista[41].get(unit);
courseUnitInputLine.lingua2 = lista[42].get(unit);
 
if(courseUnitInputLine.semestre.equals("S1") || courseUnitInputLine.semestre.equals("S2") || courseUnitInputLine.semestre.equals("A"))
unitsLines.add(courseUnitInputLine);
else
System.out.println("Unidade curricular " + courseUnitInputLine.nomeUnidadeCurricular + " ( " + courseUnitInputLine.codigoSIGESUnidade + " ) tem o semestre mal definido ");
}
 
 
for(CourseUnitInputLine line: unitsLines)
{
// System.out.println(line.toString());
HibernateUtils.getCurrentSession().beginTransaction();
 
importCourseUnit(line,importYear);
 
HibernateUtils.getCurrentSession().flush();
HibernateUtils.getCurrentSession().connection().commit();
}
 
 
}
 
static String importYear = "201213";
private static void importCourseUnit(CourseUnitInputLine line, String importYear) throws TransformerException, IOException, FOPException {
 
CourseUnit cu = DaoFactory.getCourseUnitDaoImpl().loadBySigesCodeUnique(line.codigoSIGESUnidade,line.codigoCurso,line.semestre, importYear);
if(cu != null)
{
setCourse(cu, line);
}
else
{
cu = createNewCourseUnit(cu,line,importYear);
}
persistCourseUnitProgram(cu,line);
setTeachers(cu,line);
 
createPdf(line,cu);
 
}
 
private static void createPdf(CourseUnitInputLine line, CourseUnit cu) throws IOException, TransformerException, FOPException {
Document responseDoc = DocumentHelper.createDocument();
Namespace namespace = new Namespace("uc", "http://baco.estgp.pt/schemas/courseunits/program/");
responseDoc.setXMLEncoding("ISO-8859-1");
 
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
Element curriculum = responseDoc.addElement(new QName("UnidadeCurricular", namespace));
curriculum.addAttribute(new QName("data",namespace),sdf.format(new java.util.Date()));
 
Element curso = curriculum.addElement(new QName("curso",namespace));
curso.setText(cu.getCourseName());
 
Element anoLectivo = curriculum.addElement(new QName("anoLectivo",namespace));
anoLectivo.setText(DatesUtils.getImportYearPrograms(cu.getImportYear()));
 
Element unidadeCurricular = curriculum.addElement(new QName("unidadeCurricular",namespace));
unidadeCurricular.setText(cu.getName());
 
Element responsavel = curriculum.addElement(new QName("responsavel",namespace));
responsavel.setText(line.nomeDocenteResponsavel);
 
Element responsavelEmail = curriculum.addElement(new QName("responsavelEmail",namespace));
responsavelEmail.setText(line.emailDocenteResponsavel);
 
Element apresentacaoObjectivos = curriculum.addElement(new QName("objetivosDaAprendizagem",namespace));
apresentacaoObjectivos.setText(line.objetivosDaAprendizagem);
 
 
 
Dom4jUtil.writeSout(responseDoc);
 
 
FileOutputStream teste = new FileOutputStream("D:\\Jorge\\Documents\\estg\\projectos\\Fichas Curriculares Baco\\APM (1).pdf");
PdfUtils.createPdfFromXml(new DOMSource(Dom4jUtil.toW3c(responseDoc)), "pt/estgp/estgweb/services/courseunits/courseunitprogram.fo.xsl", teste);
teste.flush();
teste.close();
}
 
private static void setTeachers(CourseUnit cu, CourseUnitInputLine line)
{
if(line.codSIGESDocenteResponsavel != null && line.codSIGESDocenteResponsavel.trim().length() > 0)
{
checkTeacher(cu, line.codSIGESDocenteResponsavel,line.nomeDocenteResponsavel,line.emailDocenteResponsavel);
}
else
System.out.println("Nao existe docente responsavel para a unidade " + cu.getCode());
 
if(line.codigoSIGESDocente1 != null && line.codigoSIGESDocente1.trim().length() > 0)
checkTeacher(cu, line.codigoSIGESDocente1,line.outroDocente1,line.docenteEmail1);
if(line.codigoSIGESDocente2 != null && line.codigoSIGESDocente2.trim().length() > 0)
checkTeacher(cu, line.codigoSIGESDocente2,line.outroDocente2,line.docenteEmail2);
if(line.codigoSIGESDocente3 != null && line.codigoSIGESDocente3.trim().length() > 0)
checkTeacher(cu, line.codigoSIGESDocente3,line.outroDocente3,line.docenteEmail3);
if(line.codigoSIGESDocente4 != null && line.codigoSIGESDocente4.trim().length() > 0)
checkTeacher(cu, line.codigoSIGESDocente4,line.outroDocente4,line.docenteEmail4);
}
 
private static void checkTeacher(CourseUnit cu, String codSIGESDocenteResponsavel, String nomeDocenteResponsavel, String emailDocenteResponsavel) {
 
try{
Teacher t = DaoFactory.getTeacherDaoImpl().loadBySigesCode(Integer.parseInt(codSIGESDocenteResponsavel));
boolean found = false;
for(Teacher ts : cu.getTeachers())
{
if(ts.getId() == t.getId())
{
found = true;
break;
}
}
if(!found)
cu.getTeachers().add((TeacherImpl) t);
}catch(Exception e)
{
 
}
 
}
 
private static CourseUnit createNewCourseUnit(CourseUnit cu, CourseUnitInputLine line,String importYear)
{
cu = DomainObjectFactory.createCourseUnitImpl();
cu.setSemestre(line.semestre);
cu.setImportYear(importYear);
cu.setCode(line.codigoSIGESUnidade);
cu.setCourseCode(line.codigoCurso);
cu.setName(line.nomeUnidadeCurricular);
cu.setInstitutionCode("" + Globals.SIGES_INSTITUTION_CODE);
 
setCourse(cu, line);
DaoFactory.getCourseUnitDaoImpl().save(cu);
return cu;
}
 
private static void setCourse(CourseUnit cu, CourseUnitInputLine line) {
Course c = DaoFactory.getCourseDaoImpl().findCourseByCode(line.codigoCurso);
if(c == null)
System.out.println("Curso " + line.codigoCurso + " nao existe por favor crie e importe novamente");
cu.setCourse(c);
}
 
private static void persistCourseUnitProgram(CourseUnit cu, CourseUnitInputLine line) throws IOException, TransformerException, FOPException {
Session sess = HibernateUtils.getCurrentSession();
 
CourseUnitProgram program = cu.getCourseUnitProgram();
if(program == null)
{
program = new CourseUnitProgramImpl();
program.setSaveDate(new java.util.Date());
cu.setCourseUnitProgram(program);
sess.save(program);
}
program.setAdaptacaoObjectivosMetodologia(line.adaptacaoMetodologiasObjectivos);
program.setAvaliacaoEspeciaisFrequencia(line.alunosMobilidadeAlunosComEstatutoEspecialPorFrequencia);
program.setAvaliacaoEspeciaissExame(line.alunosMobilidadeAlunosComEstatutoEspecialPorExame);
program.setAvaliacaoOrdinariosFrequencia(line.alunosOrdinariosPorFrequencia);
program.setAvaliacaoOrdinariosExame(line.alunosOrdinariosPorExame);
program.setBibliografia(line.bibliografiaPrincipal);
program.setConteudos(line.conteudosProgramaticos);
program.setDemonstracaoCargaEcts(line.verificacaoCargaECTS);
program.setDemonstracaoObjectivosMetodologia(line.demonstracaoDaCoerenciaMetodologiasObjectivos);
program.setEcts(line.ects);
program.setGarantiaAvaliacaoFuncaObjectivos(line.avaliacaoFuncaoObjectivos);
program.setLingua1(line.lingua1);
program.setLingua2(line.lingua2);
program.setMetodologiasActividadeCientifica(line.metodologiasFacilitamParticipacaoCientificas);
program.setMetodologiasEnsino(line.metodologiasEnsino);
program.setDemonstracaoCoerenciaConteudos(line.demonstracaoCoerenciaConteudosObjectivos);
program.setObjectivos(line.objetivosDaAprendizagem);
program.setObrigatoria(line.obrigatoria);
program.setPrerequisitos(line.preRequisitos);
 
 
}
 
}
/impl/src/java/pt/estgp/estgweb/domain/views/ComunicationFolderView.java
New file
0,0 → 1,166
package pt.estgp.estgweb.domain.views;
 
import pt.estgp.estgweb.domain.*;
import pt.estgp.estgweb.utils.RoleManager;
 
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
 
/**
* Created by IntelliJ IDEA.
* User: Jorge
* Date: 13/Fev/2012
* Time: 17:54:45
* To change this template use File | Settings | File Templates.
*/
public class ComunicationFolderView extends DomainObjectView implements IOwned, ITargetRoles, ICanLoad{
 
 
private ComunicationFolderImpl comunicationFolder;
private long id;
private Date updateDate;
private Date saveDate;
private String name;
private String code;
private List<String> targetRoles;
private GenericUser owner;
private Blog blog;
 
 
public ComunicationFolderView() {
 
}
 
public ComunicationFolderView(ComunicationFolderImpl comunicationFolder) {
super(comunicationFolder);
this.comunicationFolder = comunicationFolder;
init(comunicationFolder,comunicationFolder.getOwner(),comunicationFolder.getBlog());
}
 
private void init(ComunicationFolderImpl comunicationFolder, GenericUser owner, Blog blog)
{
 
this.comunicationFolder = comunicationFolder;
this.name = comunicationFolder.getName();
this.updateDate = comunicationFolder.getUpdateDate();
this.saveDate = comunicationFolder.getSaveDate();
this.code = comunicationFolder.getCode();
this.owner = comunicationFolder.getOwner();
this.targetRoles = RoleManager.getRolesFromSerial(comunicationFolder.getTargetRoles());
if(this.targetRoles == null) targetRoles = new ArrayList<String>();
this.blog = blog;
}
 
@Override
public Class getReferenceClass() {
return ComunicationFolderImpl.class;
}
 
@Override
public Serializable getSerializable() {
return id;
}
 
public boolean canLoad(GenericUserImpl u)
{
return u.hasRole(getTargetRolesList());
}
 
public boolean canLoadInOpenTransaction(GenericUserImpl u) {
return u.hasRole(getTargetRolesList());
}
 
public boolean isOwnedBy(GenericUser u)
{
return comunicationFolder.isOwnedBy(u,false);
}
 
public boolean isOwnedBy(GenericUser u, boolean transaction)
{
return comunicationFolder.isOwnedBy(u,transaction);
}
 
 
public GenericUser getOwner() {
return owner;
}
 
public List<String> getOwnerRoles() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
 
public String getChoosedOwnerRole() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
 
public List<String> getTargetRolesList() {
return comunicationFolder.getTargetRolesList();
}
 
public ComunicationFolderImpl getComunicationFolder() {
return comunicationFolder;
}
 
public void setComunicationFolder(ComunicationFolderImpl comunicationFolder) {
this.comunicationFolder = comunicationFolder;
}
 
public long getId() {
return id;
}
 
public void setId(long id) {
this.id = id;
}
 
public Date getUpdateDate() {
return updateDate;
}
 
public void setUpdateDate(Date updateDate) {
this.updateDate = updateDate;
}
 
public Date getSaveDate() {
return saveDate;
}
 
public void setSaveDate(Date saveDate) {
this.saveDate = saveDate;
}
 
public String getName() {
return name;
}
 
public void setName(String name) {
this.name = name;
}
 
public String getCode() {
return code;
}
 
public void setCode(String code) {
this.code = code;
}
 
public List<String> getTargetRoles() {
return targetRoles;
}
 
public void setTargetRoles(List<String> targetRoles) {
this.targetRoles = targetRoles;
}
 
public Blog getBlog() {
return blog;
}
 
public void setBlog(Blog blog) {
this.blog = blog;
}
}
/impl/src/java/pt/estgp/estgweb/domain/DomainObjectFactory.java
161,11 → 161,16
return new CourseUnitImpl();
}
 
public static TeacherImpl createTeacherImpl()
public static ComunicationFolderImpl createComunicationFolderImpl()
{
return new TeacherImpl();
return new ComunicationFolderImpl();
}
 
public static TeacherImpl createTeacherImpl()
{
return new TeacherImpl();
}
 
public static StudentImpl createStudentImpl()
{
return new StudentImpl();
/impl/src/java/pt/estgp/estgweb/filters/filters/OwnerUsersClass.java
31,7 → 31,8
if(userSession.getUser().isSuperuser())
return;
 
IOwned iOwned = (IOwned) LoadObjectFromParameters.loadObjectFromClassName((String) filterParameters.getParameter(1),filterParameters,request.getServiceParameters());
IOwned iOwned = (IOwned) LoadObjectFromParameters.loadObjectFromClassName((String) filterParameters.getParameter(1),
filterParameters,request.getServiceParameters());
 
if(!iOwned.isOwnedBy(userSession.getUser(),true))
{
/impl/src/java/pt/estgp/estgweb/web/form/comunicationfolder/ComunicationFolderForm.java
New file
0,0 → 1,55
package pt.estgp.estgweb.web.form.comunicationfolder;
 
import org.apache.struts.action.ActionErrors;
import pt.estgp.estgweb.domain.views.ComunicationFolderView;
import pt.estgp.estgweb.web.form.AddRolesForm;
 
/**
* @author Fabio
* @date 30/Abr/2008
* @time 17:18:57
* @see pt.estgp.estgweb.web.form.profile
*/
public class ComunicationFolderForm extends AddRolesForm
{
 
 
 
private ComunicationFolderView comunicationFolderView;
 
public ComunicationFolderForm()
{
comunicationFolderView = new ComunicationFolderView();
}
 
public ComunicationFolderForm(ComunicationFolderView comunicationFolderView)
{
this.comunicationFolderView = comunicationFolderView;
}
 
public ComunicationFolderView getComunicationFolderView() {
return comunicationFolderView;
}
 
public void setComunicationFolderView(ComunicationFolderView comunicationFolderView) {
this.comunicationFolderView = comunicationFolderView;
}
 
 
 
public ActionErrors validate(org.apache.struts.action.ActionMapping actionMapping, javax.servlet.http.HttpServletRequest httpServletRequest)
{
 
ActionErrors errors = new ActionErrors();
if(comunicationFolderView.getName() == null || comunicationFolderView.getName().length() == 0)
{
addMessageWithKeys(errors, httpServletRequest, "errors.required","name");
}
if(getSelectedRoles() == null || getSelectedRoles().size() == 0)
{
addMessageWithKeys(errors, httpServletRequest, "errors.required","profile.roles");
}
return errors;
}
}
 
/impl/src/java/pt/estgp/estgweb/web/controllers/comunicationfolder/ComunicationFolderController.java
New file
0,0 → 1,568
package pt.estgp.estgweb.web.controllers.comunicationfolder;
 
import org.apache.log4j.Logger;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import pt.estgp.estgweb.Globals;
import pt.estgp.estgweb.domain.DomainObjectFactory;
import pt.estgp.estgweb.domain.User;
import pt.estgp.estgweb.domain.UserSessionImpl;
import pt.estgp.estgweb.domain.views.ComunicationFolderView;
import pt.estgp.estgweb.domain.views.RecordView;
import pt.estgp.estgweb.domain.views.UserView;
import pt.estgp.estgweb.services.expceptions.AlreadyExistsException;
import pt.estgp.estgweb.web.UserSessionProxy;
import pt.estgp.estgweb.web.controllers.AddRolesController;
import pt.estgp.estgweb.web.exceptions.NoCookiesException;
import pt.estgp.estgweb.web.form.AddRolesForm;
import pt.estgp.estgweb.web.form.comunicationfolder.ComunicationFolderForm;
import pt.estgp.estgweb.web.form.profile.ProfileForm;
import pt.estgp.estgweb.web.utils.RequestUtils;
import pt.utl.ist.berserk.logic.filterManager.exceptions.FilterRetrieveException;
import pt.utl.ist.berserk.logic.filterManager.exceptions.IncompatibleFilterException;
import pt.utl.ist.berserk.logic.filterManager.exceptions.InvalidFilterException;
import pt.utl.ist.berserk.logic.filterManager.exceptions.InvalidFilterExpressionException;
import pt.utl.ist.berserk.logic.serviceManager.IServiceManager;
import pt.utl.ist.berserk.logic.serviceManager.ServiceManager;
import pt.utl.ist.berserk.logic.serviceManager.exceptions.FilterChainFailedException;
import pt.utl.ist.berserk.logic.serviceManager.exceptions.ServiceManagerException;
 
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
 
/**
* @author Jorge Machado
* @date 26/Fev/2008
* @time 18:01:54
* @see pt.estgp.estgweb.web
*/
public class ComunicationFolderController extends AddRolesController
{
 
private static final Logger logger = Logger.getLogger(ComunicationFolderController.class);
private static final String TARGET_ROLES_KEY = AddRolesForm.TARGET_ROLES_KEY;
 
 
public ActionForward newComunicationFolder(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Throwable, ServletException
{
try
{
ComunicationFolderForm cFF = (ComunicationFolderForm) form;
UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request, response);
 
ComunicationFolderView cv = new ComunicationFolderView(DomainObjectFactory.createComunicationFolderImpl());
 
 
cFF.setComunicationFolderView(cv);
cFF.setSelectedRoles(new ArrayList<String>());
userSession.put(TARGET_ROLES_KEY, (Serializable) cv.getTargetRolesList());
userSession.serialize(request, response);
return mapping.findForward("comunicationFolder");
}
catch (FilterChainFailedException e)
{
return mapping.findForward("error401");
}
catch (Throwable e)
{
logger.error(e, e);
throw e;
}
}
 
 
 
 
public ActionForward editUser(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Throwable, ServletException
{
ProfileForm profileForm = (ProfileForm) form;
ActionErrors errors = profileForm.validate(mapping, request);
if (!errors.isEmpty())
{
if(profileForm.getUserView().getId() > 0)
{
UserView uV = loadUser(profileForm.getUserView().getId(), request, response);
profileForm.getUserView().setPasswordLocal(uV.isPasswordLocal());
UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request, response);
uV.setUserRoles((List<String>) userSession.get(TARGET_ROLES_KEY));
profileForm.setSelectedRoles(uV.getUserRoles());
}
saveMessages(request, errors);
return mapping.getInputForward();
}
UserView userView = profileForm.getUserView();
try
{
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, profileForm.getTypeClass()};
try
{
userView = (UserView) sm.execute(RequestUtils.getRequester(request, response), "SubmitUser", args, names);
}
catch (AlreadyExistsException e)
{
if(profileForm.getUserView().getId() > 0)
{
UserView uV = loadUser(profileForm.getUserView().getId(), request, response);
profileForm.getUserView().setPasswordLocal(uV.isPasswordLocal());
}
addErrorWithKeys(request,"user.exists",e.getMessage());
return mapping.getInputForward();
}
profileForm.setUserView(userView);
if (userSession.getUser().getId() == userView.getId())
{
userSession.setUser(userView.getUser());
request.setAttribute(Globals.USER_SESSION_KEY, userSession);
logger.info("Puting new user info in session:" + userView.getId());
}
addMessage(request, "profile.edited.sucess");
return mapping.findForward("success");
}
catch (FilterChainFailedException e)
{
return mapping.findForward("error401");
}
catch (Throwable e)
{
logger.error(e, e);
throw e;
}
}
 
public ActionForward newTeacher(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Throwable, ServletException
{
return newGenericUser(mapping, form, request, response, DomainObjectFactory.createTeacherImpl());
}
 
public ActionForward newStudent(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Throwable, ServletException
{
return newGenericUser(mapping, form, request, response, DomainObjectFactory.createStudentImpl());
}
 
public ActionForward newUser(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Throwable, ServletException
{
return newGenericUser(mapping, form, request, response, DomainObjectFactory.createUserImpl());
}
 
public ActionForward newGenericUser(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response,
User u)
throws Throwable, ServletException
{
try
{
ProfileForm pF = (ProfileForm) form;
UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request, response);
 
UserView uV = new UserView(u);
pF.setUserView(uV);
pF.setTypeClass(u.getClass().getName());
pF.setSelectedRoles(uV.getUserRoles());
userSession.put(TARGET_ROLES_KEY, (Serializable) uV.getUserRoles());
userSession.serialize(request, response);
return mapping.findForward("personalData");
}
catch (FilterChainFailedException e)
{
return mapping.findForward("error401");
}
catch (Throwable e)
{
logger.error(e, e);
throw e;
}
}
 
public ActionForward changeProfile(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Throwable, ServletException
{
try
{
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();
UserView uV = loadUser(userToLoad, request, response);
pF.setUserView(uV);
pF.setSelectedRoles(uV.getUserRoles());
userSession.put(TARGET_ROLES_KEY, (Serializable) uV.getUserRoles());
userSession.serialize(request, response);
return mapping.findForward("personalData");
}
catch (FilterChainFailedException e)
{
return mapping.findForward("error401");
}
catch (Throwable e)
{
logger.error(e, e);
throw e;
}
}
 
public ActionForward home(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Throwable, ServletException
{
try
{
ProfileForm pF = (ProfileForm) form;
UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request, response);
long userToLoad;
if (pF.getUserView().getId() > 0)
userToLoad = pF.getUserView().getId();
else
userToLoad = userSession.getUser().getId();
UserView uV = loadUserWithRecords(userToLoad, request, response);
pF.setUserView(uV);
return mapping.findForward("home");
}
catch (FilterChainFailedException e)
{
return mapping.findForward("error401");
}
catch (Throwable e)
{
logger.error(e, e);
throw e;
}
}
 
public ActionForward grades(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Throwable, ServletException
{
try
{
ProfileForm pF = (ProfileForm) form;
UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request, response);
long userToLoad;
if (pF.getUserView().getId() > 0)
userToLoad = pF.getUserView().getId();
else
userToLoad = userSession.getUser().getId();
UserView uV = loadUserWithGrades(userToLoad, request, response);
pF.setUserView(uV);
return mapping.findForward("grades");
}
catch (FilterChainFailedException e)
{
return mapping.findForward("error401");
}
catch (Throwable e)
{
logger.error(e, e);
throw e;
}
}
 
 
public ActionForward homeCode(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Throwable, ServletException
{
try
{
ProfileForm pF = (ProfileForm) form;
UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request, response);
int userToLoad = pF.getUserView().getCode();
UserView uV = loadUserWithRecordsCode(userToLoad, request, response);
pF.setUserView(uV);
return mapping.findForward("home");
}
catch (FilterChainFailedException e)
{
return mapping.findForward("error401");
}
catch (Throwable e)
{
logger.error(e, e);
throw e;
}
}
 
public ActionForward curriculum(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Throwable, ServletException
{
try
{
ProfileForm pF = (ProfileForm) form;
UserSessionImpl userSession = (UserSessionImpl) UserSessionProxy.loadUserSession(request, response);
long userToLoad = userSession.getUser().getId();
UserView uV = loadUserWithRecords(userToLoad, request, response);
pF.setUserView(uV);
return mapping.findForward("curriculum");
}
catch (FilterChainFailedException e)
{
return mapping.findForward("error401");
}
catch (Throwable e)
{
logger.error(e, e);
throw e;
}
}
 
private UserView loadUser(long id, HttpServletRequest request, HttpServletResponse response) throws Throwable, InvalidFilterException, ServiceManagerException, InvalidFilterExpressionException, IncompatibleFilterException, FilterRetrieveException, NoCookiesException
{
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{"serializable"};
Object[] args = new Object[]{id};
UserView uV = (UserView) sm.execute(RequestUtils.getRequester(request, response), "LoadUserById", args, names);
return uV;
}
 
private UserView loadUserWithRecords(long id, HttpServletRequest request, HttpServletResponse response) throws Throwable, InvalidFilterException, ServiceManagerException, InvalidFilterExpressionException, IncompatibleFilterException, FilterRetrieveException, NoCookiesException
{
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{"serializable"};
Object[] args = new Object[]{id};
UserView uV = (UserView) sm.execute(RequestUtils.getRequester(request, response), "LoadUserWithRecordsById", args, names);
return uV;
}
 
private UserView loadUserWithGrades(long id, HttpServletRequest request, HttpServletResponse response) throws Throwable, InvalidFilterException, ServiceManagerException, InvalidFilterExpressionException, IncompatibleFilterException, FilterRetrieveException, NoCookiesException
{
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{"serializable"};
Object[] args = new Object[]{id};
UserView uV = (UserView) sm.execute(RequestUtils.getRequester(request, response), "LoadUserWithGradesById", args, names);
return uV;
}
 
public UserView loadUserWithRecordsCode(int code, HttpServletRequest request, HttpServletResponse response) throws Throwable, InvalidFilterException, ServiceManagerException, InvalidFilterExpressionException, IncompatibleFilterException, FilterRetrieveException, NoCookiesException
{
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{"serializable"};
Object[] args = new Object[]{code};
UserView uV = (UserView) sm.execute(RequestUtils.getRequester(request, response), "LoadUserWithRecordsByCode", args, names);
return uV;
}
 
public ActionForward search(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Throwable, ServletException
{
try
{
ProfileForm fromRequest = (ProfileForm) form;
 
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{"serializable"};
Object[] args = new Object[]{fromRequest.getTextToSearch(), fromRequest.getTypeToSearch()};
List<UserView> uVs = (List<UserView>) sm.execute(RequestUtils.getRequester(request, response), "SearchUser", args, names);
fromRequest.setUsersFind(uVs);
request.setAttribute("ProfileForm", fromRequest);
if (uVs.size() != 0)
addMessage(request, "profile.search.user.find", "" + uVs.size());
else
addMessage(request, "profile.search.user.not.find");
return mapping.findForward("search");
}
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), "DeleteUser", args, names);
if (status)
{
addMessage(request, "user.deleted.sucess");
return mapping.findForward("success");
}
else
{
addMessage(request, "user.deleted.fail");
return mapping.findForward("success");
}
}
catch (FilterChainFailedException e)
{
return mapping.findForward("error401");
}
catch (Throwable e)
{
logger.error(e, e);
throw e;
}
}
 
public ActionForward createRecord(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Throwable, ServletException
{
try
{
ProfileForm profileForm = (ProfileForm) form;
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{"object"};
 
Object[] args;
if (profileForm.getUploadFile() != null)
args = new Object[]{profileForm.getRecordView(), profileForm.getUploadFile().getInputStream(), profileForm.getUploadFile().getFileName(), profileForm.getUploadFile().getContentType(), profileForm.getUploadFile().getFileSize()};
else
args = new Object[]{profileForm.getRecordView(), null, null, null, 0};
 
boolean newRecord = false;
if(profileForm.getRecordView().getId() <= 0)
newRecord = true;
UserView userView;
if (profileForm.getRecordView().getId() > 0)
userView = (UserView) sm.execute(RequestUtils.getRequester(request, response), "EditUserProfileRecord", args, names);
else
userView = (UserView) sm.execute(RequestUtils.getRequester(request, response), "CreateUserProfileRecord", args, names);
 
if(newRecord)
addMessage(request, "profile.record.add.sucess", profileForm.getRecordView().getTitle());
else
addMessage(request, "profile.record.updated.sucess", profileForm.getRecordView().getTitle());
profileForm.setUserView(userView);
return mapping.findForward("home");
}
catch (FilterChainFailedException e)
{
return mapping.findForward("error401");
}
catch (Throwable e)
{
logger.error(e, e);
throw e;
}
}
 
public ActionForward deleteRecord(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Throwable, ServletException
{
try
{
ProfileForm profileForm = (ProfileForm) form;
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{"serializable"};
Object[] args;
args = new Object[]{profileForm.getRecordView().getId()};
 
UserView userView = (UserView) sm.execute(RequestUtils.getRequester(request, response), "DeleteUserProfileRecord", args, names);
addMessage(request, "profile.record.deleted.sucess");
profileForm.setUserView(userView);
return mapping.findForward("home");
}
catch (FilterChainFailedException e)
{
return mapping.findForward("error401");
}
catch (Throwable e)
{
logger.error(e, e);
throw e;
}
}
 
public ActionForward loadEditRecord(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Throwable, ServletException
{
try
{
ProfileForm profileForm = (ProfileForm) form;
IServiceManager sm = ServiceManager.getInstance();
String[] names = new String[]{"serializable"};
Object[] args;
args = new Object[]{profileForm.getRecordView().getId()};
 
RecordView recordView = (RecordView) sm.execute(RequestUtils.getRequester(request, response), "LoadEditUserProfileRecord", args, names);
UserView uV = recordView.getOwnerUserView();
// addMessage(request, "profile.record.deleted.sucess");
profileForm.setUserView(uV);
profileForm.setRecordView(recordView);
return mapping.findForward("curriculum");
}
catch (FilterChainFailedException e)
{
return mapping.findForward("error401");
}
catch (Throwable e)
{
logger.error(e, e);
throw e;
}
}
 
}
/impl/src/java/pt/estgp/estgweb/web/controllers/blogs/BlogsController.java
310,7 → 310,7
{
try
{
BlogForm blogForm = (BlogForm) form;
BlogForm blogForm = (BlogForm) form;
ActionErrors errors = blogForm.validatePost(mapping, request);
if (!errors.isEmpty())
{
/impl/src/updates/db/update10.sql
New file
0,0 → 1,21
 
 
drop table comunicationfolder;
create table comunicationfolder (
id bigint not null auto_increment,
discrimitator varchar(255) not null,
updateDate datetime not null,
saveDate datetime,
name varchar(255),
code varchar(255),
targetRoles varchar(255),
owner bigint,
blog bigint,
primary key (id),
KEY `nameIndex` (`name`),
KEY `codeIndex` (`code`),
KEY `ownerIndex` (`owner`),
KEY `targetRolesIndex` (`targetRoles`),
CONSTRAINT `fkBlog` FOREIGN KEY (`blog`) REFERENCES `blog` (`id`),
CONSTRAINT `fkOwner` FOREIGN KEY (`owner`) REFERENCES `user` (`id`)
);
/impl/src/updates/db/update11Programs.sql
New file
0,0 → 1,7
 
ALTER TABLE `courseunit` ADD COLUMN `courseUnitProgram` BIGINT(20) AFTER `validProgram`;
 
create table courseunitprogram (id bigint not null auto_increment, discrimitator varchar(255) not null, updateDate datetime not null, saveDate datetime, objectivos text, conteudos text,demonstracaoCoerenciaConteudos text, metodologiasEnsino text, avaliacaoOrdinariosFrequencia text, avaliacaoOrdinariosExame text, avaliacaoEspeciaisFrequencia text, avaliacaoEspeciaissExame text, demonstracaoObjectivosMetodologia text, bibliografia text, adaptacaoObjectivosMetodologia text, demonstracaoCargaEcts text, garantiaAvaliacaoFuncaObjectivos text, metodologiasActividadeCientifica text, ects varchar(255), prerequisitos text, obrigatoria varchar(255), lingua1 varchar(255), lingua2 varchar(255), primary key (id));
 
alter table courseunit add index FK9486341F2DE085C4 (courseUnitProgram), add constraint FK9486341F2DE085C4 foreign key (courseUnitProgram) references courseunitprogram (id);
 
/impl/src/hbm/pt/estgp/estgweb/domain/ComunicationFolder.hbm.xml
New file
0,0 → 1,24
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
 
<hibernate-mapping>
<class name="pt.estgp.estgweb.domain.ComunicationFolder" table="comunicationfolder" abstract="true">
<meta attribute="extends">pt.estgp.estgweb.domain.OwnedDomainObject</meta>
<meta attribute="scope-class">public abstract</meta>
<id name="id" type="long">
<generator class="native"/>
</id>
<discriminator column="discrimitator"/>
<timestamp source="db" name="updateDate" unsaved-value="null"/>
<property name="saveDate" type="timestamp"/>
<property name="name" type="string" index="nameIndex"/>
<property name="code" type="string" index="codeIndex"/>
<property name="targetRoles" type="string"/>
<many-to-one name="owner" class="pt.estgp.estgweb.domain.GenericUser" lazy="false" outer-join="true"/>
<many-to-one name="blog" class="pt.estgp.estgweb.domain.Blog" lazy="false" outer-join="true"/>
<subclass name="pt.estgp.estgweb.domain.ComunicationFolderImpl" discriminator-value="ComunicationFolderImpl"/>
</class>
 
</hibernate-mapping>
/impl/src/hbm/pt/estgp/estgweb/domain/CourseUnit.hbm.xml
30,6 → 30,7
<property name="contentsGrants" type="string"/>
<many-to-one name="validatorUser" class="pt.estgp.estgweb.domain.Teacher" lazy="false" outer-join="true"/>
<many-to-one name="course" class="pt.estgp.estgweb.domain.Course" lazy="false" outer-join="true"/>
<many-to-one name="courseUnitProgram" class="pt.estgp.estgweb.domain.CourseUnitProgram" lazy="false" outer-join="true"/>
<set name="blogs" cascade="delete" lazy="true" order-by="saveDate asc">
<key column="courseUnit"/>
<one-to-many class="pt.estgp.estgweb.domain.CourseUnitBlog" />
166,6 → 167,40
<subclass name="pt.estgp.estgweb.domain.CourseUnitSummaryImpl" discriminator-value="CourseUnitSummaryImpl"/>
</class>
 
 
 
<class name="pt.estgp.estgweb.domain.CourseUnitProgram" table="courseunitprogram" abstract="true">
<meta attribute="extends">pt.estgp.estgweb.domain.DomainSerializableObject</meta>
<meta attribute="scope-class">public abstract</meta>
<id name="id" type="long">
<generator class="native"/>
</id>
<discriminator column="discrimitator"/>
<timestamp source="db" name="updateDate" unsaved-value="null"/>
<property name="saveDate" type="timestamp"/>
<property name="objectivos" type="text"/>
<property name="conteudos" type="text"/>
<property name="demonstracaoCoerenciaConteudos" type="text"/>
<property name="metodologiasEnsino" type="text"/>
<property name="avaliacaoOrdinariosFrequencia" type="text"/>
<property name="avaliacaoOrdinariosExame" type="text"/>
<property name="avaliacaoEspeciaisFrequencia" type="text"/>
<property name="avaliacaoEspeciaissExame" type="text"/>
<property name="demonstracaoObjectivosMetodologia" type="text"/>
<property name="bibliografia" type="text"/>
<property name="adaptacaoObjectivosMetodologia" type="text"/>
<property name="demonstracaoCargaEcts" type="text"/>
<property name="garantiaAvaliacaoFuncaObjectivos" type="text"/>
<property name="metodologiasActividadeCientifica" type="text"/>
<property name="ects" type="string"/>
<property name="prerequisitos" type="text"/>
<property name="obrigatoria" type="string"/>
<property name="lingua1" type="string"/>
<property name="lingua2" type="string"/>
<subclass name="pt.estgp.estgweb.domain.CourseUnitProgramImpl" discriminator-value="CourseUnitProgramImpl"/>
</class>
 
 
<!--<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>-->
/impl/src/web/admin/comunicationfolder/comunicationfolder.jsp
New file
0,0 → 1,99
<%@ page import="pt.utl.ist.berserk.logic.serviceManager.IServiceManager" %>
<%@ page import="pt.estgp.estgweb.web.utils.RequestUtils" %>
<%@ page import="pt.estgp.estgweb.domain.views.CourseView" %>
<%@ page import="java.util.List" %>
<%@ page import="pt.utl.ist.berserk.logic.serviceManager.ServiceManager" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/tlds/baco.tld" prefix="baco" %>
<%@ taglib uri="/WEB-INF/tlds/jomm.tld" prefix="jomm" %>
<jsp:useBean id="ComunicationFolderForm" type="pt.estgp.estgweb.web.form.comunicationfolder.ComunicationFolderForm" scope="request"/>
<jsp:useBean id="UserSession" type="pt.estgp.estgweb.domain.UserSession" scope="request"/>
<html:errors/>
<jomm:messages/>
 
<html:form styleClass="form" action="/user/comunicationfolderController" enctype="multipart/form-data">
<input type="hidden" name="dispatch" value="createOrUpdateComunicationFolder">
<html:hidden property="comunicationFolderView.id"/>
 
<table>
<tr>
<th>
<bean:message key="comunicationfolder.name"/>
</th>
<td>
<html:text styleClass="text" property="comunicationFolderView.name"/>
</td>
</tr>
<tr>
<th>
<bean:message key="comunicationfolder.code"/>
</th>
<td>
<html:text styleClass="text" property="comunicationFolderView.code"/>
</td>
</tr>
<%--<tr>--%>
<%--<th>--%>
<%--<bean:message key="blog.target.roles"/>--%>
<%--</th>--%>
<%--<td>--%>
<%--<html:select property="targetRolesStr">--%>
<%--<baco:isAdmin>--%>
<%--<logic:present name="BlogForm" property="targetRoles">--%>
<%--<logic:iterate id="item" name="BlogForm" property="targetRoles">--%>
<%--<jomm:option itemName="item" comparableObjectName="BlogForm"--%>
<%--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>--%>
<%--</baco:isAdmin>--%>
<%--<baco:isNotAdmin>--%>
<%--<html:option value="all">--%>
<%--<bean:message key="user.role.all"/>--%>
<%--</html:option>--%>
<%--<html:option value="student">--%>
<%--<bean:message key="user.role.student"/>--%>
<%--</html:option>--%>
<%--<html:option value="oldStudent">--%>
<%--<bean:message key="user.role.oldStudent"/>--%>
<%--</html:option>--%>
<%--<html:option value="futureStudent">--%>
<%--<bean:message key="user.role.futureStudent"/>--%>
<%--</html:option>--%>
<%--<html:option value="teacher">--%>
<%--<bean:message key="user.role.teacher"/>--%>
<%--</html:option>--%>
<%--</baco:isNotAdmin>--%>
<%--</html:select>--%>
 
<%--<logic:present name="BlogForm" property="selectedRoles">--%>
<%--<logic:notEmpty name="BlogForm" property="selectedRoles">--%>
<%--<table class="dataTable removeButton">--%>
<%--<logic:iterate id="item" name="BlogForm" property="selectedRoles">--%>
<%--<tr>--%>
<%--<th>--%>
<%--<jomm:message patternMessage="user.role.{0}" name0="item"/>--%>
<%--</th>--%>
<%--<td><input type="button" class="removeButton"--%>
<%--onclick="BlogForm.role.value='${item}';set(this.form,'removeRole');this.form.submit();">--%>
<%--</td>--%>
<%--</tr>--%>
<%--</logic:iterate>--%>
<%--</table>--%>
<%--</logic:notEmpty>--%>
<%--</logic:present>--%>
<%--</td>--%>
<%--</tr>--%>
</table>
 
<input type="button" onclick="set(form,'createOrUpdateComunicationFolder');form.submit()" value="<bean:message key="confirm"/>">
 
</html:form>
/impl/src/web/public/blogs/blog.jsp
102,7 → 102,7
</td>
<tr>
<tr>
<th>
<th>
<bean:message key="blog.image"/>
</th>
<td>
/impl/src/web/user/serviceZone/topnavCreateComunicationFolder.jsp
New file
0,0 → 1,10
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="jomm.web.utils.NavPlaceServer"%>
<%@ page import="jomm.web.utils.TopNav" %>
<%
TopNav topNav = NavPlaceServer.getInstance().createTopNav(request);
topNav.addNavPlace("/user/startServiceZone.do", "intranet.separator.service.zone.back");
topNav.addNavPlace(null, "submit.comunicationfolder");
%>
<jsp:include page="/layout/topnav.jsp"/>
/impl/libs.xml
61,5 → 61,8
<fileset dir="${common.lib.dir}/saxon">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${common.lib.dir}/fop">
<include name="**/*.jar"/>
</fileset>
</path>
</project>
/impl/build.xml
249,6 → 249,9
<fileset dir="${common.lib.dir}/saxon">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${common.lib.dir}/fop">
<include name="**/*.jar"/>
</fileset>
</copy>
<copy file="${dist.dir}/estgweb.jar" todir="${build.dir.war}/WEB-INF/lib"/>
<copy todir="${build.dir.war}/WEB-INF" overwrite="true">