Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 1516 → Rev 1517

/branches/v3/impl/src/java/pt/estgp/estgweb/services/courses/CoursesService.java
424,6 → 424,8
.exclude("nome",Curso.class)
.exclude("dep")
.exclude("removed",UnidadeType.class)
.exclude("perfilId",Curso.Semestre.Perfil.class)
.exclude("semestreId",Curso.Semestre.class)
.create();
return genson;
}
/branches/v3/impl/src/java/pt/estgp/estgweb/services/courses/xsd/SemestreImpl.java
55,14 → 55,21
else if(getId().equals("T8"))
return "Trimestre 8";
 
return "Desconhecido";
return getSemestreDesc();
}
 
 
 
public void setId(String semestre)
{
 
super.setId(semestre);
setSemestreDesc(getSemestreDescAux());
if(!semestre.equals("OP"))
{
setSemestreDesc(getSemestreDescAux());
setSemestreDescEn("");
setSemestreDescEs("");
setSemestreDescFr("");
}
}
}
/branches/v3/impl/src/java/pt/estgp/estgweb/web/controllers/courses/CoursesController.java
699,6 → 699,142
}
}
 
public ActionForward sendUpSemestre(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws ServletException
{
try
{
CourseStudiesPlansAdminForm frm = (CourseStudiesPlansAdminForm) form;
String semestreId = frm.getSemestreId();
for(int i = 0; i < frm.getPlanoEstudos().getSemestre().size();i++)
{
Curso.Semestre semestre = frm.getPlanoEstudos().getSemestre().get(i);
if(semestre.getSemestreId().equals(semestreId))
{
int nextPos = i-1;
frm.getPlanoEstudos().getSemestre().remove(i);
if(nextPos < 0)
nextPos = 0;
frm.getPlanoEstudos().getSemestre().add(nextPos,semestre);
break;
}
}
return mapping.findForward("editStudyPlan");
}
catch (Throwable e)
{
logger.error(e, e);
return mapping.findForward("error500");
}
}
public ActionForward sendDownSemestre(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws ServletException
{
try
{
CourseStudiesPlansAdminForm frm = (CourseStudiesPlansAdminForm) form;
String semestreId = frm.getSemestreId();
for(int i = 0; i < frm.getPlanoEstudos().getSemestre().size();i++)
{
Curso.Semestre semestre = frm.getPlanoEstudos().getSemestre().get(i);
if(semestre.getSemestreId().equals(semestreId))
{
int nextPos = i+1;
frm.getPlanoEstudos().getSemestre().remove(i);
if(nextPos >= frm.getPlanoEstudos().getSemestre().size())
frm.getPlanoEstudos().getSemestre().add(semestre);
else
frm.getPlanoEstudos().getSemestre().add(nextPos,semestre);
break;
}
}
return mapping.findForward("editStudyPlan");
}
catch (Throwable e)
{
logger.error(e, e);
return mapping.findForward("error500");
}
}
 
public ActionForward sendUpPerfil(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws ServletException
{
try
{
CourseStudiesPlansAdminForm frm = (CourseStudiesPlansAdminForm) form;
String perfilId = frm.getPerfilId();
 
for(Curso.Semestre semestre: frm.getPlanoEstudos().getSemestre())
{
for(int i = 0; i < semestre.getPerfil().size();i++)
{
Curso.Semestre.Perfil perfil = semestre.getPerfil().get(i);
if(perfil.getPerfilId().equals(perfilId))
{
int nextPos = i-1;
semestre.getPerfil().remove(i);
if(nextPos < 0)
nextPos = 0;
semestre.getPerfil().add(nextPos,perfil);
break;
}
}
}
return mapping.findForward("editStudyPlan");
}
catch (Throwable e)
{
logger.error(e, e);
return mapping.findForward("error500");
}
}
public ActionForward sendDownPerfil(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws ServletException
{
try
{
CourseStudiesPlansAdminForm frm = (CourseStudiesPlansAdminForm) form;
String perfilId = frm.getPerfilId();
 
for(Curso.Semestre semestre: frm.getPlanoEstudos().getSemestre())
{
for(int i = 0; i < semestre.getPerfil().size();i++)
{
Curso.Semestre.Perfil perfil = semestre.getPerfil().get(i);
if(perfil.getPerfilId().equals(perfilId))
{
int nextPos = i+1;
semestre.getPerfil().remove(i);
if(nextPos >= semestre.getPerfil().size())
semestre.getPerfil().add(perfil);
else
semestre.getPerfil().add(nextPos,perfil);
break;
}
}
}
return mapping.findForward("editStudyPlan");
}
catch (Throwable e)
{
logger.error(e, e);
return mapping.findForward("error500");
}
}
 
public ActionForward clonarPlano(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
/branches/v3/impl/src/web/user/courses/studiesPlansAdministrationEdit.jsp
288,14 → 288,43
$("#removed" + "dummyIndex" + dummyIndexId).closest("tr").hide("slow");
 
}
 
function sendUpSemestre(dummySemestreId,form)
{
$(form.semestreId).val("semestreDummy" + dummySemestreId);
$(form.dispatch).val("sendUpSemestre");
form.submit();
}
function sendDownSemestre(dummySemestreId,form)
{
$(form.semestreId).val("semestreDummy" +dummySemestreId);
$(form.dispatch).val("sendDownSemestre");
form.submit();
}
 
function sendUpPerfil(dummyPerfilId,form,dummySemestreId)
{
form.action = form.action + "#" + dummySemestreId;
$(form.perfilId).val("perfilDummy" + dummyPerfilId);
$(form.dispatch).val("sendUpPerfil");
form.submit();
}
function sendDownPerfil(dummyPerfilId,form,dummySemestreId)
{
form.action = form.action + "#" + dummySemestreId;
$(form.perfilId).val("perfilDummy" + dummyPerfilId);
$(form.dispatch).val("sendDownPerfil");
form.submit();
}
</script>
<nested:notEmpty property="planoEstudos">
 
<html:hidden property="planoEstudos.siges"/>
<html:hidden property="planoEstudos.nome"/>
<html:hidden property="planoEstudos.dep"/>
<nested:iterate id="semestre" property="planoEstudos.semestre" type="pt.estgp.estgweb.services.courses.xsd.Curso.Semestre">
<div class="panel panel-default">
<nested:size id="tamanhoSemestre" property="planoEstudos.semestre"/>
<nested:iterate id="semestre" indexId="semestreIndexId" property="planoEstudos.semestre" type="pt.estgp.estgweb.services.courses.xsd.Curso.Semestre">
<div class="panel panel-primary">
<div class="panel-heading">
 
<div class="form-group">
304,7 → 333,13
request.setAttribute("dummyIndexSemestreId",dummyIndexSemestreId);
%>
<nested:hidden property="semestreId" value="semestreDummy${dummyIndexSemestreId}"/>
<div class="col-sm-1">
<div class="col-sm-2">
<button type="button" class="btn btn-warning" onclick="sendUpSemestre('<%=dummyIndexSemestreId%>',this.form)">
<span class="glyphicon glyphicon-arrow-up"> </span>
</button>
<button type="button" class="btn btn-warning" onclick="sendDownSemestre('<%=dummyIndexSemestreId%>',this.form)">
<span class="glyphicon glyphicon-arrow-down"> </span>
</button>
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#confirm-ModalFunction" data-message="Esta operação vai remover todas as unidades e perfis deste semestre!! Tem a certeza que deseja prosseguir? A operação não afeta as unidades nem os cursos do PAE, apenas o plano." data-script="$('#semestreId').val('semestreDummy${dummyIndexSemestreId}');set($('#CourseStudiesPlansAdminForm').get(0),'removeSemestre');$('#CourseStudiesPlansAdminForm').get(0).submit()">
<span class="glyphicon glyphicon-remove"> </span>
</button>
312,8 → 347,29
<div class="col-sm-1">
Duração
</div>
<div class="col-sm-4">
<nested:select styleClass="form-control" property="id">
<div class="col-sm-3">
<script>
$(document).ready(
function()
{
showHideSemestreDesc${dummyIndexSemestreId}();
}
);
 
 
function showHideSemestreDesc${dummyIndexSemestreId}()
{
if($("#selectSemestreDesc${dummyIndexSemestreId}").val()=='OP')
{
$('#semestreDescContainer${dummyIndexSemestreId}').show();
}
else
{
$('#semestreDescContainer${dummyIndexSemestreId}').hide();
}
}
</script>
<nested:select styleClass="form-control" property="id" styleId="selectSemestreDesc${dummyIndexSemestreId}" onchange="showHideSemestreDesc${dummyIndexSemestreId}(this)">
<html:option value="S1">Semestre 1</html:option>
<html:option value="S2">Semestre 2</html:option>
<html:option value="S3">Semestre 3</html:option>
328,7 → 384,14
<html:option value="T6">Trimestre 6</html:option>
<html:option value="T7">Trimestre 7</html:option>
<html:option value="T8">Trimestre 8</html:option>
<html:option value="OP">Opcionais</html:option>
</nested:select>
<div id="semestreDescContainer${dummyIndexSemestreId}">
Descrição (PT) <nested:text property="semestreDesc" styleClass="form-control"/>
Descrição (EN) <nested:text property="semestreDescEn" styleClass="form-control"/>
Descrição (ES) <nested:text property="semestreDescEs" styleClass="form-control"/>
Descrição (FR) <nested:text property="semestreDescFr" styleClass="form-control"/>
</div>
</div>
<div class="col-sm-6">
 
348,7 → 411,9
 
 
<button class="btn btn-default" data-toggle="collapse" type="button" data-target=".langs">Ver Campos Multingua</button>
<nested:iterate id="perfil" property="perfil" type="pt.estgp.estgweb.services.courses.xsd.Curso.Semestre.Perfil">
 
<nested:size id="tamanhoPerfil" property="perfil"/>
<nested:iterate id="perfil" indexId="perfilIndexId" property="perfil" type="pt.estgp.estgweb.services.courses.xsd.Curso.Semestre.Perfil">
<div class="panel panel-default">
<div class="panel-heading">
<div class="form-group">
358,7 → 423,13
%>
<a name="perfilDummy${dummyIndexPerfilId}"></a>
<nested:hidden property="perfilId" value="perfilDummy${dummyIndexPerfilId}"/>
<div class="col-sm-1">
<div class="col-sm-2">
<button type="button" class="btn btn-warning" onclick="sendUpPerfil('<%=dummyIndexPerfilId%>',this.form,'semestreDummy${dummyIndexSemestreId}')">
<span class="glyphicon glyphicon-arrow-up"> </span>
</button>
<button type="button" class="btn btn-warning" onclick="sendDownPerfil('<%=dummyIndexPerfilId%>',this.form,'semestreDummy${dummyIndexSemestreId}')">
<span class="glyphicon glyphicon-arrow-down"> </span>
</button>
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#confirm-ModalFunction" data-message="Esta operação vai remover todas as unidades deste perfil!! Tem a certeza que deseja prosseguir? A operação não afeta as unidades nem os cursos do PAE, apenas o plano." data-script="$('#CourseStudiesPlansAdminForm').get(0).action=$('#CourseStudiesPlansAdminForm').get(0).action+'#semestreDummy${dummyIndexSemestreId}';$('#perfilId').val('perfilDummy${dummyIndexPerfilId}');set($('#CourseStudiesPlansAdminForm').get(0),'removePerfil');$('#CourseStudiesPlansAdminForm').get(0).submit()">
<span class="glyphicon glyphicon-remove"> </span>
</button>
366,7 → 437,7
<div class="col-sm-1">
Perfil
</div>
<div class="col-sm-6">
<div class="col-sm-5">
<nested:text styleClass="form-control" property="nome"/>
</div>
<div class="col-sm-4">
416,16 → 487,28
<tr <nested:equal property="removed" value="true">class="hidden"</nested:equal>>
<td class="text-nowrap">
 
<nested:greaterThan value="0" name="indexId">
<%--
Usando o dummyIndex apenas não colocamos botao de up na primeira de todas as unidades de todos os semestres
Antes usavamos o indexId e trabalhavamos lista a lista considerando semestres e perfis independentes
--%>
<nested:notEqual value="dummyIndex1" name="dummyIndexIdUnidades">
<button type="button" class="btn btn-warning" onclick="sendUpUnidadeCurricular(<%=dummyIndexIdUnidades%>)">
<span class="glyphicon glyphicon-arrow-up"> </span>
</button>
</nested:greaterThan>
<nested:lessThan name="indexId" value="${tamanhoMinus1}">
</nested:notEqual>
<%
boolean perfilMaximoAtingido = perfilIndexId >= tamanhoPerfil - 1;
boolean semestreMaximoAtingido = semestreIndexId >= tamanhoSemestre - 1;
boolean tamanhoMaximoAtingido = indexId >= tamanho - 1;
if(!perfilMaximoAtingido || !semestreMaximoAtingido || !tamanhoMaximoAtingido)
{
%>
<button type="button" class="btn btn-warning" onclick="sendDownUnidadeCurricular(<%=dummyIndexIdUnidades%>)">
<span class="glyphicon glyphicon-arrow-down"> </span>
</button>
</nested:lessThan>
<%
}
%>
</td>
<td>
<nested:hidden styleId="removed${dummyIndexIdUnidades}" property="removed"/>
514,16 → 597,27
<tr <nested:equal property="removed" value="true">class="hidden"</nested:equal>>
<td class="text-nowrap">
 
<nested:greaterThan value="0" name="indexId">
<%--
Usando o dummyIndex apenas não colocamos botao de up na primeira de todas as unidades de todos os semestres
Antes usavamos o indexId e trabalhavamos lista a lista considerando semestres e perfis independentes
--%>
<nested:notEqual value="dummyIndex1" name="dummyIndexIdUnidades">
<button type="button" class="btn btn-warning" onclick="sendUpUnidadeCurricular(<%=dummyIndexIdUnidades%>)">
<span class="glyphicon glyphicon-arrow-up"> </span>
</button>
</nested:greaterThan>
<nested:lessThan name="indexId" value="${tamanhoMinus1}">
<button type="button" class="btn btn-warning" onclick="sendDownUnidadeCurricular(<%=dummyIndexIdUnidades%>)">
<span class="glyphicon glyphicon-arrow-down"> </span>
</button>
</nested:lessThan>
</nested:notEqual>
<%
boolean semestreMaximoAtingido = semestreIndexId >= tamanhoSemestre - 1;
boolean tamanhoMaximoAtingido = indexId >= tamanho - 1;
if(!semestreMaximoAtingido || !tamanhoMaximoAtingido)
{
%>
<button type="button" class="btn btn-warning" onclick="sendDownUnidadeCurricular(<%=dummyIndexIdUnidades%>)">
<span class="glyphicon glyphicon-arrow-down"> </span>
</button>
<%
}
%>
</td>
<td>
<nested:hidden styleId="removed${dummyIndexIdUnidades}" property="removed"/>
/branches/v3/impl/src/xsd/planoestudos.xsd
27,6 → 27,9
</xsd:element>
</xsd:choice>
<xsl:attribute name="semestreDesc" type="xsd:string" use="optional"/>
<xsl:attribute name="semestreDescEn" type="xsd:string" use="optional"/>
<xsl:attribute name="semestreDescEs" type="xsd:string" use="optional"/>
<xsl:attribute name="semestreDescFr" type="xsd:string" use="optional"/>
<xsd:attribute name="id" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
/branches/v3/impl/gen/java/pt/estgp/estgweb/services/courses/xsd/package-info.java
2,7 → 2,7
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2016.09.21 at 06:58:08 PM WEST
// Generated on: 2016.09.26 at 01:15:21 PM WEST
//
 
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.estgp.pt/xsd/planoestudos/1.0/", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
/branches/v3/impl/gen/java/pt/estgp/estgweb/services/courses/xsd/Curso.java
2,20 → 2,15
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2016.09.21 at 06:58:08 PM WEST
// Generated on: 2016.09.26 at 01:15:21 PM WEST
//
 
 
package pt.estgp.estgweb.services.courses.xsd;
 
import javax.xml.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
 
 
/**
52,6 → 47,9
* &lt;/element>
* &lt;/choice>
* &lt;attribute name="semestreDesc" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="semestreDescEn" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="semestreDescEs" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="semestreDescFr" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="id" use="required">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
235,6 → 233,9
* &lt;/element>
* &lt;/choice>
* &lt;attribute name="semestreDesc" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="semestreDescEn" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="semestreDescEs" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="semestreDescFr" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="id" use="required">
* &lt;simpleType>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string">
277,6 → 278,12
protected List<Curso.Semestre.Perfil> perfil;
@XmlAttribute
protected String semestreDesc;
@XmlAttribute
protected String semestreDescEn;
@XmlAttribute
protected String semestreDescEs;
@XmlAttribute
protected String semestreDescFr;
@XmlAttribute(required = true)
protected String id;
@XmlAttribute
365,6 → 372,78
}
 
/**
* Gets the value of the semestreDescEn property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSemestreDescEn() {
return semestreDescEn;
}
 
/**
* Sets the value of the semestreDescEn property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSemestreDescEn(String value) {
this.semestreDescEn = value;
}
 
/**
* Gets the value of the semestreDescEs property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSemestreDescEs() {
return semestreDescEs;
}
 
/**
* Sets the value of the semestreDescEs property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSemestreDescEs(String value) {
this.semestreDescEs = value;
}
 
/**
* Gets the value of the semestreDescFr property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSemestreDescFr() {
return semestreDescFr;
}
 
/**
* Sets the value of the semestreDescFr property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSemestreDescFr(String value) {
this.semestreDescFr = value;
}
 
/**
* Gets the value of the id property.
*
* @return
/branches/v3/impl/gen/java/pt/estgp/estgweb/services/courses/xsd/UnidadeType.java
2,7 → 2,7
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2016.09.21 at 06:58:08 PM WEST
// Generated on: 2016.09.26 at 01:15:21 PM WEST
//
 
 
/branches/v3/impl/gen/java/pt/estgp/estgweb/services/courses/xsd/ObjectFactory.java
2,7 → 2,7
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2016.09.21 at 06:58:08 PM WEST
// Generated on: 2016.09.26 at 01:15:21 PM WEST
//
 
 
45,11 → 45,11
}
 
/**
* Create an instance of {@link Curso }
* Create an instance of {@link UnidadeType.HorasContacto }
*
*/
public Curso createCurso() {
return new Curso();
public UnidadeType.HorasContacto createUnidadeTypeHorasContacto() {
return new UnidadeType.HorasContacto();
}
 
/**
61,19 → 61,19
}
 
/**
* Create an instance of {@link UnidadeType.HorasContacto }
* Create an instance of {@link Curso.Semestre.Perfil }
*
*/
public UnidadeType.HorasContacto createUnidadeTypeHorasContacto() {
return new UnidadeType.HorasContacto();
public Curso.Semestre.Perfil createCursoSemestrePerfil() {
return new Curso.Semestre.Perfil();
}
 
/**
* Create an instance of {@link Curso.Semestre.Perfil }
* Create an instance of {@link Curso }
*
*/
public Curso.Semestre.Perfil createCursoSemestrePerfil() {
return new Curso.Semestre.Perfil();
public Curso createCurso() {
return new Curso();
}
 
}