git-svn-id: https://svn.coded.pt/svn/SIPRP@1387 bb69d46d-e84e-40c8-a05a-06db0d633741

lxbfYeaa
Diogo Neves 15 years ago
parent 1e6867b32e
commit 143cea8170

@ -544,10 +544,11 @@ exists or setup the property manually. For example like this:
<copyfiles files="${file.reference.xercesImpl-2.7.1.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.xercesImpl-2.7.1.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.xml-apis-1.3.04.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.xml-apis-1.3.04.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.xml-apis-ext-1.3.04.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.xml-apis-ext-1.3.04.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${file.reference.serializer-2.7.0.jar}" iftldtodir="${build.web.dir}/WEB-INF" manifestproperty="manifest.file.reference.serializer-2.7.0.jar" todir="${dist.ear.dir}"/>
<copyfiles files="${libs.exceptionhandler-runtime.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
<mkdir dir="${build.web.dir}/META-INF"/>
<manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update">
<attribute name="Class-Path" value="${manifest.libs.jsf12.classpath} ${manifest.libs.jstl11.classpath} ${manifest.libs.jsf12-support.classpath} ${manifest.libs.woodstock-components.classpath} ${manifest.libs.woodstock-theme-default.classpath} ${manifest.file.reference.jdom.jar} ${manifest.file.reference.ashwood-2.0.jar} ${manifest.file.reference.avalon-framework-4.2.0.jar} ${manifest.file.reference.activation.jar} ${manifest.file.reference.fop.jar} ${manifest.file.reference.postgresql-8.2-506.jdbc4.jar} ${manifest.file.reference.jai_imageio.jar} ${manifest.file.reference.evologger.jar} ${manifest.file.reference.batik-all-1.7.jar} ${manifest.file.reference.xmlgraphics-commons-1.3.1.jar} ${manifest.file.reference.SIPRP.jar} ${manifest.file.reference.commons-io-1.4.jar} ${manifest.file.reference.commons-collections-3.1.jar} ${manifest.file.reference.commons-lang-2.1.jar} ${manifest.file.reference.commons-logging-1.1.jar} ${manifest.file.reference.evolute.jar} ${manifest.file.reference.mail.jar-1} ${manifest.file.reference.shst.jar} ${manifest.file.reference.log4j-1.2.15.jar} ${manifest.file.reference.xalan-2.7.0.jar} ${manifest.file.reference.xercesImpl-2.7.1.jar} ${manifest.file.reference.xml-apis-1.3.04.jar} ${manifest.file.reference.xml-apis-ext-1.3.04.jar} "/>
<attribute name="Class-Path" value="${manifest.libs.jsf12.classpath} ${manifest.libs.jstl11.classpath} ${manifest.libs.jsf12-support.classpath} ${manifest.libs.woodstock-components.classpath} ${manifest.libs.woodstock-theme-default.classpath} ${manifest.file.reference.jdom.jar} ${manifest.file.reference.ashwood-2.0.jar} ${manifest.file.reference.avalon-framework-4.2.0.jar} ${manifest.file.reference.activation.jar} ${manifest.file.reference.fop.jar} ${manifest.file.reference.postgresql-8.2-506.jdbc4.jar} ${manifest.file.reference.jai_imageio.jar} ${manifest.file.reference.evologger.jar} ${manifest.file.reference.batik-all-1.7.jar} ${manifest.file.reference.xmlgraphics-commons-1.3.1.jar} ${manifest.file.reference.SIPRP.jar} ${manifest.file.reference.commons-io-1.4.jar} ${manifest.file.reference.commons-collections-3.1.jar} ${manifest.file.reference.commons-lang-2.1.jar} ${manifest.file.reference.commons-logging-1.1.jar} ${manifest.file.reference.evolute.jar} ${manifest.file.reference.mail.jar-1} ${manifest.file.reference.shst.jar} ${manifest.file.reference.log4j-1.2.15.jar} ${manifest.file.reference.xalan-2.7.0.jar} ${manifest.file.reference.xercesImpl-2.7.1.jar} ${manifest.file.reference.xml-apis-1.3.04.jar} ${manifest.file.reference.xml-apis-ext-1.3.04.jar} ${manifest.file.reference.serializer-2.7.0.jar} "/>
</manifest>
</target>
<target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
@ -579,6 +580,7 @@ exists or setup the property manually. For example like this:
<copyfiles files="${file.reference.xercesImpl-2.7.1.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.xml-apis-1.3.04.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.xml-apis-ext-1.3.04.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${file.reference.serializer-2.7.0.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
<copyfiles files="${libs.exceptionhandler-runtime.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
</target>
<target depends="init,compile,compile-jsps,-pre-dist,library-inclusion-in-manifest" if="do.tmp.war.package" name="do-ear-dist">

@ -1,8 +1,8 @@
build.xml.data.CRC32=4c811ff2
build.xml.data.CRC32=7ab0589b
build.xml.script.CRC32=50b8b881
build.xml.stylesheet.CRC32=c0ebde35@1.15.2.1
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=4c811ff2
nbproject/build-impl.xml.script.CRC32=3b2cdd43
nbproject/build-impl.xml.data.CRC32=7ab0589b
nbproject/build-impl.xml.script.CRC32=a142f504
nbproject/build-impl.xml.stylesheet.CRC32=8ab4467e@1.15.2.1

@ -38,6 +38,7 @@ file.reference.jdom.jar=lib/jdom.jar
file.reference.log4j-1.2.15.jar=lib/log4j-1.2.15.jar
file.reference.mail.jar-1=lib/mail.jar
file.reference.postgresql-8.2-506.jdbc4.jar=lib/postgresql-8.2-506.jdbc4.jar
file.reference.serializer-2.7.0.jar=lib/serializer-2.7.0.jar
file.reference.shst.jar=lib/shst.jar
file.reference.SIPRP.jar=lib/SIPRP.jar
file.reference.xalan-2.7.0.jar=lib/xalan-2.7.0.jar
@ -78,7 +79,8 @@ javac.classpath=\
${file.reference.xalan-2.7.0.jar}:\
${file.reference.xercesImpl-2.7.1.jar}:\
${file.reference.xml-apis-1.3.04.jar}:\
${file.reference.xml-apis-ext-1.3.04.jar}
${file.reference.xml-apis-ext-1.3.04.jar}:\
${file.reference.serializer-2.7.0.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.debug=true

@ -119,6 +119,10 @@
<file>${file.reference.xml-apis-ext-1.3.04.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
<library>
<file>${file.reference.serializer-2.7.0.jar}</file>
<path-in-war>WEB-INF/lib</path-in-war>
</library>
</web-module-libraries>
<web-module-additional-libraries>
<library>

@ -398,16 +398,17 @@ public class RelatoriosDataProvider extends GenericDataProvider {
return nome;
}
public byte[] getLogoByEmpresa(Integer empresaId) throws Exception
public byte[] getLogoByEmpresa( Integer empresaId )
throws Exception
{
Statement st = dblocal.createStatement();
String sql = "select empresa_logo_id from empresas where id = " + empresaId;
ResultSet rslocal = st.executeQuery(sql);
if(rslocal.isBeforeFirst())
if ( rslocal.isBeforeFirst() )
{
rslocal.first();
Integer logoId = new Integer(rslocal.getInt("empresa_logo_id"));
byte[] logo = getLogo(logoId);
rslocal.first();
Integer logoId = new Integer( rslocal.getInt("empresa_logo_id") );
byte[] logo = getLogo( logoId );
return logo;
}

@ -17,32 +17,35 @@ import java.util.ArrayList;
*/
public class UtilizadoresDataProvider extends GenericDataProvider{
public Utilizador getUtilizador(Integer id) throws Exception
public Utilizador getUtilizador( Integer id ) throws Exception
{
Utilizador u = new Utilizador();
Statement st = createStatement();
Utilizador u = null;
Statement st = createStatement();
String sql = "SELECT * FROM utilizadores WHERE id = " + id;
ResultSet rs = st.executeQuery(sql);
rs.first();
u.setId(new Integer(rs.getInt("id")));
u.setLogin(rs.getString("login"));
u.setPassword(rs.getString("password"));
u.setData_password(rs.getDate("data_password"));
u.setEmail(rs.getString("email"));
u.setEmpresa_id(new Integer(rs.getInt("empresa_id")));
u.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id")));
u.setAdministrador(rs.getString("administrador"));
u.setTipo(new Integer(rs.getInt("tipo")));
u.setNumero_cedula(rs.getString("numero_cedula"));
u.setCap(rs.getString("cap"));
u.setNome(rs.getString("nome"));
u.setMedico_id(new Integer(rs.getInt("medico_id")));
u.setFuncionario_hst_id(new Integer(rs.getInt("funcionario_hst_id")));
u.setActivo(rs.getString("activo"));
u.setResponsavel_loja(rs.getString("responsavel_loja"));
u.setGestor_geral(rs.getString("gestor_geral"));
u.setApagado(rs.getString("apagado"));
return u;
ResultSet rs = st.executeQuery( sql );
if ( rs.first() )
{
u = new Utilizador();
u.setId(new Integer(rs.getInt("id")));
u.setLogin(rs.getString("login"));
u.setPassword(rs.getString("password"));
u.setData_password(rs.getDate("data_password"));
u.setEmail(rs.getString("email"));
u.setEmpresa_id(new Integer(rs.getInt("empresa_id")));
u.setEstabelecimento_id(new Integer(rs.getInt("estabelecimento_id")));
u.setAdministrador(rs.getString("administrador"));
u.setTipo(new Integer(rs.getInt("tipo")));
u.setNumero_cedula(rs.getString("numero_cedula"));
u.setCap(rs.getString("cap"));
u.setNome(rs.getString("nome"));
u.setMedico_id(new Integer(rs.getInt("medico_id")));
u.setFuncionario_hst_id(new Integer(rs.getInt("funcionario_hst_id")));
u.setActivo(rs.getString("activo"));
u.setResponsavel_loja(rs.getString("responsavel_loja"));
u.setGestor_geral(rs.getString("gestor_geral"));
u.setApagado(rs.getString("apagado"));
}
return u;
}
public ArrayList getUtilizadoresListByTipo(Integer tipo, String responsavel_loja, Integer estabelecimento_id) throws Exception

@ -41,6 +41,7 @@ public class Global {
//public static final String ANALISE_ACIDENTES_URL = "http://localhost:8084/AnaliseAcidentesTrabalho/faces/"; //testes
//public static final String ANALISE_ACIDENTES_URL = "http://192.168.111.24:8084/AnaliseAcidentesTrabalho/faces/"; //testes portatil
public static final String ANALISE_ACIDENTES_URL = "https://www.siprp.pt/AnaliseAcidentesTrabalho/faces/"; //real
public static final String PLANOS_ACTUACAO_URL = "https://www.siprp.pt/PlanosActuacao/faces/";
public static final String LOGOS_FOLDER = "/resources/images";

@ -67,60 +67,50 @@ public class MainPhaseListener implements PhaseListener{
}
}
public void beforePhase(PhaseEvent pe) {
if(pe.getPhaseId() == PhaseId.RENDER_RESPONSE)
public void beforePhase( PhaseEvent pe )
{
if ( pe.getPhaseId() == PhaseId.RENDER_RESPONSE )
{
FacesContext fc = pe.getFacesContext();
SessionBean1 session = JSFUtils.getSessionBean(fc);
String referer = JSFHTTPUtils.getReferer(pe.getFacesContext());
System.out.println("REFERER >>" + referer + "<<");
SessionBean1 session = JSFUtils.getSessionBean( fc );
String referer = JSFHTTPUtils.getReferer( pe.getFacesContext() );
System.out.println( "REFERER >>" + referer + "<<" );
//check if comes from AnalisesAcidentes. If so, set loggedIn to true:
if(referer != null)
if ( referer != null )
{
if(referer.indexOf("AnaliseAcidentes") != -1)
if ( referer.indexOf( "AnaliseAcidentes" ) != -1 )
{
session.setLoggedIn(true);
String user = JSFUtils.getRequestParameter(fc, "user");
System.out.println("USER >" + user.toString() + "<");
session.setLoggedIn( true );
String user = JSFUtils.getRequestParameter( fc, "user" );
System.out.println( "USER >" + user.toString() + "<" );
}
}
//Determin Session Time out
HttpServletRequest req = (HttpServletRequest) fc.getExternalContext().getRequest();
HttpServletRequest req = ( HttpServletRequest ) fc.getExternalContext().getRequest();
UIViewRoot view = fc.getViewRoot();
System.out.println("SESSION VALID : " + req.isRequestedSessionIdValid());
System.out.println( "SESSION VALID : " + req.isRequestedSessionIdValid() );
//if(!req.isRequestedSessionIdValid() && view.getViewId().indexOf("Login") == -1 ){
if(!req.isRequestedSessionIdValid() && referer.indexOf("AnaliseAcidentes") == -1 ){
System.out.println("VIEW ID :" + view.getViewId());
if ( ! req.isRequestedSessionIdValid() && referer.indexOf( "AnaliseAcidentes" ) == -1 )
{
System.out.println( "VIEW ID :" + view.getViewId() );
//NavigationHandler nh = fc.getApplication().getNavigationHandler();
//nh.handleNavigation(fc, null, "login");
try
{
//JSFUtils.logout(fc);
//JSFUtils.navigateTo(fc, "login");
try
{
//JSFUtils.redirect(fc, "http://localhost:8084/AnaliseAcidentesTrabalho/faces/Login.jsp");
JSFUtils.redirect(fc, Global.ANALISE_ACIDENTES_URL + "Login.jsp");
}
catch(Exception ex)
{
ErrorLogger.logException( ex );
}
}
catch(Exception ex)
{
ErrorLogger.logException( ex );
}
}
try
{
//JSFUtils.logout(fc);
//JSFUtils.navigateTo(fc, "login");
//JSFUtils.redirect(fc, "http://localhost:8084/AnaliseAcidentesTrabalho/faces/Login.jsp");
JSFUtils.redirect(fc, Global.ANALISE_ACIDENTES_URL + "Login.jsp");
}
catch ( Exception ex )
{
ErrorLogger.logException( ex );
}
}
//Determin if user is logged in
//HttpSession session = (HttpSession) fc.getExternalContext().getSession(false);
@ -128,53 +118,56 @@ public class MainPhaseListener implements PhaseListener{
//SessionBean1 session = JSFUtils.getSessionBean(fc);
boolean loggedIn = session.isLoggedIn();
System.out.println("LOGGED IN : " + loggedIn);
if(!loggedIn && view.getViewId().indexOf("Login") == -1 ){
if ( ! loggedIn && view.getViewId().indexOf( "Login" ) == -1 )
{
NavigationHandler nh = fc.getApplication().getNavigationHandler();
nh.handleNavigation(fc, null, "login");
nh.handleNavigation( fc, null, "login" );
}
//disable/enable EditarPlano menu
String sview = fc.getViewRoot().getViewId();
session.setRenderTopMenuImages(true);
session.setRenderSubHeader(false);
session.setRenderTopMenuImages( true );
session.setRenderSubHeader( false );
//////////////
String user_id = JSFUtils.getRequestParameter(fc, "user");
System.out.println("PHASE LISTENER - USER ID : " + user_id);
String user_id = JSFUtils.getRequestParameter( fc, "user" );
System.out.println( "PHASE LISTENER - USER ID : " + user_id );
Utilizador u = null;
try
{
Integer userId = new Integer(Integer.parseInt(user_id));
try
{
UtilizadoresDataProvider udp = new UtilizadoresDataProvider();
udp.checkConnection();
u = udp.getUtilizador(userId);
session.setCurrentUser(u);
}
catch(Exception ex1)
{
ErrorLogger.logException( ex1 );
}
Integer userId = Integer.parseInt( user_id );
// Integer userId = new Integer( Integer.parseInt( user_id ) );
UtilizadoresDataProvider udp = new UtilizadoresDataProvider();
udp.checkConnection();
u = udp.getUtilizador( userId );
session.setCurrentUser( u );
}
catch(Exception ex)
catch ( Exception ex )
{
ErrorLogger.logException( ex );
session.setMsg( "Utilizador inv&aacute;lido." );
// try
// {
// JSFUtils.redirect( fc, Global.PLANOS_ACTUACAO_URL + "Erro.jsp" );
// }
// catch ( Exception ex1 )
// {
// ErrorLogger.logException( ex1 );
// }
// ErrorLogger.logException( ex );
}
/////////////
u = session.getCurrentUser();
if(sview.matches("/EditarPlano.jsp") || sview.matches("/EnviarCorrecao.jsp") || sview.matches("/ViewPlano.jsp"))
if ( sview.matches( "/EditarPlano.jsp" ) || sview.matches( "/EnviarCorrecao.jsp" ) || sview.matches( "/ViewPlano.jsp" ) )
{
session.setDisableMenu(false);
session.setDisableMenuPlanos(false);
session.setDisableMenu(false);
session.setDisableMenuPlanos(false);
if(sview.matches("/ViewPlano.jsp"))
{
if(u.getTipo().intValue() == Global.DIRECTOR_SIPRP)
if( u != null && u.getTipo().intValue() == Global.DIRECTOR_SIPRP )
{
//session.setDisableMenu(false);
session.setDisableMenuUtilizadores(false);
@ -201,7 +194,7 @@ public class MainPhaseListener implements PhaseListener{
session.setDisableMenu(false);
if(sview.matches("/ListaPlanos.jsp"))
{
if(u.getTipo().intValue() == Global.RH || u.getTipo().intValue() == Global.GESTOR)
if( u != null && ( u.getTipo().intValue() == Global.RH || u.getTipo().intValue() == Global.GESTOR ) )
{
session.setDisableMenuUtilizadores(true);
}
@ -211,13 +204,13 @@ public class MainPhaseListener implements PhaseListener{
//insert logos
Integer empresaId = u.getEmpresa_id();
System.out.println("LOGO EMPRESA ID B : " + empresaId.toString());
Integer empresaId = u != null ? u.getEmpresa_id() : null;
System.out.println("LOGO EMPRESA ID B : " + ( empresaId != null ? empresaId.toString() : null ) );
Logos logos = new Logos();
String logourl = logos.getLogo(fc, empresaId);
session.setLogoEmpresaUrl(logourl);
System.out.println("LOGO URL : " + logourl);
System.out.println("VIEW : " + view);
String logourl = logos.getLogo( fc, empresaId );
session.setLogoEmpresaUrl( logourl );
System.out.println("LOGO URL : " + logourl );
System.out.println("VIEW : " + view );
}
}

@ -400,21 +400,22 @@ public class ListaPlanos extends AbstractPageBean {
FacesContext fc = getFacesContext();
String user_id = JSFUtils.getRequestParameter(fc, "user");
String estab_gestor = JSFUtils.getRequestParameter(fc, "estab_gestor");
System.out.println("LISTA PLANOS - USER ID : " + user_id);
System.out.println("LISTA PLANOS - USER ID : " + user_id );
Utilizador u = null;
if(user_id != null)
if ( user_id != null )
{
try
{
Integer userId = new Integer(Integer.parseInt(user_id));
Integer userId = new Integer( Integer.parseInt( user_id ) );
try
{
UtilizadoresDataProvider udp = new UtilizadoresDataProvider();
udp.checkConnection();
u = udp.getUtilizador(userId);
if(u.getTipo().intValue() == Global.GESTOR)
UtilizadoresDataProvider udp = new UtilizadoresDataProvider();
udp.checkConnection();
u = udp.getUtilizador( userId );
if ( u != null )
{
if ( u.getTipo().intValue() == Global.GESTOR )
{
try
{
@ -428,50 +429,48 @@ public class ListaPlanos extends AbstractPageBean {
}
}
getSessionBean1().setCurrentUser(u);
}
catch(Exception ex1)
{
ErrorLogger.logException( ex1 );
}
}
getSessionBean1().setCurrentUser( u );
u = getSessionBean1().getCurrentUser();
if(u.getTipo().intValue() == Global.DIRECTOR_SIPRP || u.getTipo().intValue() == Global.RH || u.getTipo().intValue() == Global.DIRECTOR_GERAL_RH || u.getTipo().intValue() == Global.GESTOR)
{
gridActual.setRendered(false);
tableRowGroup2.setEmptyDataMsg("Sem registos");
tableRowGroup3.setEmptyDataMsg("Sem registos");
}
if(u.getTipo().intValue() != Global.DIRECTOR_SIPRP && u.getTipo().intValue() != Global.RH && u.getTipo().intValue() != Global.DIRECTOR_GERAL_RH)
{
getSessionBean1().setDisableMenuUtilizadores(true);
tableRowGroup1.setEmptyDataMsg("Sem registos");
tableRowGroup2.setEmptyDataMsg("Sem registos");
tableRowGroup3.setEmptyDataMsg("Sem registos");
}
//Column para desactivar plano - mostra se o utilizador for DIRECTOR SIPRP
int uType = u.getTipo().intValue();
boolean renderOrNot = uType == Global.DIRECTOR_SIPRP || uType == Global.TECNICO_HS;
tableColumn55.setRendered( renderOrNot );
buttonDesactivar.setRendered( renderOrNot );
tableColumn56.setRendered( renderOrNot );
buttonDesactivarSeguimento.setRendered( renderOrNot );
initialize();
}
else
{
getSessionBean1().setMsg( "Utilizador inv&aacute;lido." );
}
}
catch(Exception ex)
{
ErrorLogger.logException( ex );
}
}
u = getSessionBean1().getCurrentUser();
if(u.getTipo().intValue() == Global.DIRECTOR_SIPRP || u.getTipo().intValue() == Global.RH || u.getTipo().intValue() == Global.DIRECTOR_GERAL_RH || u.getTipo().intValue() == Global.GESTOR)
{
gridActual.setRendered(false);
tableRowGroup2.setEmptyDataMsg("Sem registos");
tableRowGroup3.setEmptyDataMsg("Sem registos");
}
if(u.getTipo().intValue() != Global.DIRECTOR_SIPRP && u.getTipo().intValue() != Global.RH && u.getTipo().intValue() != Global.DIRECTOR_GERAL_RH)
{
getSessionBean1().setDisableMenuUtilizadores(true);
tableRowGroup1.setEmptyDataMsg("Sem registos");
tableRowGroup2.setEmptyDataMsg("Sem registos");
tableRowGroup3.setEmptyDataMsg("Sem registos");
}
//Column para desactivar plano - mostra se o utilizador for DIRECTOR SIPRP
int uType = u.getTipo().intValue();
boolean renderOrNot = uType == Global.DIRECTOR_SIPRP || uType == Global.TECNICO_HS;
tableColumn55.setRendered( renderOrNot );
buttonDesactivar.setRendered( renderOrNot );
tableColumn56.setRendered( renderOrNot );
buttonDesactivarSeguimento.setRendered( renderOrNot );
initialize();
}
}
}

@ -25,32 +25,36 @@ public class Logos {
return null;
}
public String getLogo(FacesContext fc, Integer empresaId)
public String getLogo( FacesContext fc, Integer empresaId )
{
String result = null;
try
{
//get image from db :
RelatoriosDataProvider rdp = new RelatoriosDataProvider();
byte[] logo = rdp.getLogoByEmpresa(empresaId);
int len = logo.length;
ServletContext context = (ServletContext) fc.getExternalContext().getContext();
File logoFolder = new File(context.getRealPath(Global.LOGOS_FOLDER));
String logoFilename = logoFolder + "/logo_empresa" + empresaId.toString() + ".jpg";
OutputStream outImej = new FileOutputStream(logoFilename);
outImej.write(logo, 0, len);
System.out.println("LOGO PATH : " + logoFilename);
outImej.close();
return Global.LOGOS_FOLDER + "/logo_empresa" + empresaId.toString() + ".jpg";
}
catch(Exception ex)
{
ErrorLogger.logException( ex );
return null;
}
byte[] logo = rdp.getLogoByEmpresa( empresaId );
if ( logo != null )
{
int len = logo.length;
ServletContext context = (ServletContext) fc.getExternalContext().getContext();
File logoFolder = new File( context.getRealPath( Global.LOGOS_FOLDER ) );
String logoFilename = logoFolder + "/logo_empresa" + empresaId.toString() + ".jpg";
OutputStream outImej = new FileOutputStream(logoFilename);
outImej.write(logo, 0, len);
System.out.println("LOGO PATH : " + logoFilename);
outImej.close();
result = Global.LOGOS_FOLDER + "/logo_empresa" + empresaId.toString() + ".jpg";
}
}
catch ( Exception ex )
{
ErrorLogger.logException( ex );
}
return result;
}
}

@ -66,7 +66,11 @@
<navigation-case>
<from-outcome>ver_plano</from-outcome>
<to-view-id>/ViewPlano.jsp</to-view-id>
</navigation-case>
</navigation-case>
<navigation-case>
<from-outcome>erro</from-outcome>
<to-view-id>/Erro.jsp</to-view-id>
</navigation-case>
</navigation-rule>
<navigation-rule>
<from-view-id>/EditarPlano.jsp</from-view-id>

Loading…
Cancel
Save