riscosHash;
+
+
+ public static enum PAGINATION_ENUM
+ {
+ NORMAL( 0, "Normal" ),
+ PATRIMONIAIS( 1, "Patrimoniais" )
+ ;
+
+ private Integer code = null;
+ private String type = null;
+
+ PAGINATION_ENUM( Integer code, String type )
+ {
+ this.code = code;
+ this.type = type;
+ }
+
+ public Integer getCode() {
+ return code;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ }
+
+ private Map< PAGINATION_ENUM, Pagination > paginationMap = null;
+// private Pagination pagination = null;
private String logoEmpresaUrl = "";
@@ -329,13 +358,33 @@ public class SessionBean1 extends AbstractSessionBean {
this.riscosHash = riscosHash;
}
- public Pagination getPagination() {
- return pagination;
- }
- public void setPagination(Pagination pagination) {
- this.pagination = pagination;
- }
+ public void addPagination( PAGINATION_ENUM type, Pagination pagination )
+ {
+ if ( paginationMap == null )
+ {
+ paginationMap = new HashMap< PAGINATION_ENUM, Pagination >();
+ }
+
+ paginationMap.put( type, pagination );
+ }
+
+ public Pagination getPagination( PAGINATION_ENUM type )
+ {
+ Pagination pagination = null;
+ if ( paginationMap != null )
+ {
+ pagination = paginationMap.get( type );
+ }
+ return pagination;
+ }
+// public Pagination getPagination() {
+// return pagination;
+// }
+//
+// public void setPagination(Pagination pagination) {
+// this.pagination = pagination;
+// }
public Risco getCurrentRisco() {
return currentRisco;
diff --git a/trunk/PlanosActuacao/src/java/planosactuacao/ViewPlano.java b/trunk/PlanosActuacao/src/java/planosactuacao/ViewPlano.java
index a6590e07..c02a4cc0 100644
--- a/trunk/PlanosActuacao/src/java/planosactuacao/ViewPlano.java
+++ b/trunk/PlanosActuacao/src/java/planosactuacao/ViewPlano.java
@@ -17,12 +17,14 @@ import db.entidades.Medida;
import db.entidades.PlanoActuacao;
import db.entidades.PostoTrabalho;
import db.entidades.Risco;
-import db.entidades.Valor;
import db.providers.UtilizadoresLogic;
import java.text.SimpleDateFormat;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.List;
import javax.faces.FacesException;
import javax.faces.component.html.HtmlPanelGrid;
+import javax.sound.midi.SysexMessage;
/**
* Page bean that corresponds to a similarly named JSP page. This
@@ -197,14 +199,12 @@ public class ViewPlano extends AbstractPageBean
{
System.out.println( "\nViewPlano . showPlano( " + p.getId() + " ) : \n" );
-
gridPlano = new HtmlPanelGrid();
- gridPlano.setId("gridPlano");
- gridPlano.setWidth("100%");
- gridPlano.setColumns(1);
- gridPlano.setStyle("background-color: #f6f4e8; border: solid 1px #000000");
- gridPlano.setColumnClasses("gridColCenter");
- //plano
+ gridPlano.setId( "gridPlano" );
+ gridPlano.setWidth( "100%" );
+ gridPlano.setColumns( 1 );
+ gridPlano.setStyle( "background-color: #f6f4e8; border: solid 1px #000000" );
+ gridPlano.setColumnClasses( "gridColCenter" );
//lblTop.setText("Plano de actuação da auditoria " + p.getData_visita_str());
if ( p.getConcluidoPorDesactivacao() )
@@ -214,97 +214,101 @@ public class ViewPlano extends AbstractPageBean
st.setStyle( "color: #FF0000; font-weight: bold; font-size: 13px;" );
gridPlano.getChildren().add( st );
}
- gridLayout.getChildren().add(gridPlano);
- showAreas(p.getAreas());
- showValidacoes(gridPlano, p);
+ gridLayout.getChildren().add( gridPlano );
+ showAreas( p.getAreas() );
+ showValidacoes( gridPlano, p );
}
- private void showAreas(List areas)
+ private void showAreas( List< Area > areas )
{
int i = 0;
- for(Area area : areas)
+ for( Area area : areas )
{
i++;
gridArea = new HtmlPanelGrid();
- gridArea.setColumns(1);
- gridArea.setColumnClasses("gridColCenter");
- gridArea.setWidth("100%");
+ gridArea.setColumns( 1 );
+ gridArea.setColumnClasses( "gridColCenter" );
+ gridArea.setWidth( "100%" );
- gridPlano.getChildren().add(gridArea);
+ gridPlano.getChildren().add( gridArea );
pg = new PanelGroup();
st = new StaticText();
- st.setEscape(false);
- st.setStyleClass("label");
- st.setText("Área: ");
- pg.getChildren().add(st);
+ st.setEscape( false );
+ st.setStyleClass( "label" );
+ st.setText( "Área: " );
+ pg.getChildren().add( st );
st = new StaticText();
- st.setId("fakeLink" + i);
- st.setStyleClass("fakeLink");
- st.setOnMouseOver("this.style.textDecoration = 'underline'");
- st.setOnMouseOut("this.style.textDecoration = 'none'");
- st.setOnClick("expand(this)");
- st.setEscape(false);
- st.setText(area.getDescricao());
- pg.getChildren().add(st);
+ st.setId( "fakeLink" + i );
+ st.setStyleClass( "fakeLink" );
+ st.setOnMouseOver( "this.style.textDecoration = 'underline'" );
+ st.setOnMouseOut( "this.style.textDecoration = 'none'" );
+ st.setOnClick( "expand(this)" );
+ st.setEscape( false );
+ st.setText( area.getDescricao() );
+ pg.getChildren().add( st );
- gridArea.getChildren().add(pg);
+ gridArea.getChildren().add( pg );
gridAreaContainer = new HtmlPanelGrid();
- gridAreaContainer.setId("area_container" + i);
+ gridAreaContainer.setId( "area_container" + i );
////gridAreaContainer.setStyle("border: solid 1px #000000; width: 100%;");
- gridAreaContainer.setStyleClass("hidden");
+ gridAreaContainer.setStyleClass( "hidden" );
//gridAreaContainer.setStyleClass("visible");
- gridAreaContainer.setColumns(1);
- gridAreaContainer.setColumnClasses("gridColLeft");
- gridAreaContainer.setWidth("100%");
-
-// st = new StaticText();
-// st.setEscape(false);
-// st.setText("AAAAAAAAA");
-// gridAreaContainer.getChildren().add(st);
-
- gridArea.getChildren().add(gridAreaContainer);
- showRiscos(area.getRiscos());
+ gridAreaContainer.setColumns( 1 );
+ gridAreaContainer.setColumnClasses( "gridColLeft" );
+ gridAreaContainer.setWidth( "100%" );
+
+ gridArea.getChildren().add( gridAreaContainer );
+ showRiscos( area.getRiscos() );
}
}
- private void showRiscos(List riscos)
+ private void showRiscos( List< Risco > riscos )
{
int rCount = 0;
- for(Risco risco : riscos)
+ Collections.sort( riscos, new Comparator< Risco >()
+ {
+ public int compare( Risco o1, Risco o2 )
+ {
+ // false first, true after
+ return o1.getIsPatrimonial().compareTo( o2.getIsPatrimonial() );
+ }
+ } );
+
+ for ( Risco risco : riscos )
{
HtmlPanelGrid grd = new HtmlPanelGrid();
- grd.setColumns(1);
- grd.setColumnClasses("gridColLeft");
+ grd.setColumns( 1 );
+ grd.setColumnClasses( "gridColLeft" );
//grd.setStyle("border: solid 1px #0000FF; display: inline; width: 100%");
- grd.setStyle("display: block; width: 100%");
- grd.setWidth("100%");
+ grd.setStyle( "display: block; width: 100%" );
+ grd.setWidth( "100%" );
//grd.setStyleClass("centerBlock");
//gridArea.getChildren().add(grd);
- gridAreaContainer.getChildren().add(grd);
+ gridAreaContainer.getChildren().add( grd );
gridRisco = new HtmlPanelGrid();
//gridRisco.setStyleClass("centerBlock");
- gridRisco.setStyle("display: block; width: 98%");
- gridRisco.setWidth("98%");
- gridRisco.setColumns(1);
- gridRisco.setColumnClasses("gridColLeft");
- grd.getChildren().add(gridRisco);
+ gridRisco.setStyle( "display: block; width: 98%" );
+ gridRisco.setWidth( "98%" );
+ gridRisco.setColumns( 1 );
+ gridRisco.setColumnClasses( "gridColLeft" );
+ grd.getChildren().add( gridRisco );
pg = new PanelGroup();
st = new StaticText();
- st.setEscape(false);
- st.setStyleClass("label");
- st.setText("Risco: ");
- pg.getChildren().add(st);
+ st.setEscape( false );
+ st.setStyleClass( "label" );
+ st.setText( "Risco: " );
+ pg.getChildren().add( st );
st = new StaticText();
- st.setEscape(false);
- st.setText(risco.getDescricao());
- pg.getChildren().add(st);
- gridRisco.getChildren().add(pg);
+ st.setEscape( false );
+ st.setText( risco.getDescricao() );
+ pg.getChildren().add( st );
+ gridRisco.getChildren().add( pg );
//showValores(risco.getValores());
- showValor(risco);
+ showValor( risco );
//showMedidas(risco.getMedidas());
if ( rCount < riscos.size() - 1 )
@@ -316,403 +320,400 @@ public class ViewPlano extends AbstractPageBean
}
}
- private void showValor(Risco r)
+ private void showValor( Risco r )
{
- HtmlPanelGrid grd = new HtmlPanelGrid();
- grd.setColumns(1);
- grd.setWidth("100%");
- grd.setStyleClass("centerBlock");
- grd.setStyle("display: block");
- //gridRisco.getChildren().add(grd);
-
- gridValor = new HtmlPanelGrid();
- gridRisco.getChildren().add(gridValor);
- //gridValor.setStyleClass("centerBlock");
- gridValor.setStyle("display: block");
- gridValor.setWidth("100%");
- gridValor.setColumns(1);
- gridValor.setColumnClasses("gridColLeft");
- //grd.getChildren().add(gridValor);
- pg = new PanelGroup();
- st = new StaticText();
- st.setEscape(false);
- st.setStyleClass("label");
- st.setText("Valor: ");
- pg.getChildren().add(st);
- st = new StaticText();
- st.setEscape(false);
- if(r.getValor() == null)
- {
- st.setText("IND");
- }
- else
- {
- st.setText(r.getValor().toString());
- }
- pg.getChildren().add(st);
- gridValor.getChildren().add(pg);
-
- showMedidas(r.getMedidas());
-
- grd = new HtmlPanelGrid();
- grd.setColumns(1);
- grd.setWidth("100%");
- //grd.setStyleClass("centerBlock");
- gridValor.getChildren().add(grd);
- HtmlPanelGrid gridParecer = new HtmlPanelGrid();
- gridParecer.setStyleClass("centerBlock");
- gridParecer.setStyle("display: block");
- gridParecer.setWidth("98%");
- gridParecer.setColumns(1);
- gridParecer.setColumnClasses("gridColLeft");
- grd.getChildren().add(gridParecer);
-
- if(r.getResponsavel_execucao() != null)
- {
- if(r.getResponsavel_execucao().trim().length() > 0)
- {
- pg = new PanelGroup();
-
- st = new StaticText();
- st.setEscape(false);
- st.setStyleClass("label");
- st.setText("Responsável de execução: ");
- pg.getChildren().add(st);
- st = new StaticText();
- st.setEscape(false);
- st.setText(r.getResponsavel_execucao().toString());
- pg.getChildren().add(st);
-
-
- if(r.getPor() != null)
- {
- if(r.getPor().trim().length() > 0)
- {
- st = new StaticText();
- st.setEscape(false);
- st.setText(" ");
- pg.getChildren().add(st);
-
- st = new StaticText();
- st.setEscape(false);
- st.setStyleClass("label");
- st.setText("POR: ");
- pg.getChildren().add(st);
- st = new StaticText();
- st.setEscape(false);
- st.setText(r.getPor().toString());
- pg.getChildren().add(st);
- }
- }
-
- gridParecer.getChildren().add(pg);
- }
- }
-
- if(r.getRecursos_necessarios() != null)
- {
- if(r.getRecursos_necessarios().trim().length() > 0)
- {
- pg = new PanelGroup();
- st = new StaticText();
- st.setEscape(false);
- st.setStyleClass("label");
- st.setText("Recursos necessários: ");
- pg.getChildren().add(st);
- st = new StaticText();
- st.setEscape(false);
- st.setText(r.getRecursos_necessarios().toString());
- pg.getChildren().add(st);
- gridParecer.getChildren().add(pg);
- }
- }
-
- if(r.getData_inicio() != null)
- {
- pg = new PanelGroup();
- st = new StaticText();
- st.setEscape(false);
- st.setStyleClass("label");
- st.setText("Data início: ");
- pg.getChildren().add(st);
- st = new StaticText();
- st.setEscape(false);
- String data_str = "";
- SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
- data_str = formatter.format(r.getData_inicio());
- st.setText(data_str);
- pg.getChildren().add(st);
- gridParecer.getChildren().add(pg);
- }
-
- if(r.getData_fim() != null)
- {
- pg = new PanelGroup();
- st = new StaticText();
- st.setEscape(false);
- st.setStyleClass("label");
- st.setText("Data fim: ");
- pg.getChildren().add(st);
- st = new StaticText();
- st.setEscape(false);
- String data_str = "";
- SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
- data_str = formatter.format(r.getData_fim());
- st.setText(data_str);
- pg.getChildren().add(st);
- gridParecer.getChildren().add(pg);
- }
-
- if(r.getParecer_dl() != null)
- {
- if(r.getParecer_dl().trim().length() > 0)
- {
- pg = new PanelGroup();
- st = new StaticText();
- st.setEscape(false);
- st.setStyleClass("label");
- st.setText("Parecer DL: ");
- pg.getChildren().add(st);
- st = new StaticText();
- st.setEscape(false);
- st.setText(r.getParecer_dl().toString());
- pg.getChildren().add(st);
- gridParecer.getChildren().add(pg);
-
- }
- }
-
- if(r.getParecer_dns() != null)
- {
- if(r.getParecer_dns().trim().length() > 0)
- {
- pg = new PanelGroup();
- st = new StaticText();
- st.setEscape(false);
- st.setStyleClass("label");
- st.setText("Parecer DNS: ");
- pg.getChildren().add(st);
- st = new StaticText();
- st.setEscape(false);
- st.setText(r.getParecer_dns().toString());
- pg.getChildren().add(st);
- gridParecer.getChildren().add(pg);
-
- }
- }
-
- if(r.getVerificacao_siprp() != null)
- {
- if(r.getVerificacao_siprp().trim().length() > 0)
- {
- pg = new PanelGroup();
- st = new StaticText();
- st.setEscape(false);
- st.setStyleClass("label");
- st.setText("Verificação SIPRP: ");
- pg.getChildren().add(st);
- st = new StaticText();
- st.setEscape(false);
- st.setText(r.getVerificacao_siprp().toString());
- pg.getChildren().add(st);
- gridParecer.getChildren().add(pg);
-
- }
- }
+ HtmlPanelGrid grd = new HtmlPanelGrid();
+ grd.setColumns( 1 );
+ grd.setWidth( "100%" );
+ grd.setStyleClass( "centerBlock" );
+ grd.setStyle( "display: block" );
+ //gridRisco.getChildren().add(grd);
+
+ gridValor = new HtmlPanelGrid();
+ gridRisco.getChildren().add( gridValor );
+ //gridValor.setStyleClass("centerBlock");
+ gridValor.setStyle( "display: block" );
+ gridValor.setWidth( "100%" );
+ gridValor.setColumns( 1 );
+ gridValor.setColumnClasses( "gridColLeft" );
+ //grd.getChildren().add(gridValor);
+ pg = new PanelGroup();
+ st = new StaticText();
+ st.setEscape( false );
+ st.setStyleClass( "label" );
+ st.setText( "Valor: " );
+ pg.getChildren().add( st );
+ st = new StaticText();
+ st.setEscape( false );
+ if ( r.getValor() == null )
+ {
+ st.setText( "IND" );
+ }
+ else
+ {
+ st.setText( r.getValor().toString() );
+ }
+ pg.getChildren().add( st );
+ gridValor.getChildren().add( pg );
+
+ showMedidas( r.getMedidas() );
+
+ grd = new HtmlPanelGrid();
+ grd.setColumns( 1 );
+ grd.setWidth( "100%" );
+ //grd.setStyleClass("centerBlock");
+ gridValor.getChildren().add( grd );
+ HtmlPanelGrid gridParecer = new HtmlPanelGrid();
+ gridParecer.setStyleClass( "centerBlock" );
+ gridParecer.setStyle( "display: block" );
+ gridParecer.setWidth( "98%" );
+ gridParecer.setColumns( 1 );
+ gridParecer.setColumnClasses( "gridColLeft" );
+ grd.getChildren().add( gridParecer );
+
+ if ( r.getResponsavel_execucao() != null )
+ {
+ if ( r.getResponsavel_execucao().trim().length() > 0 )
+ {
+ pg = new PanelGroup();
+
+ st = new StaticText();
+ st.setEscape( false );
+ st.setStyleClass( "label" );
+ st.setText( "Responsável de execução: " );
+ pg.getChildren().add( st );
+ st = new StaticText();
+ st.setEscape( false );
+ st.setText( r.getResponsavel_execucao().toString() );
+ pg.getChildren().add( st );
+
+ if ( r.getPor() != null )
+ {
+ if ( r.getPor().trim().length() > 0 )
+ {
+ st = new StaticText();
+ st.setEscape( false );
+ st.setText( " " );
+ pg.getChildren().add( st );
+
+ st = new StaticText();
+ st.setEscape( false );
+ st.setStyleClass( "label" );
+ st.setText( "POR: " );
+ pg.getChildren().add( st );
+ st = new StaticText();
+ st.setEscape( false );
+ st.setText( r.getPor().toString() );
+ pg.getChildren().add( st );
+ }
+ }
+
+ gridParecer.getChildren().add( pg );
+ }
+ }
+
+ if ( r.getRecursos_necessarios() != null )
+ {
+ if ( r.getRecursos_necessarios().trim().length() > 0 )
+ {
+ pg = new PanelGroup();
+ st = new StaticText();
+ st.setEscape( false );
+ st.setStyleClass( "label" );
+ st.setText( "Recursos necessários: " );
+ pg.getChildren().add( st );
+ st = new StaticText();
+ st.setEscape( false );
+ st.setText( r.getRecursos_necessarios().toString() );
+ pg.getChildren().add( st );
+ gridParecer.getChildren().add( pg );
+ }
+ }
+
+ if ( r.getData_inicio() != null )
+ {
+ pg = new PanelGroup();
+ st = new StaticText();
+ st.setEscape( false );
+ st.setStyleClass( "label" );
+ st.setText( "Data início: " );
+ pg.getChildren().add( st );
+ st = new StaticText();
+ st.setEscape( false );
+ String data_str = "";
+ SimpleDateFormat formatter = new SimpleDateFormat( "dd/MM/yyyy" );
+ data_str = formatter.format( r.getData_inicio() );
+ st.setText( data_str );
+ pg.getChildren().add( st );
+ gridParecer.getChildren().add( pg );
+ }
+
+ if ( r.getData_fim() != null )
+ {
+ pg = new PanelGroup();
+ st = new StaticText();
+ st.setEscape( false );
+ st.setStyleClass( "label" );
+ st.setText( "Data fim: " );
+ pg.getChildren().add( st );
+ st = new StaticText();
+ st.setEscape( false );
+ String data_str = "";
+ SimpleDateFormat formatter = new SimpleDateFormat( "dd/MM/yyyy" );
+ data_str = formatter.format( r.getData_fim() );
+ st.setText( data_str );
+ pg.getChildren().add( st );
+ gridParecer.getChildren().add( pg );
+ }
+
+ if ( r.getParecer_dl() != null )
+ {
+ if ( r.getParecer_dl().trim().length() > 0 )
+ {
+ pg = new PanelGroup();
+ st = new StaticText();
+ st.setEscape( false );
+ st.setStyleClass( "label" );
+ st.setText( "Parecer DL: " );
+ pg.getChildren().add( st );
+ st = new StaticText();
+ st.setEscape( false );
+ st.setText( r.getParecer_dl().toString() );
+ pg.getChildren().add( st );
+ gridParecer.getChildren().add( pg );
+ }
+ }
+
+ if ( r.getParecer_dns() != null )
+ {
+ if ( r.getParecer_dns().trim().length() > 0 )
+ {
+ pg = new PanelGroup();
+ st = new StaticText();
+ st.setEscape( false );
+ st.setStyleClass( "label" );
+ st.setText( "Parecer DNS: " );
+ pg.getChildren().add( st );
+ st = new StaticText();
+ st.setEscape( false );
+ st.setText( r.getParecer_dns().toString() );
+ pg.getChildren().add( st );
+ gridParecer.getChildren().add( pg );
+
+ }
+ }
+
+ if ( r.getVerificacao_siprp() != null )
+ {
+ if ( r.getVerificacao_siprp().trim().length() > 0 )
+ {
+ pg = new PanelGroup();
+ st = new StaticText();
+ st.setEscape( false );
+ st.setStyleClass( "label" );
+ st.setText( "Verificação SIPRP: " );
+ pg.getChildren().add( st );
+ st = new StaticText();
+ st.setEscape( false );
+ st.setText( r.getVerificacao_siprp().toString() );
+ pg.getChildren().add( st );
+ gridParecer.getChildren().add( pg );
+ }
+ }
}
- private void showValores(List valores)
- {
- for(Valor valor : valores)
- {
- HtmlPanelGrid grd = new HtmlPanelGrid();
- grd.setColumns(1);
- grd.setWidth("100%");
- //grd.setStyleClass("centerBlock");
- //gridRisco.getChildren().add(grd);
-
- gridValor = new HtmlPanelGrid();
- gridRisco.getChildren().add(gridValor);
- ////gridValor.setStyleClass("centerBlock");
- gridValor.setWidth("100%");
- gridValor.setColumns(1);
- gridValor.setColumnClasses("gridColLeft");
- //grd.getChildren().add(gridValor);
- pg = new PanelGroup();
- st = new StaticText();
- st.setEscape(false);
- st.setStyleClass("label");
- st.setText("Valor: ");
- pg.getChildren().add(st);
- st = new StaticText();
- st.setEscape(false);
- if(valor.getValor() == null)
- {
- st.setText(" - ");
- }
- else
- {
- st.setText(valor.getValor().toString());
- }
- pg.getChildren().add(st);
- gridValor.getChildren().add(pg);
-
- showMedidas(valor.getMedidas());
-
- grd = new HtmlPanelGrid();
- grd.setColumns(1);
- grd.setWidth("100%");
- ////grd.setStyleClass("centerBlock");
- gridValor.getChildren().add(grd);
- HtmlPanelGrid gridParecer = new HtmlPanelGrid();
- gridParecer.setStyleClass("centerBlock");
- gridParecer.setWidth("98%");
- gridParecer.setColumns(1);
- gridParecer.setColumnClasses("gridColLeft");
- grd.getChildren().add(gridParecer);
-
- if(valor.getResponsavel_execucao() != null)
- {
- if(valor.getResponsavel_execucao().trim().length() > 0)
- {
- pg = new PanelGroup();
- st = new StaticText();
- st.setEscape(false);
- st.setStyleClass("label");
- st.setText("Responsável de execução: ");
- pg.getChildren().add(st);
- st = new StaticText();
- st.setEscape(false);
- st.setText(valor.getResponsavel_execucao().toString());
- pg.getChildren().add(st);
- gridParecer.getChildren().add(pg);
- }
- }
-
- if(valor.getRecursos_necessarios() != null)
- {
- if(valor.getRecursos_necessarios().trim().length() > 0)
- {
- pg = new PanelGroup();
- st = new StaticText();
- st.setEscape(false);
- st.setStyleClass("label");
- st.setText("Recursos necessários: ");
- pg.getChildren().add(st);
- st = new StaticText();
- st.setEscape(false);
- st.setText(valor.getRecursos_necessarios().toString());
- pg.getChildren().add(st);
- gridParecer.getChildren().add(pg);
- }
- }
-
- if(valor.getData_inicio() != null)
- {
- pg = new PanelGroup();
- st = new StaticText();
- st.setEscape(false);
- st.setStyleClass("label");
- st.setText("Data início: ");
- pg.getChildren().add(st);
- st = new StaticText();
- st.setEscape(false);
- String data_str = "";
- SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
- data_str = formatter.format(valor.getData_inicio());
- st.setText(data_str);
- pg.getChildren().add(st);
- gridParecer.getChildren().add(pg);
- }
-
- if(valor.getData_fim() != null)
- {
- pg = new PanelGroup();
- st = new StaticText();
- st.setEscape(false);
- st.setStyleClass("label");
- st.setText("Data fim: ");
- pg.getChildren().add(st);
- st = new StaticText();
- st.setEscape(false);
- String data_str = "";
- SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
- data_str = formatter.format(valor.getData_fim());
- st.setText(data_str);
- pg.getChildren().add(st);
- gridParecer.getChildren().add(pg);
- }
-
- if(valor.getParecer_dl() != null)
- {
- if(valor.getParecer_dl().trim().length() > 0)
- {
- pg = new PanelGroup();
- st = new StaticText();
- st.setEscape(false);
- st.setStyleClass("label");
- st.setText("Parecer DL: ");
- pg.getChildren().add(st);
- st = new StaticText();
- st.setEscape(false);
- st.setText(valor.getParecer_dl().toString());
- pg.getChildren().add(st);
- gridParecer.getChildren().add(pg);
-
- }
- }
-
- if(valor.getParecer_dns() != null)
- {
- if(valor.getParecer_dns().trim().length() > 0)
- {
- pg = new PanelGroup();
- st = new StaticText();
- st.setEscape(false);
- st.setStyleClass("label");
- st.setText("Parecer DNS: ");
- pg.getChildren().add(st);
- st = new StaticText();
- st.setEscape(false);
- st.setText(valor.getParecer_dns().toString());
- pg.getChildren().add(st);
- gridParecer.getChildren().add(pg);
-
- }
- }
-
- if(valor.getVerificacao_siprp() != null)
- {
- if(valor.getVerificacao_siprp().trim().length() > 0)
- {
- pg = new PanelGroup();
- st = new StaticText();
- st.setEscape(false);
- st.setStyleClass("label");
- st.setText("Verificação SIPRP: ");
- pg.getChildren().add(st);
- st = new StaticText();
- st.setEscape(false);
- st.setText(valor.getVerificacao_siprp().toString());
- pg.getChildren().add(st);
- gridParecer.getChildren().add(pg);
-
- }
- }
- //
- }
- }
+// private void showValores( List< Valor > valores )
+// {
+// for ( Valor valor : valores )
+// {
+// HtmlPanelGrid grd = new HtmlPanelGrid();
+// grd.setColumns( 1 );
+// grd.setWidth( "100%" );
+// //grd.setStyleClass("centerBlock");
+// //gridRisco.getChildren().add(grd);
+//
+// gridValor = new HtmlPanelGrid();
+// gridRisco.getChildren().add( gridValor );
+// ////gridValor.setStyleClass("centerBlock");
+// gridValor.setWidth( "100%" );
+// gridValor.setColumns( 1 );
+// gridValor.setColumnClasses( "gridColLeft" );
+// //grd.getChildren().add(gridValor);
+// pg = new PanelGroup();
+// st = new StaticText();
+// st.setEscape(false);
+// st.setStyleClass("label");
+// st.setText("Valor: ");
+// pg.getChildren().add(st);
+// st = new StaticText();
+// st.setEscape(false);
+// if(valor.getValor() == null)
+// {
+// st.setText(" - ");
+// }
+// else
+// {
+// st.setText(valor.getValor().toString());
+// }
+// pg.getChildren().add(st);
+// gridValor.getChildren().add(pg);
+//
+// showMedidas(valor.getMedidas());
+//
+// grd = new HtmlPanelGrid();
+// grd.setColumns(1);
+// grd.setWidth("100%");
+// ////grd.setStyleClass("centerBlock");
+// gridValor.getChildren().add(grd);
+// HtmlPanelGrid gridParecer = new HtmlPanelGrid();
+// gridParecer.setStyleClass("centerBlock");
+// gridParecer.setWidth("98%");
+// gridParecer.setColumns(1);
+// gridParecer.setColumnClasses("gridColLeft");
+// grd.getChildren().add(gridParecer);
+//
+// if(valor.getResponsavel_execucao() != null)
+// {
+// if(valor.getResponsavel_execucao().trim().length() > 0)
+// {
+// pg = new PanelGroup();
+// st = new StaticText();
+// st.setEscape(false);
+// st.setStyleClass("label");
+// st.setText("Responsável de execução: ");
+// pg.getChildren().add(st);
+// st = new StaticText();
+// st.setEscape(false);
+// st.setText(valor.getResponsavel_execucao().toString());
+// pg.getChildren().add(st);
+// gridParecer.getChildren().add(pg);
+// }
+// }
+//
+// if(valor.getRecursos_necessarios() != null)
+// {
+// if(valor.getRecursos_necessarios().trim().length() > 0)
+// {
+// pg = new PanelGroup();
+// st = new StaticText();
+// st.setEscape(false);
+// st.setStyleClass("label");
+// st.setText("Recursos necessários: ");
+// pg.getChildren().add(st);
+// st = new StaticText();
+// st.setEscape(false);
+// st.setText(valor.getRecursos_necessarios().toString());
+// pg.getChildren().add(st);
+// gridParecer.getChildren().add(pg);
+// }
+// }
+//
+// if(valor.getData_inicio() != null)
+// {
+// pg = new PanelGroup();
+// st = new StaticText();
+// st.setEscape(false);
+// st.setStyleClass("label");
+// st.setText("Data início: ");
+// pg.getChildren().add(st);
+// st = new StaticText();
+// st.setEscape(false);
+// String data_str = "";
+// SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
+// data_str = formatter.format(valor.getData_inicio());
+// st.setText(data_str);
+// pg.getChildren().add(st);
+// gridParecer.getChildren().add(pg);
+// }
+//
+// if(valor.getData_fim() != null)
+// {
+// pg = new PanelGroup();
+// st = new StaticText();
+// st.setEscape(false);
+// st.setStyleClass("label");
+// st.setText("Data fim: ");
+// pg.getChildren().add(st);
+// st = new StaticText();
+// st.setEscape(false);
+// String data_str = "";
+// SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
+// data_str = formatter.format(valor.getData_fim());
+// st.setText(data_str);
+// pg.getChildren().add(st);
+// gridParecer.getChildren().add(pg);
+// }
+//
+// if(valor.getParecer_dl() != null)
+// {
+// if(valor.getParecer_dl().trim().length() > 0)
+// {
+// pg = new PanelGroup();
+// st = new StaticText();
+// st.setEscape(false);
+// st.setStyleClass("label");
+// st.setText("Parecer DL: ");
+// pg.getChildren().add(st);
+// st = new StaticText();
+// st.setEscape(false);
+// st.setText(valor.getParecer_dl().toString());
+// pg.getChildren().add(st);
+// gridParecer.getChildren().add(pg);
+//
+// }
+// }
+//
+// if(valor.getParecer_dns() != null)
+// {
+// if(valor.getParecer_dns().trim().length() > 0)
+// {
+// pg = new PanelGroup();
+// st = new StaticText();
+// st.setEscape(false);
+// st.setStyleClass("label");
+// st.setText("Parecer DNS: ");
+// pg.getChildren().add(st);
+// st = new StaticText();
+// st.setEscape(false);
+// st.setText(valor.getParecer_dns().toString());
+// pg.getChildren().add(st);
+// gridParecer.getChildren().add(pg);
+//
+// }
+// }
+//
+// if(valor.getVerificacao_siprp() != null)
+// {
+// if(valor.getVerificacao_siprp().trim().length() > 0)
+// {
+// pg = new PanelGroup();
+// st = new StaticText();
+// st.setEscape(false);
+// st.setStyleClass("label");
+// st.setText("Verificação SIPRP: ");
+// pg.getChildren().add(st);
+// st = new StaticText();
+// st.setEscape(false);
+// st.setText(valor.getVerificacao_siprp().toString());
+// pg.getChildren().add(st);
+// gridParecer.getChildren().add(pg);
+//
+// }
+// }
+// //
+// }
+// }
- private void showMedidas(List medidas)
+ private void showMedidas( List< Medida > medidas )
{
- for(Medida medida : medidas)
+ for( Medida medida : medidas )
{
HtmlPanelGrid grd = new HtmlPanelGrid();
- grd.setColumns(1);
+ grd.setColumns( 1 );
grd.setWidth("100%");
////grd.setStyleClass("centerBlock");
grd.setStyle("display: block");
- gridValor.getChildren().add(grd);
+ gridValor.getChildren().add( grd );
gridMedida = new HtmlPanelGrid();
////gridMedida.setStyleClass("centerBlock");
@@ -720,20 +721,21 @@ public class ViewPlano extends AbstractPageBean
gridMedida.setWidth("98%");
gridMedida.setColumns(1);
gridMedida.setColumnClasses("gridColLeft");
- grd.getChildren().add(gridMedida);
+ grd.getChildren().add( gridMedida );
+
pg = new PanelGroup();
st = new StaticText();
st.setEscape(false);
- st.setStyleClass("label");
- st.setText("Medida: ");
- pg.getChildren().add(st);
+ st.setStyleClass("label");
+ st.setText("Medida: ");
+ pg.getChildren().add( st );
st = new StaticText();
- st.setEscape(false);
- st.setText(medida.getDescricao());
- pg.getChildren().add(st);
- gridMedida.getChildren().add(pg);
+ st.setEscape( false );
+ st.setText( medida.getDescricao() );
+ pg.getChildren().add( st );
+ gridMedida.getChildren().add( pg );
- showPostos(medida.getPostos());
+ showPostos( medida.getPostos() );
}
}
diff --git a/trunk/PlanosActuacao/web/EditarPlano.jsp b/trunk/PlanosActuacao/web/EditarPlano.jsp
index 2372a0c9..37b9015b 100644
--- a/trunk/PlanosActuacao/web/EditarPlano.jsp
+++ b/trunk/PlanosActuacao/web/EditarPlano.jsp
@@ -4,7 +4,12 @@
Created on : Aug 26, 2008, 3:10:59 PM
Author : lluis
-->
-
+
@@ -170,7 +175,8 @@
-
+
+
@@ -246,6 +252,7 @@
+