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

lxbfYeaa
Diogo Neves 14 years ago
parent c015997362
commit b1a48fc639

@ -2,17 +2,41 @@
<classpath> <classpath>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="lib" path="lib.tools/servlet-api.jar"/>
<classpathentry kind="lib" path="lib/batik-all-1.7.jar"/>
<classpathentry kind="lib" path="lib/commons-codec-1.3.jar"/>
<classpathentry kind="lib" path="lib/commons-collections-3.1.jar"/> <classpathentry kind="lib" path="lib/commons-collections-3.1.jar"/>
<classpathentry kind="lib" path="lib/commons-email-1.0-dev.jar"/> <classpathentry kind="lib" path="lib/commons-email-1.0-dev.jar"/>
<classpathentry kind="lib" path="lib/commons-fileupload-1.0.jar"/> <classpathentry kind="lib" path="lib/commons-fileupload-1.0.jar"/>
<classpathentry kind="lib" path="lib/commons-httpclient-3.1.jar"/>
<classpathentry kind="lib" path="lib/commons-io-1.3.1.jar"/>
<classpathentry kind="lib" path="lib/commons-lang-2.1.jar"/> <classpathentry kind="lib" path="lib/commons-lang-2.1.jar"/>
<classpathentry kind="lib" path="lib/commons-logging-1.1.jar"/> <classpathentry kind="lib" path="lib/commons-logging-1.1.jar"/>
<classpathentry kind="lib" path="lib/commons-validator-1.3.1.jar"/>
<classpathentry kind="lib" path="lib/commons-vfs-1.0.jar"/>
<classpathentry kind="lib" path="lib/dom4j-1.6.1.jar"/>
<classpathentry kind="lib" path="lib/evologger.jar"/> <classpathentry kind="lib" path="lib/evologger.jar"/>
<classpathentry kind="lib" path="lib/evolute.jar"/> <classpathentry kind="lib" path="lib/evolute.jar"/>
<classpathentry kind="lib" path="lib/htmllexer.jar"/>
<classpathentry kind="lib" path="lib/htmlparser.jar"/>
<classpathentry kind="lib" path="lib/httpclient-4.0.1.jar"/>
<classpathentry kind="lib" path="lib/httpcore-4.0.1.jar"/>
<classpathentry kind="lib" path="lib/httpmime-4.0.1.jar"/>
<classpathentry kind="lib" path="lib/jdom.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2.8.jar"/> <classpathentry kind="lib" path="lib/log4j-1.2.8.jar"/>
<classpathentry kind="lib" path="lib/mail.jar"/> <classpathentry kind="lib" path="lib/mail.jar"/>
<classpathentry kind="lib" path="lib/org.springframework.beans-3.0.0.jar"/>
<classpathentry kind="lib" path="lib/org.springframework.context-3.0.0.jar"/>
<classpathentry kind="lib" path="lib/org.springframework.core-3.0.0.jar"/>
<classpathentry kind="lib" path="lib/postgresql-9.0-801.jdbc4.jar"/> <classpathentry kind="lib" path="lib/postgresql-9.0-801.jdbc4.jar"/>
<classpathentry kind="lib" path="lib/spring-ws-core-1.5.9.jar"/>
<classpathentry kind="lib" path="lib/spring-ws-core-tiger-1.5.9.jar"/>
<classpathentry kind="lib" path="lib/spring-ws-support-1.5.9.jar"/>
<classpathentry kind="lib" path="lib/spring-xml-1.5.9.jar"/>
<classpathentry kind="lib" path="lib/truelicense.jar"/>
<classpathentry kind="lib" path="lib/velocity-dep-1.4.jar"/> <classpathentry kind="lib" path="lib/velocity-dep-1.4.jar"/>
<classpathentry kind="lib" path="lib.tools/servlet-api.jar"/> <classpathentry kind="lib" path="lib/xml-apis-ext.jar"/>
<classpathentry kind="lib" path="lib/xml-apis.jar"/>
<classpathentry kind="lib" path="lib/xmlgraphics-commons-1.4.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

@ -61,4 +61,8 @@
<url-pattern>/recruit</url-pattern> <url-pattern>/recruit</url-pattern>
</servlet-mapping> </servlet-mapping>
<listener>
<listener-class>com.evolute.siprp.pagina.SiprpWebContextListener</listener-class>
</listener>
</web-app> </web-app>

@ -37,6 +37,16 @@
<echo message="Project's codegen configuration file not found at ${codegen.properties.file}"/> <echo message="Project's codegen configuration file not found at ${codegen.properties.file}"/>
</target> </target>
<target name="run-batch-deployer" description="Batches multiple deploys" depends="load-properties">
<path id="deployer.classpath">
<fileset dir="${lib.tools.dir}" />
<path refid="app.build.classpath" />
</path>
<java jvmversion="${app.java.version}" classname="${deployer.main}" classpathref="deployer.classpath" fork="true" dir="${app.build.dir}">
<arg value="${basedir}"/>
</java>
</target>
<target name="run-LEAF" description="Runs LEAF for this project" depends="load-properties"> <target name="run-LEAF" description="Runs LEAF for this project" depends="load-properties">
<path id="leaf.classpath"> <path id="leaf.classpath">
<fileset dir="${lib.tools.dir}" /> <fileset dir="${lib.tools.dir}" />

@ -32,16 +32,31 @@
<target name="pre-deploy" /> <target name="pre-deploy" />
<target name="app-deploy-version" if="deploy.version" > <target name="ask-deploy.version" unless="deploy.version">
<input defaultvalue="${basedir}" addproperty="deploy.jars"> <input defaultvalue="" addproperty="deploy.version">
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.VersionInputHandler" />
</input>
</target>
<target name="ask-deploy.jars" unless="deploy.jars">
<input defaultvalue="${basedir}:${app.appName}" addproperty="deploy.jars">
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.JarInputHandler" /> <handler classpathref="lib.tools.classpath" classname="com.evolute.ant.JarInputHandler" />
</input> </input>
</target>
<target name="ask-deploy.user" unless="deploy.user">
<input message="" addproperty="deploy.user"> <input message="" addproperty="deploy.user">
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.UserInputHandler" /> <handler classpathref="lib.tools.classpath" classname="com.evolute.ant.UserInputHandler" />
</input> </input>
</target>
<target name="ask-deploy.password" unless="deploy.password">
<input message="password:>" addproperty="deploy.password"> <input message="password:>" addproperty="deploy.password">
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.PasswordInputHandler" /> <handler classpathref="lib.tools.classpath" classname="com.evolute.ant.PasswordInputHandler" />
</input> </input>
</target>
<target name="app-deploy-version" if="deploy.version" depends="ask-deploy.jars,ask-deploy.user,ask-deploy.password" >
<antcall target="app-deploy-create-jar"/> <antcall target="app-deploy-create-jar"/>
<antcall target="pre-deploy" /> <antcall target="pre-deploy" />
<antcall target="run-jnlp-task" /> <antcall target="run-jnlp-task" />
@ -92,7 +107,8 @@
</target> </target>
<target name="deploy-production" unless="TESTDEPLOY"> <target name="deploy-production" unless="TESTDEPLOY">
<sshexec trust="yes" host="${app.deploy.server}" username="${deploy.user}" command="sh ${app.deploy.production.script} ${app.name}" password="${deploy.password}" /> <echo message="Deploying to ${deploy.user}@${app.deploy.server}"/>
<sshexec failonerror="true" trust="yes" host="${app.deploy.server}" username="${deploy.user}" command="sh ${app.deploy.production.script} ${app.name}" password="${deploy.password}" />
</target> </target>
<target name="app-deploy-version-jars-user-pass" if="deploy.password"> <target name="app-deploy-version-jars-user-pass" if="deploy.password">
@ -101,6 +117,7 @@
<scp verbose="yes" todir="${deploy.user}@${app.deploy.server}:${app.deploy.path}" password="${deploy.password}" sftp="true" trust="true" > <scp verbose="yes" todir="${deploy.user}@${app.deploy.server}:${app.deploy.path}" password="${deploy.password}" sftp="true" trust="true" >
<fileset dir="${app.deploy.dist.dir}" includes="${deploy.jars}"/> <fileset dir="${app.deploy.dist.dir}" includes="${deploy.jars}"/>
</scp> </scp>
<echo message="Uploading jnlps"/>
<scp verbose="yes" todir="${deploy.user}@${app.deploy.server}:${app.deploy.jnlp.path}" password="${deploy.password}" sftp="true" trust="true" > <scp verbose="yes" todir="${deploy.user}@${app.deploy.server}:${app.deploy.jnlp.path}" password="${deploy.password}" sftp="true" trust="true" >
<fileset dir="${jnlp.dir}" includes="**/*.jnlp"/> <fileset dir="${jnlp.dir}" includes="**/*.jnlp"/>
</scp> </scp>
@ -120,10 +137,7 @@
<antcall target="app-version-increase-${deploy.version}" /> <antcall target="app-version-increase-${deploy.version}" />
</target> </target>
<target name="app-deploy" description="Deploys application" depends="load-properties"> <target name="app-deploy" description="Deploys application" depends="load-properties,ask-deploy.version">
<input defaultvalue="" addproperty="deploy.version">
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.VersionInputHandler" />
</input>
<antcall target="app-deploy-choose-version"/> <antcall target="app-deploy-choose-version"/>
<antcall target="app-create-software-evo-licensor"/> <antcall target="app-create-software-evo-licensor"/>
</target> </target>

@ -3,6 +3,10 @@
<property name="properties.base.dir" value="${basedir}/properties" /> <property name="properties.base.dir" value="${basedir}/properties" />
<property name="lib.tools.dir" value="${basedir}/lib.tools" /> <property name="lib.tools.dir" value="${basedir}/lib.tools" />
<path id="lib.tools.classpath">
<fileset dir="${lib.tools.dir}" />
</path>
<target name="load-static-properties" > <target name="load-static-properties" >
<property name="app.dir" value="${basedir}" /> <property name="app.dir" value="${basedir}" />
<property name="evolute.dir" value="${basedir}/../evolute" /> <property name="evolute.dir" value="${basedir}/../evolute" />
@ -34,10 +38,6 @@
<path refid="app.jar.classpath" /> <path refid="app.jar.classpath" />
</path> </path>
<path id="lib.tools.classpath">
<fileset dir="${lib.tools.dir}" />
</path>
<path id="lib.docs.classpath"> <path id="lib.docs.classpath">
<path refid="lib.tools.classpath" /> <path refid="lib.tools.classpath" />
<path refid="app.jar.classpath" /> <path refid="app.jar.classpath" />
@ -82,6 +82,7 @@
<property name="app.max.mem" value="512M" /> <property name="app.max.mem" value="512M" />
<property name="leaf.main" value="com.evolute.leaf.Main" /> <property name="leaf.main" value="com.evolute.leaf.Main" />
<property name="deployer.main" value="com.evolute.deploy.Main" />
</target> </target>
</project> </project>

@ -1,9 +1,6 @@
<project name="evo-app-multiple-client-common" basedir="../../"> <project name="evo-app-multiple-client-common" basedir="../../">
<target name="load-properties-file" > <target name="load-properties-file" depends="ask-target">
<input defaultvalue="${properties.base.dir}" addproperty="properties.dir">
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.ProjectClientInputHandler" />
</input>
<property file="${properties.dir}/app.properties" /> <property file="${properties.dir}/app.properties" />
<property file="${properties.dir}/project.properties" /> <property file="${properties.dir}/project.properties" />
<property file="${properties.base.dir}/app.properties" /> <property file="${properties.base.dir}/app.properties" />
@ -16,4 +13,10 @@
</copy> </copy>
</target> </target>
<target name="ask-target" unless="properties.dir">
<input defaultvalue="${properties.base.dir}" addproperty="properties.dir">
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.ProjectClientInputHandler" />
</input>
</target>
</project> </project>

@ -1,7 +1,20 @@
||:com.evolute.siprp.pagina.SiprpWebContextListener
com.evolute.siprp.pagina.SiprpWebContextListener
java.lang.StringBuilder
com.evolute.siprp.pagina.SiprpWebLoggerInitializer
javax.servlet.ServletContextListener
java.lang.System
java.io.PrintStream
java.text.SimpleDateFormat
java.lang.Object
com.evolute.utils.date.DateUtils
java.util.Date
java.lang.Exception
||:com.evolute.siprp.pagina.RelatorioServlet ||:com.evolute.siprp.pagina.RelatorioServlet
javax.servlet.http.HttpSession javax.servlet.http.HttpSession
com.evolute.siprp.pagina.RelatorioServlet com.evolute.siprp.pagina.RelatorioServlet
org.apache.velocity.app.Velocity org.apache.velocity.app.Velocity
com.evolute.utils.error.ErrorLogger
javax.servlet.http.HttpServletRequest javax.servlet.http.HttpServletRequest
javax.servlet.ServletOutputStream javax.servlet.ServletOutputStream
java.util.Hashtable java.util.Hashtable
@ -13,8 +26,19 @@ java.lang.String
com.evolute.siprp.pagina.MailerServlet com.evolute.siprp.pagina.MailerServlet
javax.servlet.http.HttpServletResponse javax.servlet.http.HttpServletResponse
java.lang.Exception java.lang.Exception
||:com.evolute.siprp.pagina.SiprpWebLoggerInitializer
com.evolute.utils.error.LoggerProperties
com.evolute.siprp.pagina.SiprpWebLoggerInitializer
com.evolute.utils.error.ErrorLogger
java.util.HashMap
com.evolute.utils.error.ws.WSLogger
com.evolute.utils.network.proxy.EvoProxyObject
java.lang.Object
com.evolute.utils.error.ProjectsEnum
java.lang.Exception
||:com.evolute.siprp.pagina.doGetListaTrabalhadoresTudo ||:com.evolute.siprp.pagina.doGetListaTrabalhadoresTudo
java.sql.SQLException java.sql.SQLException
com.evolute.utils.error.ErrorLogger
java.lang.StringBuilder java.lang.StringBuilder
java.sql.DriverManager java.sql.DriverManager
java.util.LinkedList java.util.LinkedList
@ -39,6 +63,7 @@ java.sql.Connection
java.lang.String java.lang.String
||:com.evolute.siprp.pagina.doGetListaEmpresas ||:com.evolute.siprp.pagina.doGetListaEmpresas
java.sql.SQLException java.sql.SQLException
com.evolute.utils.error.ErrorLogger
java.lang.StringBuilder java.lang.StringBuilder
java.sql.DriverManager java.sql.DriverManager
java.util.LinkedList java.util.LinkedList
@ -62,6 +87,7 @@ java.sql.Connection
java.lang.String java.lang.String
||:com.evolute.siprp.pagina.doPostLogin ||:com.evolute.siprp.pagina.doPostLogin
java.sql.SQLException java.sql.SQLException
com.evolute.utils.error.ErrorLogger
java.lang.StringBuilder java.lang.StringBuilder
com.evolute.siprp.pagina.doGetListaEstabelecimentos com.evolute.siprp.pagina.doGetListaEstabelecimentos
java.lang.System java.lang.System
@ -147,6 +173,7 @@ java.io.PrintStream
java.lang.StringBuffer java.lang.StringBuffer
org.apache.velocity.app.Velocity org.apache.velocity.app.Velocity
javax.servlet.http.HttpServlet javax.servlet.http.HttpServlet
com.evolute.utils.error.ErrorLogger
java.util.Properties java.util.Properties
||:com.evolute.siprp.pagina.GlobalConstants ||:com.evolute.siprp.pagina.GlobalConstants
java.lang.Object java.lang.Object
@ -174,11 +201,12 @@ java.lang.String
javax.servlet.http.HttpSession javax.servlet.http.HttpSession
java.lang.StringBuilder java.lang.StringBuilder
org.apache.velocity.app.Velocity org.apache.velocity.app.Velocity
com.evolute.utils.error.ErrorLogger
javax.servlet.http.HttpServletRequest javax.servlet.http.HttpServletRequest
javax.servlet.ServletOutputStream javax.servlet.ServletOutputStream
com.evolute.siprp.pagina.ScheduleServlet com.evolute.siprp.pagina.ScheduleServlet
java.util.Hashtable
java.io.StringWriter java.io.StringWriter
java.util.Hashtable
[Ljava.lang.String; [Ljava.lang.String;
java.io.IOException java.io.IOException
java.util.Enumeration java.util.Enumeration
@ -189,6 +217,7 @@ java.lang.Exception
javax.servlet.http.HttpServletResponse javax.servlet.http.HttpServletResponse
||:com.evolute.siprp.pagina.doGetTrabalhador ||:com.evolute.siprp.pagina.doGetTrabalhador
java.sql.SQLException java.sql.SQLException
com.evolute.utils.error.ErrorLogger
java.lang.StringBuilder java.lang.StringBuilder
java.sql.DriverManager java.sql.DriverManager
java.io.Serializable java.io.Serializable
@ -221,6 +250,7 @@ java.io.IOException
javax.servlet.ServletOutputStream javax.servlet.ServletOutputStream
||:com.evolute.siprp.pagina.doGetListaEstabelecimentos ||:com.evolute.siprp.pagina.doGetListaEstabelecimentos
java.sql.SQLException java.sql.SQLException
com.evolute.utils.error.ErrorLogger
java.lang.StringBuilder java.lang.StringBuilder
com.evolute.siprp.pagina.doGetListaEstabelecimentos com.evolute.siprp.pagina.doGetListaEstabelecimentos
java.sql.DriverManager java.sql.DriverManager
@ -243,6 +273,7 @@ java.sql.Connection
java.lang.String java.lang.String
||:com.evolute.siprp.pagina.doGetListaTrabalhadores ||:com.evolute.siprp.pagina.doGetListaTrabalhadores
java.sql.SQLException java.sql.SQLException
com.evolute.utils.error.ErrorLogger
java.lang.StringBuilder java.lang.StringBuilder
java.lang.System java.lang.System
java.sql.DriverManager java.sql.DriverManager
@ -271,6 +302,7 @@ java.sql.Connection
java.lang.String java.lang.String
||:com.evolute.siprp.pagina.MailerServlet ||:com.evolute.siprp.pagina.MailerServlet
javax.mail.Session javax.mail.Session
com.evolute.utils.error.ErrorLogger
java.lang.StringBuilder java.lang.StringBuilder
java.lang.System java.lang.System
org.apache.velocity.VelocityContext org.apache.velocity.VelocityContext
@ -306,6 +338,7 @@ javax.mail.Message
||:com.evolute.siprp.pagina.NewsServlet ||:com.evolute.siprp.pagina.NewsServlet
com.evolute.utils.sql.Select com.evolute.utils.sql.Select
com.evolute.utils.db.SQLExecuter com.evolute.utils.db.SQLExecuter
com.evolute.utils.error.ErrorLogger
java.lang.StringBuilder java.lang.StringBuilder
org.apache.velocity.VelocityContext org.apache.velocity.VelocityContext
javax.servlet.http.HttpServletResponse javax.servlet.http.HttpServletResponse

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -21,6 +21,7 @@ import org.apache.velocity.*;
import org.apache.velocity.app.*; import org.apache.velocity.app.*;
import com.evolute.utils.arrays.*; import com.evolute.utils.arrays.*;
import com.evolute.utils.error.ErrorLogger;
/** /**
* *
* @author psantos * @author psantos
@ -61,7 +62,7 @@ public class MailerServlet extends HttpServlet
} }
catch( Exception e ) catch( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
} }
@ -83,7 +84,7 @@ public class MailerServlet extends HttpServlet
} }
catch( Exception e ) catch( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
return null; return null;
@ -109,7 +110,7 @@ public class MailerServlet extends HttpServlet
} }
catch( Exception e ) catch( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
return null; return null;
@ -146,7 +147,7 @@ public class MailerServlet extends HttpServlet
} }
catch( Exception e ) catch( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
return false; return false;
@ -199,7 +200,7 @@ public class MailerServlet extends HttpServlet
} }
catch( Exception e ) catch( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
return false; return false;

@ -25,6 +25,7 @@ import com.evolute.utils.arrays.Virtual2DArray;
import com.evolute.utils.db.DBManager; import com.evolute.utils.db.DBManager;
import com.evolute.utils.db.JDBCManager; import com.evolute.utils.db.JDBCManager;
import com.evolute.utils.db.SQLExecuter; import com.evolute.utils.db.SQLExecuter;
import com.evolute.utils.error.ErrorLogger;
import com.evolute.utils.sql.Field; import com.evolute.utils.sql.Field;
import com.evolute.utils.sql.SQLQuery; import com.evolute.utils.sql.SQLQuery;
import com.evolute.utils.sql.Select; import com.evolute.utils.sql.Select;
@ -61,7 +62,7 @@ public class NewsServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception ex ) catch ( Exception ex )
{ {
ex.printStackTrace(); ErrorLogger.logException( ex );
} }
velocityInit = true; velocityInit = true;
} }
@ -77,7 +78,7 @@ public class NewsServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
} }
@ -111,7 +112,7 @@ public class NewsServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception ex ) catch ( Exception ex )
{ {
ex.printStackTrace(); ErrorLogger.logException( ex );
close(); close();
} }
return null; return null;
@ -150,7 +151,7 @@ public class NewsServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
return null; return null;
} }

@ -14,6 +14,8 @@ import javax.servlet.http.*;
import org.apache.velocity.*; import org.apache.velocity.*;
import org.apache.velocity.app.*; import org.apache.velocity.app.*;
import com.evolute.utils.error.ErrorLogger;
/** /**
* *
* @author fpalma * @author fpalma
@ -113,7 +115,7 @@ public class RelatorioServlet extends MailerServlet
} }
catch( Exception e ) catch( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
return null; return null;

@ -15,6 +15,8 @@ import javax.servlet.http.*;
import org.apache.velocity.*; import org.apache.velocity.*;
import org.apache.velocity.app.*; import org.apache.velocity.app.*;
import com.evolute.utils.error.ErrorLogger;
/** /**
* *
* @author psantos * @author psantos
@ -134,7 +136,7 @@ public class ScheduleServlet extends MailerServlet
} }
catch( Exception e ) catch( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
return null; return null;

@ -0,0 +1,54 @@
package com.evolute.siprp.pagina;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import com.evolute.utils.date.DateUtils;
import com.evolute.utils.error.ErrorLogger;
public class SiprpWebContextListener implements ServletContextListener
{
private long startedTime = 0L;
@Override
public void contextInitialized( ServletContextEvent event )
{
startedTime = System.currentTimeMillis();
System.out.println( "\n\nsiprpWeb . contextInitialized() : " + startedTime );
try
{
System.out.println( "\nInitializing siprpWeb logger ...\n\n" );
SiprpWebLoggerInitializer.init();
}
catch ( Exception e )
{
e.printStackTrace( System.err );
}
ErrorLogger.logException( new Exception( "siprpWeb context initialized." ) );
}
@Override
public void contextDestroyed( ServletContextEvent event )
{
System.out.println( "\n\nsiprpWeb . contextDestroyed() : " );
long endTime = System.currentTimeMillis();
SimpleDateFormat D_F = new SimpleDateFormat( "dd-MM-yyyy HH:mm:ss" );
Date startDate = new Date( startedTime );
Date endDate = new Date( endTime );
String timePassed = DateUtils.getTimePassed( startedTime, endTime );
System.out.println( "\trunning for: " + D_F.format( startDate ) + " -> " + D_F.format( endDate ) + " = " + ( (endTime - startedTime) / 1000 ) + " s ; " + timePassed );
ErrorLogger.logException( new Exception( "siprpWeb context destroyed. running for: " + D_F.format( startDate ) + " -> " + D_F.format( endDate ) + " = " + ( (endTime - startedTime) / 1000 ) + " s ; " + timePassed ) );
}
}

@ -0,0 +1,36 @@
package com.evolute.siprp.pagina;
import java.util.HashMap;
import com.evolute.utils.error.ErrorLogger;
import com.evolute.utils.error.Logger;
import com.evolute.utils.error.LoggerProperties;
import com.evolute.utils.error.ProjectsEnum;
import com.evolute.utils.error.ws.WSLogger;
import com.evolute.utils.network.proxy.EvoProxyObject;
public class SiprpWebLoggerInitializer
{
public static void init() throws Exception
{
HashMap< LoggerProperties, String > properties = new HashMap< LoggerProperties, String >();
properties.put( LoggerProperties.SOFTWARE_NAME, "SIPRP - siprpWeb" );
properties.put( LoggerProperties.SOFTWARE_VERSION, "1" );
properties.put( LoggerProperties.PROJECT, ProjectsEnum.SIPRP.toString() );
properties.put( LoggerProperties.PROJECT_NAME, ProjectsEnum.SIPRP.toString() );
properties.put( LoggerProperties.PROJECT_VERSION, "1" );
String user = "";
String pass = "";
String host = "";
String port = "";
EvoProxyObject.configSystemProxySelector();
EvoProxyObject.getProxy( user, pass, host, port );
Logger logger = new WSLogger( properties );
ErrorLogger.initializeLogger( logger );
}
}

@ -17,6 +17,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.evolute.utils.arrays.ResultSet2DArray; import com.evolute.utils.arrays.ResultSet2DArray;
import com.evolute.utils.error.ErrorLogger;
public class doGetListaEmpresas extends siprpServlet public class doGetListaEmpresas extends siprpServlet
{ {
@ -106,17 +107,17 @@ public class doGetListaEmpresas extends siprpServlet
} }
catch ( IllegalStateException e ) // session timeout catch ( IllegalStateException e ) // session timeout
{ {
e.printStackTrace(); ErrorLogger.logException( e );
out.println( mergeTemplate( msgSessionTimeout, errorTemplate ) ); out.println( mergeTemplate( msgSessionTimeout, errorTemplate ) );
} }
catch ( SQLException e ) catch ( SQLException e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
out.println( mergeTemplate( msgErroBd, errorTemplate ) ); out.println( mergeTemplate( msgErroBd, errorTemplate ) );
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
out.println( mergeTemplate( msgGenericError, userRole, errorTemplate ) ); out.println( mergeTemplate( msgGenericError, userRole, errorTemplate ) );
} }
} }

@ -17,6 +17,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.evolute.utils.arrays.ResultSet2DArray; import com.evolute.utils.arrays.ResultSet2DArray;
import com.evolute.utils.error.ErrorLogger;
public class doGetListaEstabelecimentos extends siprpServlet public class doGetListaEstabelecimentos extends siprpServlet
@ -106,12 +107,12 @@ public class doGetListaEstabelecimentos extends siprpServlet
} }
catch ( SQLException e ) catch ( SQLException e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
out.println( mergeTemplate( msgErroBd, errorTemplate ) ); out.println( mergeTemplate( msgErroBd, errorTemplate ) );
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
out.println( mergeTemplate( msgGenericError, errorTemplate ) ); out.println( mergeTemplate( msgGenericError, errorTemplate ) );
} }
} }

@ -16,6 +16,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.evolute.utils.arrays.ResultSet2DArray; import com.evolute.utils.arrays.ResultSet2DArray;
import com.evolute.utils.error.ErrorLogger;
public class doGetListaTrabalhadores extends siprpServlet public class doGetListaTrabalhadores extends siprpServlet
{ {
@ -170,7 +171,7 @@ public class doGetListaTrabalhadores extends siprpServlet
// } // }
// catch( Exception ex ) // catch( Exception ex )
// { // {
// ex.printStackTrace(); // ErrorLogger.logException( ex );
// } // }
// trabalhador.put( "proxima_consulta", dataConsulta2 ); // trabalhador.put( "proxima_consulta", dataConsulta2 );
// //
@ -378,12 +379,12 @@ public class doGetListaTrabalhadores extends siprpServlet
} }
catch ( SQLException e ) catch ( SQLException e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
out.println( mergeTemplate( msgErroBd, errorTemplate ) ); out.println( mergeTemplate( msgErroBd, errorTemplate ) );
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
out.println( mergeTemplate( msgGenericError, errorTemplate ) ); out.println( mergeTemplate( msgGenericError, errorTemplate ) );
} }
} }

@ -17,6 +17,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.evolute.utils.arrays.Virtual2DArray; import com.evolute.utils.arrays.Virtual2DArray;
import com.evolute.utils.error.ErrorLogger;
import com.evolute.utils.sql.Select; import com.evolute.utils.sql.Select;
/** /**
@ -342,12 +343,12 @@ public class doGetListaTrabalhadoresPendentes
// } // }
// catch ( SQLException e ) // catch ( SQLException e )
// { // {
// e.printStackTrace(); // ErrorLogger.logException( e );
// out.println( mergeTemplate( super.msgErroBd, super.errorTemplate ) ); // out.println( mergeTemplate( super.msgErroBd, super.errorTemplate ) );
// } // }
// catch ( Exception e ) // catch ( Exception e )
// { // {
// e.printStackTrace(); // ErrorLogger.logException( e );
// out.println( mergeTemplate( super.msgGenericError, super.errorTemplate ) ); // out.println( mergeTemplate( super.msgGenericError, super.errorTemplate ) );
// } // }
// } // }

@ -24,6 +24,7 @@ import javax.servlet.http.HttpSession;
import com.evolute.utils.arrays.ResultSet2DArray; import com.evolute.utils.arrays.ResultSet2DArray;
import com.evolute.utils.arrays.Virtual2DArray; import com.evolute.utils.arrays.Virtual2DArray;
import com.evolute.utils.error.ErrorLogger;
@ -112,12 +113,12 @@ public class doGetListaTrabalhadoresTudo extends siprpServlet implements GlobalC
} }
catch ( SQLException e ) catch ( SQLException e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
out.println( mergeTemplate( msgErroBd, errorTemplate ) ); out.println( mergeTemplate( msgErroBd, errorTemplate ) );
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
out.println( mergeTemplate( msgGenericError, errorTemplate ) ); out.println( mergeTemplate( msgGenericError, errorTemplate ) );
} }
} }
@ -287,12 +288,12 @@ public class doGetListaTrabalhadoresTudo extends siprpServlet implements GlobalC
// } // }
// catch ( SQLException e ) // catch ( SQLException e )
// { // {
// e.printStackTrace(); // ErrorLogger.logException( e );
// out.println( mergeTemplate( super.msgErroBd, super.errorTemplate ) ); // out.println( mergeTemplate( super.msgErroBd, super.errorTemplate ) );
// } // }
// catch ( Exception e ) // catch ( Exception e )
// { // {
// e.printStackTrace(); // ErrorLogger.logException( e );
// out.println( mergeTemplate( super.msgGenericError, super.errorTemplate ) ); // out.println( mergeTemplate( super.msgGenericError, super.errorTemplate ) );
// } // }
// } // }

@ -15,6 +15,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.evolute.utils.arrays.ResultSet2DArray; import com.evolute.utils.arrays.ResultSet2DArray;
import com.evolute.utils.error.ErrorLogger;
public class doGetTrabalhador extends siprpServlet public class doGetTrabalhador extends siprpServlet
{ {
@ -209,12 +210,12 @@ public class doGetTrabalhador extends siprpServlet
} }
catch ( SQLException e ) catch ( SQLException e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
out.println( mergeTemplate( msgErroBd, errorTemplate ) ); out.println( mergeTemplate( msgErroBd, errorTemplate ) );
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
out.println( mergeTemplate( msgGenericError, errorTemplate ) ); out.println( mergeTemplate( msgGenericError, errorTemplate ) );
} }

@ -15,6 +15,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSession;
import com.evolute.utils.arrays.ResultSet2DArray; import com.evolute.utils.arrays.ResultSet2DArray;
import com.evolute.utils.error.ErrorLogger;
public class doPostLogin extends siprpServlet public class doPostLogin extends siprpServlet
{ {
@ -103,38 +104,38 @@ public class doPostLogin extends siprpServlet
} }
catch ( SQLException e ) catch ( SQLException e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
try try
{ {
doErro( "erro=" + msgErroBd, out ); doErro( "erro=" + msgErroBd, out );
} }
catch ( Exception ex ) catch ( Exception ex )
{ {
ex.printStackTrace(); ErrorLogger.logException( ex );
} }
} }
catch ( IllegalStateException e ) // session timeout catch ( IllegalStateException e ) // session timeout
{ {
e.printStackTrace(); ErrorLogger.logException( e );
try try
{ {
doErro( "erro=" + msgSessionTimeout, out ); doErro( "erro=" + msgSessionTimeout, out );
} }
catch ( Exception ex ) catch ( Exception ex )
{ {
ex.printStackTrace(); ErrorLogger.logException( ex );
} }
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
try try
{ {
doErro( "erro=" + msgGenericError, out ); doErro( "erro=" + msgGenericError, out );
} }
catch ( Exception ex ) catch ( Exception ex )
{ {
ex.printStackTrace(); ErrorLogger.logException( ex );
} }
} }
} }

@ -27,6 +27,7 @@ import com.evolute.utils.arrays.Virtual2DArray;
import com.evolute.utils.db.DBManager; import com.evolute.utils.db.DBManager;
import com.evolute.utils.db.Executer; import com.evolute.utils.db.Executer;
import com.evolute.utils.db.JDBCManager; import com.evolute.utils.db.JDBCManager;
import com.evolute.utils.error.ErrorLogger;
import com.evolute.utils.sql.Select; import com.evolute.utils.sql.Select;
public class siprpServlet extends HttpServlet implements GlobalConstants public class siprpServlet extends HttpServlet implements GlobalConstants
@ -134,7 +135,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
} }
@ -256,17 +257,17 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( NumberFormatException e ) // argumentos invalidos catch ( NumberFormatException e ) // argumentos invalidos
{ {
e.printStackTrace(); ErrorLogger.logException( e );
out.println( mergeTemplate( msgLinkFormatError, backUri, errorTemplate ) ); out.println( mergeTemplate( msgLinkFormatError, backUri, errorTemplate ) );
} }
catch ( IllegalStateException e ) // session timeout catch ( IllegalStateException e ) // session timeout
{ {
e.printStackTrace(); ErrorLogger.logException( e );
out.println( mergeTemplate( msgSessionTimeout, errorTemplate ) ); out.println( mergeTemplate( msgSessionTimeout, errorTemplate ) );
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
// out.println( mergeTemplate( msgGenericError , backUri, // out.println( mergeTemplate( msgGenericError , backUri,
// errorTemplate ) ); // errorTemplate ) );
out.println( mergeTemplate( msgGenericError, errorTemplate ) ); out.println( mergeTemplate( msgGenericError, errorTemplate ) );
@ -296,17 +297,17 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
} }
/* /*
* catch ( SQLException e ) { e.printStackTrace(); out.println( * catch ( SQLException e ) { ErrorLogger.logException( e ); out.println(
* mergeTemplate( msgErroBd , criticalErrorTemplate) ); } * mergeTemplate( msgErroBd , criticalErrorTemplate) ); }
*/ */
catch ( IllegalStateException e ) // session timeout catch ( IllegalStateException e ) // session timeout
{ {
e.printStackTrace(); ErrorLogger.logException( e );
out.println( mergeTemplate( msgSessionTimeout, errorTemplate ) ); out.println( mergeTemplate( msgSessionTimeout, errorTemplate ) );
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
out.println( mergeTemplate( msgGenericError, errorTemplate ) ); out.println( mergeTemplate( msgGenericError, errorTemplate ) );
} }
} }
@ -329,7 +330,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
return null; return null;
} }
@ -347,7 +348,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
return null; return null;
} }
@ -367,7 +368,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
return null; return null;
} }
@ -390,7 +391,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
return null; return null;
} }
@ -408,7 +409,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
} }
@ -450,7 +451,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
return false; return false;
} }
@ -484,7 +485,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
return false; return false;
} }
@ -498,7 +499,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
} }
@ -529,7 +530,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
return null; return null;
} }
@ -568,7 +569,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
return null; return null;
} }
@ -608,7 +609,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
return null; return null;
} }
@ -639,7 +640,7 @@ public class siprpServlet extends HttpServlet implements GlobalConstants
} }
catch ( Exception e ) catch ( Exception e )
{ {
e.printStackTrace(); ErrorLogger.logException( e );
} }
return null; return null;
} }

Loading…
Cancel
Save