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

lxbfYeaa
Tiago Simão 16 years ago
parent dcf5ef8ba9
commit 89a1455ae6

@ -11,7 +11,7 @@
<classpathentry kind="lib" path="lib/commons-lang-2.1.jar"/>
<classpathentry kind="lib" path="lib/commons-logging-1.0.4.jar"/>
<classpathentry kind="lib" path="lib/commons-logging-1.1.jar"/>
<classpathentry kind="lib" path="lib/evolute.jar"/>
<classpathentry kind="lib" path="lib/evolute.jar" sourcepath="/evolute"/>
<classpathentry kind="lib" path="lib/evospellchecker.jar"/>
<classpathentry kind="lib" path="lib/fop.jar"/>
<classpathentry kind="lib" path="lib/iText-2.0.7.jar"/>
@ -26,12 +26,13 @@
<classpathentry kind="lib" path="lib/mail.jar"/>
<classpathentry kind="lib" path="lib/nlog4j-1.2.25.jar"/>
<classpathentry kind="lib" path="lib/PDFRenderer.jar"/>
<classpathentry kind="lib" path="lib/postgresql-8.0-317.jdbc3.jar"/>
<classpathentry kind="lib" path="lib/serializer-2.7.0.jar"/>
<classpathentry kind="lib" path="lib/smtp.jar"/>
<classpathentry kind="lib" path="lib/TableLayout.jar"/>
<classpathentry kind="lib" path="lib/xalan-2.7.0.jar"/>
<classpathentry kind="lib" path="lib/xercesImpl-2.7.1.jar"/>
<classpathentry kind="lib" path="lib/xmlgraphics-commons-1.3.1.jar"/>
<classpathentry kind="lib" path="lib/swingx.jar"/>
<classpathentry kind="lib" path="lib/postgresql-8.4-701.jdbc4.jar"/>
<classpathentry kind="output" path="build"/>
</classpath>

@ -0,0 +1,40 @@
<project name="evo-app-build-common" >
<import file="evo-app-compile-common.xml" />
<target name="app-build" description="Compiles all application classes" depends="app-prepare,app-pre-build">
<mkdir dir="${app.build.dir}" />
<depend srcdir="${app.src.dir}" destdir="${app.build.dir}" cache="${app.dependencies.chache.dir}">
<include name="**/*.java" />
</depend>
<javac srcdir="${app.src.dir}" destdir="${app.build.dir}" classpathref="app.build.classpath" debug="on" deprecation="on" fork="true" memoryMaximumSize="512M" />
<antcall target="app-post-build"/>
</target>
<target name="run-codegen" description="Runs codegen for this project" depends="load-properties">
<available file="${codegen.project.ant}" property="codegen.project.exists"/>
<antcall target="show-codegen-project-error"/>
<antcall target="run-codegen-if-project-exists"/>
</target>
<target name="run-codegen-if-project-exists" if="codegen.project.exists">
<available file="${codegen.properties.file}" property="codegen.properties.exists"/>
<antcall target="show-codegen-properties-error"/>
<antcall target="run-codegen-if-exists"/>
</target>
<target name="show-codegen-project-error" unless="codegen.project.exists">
<echo message="Codegen's build-file not found at ${codegen.project.ant}"/>
</target>
<target name="run-codegen-if-exists" if="codegen.properties.exists">
<ant inheritall="false" antfile="${codegen.project.ant}" target="app-run">
<property name="app.run.args" value="${basedir}" />
</ant>
</target>
<target name="show-codegen-properties-error" unless="codegen.properties.exists">
<echo message="Project's codegen configuration file not found at ${codegen.properties.file}"/>
</target>
</project>

@ -0,0 +1,62 @@
<project name="evo-app-build-obfuscate-common">
<target name="obfuscate">
<taskdef resource="proguard/ant/task.properties" classpath="${app.dir}/lib.tools/proguard.jar" />
<delete file="${app.deploy.dist.dir}/${evolute.jar.name}" failonerror="false" />
<proguard printmapping="${app.dir}/${app.name}.map">
<injar file="${app.lib.dir}/evologger.jar" />
<outjar file="${app.deploy.dist.lib.dir}/evologger.jar" />
<injar file="${app.lib.dir}/evolute.jar" />
<outjar file="${app.deploy.dist.lib.dir}/evolute.jar" />
<injar file="${app.deploy.dist.dir}/${app.jar.name}" />
<outjar file="${app.deploy.dist.dir}/${app.jar.name}_guard.jar" />
<libraryjar file="${evolute.lib.dir}" />
<libraryjar file="${app.lib.dir}" />
<libraryjar file="${java.home}/lib/jce.jar" />
<libraryjar file="${java.home}/lib/jsse.jar" />
<libraryjar file="${java.home}/lib/rt.jar" />
-printseeds
-verbose
-dontskipnonpubliclibraryclasses
-keepclasseswithmembers public class * {
public static void main(java.lang.String[]);
}
</proguard>
<delete file="${app.deploy.dist.dir}/${app.jar.name}" failonerror="true" />
<move file="${app.deploy.dist.dir}/${app.jar.name}_guard.jar" tofile="${app.deploy.dist.dir}/${app.jar.name}" />
</target>
<target name="ProguardTask">
<property file="${app.version.file}" prefix="version" />
<echo message="${version.major}.${version.minor}.${version.build}" />
<echo message="${version.major}.${version.minor}.${version.build}" />
<typedef classpathref="lib.tools.classpath" resource="net/jtools/classloadertask/antlib.xml">
<classpath>
<path refid="lib.tools.classpath"/>
</classpath>
</typedef>
<classloader loader="project">
<classpath>
<fileset dir="${lib.tools.dir}" includes="*.jar"/>
<fileset dir="${app.lib.dir}" includes="*.jar"/>
</classpath>
</classloader>
<taskdef name="proguardtask" classpathref="lib.tools.classpath" classname="com.evolute.ant.ProguardTask" />
<proguardtask filePath="${app.dir}/${app.name}.map" version="${version.major}.${version.minor}.${version.build}" fileName="${app.name}.map" projectName="${app.name}" />
</target>
<target name="pre-deploy">
<antcall target="obfuscate" />
<antcall target="ProguardTask" />
</target>
</project>

@ -0,0 +1,89 @@
<project name="evo-app-compile-common" >
<import file="evo-app-load-properties.xml" />
<!-- BUILD -->
<target name="app-post-build" />
<target name="app-pre-build" />
<target name="app-build" />
<target name="app-prepare" depends="load-properties">
<echo message="Dealing with package-info.java files (ant compilation problem workaround)" />
<delete failonerror="false">
<fileset dir="${app.build.dir}" includes="**/package-info.java"/>
</delete>
<!--touch>
<fileset dir="${app.src.dir}" includes="**/package-info.java"/>
</touch-->
<echo message="Copying non-java files to build directory" />
<copy verbose="true" failonerror="true" overwrite="true" todir="${app.build.dir}">
<fileset dir="${app.src.dir}">
<exclude name="**/*.java" />
<exclude name="*.java" />
</fileset>
<fileset dir="${properties.dir}">
<include name="app.properties" />
<include name="**/*" />
</fileset>
</copy>
</target>
<target name="app-clean" description="Removes all generated files" depends="load-static-properties">
<delete verbose="true" failonerror="false">
<fileset dir="${app.build.dir}">
<include name="**/*" />
</fileset>
</delete>
<delete dir="${app.build.dir}" verbose="true" failonerror="true" />
<delete dir="${app.dist.dir}" verbose="true" failonerror="true" />
<delete dir="${app.deploy.dist.dir}" verbose="true" failonerror="true" />
</target>
<target name="app-run" description="Runs the application" depends="app-build">
<java jvmversion="${app.java.version}" classname="${app.main}" maxmemory="${app.max.mem}" classpathref="app.build.classpath" fork="true" dir="${app.build.dir}">
<jvmarg value="-XX:-UseGCOverheadLimit" />
<arg value="${app.run.args}"/>
</java>
</target>
<!-- JAR -->
<target name="app-deploy-create-jar" depends="app-clean, app-build" >
<mkdir dir="${app.deploy.dist.dir}" />
<jar destfile="${app.deploy.dist.dir}/${app.jar.name}" >
<fileset dir="${app.build.dir}">
<include name="**/*" />
</fileset>
</jar>
<copy todir="${app.deploy.dist.lib.dir}">
<fileset dir="${app.lib.dir}">
<include name="**/*" />
</fileset>
</copy>
</target>
<target name="app-create-jar" description="Make application Jar" depends="app-clean, app-build" >
<pathconvert property="jar.classpath.converted" refid="app.jar.classpath" pathsep=" ">
<map from="${app.dir}/" to="" />
<map from="${basedir}/" to="" />
</pathconvert>
<mkdir dir="${app.dist.dir}" />
<jar destfile="${app.dist.dir}/${app.jar.name}">
<fileset dir="${app.build.dir}">
<include name="**/*" />
</fileset>
<manifest>
<attribute name="Main-Class" value="${app.main}" />
<attribute name="Class-Path" value="${jar.classpath.converted}" />
</manifest>
</jar>
<copy todir="${app.dist.lib.dir}">
<fileset dir="${app.lib.dir}">
<include name="**/*" />
</fileset>
</copy>
</target>
</project>

@ -0,0 +1,130 @@
<project name="evo-app-deploy-common" >
<!-- PROPERTIES -->
<property name="properties.key.name" value="name" />
<property name="properties.key.major" value="major" />
<property name="properties.key.minor" value="minor" />
<property name="properties.key.build" value="build" />
<!-- SETUP -->
<target name="prepare-deploy-location">
<sshexec trust="yes" host="${app.deploy.server}" username="${deploy.user}" command="sh ${deploy.prepare.script} ${app.name}" password="${deploy.password}" />
</target>
<target name="run-jnlp-task" >
<typedef classpathref="lib.tools.classpath" resource="net/jtools/classloadertask/antlib.xml">
<classpath>
<path refid="lib.tools.classpath"/>
</classpath>
</typedef>
<classloader loader="project">
<classpath>
<fileset dir="${lib.tools.dir}" includes="*.jar"/>
</classpath>
</classloader>
<taskdef name="generate-jnlp" classpathref="lib.tools.classpath" classname="com.evolute.ant.JNLPGeneratorTask" />
<generate-jnlp propertiesDir="${properties.dir}" basedir="${app.dir}" />
</target>
<!-- DEPLOY -->
<target name="load-properties" />
<target name="pre-deploy" />
<target name="app-deploy-version" if="deploy.version" >
<antcall target="app-deploy-create-jar"/>
<antcall target="pre-deploy" />
<antcall target="run-jnlp-task" />
<input defaultvalue="${basedir}" addproperty="deploy.jars">
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.JarInputHandler" />
</input>
<condition property="do.abort">
<equals arg1="${deploy.jars}" arg2="null"/>
</condition>
<fail if="do.abort">Deploy cancelled</fail>
<antcall target="app-deploy-version-jars"/>
</target>
<target name="app-version-increase-test">
<property name="TESTDEPLOY" value="yes"/>
<antcall target="app-version-increase-build"/>
</target>
<target name="app-version-increase-major">
<propertyfile file="${app.version.file}" comment="${app.version.comment}" >
<entry key="${properties.key.name}" value="${app.name}"/>
<entry key="${properties.key.major}" type="int" operation="+" value="1"/>
<entry key="${properties.key.minor}" type="int" operation="=" value="0"/>
<entry key="${properties.key.build}" type="int" operation="=" value="0"/>
</propertyfile>
<antcall target="app-deploy-version"/>
</target>
<target name="app-version-increase-minor">
<propertyfile file="${app.version.file}" comment="${app.version.comment}" >
<entry key="${properties.key.name}" value="${app.name}"/>
<entry key="${properties.key.major}" type="int" operation="+" value="0"/>
<entry key="${properties.key.minor}" type="int" operation="+" value="1"/>
<entry key="${properties.key.build}" type="int" operation="=" value="0"/>
</propertyfile>
<antcall target="app-deploy-version"/>
</target>
<target name="app-version-increase-build">
<propertyfile file="${app.version.file}" comment="${app.version.comment}" >
<entry key="${properties.key.name}" value="${app.name}"/>
<entry key="${properties.key.major}" type="int" operation="+" value="0"/>
<entry key="${properties.key.minor}" type="int" operation="+" value="0"/>
<entry key="${properties.key.build}" type="int" operation="+" value="1"/>
</propertyfile>
<antcall target="app-deploy-version"/>
</target>
<target name="deploy-test" if="TESTDEPLOY">
<sshexec trust="yes" host="${app.deploy.server}" username="${deploy.user}" command="sh ${app.deploy.test.script} ${app.name}" password="${deploy.password}" />
</target>
<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}" />
</target>
<target name="app-deploy-version-jars-user-pass" if="deploy.password">
<antcall target="prepare-deploy-location" />
<echo message="Uploading files: ${deploy.jars}"/>
<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}"/>
</scp>
<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"/>
</scp>
<antcall target="deploy-test"/>
<antcall target="deploy-production"/>
</target>
<target name="app-deploy-version-jars-user" if="deploy.user">
<input message="password:>" addproperty="deploy.password">
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.PasswordInputHandler" />
</input>
<antcall target="app-deploy-version-jars-user-pass"/>
</target>
<target name="app-deploy-version-jars" if="deploy.jars" >
<input message="" addproperty="deploy.user">
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.UserInputHandler" />
</input>
<antcall target="app-deploy-version-jars-user" />
</target>
<target name="app-deploy-choose-version" if="deploy.version" >
<antcall target="app-version-increase-${deploy.version}" />
</target>
<target name="app-deploy" description="Deploys application" depends="load-properties">
<input defaultvalue="" addproperty="deploy.version">
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.VersionInputHandler" />
</input>
<antcall target="app-deploy-choose-version"/>
</target>
</project>

@ -0,0 +1,71 @@
<project name="evo-app-load-properties" >
<property name="properties.base.dir" value="${basedir}/properties" />
<property name="lib.tools.dir" value="${basedir}/lib.tools" />
<target name="load-static-properties" >
<property name="app.dir" value="${basedir}" />
<property name="evolute.dir" value="${basedir}/../evolute" />
<property name="evolute.lib.dir" value="${evolute.dir}/lib" />
<property name="evolute.lib.tools.dir" value="${evolute.dir}/lib.tools" />
<property name="evolute.ant.dir" value="${evolute.dir}/ant" />
<property name="evolute.jar.name" value="evolute.jar" />
<property name="app.src.dir" value="${app.dir}/src" />
<property name="app.lib.dir" value="${app.dir}/lib" />
<property name="app.dist.dir" value="${app.dir}/dist" />
<property name="app.dist.lib.dir" value="${app.dist.dir}/lib" />
<property name="app.deploy.dist.dir" value="${app.dir}/deploy" />
<property name="app.deploy.dist.lib.dir" value="${app.deploy.dist.dir}/lib" />
<property name="app.build.dir" value="${app.dir}/build" />
<property name="app.dependencies.chache.dir" value="${app.dir}/dependenciesCache" />
<property name="app.max.mem" value="512M" />
<property name="codegen.project.ant" value="${basedir}/../codegen/build.xml"/>
<property name="codegen.properties.file" value="${basedir}/properties/codegen.xml"/>
<path id="app.jar.classpath">
<fileset dir="${app.lib.dir}" />
</path>
<path id="app.build.classpath">
<pathelement location="${app.build.dir}" />
<path refid="app.jar.classpath" />
</path>
<path id="lib.tools.classpath">
<fileset dir="${lib.tools.dir}" />
</path>
<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="lib.tools.classpath" />
</target>
<target name="load-properties-file" >
<property name="properties.dir" value="${properties.base.dir}" />
<property file="${properties.dir}/app.properties" />
<property file="${properties.dir}/project.properties" />
<antcall target="load-static-properties"/>
</target>
<target name="load-properties" depends="load-properties-file,load-static-properties">
<property name="app.name" value="${app.appName}" />
<property name="app.main" value="${app.main-class}" />
<property name="app.jar.name" value="${app.name}.jar" />
<property name="jnlp.dir" value="${app.dir}/jnlp" />
<property name="jnlp.extensions.dir" value="${jnlp.dir}/extensions" />
<property name="app.java.version" value="${java.version}" />
<property name="app.deploy.server" value="www.evolute.pt" />
<property name="app.deploy.path" value="/home/software/src_${app.name}" />
<property name="app.deploy.jnlp.path" value="${app.deploy.path}/jnlp" />
<property name="app.deploy.production.script" value="/home/software/auto_deploy.sh ${app.name}" />
<property name="app.deploy.test.script" value="/home/software/auto_test_deploy.sh ${app.name}" />
<property name="deploy.prepare.script" value="/home/software/auto_prepare_deploy.sh ${app.name}" />
<property name="app.version.file" value="${properties.base.dir}/version.properties" />
<property name="app.version.comment" value="${app.name} versioning file" />
<property name="app.run.args" value="" />
<property name="app.ws.wsdl.url" value="${app.ws.wsdl.url.protocol}://${app.ws.wsdl.url.host}:${app.ws.wsdl.url.port}${app.ws.wsdl.url.path}" />
</target>
</project>

@ -0,0 +1,19 @@
<project name="evo-app-multiple-client-common" >
<target name="load-properties-file" >
<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}/project.properties" />
<property file="${properties.base.dir}/app.properties" />
<property file="${properties.base.dir}/project.properties" />
<copy verbose="true" failonerror="true" overwrite="true" todir="${basedir}/build">
<fileset dir="${properties.dir}">
<include name="*" />
<include name="**/*" />
</fileset>
</copy>
</target>
</project>

@ -0,0 +1,113 @@
<project name="evo-app-build-5" >
<import file="common/evo-app-load-properties.xml" />
<import file="common/evo-app-deploy-common.xml" />
<!-- CLASSPATH -->
<path id="app.jar.classpath">
<fileset dir="${app.lib.dir}" />
</path>
<path id="app.build.classpath">
<path refid="app.jar.classpath" />
<pathelement location="${app.build.dir}" />
</path>
<path id="svn.classpath">
<fileset dir="${evolute.lib.tools.dir}" />
</path>
<path id="jsch.classpath">
<fileset dir="${evolute.lib.tools.dir}" />
</path>
<path id="lib.tools.classpath">
<fileset dir="${lib.tools.dir}" />
</path>
<!-- BUILD -->
<target name="app-prepare" depends="load-properties">
<echo message="Copying non-java files to build directory" />
<copy todir="${app.build.dir}">
<fileset dir="${app.src.dir}">
<exclude name="**/*.java" />
<exclude name="*.java" />
</fileset>
<fileset dir="${properties.dir}">
<include name="*" />
<include name="**/*" />
</fileset>
</copy>
</target>
<target name="app-build" description="Compiles all application classes" depends="app-prepare">
<mkdir dir="${app.build.dir}" />
<depend srcdir="${app.src.dir}" destdir="${app.build.dir}" cache="${app.dependencies.chache.dir}">
<include name="**/*.java" />
</depend>
<javac srcdir="${app.src.dir}" destdir="${app.build.dir}" classpathref="app.build.classpath" debug="on" deprecation="on" fork="true" memoryMaximumSize="512M" source="1.5" target="1.5" />
<antcall target="app-datanucleus"/>
</target>
<target name="app-datanucleus">
<path id="jpox.enhancer.classpath">
<fileset dir="${lib.tools.dir}" />
<path refid="app.build.classpath" />
</path>
<taskdef name="jpoxEnhancer" description="JPOX Enhancer" classpathref="jpox.enhancer.classpath" classname="org.datanucleus.enhancer.tools.EnhancerTask" />
<jpoxEnhancer maxmemory="256M" classpathref="jpox.enhancer.classpath" dir="${app.build.dir}" verbose="true"/>
</target>
<target name="app-clean" description="Removes all generated files">
<delete failonerror="false">
<fileset dir="${app.build.dir}">
<include name="**/*" />
</fileset>
</delete>
<delete dir="${app.build.dir}" failonerror="false" />
<delete dir="${app.dist.dir}" failonerror="false" />
<delete dir="${app.deploy.dist.dir}" failonerror="false" />
</target>
<target name="app-run" description="Runs the application" depends="app-build">
<java classname="${app.main}" classpathref="app.build.classpath" fork="true" dir="${app.build.dir}" />
</target>
<!-- JAR -->
<target name="app-deploy-create-jar" depends="app-clean, app-build" >
<mkdir dir="${app.deploy.dist.dir}" />
<jar destfile="${app.deploy.dist.dir}/${app.jar.name}" >
<fileset dir="${app.build.dir}">
<include name="**/*" />
</fileset>
</jar>
<copy todir="${app.deploy.dist.lib.dir}">
<fileset dir="${app.lib.dir}">
<include name="**/*" />
</fileset>
</copy>
</target>
<target name="app-create-jar" description="Make application Jar" depends="app-clean, app-build" >
<pathconvert property="jar.classpath.converted" refid="app.jar.classpath" pathsep=" ">
<map from="${app.dir}/" to="" />
<map from="${basedir}/" to="" />
</pathconvert>
<mkdir dir="${app.dist.dir}" />
<jar destfile="${app.dist.dir}/${app.jar.name}">
<fileset dir="${app.build.dir}">
<include name="**/*" />
</fileset>
<manifest>
<attribute name="Main-Class" value="${app.main}" />
<attribute name="Class-Path" value="${jar.classpath.converted}" />
</manifest>
</jar>
<copy todir="${app.dist.lib.dir}">
<fileset dir="${app.lib.dir}">
<include name="**/*" />
</fileset>
</copy>
</target>
</project>

@ -0,0 +1,25 @@
<project name="evo-app-build-jdo" >
<import file="common/evo-app-compile-common.xml" />
<import file="common/evo-app-deploy-common.xml" />
<target name="app-build" description="Compiles all application classes" depends="app-prepare,app-pre-build">
<mkdir dir="${app.build.dir}" />
<depend srcdir="${app.src.dir}" destdir="${app.build.dir}" cache="${app.dependencies.chache.dir}">
<include name="**/*.java" />
</depend>
<javac srcdir="${app.src.dir}" destdir="${app.build.dir}" classpathref="app.build.classpath" debug="on" deprecation="on" fork="true" memoryMaximumSize="512M" />
<antcall target="app-datanucleus"/>
<antcall target="app-post-build"/>
</target>
<target name="app-datanucleus">
<path id="jpox.enhancer.classpath">
<fileset dir="${lib.tools.dir}" />
<path refid="app.build.classpath" />
</path>
<taskdef name="jpoxEnhancer" description="JPOX Enhancer" classpathref="jpox.enhancer.classpath" classname="org.datanucleus.enhancer.tools.EnhancerTask" />
<jpoxEnhancer maxmemory="256M" classpathref="jpox.enhancer.classpath" dir="${app.build.dir}" verbose="true"/>
</target>
</project>

@ -0,0 +1,6 @@
<project name="evo-app-build-obfuscate-jdo">
<import file="common/evo-app-compile-common.xml" />
<import file="common/evo-app-deploy-common.xml" />
</project>

@ -0,0 +1,7 @@
<project name="evo-app-build-obfuscate">
<import file="common/evo-app-build-common.xml" />
<import file="common/evo-app-build-obfuscate-common.xml" />
<import file="common/evo-app-deploy-common.xml" />
</project>

@ -0,0 +1,6 @@
<project name="evo-app-build" >
<import file="common/evo-app-build-common.xml" />
<import file="common/evo-app-deploy-common.xml" />
</project>

@ -0,0 +1,7 @@
<project name="evo-app-multiple-client-build" >
<import file="common/evo-app-multiple-client-common.xml" />
<import file="common/evo-app-build-common.xml" />
<import file="common/evo-app-deploy-common.xml" />
</project>

@ -0,0 +1,6 @@
<project name="evo-app-multiple-client-build" >
<import file="common/evo-app-multiple-client-common.xml" />
<import file="evo-app-build-obfuscate.xml" />
</project>

@ -0,0 +1,30 @@
<project name="evo-app-ws-client-build" >
<import file="common/evo-app-build-common.xml" />
<path id="jaxws.classpath">
<path refid="lib.tools.classpath"/>
<pathelement location="${java.home}/../lib/tools.jar" />
</path>
<target name="receitas-gen-client" depends="app-build" description="generates client">
<taskdef name="wsimport" classname="com.sun.tools.ws.ant.WsImport">
<classpath refid="lib.tools.classpath" />
</taskdef>
<java fork="false" classname="com.evolute.ssl.InstallCert" classpathref="app.build.classpath">
<arg value="${app.ws.wsdl.url.host}"/>
<arg value="${app.ws.wsdl.url.port}"/>
<arg value="${app.ssl.truststore.file}"/>
<arg value="${app.ssl.truststore.pass}"/>
<arg value="true"/>
<arg value="true"/>
</java>
<wsimport fork="false" debug="true" verbose="true" keep="true" sourcedestdir="${app.src.dir}" package="${app.ws.dest.package}" wsdl="${app.ws.wsdl.url}">
<jvmarg value="-Djavax.net.ssl.trustStore=${basedir}/jssecacerts" />
<jvmarg value="-Djavax.net.ssl.trustStorePassword=changeit" />
<jvmarg value="-Djavax.net.ssl.keyStore=${basedir}/jssecacerts" />
<jvmarg value="-Djavax.net.ssl.keyStorePassword=changeit" />
</wsimport>
</target>
</project>

@ -0,0 +1,21 @@
<project name="evo-library-build" default="library-deploy">
<import file="common/evo-app-build-common.xml" />
<target name="deploy-default-project" depends="app-create-jar">
<mkdir dir="${deploy.project.dir}/lib"/>
<copy failonerror="false" verbose="true" file="${app.dist.dir}/${app.jar.name}" toDir="${deploy.project.dir}/lib" />
</target>
<target name="deploy-project" if="deploy.project.dir">
<antcall target="deploy-default-project" />
</target>
<target name="library-deploy" description="Deploys current version of evolute utilities" depends="load-static-properties">
<input defaultvalue="${basedir}" addproperty="deploy.project.dir">
<handler classpathref="lib.tools.classpath" classname="com.evolute.ant.ProjectInputHandler" />
</input>
<antcall target="deploy-project" />
</target>
</project>

@ -0,0 +1,5 @@
<project name="SIPRPSoft" basedir="." default="app-run">
<import file="ant/evo-app-build.xml" />
</project>

Binary file not shown.

Binary file not shown.

@ -0,0 +1,63 @@
#APP level
app.appName = SIPRPSoft
app.main-class = siprp.Main
app.main = siprp.Main
#app.max.mem=512M
#app.run.args=test 1 2 3
#app.resources.j2se.version = 1.0+
#app.resources.j2se.initial-heap-size = 4m
#app.resources.j2se.max-heap-size = 8m
#app.ws.dest.package=com.evolute.test-project.stubs
#app.ws.wsdl.url=https://www.evolute.pt/test-project/test-endpoint?wsdl
#app.ws.wsdl.url.protocol=https
#app.ws.wsdl.url.host=www.evolute.pt
#app.ws.wsdl.url.port=443
#app.ws.wsdl.url.path=/test-project/test-endpoint?wsdl
#app.ssl.truststore.file=jssecacerts
#app.ssl.truststore.pass=changeit
#JNLP level
#jnlp.app.appName = test-project
#jnlp.information.title = jnlp-Test Project
#jnlp.resources.j2se.version = 1.1+
#jnlp.test.url=http://www.evolute.pt/~software/test-project
#JNLP + PRODUCTION level
#jnlp.production.app.main-class = !com.evolute.test-project.TestProject2
#jnlp.production.app.appName = test-project
#jnlp.production.url=http://www.evolute.pt/~software/test-project
#jnlp.production.information.title = prod-Test Project
#jnlp.production.information.vendor = prod-Evolute Lda
#jnlp.production.information.description = prod-Tester Project for JNLP Generator
#jnlp.production.information.description.short = prod-JNLP Tester
#jnlp.production.information.icon = prod-logo.png
#jnlp.production.resources.j2se.version = 1.6.0+
#jnlp.production.resources.j2se.initial-heap-size = 64m
#jnlp.production.resources.j2se.max-heap-size = 512m
#jnlp.production.resources.property.jnlp.packEnabled = true
#jnlp.production.resources.property.apple.laf.useScreenMenuBar = true
#jnlp.production.resources.property.swing.defaultlaf = org.jvnet.substance.skin.SubstanceRavenGraphiteGlassLookAndFeel
#jnlp.production.resources.property.evolute.ui.overridePaint = false
#JNLP + TEST level
#jnlp.test.app.main-class = com.evolute.test-project.TestProject3
#jnlp.test.app.appName = project-test
#jnlp.test.url=http://www.evolute.pt/~software/versoes_teste/test-project
#jnlp.test.information.title = test-Test Project
#jnlp.test.information.vendor = test-Evolute Lda
#jnlp.test.information.description = test-Tester Project for JNLP Generator
#jnlp.test.information.description.short = test-JNLP Tester
#jnlp.test.information.icon = test-logo.png
#jnlp.test.resources.j2se.version = 1.6.0+
#jnlp.test.resources.j2se.initial-heap-size = 64m
#jnlp.test.resources.j2se.max-heap-size = 512m

@ -0,0 +1,399 @@
<?xml version="1.0" encoding="UTF-8"?>
<entity-gen-configuration>
<connection>
<url>jdbc:postgresql://www.evolute.pt:5436/siprp_local_3</url>
<user>postgres</user>
<password>Typein</password>
</connection>
<base-path>/home/tsimao/workspace/SIPRPSoft/src</base-path>
<inner-package>siprp.data.inner</inner-package>
<outer-package>siprp.data.outer</outer-package>
<super-class>siprp.data.BaseObject</super-class>
<package-file-name>package.xml</package-file-name>
<table>
<name>actualizacao</name>
<class-name>Actualizacao</class-name>
<super-class-name />
</table>
<table>
<name>avisos</name>
<class-name>Avisos</class-name>
<super-class-name />
</table>
<table>
<name>contactos</name>
<class-name>Contactos</class-name>
<super-class-name />
</table>
<table>
<name>ecd_oficial</name>
<class-name>EcdOficial</class-name>
<super-class-name />
</table>
<table>
<name>email_plano_de_actuacao</name>
<class-name>EmailPlanoDeActuacao</class-name>
<super-class-name />
</table>
<table>
<name>empresas</name>
<class-name>Empresas</class-name>
<super-class-name />
</table>
<table>
<name>errors</name>
<class-name>Errors</class-name>
<super-class-name />
</table>
<table>
<name>estabelecimentos</name>
<class-name>Estabelecimentos</class-name>
<super-class-name />
</table>
<table>
<name>etiquetas</name>
<class-name>Etiquetas</class-name>
<super-class-name />
</table>
<table>
<name>exames</name>
<class-name>Exames</class-name>
<super-class-name />
</table>
<table>
<name>exames_perfis</name>
<class-name>ExamesPerfis</class-name>
<super-class-name />
</table>
<table>
<name>exames_portaria</name>
<class-name>ExamesPortaria</class-name>
<super-class-name />
</table>
<table>
<name>historico_estabelecimento</name>
<class-name>HistoricoEstabelecimento</class-name>
<super-class-name>siprp.data.Historico</super-class-name>
</table>
<table>
<name>hs_area</name>
<class-name>HsArea</class-name>
<super-class-name />
</table>
<table>
<name>hs_email</name>
<class-name>HsEmail</class-name>
<super-class-name />
</table>
<table>
<name>hs_email_empresa</name>
<class-name>HsEmailEmpresa</class-name>
<super-class-name />
</table>
<table>
<name>hs_email_estabelecimento</name>
<class-name>HsEmailEstabelecimento</class-name>
<super-class-name />
</table>
<table>
<name>hs_equipamento</name>
<class-name>HsEquipamento</class-name>
<super-class-name />
</table>
<table>
<name>hs_legislacao</name>
<class-name>HsLegislacao</class-name>
<super-class-name />
</table>
<table>
<name>hs_legislacao_categoria</name>
<class-name>HsLegislacaoCategoria</class-name>
<super-class-name />
</table>
<table>
<name>hs_legislacao_empresa</name>
<class-name>HsLegislacaoEmpresa</class-name>
<super-class-name />
</table>
<table>
<name>hs_legislacao_estabelecimento</name>
<class-name>HsLegislacaoEstabelecimento</class-name>
<super-class-name />
</table>
<table>
<name>hs_medida</name>
<class-name>HsMedida</class-name>
<super-class-name />
</table>
<table>
<name>hs_normalizacao</name>
<class-name>HsNormalizacao</class-name>
<super-class-name />
</table>
<table>
<name>hs_normalizacao_empresa</name>
<class-name>HsNormalizacaoEmpresa</class-name>
<super-class-name />
</table>
<table>
<name>hs_normalizacao_estabelecimento</name>
<class-name>HsNormalizacaoEstabelecimento</class-name>
<super-class-name />
</table>
<table>
<name>hs_posto</name>
<class-name>HsPosto</class-name>
<super-class-name />
</table>
<table>
<name>hs_posto_estabelecimento</name>
<class-name>HsPostoEstabelecimento</class-name>
<super-class-name />
</table>
<table>
<name>hs_posto_medida</name>
<class-name>HsPostoMedida</class-name>
<super-class-name />
</table>
<table>
<name>hs_posto_risco</name>
<class-name>HsPostoRisco</class-name>
<super-class-name />
</table>
<table>
<name>hs_relatorio</name>
<class-name>HsRelatorio</class-name>
<super-class-name />
</table>
<table>
<name>hs_relatorio_area</name>
<class-name>HsRelatorioArea</class-name>
<super-class-name />
</table>
<table>
<name>hs_relatorio_equipamento</name>
<class-name>HsRelatorioEquipamento</class-name>
<super-class-name />
</table>
<table>
<name>hs_relatorio_legislacao</name>
<class-name>HsRelatorioLegislacao</class-name>
<super-class-name />
</table>
<table>
<name>hs_relatorio_medida</name>
<class-name>HsRelatorioMedida</class-name>
<super-class-name />
</table>
<table>
<name>hs_relatorio_normalizacao</name>
<class-name>HsRelatorioNormalizacao</class-name>
<super-class-name />
</table>
<table>
<name>hs_relatorio_posto</name>
<class-name>HsRelatorioPosto</class-name>
<super-class-name />
</table>
<table>
<name>hs_relatorio_posto_medida</name>
<class-name>HsRelatorioPostoMedida</class-name>
<super-class-name />
</table>
<table>
<name>hs_relatorio_posto_risco</name>
<class-name>HsRelatorioPostoRisco</class-name>
<super-class-name />
</table>
<table>
<name>hs_relatorio_risco</name>
<class-name>HsRelatorioRisco</class-name>
<super-class-name />
</table>
<table>
<name>hs_relatorio_risco_valor_qualitativo</name>
<class-name>HsRelatorioRiscoValorQualitativo</class-name>
<super-class-name />
</table>
<table>
<name>hs_risco</name>
<class-name>HsRisco</class-name>
<super-class-name />
</table>
<table>
<name>hs_risco_empresa</name>
<class-name>HsRiscoEmpresa</class-name>
<super-class-name />
</table>
<table>
<name>hs_risco_medida</name>
<class-name>HsRiscoMedida</class-name>
<super-class-name />
</table>
<table>
<name>hs_risco_tema</name>
<class-name>HsRiscoTema</class-name>
<super-class-name />
</table>
<table>
<name>ids</name>
<class-name>Ids</class-name>
<super-class-name />
</table>
<table>
<name>image</name>
<class-name>Image</class-name>
<super-class-name />
</table>
<table>
<name>lembretes</name>
<class-name>Lembretes</class-name>
<super-class-name />
</table>
<table>
<name>lembretes_tipos</name>
<class-name>LembretesTipos</class-name>
<super-class-name />
</table>
<table>
<name>marcacoes_empresa</name>
<class-name>MarcacoesEmpresa</class-name>
<super-class-name>siprp.data.Marcacao</super-class-name>
</table>
<table>
<name>marcacoes_estabelecimento</name>
<class-name>MarcacoesEstabelecimento</class-name>
<super-class-name>siprp.data.Marcacao</super-class-name>
</table>
<table>
<name>marcacoes_grupos_realizados</name>
<class-name>MarcacoesGruposRealizados</class-name>
<super-class-name />
</table>
<table>
<name>marcacoes_tecnicos_hst</name>
<class-name>MarcacoesTecnicosHst</class-name>
<super-class-name />
</table>
<table>
<name>marcacoes_trabalhador</name>
<class-name>MarcacoesTrabalhador</class-name>
<super-class-name>siprp.data.Marcacao</super-class-name>
</table>
<table>
<name>marcacoes_trabalhador_estados</name>
<class-name>MarcacoesTrabalhadorEstados</class-name>
<super-class-name />
</table>
<table>
<name>medicos</name>
<class-name>Medicos</class-name>
<super-class-name />
</table>
<table>
<name>prestadores</name>
<class-name>Prestadores</class-name>
<super-class-name />
</table>
<table>
<name>prestadores_grupos_protocolo</name>
<class-name>PrestadoresGruposProtocolo</class-name>
<super-class-name />
</table>
<table>
<name>prt_elementos_protocolo</name>
<class-name>PrtElementosProtocolo</class-name>
<super-class-name />
</table>
<table>
<name>prt_grupos_protocolo</name>
<class-name>PrtGruposProtocolo</class-name>
<super-class-name />
</table>
<table>
<name>prt_tipos_elementos_protocolo</name>
<class-name>PrtTiposElementosProtocolo</class-name>
<super-class-name />
</table>
<table>
<name>tipos_exames_comp</name>
<class-name>TiposExamesComp</class-name>
<super-class-name />
</table>
<table>
<name>trabalhadores</name>
<class-name>Trabalhadores</class-name>
<super-class-name />
</table>
<table>
<name>trabalhadores_consultas</name>
<class-name>TrabalhadoresConsultas</class-name>
<super-class-name />
</table>
<table>
<name>trabalhadores_consultas_datas</name>
<class-name>TrabalhadoresConsultasDatas</class-name>
<super-class-name />
</table>
<table>
<name>trabalhadores_consultas_datas_emails</name>
<class-name>TrabalhadoresConsultasDatasEmails</class-name>
<super-class-name />
</table>
<table>
<name>trabalhadores_consultas_datas_observacoes</name>
<class-name>TrabalhadoresConsultasDatasObservacoes</class-name>
<super-class-name />
</table>
<table>
<name>trabalhadores_ecd</name>
<class-name>TrabalhadoresEcd</class-name>
<super-class-name />
</table>
<table>
<name>trabalhadores_ecds</name>
<class-name>TrabalhadoresEcds</class-name>
<super-class-name />
</table>
<table>
<name>trabalhadores_ecds_analise</name>
<class-name>TrabalhadoresEcdsAnalise</class-name>
<super-class-name />
</table>
<table>
<name>trabalhadores_ecds_datas</name>
<class-name>TrabalhadoresEcdsDatas</class-name>
<super-class-name />
</table>
<table>
<name>trabalhadores_ecds_datas_emails</name>
<class-name>TrabalhadoresEcdsDatasEmails</class-name>
<super-class-name />
</table>
<table>
<name>trabalhadores_ecds_datas_observacoes</name>
<class-name>TrabalhadoresEcdsDatasObservacoes</class-name>
<super-class-name />
</table>
<table>
<name>trabalhadores_fichas_aptidao</name>
<class-name>TrabalhadoresFichasAptidao</class-name>
<super-class-name />
</table>
<table>
<name>trabalhadores_processo</name>
<class-name>TrabalhadoresProcesso</class-name>
<super-class-name />
</table>
<table>
<name>versao</name>
<class-name>Versao</class-name>
<super-class-name />
</table>
<table>
<name>version</name>
<class-name>Version</class-name>
<super-class-name />
</table>
</entity-gen-configuration>

@ -0,0 +1,12 @@
#app.jar.name=
#jnlp.dir=
#jnlp.extensions.dir=
#app.deploy.path=
#app.deploy.jnlp.path=
#app.version.file=
#app.version.comment=
#app.java.version=1.6
#app.deploy.server=www.evolute.pt
#app.deploy.production.script=/home/software/auto_deploy.sh
#app.deploy.test.script=/home/software/auto_test_deploy.sh
#deploy.prepare.script=/home/software/auto_prepare_deploy.sh

@ -1,342 +0,0 @@
package com.evolute.adt;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
public class OrderedMap<KeyClass extends Object> implements Iterable<KeyClass>
{
private static final long serialVersionUID = 1L;
private Vector<KeyClass> order = new Vector<KeyClass>();
private HashMap<KeyClass, List<Object>> map = new HashMap<KeyClass, List<Object>>();
public OrderedMap()
{
}
public OrderedMap(Collection<KeyClass> allPrestadores)
{
Iterator<KeyClass> iterator = allPrestadores.iterator();
while( iterator.hasNext() )
{
KeyClass value = iterator.next();
this.putLast( value, value );
}
}
public List<Object> getRow( int row )
{
return map.get( order.get( row ) );
}
public List<Object> getValues( KeyClass key )
{
return map.get( key );
}
public int rows()
{
return order.size();
}
public KeyClass getKeyForValue( Object value )
{
for( KeyClass key : map.keySet() )
{
List<Object> values = map.get( key );
if( value.equals( values ) )
{
return key;
}
else
{
for( Object currentValue : values )
{
if( currentValue.equals( value ) )
{
return key;
}
}
}
}
return null;
}
/**
* returns the length of the biggest line
*
* @return
*/
public int columns()
{
int result = 0;
for( KeyClass key : order )
{
result = map.get( key ).size() > result ? map.get( key ).size() : result;
}
return result;
}
public List<Object> getColumn( int i )
{
List<Object> result = new ArrayList<Object>();
if( order != null && order.size() > 0 )
{
for( KeyClass key : order )
{
List<Object> row = map.get( key );
if( row != null && row.size() > 0 )
{
result.add( row.get( 0 ) );
}
else
{
row.add( null );
}
}
}
return result;
}
public KeyClass getFirst()
{
return order.isEmpty() ? null : order.get( 0 );
}
public Iterator<KeyClass> iterator()
{
return order.iterator();
}
public boolean containsKey( KeyClass key )
{
return map.containsKey( key );
}
public Object getValueAt( int row, int column )
{
Object result = null;
if( row < order.size() )
{
List<Object> line = map.get( order.get( row ) );
if( column < line.size() )
{
result = line.get( column );
}
}
return result;
}
/**
* Adds arguments to the end of the row (on given order)
*
* @param key
* @param values
*/
public void putLast( KeyClass key, Object... values )
{
if( values != null )
{
for( Object currentValue : values )
{
putLast( key, currentValue );
}
}
}
/**
* Adds argument to the end of the row
*
* @param key
* @param value
*/
public void putLast( KeyClass key, Object value )
{
List<Object> list;
if( map.containsKey( key ) )
{
list = map.get( key );
}
else
{
list = new ArrayList<Object>();
order.add( key );
}
list.add( value );
map.put( key, list );
}
public List<Object> remove( Object key )
{
order.remove( key );
return map.remove( key );
}
/**
* Orders by first column (rows compared as strings)
*/
public void order()
{
order( 0 );
}
public void order( int columnNumber )
{
order( new int[] {
columnNumber
}, 0, 0, order.size() - 1, order );
}
public void order( int[] colNumbers )
{
order( colNumbers, 0, 0, order.size() - 1, order );
}
private void order( int[] colNumbers, int currentColumnIndex, int fromLineNumber, int toLineNumber, List<KeyClass> order )
{
if( colNumbers != null && currentColumnIndex >= 0 && fromLineNumber < toLineNumber && toLineNumber < order.size() && currentColumnIndex < colNumbers.length )
{
int columnNumber = colNumbers[currentColumnIndex];
if( order != null && order.size() > 0 )
{
List<Pair<String, KeyClass>> sortedList = new ArrayList<Pair<String, KeyClass>>();
for( int i = fromLineNumber; i < order.size() && i < (toLineNumber + 1); ++i )
{
KeyClass key = order.get( i );
List<Object> row = map.get( key );
String value = "";
if( row != null && row.size() > columnNumber && row.get( columnNumber ) != null )
{
value = row.get( columnNumber ).toString();
}
sortedList.add( new Pair<String, KeyClass>( value, key ) );
}
Collections.sort( sortedList );
List<Pair<String, KeyClass>> equalEntries = new ArrayList<Pair<String, KeyClass>>();
for( int i = 0; i < sortedList.size(); ++i )
{
Pair<String, KeyClass> entry = sortedList.get( i );
if( equalEntries.isEmpty() && i < (sortedList.size() - 1) )
{
equalEntries.add( entry );
}
else
{
Pair<String, KeyClass> previousEntry = equalEntries.get( 0 );
if( previousEntry.getLeft().equals( entry.getLeft() ) )
{
if( i < (sortedList.size() - 1) )
{
equalEntries.add( entry );
continue;
}
else
{
equalEntries.add( entry );
++i;
}
}
if( equalEntries.size() > 1 )
{
List<KeyClass> toSubOrder = new Vector<KeyClass>();
List<String> DEBUGLIST = new Vector<String>();
for( Pair<String, KeyClass> pair : equalEntries )
{
toSubOrder.add( pair.getRight() );
DEBUGLIST.add( pair.getLeft() );
}
order( colNumbers, currentColumnIndex + 1, 0, toSubOrder.size() - 1, toSubOrder );
for( int j = 0; j < toSubOrder.size(); ++j )
{
sortedList.set( i - toSubOrder.size() + j, new Pair<String, KeyClass>( "", toSubOrder.get( j ) ) );
}
}
equalEntries.clear();
if( i < (sortedList.size() - 1) )
{
equalEntries.add( entry );
}
}
}
for( int i = 0; i < sortedList.size(); ++i )
{
Pair<String, KeyClass> value = sortedList.get( i );
order.set( i, value.getRight() );
}
}
}
}
public void addRow( KeyClass key, List<Object> grupo )
{
if( key != null && grupo != null )
{
order.add( key );
map.put( key, grupo );
}
}
public void clear()
{
order.clear();
map.clear();
}
public void deleteRow( int row )
{
if( row < order.size() )
{
KeyClass key = order.get( row );
order.remove( row );
map.remove( key );
}
}
public KeyClass getKeyForRow( int row )
{
KeyClass result = null;
if( row < order.size() )
{
result = order.get( row );
}
return result;
}
public void setValueAt( int row, int col, Object obj )
{
if( row < order.size() )
{
List<Object> line = map.get( order.get( row ) );
if( col < line.size() )
{
line.add( col, obj );
}
}
}
public Object getFirstValue( KeyClass key )
{
return getValue( key, 0 );
}
public Object getValue( KeyClass key, int i )
{
Object result = null;
if( key != null && order.contains( key ) )
{
List<Object> row = map.get( key );
if( row != null && row.size() > i )
{
result = row.get( i );
}
}
return result;
}
}

@ -1,100 +0,0 @@
package com.evolute.adt;
public class Pair<CARCLASS extends Object, CDRCLASS extends Object> implements Comparable<Pair<? extends CARCLASS,? extends CDRCLASS>>
{
private final CARCLASS left;
private final CDRCLASS right;
public Pair( CARCLASS leftValue, CDRCLASS rightValue )
{
this.left = leftValue;
this.right = rightValue;
}
public CARCLASS getLeft()
{
return left;
}
public CDRCLASS getRight()
{
return right;
}
@SuppressWarnings("unchecked")
@Override
public boolean equals(Object obj)
{
boolean result = obj != null;
if( result )
{
if( obj instanceof Pair )
{
result = ( left == null ? (((Pair) obj).left == null ) : (left.equals(((Pair) obj).left)) );
result &= ( right == null ? (((Pair) obj).right == null ) : (right.equals(((Pair) obj).right)) );
}
else
{
result = false;
}
}
return result;
}
@Override
public int compareTo(Pair<? extends CARCLASS, ? extends CDRCLASS> pair)
{
int result = compare( left, pair == null ? null : pair.left );
if( result == 0 )
{
result = compare( right, pair == null ? null : pair.right );
}
return result;
}
@SuppressWarnings("unchecked")
private int compare( Object a, Object b )
{
int result = a == null ? (b == null ? 0 : -1 ) : ( b == null ? 1 : 0 );
if( a != null && b != null )
{
if( a.getClass().equals( b.getClass() ) && (a instanceof Comparable) )
{
((Comparable)a).compareTo(b);
}
else
{
result = compare(a.toString(),b.toString());
}
}
return result;
}
@Override
public int hashCode()
{
int result = super.hashCode();
if( left != null )
{
result = left.hashCode();
if( right != null )
{
result ^= right.hashCode();
}
}
else if( right != null )
{
result = right.hashCode();
}
return result;
}
@Override
public String toString()
{
return "<"+left+","+right+">";
}
}

@ -1,55 +0,0 @@
package com.evolute.adt;
public class Range
{
private final int start;
private final int end;
private final int length;
public Range( int start, int end )
{
super();
this.start = start;
this.end = end;
this.length = 1 + ( Math.max( Math.abs( start ), Math.abs( end ) ) - Math.min( Math.abs( start ), Math.abs( end ) ) );
}
public int getStart()
{
return start;
}
public int getEnd()
{
return end;
}
/**
* The lenght of the range
* Examples:
* start:end > length
* 0:3 > 4
* -1:-1 > 1
* @return
*/
public int getLength()
{
return length;
}
@Override
public boolean equals( Object obj )
{
return (obj instanceof Range) && ((Range)obj).start == start && ((Range)obj).end == end;
}
@Override
public int hashCode()
{
return new Integer( start ).hashCode() ^ new Integer( end ).hashCode();
}
}

@ -1,263 +0,0 @@
package com.evolute.adt;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;
import leaf.ui.LeafTree;
import com.evolute.utils.strings.StringPlainer;
public class TreeTools
{
private static final Comparator<DefaultMutableTreeNode> comparator = new Comparator<DefaultMutableTreeNode>()
{
private int compareObjects( Object o1, Object o2 )
{
if( o1 == null )
{
return o2 == null ? 0 : -1;
}
else if( (o1 instanceof Comparable ) && (o2 instanceof Comparable))
{
return ((Comparable)o1).compareTo( (Comparable) o2 );
}
else
{
return o2 == null ? 1 : StringPlainer.convertString( o1.toString() ).compareTo( StringPlainer.convertString( o2.toString() ) );
}
}
@Override
public int compare( DefaultMutableTreeNode o1, DefaultMutableTreeNode o2 )
{
if( o1 == null )
{
return o2 == null ? 0 : -1;
}
else
{
return o2 == null ? 1 : compareObjects( o1.getUserObject(), o2.getUserObject() );
}
}
};
public static void refreshTree( JTree tree, DefaultMutableTreeNode node, boolean expand )
{
if( tree instanceof LeafTree )
{
((LeafTree)tree).saveExpansionState();
}
((DefaultTreeModel) tree.getModel()).nodeStructureChanged( node );
if( expand )
{
for( int i = 0; i < tree.getRowCount(); ++i)
{
tree.expandPath( tree.getPathForRow( i ) );
}
}
if( tree instanceof LeafTree )
{
((LeafTree)tree).loadExpansionState();
}
}
public static boolean userObjectExistsOn( Object object, DefaultMutableTreeNode on )
{
boolean result = false;
if( object != null && on != null )
{
result = object.equals( on.getUserObject() );
for( int i = 0; i < on.getChildCount() && !result; ++i )
{
result |= userObjectExistsOn( object, (DefaultMutableTreeNode) on.getChildAt( i ) );
}
}
return result;
}
public static DefaultMutableTreeNode findNodeWithUserObject( Object object, DefaultMutableTreeNode on )
{
DefaultMutableTreeNode result = null;
if( object != null && on != null )
{
result = object.equals( on.getUserObject() ) ? on : null;
for( int i = 0; i < on.getChildCount() && result == null; ++i )
{
result = object.equals(((DefaultMutableTreeNode) on.getChildAt( i )).getUserObject()) ? (DefaultMutableTreeNode) on.getChildAt( i ) : findNodeWithUserObject( object, (DefaultMutableTreeNode) on.getChildAt( i ) );
}
}
return result;
}
public static DefaultMutableTreeNode cloneFullNode( DefaultMutableTreeNode node )
{
DefaultMutableTreeNode result = (DefaultMutableTreeNode) node.clone();
for( int i = 0; i < node.getChildCount(); ++i )
{
DefaultMutableTreeNode child = (DefaultMutableTreeNode) node.getChildAt( i );
result.add( cloneFullNode(child) );
}
return result;
}
public static void merge( DefaultMutableTreeNode with, DefaultMutableTreeNode what )
{
if( what != null )
{
for( int i = 0; i < what.getChildCount(); ++i )
{
DefaultMutableTreeNode child = (DefaultMutableTreeNode) what.getChildAt( i );
DefaultMutableTreeNode exists = TreeTools.findNodeWithUserObject( child.getUserObject(), with );
if( exists == null )
{
with.add( TreeTools.cloneFullNode( child ) );
}
else
{
merge( exists, child );
}
}
}
}
public static void removeAll( DefaultMutableTreeNode from, DefaultMutableTreeNode what )
{
for( int i = 0; i < what.getChildCount(); ++i )
{
DefaultMutableTreeNode child = (DefaultMutableTreeNode) what.getChildAt( i );
removeAll( from, child );
}
DefaultMutableTreeNode exists = TreeTools.findNodeWithUserObject( what.getUserObject(), from );
if( exists != null )
{
exists.removeFromParent();
}
}
public static void remove( DefaultMutableTreeNode from, DefaultMutableTreeNode what )
{
for( int i = 0; i < what.getChildCount(); ++i )
{
DefaultMutableTreeNode child = (DefaultMutableTreeNode) what.getChildAt( i );
DefaultMutableTreeNode exists = TreeTools.findNodeWithUserObject( child.getUserObject(), from );
if( exists != null )
{
exists.removeFromParent();
}
}
}
public static void removeAllLeafs( DefaultMutableTreeNode from, DefaultMutableTreeNode what )
{
for( int i = 0; i < what.getChildCount(); ++i )
{
DefaultMutableTreeNode child = (DefaultMutableTreeNode) what.getChildAt( i );
removeAllLeafs( from, child );
}
DefaultMutableTreeNode exists = TreeTools.findNodeWithUserObject( what.getUserObject(), from );
if( exists != null && exists.getChildCount() == 0 )
{
exists.removeFromParent();
}
}
public static void sort( DefaultMutableTreeNode result, boolean useDefaultComparator )
{
if( result != null )
{
List<DefaultMutableTreeNode> children = new ArrayList<DefaultMutableTreeNode>(result.getChildCount());
for( int i = 0; i < result.getChildCount(); ++i )
{
children.add( (DefaultMutableTreeNode) result.getChildAt( i ) );
}
result.removeAllChildren();
if( useDefaultComparator )
{
Collections.sort( children, comparator );
}
for( DefaultMutableTreeNode child : children )
{
sort( child );
result.add( child );
}
}
}
public static void sort( DefaultMutableTreeNode result )
{
sort( result, true );
}
public static void sort( DefaultMutableTreeNode result, Comparator<DefaultMutableTreeNode> comparator )
{
if( result != null )
{
List<DefaultMutableTreeNode> children = new ArrayList<DefaultMutableTreeNode>(result.getChildCount());
for( int i = 0; i < result.getChildCount(); ++i )
{
children.add( (DefaultMutableTreeNode) result.getChildAt( i ) );
}
result.removeAllChildren();
Collections.sort( children, comparator );
for( DefaultMutableTreeNode child : children )
{
sort( child );
result.add( child );
}
}
}
public static TreePath getPathFor( DefaultMutableTreeNode node )
{
List<Object> path = getObjectPathFor( node );
return new TreePath( path.toArray( new Object[path.size()] ) );
}
private static List<Object> getObjectPathFor( DefaultMutableTreeNode node )
{
LinkedList<Object> path = new LinkedList<Object>();
if( node != null )
{
if( node.getParent() != null )
{
path.addAll( getObjectPathFor( (DefaultMutableTreeNode) node.getParent() ) );
}
path.add( node );
}
return path;
}
private static DefaultMutableTreeNode getRoot( JTree tree )
{
return (DefaultMutableTreeNode) tree.getModel().getRoot();
}
public static void expandNodeForObject(Object userObject, JTree tree )
{
Object root = getRoot( tree );
if( tree != null && userObject != null && ( root instanceof DefaultMutableTreeNode ) )
{
DefaultMutableTreeNode found = findNodeWithUserObject(userObject, (DefaultMutableTreeNode) root);
if( found != null )
{
TreePath path = getPathFor( found );
if( path != null )
{
tree.expandPath( path );
}
}
}
}
}

@ -1,13 +0,0 @@
package com.evolute.adt;
public interface Validator<OBJECT_CLASS extends Object>
{
/**
* Tests if given object is valid
* @param object
* @return
*/
public boolean isValid(OBJECT_CLASS object);
}

@ -9,7 +9,7 @@ import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
import com.evolute.adt.TreeTools;
import com.evolute.utils.ui.trees.TreeTools;
public class LeafTree extends JTree
{

@ -23,10 +23,10 @@ import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel;
import com.evolute.adt.TreeTools;
import com.evolute.utils.error.ErrorLogger;
import com.evolute.utils.images.ImageException;
import com.evolute.utils.images.ImageIconLoader;
import com.evolute.utils.ui.trees.TreeTools;

@ -12,6 +12,7 @@ import java.util.Hashtable;
import siprp.data.AvisoConstants;
import siprp.data.Marcacao;
import siprp.data.outer.MarcacoesTrabalhadorData;
import com.evolute.utils.Singleton;
import com.evolute.utils.arrays.Virtual2DArray;
@ -564,7 +565,7 @@ public class FichaDataProvider
new String[]{ "MAX(data)" },
new Field( "trabalhador_id" ).isEqual( trabalhadorID ).and(
new Field( "estado" ).isEqual( new Integer( 2 ) ) ).and(
new Field( "tipo" ).isEqual( new Integer( siprp.data.MarcacaoTrabalhadorData.TIPO_CONSULTA ) ) ) );
new Field( "tipo" ).isEqual( new Integer( MarcacoesTrabalhadorData.TIPO_CONSULTA ) ) ) );
Virtual2DArray realizadaArray = executer.executeQuery( realizadaSelect );
Date realizada = (Date) realizadaArray.get( 0, 0 );
Select select;
@ -574,7 +575,7 @@ public class FichaDataProvider
new String[]{ "MIN(id)" },
new Field( "trabalhador_id" ).isEqual( trabalhadorID ).and(
new Field( "estado" ).isEqual( new Integer( 0 ) ) ).and(
new Field( "tipo" ).isEqual( new Integer( siprp.data.MarcacaoTrabalhadorData.TIPO_CONSULTA ) ) ) );
new Field( "tipo" ).isEqual( new Integer( MarcacoesTrabalhadorData.TIPO_CONSULTA ) ) ) );
}
else
{
@ -583,7 +584,7 @@ public class FichaDataProvider
new Field( "trabalhador_id" ).isEqual( trabalhadorID ).and(
new Field( "estado" ).isEqual( new Integer( 0 ) ) ).and(
new Field( "data" ).isGreater( realizada ) ).and(
new Field( "tipo" ).isEqual( new Integer( siprp.data.MarcacaoTrabalhadorData.TIPO_CONSULTA ) ) ) );
new Field( "tipo" ).isEqual( new Integer( MarcacoesTrabalhadorData.TIPO_CONSULTA ) ) ) );
}
Virtual2DArray array = executer.executeQuery( select );
if( array.columnLength() == 0 || array.get( 0, 0 ) == null )

@ -1,69 +0,0 @@
package siprp;
import java.util.Date;
import java.util.Properties;
import com.evolute.utils.Singleton;
import com.evolute.utils.jdo.JDOProvider;
public class JDOInitializer
{
public void initializeJDO(String url, String user, String password)
{
Date d = new Date();
System.out.println( "INIT: " + d );
Properties jpoxProps;
jpoxProps = System.getProperties();//new Properties();
// Set the PersistenceManagerFactoryClass to the TJDO class.
jpoxProps.setProperty( "javax.jdo.PersistenceManagerFactoryClass",
"org.jpox.PersistenceManagerFactoryImpl" );
// Set the JDBC driver name.
jpoxProps.setProperty( "javax.jdo.option.ConnectionDriverName", (String) Singleton.getInstance( SingletonConstants.LOCAL_DRIVER_NAME ) );
jpoxProps.setProperty( "org.jpox.identifier.fullyQualifiedNames", "false" );
// props.setProperty("com.triactive.jdo.transactionIsolation",
// "read-uncommitted" );
// Set the connection URL
// jpoxProps.setProperty( "javax.jdo.option.ConnectionURL", "jdbc:informix-sqli://192.168.0.3:6666"
// + "/apdp_db:informixserver=server" );
jpoxProps.setProperty( "javax.jdo.option.ConnectionURL", url );
jpoxProps.setProperty( "javax.jdo.option.ConnectionUserName", user );
jpoxProps.setProperty( "javax.jdo.option.ConnectionPassword", password );
// jpoxProps.setProperty( "javax.jdo.option.IgnoreCache", "true" );
// jpoxProps.setProperty( "javax.jdo.option.NonTransactionalRead", "true" );
jpoxProps.setProperty( "javax.jdo.option.RetainValues", "true" );
jpoxProps.setProperty( "org.jpox.autoCreateTables", "false" );
jpoxProps.setProperty( "org.jpox.autoCreateSchema", "false" );
jpoxProps.setProperty( "org.jpox.autoCreateConstraints", "false" );
jpoxProps.setProperty( "org.jpox.validateTables", "false" );
jpoxProps.setProperty( "org.jpox.validateConstraints", "false" );
jpoxProps.setProperty( "org.jpox.autoStartMechanismMode", "Ignored" );
jpoxProps.setProperty( "org.jpox.autoStartMechanism", "None" );
// jpoxProps.setProperty( "javax.jdo.option.RetainValues", "true" );
// jpoxProps.setProperty( "javax.jdo.option.Optimistic", "true" );
// jpoxProps.setProperty( "org.jpox.identifier.defaultSchemaName", "informix" );
jpoxProps.setProperty( "org.jpox.rdbms.CheckExistTablesOrViews", "false" );
System.setProperty( "org.jpox.catalogName", (String)Singleton.getInstance( SingletonConstants.LOCAL_DB_NAME ) );
System.setProperty( "org.jpox.schemaName", "" );
// PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory( jpoxProps );
//// pmf.setOptimistic( true );
//System.out.print( "Loading PM: " + new Date() );
// // ( ( PersistenceManagerFactoryImpl )pmf ).setTransactionIsolation( Connection.TRANSACTION_READ_UNCOMMITTED );
// // Retrieve a PersistenceManager from the PersistenceManagerFactory.
// PersistenceManager pm = pmf.getPersistenceManager();
// JDOObject.setPersistentManager( pm );
// Singleton.setInstance( Singleton.DEFAULT_PERSISTENCE_MANAGER_FACTORY, pmf );
// Singleton.setInstance( SingletonConstants.PERSISTENCE_MANAGER, pm );
JDOProvider jdoProvider = new JDOProvider( jpoxProps );
Singleton.setInstance( Singleton.DEFAULT_JDO_PROVIDER, jdoProvider );
System.out.println( "PM done " + new Date() + "JDO: " + jdoProvider );
}
}

@ -31,18 +31,10 @@ import org.apache.cayenne.map.DataMap;
import siprp.clientes.AvisosPanel;
import siprp.companydataloaders.SIPRPDataLoader;
import siprp.data.ActualizacaoSaveHandler;
import siprp.data.DisableDeleteHandler;
import siprp.data.EmpresaData;
import siprp.data.EstabelecimentoData;
import siprp.data.MarcacaoEmpresaData;
import siprp.data.MarcacaoEstabelecimentoData;
import siprp.data.MarcacaoSaveAndDeleteHandler;
import siprp.data.MarcacaoTrabalhadorData;
import siprp.data.TrabalhadorData;
import siprp.lembretes.LembretesDemon;
import siprp.update.UpdateWindow;
import siprp.update.UpdateList;
import com.evolute.module.updater.Updater;
import com.evolute.utils.Singleton;
import com.evolute.utils.db.DBException;
import com.evolute.utils.db.DBManager;
@ -51,7 +43,6 @@ import com.evolute.utils.db.keyretrievers.JDBCAutoKeyRetriever;
import com.evolute.utils.error.ErrorLogger;
import com.evolute.utils.jdbc.DBStatementExecuter;
import com.evolute.utils.jdbc.StatementExecuterFactory;
import com.evolute.utils.jdo.JDOObject;
import com.evolute.utils.sql.Insert;
import com.evolute.utils.sql.SQLQuery;
import com.evolute.utils.strings.UnicodeChecker;
@ -71,17 +62,6 @@ public class Main implements com.evolute.utils.ui.window.Connector
static
{
JDOObject.registerOperationHandlerForClass( DisableDeleteHandler.INSTANCE, EmpresaData.class );
JDOObject.registerOperationHandlerForClass( DisableDeleteHandler.INSTANCE, EstabelecimentoData.class );
JDOObject.registerOperationHandlerForClass( DisableDeleteHandler.INSTANCE, TrabalhadorData.class );
JDOObject.registerOperationHandlerForClass( ActualizacaoSaveHandler.INSTANCE, EmpresaData.class );
JDOObject.registerOperationHandlerForClass( ActualizacaoSaveHandler.INSTANCE, EstabelecimentoData.class );
JDOObject.registerOperationHandlerForClass( ActualizacaoSaveHandler.INSTANCE, TrabalhadorData.class );
JDOObject.registerOperationHandlerForClass( MarcacaoSaveAndDeleteHandler.INSTANCE, MarcacaoEmpresaData.class );
JDOObject.registerOperationHandlerForClass( MarcacaoSaveAndDeleteHandler.INSTANCE, MarcacaoEstabelecimentoData.class );
JDOObject.registerOperationHandlerForClass( MarcacaoSaveAndDeleteHandler.INSTANCE, MarcacaoTrabalhadorData.class );
ESTADO_PROCESSO_BY_CODE.put( PROCESSO_ABERTO_CODE, PROCESSO_ABERTO_DESCRIPTION );
ESTADO_PROCESSO_BY_CODE.put( PROCESSO_FECHADO_CODE, PROCESSO_FECHADO_DESCRIPTION );
@ -172,7 +152,6 @@ public class Main implements com.evolute.utils.ui.window.Connector
fopConfigFile = loadFopConfigFile();
new UpdateWindow().update();
}
@ -220,14 +199,14 @@ public class Main implements com.evolute.utils.ui.window.Connector
DBManager dbm = new JDBCManager( url, user, passwd , 10, 8, 8, null );
// UnicodeChecker.setUseDoubleSlash( true );
Singleton.setInstance( Singleton.DEFAULT_DBMANAGER, dbm );
StatementExecuterFactory.initialize(
new DBStatementExecuter( dbm.getSharedExecuter() ) );
new JDOInitializer().initializeJDO( url, user, passwd );
StatementExecuterFactory.initialize(
new DBStatementExecuter( dbm.getSharedExecuter() ) );
Updater.getInstance().executeUpdate(true, true, UpdateList.UPDATE_LIST);
StatementExecuterFactory.initialize(
new DBStatementExecuter( dbm.getSharedExecuter() ) );
new DBStatementExecuter( dbm.getSharedExecuter(this) ) );
new ORMInitializer().initializeORM( url, user, passwd );
Singleton.setInstance( Singleton.TODAY, new Date() );
initializeCayenne( url, user, passwd);

@ -0,0 +1,82 @@
package siprp;
import com.evolute.entity.ProviderInterface;
import com.evolute.entity.ProviderRegistry;
import com.evolute.entity.evo.EvoDataProviderFactory;
import com.evolute.entity.utils.ConnectionIdentity;
import com.evolute.utils.Singleton;
import com.evolute.utils.db.keyretrievers.PostgresqlAutoKeyRetriever;
import com.evolute.utils.sql.Insert;
public class ORMInitializer
{
public void initializeORM(String url, String user, String password)
{
// Date d = new Date();
// System.out.println( "INIT: " + d );
//
//
// Properties jpoxProps;
// jpoxProps = System.getProperties();//new Properties();
// Set the PersistenceManagerFactoryClass to the TJDO class.
// jpoxProps.setProperty( "javax.jdo.PersistenceManagerFactoryClass",
// "org.jpox.PersistenceManagerFactoryImpl" );
// Set the JDBC driver name.
// jpoxProps.setProperty( "javax.jdo.option.ConnectionDriverName", (String) Singleton.getInstance( SingletonConstants.LOCAL_DRIVER_NAME ) );
// jpoxProps.setProperty( "org.jpox.identifier.fullyQualifiedNames", "false" );
// props.setProperty("com.triactive.jdo.transactionIsolation",
// "read-uncommitted" );
// Set the connection URL
// jpoxProps.setProperty( "javax.jdo.option.ConnectionURL", "jdbc:informix-sqli://192.168.0.3:6666"
// + "/apdp_db:informixserver=server" );
// jpoxProps.setProperty( "javax.jdo.option.ConnectionURL", url );
// jpoxProps.setProperty( "javax.jdo.option.ConnectionUserName", user );
// jpoxProps.setProperty( "javax.jdo.option.ConnectionPassword", password );
// jpoxProps.setProperty( "javax.jdo.option.IgnoreCache", "true" );
// jpoxProps.setProperty( "javax.jdo.option.NonTransactionalRead", "true" );
// jpoxProps.setProperty( "javax.jdo.option.RetainValues", "true" );
//
// jpoxProps.setProperty( "org.jpox.autoCreateTables", "false" );
// jpoxProps.setProperty( "org.jpox.autoCreateSchema", "false" );
// jpoxProps.setProperty( "org.jpox.autoCreateConstraints", "false" );
// jpoxProps.setProperty( "org.jpox.validateTables", "false" );
// jpoxProps.setProperty( "org.jpox.validateConstraints", "false" );
// jpoxProps.setProperty( "org.jpox.autoStartMechanismMode", "Ignored" );
// jpoxProps.setProperty( "org.jpox.autoStartMechanism", "None" );
// jpoxProps.setProperty( "javax.jdo.option.RetainValues", "true" );
// jpoxProps.setProperty( "javax.jdo.option.Optimistic", "true" );
// jpoxProps.setProperty( "org.jpox.identifier.defaultSchemaName", "informix" );
// jpoxProps.setProperty( "org.jpox.rdbms.CheckExistTablesOrViews", "false" );
//
// System.setProperty( "org.jpox.catalogName", (String)Singleton.getInstance( SingletonConstants.LOCAL_DB_NAME ) );
// System.setProperty( "org.jpox.schemaName", "" );
// PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory( jpoxProps );
//// pmf.setOptimistic( true );
//System.out.print( "Loading PM: " + new Date() );
// // ( ( PersistenceManagerFactoryImpl )pmf ).setTransactionIsolation( Connection.TRANSACTION_READ_UNCOMMITTED );
// // Retrieve a PersistenceManager from the PersistenceManagerFactory.
// PersistenceManager pm = pmf.getPersistenceManager();
// JDOObject.setPersistentManager( pm );
// Singleton.setInstance( Singleton.DEFAULT_PERSISTENCE_MANAGER_FACTORY, pmf );
// Singleton.setInstance( SingletonConstants.PERSISTENCE_MANAGER, pm );
// JDOProvider jdoProvider = new JDOProvider( jpoxProps );
// Singleton.setInstance( Singleton.DEFAULT_JDO_PROVIDER, jdoProvider );
//System.out.println( "PM done " + new Date() + "JDO: " + jdoProvider );
Insert.setDefaultKeyRetriever( PostgresqlAutoKeyRetriever.RETRIEVER );
ProviderRegistry.registerDefaultProviderFactory( new EvoDataProviderFactory() );
ConnectionIdentity conn = new ConnectionIdentity( url, user );
conn.setPassword( password );
ProviderRegistry.registerDefaultConnection( conn );
ProviderInterface provider = ProviderRegistry.getDefaultProvider( conn );
Singleton.setInstance( Singleton.DEFAULT_OBJECT_PROVIDER, provider );
Singleton.setInstance( Singleton.DEFAULT_JDO_PROVIDER, provider );
}
}

@ -6,6 +6,8 @@
package siprp;
import org.apache.log4j.Level;
import com.evolute.utils.Singleton;
import com.evolute.utils.db.DBManager;
import com.evolute.utils.db.Executer;
@ -62,6 +64,7 @@ public class SHSTLogger implements Logger
executer = dbm.getExclusiveExecuter( this );
}
@Override
public void log( String str )
{
String mem = "(" + Runtime.getRuntime().freeMemory() + "/" +
@ -84,6 +87,7 @@ public class SHSTLogger implements Logger
}
}
@Override
public void logException( Throwable ex )
{
StackTraceElement ste[] = ex.getStackTrace();
@ -112,5 +116,20 @@ public class SHSTLogger implements Logger
ex.printStackTrace();
}
}
@Override
public void log(String arg0, Level arg1)
{
}
@Override
public void logException(Throwable arg0, Level arg1)
{
}
@Override
public void close() {
}
}

@ -17,6 +17,7 @@ import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Hashtable;
import java.util.Map;
import java.util.Set;
import javax.swing.BorderFactory;
@ -29,14 +30,14 @@ import javax.swing.JScrollPane;
import siprp.FichaDataProvider;
import siprp.SIPRPTracker;
import siprp.data.AvisoConstants;
import siprp.data.AvisoData;
import siprp.data.EmpresaData;
import siprp.data.EstabelecimentoData;
import siprp.data.TrabalhadorData;
import siprp.data.outer.AvisosData;
import siprp.data.outer.EmpresasData;
import siprp.data.outer.EstabelecimentosData;
import siprp.data.outer.TrabalhadoresData;
import com.evolute.entity.ProviderInterface;
import com.evolute.utils.Singleton;
import com.evolute.utils.dataui.ControllableComponent;
import com.evolute.utils.jdo.JDOProvider;
import com.evolute.utils.ui.DialogException;
/**
@ -47,7 +48,7 @@ public class AvisosPanel extends JPanel
implements ActionListener, ControllableComponent
{
private static final DateFormat DATE_FORMAT = DateFormat.getDateInstance( DateFormat.SHORT );
private JDOProvider JDO;
private ProviderInterface JDO;
private FichaDataProvider provider;
private SIPRPTracker tracker;
@ -55,10 +56,10 @@ public class AvisosPanel extends JPanel
private JPanel estabelecimentosPanel;
private JPanel trabalhadoresPanel;
// private AvisoData avisos[];
// private AvisoData avisosEmpresa[];
// private AvisoData avisosEstabelecimento[];
// private AvisoData avisosTrabalhador[];
// private AvisosData avisos[];
// private AvisosData avisosEmpresa[];
// private AvisosData avisosEstabelecimento[];
// private AvisosData avisosTrabalhador[];
private Object avisosEmpresa[][];
private Object avisosEstabelecimento[][];
@ -70,16 +71,16 @@ public class AvisosPanel extends JPanel
private Hashtable buttonTypeHash;
/** Creates a new instance of AvisosPanel */
public AvisosPanel(/* AvisoData avisosEmpresa[], AvisoData avisosEstabelecimento[], AvisoData avisosTrabalhador[]*/ )
public AvisosPanel(/* AvisosData avisosEmpresa[], AvisosData avisosEstabelecimento[], AvisosData avisosTrabalhador[]*/ )
throws Exception
{
// this.avisosEmpresa = new AvisoData[ 0 ];
// this.avisosEstabelecimento = new AvisoData[ 0 ];
// this.avisosTrabalhador = new AvisoData[ 0 ];
// this.avisosEmpresa = new AvisosData[ 0 ];
// this.avisosEstabelecimento = new AvisosData[ 0 ];
// this.avisosTrabalhador = new AvisosData[ 0 ];
// setupComponents();
buttonHash = new Hashtable();
buttonTypeHash = new Hashtable();
JDO = (JDOProvider) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
JDO = (ProviderInterface) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
// System.out.println( "public AvisosPanel() JDO: " + JDO );
}
@ -99,7 +100,7 @@ public class AvisosPanel extends JPanel
JPanel pan = new JPanel();
GridBagLayout gridbag = new GridBagLayout();
pan.setBorder( BorderFactory.createLineBorder( Color.black, 1 ) );
// EmpresaData empresa = (EmpresaData)avisosEmpresa[ n ].get( AvisoData.EMPRESA );
// EmpresasData empresa = (EmpresasData)avisosEmpresa[ n ].get( AvisosData.EMPRESA );
pan.setLayout( gridbag );
constraints.gridheight = GridBagConstraints.REMAINDER;
constraints.gridx = 0;
@ -110,7 +111,7 @@ public class AvisosPanel extends JPanel
pan.add( tratarButton );
//buttonHash.put( tratarButton, avisosEmpresa[ n ] );
// buttonHash.put( tratarButton, new Integer( n ) );
// buttonHash.put( tratarButton, avisosEmpresa[ n ].get( AvisoData.ID ) );
// buttonHash.put( tratarButton, avisosEmpresa[ n ].get( AvisosData.ID ) );
buttonHash.put( tratarButton, avisosEmpresa[ n ][ 0 ] );
buttonTypeHash.put( tratarButton, new Integer( AvisoConstants.TIPO_EMPRESA ) );
tratarButton.addActionListener( this );
@ -119,7 +120,7 @@ public class AvisosPanel extends JPanel
constraints.weightx = 1;
constraints.gridheight = 1;
constraints.gridwidth = GridBagConstraints.REMAINDER;
// JLabel empresaLabel = new JLabel( "" + empresa.get( EmpresaData.DESIGNACAO_SOCIAL ) );
// JLabel empresaLabel = new JLabel( "" + empresa.get( EmpresasData.DESIGNACAO_SOCIAL ) );
JLabel empresaLabel = new JLabel( "" + avisosEmpresa[ n ][ 3 ] );
gridbag.setConstraints( empresaLabel, constraints );
pan.add( empresaLabel );
@ -127,7 +128,7 @@ public class AvisosPanel extends JPanel
constraints.weightx = 1;
constraints.gridwidth = GridBagConstraints.REMAINDER;
//JLabel descricaoLabel = new JLabel( (String)avisosEmpresa[ n ].get( AvisoData.DESCRICAO ) );
//JLabel descricaoLabel = new JLabel( (String)avisosEmpresa[ n ].get( AvisosData.DESCRICAO ) );
JLabel descricaoLabel = criarDescricao( avisosEmpresa[ n ] );
gridbag.setConstraints( descricaoLabel, constraints );
pan.add( descricaoLabel );
@ -156,8 +157,8 @@ public class AvisosPanel extends JPanel
JPanel pan = new JPanel();
GridBagLayout gridbag = new GridBagLayout();
pan.setBorder( BorderFactory.createLineBorder( Color.black, 1 ) );
// EstabelecimentoData estabelecimento = (EstabelecimentoData)avisosEstabelecimento[ n ].get( AvisoData.ESTABELECIMENTO );
// EmpresaData empresa = (EmpresaData)estabelecimento.get( EstabelecimentoData.EMPRESA );
// EstabelecimentosData estabelecimento = (EstabelecimentosData)avisosEstabelecimento[ n ].get( AvisosData.ESTABELECIMENTO );
// EmpresasData empresa = (EmpresasData)estabelecimento.get( EstabelecimentosData.EMPRESA );
pan.setLayout( gridbag );
constraints.gridheight = GridBagConstraints.REMAINDER;
constraints.gridx = 0;
@ -168,7 +169,7 @@ public class AvisosPanel extends JPanel
pan.add( tratarButton );
//buttonHash.put( tratarButton, avisosEstabelecimento[ n ] );
// buttonHash.put( tratarButton, new Integer( n + avisosEmpresa.length ) );
// buttonHash.put( tratarButton, avisosEstabelecimento[ n ].get( AvisoData.ID ) );
// buttonHash.put( tratarButton, avisosEstabelecimento[ n ].get( AvisosData.ID ) );
buttonHash.put( tratarButton, avisosEstabelecimento[ n ][ 0 ] );
buttonTypeHash.put( tratarButton, new Integer( AvisoConstants.TIPO_ESTABELECIMENTO ) );
tratarButton.addActionListener( this );
@ -177,18 +178,18 @@ public class AvisosPanel extends JPanel
constraints.weightx = 1;
constraints.gridheight = 1;
constraints.gridwidth = GridBagConstraints.REMAINDER;
// JLabel empresaLabel = new JLabel( "" + empresa.get( EmpresaData.DESIGNACAO_SOCIAL ) );
// JLabel empresaLabel = new JLabel( "" + empresa.get( EmpresasData.DESIGNACAO_SOCIAL ) );
JLabel empresaLabel = new JLabel( "" + avisosEstabelecimento[ n ][ 3 ] );
gridbag.setConstraints( empresaLabel, constraints );
pan.add( empresaLabel );
// JLabel estabelecimentoLabel = new JLabel( "" + estabelecimento.get( EstabelecimentoData.NOME ) );
// JLabel estabelecimentoLabel = new JLabel( "" + estabelecimento.get( EstabelecimentosData.NOME ) );
JLabel estabelecimentoLabel = new JLabel( "" + avisosEstabelecimento[ n ][ 4 ] );
gridbag.setConstraints( estabelecimentoLabel, constraints );
pan.add( estabelecimentoLabel );
constraints.gridwidth = GridBagConstraints.REMAINDER;
//JLabel descricaoLabel = new JLabel( (String)avisosEstabelecimento[ n ].get( AvisoData.DESCRICAO ) );
//JLabel descricaoLabel = new JLabel( (String)avisosEstabelecimento[ n ].get( AvisosData.DESCRICAO ) );
JLabel descricaoLabel = criarDescricao( avisosEstabelecimento[ n ] );
gridbag.setConstraints( descricaoLabel, constraints );
pan.add( descricaoLabel );
@ -217,9 +218,9 @@ public class AvisosPanel extends JPanel
JPanel pan = new JPanel();
GridBagLayout gridbag = new GridBagLayout();
pan.setBorder( BorderFactory.createLineBorder( Color.black, 1 ) );
// TrabalhadorData trabalhador = (TrabalhadorData)avisosTrabalhador[ n ].get( AvisoData.TRABALHADOR );
// EstabelecimentoData estabelecimento = (EstabelecimentoData)trabalhador.get( TrabalhadorData.ESTABELECIMENTO );
// EmpresaData empresa = (EmpresaData)estabelecimento.get( EstabelecimentoData.EMPRESA );
// TrabalhadoresData trabalhador = (TrabalhadoresData)avisosTrabalhador[ n ].get( AvisosData.TRABALHADOR );
// EstabelecimentosData estabelecimento = (EstabelecimentosData)trabalhador.get( TrabalhadoresData.ESTABELECIMENTO );
// EmpresasData empresa = (EmpresasData)estabelecimento.get( EstabelecimentosData.EMPRESA );
pan.setLayout( gridbag );
constraints.gridheight = GridBagConstraints.REMAINDER;
constraints.gridx = 0;
@ -230,7 +231,7 @@ public class AvisosPanel extends JPanel
pan.add( tratarButton );
//buttonHash.put( tratarButton, avisosTrabalhador[ n ] );
// buttonHash.put( tratarButton, new Integer( n + avisosEmpresa.length + avisosEstabelecimento.length ) );
// buttonHash.put( tratarButton, avisosTrabalhador[ n ].get( AvisoData.ID ) );
// buttonHash.put( tratarButton, avisosTrabalhador[ n ].get( AvisosData.ID ) );
buttonHash.put( tratarButton, avisosTrabalhador[ n ][ 0 ] );
buttonTypeHash.put( tratarButton, new Integer( AvisoConstants.TIPO_TRABALHADOR ) );
tratarButton.addActionListener( this );
@ -239,22 +240,22 @@ public class AvisosPanel extends JPanel
constraints.weightx = 1;
constraints.gridheight = 1;
constraints.gridwidth = GridBagConstraints.REMAINDER;
// JLabel empresaLabel = new JLabel( "" + empresa.get( EmpresaData.DESIGNACAO_SOCIAL ) );
// JLabel empresaLabel = new JLabel( "" + empresa.get( EmpresasData.DESIGNACAO_SOCIAL ) );
JLabel empresaLabel = new JLabel( "" + avisosTrabalhador[ n ][ 3 ] );
gridbag.setConstraints( empresaLabel, constraints );
pan.add( empresaLabel );
// JLabel estabelecimentoLabel = new JLabel( "" + estabelecimento.get( EstabelecimentoData.NOME ) );
// JLabel estabelecimentoLabel = new JLabel( "" + estabelecimento.get( EstabelecimentosData.NOME ) );
JLabel estabelecimentoLabel = new JLabel( "" + avisosTrabalhador[ n ][ 4 ] );
gridbag.setConstraints( estabelecimentoLabel, constraints );
pan.add( estabelecimentoLabel );
// JLabel trabalhadorLabel = new JLabel( "" + trabalhador.get( TrabalhadorData.NOME ) );
// JLabel trabalhadorLabel = new JLabel( "" + trabalhador.get( TrabalhadoresData.NOME ) );
JLabel trabalhadorLabel = new JLabel( "" + avisosTrabalhador[ n ][ 5 ] );
gridbag.setConstraints( trabalhadorLabel, constraints );
pan.add( trabalhadorLabel );
constraints.gridwidth = GridBagConstraints.REMAINDER;
//JLabel descricaoLabel = new JLabel( (String)avisosTrabalhador[ n ].get( AvisoData.DESCRICAO ) );
//JLabel descricaoLabel = new JLabel( (String)avisosTrabalhador[ n ].get( AvisosData.DESCRICAO ) );
JLabel descricaoLabel = criarDescricao( avisosTrabalhador[ n ] );
gridbag.setConstraints( descricaoLabel, constraints );
pan.add( descricaoLabel );
@ -265,7 +266,7 @@ public class AvisosPanel extends JPanel
// Vector v = new Vector( Arrays.asList( avisosEmpresa ) );
// v.addAll( Arrays.asList( avisosTrabalhador ) );
// v.addAll( Arrays.asList( avisosEstabelecimento ) );
// avisos = (AvisoData []) v.toArray( new AvisoData[0] );
// avisos = (AvisosData []) v.toArray( new AvisosData[0] );
JScrollPane scp = new JScrollPane();
setLayout( new GridLayout( 1, 1 ) );
@ -312,28 +313,28 @@ public class AvisosPanel extends JPanel
try
{
provider = ( FichaDataProvider ) FichaDataProvider.getProvider();
// Collection c = AvisoData.load( AvisoData.class, " estabelecimento_id == \"null\" ",
// AvisoData.DATA_EVENTO + " ascending" );
// Collection c = AvisosData.load( AvisosData.class, " estabelecimento_id == \"null\" ",
// AvisosData.DATA_EVENTO + " ascending" );
// Collection c = AvisoData.load( AvisoData.class, "(tipo == " + AvisoData.TIPO_EMPRESA+")",// + ") && ( data_aviso <= CURRENT_DATE )",
// AvisoData.DATA_EVENTO + " ascending" );
// Collection c = AvisoData.load( AvisoData.class, new Object[]{ /*new Integer( AvisoData.TIPO_EMPRESA ), */new Date() },
// Collection c = AvisosData.load( AvisosData.class, "(tipo == " + AvisosData.TIPO_EMPRESA+")",// + ") && ( data_aviso <= CURRENT_DATE )",
// AvisosData.DATA_EVENTO + " ascending" );
// Collection c = AvisosData.load( AvisosData.class, new Object[]{ /*new Integer( AvisosData.TIPO_EMPRESA ), */new Date() },
// new String[]{ /*"tipo", */"data_aviso" },
// new String[]{ "=="/*, "==" */},
// new String[]{ AvisoData.DATA_EVENTO + " ascending" } );
// new String[]{ AvisosData.DATA_EVENTO + " ascending" } );
// if( c == null )
// {
// avisosEmpresa = new AvisoData[ 0 ];
// avisosEmpresa = new AvisosData[ 0 ];
// }
// else
// {
//
// avisosEmpresa = ( AvisoData[] )c.toArray( new AvisoData[ c.size() ] );
// avisosEmpresa = ( AvisosData[] )c.toArray( new AvisosData[ c.size() ] );
// }
// Integer ids[] = provider.getAvisosIDByTipoAndDate( new Integer( AvisoConstants.TIPO_EMPRESA ), new Date() );
// avisosEmpresa = new AvisoData[ ids.length ];
// avisosEmpresa = new AvisosData[ ids.length ];
// if( JDO == null )
// {
// JDO = ( JDOProvider ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
@ -341,47 +342,47 @@ public class AvisosPanel extends JPanel
//// System.out.println( "JDO: " + JDO );
// for( int n = 0; n < avisosEmpresa.length; n++ )
// {
// avisosEmpresa[ n ] = (AvisoData) JDO.load( AvisoData.class, ids[ n ] );
// avisosEmpresa[ n ] = (AvisosData) JDO.load( AvisosData.class, ids[ n ] );
// }
//
////System.out.println( "EmpresaData " + avisosEmpresa.length );
//// c = AvisoData.load( AvisoData.class, " tipo == " + AvisoData.TIPO_ESTABELECIMENTO,// + ") && ( data_aviso <= new Date() )",
//// AvisoData.DATA_EVENTO + " ascending" );
//// c = AvisoData.load( AvisoData.class, "estabelecimento_id != \"null\" "
//// + " && trabalhador_id == \"null\"", AvisoData.DATA_EVENTO + " ascending" );
////System.out.println( "EmpresasData " + avisosEmpresa.length );
//// c = AvisosData.load( AvisosData.class, " tipo == " + AvisosData.TIPO_ESTABELECIMENTO,// + ") && ( data_aviso <= new Date() )",
//// AvisosData.DATA_EVENTO + " ascending" );
//// c = AvisosData.load( AvisosData.class, "estabelecimento_id != \"null\" "
//// + " && trabalhador_id == \"null\"", AvisosData.DATA_EVENTO + " ascending" );
//// if( c == null )
//// {
//// avisosEstabelecimento = new AvisoData[ 0 ];
//// avisosEstabelecimento = new AvisosData[ 0 ];
//// }
//// else
//// {
//// avisosEstabelecimento = ( AvisoData[] )c.toArray( new AvisoData[ c.size() ] );
//// avisosEstabelecimento = ( AvisosData[] )c.toArray( new AvisosData[ c.size() ] );
//// }
//
// ids = provider.getAvisosIDByTipoAndDate( new Integer( AvisoConstants.TIPO_ESTABELECIMENTO ), new Date() );
// avisosEstabelecimento = new AvisoData[ ids.length ];
// avisosEstabelecimento = new AvisosData[ ids.length ];
// for( int n = 0; n < avisosEstabelecimento.length; n++ )
// {
// avisosEstabelecimento[ n ] = (AvisoData) JDO.load( AvisoData.class, new Object[]{ids[ n ]}, new String[]{ "id" } );
// avisosEstabelecimento[ n ] = (AvisosData) JDO.load( AvisosData.class, new Object[]{ids[ n ]}, new String[]{ "id" } );
// }
////System.out.println( "EstabelecimentoData " + avisosEstabelecimento.length );
//// c = AvisoData.load( AvisoData.class, " tipo == " + AvisoData.TIPO_TRABALHADOR,// + ") && ( data_aviso <= new Date() )",
//// AvisoData.DATA_EVENTO + " ascending" );
//// c = AvisoData.load( AvisoData.class, "trabalhador_id != \"null\"", AvisoData.DATA_EVENTO + " ascending" );
////System.out.println( "EstabelecimentosData " + avisosEstabelecimento.length );
//// c = AvisosData.load( AvisosData.class, " tipo == " + AvisosData.TIPO_TRABALHADOR,// + ") && ( data_aviso <= new Date() )",
//// AvisosData.DATA_EVENTO + " ascending" );
//// c = AvisosData.load( AvisosData.class, "trabalhador_id != \"null\"", AvisosData.DATA_EVENTO + " ascending" );
//// if( c == null )
//// {
//// avisosTrabalhador = new AvisoData[ 0 ];
//// avisosTrabalhador = new AvisosData[ 0 ];
//// }
//// else
//// {
//// avisosTrabalhador = ( AvisoData[] )c.toArray( new AvisoData[ c.size() ] );
//// avisosTrabalhador = ( AvisosData[] )c.toArray( new AvisosData[ c.size() ] );
//// }
// ids = provider.getAvisosIDByTipoAndDate( new Integer( AvisoConstants.TIPO_TRABALHADOR ), new Date() );
//
// avisosTrabalhador = new AvisoData[ ids.length ];
// avisosTrabalhador = new AvisosData[ ids.length ];
// for( int n = 0; n < avisosTrabalhador.length; n++ )
// {
// avisosTrabalhador[ n ] = (AvisoData) JDO.load( AvisoData.class, ids[ n ] );
// avisosTrabalhador[ n ] = (AvisosData) JDO.load( AvisosData.class, ids[ n ] );
// }
//System.out.println( "trabalhador " + avisosTrabalhador.length );
avisosEmpresa = provider.getAvisosEmpresaByDate( new Date() );
@ -433,12 +434,12 @@ public class AvisosPanel extends JPanel
return descricaoLabel;
}
// private JLabel criarDescricao( AvisoData aviso )
// private JLabel criarDescricao( AvisosData aviso )
// {
// Date dataEvento = ( Date )aviso.get( AvisoData.DATA_EVENTO );
// Date dataEvento = ( Date )aviso.get( AvisosData.DATA_EVENTO );
//
// String descricao = (String)aviso.get( AvisoData.DESCRICAO );
// String descricao2 = (String)aviso.get( AvisoData.DESCRICAO );
// String descricao = (String)aviso.get( AvisosData.DESCRICAO );
// String descricao2 = (String)aviso.get( AvisosData.DESCRICAO );
// Calendar cal = Calendar.getInstance();
// cal.setTime( dataEvento );
// cal.set( cal.get( Calendar.YEAR ), cal.get( Calendar.MONTH ), cal.get( Calendar.DAY_OF_MONTH ), 0, 0, 0 );
@ -474,12 +475,12 @@ public class AvisosPanel extends JPanel
{
if( JDO == null )
{
JDO = ( JDOProvider ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
JDO = ( ProviderInterface ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
}
Object source = e.getSource();
if( source instanceof JButton )
{
// AvisoData aviso = (AvisoData) buttonHash.get( source );
// AvisosData aviso = (AvisosData) buttonHash.get( source );
try
{
( (JButton) source ).setEnabled( false );
@ -489,15 +490,15 @@ public class AvisosPanel extends JPanel
return;
}
buttonHash.remove( source );
AvisoData aviso = (AvisoData) JDO.load( AvisoData.class, id );
AvisosData aviso = (AvisosData) JDO.load( AvisosData.class, id );
if( aviso == null )
{
JOptionPane.showMessageDialog( null, "Este aviso j\u00e1 foi tratado.", "J\u00e1 tratado",
JOptionPane.WARNING_MESSAGE );
return;
}
Hashtable dataHash = aviso.getHashData();
Date dataEvento = (Date)dataHash.get( AvisoData.DATA_EVENTO );
Map<String,Object> dataHash = aviso.getHashData();
Date dataEvento = (Date)dataHash.get( AvisosData.DATA_EVENTO );
Calendar cal = Calendar.getInstance();
cal.setTime( dataEvento );
cal.set( cal.get( Calendar.YEAR ), cal.get( Calendar.MONTH ), cal.get( Calendar.DAY_OF_MONTH ), 0, 0, 0 );
@ -510,41 +511,41 @@ public class AvisosPanel extends JPanel
Date hoje = cal.getTime();
if( hoje.before( dataEvento ) )
{
AvisoData novoAviso = new AvisoData();
AvisosData novoAviso = new AvisosData();
novoAviso.setHashData( dataHash );
novoAviso.set( AvisoData.DATA_AVISO, dataEvento );
novoAviso.set( AvisosData.DATA_AVISO, dataEvento );
novoAviso.save();
}
Integer tipo = (Integer) aviso.get( AvisoData.TIPO );
TrabalhadorData trabalhador;
EstabelecimentoData estabelecimento;
EmpresaData empresa;
Integer tipo = (Integer) aviso.get( AvisosData.TIPO );
TrabalhadoresData trabalhador;
EstabelecimentosData estabelecimento;
EmpresasData empresa;
switch( tipo.intValue() )
{
case AvisoConstants.TIPO_TRABALHADOR:
trabalhador = (TrabalhadorData) aviso.get( AvisoData.TRABALHADOR );
estabelecimento = (EstabelecimentoData) trabalhador.get( TrabalhadorData.ESTABELECIMENTO );
empresa = (EmpresaData) estabelecimento.get( EstabelecimentoData.EMPRESA );
trabalhador = aviso.toTrabalhador_id();
estabelecimento = trabalhador.toEstabelecimento_id();
empresa = estabelecimento.toEmpresa_id();
aviso.delete();
tracker.getMedicinaWindow().setVisible( true );
tracker.getMedicinaWindow().setEmpresaAndEstabelecimentoAndTrabalhador( (Integer) empresa.get( EmpresaData.ID ),
( Integer ) estabelecimento.get( EstabelecimentoData.ID ),
( Integer ) trabalhador.get( TrabalhadorData.ID ) );
tracker.getMedicinaWindow().setEmpresaAndEstabelecimentoAndTrabalhador( (Integer) empresa.get( EmpresasData.ID ),
( Integer ) estabelecimento.get( EstabelecimentosData.ID ),
( Integer ) trabalhador.get( TrabalhadoresData.ID ) );
break;
case AvisoConstants.TIPO_ESTABELECIMENTO:
estabelecimento = (EstabelecimentoData) aviso.get( AvisoData.ESTABELECIMENTO );
empresa = (EmpresaData) estabelecimento.get( EstabelecimentoData.EMPRESA );
estabelecimento = aviso.toEstabelecimento_id();
empresa = estabelecimento.toEmpresa_id();
aviso.delete();
tracker.getHigieneWindow().setVisible( true );
tracker.getHigieneWindow().setEmpresaAndEstabelecimento( (Integer) empresa.get( EmpresaData.ID ),
( Integer ) estabelecimento.get( EstabelecimentoData.ID ) );
tracker.getHigieneWindow().setEmpresaAndEstabelecimento( (Integer) empresa.get( EmpresasData.ID ),
( Integer ) estabelecimento.get( EstabelecimentosData.ID ) );
break;
case AvisoConstants.TIPO_EMPRESA:
empresa = (EmpresaData) aviso.get( AvisoData.EMPRESA );
empresa = aviso.toEmpresa_id();
aviso.delete();
ClientesWindow clientesWindow = tracker.getClientesWindow();
clientesWindow.setVisible( true );
@ -552,9 +553,9 @@ public class AvisosPanel extends JPanel
break;
}
System.out.println( "delete aviso" );
// aviso.set( AvisoData.TRABALHADOR, null );
// aviso.set( AvisoData.ESTABELECIMENTO, null );
// aviso.set( AvisoData.EMPRESA, null );
// aviso.set( AvisosData.TRABALHADOR, null );
// aviso.set( AvisosData.ESTABELECIMENTO, null );
// aviso.set( AvisosData.EMPRESA, null );
}
catch( Exception ex )
{

@ -36,22 +36,23 @@ import siprp.FichaDataProvider;
import siprp.SIPRPTracker;
import siprp.SingletonConstants;
import siprp.data.AvisoConstants;
import siprp.data.ContactoData;
import siprp.data.EmpresaData;
import siprp.data.EstabelecimentoData;
import siprp.data.EtiquetaData;
import siprp.data.ExameData;
import siprp.data.SearchExecuterFactory;
import siprp.data.TrabalhadorData;
import siprp.data.outer.ContactosData;
import siprp.data.outer.EmpresasData;
import siprp.data.outer.EstabelecimentosData;
import siprp.data.outer.EtiquetasData;
import siprp.data.outer.ExamesData;
import siprp.data.outer.TrabalhadoresData;
import siprp.ficha.ExamePDF;
import siprp.importer.Importer;
import com.evolute.entity.ProviderInterface;
import com.evolute.utils.Singleton;
import com.evolute.utils.data.IDObject;
import com.evolute.utils.dataedition.persistence.Persistent;
import com.evolute.utils.dataui.ControllableComponent;
import com.evolute.utils.date.DateUtils;
import com.evolute.utils.jdo.JDOObject;
import com.evolute.utils.jdo.JDOProvider;
import com.evolute.utils.strings.StringPlainer;
import com.evolute.utils.ui.DialogException;
import com.evolute.utils.ui.dialog.ListAction;
@ -81,27 +82,27 @@ public class ClientesWindow extends EditorWindow
static
{
TR_IMPORT_NAMES_TO_TRAB.put( Importer.NOME, TrabalhadorData.NOME );
TR_IMPORT_NAMES_TO_TRAB.put( Importer.SEXO, TrabalhadorData.SEXO );
TR_IMPORT_NAMES_TO_TRAB.put( Importer.NACIONALIDADE, TrabalhadorData.NACIONALIDADE );
TR_IMPORT_NAMES_TO_TRAB.put( Importer.DATA_NASCIMENTO, TrabalhadorData.DATA_NASCIMENTO );
TR_IMPORT_NAMES_TO_TRAB.put( Importer.NUMERO_MECANOGRAFICO, TrabalhadorData.NUMERO_MECANOGRAFICO );
TR_IMPORT_NAMES_TO_TRAB.put( Importer.DATA_ADMISSAO, TrabalhadorData.DATA_ADMISSAO );
TR_IMPORT_NAMES_TO_TRAB.put( Importer.CATEGORIA, TrabalhadorData.CATEGORIA );
TR_IMPORT_NAMES_TO_TRAB.put( Importer.LOCAL_TRABALHO, TrabalhadorData.LOCAL_TRABALHO );
TR_IMPORT_NAMES_TO_TRAB.put( Importer.FUNCAO, TrabalhadorData.FUNCAO_PROPOSTA );
TR_IMPORT_NAMES_TO_TRAB.put( Importer.DATA_ADMISSAO_FUNCAO, TrabalhadorData.DATA_ADMISSAO_FUNCAO );
TR_IMPORT_NAMES_TO_TRAB.put( Importer.NOME, TrabalhadoresData.NOME );
TR_IMPORT_NAMES_TO_TRAB.put( Importer.SEXO, TrabalhadoresData.SEXO );
TR_IMPORT_NAMES_TO_TRAB.put( Importer.NACIONALIDADE, TrabalhadoresData.NACIONALIDADE );
TR_IMPORT_NAMES_TO_TRAB.put( Importer.DATA_NASCIMENTO, TrabalhadoresData.DATA_NASCIMENTO );
TR_IMPORT_NAMES_TO_TRAB.put( Importer.NUMERO_MECANOGRAFICO, TrabalhadoresData.NUMERO_MECANOGRAFICO );
TR_IMPORT_NAMES_TO_TRAB.put( Importer.DATA_ADMISSAO, TrabalhadoresData.DATA_ADMISSAO );
TR_IMPORT_NAMES_TO_TRAB.put( Importer.CATEGORIA, TrabalhadoresData.CATEGORIA );
TR_IMPORT_NAMES_TO_TRAB.put( Importer.LOCAL_TRABALHO, TrabalhadoresData.LOCAL_TRABALHO );
TR_IMPORT_NAMES_TO_TRAB.put( Importer.FUNCAO, TrabalhadoresData.FUNCAO_PROPOSTA );
TR_IMPORT_NAMES_TO_TRAB.put( Importer.DATA_ADMISSAO_FUNCAO, TrabalhadoresData.DATA_ADMISSAO_FUNCAO );
TR_IMPORT_NAMES_TO_DEMISSOES.put( Importer.NOME, TrabalhadorData.NOME );
TR_IMPORT_NAMES_TO_DEMISSOES.put( Importer.DATA_DEMISSAO, TrabalhadorData.DATA_DEMISSAO );
TR_IMPORT_NAMES_TO_DEMISSOES.put( Importer.NOME, TrabalhadoresData.NOME );
TR_IMPORT_NAMES_TO_DEMISSOES.put( Importer.DATA_DEMISSAO, TrabalhadoresData.DATA_DEMISSAO );
// JDOObject.registerOperationHandlerForClass( DisableDeleteHandler.INSTANCE, EmpresaData.class );
// JDOObject.registerOperationHandlerForClass( DisableDeleteHandler.INSTANCE, EstabelecimentoData.class );
// JDOObject.registerOperationHandlerForClass( DisableDeleteHandler.INSTANCE, TrabalhadorData.class );
// JDOObject.registerOperationHandlerForClass( DisableDeleteHandler.INSTANCE, EmpresasData.class );
// JDOObject.registerOperationHandlerForClass( DisableDeleteHandler.INSTANCE, EstabelecimentosData.class );
// JDOObject.registerOperationHandlerForClass( DisableDeleteHandler.INSTANCE, TrabalhadoresData.class );
//
// JDOObject.registerOperationHandlerForClass( MarcacaoSaveAndDeleteHandler.INSTANCE, MarcacaoEmpresaData.class );
// JDOObject.registerOperationHandlerForClass( MarcacaoSaveAndDeleteHandler.INSTANCE, MarcacaoEstabelecimentoData.class );
// JDOObject.registerOperationHandlerForClass( MarcacaoSaveAndDeleteHandler.INSTANCE, MarcacaoTrabalhadorData.class );
// JDOObject.registerOperationHandlerForClass( MarcacaoSaveAndDeleteHandler.INSTANCE, MarcacaoEmpresasData.class );
// JDOObject.registerOperationHandlerForClass( MarcacaoSaveAndDeleteHandler.INSTANCE, MarcacaoEstabelecimentosData.class );
// JDOObject.registerOperationHandlerForClass( MarcacaoSaveAndDeleteHandler.INSTANCE, MarcacoesTrabalhadorData.class );
}
public static final int INDEX_EMPRESA = 0;
@ -116,7 +117,7 @@ public class ClientesWindow extends EditorWindow
{ NEW_INDEX, EDIT_INDEX, CANCEL_INDEX, SAVE_INDEX, DELETE_INDEX },
{ NEW_INDEX, EDIT_INDEX, CANCEL_INDEX, SAVE_INDEX, DELETE_INDEX } };
private JDOProvider JDO;
private ProviderInterface JDO;
private ClientesDataProvider clientesProvider;
private ControllableComponent panels[] = new ControllableComponent[ 4 ];
private EmpresaPanel empresaPanel;
@ -128,10 +129,10 @@ public class ClientesWindow extends EditorWindow
private SIPRPTracker tracker;
private EmpresaData empresa;
private EmpresasData empresa;
private Integer elementosProtocolo[][];
private EstabelecimentoData estabelecimento;
private TrabalhadorData trabalhador;
private EstabelecimentosData estabelecimento;
private TrabalhadoresData trabalhador;
private AvisosPanel avisos;
@ -153,7 +154,7 @@ public class ClientesWindow extends EditorWindow
super( permissions );
this.avisos = avisos;
webAware = ( ( Boolean ) Singleton.getInstance( SingletonConstants.WEB_AWARE ) ).booleanValue();
JDO = ( JDOProvider ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
JDO = ( ProviderInterface ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
clientesProvider = ( ClientesDataProvider ) ClientesDataProvider.getProvider();
setEditorManagerHierarchy( hierarchy );
setupComponents();
@ -449,13 +450,13 @@ public class ClientesWindow extends EditorWindow
// switch( index )
// {
// case INDEX_EMPRESA:
search = new SearchDialog( SearchExecuterFactory.getSearchExecuter( EmpresaData.class ), null, false, null, true );
search = new SearchDialog( SearchExecuterFactory.getSearchExecuter( EmpresasData.class ), null, false, null, true );
empresaID = ( Integer )search.getSelected();
if( empresaID != null )
{
try
{
empresa = (EmpresaData) JDO.load( EmpresaData.class, empresaID );
empresa = (EmpresasData) JDO.load( EmpresasData.class, empresaID );
elementosProtocolo = clientesProvider.getElementosProtocoloForEmpresa( empresaID, 2 );
}
catch( Exception ex )
@ -488,7 +489,7 @@ public class ClientesWindow extends EditorWindow
// trabalhadorPanel.fill( null );
estabelecimentoPanel.fill( estabelecimento );
trabalhadorPanel.setEstabelecimento( estabelecimento );
// planoActuacaoPanel.fill( estabelecimento == null ? null : estabelecimento.get( EstabelecimentoData.ID ) );
// planoActuacaoPanel.fill( estabelecimento == null ? null : estabelecimento.get( EstabelecimentosData.ID ) );
break;
case INDEX_TRABALHADOR:
trabalhadorPanel.fill( trabalhador );
@ -506,32 +507,38 @@ public class ClientesWindow extends EditorWindow
switch( index )
{
case INDEX_EMPRESA:
empresa = (EmpresaData) ( ( Object [] )object )[ 0 ];
if( empresa.get( EmpresaData.ID ) == null )
empresa = (EmpresasData) ( ( Object [] )object )[ 0 ];
if( empresa.get( EmpresasData.ID ) == null )
{
isNew = true;
}
elementosProtocolo = (Integer [][]) ( ( Object [] )object )[ 1 ];
// System.out.println( empresa.debug() );
ContactoData c1 = ( ContactoData )empresa.get( EmpresaData.CONTACTO_1 );
ContactoData c2 = ( ContactoData )empresa.get( EmpresaData.CONTACTO_2 );
// empresa.set( EmpresaData.CONTACTO_1, null );
// empresa.set( EmpresaData.CONTACTO_2, null );
ContactosData c1 = empresa.toContacto_1();
ContactosData c2 = empresa.toContacto_2();
// empresa.set( EmpresasData.CONTACTO_1, null );
// empresa.set( EmpresasData.CONTACTO_2, null );
// empresa.save();
// empresa.set( EmpresaData.CONTACTO_1, c1 );
// empresa.set( EmpresasData.CONTACTO_1, c1 );
// empresa.set( EmpresaData.CONTACTO_2, c2 );
c1.save();
c2.save();
// empresa.set( EmpresasData.CONTACTO_2, c2 );
if( c1 != null )
{
c1.save();
}
if( c2 != null )
{
c2.save();
}
// empresa.set( EmpresaData.INACTIVO, "n" );
empresa.set( EmpresaData.DESIGNACAO_SOCIAL_PLAIN,
// empresa.set( EmpresasData.INACTIVO, "n" );
empresa.set( EmpresasData.DESIGNACAO_SOCIAL_PLAIN,
com.evolute.utils.strings.StringPlainer.convertString( ( String )
empresa.get( EmpresaData.DESIGNACAO_SOCIAL ) ) );
empresa.get( EmpresasData.DESIGNACAO_SOCIAL ) ) );
empresa.save();
clientesProvider.setElementosProtocoloForEmpresa(
( Integer ) empresa.get( EmpresaData.ID ), elementosProtocolo );
( Integer ) empresa.get( EmpresasData.ID ), elementosProtocolo );
if( isNew )
{
@ -541,22 +548,22 @@ public class ClientesWindow extends EditorWindow
break;
case INDEX_ESTABELECIMENTO:
estabelecimento = (EstabelecimentoData) object;
if( estabelecimento.get( EstabelecimentoData.ID ) == null )
estabelecimento = (EstabelecimentosData) object;
if( estabelecimento.get( EstabelecimentosData.ID ) == null )
{
isNew = true;
}
ContactoData c = ( ContactoData )estabelecimento.get( EstabelecimentoData.CONTACTO );
ContactosData c = ( ContactosData )estabelecimento.toContacto_id();
c.save();
if( estabelecimento.get( EstabelecimentoData.EMPRESA ) == null )
if( estabelecimento.toEmpresa_id() == null )
{
JOptionPane.showMessageDialog( this, "Erro a guardar estabelecimento (NULL).", "Erro...",
JOptionPane.ERROR_MESSAGE );
return false;
}
estabelecimento.set( EstabelecimentoData.NOME_PLAIN,
estabelecimento.set( EstabelecimentosData.NOME_PLAIN,
com.evolute.utils.strings.StringPlainer.convertString( ( String )
estabelecimento.get( EstabelecimentoData.NOME ) ) );
estabelecimento.get( EstabelecimentosData.NOME ) ) );
estabelecimento.save();
estabelecimentoPanel.postSave();
if( isNew )
@ -566,10 +573,10 @@ public class ClientesWindow extends EditorWindow
break;
case INDEX_TRABALHADOR:
trabalhador = (TrabalhadorData) object;
trabalhador.set( TrabalhadorData.NOME_PLAIN,
trabalhador = (TrabalhadoresData) object;
trabalhador.set( TrabalhadoresData.NOME_PLAIN,
com.evolute.utils.strings.StringPlainer.convertString( ( String )
trabalhador.get( TrabalhadorData.NOME ) ) );
trabalhador.get( TrabalhadoresData.NOME ) ) );
trabalhador.save();
trabalhadorPanel.postSave();
break;
@ -612,7 +619,7 @@ public class ClientesWindow extends EditorWindow
select( INDEX_ESTABELECIMENTO );
try
{
estabelecimento = ( EstabelecimentoData ) JDO.load( EstabelecimentoData.class, id );
estabelecimento = ( EstabelecimentosData ) JDO.load( EstabelecimentosData.class, id );
}
catch( Exception ex )
{
@ -635,7 +642,7 @@ public class ClientesWindow extends EditorWindow
{
try
{
trabalhador = (TrabalhadorData) JDO.load( TrabalhadorData.class, id );
trabalhador = (TrabalhadoresData) JDO.load( TrabalhadoresData.class, id );
}
catch( Exception ex )
{
@ -715,7 +722,7 @@ public class ClientesWindow extends EditorWindow
{
try
{
TrabalhadorData trabalhadorAux = trabalhador;
TrabalhadoresData trabalhadorAux = trabalhador;
trabalhador = null;
trabalhadorAux.delete();
@ -767,7 +774,7 @@ public class ClientesWindow extends EditorWindow
// load all (active) trabalhadores for this company
IDObject trab[] = ( ( FichaDataProvider )FichaDataProvider.getProvider()
).getAllTrabalhadoresForEmpresa(
( Integer )empresa.get( EmpresaData.ID ) );
( Integer )empresa.get( EmpresasData.ID ) );
Hashtable trabalhadores = new Hashtable();
for( int i = 0; i < trab.length; ++i )
{
@ -776,7 +783,7 @@ public class ClientesWindow extends EditorWindow
// load all active estabelecimentos for this company
IDObject estab[] = ( ( FichaDataProvider )FichaDataProvider.getProvider()
).getAllEstabelecimentosForEmpresa(
( Integer )empresa.get( EmpresaData.ID ) );
( Integer )empresa.get( EmpresasData.ID ) );
Hashtable estabelecimentos = new Hashtable();
for( int i = 0; i < estab.length; ++i )
{
@ -805,7 +812,7 @@ public class ClientesWindow extends EditorWindow
hash[ i ].put( TR_IMPORT_NAMES_TO_TRAB.get( Importer.NOME ),
value.toString().trim() );
hash[ i ].put( TrabalhadorData.NOME_PLAIN,
hash[ i ].put( TrabalhadoresData.NOME_PLAIN,
com.evolute.utils.strings.StringPlainer.convertString( value.toString().trim(), false, false ) );
}
else
@ -825,31 +832,29 @@ public class ClientesWindow extends EditorWindow
value = "sede";
}
Integer eid = ( Integer )estabelecimentos.get( value.toString().trim().toLowerCase() );
EstabelecimentoData esta;
EstabelecimentosData esta;
if( eid == null )
{
// save this estab
esta = new EstabelecimentoData();
esta.set( EstabelecimentoData.EMPRESA, empresa );
esta.set( EstabelecimentoData.NOME, value.toString().trim() );
esta.set( EstabelecimentoData.NOME_PLAIN, com.evolute.utils.strings.StringPlainer.convertString( value.toString().trim(), false, false ) );
esta = new EstabelecimentosData();
esta.setToEmpresa_id( empresa );
esta.set( EstabelecimentosData.NOME, value.toString().trim() );
esta.set( EstabelecimentosData.NOME_PLAIN, com.evolute.utils.strings.StringPlainer.convertString( value.toString().trim(), false, false ) );
esta.save();
estabelecimentos.put( value.toString().trim().toLowerCase(),
esta.get( EstabelecimentoData.ID ) );
esta.get( EstabelecimentosData.ID ) );
}
else
{
esta = ( EstabelecimentoData )estabCache.get( value );
esta = ( EstabelecimentosData )estabCache.get( value );
if( esta == null )
{
esta = (EstabelecimentoData) JDO.load( EstabelecimentoData.class, eid );
esta = (EstabelecimentosData) JDO.load( EstabelecimentosData.class, eid );
estabCache.put( value, esta );
}
}
//System.out.println( "Put " + i + " esta " + esta.debug() );
hash[ i ].put( TrabalhadorData.ESTABELECIMENTO,
esta );
hash[ i ].put( TrabalhadoresData.TO_ESTABELECIMENTO_ID, esta );
hash[ i ].put( TR_IMPORT_NAMES_TO_TRAB.get( Importer.LOCAL_TRABALHO ),
value.toString().trim() );
}
@ -897,19 +902,18 @@ public class ClientesWindow extends EditorWindow
continue;
}
// save trab
TrabalhadorData tr = new TrabalhadorData();
TrabalhadoresData tr = new TrabalhadoresData();
tr.setHashData( hash[ i ] );
// o estabelecimento nao faz parte da lista por causa do UI
tr.set( TrabalhadorData.ESTABELECIMENTO,
hash[ i ].get( TrabalhadorData.ESTABELECIMENTO ) );
tr.set( TrabalhadorData.PERFIL, new Integer( 1 ) );
tr.set( TrabalhadoresData.TO_ESTABELECIMENTO_ID, hash[ i ].get( TrabalhadoresData.TO_ESTABELECIMENTO_ID ) );
tr.set( TrabalhadoresData.PERFIL, new Integer( 1 ) );
// System.out.println( "T: " + i + "\n" + tr.debug() );
tr.save();
}
for( int i = 0; i < activate.size(); i++ )
{
TrabalhadorData trabalhadorR = (TrabalhadorData)JDO.load( TrabalhadorData.class, ( Integer ) activate.elementAt( i ) );
trabalhadorR.set( TrabalhadorData.INACTIVO, "n" );
TrabalhadoresData trabalhadorR = (TrabalhadoresData)JDO.load( TrabalhadoresData.class, ( Integer ) activate.elementAt( i ) );
trabalhadorR.set( TrabalhadoresData.INACTIVO, "n" );
trabalhadorR.save();
}
}
@ -952,7 +956,7 @@ public class ClientesWindow extends EditorWindow
// load all (active) trabalhadores for this company
IDObject trab[] = ( ( FichaDataProvider )FichaDataProvider.getProvider()
).getAllTrabalhadoresForEmpresa(
( Integer )empresa.get( EmpresaData.ID ) );
( Integer )empresa.get( EmpresasData.ID ) );
Hashtable trabalhadores = new Hashtable();
for( int i = 0; i < trab.length; ++i )
{
@ -986,7 +990,7 @@ System.out.println( "VALUE NOME: " + value );
else if( value != null )
{
Integer tID = (Integer) trabalhadores.get( StringPlainer.convertString( value.toString().trim().toLowerCase() ) );
hash[ i ].put( TrabalhadorData.ID, tID );
hash[ i ].put( TrabalhadoresData.ID, tID );
validos.add( new String[]{ value.toString().trim(),
StringPlainer.convertString( value.toString().trim(), false, false ) } );
}
@ -1023,10 +1027,10 @@ System.out.println( "VALUE NOME: " + value );
continue;
}
//System.out.println( "TRABALHADOR:not continue" );
TrabalhadorData tr = (TrabalhadorData)JDO.load( TrabalhadorData.class, ( Integer ) hash[ i ].get( TrabalhadorData.ID ) );
//System.out.println( "TRABALHADORID: " + tr.get( TrabalhadorData.ID ) );
tr.set( TrabalhadorData.DATA_DEMISSAO, hash[ i ].get( TrabalhadorData.DATA_DEMISSAO ) );
//System.out.println( "TRABALHADORDEMISSAO: " + tr.get( TrabalhadorData.DATA_DEMISSAO ) );
TrabalhadoresData tr = (TrabalhadoresData)JDO.load( TrabalhadoresData.class, ( Integer ) hash[ i ].get( TrabalhadoresData.ID ) );
//System.out.println( "TRABALHADORID: " + tr.get( TrabalhadoresData.ID ) );
tr.set( TrabalhadoresData.DATA_DEMISSAO, hash[ i ].get( TrabalhadoresData.DATA_DEMISSAO ) );
//System.out.println( "TRABALHADORDEMISSAO: " + tr.get( TrabalhadoresData.DATA_DEMISSAO ) );
tr.save();
}
StringBuffer buff = new StringBuffer( "" );
@ -1074,8 +1078,8 @@ System.out.println( "VALUE NOME: " + value );
}
try
{
EstabelecimentoData eatabelecimentoNovo = (EstabelecimentoData)JDO.load( EstabelecimentoData.class, ( (IDObject)value ).getID() );
trabalhador.set( TrabalhadorData.ESTABELECIMENTO, eatabelecimentoNovo );
EstabelecimentosData eatabelecimentoNovo = (EstabelecimentosData)JDO.load( EstabelecimentosData.class, ( (IDObject)value ).getID() );
trabalhador.set( TrabalhadoresData.TO_ESTABELECIMENTO_ID, eatabelecimentoNovo );
trabalhador.save();
trabalhador = null;
reload( INDEX_ESTABELECIMENTO );
@ -1094,7 +1098,7 @@ System.out.println( "VALUE NOME: " + value );
{
IDObject estab[] = ( ( FichaDataProvider )FichaDataProvider.getProvider()
).getAllEstabelecimentosForEmpresa(
( Integer )empresa.get( EmpresaData.ID ) );
( Integer )empresa.get( EmpresasData.ID ) );
ListActionDialog dialog = new ListActionDialog( this, "Escolher Estabelecimento", new String []{ "Designa\u00e7\u00e3o" },
new Vector( Arrays.asList( estab ) ), lAction );
dialog.setSize( 250, 200 );
@ -1106,28 +1110,28 @@ System.out.println( "VALUE NOME: " + value );
}
}
public void setJDOObject( JDOObject object )
public void setJDOObject( Persistent<?> object )
{
empresa = null;
estabelecimento = null;
trabalhador = null;
reload(0);
if( object instanceof TrabalhadorData )
if( object instanceof TrabalhadoresData )
{
tabbedPane.setSelectedIndex( 1 );
trabalhador = (TrabalhadorData) object;
estabelecimento = (EstabelecimentoData)trabalhador.get( TrabalhadorData.ESTABELECIMENTO );
empresa = (EmpresaData)estabelecimento.get( EstabelecimentoData.EMPRESA );
trabalhador = (TrabalhadoresData) object;
estabelecimento = (EstabelecimentosData)trabalhador.toEstabelecimento_id();
empresa = (EmpresasData)estabelecimento.toEmpresa_id();
}
else if( object instanceof EstabelecimentoData )
else if( object instanceof EstabelecimentosData )
{
tabbedPane.setSelectedIndex( 0 );
estabelecimento = (EstabelecimentoData)object;
empresa = (EmpresaData)estabelecimento.get( EstabelecimentoData.EMPRESA );
estabelecimento = (EstabelecimentosData)object;
empresa = (EmpresasData)estabelecimento.toEmpresa_id();
}
else if( object instanceof EmpresaData )
else if( object instanceof EmpresasData )
{
empresa = (EmpresaData)object;
empresa = (EmpresasData)object;
}
if( empresa != null )
{
@ -1135,7 +1139,7 @@ System.out.println( "VALUE NOME: " + value );
{
elementosProtocolo =
clientesProvider.getElementosProtocoloForEmpresa(
( Integer ) empresa.get( EmpresaData.ID ), 2 );
( Integer ) empresa.get( EmpresasData.ID ), 2 );
}
catch( Exception ex )
{
@ -1174,8 +1178,8 @@ System.out.println( "VALUE NOME: " + value );
{
try
{
EmpresaData empresaR = (EmpresaData)JDO.load( EmpresaData.class, ( (IDObject)value ).getID() );
empresaR.set( EmpresaData.INACTIVO, "n" );
EmpresasData empresaR = (EmpresasData)JDO.load( EmpresasData.class, ( (IDObject)value ).getID() );
empresaR.set( EmpresasData.INACTIVO, "n" );
empresaR.save();
}
catch( Exception ex )
@ -1215,8 +1219,8 @@ System.out.println( "VALUE NOME: " + value );
{
try
{
EstabelecimentoData estabelecimentoR = (EstabelecimentoData)JDO.load( EstabelecimentoData.class, ( (IDObject)value ).getID() );
estabelecimentoR.set( EstabelecimentoData.INACTIVO, "n" );
EstabelecimentosData estabelecimentoR = (EstabelecimentosData)JDO.load( EstabelecimentosData.class, ( (IDObject)value ).getID() );
estabelecimentoR.set( EstabelecimentosData.INACTIVO, "n" );
estabelecimentoR.save();
}
catch( Exception ex )
@ -1234,7 +1238,7 @@ System.out.println( "VALUE NOME: " + value );
try
{
IDObject estabelecimentos[] = ( ( FichaDataProvider )FichaDataProvider.getProvider()
).getAllEstabelecimentosDeletedForEmpresa( ( Integer ) empresa.get( EmpresaData.ID ) );
).getAllEstabelecimentosDeletedForEmpresa( ( Integer ) empresa.get( EmpresasData.ID ) );
ListActionDialog dialog = new ListActionDialog( this, "Restaurar Estabelecimento", new String []{ "Nome" },
new Vector( Arrays.asList( estabelecimentos ) ), lAction );
dialog.setSize( 250, 200 );
@ -1259,8 +1263,8 @@ System.out.println( "VALUE NOME: " + value );
{
try
{
TrabalhadorData trabalhadorR = (TrabalhadorData)JDO.load( TrabalhadorData.class, ( (IDObject)value ).getID() );
trabalhadorR.set( TrabalhadorData.INACTIVO, "n" );
TrabalhadoresData trabalhadorR = (TrabalhadoresData)JDO.load( TrabalhadoresData.class, ( (IDObject)value ).getID() );
trabalhadorR.set( TrabalhadoresData.INACTIVO, "n" );
trabalhadorR.save();
}
catch( Exception ex )
@ -1278,7 +1282,7 @@ System.out.println( "VALUE NOME: " + value );
try
{
IDObject trabalhadores[] = ( ( FichaDataProvider )FichaDataProvider.getProvider()
).getAllTrabalhadoresDeletedForEstabelecimento( ( Integer ) estabelecimento.get( EstabelecimentoData.ID ) );
).getAllTrabalhadoresDeletedForEstabelecimento( ( Integer ) estabelecimento.get( EstabelecimentosData.ID ) );
ListActionDialog dialog = new ListActionDialog( this, "Restaurar Trabalhador", new String []{ "Nome" },
new Vector( Arrays.asList( trabalhadores ) ), lAction );
dialog.setSize( 250, 200 );
@ -1302,7 +1306,7 @@ System.out.println( "VALUE NOME: " + value );
try
{
UserWindow window = new UserWindow( this, siprp ? null : ( Integer ) empresa.get( EmpresaData.ID ) );
UserWindow window = new UserWindow( this, siprp ? null : ( Integer ) empresa.get( EmpresasData.ID ) );
window.setVisible( true );
}
catch( Exception ex )
@ -1358,7 +1362,7 @@ System.out.println( "VALUE NOME: " + value );
try
{
IDObject fichas[] = ( ( FichaDataProvider )FichaDataProvider.getProvider()
).getAllFichasForTrabalhador( ( Integer ) trabalhador.get( TrabalhadorData.ID ) );
).getAllFichasForTrabalhador( ( Integer ) trabalhador.get( TrabalhadoresData.ID ) );
linhas = new Vector( Arrays.asList( fichas ) );
}
catch( Exception ex )
@ -1376,14 +1380,14 @@ System.out.println( "VALUE NOME: " + value );
throws Exception
{
// MetaObject exame = fdpProvider.load( fdpProvider.EXAMES, new DBKey( exameID ) );
ExameData exame = (ExameData) JDO.load( ExameData.class, exameID );
byte pdf[] = (byte []) exame.get( ExameData.PDF );
ExamesData exame = (ExamesData) JDO.load( ExamesData.class, exameID );
byte pdf[] = (byte []) exame.get( ExamesData.PDF );
if( exame == null )
{
throw new Exception( "N\u00e3o existe exame" );
}
TrabalhadorData trabalhadorExame = ( TrabalhadorData ) exame.get( ExameData.TRABALHADOR );
String nomeFicheiro = StringPlainer.convertString( ( String ) trabalhadorExame.get( TrabalhadorData.NOME ) );
TrabalhadoresData trabalhadorExame = exame.toTrabalhador_id();
String nomeFicheiro = StringPlainer.convertString( ( String ) trabalhadorExame.get( TrabalhadoresData.NOME ) );
nomeFicheiro.replaceAll( " ", "_" );
ExamePDF ePDF = new ExamePDF();
ePDF.print( pdf, nomeFicheiro );
@ -1402,21 +1406,21 @@ System.out.println( "VALUE NOME: " + value );
{
return;
}
String nomeEmpresa = ( ( String ) empresa.get( EmpresaData.DESIGNACAO_SOCIAL ) );
String nomeTrabalhador = ( ( String ) trabalhador.get( TrabalhadorData.NOME ) );
String numeroMecanografico = ( ( String ) trabalhador.get( TrabalhadorData.NUMERO_MECANOGRAFICO ) );
String sexo = "m".equals( trabalhador.get( TrabalhadorData.SEXO ) ) ? "M" : "F";
Date data = ( Date ) trabalhador.get( TrabalhadorData.DATA_NASCIMENTO );
String nomeEmpresa = ( ( String ) empresa.get( EmpresasData.DESIGNACAO_SOCIAL ) );
String nomeTrabalhador = ( ( String ) trabalhador.get( TrabalhadoresData.NOME ) );
String numeroMecanografico = ( ( String ) trabalhador.get( TrabalhadoresData.NUMERO_MECANOGRAFICO ) );
String sexo = "m".equals( trabalhador.get( TrabalhadoresData.SEXO ) ) ? "M" : "F";
Date data = ( Date ) trabalhador.get( TrabalhadoresData.DATA_NASCIMENTO );
String dataNascimento = data != null ? DF.format( data ) : "--";
String nacionalidade = ( String ) trabalhador.get( TrabalhadorData.NACIONALIDADE );
data = ( Date ) trabalhador.get( TrabalhadorData.DATA_ADMISSAO );
String nacionalidade = ( String ) trabalhador.get( TrabalhadoresData.NACIONALIDADE );
data = ( Date ) trabalhador.get( TrabalhadoresData.DATA_ADMISSAO );
String dataAdmissao = data != null ? DF.format( data ) : "--";
String categoria = ( String ) trabalhador.get( TrabalhadorData.CATEGORIA );
String funcao = ( String ) trabalhador.get( TrabalhadorData.FUNCAO_PROPOSTA );
String categoria = ( String ) trabalhador.get( TrabalhadoresData.CATEGORIA );
String funcao = ( String ) trabalhador.get( TrabalhadoresData.FUNCAO_PROPOSTA );
try
{
Integer id = clientesProvider.getEtiquetaID();
EtiquetaData etiqueta = ( EtiquetaData ) JDO.load( EtiquetaData.class, id );
EtiquetasData etiqueta = (EtiquetasData) JDO.load( EtiquetasData.class, id );
EtiquetaPrinter printer = new EtiquetaPrinter( etiqueta );
Vector<Object[]> linhas = new Vector<Object[]>();
linhas.add( new Object[]{ nomeEmpresa, new Double( 1.0 ) } );
@ -1442,22 +1446,22 @@ System.out.println( "VALUE NOME: " + value );
{
return;
}
String nomeEmpresa = ( ( String ) empresa.get( EmpresaData.DESIGNACAO_SOCIAL ) );
String nomeEstabelecimento = ( ( String ) estabelecimento.get( EstabelecimentoData.NOME ) );
ContactoData contacto = ( ContactoData )estabelecimento.get( EstabelecimentoData.CONTACTO );
String nomeEmpresa = ( ( String ) empresa.get( EmpresasData.DESIGNACAO_SOCIAL ) );
String nomeEstabelecimento = ( ( String ) estabelecimento.get( EstabelecimentosData.NOME ) );
ContactosData contacto = estabelecimento.toContacto_id();
String nomeContacto = "";
if( contacto != null )
{
nomeContacto = ( String )contacto.get( ContactoData.NOME );
nomeContacto = ( String )contacto.get( ContactosData.NOME );
}
String morada = ( ( String ) estabelecimento.get( EstabelecimentoData.MORADA ) );
String codigoPostal = ( ( String ) estabelecimento.get( EstabelecimentoData.CODIGO_POSTAL ) );
String local = ( ( String ) estabelecimento.get( EstabelecimentoData.LOCALIDADE ) );
String morada = ( ( String ) estabelecimento.get( EstabelecimentosData.MORADA ) );
String codigoPostal = ( ( String ) estabelecimento.get( EstabelecimentosData.CODIGO_POSTAL ) );
String local = ( ( String ) estabelecimento.get( EstabelecimentosData.LOCALIDADE ) );
try
{
Integer id = clientesProvider.getEtiquetaID();
EtiquetaData etiqueta = ( EtiquetaData ) JDO.load( EtiquetaData.class, id );
EtiquetasData etiqueta = ( EtiquetasData ) JDO.load( EtiquetasData.class, id );
EtiquetaPrinter printer = new EtiquetaPrinter( etiqueta );
Vector<Object[]> linhas = new Vector<Object[]>();
linhas.add( new Object[]{ nomeEmpresa, new Double( 1.0 ) } );

@ -15,7 +15,7 @@ import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import siprp.data.ContactoData;
import siprp.data.outer.ContactosData;
import com.evolute.utils.dataui.ComponentController;
import com.evolute.utils.dataui.ComponentsHashtable;
@ -28,7 +28,7 @@ import com.evolute.utils.ui.text.CopyPasteHandler;
public class ContactoPanel extends JPanel
implements ControllableComponent
{
private ContactoData contacto;
private ContactosData contacto;
private ComponentsHashtable components;
private JTextField nomeText;
@ -139,12 +139,12 @@ public class ContactoPanel extends JPanel
private void setupComponentsHashtable()
{
components = new ComponentsHashtable();
components.putComponent( ContactoData.NOME, nomeText );
components.putComponent( ContactoData.CARGO, cargoText );
components.putComponent( ContactoData.TELEFONE, telefoneText );
components.putComponent( ContactoData.TELEMOVEL, telemovelText );
components.putComponent( ContactoData.FAX, faxText );
components.putComponent( ContactoData.EMAIL, emailText );
components.putComponent( ContactosData.NOME, nomeText );
components.putComponent( ContactosData.CARGO, cargoText );
components.putComponent( ContactosData.TELEFONE, telefoneText );
components.putComponent( ContactosData.TELEMOVEL, telemovelText );
components.putComponent( ContactosData.FAX, faxText );
components.putComponent( ContactosData.EMAIL, emailText );
}
public void clear()
@ -157,7 +157,7 @@ public class ContactoPanel extends JPanel
public void fill(Object value)
{
clear();
contacto = ( ContactoData ) value;
contacto = ( ContactosData ) value;
if( contacto == null )
{
return;
@ -170,7 +170,7 @@ public class ContactoPanel extends JPanel
{
if( contacto == null )
{
contacto = new ContactoData();
contacto = new ContactosData();
}
String names[] = contacto.getFieldNames();

@ -18,7 +18,7 @@ import java.awt.GridLayout;
import java.awt.Insets;
import java.util.Arrays;
import java.util.Collection;
import java.util.Hashtable;
import java.util.Map;
import java.util.Vector;
import javax.swing.BorderFactory;
@ -35,13 +35,13 @@ import javax.swing.event.ListSelectionListener;
import siprp.FichaDataProvider;
import siprp.SingletonConstants;
import siprp.data.EmpresaData;
import siprp.data.EstabelecimentoData;
import siprp.data.MarcacaoEmpresa;
import siprp.data.MarcacaoEmpresaData;
import siprp.data.outer.EmpresasData;
import siprp.data.outer.EstabelecimentosData;
import siprp.data.outer.MarcacoesEmpresaData;
import siprp.database.cayenne.objects.Image;
import siprp.database.cayenne.providers.ImageDAO;
import com.evolute.entity.ProviderInterface;
import com.evolute.utils.Singleton;
import com.evolute.utils.data.IDObject;
import com.evolute.utils.data.MappableObject;
@ -51,7 +51,6 @@ import com.evolute.utils.dataui.ControllableComponent;
import com.evolute.utils.documents.DoubleDocument;
import com.evolute.utils.documents.IntegerDocument;
import com.evolute.utils.documents.MaximumLengthDocument;
import com.evolute.utils.jdo.JDOProvider;
import com.evolute.utils.tables.BaseTable;
import com.evolute.utils.tables.ColumnizedObject;
import com.evolute.utils.tables.VectorTableModel;
@ -72,10 +71,10 @@ public class EmpresaPanel extends JPanel
private static final String STRING_TRABALHADORES_ACTIVOS = "Trabalhadores activos";
private JDOProvider JDO;
private ProviderInterface objectProvider;
private FichaDataProvider provider;
private EmpresaData empresa;
private EmpresasData empresa;
private ComponentsHashtable components;
private Integer id;
@ -136,7 +135,7 @@ public class EmpresaPanel extends JPanel
webAware = ( ( Boolean ) Singleton.getInstance( SingletonConstants.WEB_AWARE ) ).booleanValue();
provider = (FichaDataProvider)FichaDataProvider.getProvider();
listSelectionListeners = new Vector();
JDO = ( JDOProvider ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
objectProvider = ( ProviderInterface ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
setupComponents();
setupComponentsHashtable();
}
@ -687,7 +686,7 @@ public class EmpresaPanel extends JPanel
Object row = ( (VectorTableModel)marcacoesTable.getModel() ).getRowAt( selected );
marcacoesTable.clearSelection();
marcacaoPanel.setEmpresa( empresa );
if( row != null && row instanceof MarcacaoEmpresaData )
if( row != null && row instanceof MarcacoesEmpresaData )
{
marcacaoPanel.fill( row );
}
@ -729,41 +728,41 @@ public class EmpresaPanel extends JPanel
private void setupComponentsHashtable()
{
components = new ComponentsHashtable();
components.putComponent( EmpresaData.DESIGNACAO_SOCIAL, designacaoSocialText );
components.putComponent( EmpresaData.MORADA, moradaText );
components.putComponent( EmpresaData.CODIGO_POSTAL, codigoPostalText );
components.putComponent( EmpresaData.LOCALIDADE, localText );
components.putComponent( EmpresaData.DISTRITO, distritoText );
components.putComponent( EmpresaData.CONCELHO, concelhoText );
components.putComponent( EmpresaData.DATA_PROPOSTA, envioPropostaPanel );
components.putComponent( EmpresaData.DATA_ACEITACAO, aceitacaoPropostaPanel );
components.putComponent( EmpresaData.INICIO_CONTRATO, inicioContratoPanel );
components.putComponent( EmpresaData.DURACAO, duracaoContratoText );
components.putComponent( EmpresaData.DATA_CANCELAMENTO, cancelamentoPanel );
components.putDummy( EmpresaData.PERFIL_1 );
components.putDummy( EmpresaData.PERFIL_2);
components.putComponent( EmpresaData.DATA_ENVIO_CONTRATO, envioContratoPanel );
components.putComponent( EmpresaData.DATA_RECEPCAO_CONTRATO, recepcaoContratoPanel );
components.putComponent( EmpresaData.DATA_ENVIO_IDICT, envioIdictPanel );
components.putComponent( EmpresaData.DATA_RELATORIO_ANUAL, relatorioAnualPanel );
components.putComponent( EmpresaData.CODIGO_1, codigo1Text );
components.putComponent( EmpresaData.CODIGO_2, codigo2Text );
components.putComponent( EmpresaData.CODIGO_3, codigo3Text );
components.putComponent( EmpresaData.CAE, caeText );
components.putComponent( EmpresaData.ACTIVIDADE, actividadeText );
components.putComponent( EmpresaData.CONTRIBUINTE, contribuinteText );
components.putComponent( EmpresaData.SEGURANCA_SOCIAL, segSocialText );
components.putComponent( EmpresaData.CONTACTO_1, contacto1Panel );
components.putComponent( EmpresaData.CONTACTO_2, contacto2Panel );
components.putComponent( EmpresaData.SERVICOS, servicosCombo );
components.putComponent( EmpresaData.PRECO_HIGIENE, precoHigieneText );
components.putComponent( EmpresaData.PRECO_MEDICINA, precoMedicinaText );
components.putComponent( EmpresaData.PERIODICIDADE, modalidadePagamentoText );
components.putDummy( EmpresaData.SERVICO_SAUDE_TIPO );
components.putDummy( EmpresaData.SERVICO_SAUDE_DESIGNACAO );
components.putDummy( EmpresaData.SERVICO_HIGIENE_TIPO );
components.putDummy( EmpresaData.SERVICO_HIGIENE_DESIGNACAO );
components.putDummy( EmpresaData.DESIGNACAO_SOCIAL_PLAIN );
components.putComponent( EmpresasData.DESIGNACAO_SOCIAL, designacaoSocialText );
components.putComponent( EmpresasData.MORADA, moradaText );
components.putComponent( EmpresasData.CODIGO_POSTAL, codigoPostalText );
components.putComponent( EmpresasData.LOCALIDADE, localText );
components.putComponent( EmpresasData.DISTRITO, distritoText );
components.putComponent( EmpresasData.CONCELHO, concelhoText );
components.putComponent( EmpresasData.DATA_PROPOSTA, envioPropostaPanel );
components.putComponent( EmpresasData.DATA_ACEITACAO, aceitacaoPropostaPanel );
components.putComponent( EmpresasData.INICIO_CONTRATO, inicioContratoPanel );
components.putComponent( EmpresasData.DURACAO, duracaoContratoText );
components.putComponent( EmpresasData.DATA_CANCELAMENTO, cancelamentoPanel );
components.putDummy( EmpresasData.PERFIL_1 );
components.putDummy( EmpresasData.PERFIL_2);
components.putComponent( EmpresasData.DATA_ENVIO_CONTRATO, envioContratoPanel );
components.putComponent( EmpresasData.DATA_RECEPCAO_CONTRATO, recepcaoContratoPanel );
components.putComponent( EmpresasData.DATA_ENVIO_IDICT, envioIdictPanel );
components.putComponent( EmpresasData.DATA_RELATORIO_ANUAL, relatorioAnualPanel );
components.putComponent( EmpresasData.CODIGO_1, codigo1Text );
components.putComponent( EmpresasData.CODIGO_2, codigo2Text );
components.putComponent( EmpresasData.CODIGO_3, codigo3Text );
components.putComponent( EmpresasData.CAE, caeText );
components.putComponent( EmpresasData.ACTIVIDADE, actividadeText );
components.putComponent( EmpresasData.CONTRIBUINTE, contribuinteText );
components.putComponent( EmpresasData.SEGURANCA_SOCIAL, segSocialText );
components.putComponent( EmpresasData.TO_CONTACTO_1, contacto1Panel );
components.putComponent( EmpresasData.TO_CONTACTO_2, contacto2Panel );
components.putComponent( EmpresasData.SERVICOS, servicosCombo );
components.putComponent( EmpresasData.PRECO_HIGIENE, precoHigieneText );
components.putComponent( EmpresasData.PRECO_MEDICINA, precoMedicinaText );
components.putComponent( EmpresasData.PERIODICIDADE, modalidadePagamentoText );
components.putDummy( EmpresasData.SERVICO_SAUDE_TIPO );
components.putDummy( EmpresasData.SERVICO_SAUDE_DESIGNACAO );
components.putDummy( EmpresasData.SERVICO_HIGIENE_TIPO );
components.putDummy( EmpresasData.SERVICO_HIGIENE_DESIGNACAO );
components.putDummy( EmpresasData.DESIGNACAO_SOCIAL_PLAIN );
}
public void clear()
@ -785,12 +784,12 @@ public class EmpresaPanel extends JPanel
// userPanel.setEmpresaID( null );
return;
}
empresa = ( EmpresaData ) ( ( Object [] )value )[ 0 ];
empresa = ( EmpresasData ) ( ( Object [] )value )[ 0 ];
Integer elementosProtocolo[][] = ( Integer [][] ) ( ( Object [] )value )[ 1 ];
String names[] = ( String[] ) components.keySet().toArray( new String[ components.size() ] );
ComponentController.fill( names, empresa.getHashData(), components );
id = (Integer) empresa.get( EmpresaData.ID );
id = (Integer) empresa.get( EmpresasData.ID );
IDObject estabelecimentos[];
try
{
@ -807,17 +806,17 @@ public class EmpresaPanel extends JPanel
Vector dadosProtocolo[] = new Vector[]{ new Vector(), new Vector() };
boolean analisesExamesA[] = new boolean[2];
analisesExamesA[ 0 ] = "y".equals( empresa.get( EmpresaData.A_CONSULTAS ) );
analisesExamesA[ 1 ] = "y".equals( empresa.get( EmpresaData.A_EXAMES ) );
analisesExamesA[ 0 ] = "y".equals( empresa.get( EmpresasData.A_CONSULTAS ) );
analisesExamesA[ 1 ] = "y".equals( empresa.get( EmpresasData.A_EXAMES ) );
dadosProtocolo[ 0 ].add( analisesExamesA );
dadosProtocolo[ 0 ].add( elementosProtocolo[ 0 ] );
boolean analisesExamesB[] = new boolean[2];
analisesExamesB[ 0 ] = "y".equals( empresa.get( EmpresaData.B_CONSULTAS ) );
analisesExamesB[ 1 ] = "y".equals( empresa.get( EmpresaData.B_EXAMES ) );
analisesExamesB[ 0 ] = "y".equals( empresa.get( EmpresasData.B_CONSULTAS ) );
analisesExamesB[ 1 ] = "y".equals( empresa.get( EmpresasData.B_EXAMES ) );
dadosProtocolo[ 1 ].add( analisesExamesB );
dadosProtocolo[ 1 ].add( elementosProtocolo[ 1 ] );
protocoloPanel.fill( dadosProtocolo );
Integer empresaID = empresa == null ? null : (Integer) empresa.get( EmpresaData.ID );
Integer empresaID = empresa == null ? null : (Integer) empresa.get( EmpresasData.ID );
if( empresaID != null )
{
Long numTrabalhadoresActivos = provider.countTrabalhadoresActivosForEmpresa( empresaID );
@ -827,7 +826,7 @@ public class EmpresaPanel extends JPanel
}
// if( webAware )
// {
// userPanel.setEmpresaID( (Integer) empresa.get( EmpresaData.ID ) );
// userPanel.setEmpresaID( (Integer) empresa.get( EmpresasData.ID ) );
// userPanel.setEnabled( id != null );
// }
@ -837,24 +836,24 @@ public class EmpresaPanel extends JPanel
{
if( empresa == null )
{
empresa = new EmpresaData();
empresa = new EmpresasData();
}
String names[] = ( String[] ) components.keySet().toArray( new String[ components.size() ] );
Hashtable hash = empresa.getHashData();
Map<String,Object> hash = empresa.getHashData();
ComponentController.save( names, hash, components );
empresa.setHashData( hash );
Vector dadosProtocolo[] = ( Vector[] ) protocoloPanel.save();
boolean analisesExamesA[] = ( boolean [] ) dadosProtocolo[ 0 ].elementAt( 0 );
empresa.set( EmpresaData.A_CONSULTAS, analisesExamesA[ 0 ] ? "y" : "n" );
empresa.set( EmpresaData.A_EXAMES, analisesExamesA[ 1 ] ? "y" : "n" );
empresa.set( EmpresasData.A_CONSULTAS, analisesExamesA[ 0 ] ? "y" : "n" );
empresa.set( EmpresasData.A_EXAMES, analisesExamesA[ 1 ] ? "y" : "n" );
boolean analisesExamesB[] = ( boolean [] ) dadosProtocolo[ 1 ].elementAt( 0 );
empresa.set( EmpresaData.B_CONSULTAS, analisesExamesB[ 0 ] ? "y" : "n" );
empresa.set( EmpresaData.B_EXAMES, analisesExamesB[ 1 ] ? "y" : "n" );
empresa.set( EmpresasData.B_CONSULTAS, analisesExamesB[ 0 ] ? "y" : "n" );
empresa.set( EmpresasData.B_EXAMES, analisesExamesB[ 1 ] ? "y" : "n" );
Integer elementosProtocolo[][] =
new Integer[][]{ ( Integer [] ) dadosProtocolo[ 0 ].elementAt( 1 ),
( Integer [] ) dadosProtocolo[ 1 ].elementAt( 1 ) };
imageDAO.setImageForEmpresaID( (Integer) empresa.get( EmpresaData.ID ), (byte[]) logotipo.save() );
imageDAO.setImageForEmpresaID( (Integer) empresa.get( EmpresasData.ID ), (byte[]) logotipo.save() );
return new Object[] { empresa, elementosProtocolo };
}
@ -913,10 +912,10 @@ public class EmpresaPanel extends JPanel
return estabelecimentosTable;
}
public void setSelectedEstabelecimento( EstabelecimentoData estab )
public void setSelectedEstabelecimento( EstabelecimentosData estab )
{
IDObject lista[] = (IDObject [])estabelecimentosModel.getValues().toArray( new IDObject[ 0 ] );
Integer id = (Integer)estab.get( EstabelecimentoData.ID );
Integer id = (Integer)estab.get( EstabelecimentosData.ID );
for( int n = 0; n < lista.length; n++ )
{
if( lista[ n ].getID().equals( id ) )
@ -933,8 +932,8 @@ public class EmpresaPanel extends JPanel
try
{
Collection marcacoesCollection =
JDO.listLoad( MarcacaoEmpresa.class, new Object[]{ empresa.get( EmpresaData.ID ) },
new String []{ "empresa.id" }, new String[]{ "data descending" } );
objectProvider.listLoad( MarcacoesEmpresaData.class, new Object[]{ empresa.getId() },
new String []{ MarcacoesEmpresaData.EMPRESA_ID }, new String[]{ "data desc" } );
Vector marcacoes = new Vector();
marcacoes.add( new ColumnizedObject(){
public Object getValue( int col )

@ -34,12 +34,12 @@ import javax.swing.event.ListSelectionListener;
import siprp.SIPRPTracker;
import siprp.SingletonConstants;
import siprp.data.EmpresaData;
import siprp.data.EstabelecimentoData;
import siprp.data.HistoricoEstabelecimento;
import siprp.data.HistoricoEstabelecimentoData;
import siprp.data.outer.EmpresasData;
import siprp.data.outer.EstabelecimentosData;
import siprp.data.outer.HistoricoEstabelecimentoData;
import siprp.medicina.prestadores.PrestadoresDataProvider;
import com.evolute.entity.ProviderInterface;
import com.evolute.utils.Singleton;
import com.evolute.utils.data.IDObject;
import com.evolute.utils.data.MappableObject;
@ -48,7 +48,6 @@ import com.evolute.utils.dataui.ComponentsHashtable;
import com.evolute.utils.dataui.ControllableComponent;
import com.evolute.utils.documents.MaximumLengthDocument;
import com.evolute.utils.error.ErrorLogger;
import com.evolute.utils.jdo.JDOProvider;
import com.evolute.utils.tables.BaseTable;
import com.evolute.utils.tables.ColumnizedObject;
import com.evolute.utils.tables.VectorTableModel;
@ -65,12 +64,12 @@ public class EstabelecimentoPanel extends JPanel
public static int disables = 0;
private JDOProvider JDO;
private ProviderInterface objectProvider;
private EstabelecimentoData estabelecimento;
private EstabelecimentosData estabelecimento;
private ComponentsHashtable components;
private EmpresaData empresa;
private EmpresasData empresa;
private JTable estabelecimentosTable;
private JPanel toolbarPanel;
@ -104,7 +103,7 @@ public class EstabelecimentoPanel extends JPanel
this.toolbarPanel = toolbarPanel;
this.designacaoText = designacaoText;
this.estabelecimentosTable = estabelecimentosTable;
JDO = ( JDOProvider ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
objectProvider = ( ProviderInterface ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
prestadoresProvider = PrestadoresDataProvider.getProvider();
setupComponents();
setupComponentsHashtable();
@ -327,18 +326,18 @@ public class EstabelecimentoPanel extends JPanel
private void setupComponentsHashtable()
{
components = new ComponentsHashtable();
components.putComponent( EstabelecimentoData.NOME, designacaoText );
components.putComponent( EstabelecimentoData.MORADA, moradaText );
components.putComponent( EstabelecimentoData.LOCALIDADE, localText );
components.putComponent( EstabelecimentoData.CODIGO_POSTAL, codigoPostalText );
components.putComponent( EstabelecimentoData.CONTACTO, contactoPanel );
// components.putComponent( EstabelecimentoData.HISTORICO, historicoText );
components.putComponent( EstabelecimentoData.HISTORICO, historicoText );
components.putComponent( EstabelecimentoData.PRESTADOR_CONSULTA_ID, prestadorConsultaCombo );
components.putComponent( EstabelecimentoData.PRESTADOR_ECDS_ID, prestadorEcdsCombo );
components.putDummy( EstabelecimentoData.EMPRESA );
components.putDummy( EstabelecimentoData.NOME_PLAIN );
// components.putDummy( EstabelecimentoData.INACTIVO );
components.putComponent( EstabelecimentosData.NOME, designacaoText );
components.putComponent( EstabelecimentosData.MORADA, moradaText );
components.putComponent( EstabelecimentosData.LOCALIDADE, localText );
components.putComponent( EstabelecimentosData.CODIGO_POSTAL, codigoPostalText );
components.putComponent( EstabelecimentosData.CONTACTO_ID, contactoPanel );
// components.putComponent( EstabelecimentosData.HISTORICO, historicoText );
components.putComponent( EstabelecimentosData.HISTORICO, historicoText );
components.putComponent( EstabelecimentosData.PRESTADOR_CONSULTA_ID, prestadorConsultaCombo );
components.putComponent( EstabelecimentosData.PRESTADOR_ECDS_ID, prestadorEcdsCombo );
components.putDummy( EstabelecimentosData.EMPRESA_ID );
components.putDummy( EstabelecimentosData.NOME_PLAIN );
// components.putDummy( EstabelecimentosData.INACTIVO );
}
public void clear()
@ -353,7 +352,7 @@ public class EstabelecimentoPanel extends JPanel
public void fill(Object value)
{
clear();
estabelecimento = ( EstabelecimentoData ) value;
estabelecimento = ( EstabelecimentosData ) value;
// marcacaoPanel.setEnabled( estabelecimento != null );
// marcacaoPanel.fill( estabelecimento );
if( estabelecimento == null )
@ -370,14 +369,14 @@ public class EstabelecimentoPanel extends JPanel
{
if( estabelecimento == null )
{
estabelecimento = new EstabelecimentoData();
estabelecimento = new EstabelecimentosData();
}
String names[] = estabelecimento.getFieldNames();
Hashtable hash = new Hashtable();
ComponentController.save( names, hash, components );
estabelecimento.setHashData( hash );
estabelecimento.set( EstabelecimentoData.EMPRESA, empresa );
estabelecimento.setToEmpresa_id( empresa );
return estabelecimento;
}
@ -386,7 +385,7 @@ public class EstabelecimentoPanel extends JPanel
int selected = estabelecimentosTable.getSelectedRow();
if( estabelecimento != null )
{
IDObject obj = new MappableObject( (Integer) estabelecimento.get( EstabelecimentoData.ID ), estabelecimento.get( EstabelecimentoData.NOME ) );
IDObject obj = new MappableObject( (Integer) estabelecimento.get( EstabelecimentosData.ID ), estabelecimento.get( EstabelecimentosData.NOME ) );
VectorTableModel model = (VectorTableModel)estabelecimentosTable.getModel();
if( selected == -1 )
{
@ -436,7 +435,7 @@ public class EstabelecimentoPanel extends JPanel
{
try
{
EstabelecimentoData estab = ( EstabelecimentoData ) JDO.load( EstabelecimentoData.class, id );
EstabelecimentosData estab = ( EstabelecimentosData ) objectProvider.load( EstabelecimentosData.class, id );
fill( estab );
}
catch( Exception ex )
@ -457,7 +456,7 @@ public class EstabelecimentoPanel extends JPanel
fill( estabelecimento );
}
public void setEmpresa( EmpresaData empresa )
public void setEmpresa( EmpresasData empresa )
{
this.empresa = empresa;
}
@ -467,7 +466,7 @@ public class EstabelecimentoPanel extends JPanel
try
{
Collection historicoCollection =
JDO.listLoad( HistoricoEstabelecimento.class, new Object[]{ estabelecimento.get( EstabelecimentoData.ID ) },
objectProvider.listLoad( HistoricoEstabelecimentoData.class, new Object[]{ estabelecimento.get( EstabelecimentosData.ID ) },
new String []{ "estabelecimento.id" }, new String[]{ "data descending" } );
Vector historico = new Vector();
historico.add( new ColumnizedObject(){
@ -521,8 +520,8 @@ public class EstabelecimentoPanel extends JPanel
try
{
tracker.getHigieneWindow().setVisible( true );
tracker.getHigieneWindow().setEmpresaAndEstabelecimento( (Integer) empresa.get( EmpresaData.ID ),
( Integer ) estabelecimento.get( EstabelecimentoData.ID ) );
tracker.getHigieneWindow().setEmpresaAndEstabelecimento( (Integer) empresa.get( EmpresasData.ID ),
( Integer ) estabelecimento.get( EstabelecimentosData.ID ) );
}
catch (Exception ex) {
ErrorLogger.logException(ex);

@ -18,7 +18,7 @@ import java.util.Hashtable;
import java.util.Locale;
import java.util.Vector;
import siprp.data.EtiquetaData;
import siprp.data.outer.EtiquetasData;
import siprp.util.fop.FOPCreator;
import siprp.util.fop.FOPPrinter;
@ -55,19 +55,19 @@ public class EtiquetaPrinter
protected Double margemHorizontalFolha;
/** Creates a new instance of EtiquetaPrinter */
public EtiquetaPrinter( EtiquetaData etiqueta )
public EtiquetaPrinter( EtiquetasData etiqueta )
{
altura = ( Double ) etiqueta.get( EtiquetaData.ALTURA );
largura = ( Double ) etiqueta.get( EtiquetaData.LARGURA );
margemEsquerda = ( Double ) etiqueta.get( EtiquetaData.MARGEM_ESQUERDA );
margemCima = ( Double ) etiqueta.get( EtiquetaData.MARGEM_CIMA );
colunas = ( Integer ) etiqueta.get( EtiquetaData.COLUNAS );
linhas = ( Integer ) etiqueta.get( EtiquetaData.LINHAS );
continua = "y".equals( etiqueta.get( EtiquetaData.CONTINUA ) );
alturaFolha = ( Double ) etiqueta.get( EtiquetaData.ALTURA_FOLHA );
larguraFolha = ( Double ) etiqueta.get( EtiquetaData.LARGURA_FOLHA );
margemVerticalFolha = ( Double ) etiqueta.get( EtiquetaData.MARGEM_VERTICAL_FOLHA );
margemHorizontalFolha = ( Double ) etiqueta.get( EtiquetaData.MARGEM_HORIZONTAL_FOLHA );
altura = ( Double ) etiqueta.get( EtiquetasData.ALTURA );
largura = ( Double ) etiqueta.get( EtiquetasData.LARGURA );
margemEsquerda = ( Double ) etiqueta.get( EtiquetasData.MARGEM_ESQUERDA );
margemCima = ( Double ) etiqueta.get( EtiquetasData.MARGEM_CIMA );
colunas = ( Integer ) etiqueta.get( EtiquetasData.COLUNAS );
linhas = ( Integer ) etiqueta.get( EtiquetasData.LINHAS );
continua = "y".equals( etiqueta.get( EtiquetasData.CONTINUA ) );
alturaFolha = ( Double ) etiqueta.get( EtiquetasData.ALTURA_FOLHA );
larguraFolha = ( Double ) etiqueta.get( EtiquetasData.LARGURA_FOLHA );
margemVerticalFolha = ( Double ) etiqueta.get( EtiquetasData.MARGEM_VERTICAL_FOLHA );
margemHorizontalFolha = ( Double ) etiqueta.get( EtiquetasData.MARGEM_HORIZONTAL_FOLHA );
}
public void print( Vector<Object[]> data )

@ -26,8 +26,8 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentListener;
import siprp.data.EstabelecimentoData;
import siprp.data.HistoricoEstabelecimentoData;
import siprp.data.outer.EstabelecimentosData;
import siprp.data.outer.HistoricoEstabelecimentoData;
import com.evolute.utils.EVUtilsImageLib;
import com.evolute.utils.dataui.ComponentController;
@ -56,7 +56,7 @@ public class HistoricoEstabelecimentoPanel extends JPanel
private JButton saveButton;
private JButton cancelButton;
private EstabelecimentoData estabelecimento;
private EstabelecimentosData estabelecimento;
private boolean changed = false;
private boolean filling = false;
@ -125,7 +125,7 @@ public class HistoricoEstabelecimentoPanel extends JPanel
components = new ComponentsHashtable();
components.putComponent( HistoricoEstabelecimentoData.DATA, calendarPanel );
components.putComponent( HistoricoEstabelecimentoData.TEXTO, text );
components.putDummy( HistoricoEstabelecimentoData.ESTABELECIMENTO );
components.putDummy( HistoricoEstabelecimentoData.ESTABELECIMENTO_ID );
}
public void clear()
@ -162,7 +162,7 @@ public class HistoricoEstabelecimentoPanel extends JPanel
Hashtable hash = new Hashtable();
ComponentController.save( names, hash, components );
hash.put( HistoricoEstabelecimentoData.ESTABELECIMENTO, estabelecimento );
hash.put( HistoricoEstabelecimentoData.TO_ESTABELECIMENTO_ID, estabelecimento );
historico.setHashData( hash );
return historico;
}
@ -281,7 +281,7 @@ public class HistoricoEstabelecimentoPanel extends JPanel
}
public void setEstabelecimento( EstabelecimentoData estabelecimento )
public void setEstabelecimento( EstabelecimentosData estabelecimento )
{
this.estabelecimento = estabelecimento;
}

@ -26,8 +26,8 @@ import javax.swing.JTextArea;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentListener;
import siprp.data.EmpresaData;
import siprp.data.MarcacaoEmpresaData;
import siprp.data.outer.EmpresasData;
import siprp.data.outer.MarcacoesEmpresaData;
import com.evolute.utils.EVUtilsImageLib;
import com.evolute.utils.dataui.ComponentController;
@ -56,11 +56,11 @@ public class MarcacaoEmpresaPanel extends JPanel
private JButton saveButton;
private JButton cancelButton;
private EmpresaData empresa;
private EmpresasData empresa;
private boolean changed = false;
private boolean filling = false;
private MarcacaoEmpresaData marcacao;
private MarcacoesEmpresaData marcacao;
/** Creates a new instance of MarcacaoEmpresaPanel */
public MarcacaoEmpresaPanel( EmpresaPanel owner )
@ -128,10 +128,10 @@ public class MarcacaoEmpresaPanel extends JPanel
private void setupComponentsHashtable()
{
components = new ComponentsHashtable();
components.putComponent( MarcacaoEmpresaData.DATA, calendarPanel );
components.putComponent( MarcacaoEmpresaData.TEXTO, text );
components.putComponent( MarcacaoEmpresaData.REALIZADA, realizadaCheck );
components.putDummy( MarcacaoEmpresaData.EMPRESA );
components.putComponent( MarcacoesEmpresaData.DATA, calendarPanel );
components.putComponent( MarcacoesEmpresaData.TEXTO, text );
components.putComponent( MarcacoesEmpresaData.REALIZADA, realizadaCheck );
components.putDummy( MarcacoesEmpresaData.EMPRESA_ID );
}
public void clear()
@ -146,7 +146,7 @@ public class MarcacaoEmpresaPanel extends JPanel
filling = true;
clear();
initButtons();
marcacao = (MarcacaoEmpresaData)value;
marcacao = (MarcacoesEmpresaData)value;
if( marcacao == null )
{
filling = false;
@ -161,16 +161,15 @@ public class MarcacaoEmpresaPanel extends JPanel
{
if( marcacao == null )
{
marcacao = new MarcacaoEmpresaData();
marcacao = new MarcacoesEmpresaData();
}
String names[] = marcacao.getFieldNames();
Hashtable hash = new Hashtable();
ComponentController.save( names, hash, components );
hash.put( MarcacaoEmpresaData.EMPRESA, empresa );
hash.put( MarcacoesEmpresaData.TO_EMPRESA_ID, empresa );
marcacao.setHashData( hash );
System.out.println( "EMPRESA:: " + marcacao.get( MarcacaoEmpresaData.EMPRESA ) );
return marcacao;
}
@ -270,7 +269,7 @@ public class MarcacaoEmpresaPanel extends JPanel
JOptionPane.showMessageDialog( this, "Tem de escolher uma data", "Erro...", JOptionPane.ERROR_MESSAGE );
return;
}
MarcacaoEmpresaData marc = ( MarcacaoEmpresaData ) save();
MarcacoesEmpresaData marc = ( MarcacoesEmpresaData ) save();
try
{
@ -290,7 +289,7 @@ public class MarcacaoEmpresaPanel extends JPanel
}
public void setEmpresa( EmpresaData empresa )
public void setEmpresa( EmpresasData empresa )
{
this.empresa = empresa;
}

@ -30,14 +30,14 @@ import javax.swing.event.ChangeListener;
import siprp.CompanyDataLoader;
import siprp.SingletonConstants;
import siprp.data.ContactoData;
import siprp.data.EstabelecimentoData;
import siprp.data.Marcacao;
import siprp.data.MarcacaoEstabelecimentoData;
import siprp.data.MarcacaoListLoader;
import siprp.data.MarcacaoTrabalhadorConstants;
import siprp.data.MarcacaoTrabalhadorData;
import siprp.data.TrabalhadorData;
import siprp.data.outer.ContactosData;
import siprp.data.outer.EstabelecimentosData;
import siprp.data.outer.MarcacoesEstabelecimentoData;
import siprp.data.outer.MarcacoesTrabalhadorData;
import siprp.data.outer.TrabalhadoresData;
import com.evolute.utils.Singleton;
import com.evolute.utils.dataui.ComponentController;
@ -77,8 +77,8 @@ public class MarcacaoPanel extends JPanel
private JLabel dataEnvioMailLabel;
private JButton historicoButton;
private TrabalhadorData trabalhador;
private EstabelecimentoData estabelecimento;
private TrabalhadoresData trabalhador;
private EstabelecimentosData estabelecimento;
private MarcacaoListLoader loader;
private Marcacao current;
@ -264,15 +264,15 @@ System.out.println( "stateChanged2" );
switch( tipo )
{
case Marcacao.TIPO_MARCACAO_TRABALHADOR_EXAMES: case Marcacao.TIPO_MARCACAO_TRABALHADOR_CONSULTA:
if( ! ( value instanceof TrabalhadorData ) )
if( ! ( value instanceof TrabalhadoresData ) )
{
filling = false;
return ;
}
trabalhador = (TrabalhadorData) value;
trabalhador = (TrabalhadoresData) value;
try
{
marcacoes = loader.load( tipo, (Integer)trabalhador.get( TrabalhadorData.ID ) );
marcacoes = loader.load( tipo, (Integer)trabalhador.get( TrabalhadoresData.ID ) );
}
catch( Exception ex )
{
@ -282,15 +282,15 @@ System.out.println( "stateChanged2" );
break;
case Marcacao.TIPO_MARCACAO_ESTABELECIMENTO:
if( ! ( value instanceof EstabelecimentoData ) )
if( ! ( value instanceof EstabelecimentosData ) )
{
filling = false;
return ;
}
estabelecimento = (EstabelecimentoData) value;
estabelecimento = (EstabelecimentosData) value;
try
{
marcacoes = loader.load( tipo, (Integer)estabelecimento.get( EstabelecimentoData.ID ) );
marcacoes = loader.load( tipo, (Integer)estabelecimento.get( EstabelecimentosData.ID ) );
}
catch( Exception ex )
{
@ -411,13 +411,13 @@ System.out.println( "stateChanged2" );
current.set( Marcacao.DATA_EMAIL, today );
String subject = ".";
String texto = "";
EstabelecimentoData estab = null;
if( current instanceof MarcacaoTrabalhadorData )
EstabelecimentosData estab = null;
if( current instanceof MarcacoesTrabalhadorData )
{
TrabalhadorData trab = ( TrabalhadorData )current.get( MarcacaoTrabalhadorData.TRABALHADOR );
String nome = ( String )trab.get( TrabalhadorData.NOME );
String data = DateFormat.getDateInstance( DateFormat.SHORT ).format( ( Date )current.get( MarcacaoTrabalhadorData.DATA ) );
if( ( ( Number )current.get( MarcacaoTrabalhadorData.TIPO ) ).intValue() == MarcacaoTrabalhadorConstants.TIPO_EXAMES )
TrabalhadoresData trab = ((MarcacoesTrabalhadorData)current).toTrabalhador_id();
String nome = ( String )trab.get( TrabalhadoresData.NOME );
String data = DateFormat.getDateInstance( DateFormat.SHORT ).format( ( Date )current.get( MarcacoesTrabalhadorData.DATA ) );
if( ( ( Number )current.get( MarcacoesTrabalhadorData.TIPO ) ).intValue() == MarcacaoTrabalhadorConstants.TIPO_EXAMES )
{
subject = ( String ) Singleton.getInstance( SingletonConstants.SUBJECT_EXAMES );
subject = subject.replaceAll( CompanyDataLoader.NOME, nome );
@ -467,16 +467,16 @@ System.out.println( "stateChanged2" );
// + "%0A%0APra\u00e7a Duque de Saldanha, 1 - 9\u00BAC"
// + "%0A%0A1050-094 Lisboa";
}
estab = ( EstabelecimentoData )trab.get( TrabalhadorData.ESTABELECIMENTO );
estab = trab.toEstabelecimento_id();
}
else
{
estab = ( EstabelecimentoData )current.get( MarcacaoEstabelecimentoData.ESTABELECIMENTO );
String sede = ( String )estab.get( EstabelecimentoData.NOME );
estab = ( EstabelecimentosData ) current.get( MarcacoesEstabelecimentoData.TO_ESTABELECIMENTO_ID );
String sede = ( String )estab.get( EstabelecimentosData.NOME );
subject = ( String ) Singleton.getInstance( SingletonConstants.SUBJECT_VISITA );
subject = subject.replaceAll( CompanyDataLoader.NOME, sede );
String morada = ( String )estab.get( EstabelecimentoData.MORADA );
String data = DateFormat.getDateInstance( DateFormat.SHORT ).format( ( Date )current.get( MarcacaoEstabelecimentoData.DATA ) );
String morada = ( String )estab.get( EstabelecimentosData.MORADA );
String data = DateFormat.getDateInstance( DateFormat.SHORT ).format( ( Date ) current.get( MarcacoesEstabelecimentoData.DATA ) );
texto = ( String ) Singleton.getInstance( SingletonConstants.LETTER_VISITA );
texto = texto.replaceAll( CompanyDataLoader.DATA, data );
texto = texto.replaceAll( CompanyDataLoader.NOME, sede );
@ -499,11 +499,11 @@ System.out.println( "stateChanged2" );
}
ContactoData cont = ( ContactoData )estab.get( EstabelecimentoData.CONTACTO );
ContactosData cont = ( ContactosData )estab.toContacto_id();
String mail = "";
if( cont != null )
{
mail = ( String )cont.get( ContactoData.EMAIL );
mail = cont.getEmail();
}
try
{
@ -573,12 +573,12 @@ System.out.println( "MARCAR" );
switch( tipo )
{
case Marcacao.TIPO_MARCACAO_TRABALHADOR_EXAMES: case Marcacao.TIPO_MARCACAO_TRABALHADOR_CONSULTA:
current.set( MarcacaoTrabalhadorData.TRABALHADOR, trabalhador );
current.set( MarcacaoTrabalhadorData.TIPO, new Integer( tipo ) );
current.set( MarcacoesTrabalhadorData.TO_TRABALHADOR_ID, trabalhador );
current.set( MarcacoesTrabalhadorData.TIPO, new Integer( tipo ) );
break;
case Marcacao.TIPO_MARCACAO_ESTABELECIMENTO:
current.set( MarcacaoEstabelecimentoData.ESTABELECIMENTO, estabelecimento );
current.set( MarcacoesEstabelecimentoData.TO_ESTABELECIMENTO_ID, estabelecimento );
break;
}
marcacoes = ( Marcacao [])aux.toArray( new Marcacao[0] );

@ -30,9 +30,9 @@ import javax.swing.event.ListSelectionListener;
import siprp.FichaDataProvider;
import siprp.SIPRPTracker;
import siprp.data.EmpresaData;
import siprp.data.EstabelecimentoData;
import siprp.data.TrabalhadorData;
import siprp.data.outer.EmpresasData;
import siprp.data.outer.EstabelecimentosData;
import siprp.data.outer.TrabalhadoresData;
import com.evolute.utils.data.IDObject;
import com.evolute.utils.data.MappableObject;
@ -56,10 +56,10 @@ public class TrabalhadorPanel extends JPanel
implements ControllableComponent, ListSelectionListener, ActionListener
{
private FichaDataProvider provider;
private TrabalhadorData trabalhador;
private TrabalhadoresData trabalhador;
private ComponentsHashtable components;
private EstabelecimentoData estabelecimento;
private EstabelecimentosData estabelecimento;
private JTable estabelecimentosTable;
private JPanel toolbarPanel;
@ -254,8 +254,8 @@ public class TrabalhadorPanel extends JPanel
private void setupComponentsHashtable()
{
components = new ComponentsHashtable();
components.putComponent( TrabalhadorData.NOME, nomeText );
components.putComponent( TrabalhadorData.SEXO, new ControllableComponent()
components.putComponent( TrabalhadoresData.NOME, nomeText );
components.putComponent( TrabalhadoresData.SEXO, new ControllableComponent()
{
public void fill( Object value )
{
@ -289,22 +289,22 @@ public class TrabalhadorPanel extends JPanel
sexoPanel.setEnabled( enable );
}
} );
components.putComponent( TrabalhadorData.BI , biText );
components.putComponent( TrabalhadorData.DATA_NASCIMENTO, dataNascimentoPanel );
components.putComponent( TrabalhadorData.NACIONALIDADE, nacionalidadeText );
components.putComponent( TrabalhadorData.NUMERO_MECANOGRAFICO, numeroMecanograficoText );
components.putComponent( TrabalhadorData.DATA_ADMISSAO, dataAdmissaoPanel );
components.putComponent( TrabalhadorData.CATEGORIA, categoriaText );
components.putComponent( TrabalhadorData.LOCAL_TRABALHO, localText );
components.putComponent( TrabalhadorData.FUNCAO_PROPOSTA, funcaoText );
components.putComponent( TrabalhadorData.DATA_ADMISSAO_FUNCAO, dataAdmissaoFuncaoPanel );
components.putComponent( TrabalhadorData.DATA_DEMISSAO, dataDemissaoPanel );
components.putDummy( TrabalhadorData.OBSERVACOES );
components.putComponent( TrabalhadorData.OBSERVACOES_GESTAO, observacoesText );
components.putComponent( TrabalhadorData.PERFIL, perfilPanel );
// components.putDummy( TrabalhadorData.INACTIVO );
components.putDummy( TrabalhadorData.ESTABELECIMENTO );
components.putDummy( TrabalhadorData.NOME_PLAIN );
components.putComponent( TrabalhadoresData.BI , biText );
components.putComponent( TrabalhadoresData.DATA_NASCIMENTO, dataNascimentoPanel );
components.putComponent( TrabalhadoresData.NACIONALIDADE, nacionalidadeText );
components.putComponent( TrabalhadoresData.NUMERO_MECANOGRAFICO, numeroMecanograficoText );
components.putComponent( TrabalhadoresData.DATA_ADMISSAO, dataAdmissaoPanel );
components.putComponent( TrabalhadoresData.CATEGORIA, categoriaText );
components.putComponent( TrabalhadoresData.LOCAL_TRABALHO, localText );
components.putComponent( TrabalhadoresData.FUNCAO_PROPOSTA, funcaoText );
components.putComponent( TrabalhadoresData.DATA_ADMISSAO_FUNCAO, dataAdmissaoFuncaoPanel );
components.putComponent( TrabalhadoresData.DATA_DEMISSAO, dataDemissaoPanel );
components.putDummy( TrabalhadoresData.OBSERVACOES );
components.putComponent( TrabalhadoresData.OBSERVACOES_GESTAO, observacoesText );
components.putComponent( TrabalhadoresData.PERFIL, perfilPanel );
// components.putDummy( TrabalhadoresData.INACTIVO );
components.putDummy( TrabalhadoresData.ESTABELECIMENTO_ID );
components.putDummy( TrabalhadoresData.NOME_PLAIN );
}
public void clear()
@ -317,7 +317,7 @@ public class TrabalhadorPanel extends JPanel
public void fill(Object value)
{
clear();
trabalhador = ( TrabalhadorData ) value;
trabalhador = ( TrabalhadoresData ) value;
// examesPanel.setEnabled( trabalhador != null );
// examesPanel.fill( trabalhador );
// consultaPanel.setEnabled( trabalhador != null );
@ -336,14 +336,14 @@ public class TrabalhadorPanel extends JPanel
if( trabalhador == null )
{
trabalhador = new TrabalhadorData();
trabalhador = new TrabalhadoresData();
}
String names[] = trabalhador.getFieldNames();
Hashtable hash = new Hashtable();
ComponentController.save( names, hash, components );
trabalhador.setHashData( hash );
trabalhador.set( TrabalhadorData.ESTABELECIMENTO, estabelecimento );
trabalhador.set( TrabalhadoresData.TO_ESTABELECIMENTO_ID, estabelecimento );
return trabalhador;
}
@ -382,7 +382,7 @@ public class TrabalhadorPanel extends JPanel
}
else
{
Integer id = ( Integer )estabelecimento.get( EstabelecimentoData.ID );
Integer id = ( Integer )estabelecimento.get( EstabelecimentosData.ID );
IDObject []trabalhadores = provider.getAllTrabalhadoresForEstabelecimento( id );
trabalhadoresModel.setValues( new Vector( Arrays.asList( trabalhadores ) ) );
}
@ -426,7 +426,7 @@ public class TrabalhadorPanel extends JPanel
// Integer id = ( ( IDObject ) trabalhadoresModel.getRowAt( selected ) ).getID();;
// try
// {
// TrabalhadorData trabalhador = (TrabalhadorData) TrabalhadorData.load( TrabalhadorData.class, id );
// TrabalhadoresData trabalhador = (TrabalhadoresData) TrabalhadoresData.load( TrabalhadoresData.class, id );
// fill( trabalhador );
// }
// catch( Exception ex )
@ -450,7 +450,7 @@ public class TrabalhadorPanel extends JPanel
//System.out.println( "postSave TRABALHADOR PANEL " + selected + " : " + ( trabalhador == null ) );
if( trabalhador != null )
{
IDObject obj = new MappableObject( (Integer) trabalhador.get( TrabalhadorData.ID ), trabalhador.get( TrabalhadorData.NOME ) );
IDObject obj = new MappableObject( (Integer) trabalhador.get( TrabalhadoresData.ID ), trabalhador.get( TrabalhadoresData.NOME ) );
if( selected == -1 )
{
trabalhadoresModel.insertRowAt( obj, trabalhadoresTable.getRowCount() );
@ -490,15 +490,15 @@ public class TrabalhadorPanel extends JPanel
return ( (IDObject) trabalhadoresModel.getRowAt( selected ) ).getID();
}
public void setEstabelecimento( EstabelecimentoData estabelecimento )
public void setEstabelecimento( EstabelecimentosData estabelecimento )
{
this.estabelecimento = estabelecimento;
}
public void setSelectedTrabalhador( TrabalhadorData trab )
public void setSelectedTrabalhador( TrabalhadoresData trab )
{
IDObject lista[] = (IDObject [])trabalhadoresModel.getValues().toArray( new IDObject[ 0 ] );
Integer id = (Integer)trab.get( TrabalhadorData.ID );
Integer id = (Integer)trab.get( TrabalhadoresData.ID );
for( int n = 0; n < lista.length; n++ )
{
if( lista[ n ].getID().equals( id ) )
@ -523,12 +523,12 @@ public class TrabalhadorPanel extends JPanel
{
try
{
EstabelecimentoData estabelecimento = ( EstabelecimentoData ) trabalhador.get( TrabalhadorData.ESTABELECIMENTO );
EmpresaData empresa = ( EmpresaData ) estabelecimento.get( EstabelecimentoData.EMPRESA );
EstabelecimentosData estabelecimento = trabalhador.toEstabelecimento_id();
EmpresasData empresa = estabelecimento.toEmpresa_id();
tracker.getMedicinaWindow().setVisible( true );
tracker.getMedicinaWindow().setEmpresaAndEstabelecimentoAndTrabalhador( (Integer) empresa.get( EmpresaData.ID ),
( Integer ) estabelecimento.get( EstabelecimentoData.ID ),
( Integer ) trabalhador.get( TrabalhadorData.ID ) );
tracker.getMedicinaWindow().setEmpresaAndEstabelecimentoAndTrabalhador( (Integer) empresa.get( EmpresasData.ID ),
( Integer ) estabelecimento.get( EstabelecimentosData.ID ),
( Integer ) trabalhador.get( TrabalhadoresData.ID ) );
}
catch (Exception ex) {
ErrorLogger.logException(ex);

@ -10,10 +10,10 @@ import java.awt.BorderLayout;
import javax.swing.JFrame;
import siprp.data.EmpresaData;
import siprp.data.outer.EmpresasData;
import com.evolute.entity.ProviderInterface;
import com.evolute.utils.Singleton;
import com.evolute.utils.jdo.JDOProvider;
import com.evolute.utils.ui.CustomJDialog;
/**
*
@ -21,7 +21,7 @@ import com.evolute.utils.ui.CustomJDialog;
*/
public class UserWindow extends CustomJDialog
{
protected JDOProvider JDO;
protected ProviderInterface JDO;
// protected JTextField empresaText;
protected UserPanel userPanel;
protected Integer empresaID;
@ -32,7 +32,7 @@ public class UserWindow extends CustomJDialog
{
super( owner, true );
this.empresaID = empresaID;
JDO = ( JDOProvider ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
JDO = ( ProviderInterface ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
setupComponents();
centerSuper();
}
@ -54,13 +54,13 @@ public class UserWindow extends CustomJDialog
}
else
{
EmpresaData empresa = ( EmpresaData )JDO.load( EmpresaData.class, empresaID );
EmpresasData empresa = ( EmpresasData )JDO.load( EmpresasData.class, empresaID );
if( empresa == null )
{
return;
}
// empresaText.setText( (String)empresa.get( EmpresaData.DESIGNACAO_SOCIAL ) );
setTitle( (String)empresa.get( EmpresaData.DESIGNACAO_SOCIAL ) );
// empresaText.setText( (String)empresa.get( EmpresasData.DESIGNACAO_SOCIAL ) );
setTitle( (String)empresa.get( EmpresasData.DESIGNACAO_SOCIAL ) );
}
userPanel.setEmpresaID( empresaID );
}

@ -86,20 +86,20 @@ public class SIPRPDataLoader implements CompanyDataLoader
Singleton.setInstance( SingletonConstants.WEB_DB_NAME, "siprp" );
Singleton.setInstance( SingletonConstants.WEB_DRIVER_NAME, "org.postgresql.Driver" );
// Singleton.setInstance( SingletonConstants.LOCAL_USER, "siprp" );
// Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "rg2h-opksiprp" );
// Singleton.setInstance( SingletonConstants.LOCAL_URL_PREFIX, "jdbc:postgresql://" );
// Singleton.setInstance( SingletonConstants.LOCAL_URL, "www.evolute.pt:5436" );
// Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local_3" );
// Singleton.setInstance( SingletonConstants.LOCAL_DRIVER_NAME, "org.postgresql.Driver" );
Singleton.setInstance( SingletonConstants.LOCAL_USER, "postgres" );
Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "Typein" );
Singleton.setInstance( SingletonConstants.LOCAL_USER, "siprp" );
Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "rg2h-opksiprp" );
Singleton.setInstance( SingletonConstants.LOCAL_URL_PREFIX, "jdbc:postgresql://" );
Singleton.setInstance( SingletonConstants.LOCAL_URL, "10.158.2.2:5432" );
Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local" );
Singleton.setInstance( SingletonConstants.LOCAL_URL, "www.evolute.pt:5436" );
Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local_3" );
Singleton.setInstance( SingletonConstants.LOCAL_DRIVER_NAME, "org.postgresql.Driver" );
// Singleton.setInstance( SingletonConstants.LOCAL_USER, "postgres" );
// Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "Typein" );
// Singleton.setInstance( SingletonConstants.LOCAL_URL_PREFIX, "jdbc:postgresql://" );
// Singleton.setInstance( SingletonConstants.LOCAL_URL, "10.158.2.2:5432" );
// Singleton.setInstance( SingletonConstants.LOCAL_DB_NAME, "siprp_local" );
// Singleton.setInstance( SingletonConstants.LOCAL_DRIVER_NAME, "org.postgresql.Driver" );
// Singleton.setInstance( SingletonConstants.LOCAL_USER, "postgres" );
// Singleton.setInstance( SingletonConstants.LOCAL_PASSWORD, "Typein" );
// Singleton.setInstance( SingletonConstants.LOCAL_URL_PREFIX, "jdbc:postgresql://" );

@ -1,52 +0,0 @@
/*
* StampSaveHandler.java
*
* Created on 15 de Marco de 2005, 15:00
*/
package siprp.data;
import java.util.Date;
import com.evolute.utils.jdo.JDOObject;
import com.evolute.utils.jdo.JDOOperationHandlerInterface;
/**
*
* @author fpalma
*/
public class ActualizacaoSaveHandler implements JDOOperationHandlerInterface
{
public static final ActualizacaoSaveHandler INSTANCE = new ActualizacaoSaveHandler();
/** Creates a new instance of StampSaveHandler */
public ActualizacaoSaveHandler()
{
}
public boolean handle(JDOObject object, int operation, int moment) throws Exception
{
if( !( object instanceof ActualizacaoSaveable ) )
{
return false;
}
switch( operation )
{
case OP_SAVE:
return save( object, moment );
case OP_DELETE:
return false;
}
return false;
}
protected boolean save( JDOObject object, int moment )
{
if( moment != MOMENT_BEFORE )
{
return false;
}
object.set( ActualizacaoSaveable.ACTUALIZACAO, new Date() );
return true;
}
}

@ -1,16 +0,0 @@
/*
* ActualizacaoSaveable.java
*
* Created on 15 de Marco de 2005, 15:32
*/
package siprp.data;
/**
*
* @author fpalma
*/
public interface ActualizacaoSaveable
{
public static final String ACTUALIZACAO = "actualizacao";
}

@ -1,187 +0,0 @@
/*
* Aviso.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on 13/Out/2004
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.util.Date;
import com.evolute.utils.jdo.JDOInnerObject;
public final class Aviso implements JDOInnerObject
{
private Integer id;
private Integer tipo;
private Empresa empresa;
private Estabelecimento estabelecimento;
private Trabalhador trabalhador;
private Integer evento_id;
private Date data_aviso;
private Date data_evento;
private String descricao;
public Aviso()
{
}
public Object getField( String fieldName )
{
if( fieldName == AvisoData.ID )
{
return id;
}
else if( fieldName == AvisoData.TIPO )
{
return tipo;
}
else if( fieldName == AvisoData.EMPRESA )
{
return empresa;
}
else if( fieldName == AvisoData.ESTABELECIMENTO )
{
return estabelecimento;
}
else if( fieldName == AvisoData.TRABALHADOR )
{
return trabalhador;
}
else if( fieldName == AvisoData.EVENTO_ID )
{
return evento_id;
}
else if( fieldName == AvisoData.DATA_AVISO )
{
return data_aviso;
}
else if( fieldName == AvisoData.DATA_EVENTO )
{
return data_evento;
}
else if( fieldName == AvisoData.DESCRICAO )
{
return descricao;
}
else if( fieldName.equals( AvisoData.ID ) )
{
return id;
}
else if( fieldName.equals( AvisoData.TIPO ) )
{
return tipo;
}
else if( fieldName.equals( AvisoData.EMPRESA ) )
{
return empresa;
}
else if( fieldName.equals( AvisoData.ESTABELECIMENTO ) )
{
return estabelecimento;
}
else if( fieldName.equals( AvisoData.TRABALHADOR ) )
{
return trabalhador;
}
else if( fieldName.equals( AvisoData.EVENTO_ID ) )
{
return evento_id;
}
else if( fieldName.equals( AvisoData.DATA_AVISO ) )
{
return data_aviso;
}
else if( fieldName.equals( AvisoData.DATA_EVENTO ) )
{
return data_evento;
}
else if( fieldName.equals( AvisoData.DESCRICAO ) )
{
return descricao;
}
return null;
}
public void setField( String fieldName, Object value )
{
if( fieldName == AvisoData.ID )
{
id = ( Integer ) value;
}
else if( fieldName == AvisoData.TIPO )
{
tipo = ( Integer ) value;
}
else if( fieldName == AvisoData.EMPRESA )
{
empresa = ( Empresa ) value;
}
else if( fieldName == AvisoData.ESTABELECIMENTO )
{
estabelecimento = ( Estabelecimento ) value;
}
else if( fieldName == AvisoData.TRABALHADOR )
{
trabalhador = ( Trabalhador ) value;
}
else if( fieldName == AvisoData.EVENTO_ID )
{
evento_id = ( Integer ) value;
}
else if( fieldName == AvisoData.DATA_AVISO )
{
data_aviso = ( Date ) value;
}
else if( fieldName == AvisoData.DATA_EVENTO )
{
data_evento = ( Date ) value;
}
else if( fieldName == AvisoData.DESCRICAO )
{
descricao = ( String ) value;
}
else if( fieldName.equals( AvisoData.ID ) )
{
id = ( Integer ) value;
}
else if( fieldName.equals( AvisoData.TIPO ) )
{
tipo = ( Integer ) value;
}
else if( fieldName.equals( AvisoData.EMPRESA ) )
{
empresa = ( Empresa ) value;
}
else if( fieldName.equals( AvisoData.ESTABELECIMENTO ) )
{
estabelecimento = ( Estabelecimento ) value;
}
else if( fieldName.equals( AvisoData.TRABALHADOR ) )
{
trabalhador = ( Trabalhador ) value;
}
else if( fieldName.equals( AvisoData.EVENTO_ID ) )
{
evento_id = ( Integer ) value;
}
else if( fieldName.equals( AvisoData.DATA_AVISO ) )
{
data_aviso = ( Date ) value;
}
else if( fieldName.equals( AvisoData.DATA_EVENTO ) )
{
data_evento = ( Date ) value;
}
else if( fieldName.equals( AvisoData.DESCRICAO ) )
{
descricao = ( String ) value;
}
}
public Class getOuterClass()
{
return AvisoData.class;
}
}

@ -1,69 +0,0 @@
/*
* AvisoData.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on 13/Out/2004
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.util.HashMap;
import com.evolute.utils.jdo.JDOObject;
public final class AvisoData extends JDOObject
implements AvisoConstants
{
public static final String ID = "id";
public static final String TIPO = "tipo";
public static final String EMPRESA = "empresa";
public static final String ESTABELECIMENTO = "estabelecimento";
public static final String TRABALHADOR = "trabalhador";
public static final String EVENTO_ID = "evento_id";
public static final String DATA_AVISO = "data_aviso";
public static final String DATA_EVENTO = "data_evento";
public static final String DESCRICAO = "descricao";
public static final String FIELD_NAMES[] = new String[]{
TIPO, EMPRESA, ESTABELECIMENTO, TRABALHADOR, EVENTO_ID, DATA_AVISO, DATA_EVENTO,
DESCRICAO, };
protected static final String ALL_FIELD_NAMES[] = new String[]{
ID, TIPO, EMPRESA, ESTABELECIMENTO, TRABALHADOR, EVENTO_ID, DATA_AVISO, DATA_EVENTO,
DESCRICAO, };
private HashMap dataHash;
public AvisoData()
{
dataHash = new HashMap();
}
protected Object innerGet( String fieldName )
throws Exception
{
return dataHash.get( fieldName );
}
protected void innerSet( String fieldName, Object value )
throws Exception
{
dataHash.put( fieldName, value );
}
public String []getFieldNames()
{
return FIELD_NAMES;
}
protected String []getAllFieldNames()
{
return ALL_FIELD_NAMES;
}
public Class getInnerClass()
{
return Aviso.class;
}
}

@ -1,22 +0,0 @@
/*
* AvisoID.java
*
* Generated by com.evolute.codegen.jdo.idclassgenerators.JPOXIDClassGenerator on 13/Out/2004
*
* Use but DON'T TOUCH
*/
package siprp.data;
import com.evolute.utils.jdo.jpox.IntegerID;
public final class AvisoID extends IntegerID
{
public AvisoID()
{
}
public AvisoID( String str )
{
super( str );
}
}

@ -0,0 +1,45 @@
package siprp.data;
import java.text.DateFormat;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import siprp.database.cayenne.providers.MainDAO;
import com.evolute.entity.evo.EvoDataException;
import com.evolute.entity.evo.EvoDataObject;
import com.evolute.utils.strings.UnicodeChecker;
public abstract class BaseObject extends EvoDataObject
{
static
{
UnicodeChecker.setUseDoubleSlash( true );
}
private static final long serialVersionUID = 1L;
protected static MainDAO dao = new MainDAO();
public static final DateFormat DATE_FORMAT = DateFormat.getDateInstance( DateFormat.SHORT, new Locale( "pt", "PT" ) );
protected static final String isNewMessage = " ";
@Override
protected List fromReference(Class clazz, Integer id, String referingProperty, String... order) throws EvoDataException
{
List result = new LinkedList();
for( Object o : super.fromReference(clazz, id, referingProperty, order) )
{
Object value = ((EvoDataObject)o).get("deleted_date");
if( value == null )
{
result.add( o );
}
}
return result;
}
}

@ -1,151 +0,0 @@
/*
* Contacto.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on 13/Out/2004
*
* Use but DON'T TOUCH
*/
package siprp.data;
import com.evolute.utils.jdo.JDOInnerObject;
public final class Contacto implements JDOInnerObject
{
private Integer id;
private String nome;
private String cargo;
private String telefone;
private String telemovel;
private String fax;
private String email;
public Contacto()
{
}
public Object getField( String fieldName )
{
if( fieldName == ContactoData.ID )
{
return id;
}
else if( fieldName == ContactoData.NOME )
{
return nome;
}
else if( fieldName == ContactoData.CARGO )
{
return cargo;
}
else if( fieldName == ContactoData.TELEFONE )
{
return telefone;
}
else if( fieldName == ContactoData.TELEMOVEL )
{
return telemovel;
}
else if( fieldName == ContactoData.FAX )
{
return fax;
}
else if( fieldName == ContactoData.EMAIL )
{
return email;
}
else if( fieldName.equals( ContactoData.ID ) )
{
return id;
}
else if( fieldName.equals( ContactoData.NOME ) )
{
return nome;
}
else if( fieldName.equals( ContactoData.CARGO ) )
{
return cargo;
}
else if( fieldName.equals( ContactoData.TELEFONE ) )
{
return telefone;
}
else if( fieldName.equals( ContactoData.TELEMOVEL ) )
{
return telemovel;
}
else if( fieldName.equals( ContactoData.FAX ) )
{
return fax;
}
else if( fieldName.equals( ContactoData.EMAIL ) )
{
return email;
}
return null;
}
public void setField( String fieldName, Object value )
{
if( fieldName == ContactoData.ID )
{
id = ( Integer ) value;
}
else if( fieldName == ContactoData.NOME )
{
nome = ( String ) value;
}
else if( fieldName == ContactoData.CARGO )
{
cargo = ( String ) value;
}
else if( fieldName == ContactoData.TELEFONE )
{
telefone = ( String ) value;
}
else if( fieldName == ContactoData.TELEMOVEL )
{
telemovel = ( String ) value;
}
else if( fieldName == ContactoData.FAX )
{
fax = ( String ) value;
}
else if( fieldName == ContactoData.EMAIL )
{
email = ( String ) value;
}
else if( fieldName.equals( ContactoData.ID ) )
{
id = ( Integer ) value;
}
else if( fieldName.equals( ContactoData.NOME ) )
{
nome = ( String ) value;
}
else if( fieldName.equals( ContactoData.CARGO ) )
{
cargo = ( String ) value;
}
else if( fieldName.equals( ContactoData.TELEFONE ) )
{
telefone = ( String ) value;
}
else if( fieldName.equals( ContactoData.TELEMOVEL ) )
{
telemovel = ( String ) value;
}
else if( fieldName.equals( ContactoData.FAX ) )
{
fax = ( String ) value;
}
else if( fieldName.equals( ContactoData.EMAIL ) )
{
email = ( String ) value;
}
}
public Class getOuterClass()
{
return ContactoData.class;
}
}

@ -1,64 +0,0 @@
/*
* ContactoData.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on 13/Out/2004
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.util.HashMap;
import com.evolute.utils.jdo.JDOObject;
public final class ContactoData extends JDOObject
{
public static final String ID = "id";
public static final String NOME = "nome";
public static final String CARGO = "cargo";
public static final String TELEFONE = "telefone";
public static final String TELEMOVEL = "telemovel";
public static final String FAX = "fax";
public static final String EMAIL = "email";
public static final String FIELD_NAMES[] = new String[]{
NOME, CARGO, TELEFONE, TELEMOVEL, FAX, EMAIL, };
protected static final String ALL_FIELD_NAMES[] = new String[]{
ID, NOME, CARGO, TELEFONE, TELEMOVEL, FAX, EMAIL, };
private HashMap dataHash;
public ContactoData()
{
dataHash = new HashMap();
}
protected Object innerGet( String fieldName )
throws Exception
{
return dataHash.get( fieldName );
}
protected void innerSet( String fieldName, Object value )
throws Exception
{
dataHash.put( fieldName, value );
}
public String []getFieldNames()
{
return FIELD_NAMES;
}
protected String []getAllFieldNames()
{
return ALL_FIELD_NAMES;
}
public Class getInnerClass()
{
return Contacto.class;
}
}

@ -1,22 +0,0 @@
/*
* ContactoID.java
*
* Generated by com.evolute.codegen.jdo.idclassgenerators.JPOXIDClassGenerator on 13/Out/2004
*
* Use but DON'T TOUCH
*/
package siprp.data;
import com.evolute.utils.jdo.jpox.IntegerID;
public final class ContactoID extends IntegerID
{
public ContactoID()
{
}
public ContactoID( String str )
{
super( str );
}
}

@ -1,71 +0,0 @@
/*
* DeleteHandler.java
*
* Created on 11 de Outubro de 2004, 16:04
*/
package siprp.data;
import com.evolute.utils.jdo.JDOObject;
import com.evolute.utils.jdo.JDOOperationHandlerInterface;
/**
*
* @author fpalma
*/
public class DisableDeleteHandler implements JDOOperationHandlerInterface
{
public static final DisableDeleteHandler INSTANCE = new DisableDeleteHandler();
/** Creates a new instance of DeleteHandler */
public DisableDeleteHandler()
{
}
public boolean handle( JDOObject object, int operation, int moment )
throws Exception
{
if( !( object instanceof DisableDeleteable ) )
{
return false;
}
switch( operation )
{
case OP_SAVE:
return save( object, moment );
case OP_DELETE:
return delete( object, moment );
}
return false;
}
protected boolean save( JDOObject object, int moment )
throws Exception
{
if( moment != MOMENT_BEFORE )
{
return false;
}
String old = (String) object.get( DisableDeleteable.INACTIVO );
if( old == null )
{
object.set( DisableDeleteable.INACTIVO, "n" );
}
return true;
}
protected boolean delete( JDOObject object, int moment )
throws Exception
{
if( moment != MOMENT_INSTEAD )
{
return false;
}
object.set( DisableDeleteable.INACTIVO, "y" );
object.save();
return true;
}
}

@ -1,16 +0,0 @@
/*
* DisableDeleteable.java
*
* Created on 11 de Outubro de 2004, 16:09
*/
package siprp.data;
/**
*
* @author fpalma
*/
public interface DisableDeleteable
{
public static final String INACTIVO = "inactivo";
}

@ -1,748 +0,0 @@
/*
* Empresa.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on 17/Mai/2006
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.util.Date;
import com.evolute.utils.jdo.JDOInnerObject;
public final class Empresa implements JDOInnerObject
{
private Integer id;
private String designacao_social;
private String designacao_social_plain;
private Integer servico_saude_tipo;
private String servico_saude_designacao;
private Integer servico_higiene_tipo;
private String servico_higiene_designacao;
private String morada;
private String codigo_postal;
private String localidade;
private String distrito;
private String concelho;
private Date data_proposta;
private Date data_aceitacao;
private Date inicio_contrato;
private Integer duracao;
private Date data_cancelamento;
private String perfil_1;
private String perfil_2;
private Date data_envio_contrato;
private Date data_recepcao_contrato;
private Date data_envio_idict;
private Date data_relatorio_anual;
private String codigo_1;
private String codigo_2;
private String codigo_3;
private String cae;
private String actividade;
private String contribuinte;
private String seguranca_social;
private Double preco_higiene;
private Double preco_medicina;
private String periodicidade;
private Contacto contacto_1;
private Contacto contacto_2;
private Integer servicos;
private String inactivo;
private Date actualizacao;
private String a_consultas;
private String a_exames;
private String b_consultas;
private String b_exames;
public Empresa()
{
}
public Object getField( String fieldName )
{
if( fieldName == EmpresaData.ID )
{
return id;
}
else if( fieldName == EmpresaData.DESIGNACAO_SOCIAL )
{
return designacao_social;
}
else if( fieldName == EmpresaData.DESIGNACAO_SOCIAL_PLAIN )
{
return designacao_social_plain;
}
else if( fieldName == EmpresaData.SERVICO_SAUDE_TIPO )
{
return servico_saude_tipo;
}
else if( fieldName == EmpresaData.SERVICO_SAUDE_DESIGNACAO )
{
return servico_saude_designacao;
}
else if( fieldName == EmpresaData.SERVICO_HIGIENE_TIPO )
{
return servico_higiene_tipo;
}
else if( fieldName == EmpresaData.SERVICO_HIGIENE_DESIGNACAO )
{
return servico_higiene_designacao;
}
else if( fieldName == EmpresaData.MORADA )
{
return morada;
}
else if( fieldName == EmpresaData.CODIGO_POSTAL )
{
return codigo_postal;
}
else if( fieldName == EmpresaData.LOCALIDADE )
{
return localidade;
}
else if( fieldName == EmpresaData.DISTRITO )
{
return distrito;
}
else if( fieldName == EmpresaData.CONCELHO )
{
return concelho;
}
else if( fieldName == EmpresaData.DATA_PROPOSTA )
{
return data_proposta;
}
else if( fieldName == EmpresaData.DATA_ACEITACAO )
{
return data_aceitacao;
}
else if( fieldName == EmpresaData.INICIO_CONTRATO )
{
return inicio_contrato;
}
else if( fieldName == EmpresaData.DURACAO )
{
return duracao;
}
else if( fieldName == EmpresaData.DATA_CANCELAMENTO )
{
return data_cancelamento;
}
else if( fieldName == EmpresaData.PERFIL_1 )
{
return perfil_1;
}
else if( fieldName == EmpresaData.PERFIL_2 )
{
return perfil_2;
}
else if( fieldName == EmpresaData.DATA_ENVIO_CONTRATO )
{
return data_envio_contrato;
}
else if( fieldName == EmpresaData.DATA_RECEPCAO_CONTRATO )
{
return data_recepcao_contrato;
}
else if( fieldName == EmpresaData.DATA_ENVIO_IDICT )
{
return data_envio_idict;
}
else if( fieldName == EmpresaData.DATA_RELATORIO_ANUAL )
{
return data_relatorio_anual;
}
else if( fieldName == EmpresaData.CODIGO_1 )
{
return codigo_1;
}
else if( fieldName == EmpresaData.CODIGO_2 )
{
return codigo_2;
}
else if( fieldName == EmpresaData.CODIGO_3 )
{
return codigo_3;
}
else if( fieldName == EmpresaData.CAE )
{
return cae;
}
else if( fieldName == EmpresaData.ACTIVIDADE )
{
return actividade;
}
else if( fieldName == EmpresaData.CONTRIBUINTE )
{
return contribuinte;
}
else if( fieldName == EmpresaData.SEGURANCA_SOCIAL )
{
return seguranca_social;
}
else if( fieldName == EmpresaData.PRECO_HIGIENE )
{
return preco_higiene;
}
else if( fieldName == EmpresaData.PRECO_MEDICINA )
{
return preco_medicina;
}
else if( fieldName == EmpresaData.PERIODICIDADE )
{
return periodicidade;
}
else if( fieldName == EmpresaData.CONTACTO_1 )
{
return contacto_1;
}
else if( fieldName == EmpresaData.CONTACTO_2 )
{
return contacto_2;
}
else if( fieldName == EmpresaData.SERVICOS )
{
return servicos;
}
else if( fieldName == EmpresaData.INACTIVO )
{
return inactivo;
}
else if( fieldName == EmpresaData.ACTUALIZACAO )
{
return actualizacao;
}
else if( fieldName == EmpresaData.A_CONSULTAS )
{
return a_consultas;
}
else if( fieldName == EmpresaData.A_EXAMES )
{
return a_exames;
}
else if( fieldName == EmpresaData.B_CONSULTAS )
{
return b_consultas;
}
else if( fieldName == EmpresaData.B_EXAMES )
{
return b_exames;
}
else if( fieldName.equals( EmpresaData.ID ) )
{
return id;
}
else if( fieldName.equals( EmpresaData.DESIGNACAO_SOCIAL ) )
{
return designacao_social;
}
else if( fieldName.equals( EmpresaData.DESIGNACAO_SOCIAL_PLAIN ) )
{
return designacao_social_plain;
}
else if( fieldName.equals( EmpresaData.SERVICO_SAUDE_TIPO ) )
{
return servico_saude_tipo;
}
else if( fieldName.equals( EmpresaData.SERVICO_SAUDE_DESIGNACAO ) )
{
return servico_saude_designacao;
}
else if( fieldName.equals( EmpresaData.SERVICO_HIGIENE_TIPO ) )
{
return servico_higiene_tipo;
}
else if( fieldName.equals( EmpresaData.SERVICO_HIGIENE_DESIGNACAO ) )
{
return servico_higiene_designacao;
}
else if( fieldName.equals( EmpresaData.MORADA ) )
{
return morada;
}
else if( fieldName.equals( EmpresaData.CODIGO_POSTAL ) )
{
return codigo_postal;
}
else if( fieldName.equals( EmpresaData.LOCALIDADE ) )
{
return localidade;
}
else if( fieldName.equals( EmpresaData.DISTRITO ) )
{
return distrito;
}
else if( fieldName.equals( EmpresaData.CONCELHO ) )
{
return concelho;
}
else if( fieldName.equals( EmpresaData.DATA_PROPOSTA ) )
{
return data_proposta;
}
else if( fieldName.equals( EmpresaData.DATA_ACEITACAO ) )
{
return data_aceitacao;
}
else if( fieldName.equals( EmpresaData.INICIO_CONTRATO ) )
{
return inicio_contrato;
}
else if( fieldName.equals( EmpresaData.DURACAO ) )
{
return duracao;
}
else if( fieldName.equals( EmpresaData.DATA_CANCELAMENTO ) )
{
return data_cancelamento;
}
else if( fieldName.equals( EmpresaData.PERFIL_1 ) )
{
return perfil_1;
}
else if( fieldName.equals( EmpresaData.PERFIL_2 ) )
{
return perfil_2;
}
else if( fieldName.equals( EmpresaData.DATA_ENVIO_CONTRATO ) )
{
return data_envio_contrato;
}
else if( fieldName.equals( EmpresaData.DATA_RECEPCAO_CONTRATO ) )
{
return data_recepcao_contrato;
}
else if( fieldName.equals( EmpresaData.DATA_ENVIO_IDICT ) )
{
return data_envio_idict;
}
else if( fieldName.equals( EmpresaData.DATA_RELATORIO_ANUAL ) )
{
return data_relatorio_anual;
}
else if( fieldName.equals( EmpresaData.CODIGO_1 ) )
{
return codigo_1;
}
else if( fieldName.equals( EmpresaData.CODIGO_2 ) )
{
return codigo_2;
}
else if( fieldName.equals( EmpresaData.CODIGO_3 ) )
{
return codigo_3;
}
else if( fieldName.equals( EmpresaData.CAE ) )
{
return cae;
}
else if( fieldName.equals( EmpresaData.ACTIVIDADE ) )
{
return actividade;
}
else if( fieldName.equals( EmpresaData.CONTRIBUINTE ) )
{
return contribuinte;
}
else if( fieldName.equals( EmpresaData.SEGURANCA_SOCIAL ) )
{
return seguranca_social;
}
else if( fieldName.equals( EmpresaData.PRECO_HIGIENE ) )
{
return preco_higiene;
}
else if( fieldName.equals( EmpresaData.PRECO_MEDICINA ) )
{
return preco_medicina;
}
else if( fieldName.equals( EmpresaData.PERIODICIDADE ) )
{
return periodicidade;
}
else if( fieldName.equals( EmpresaData.CONTACTO_1 ) )
{
return contacto_1;
}
else if( fieldName.equals( EmpresaData.CONTACTO_2 ) )
{
return contacto_2;
}
else if( fieldName.equals( EmpresaData.SERVICOS ) )
{
return servicos;
}
else if( fieldName.equals( EmpresaData.INACTIVO ) )
{
return inactivo;
}
else if( fieldName.equals( EmpresaData.ACTUALIZACAO ) )
{
return actualizacao;
}
else if( fieldName.equals( EmpresaData.A_CONSULTAS ) )
{
return a_consultas;
}
else if( fieldName.equals( EmpresaData.A_EXAMES ) )
{
return a_exames;
}
else if( fieldName.equals( EmpresaData.B_CONSULTAS ) )
{
return b_consultas;
}
else if( fieldName.equals( EmpresaData.B_EXAMES ) )
{
return b_exames;
}
return null;
}
public void setField( String fieldName, Object value )
{
if( fieldName == EmpresaData.ID )
{
id = ( Integer ) value;
}
else if( fieldName == EmpresaData.DESIGNACAO_SOCIAL )
{
designacao_social = ( String ) value;
}
else if( fieldName == EmpresaData.DESIGNACAO_SOCIAL_PLAIN )
{
designacao_social_plain = ( String ) value;
}
else if( fieldName == EmpresaData.SERVICO_SAUDE_TIPO )
{
servico_saude_tipo = ( Integer ) value;
}
else if( fieldName == EmpresaData.SERVICO_SAUDE_DESIGNACAO )
{
servico_saude_designacao = ( String ) value;
}
else if( fieldName == EmpresaData.SERVICO_HIGIENE_TIPO )
{
servico_higiene_tipo = ( Integer ) value;
}
else if( fieldName == EmpresaData.SERVICO_HIGIENE_DESIGNACAO )
{
servico_higiene_designacao = ( String ) value;
}
else if( fieldName == EmpresaData.MORADA )
{
morada = ( String ) value;
}
else if( fieldName == EmpresaData.CODIGO_POSTAL )
{
codigo_postal = ( String ) value;
}
else if( fieldName == EmpresaData.LOCALIDADE )
{
localidade = ( String ) value;
}
else if( fieldName == EmpresaData.DISTRITO )
{
distrito = ( String ) value;
}
else if( fieldName == EmpresaData.CONCELHO )
{
concelho = ( String ) value;
}
else if( fieldName == EmpresaData.DATA_PROPOSTA )
{
data_proposta = ( Date ) value;
}
else if( fieldName == EmpresaData.DATA_ACEITACAO )
{
data_aceitacao = ( Date ) value;
}
else if( fieldName == EmpresaData.INICIO_CONTRATO )
{
inicio_contrato = ( Date ) value;
}
else if( fieldName == EmpresaData.DURACAO )
{
duracao = ( Integer ) value;
}
else if( fieldName == EmpresaData.DATA_CANCELAMENTO )
{
data_cancelamento = ( Date ) value;
}
else if( fieldName == EmpresaData.PERFIL_1 )
{
perfil_1 = ( String ) value;
}
else if( fieldName == EmpresaData.PERFIL_2 )
{
perfil_2 = ( String ) value;
}
else if( fieldName == EmpresaData.DATA_ENVIO_CONTRATO )
{
data_envio_contrato = ( Date ) value;
}
else if( fieldName == EmpresaData.DATA_RECEPCAO_CONTRATO )
{
data_recepcao_contrato = ( Date ) value;
}
else if( fieldName == EmpresaData.DATA_ENVIO_IDICT )
{
data_envio_idict = ( Date ) value;
}
else if( fieldName == EmpresaData.DATA_RELATORIO_ANUAL )
{
data_relatorio_anual = ( Date ) value;
}
else if( fieldName == EmpresaData.CODIGO_1 )
{
codigo_1 = ( String ) value;
}
else if( fieldName == EmpresaData.CODIGO_2 )
{
codigo_2 = ( String ) value;
}
else if( fieldName == EmpresaData.CODIGO_3 )
{
codigo_3 = ( String ) value;
}
else if( fieldName == EmpresaData.CAE )
{
cae = ( String ) value;
}
else if( fieldName == EmpresaData.ACTIVIDADE )
{
actividade = ( String ) value;
}
else if( fieldName == EmpresaData.CONTRIBUINTE )
{
contribuinte = ( String ) value;
}
else if( fieldName == EmpresaData.SEGURANCA_SOCIAL )
{
seguranca_social = ( String ) value;
}
else if( fieldName == EmpresaData.PRECO_HIGIENE )
{
preco_higiene = ( Double ) value;
}
else if( fieldName == EmpresaData.PRECO_MEDICINA )
{
preco_medicina = ( Double ) value;
}
else if( fieldName == EmpresaData.PERIODICIDADE )
{
periodicidade = ( String ) value;
}
else if( fieldName == EmpresaData.CONTACTO_1 )
{
contacto_1 = ( Contacto ) value;
}
else if( fieldName == EmpresaData.CONTACTO_2 )
{
contacto_2 = ( Contacto ) value;
}
else if( fieldName == EmpresaData.SERVICOS )
{
servicos = ( Integer ) value;
}
else if( fieldName == EmpresaData.INACTIVO )
{
inactivo = ( String ) value;
}
else if( fieldName == EmpresaData.ACTUALIZACAO )
{
actualizacao = ( Date ) value;
}
else if( fieldName == EmpresaData.A_CONSULTAS )
{
a_consultas = ( String ) value;
}
else if( fieldName == EmpresaData.A_EXAMES )
{
a_exames = ( String ) value;
}
else if( fieldName == EmpresaData.B_CONSULTAS )
{
b_consultas = ( String ) value;
}
else if( fieldName == EmpresaData.B_EXAMES )
{
b_exames = ( String ) value;
}
else if( fieldName.equals( EmpresaData.ID ) )
{
id = ( Integer ) value;
}
else if( fieldName.equals( EmpresaData.DESIGNACAO_SOCIAL ) )
{
designacao_social = ( String ) value;
}
else if( fieldName.equals( EmpresaData.DESIGNACAO_SOCIAL_PLAIN ) )
{
designacao_social_plain = ( String ) value;
}
else if( fieldName.equals( EmpresaData.SERVICO_SAUDE_TIPO ) )
{
servico_saude_tipo = ( Integer ) value;
}
else if( fieldName.equals( EmpresaData.SERVICO_SAUDE_DESIGNACAO ) )
{
servico_saude_designacao = ( String ) value;
}
else if( fieldName.equals( EmpresaData.SERVICO_HIGIENE_TIPO ) )
{
servico_higiene_tipo = ( Integer ) value;
}
else if( fieldName.equals( EmpresaData.SERVICO_HIGIENE_DESIGNACAO ) )
{
servico_higiene_designacao = ( String ) value;
}
else if( fieldName.equals( EmpresaData.MORADA ) )
{
morada = ( String ) value;
}
else if( fieldName.equals( EmpresaData.CODIGO_POSTAL ) )
{
codigo_postal = ( String ) value;
}
else if( fieldName.equals( EmpresaData.LOCALIDADE ) )
{
localidade = ( String ) value;
}
else if( fieldName.equals( EmpresaData.DISTRITO ) )
{
distrito = ( String ) value;
}
else if( fieldName.equals( EmpresaData.CONCELHO ) )
{
concelho = ( String ) value;
}
else if( fieldName.equals( EmpresaData.DATA_PROPOSTA ) )
{
data_proposta = ( Date ) value;
}
else if( fieldName.equals( EmpresaData.DATA_ACEITACAO ) )
{
data_aceitacao = ( Date ) value;
}
else if( fieldName.equals( EmpresaData.INICIO_CONTRATO ) )
{
inicio_contrato = ( Date ) value;
}
else if( fieldName.equals( EmpresaData.DURACAO ) )
{
duracao = ( Integer ) value;
}
else if( fieldName.equals( EmpresaData.DATA_CANCELAMENTO ) )
{
data_cancelamento = ( Date ) value;
}
else if( fieldName.equals( EmpresaData.PERFIL_1 ) )
{
perfil_1 = ( String ) value;
}
else if( fieldName.equals( EmpresaData.PERFIL_2 ) )
{
perfil_2 = ( String ) value;
}
else if( fieldName.equals( EmpresaData.DATA_ENVIO_CONTRATO ) )
{
data_envio_contrato = ( Date ) value;
}
else if( fieldName.equals( EmpresaData.DATA_RECEPCAO_CONTRATO ) )
{
data_recepcao_contrato = ( Date ) value;
}
else if( fieldName.equals( EmpresaData.DATA_ENVIO_IDICT ) )
{
data_envio_idict = ( Date ) value;
}
else if( fieldName.equals( EmpresaData.DATA_RELATORIO_ANUAL ) )
{
data_relatorio_anual = ( Date ) value;
}
else if( fieldName.equals( EmpresaData.CODIGO_1 ) )
{
codigo_1 = ( String ) value;
}
else if( fieldName.equals( EmpresaData.CODIGO_2 ) )
{
codigo_2 = ( String ) value;
}
else if( fieldName.equals( EmpresaData.CODIGO_3 ) )
{
codigo_3 = ( String ) value;
}
else if( fieldName.equals( EmpresaData.CAE ) )
{
cae = ( String ) value;
}
else if( fieldName.equals( EmpresaData.ACTIVIDADE ) )
{
actividade = ( String ) value;
}
else if( fieldName.equals( EmpresaData.CONTRIBUINTE ) )
{
contribuinte = ( String ) value;
}
else if( fieldName.equals( EmpresaData.SEGURANCA_SOCIAL ) )
{
seguranca_social = ( String ) value;
}
else if( fieldName.equals( EmpresaData.PRECO_HIGIENE ) )
{
preco_higiene = ( Double ) value;
}
else if( fieldName.equals( EmpresaData.PRECO_MEDICINA ) )
{
preco_medicina = ( Double ) value;
}
else if( fieldName.equals( EmpresaData.PERIODICIDADE ) )
{
periodicidade = ( String ) value;
}
else if( fieldName.equals( EmpresaData.CONTACTO_1 ) )
{
contacto_1 = ( Contacto ) value;
}
else if( fieldName.equals( EmpresaData.CONTACTO_2 ) )
{
contacto_2 = ( Contacto ) value;
}
else if( fieldName.equals( EmpresaData.SERVICOS ) )
{
servicos = ( Integer ) value;
}
else if( fieldName.equals( EmpresaData.INACTIVO ) )
{
inactivo = ( String ) value;
}
else if( fieldName.equals( EmpresaData.ACTUALIZACAO ) )
{
actualizacao = ( Date ) value;
}
else if( fieldName.equals( EmpresaData.A_CONSULTAS ) )
{
a_consultas = ( String ) value;
}
else if( fieldName.equals( EmpresaData.A_EXAMES ) )
{
a_exames = ( String ) value;
}
else if( fieldName.equals( EmpresaData.B_CONSULTAS ) )
{
b_consultas = ( String ) value;
}
else if( fieldName.equals( EmpresaData.B_EXAMES ) )
{
b_exames = ( String ) value;
}
}
public Class getOuterClass()
{
return EmpresaData.class;
}
}

@ -1,115 +0,0 @@
/*
* EmpresaData.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on 17/Mai/2006
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.util.HashMap;
import com.evolute.utils.jdo.JDOObject;
public final class EmpresaData extends JDOObject
implements DisableDeleteable, ActualizacaoSaveable
{
public static final String ID = "id";
public static final String DESIGNACAO_SOCIAL = "designacao_social";
public static final String DESIGNACAO_SOCIAL_PLAIN = "designacao_social_plain";
public static final String SERVICO_SAUDE_TIPO = "servico_saude_tipo";
public static final String SERVICO_SAUDE_DESIGNACAO = "servico_saude_designacao";
public static final String SERVICO_HIGIENE_TIPO = "servico_higiene_tipo";
public static final String SERVICO_HIGIENE_DESIGNACAO = "servico_higiene_designacao";
public static final String MORADA = "morada";
public static final String CODIGO_POSTAL = "codigo_postal";
public static final String LOCALIDADE = "localidade";
public static final String DISTRITO = "distrito";
public static final String CONCELHO = "concelho";
public static final String DATA_PROPOSTA = "data_proposta";
public static final String DATA_ACEITACAO = "data_aceitacao";
public static final String INICIO_CONTRATO = "inicio_contrato";
public static final String DURACAO = "duracao";
public static final String DATA_CANCELAMENTO = "data_cancelamento";
public static final String PERFIL_1 = "perfil_1";
public static final String PERFIL_2 = "perfil_2";
public static final String DATA_ENVIO_CONTRATO = "data_envio_contrato";
public static final String DATA_RECEPCAO_CONTRATO = "data_recepcao_contrato";
public static final String DATA_ENVIO_IDICT = "data_envio_idict";
public static final String DATA_RELATORIO_ANUAL = "data_relatorio_anual";
public static final String CODIGO_1 = "codigo_1";
public static final String CODIGO_2 = "codigo_2";
public static final String CODIGO_3 = "codigo_3";
public static final String CAE = "cae";
public static final String ACTIVIDADE = "actividade";
public static final String CONTRIBUINTE = "contribuinte";
public static final String SEGURANCA_SOCIAL = "seguranca_social";
public static final String PRECO_HIGIENE = "preco_higiene";
public static final String PRECO_MEDICINA = "preco_medicina";
public static final String PERIODICIDADE = "periodicidade";
public static final String CONTACTO_1 = "contacto_1";
public static final String CONTACTO_2 = "contacto_2";
public static final String SERVICOS = "servicos";
public static final String INACTIVO = "inactivo";
public static final String ACTUALIZACAO = "actualizacao";
public static final String A_CONSULTAS = "a_consultas";
public static final String A_EXAMES = "a_exames";
public static final String B_CONSULTAS = "b_consultas";
public static final String B_EXAMES = "b_exames";
public static final String FIELD_NAMES[] = new String[]{
DESIGNACAO_SOCIAL, DESIGNACAO_SOCIAL_PLAIN, SERVICO_SAUDE_TIPO,
SERVICO_SAUDE_DESIGNACAO, SERVICO_HIGIENE_TIPO, SERVICO_HIGIENE_DESIGNACAO,
MORADA, CODIGO_POSTAL, LOCALIDADE, DISTRITO, CONCELHO, DATA_PROPOSTA,
DATA_ACEITACAO, INICIO_CONTRATO, DURACAO, DATA_CANCELAMENTO, PERFIL_1, PERFIL_2,
DATA_ENVIO_CONTRATO, DATA_RECEPCAO_CONTRATO, DATA_ENVIO_IDICT,
DATA_RELATORIO_ANUAL, CODIGO_1, CODIGO_2, CODIGO_3, CAE, ACTIVIDADE, CONTRIBUINTE,
SEGURANCA_SOCIAL, PRECO_HIGIENE, PRECO_MEDICINA, PERIODICIDADE, CONTACTO_1,
CONTACTO_2, SERVICOS, A_CONSULTAS, A_EXAMES, B_CONSULTAS, B_EXAMES, };
protected static final String ALL_FIELD_NAMES[] = new String[]{
ID, DESIGNACAO_SOCIAL, DESIGNACAO_SOCIAL_PLAIN, SERVICO_SAUDE_TIPO,
SERVICO_SAUDE_DESIGNACAO, SERVICO_HIGIENE_TIPO, SERVICO_HIGIENE_DESIGNACAO,
MORADA, CODIGO_POSTAL, LOCALIDADE, DISTRITO, CONCELHO, DATA_PROPOSTA,
DATA_ACEITACAO, INICIO_CONTRATO, DURACAO, DATA_CANCELAMENTO, PERFIL_1, PERFIL_2,
DATA_ENVIO_CONTRATO, DATA_RECEPCAO_CONTRATO, DATA_ENVIO_IDICT,
DATA_RELATORIO_ANUAL, CODIGO_1, CODIGO_2, CODIGO_3, CAE, ACTIVIDADE, CONTRIBUINTE,
SEGURANCA_SOCIAL, PRECO_HIGIENE, PRECO_MEDICINA, PERIODICIDADE, CONTACTO_1,
CONTACTO_2, SERVICOS, INACTIVO, ACTUALIZACAO, A_CONSULTAS, A_EXAMES, B_CONSULTAS,
B_EXAMES, };
private HashMap dataHash;
public EmpresaData()
{
dataHash = new HashMap();
}
protected Object innerGet( String fieldName )
throws Exception
{
return dataHash.get( fieldName );
}
protected void innerSet( String fieldName, Object value )
throws Exception
{
dataHash.put( fieldName, value );
}
public String []getFieldNames()
{
return FIELD_NAMES;
}
protected String []getAllFieldNames()
{
return ALL_FIELD_NAMES;
}
public Class getInnerClass()
{
return Empresa.class;
}
}

@ -1,25 +0,0 @@
/*
* EmpresaID.java
*
* Generated by com.evolute.codegen.jdo.idclassgenerators.JPOXIDClassGenerator on 17/Mai/2006
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.io.Serializable;
import com.evolute.utils.jdo.jpox.IntegerID;
public final class EmpresaID extends IntegerID
implements Serializable
{
public EmpresaID()
{
}
public EmpresaID( String str )
{
super( str );
}
}

@ -1,255 +0,0 @@
/*
* Estabelecimento.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on 24/Nov/2005
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.util.Date;
import com.evolute.utils.jdo.JDOInnerObject;
public final class Estabelecimento implements JDOInnerObject
{
private Integer id;
private String nome;
private String nome_plain;
private String morada;
private String codigo_postal;
private String localidade;
private String historico;
private Empresa empresa;
private Contacto contacto;
private String inactivo;
private Date actualizacao;
private Integer prestador_consulta_id;
private Integer prestador_ecds_id;
public Estabelecimento()
{
}
public Object getField( String fieldName )
{
if( fieldName == EstabelecimentoData.ID )
{
return id;
}
else if( fieldName == EstabelecimentoData.NOME )
{
return nome;
}
else if( fieldName == EstabelecimentoData.NOME_PLAIN )
{
return nome_plain;
}
else if( fieldName == EstabelecimentoData.MORADA )
{
return morada;
}
else if( fieldName == EstabelecimentoData.CODIGO_POSTAL )
{
return codigo_postal;
}
else if( fieldName == EstabelecimentoData.LOCALIDADE )
{
return localidade;
}
else if( fieldName == EstabelecimentoData.HISTORICO )
{
return historico;
}
else if( fieldName == EstabelecimentoData.EMPRESA )
{
return empresa;
}
else if( fieldName == EstabelecimentoData.CONTACTO )
{
return contacto;
}
else if( fieldName == EstabelecimentoData.INACTIVO )
{
return inactivo;
}
else if( fieldName == EstabelecimentoData.ACTUALIZACAO )
{
return actualizacao;
}
else if( fieldName == EstabelecimentoData.PRESTADOR_CONSULTA_ID )
{
return prestador_consulta_id;
}
else if( fieldName == EstabelecimentoData.PRESTADOR_ECDS_ID )
{
return prestador_ecds_id;
}
else if( fieldName.equals( EstabelecimentoData.ID ) )
{
return id;
}
else if( fieldName.equals( EstabelecimentoData.NOME ) )
{
return nome;
}
else if( fieldName.equals( EstabelecimentoData.NOME_PLAIN ) )
{
return nome_plain;
}
else if( fieldName.equals( EstabelecimentoData.MORADA ) )
{
return morada;
}
else if( fieldName.equals( EstabelecimentoData.CODIGO_POSTAL ) )
{
return codigo_postal;
}
else if( fieldName.equals( EstabelecimentoData.LOCALIDADE ) )
{
return localidade;
}
else if( fieldName.equals( EstabelecimentoData.HISTORICO ) )
{
return historico;
}
else if( fieldName.equals( EstabelecimentoData.EMPRESA ) )
{
return empresa;
}
else if( fieldName.equals( EstabelecimentoData.CONTACTO ) )
{
return contacto;
}
else if( fieldName.equals( EstabelecimentoData.INACTIVO ) )
{
return inactivo;
}
else if( fieldName.equals( EstabelecimentoData.ACTUALIZACAO ) )
{
return actualizacao;
}
else if( fieldName.equals( EstabelecimentoData.PRESTADOR_CONSULTA_ID ) )
{
return prestador_consulta_id;
}
else if( fieldName.equals( EstabelecimentoData.PRESTADOR_ECDS_ID ) )
{
return prestador_ecds_id;
}
return null;
}
public void setField( String fieldName, Object value )
{
if( fieldName == EstabelecimentoData.ID )
{
id = ( Integer ) value;
}
else if( fieldName == EstabelecimentoData.NOME )
{
nome = ( String ) value;
}
else if( fieldName == EstabelecimentoData.NOME_PLAIN )
{
nome_plain = ( String ) value;
}
else if( fieldName == EstabelecimentoData.MORADA )
{
morada = ( String ) value;
}
else if( fieldName == EstabelecimentoData.CODIGO_POSTAL )
{
codigo_postal = ( String ) value;
}
else if( fieldName == EstabelecimentoData.LOCALIDADE )
{
localidade = ( String ) value;
}
else if( fieldName == EstabelecimentoData.HISTORICO )
{
historico = ( String ) value;
}
else if( fieldName == EstabelecimentoData.EMPRESA )
{
empresa = ( Empresa ) value;
}
else if( fieldName == EstabelecimentoData.CONTACTO )
{
contacto = ( Contacto ) value;
}
else if( fieldName == EstabelecimentoData.INACTIVO )
{
inactivo = ( String ) value;
}
else if( fieldName == EstabelecimentoData.ACTUALIZACAO )
{
actualizacao = ( Date ) value;
}
else if( fieldName == EstabelecimentoData.PRESTADOR_CONSULTA_ID )
{
prestador_consulta_id = ( Integer ) value;
}
else if( fieldName == EstabelecimentoData.PRESTADOR_ECDS_ID )
{
prestador_ecds_id = ( Integer ) value;
}
else if( fieldName.equals( EstabelecimentoData.ID ) )
{
id = ( Integer ) value;
}
else if( fieldName.equals( EstabelecimentoData.NOME ) )
{
nome = ( String ) value;
}
else if( fieldName.equals( EstabelecimentoData.NOME_PLAIN ) )
{
nome_plain = ( String ) value;
}
else if( fieldName.equals( EstabelecimentoData.MORADA ) )
{
morada = ( String ) value;
}
else if( fieldName.equals( EstabelecimentoData.CODIGO_POSTAL ) )
{
codigo_postal = ( String ) value;
}
else if( fieldName.equals( EstabelecimentoData.LOCALIDADE ) )
{
localidade = ( String ) value;
}
else if( fieldName.equals( EstabelecimentoData.HISTORICO ) )
{
historico = ( String ) value;
}
else if( fieldName.equals( EstabelecimentoData.EMPRESA ) )
{
empresa = ( Empresa ) value;
}
else if( fieldName.equals( EstabelecimentoData.CONTACTO ) )
{
contacto = ( Contacto ) value;
}
else if( fieldName.equals( EstabelecimentoData.INACTIVO ) )
{
inactivo = ( String ) value;
}
else if( fieldName.equals( EstabelecimentoData.ACTUALIZACAO ) )
{
actualizacao = ( Date ) value;
}
else if( fieldName.equals( EstabelecimentoData.PRESTADOR_CONSULTA_ID ) )
{
prestador_consulta_id = ( Integer ) value;
}
else if( fieldName.equals( EstabelecimentoData.PRESTADOR_ECDS_ID ) )
{
prestador_ecds_id = ( Integer ) value;
}
}
public Class getOuterClass()
{
return EstabelecimentoData.class;
}
}

@ -1,72 +0,0 @@
/*
* EstabelecimentoData.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on 24/Nov/2005
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.util.HashMap;
import com.evolute.utils.jdo.JDOObject;
public final class EstabelecimentoData extends JDOObject
implements DisableDeleteable, ActualizacaoSaveable
{
public static final String ID = "id";
public static final String NOME = "nome";
public static final String NOME_PLAIN = "nome_plain";
public static final String MORADA = "morada";
public static final String CODIGO_POSTAL = "codigo_postal";
public static final String LOCALIDADE = "localidade";
public static final String HISTORICO = "historico";
public static final String EMPRESA = "empresa";
public static final String CONTACTO = "contacto";
public static final String INACTIVO = "inactivo";
public static final String ACTUALIZACAO = "actualizacao";
public static final String PRESTADOR_CONSULTA_ID = "prestador_consulta_id";
public static final String PRESTADOR_ECDS_ID = "prestador_ecds_id";
public static final String FIELD_NAMES[] = new String[]{
NOME, NOME_PLAIN, MORADA, CODIGO_POSTAL, LOCALIDADE, HISTORICO, EMPRESA, CONTACTO, PRESTADOR_CONSULTA_ID, PRESTADOR_ECDS_ID };
protected static final String ALL_FIELD_NAMES[] = new String[]{
ID, NOME, NOME_PLAIN, MORADA, CODIGO_POSTAL, LOCALIDADE, HISTORICO, EMPRESA, CONTACTO,
PRESTADOR_CONSULTA_ID, PRESTADOR_ECDS_ID, INACTIVO, ACTUALIZACAO, };
private HashMap dataHash;
public EstabelecimentoData()
{
dataHash = new HashMap();
}
protected Object innerGet( String fieldName )
throws Exception
{
return dataHash.get( fieldName );
}
protected void innerSet( String fieldName, Object value )
throws Exception
{
dataHash.put( fieldName, value );
}
public String []getFieldNames()
{
return FIELD_NAMES;
}
protected String []getAllFieldNames()
{
return ALL_FIELD_NAMES;
}
public Class getInnerClass()
{
return Estabelecimento.class;
}
}

@ -1,25 +0,0 @@
/*
* EstabelecimentoID.java
*
* Generated by com.evolute.codegen.jdo.idclassgenerators.JPOXIDClassGenerator on 24/Nov/2005
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.io.Serializable;
import com.evolute.utils.jdo.jpox.IntegerID;
public final class EstabelecimentoID extends IntegerID
implements Serializable
{
public EstabelecimentoID()
{
}
public EstabelecimentoID( String str )
{
super( str );
}
}

@ -1,270 +0,0 @@
/*
* Etiqueta.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on 27/Fev/2006
*
* Use but DON'T TOUCH
*/
package siprp.data;
import com.evolute.utils.jdo.JDOInnerObject;
public final class Etiqueta implements JDOInnerObject
{
private Integer id;
private String descricao;
private String descricao_plain;
private Double altura;
private Double largura;
private Double margem_esquerda;
private Double margem_cima;
private Integer colunas;
private Integer linhas;
private String continua;
private Double altura_folha;
private Double largura_folha;
private Double margem_vertical_folha;
private Double margem_horizontal_folha;
public Etiqueta()
{
}
public Object getField( String fieldName )
{
if( fieldName == EtiquetaData.ID )
{
return id;
}
else if( fieldName == EtiquetaData.DESCRICAO )
{
return descricao;
}
else if( fieldName == EtiquetaData.DESCRICAO_PLAIN )
{
return descricao_plain;
}
else if( fieldName == EtiquetaData.ALTURA )
{
return altura;
}
else if( fieldName == EtiquetaData.LARGURA )
{
return largura;
}
else if( fieldName == EtiquetaData.MARGEM_ESQUERDA )
{
return margem_esquerda;
}
else if( fieldName == EtiquetaData.MARGEM_CIMA )
{
return margem_cima;
}
else if( fieldName == EtiquetaData.COLUNAS )
{
return colunas;
}
else if( fieldName == EtiquetaData.LINHAS )
{
return linhas;
}
else if( fieldName == EtiquetaData.CONTINUA )
{
return continua;
}
else if( fieldName == EtiquetaData.ALTURA_FOLHA )
{
return altura_folha;
}
else if( fieldName == EtiquetaData.LARGURA_FOLHA )
{
return largura_folha;
}
else if( fieldName == EtiquetaData.MARGEM_VERTICAL_FOLHA )
{
return margem_vertical_folha;
}
else if( fieldName == EtiquetaData.MARGEM_HORIZONTAL_FOLHA )
{
return margem_horizontal_folha;
}
else if( fieldName.equals( EtiquetaData.ID ) )
{
return id;
}
else if( fieldName.equals( EtiquetaData.DESCRICAO ) )
{
return descricao;
}
else if( fieldName.equals( EtiquetaData.DESCRICAO_PLAIN ) )
{
return descricao_plain;
}
else if( fieldName.equals( EtiquetaData.ALTURA ) )
{
return altura;
}
else if( fieldName.equals( EtiquetaData.LARGURA ) )
{
return largura;
}
else if( fieldName.equals( EtiquetaData.MARGEM_ESQUERDA ) )
{
return margem_esquerda;
}
else if( fieldName.equals( EtiquetaData.MARGEM_CIMA ) )
{
return margem_cima;
}
else if( fieldName.equals( EtiquetaData.COLUNAS ) )
{
return colunas;
}
else if( fieldName.equals( EtiquetaData.LINHAS ) )
{
return linhas;
}
else if( fieldName.equals( EtiquetaData.CONTINUA ) )
{
return continua;
}
else if( fieldName.equals( EtiquetaData.ALTURA_FOLHA ) )
{
return altura_folha;
}
else if( fieldName.equals( EtiquetaData.LARGURA_FOLHA ) )
{
return largura_folha;
}
else if( fieldName.equals( EtiquetaData.MARGEM_VERTICAL_FOLHA ) )
{
return margem_vertical_folha;
}
else if( fieldName.equals( EtiquetaData.MARGEM_HORIZONTAL_FOLHA ) )
{
return margem_horizontal_folha;
}
return null;
}
public void setField( String fieldName, Object value )
{
if( fieldName == EtiquetaData.ID )
{
id = ( Integer ) value;
}
else if( fieldName == EtiquetaData.DESCRICAO )
{
descricao = ( String ) value;
}
else if( fieldName == EtiquetaData.DESCRICAO_PLAIN )
{
descricao_plain = ( String ) value;
}
else if( fieldName == EtiquetaData.ALTURA )
{
altura = ( Double ) value;
}
else if( fieldName == EtiquetaData.LARGURA )
{
largura = ( Double ) value;
}
else if( fieldName == EtiquetaData.MARGEM_ESQUERDA )
{
margem_esquerda = ( Double ) value;
}
else if( fieldName == EtiquetaData.MARGEM_CIMA )
{
margem_cima = ( Double ) value;
}
else if( fieldName == EtiquetaData.COLUNAS )
{
colunas = ( Integer ) value;
}
else if( fieldName == EtiquetaData.LINHAS )
{
linhas = ( Integer ) value;
}
else if( fieldName == EtiquetaData.CONTINUA )
{
continua = ( String ) value;
}
else if( fieldName == EtiquetaData.ALTURA_FOLHA )
{
altura_folha = ( Double ) value;
}
else if( fieldName == EtiquetaData.LARGURA_FOLHA )
{
largura_folha = ( Double ) value;
}
else if( fieldName == EtiquetaData.MARGEM_VERTICAL_FOLHA )
{
margem_vertical_folha = ( Double ) value;
}
else if( fieldName == EtiquetaData.MARGEM_HORIZONTAL_FOLHA )
{
margem_horizontal_folha = ( Double ) value;
}
else if( fieldName.equals( EtiquetaData.ID ) )
{
id = ( Integer ) value;
}
else if( fieldName.equals( EtiquetaData.DESCRICAO ) )
{
descricao = ( String ) value;
}
else if( fieldName.equals( EtiquetaData.DESCRICAO_PLAIN ) )
{
descricao_plain = ( String ) value;
}
else if( fieldName.equals( EtiquetaData.ALTURA ) )
{
altura = ( Double ) value;
}
else if( fieldName.equals( EtiquetaData.LARGURA ) )
{
largura = ( Double ) value;
}
else if( fieldName.equals( EtiquetaData.MARGEM_ESQUERDA ) )
{
margem_esquerda = ( Double ) value;
}
else if( fieldName.equals( EtiquetaData.MARGEM_CIMA ) )
{
margem_cima = ( Double ) value;
}
else if( fieldName.equals( EtiquetaData.COLUNAS ) )
{
colunas = ( Integer ) value;
}
else if( fieldName.equals( EtiquetaData.LINHAS ) )
{
linhas = ( Integer ) value;
}
else if( fieldName.equals( EtiquetaData.CONTINUA ) )
{
continua = ( String ) value;
}
else if( fieldName.equals( EtiquetaData.ALTURA_FOLHA ) )
{
altura_folha = ( Double ) value;
}
else if( fieldName.equals( EtiquetaData.LARGURA_FOLHA ) )
{
largura_folha = ( Double ) value;
}
else if( fieldName.equals( EtiquetaData.MARGEM_VERTICAL_FOLHA ) )
{
margem_vertical_folha = ( Double ) value;
}
else if( fieldName.equals( EtiquetaData.MARGEM_HORIZONTAL_FOLHA ) )
{
margem_horizontal_folha = ( Double ) value;
}
}
public Class getOuterClass()
{
return EtiquetaData.class;
}
}

@ -1,75 +0,0 @@
/*
* EtiquetaData.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on 27/Fev/2006
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.util.HashMap;
import com.evolute.utils.jdo.JDOObject;
public final class EtiquetaData extends JDOObject
{
public static final String ID = "id";
public static final String DESCRICAO = "descricao";
public static final String DESCRICAO_PLAIN = "descricao_plain";
public static final String ALTURA = "altura";
public static final String LARGURA = "largura";
public static final String MARGEM_ESQUERDA = "margem_esquerda";
public static final String MARGEM_CIMA = "margem_cima";
public static final String COLUNAS = "colunas";
public static final String LINHAS = "linhas";
public static final String CONTINUA = "continua";
public static final String ALTURA_FOLHA = "altura_folha";
public static final String LARGURA_FOLHA = "largura_folha";
public static final String MARGEM_VERTICAL_FOLHA = "margem_vertical_folha";
public static final String MARGEM_HORIZONTAL_FOLHA = "margem_horizontal_folha";
public static final String FIELD_NAMES[] = new String[]{
DESCRICAO, DESCRICAO_PLAIN, ALTURA, LARGURA, MARGEM_ESQUERDA, MARGEM_CIMA, COLUNAS,
LINHAS, CONTINUA, ALTURA_FOLHA, LARGURA_FOLHA, MARGEM_VERTICAL_FOLHA,
MARGEM_HORIZONTAL_FOLHA, };
protected static final String ALL_FIELD_NAMES[] = new String[]{
ID, DESCRICAO, DESCRICAO_PLAIN, ALTURA, LARGURA, MARGEM_ESQUERDA, MARGEM_CIMA,
COLUNAS, LINHAS, CONTINUA, ALTURA_FOLHA, LARGURA_FOLHA, MARGEM_VERTICAL_FOLHA,
MARGEM_HORIZONTAL_FOLHA, };
private HashMap dataHash;
public EtiquetaData()
{
dataHash = new HashMap();
}
protected Object innerGet( String fieldName )
throws Exception
{
return dataHash.get( fieldName );
}
protected void innerSet( String fieldName, Object value )
throws Exception
{
dataHash.put( fieldName, value );
}
public String []getFieldNames()
{
return FIELD_NAMES;
}
protected String []getAllFieldNames()
{
return ALL_FIELD_NAMES;
}
public Class getInnerClass()
{
return Etiqueta.class;
}
}

@ -1,25 +0,0 @@
/*
* EtiquetaID.java
*
* Generated by com.evolute.codegen.jdo.idclassgenerators.JPOXIDClassGenerator on 27/Fev/2006
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.io.Serializable;
import com.evolute.utils.jdo.jpox.IntegerID;
public final class EtiquetaID extends IntegerID
implements Serializable
{
public EtiquetaID()
{
}
public EtiquetaID( String str )
{
super( str );
}
}

@ -1,323 +0,0 @@
/*
* Exame.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on 28/Jan/2005
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.util.Date;
import com.evolute.utils.jdo.JDOInnerObject;
public final class Exame implements JDOInnerObject
{
private Integer id;
private Date data;
private Integer tipo;
private Integer ocasional;
private String outro_tipo;
private Integer resultado;
private String outra_funcao_1;
private String outra_funcao_2;
private String outra_funcao_3;
private String outra_funcao_4;
private Date proximo_exame;
private String outras_recomendacoes;
private Trabalhador trabalhador;
private Medico medico;
private byte[] pdf;
private byte[] fo;
private String inactivo;
public Exame()
{
}
public Object getField( String fieldName )
{
if( fieldName == ExameData.ID )
{
return id;
}
else if( fieldName == ExameData.DATA )
{
return data;
}
else if( fieldName == ExameData.TIPO )
{
return tipo;
}
else if( fieldName == ExameData.OCASIONAL )
{
return ocasional;
}
else if( fieldName == ExameData.OUTRO_TIPO )
{
return outro_tipo;
}
else if( fieldName == ExameData.RESULTADO )
{
return resultado;
}
else if( fieldName == ExameData.OUTRA_FUNCAO_1 )
{
return outra_funcao_1;
}
else if( fieldName == ExameData.OUTRA_FUNCAO_2 )
{
return outra_funcao_2;
}
else if( fieldName == ExameData.OUTRA_FUNCAO_3 )
{
return outra_funcao_3;
}
else if( fieldName == ExameData.OUTRA_FUNCAO_4 )
{
return outra_funcao_4;
}
else if( fieldName == ExameData.PROXIMO_EXAME )
{
return proximo_exame;
}
else if( fieldName == ExameData.OUTRAS_RECOMENDACOES )
{
return outras_recomendacoes;
}
else if( fieldName == ExameData.TRABALHADOR )
{
return trabalhador;
}
else if( fieldName == ExameData.MEDICO )
{
return medico;
}
else if( fieldName == ExameData.PDF )
{
return pdf;
}
else if( fieldName == ExameData.FO )
{
return fo;
}
else if( fieldName == ExameData.INACTIVO )
{
return inactivo;
}
else if( fieldName.equals( ExameData.ID ) )
{
return id;
}
else if( fieldName.equals( ExameData.DATA ) )
{
return data;
}
else if( fieldName.equals( ExameData.TIPO ) )
{
return tipo;
}
else if( fieldName.equals( ExameData.OCASIONAL ) )
{
return ocasional;
}
else if( fieldName.equals( ExameData.OUTRO_TIPO ) )
{
return outro_tipo;
}
else if( fieldName.equals( ExameData.RESULTADO ) )
{
return resultado;
}
else if( fieldName.equals( ExameData.OUTRA_FUNCAO_1 ) )
{
return outra_funcao_1;
}
else if( fieldName.equals( ExameData.OUTRA_FUNCAO_2 ) )
{
return outra_funcao_2;
}
else if( fieldName.equals( ExameData.OUTRA_FUNCAO_3 ) )
{
return outra_funcao_3;
}
else if( fieldName.equals( ExameData.OUTRA_FUNCAO_4 ) )
{
return outra_funcao_4;
}
else if( fieldName.equals( ExameData.PROXIMO_EXAME ) )
{
return proximo_exame;
}
else if( fieldName.equals( ExameData.OUTRAS_RECOMENDACOES ) )
{
return outras_recomendacoes;
}
else if( fieldName.equals( ExameData.TRABALHADOR ) )
{
return trabalhador;
}
else if( fieldName.equals( ExameData.MEDICO ) )
{
return medico;
}
else if( fieldName.equals( ExameData.PDF ) )
{
return pdf;
}
else if( fieldName.equals( ExameData.FO ) )
{
return fo;
}
else if( fieldName.equals( ExameData.INACTIVO ) )
{
return inactivo;
}
return null;
}
public void setField( String fieldName, Object value )
{
if( fieldName == ExameData.ID )
{
id = ( Integer ) value;
}
else if( fieldName == ExameData.DATA )
{
data = ( Date ) value;
}
else if( fieldName == ExameData.TIPO )
{
tipo = ( Integer ) value;
}
else if( fieldName == ExameData.OCASIONAL )
{
ocasional = ( Integer ) value;
}
else if( fieldName == ExameData.OUTRO_TIPO )
{
outro_tipo = ( String ) value;
}
else if( fieldName == ExameData.RESULTADO )
{
resultado = ( Integer ) value;
}
else if( fieldName == ExameData.OUTRA_FUNCAO_1 )
{
outra_funcao_1 = ( String ) value;
}
else if( fieldName == ExameData.OUTRA_FUNCAO_2 )
{
outra_funcao_2 = ( String ) value;
}
else if( fieldName == ExameData.OUTRA_FUNCAO_3 )
{
outra_funcao_3 = ( String ) value;
}
else if( fieldName == ExameData.OUTRA_FUNCAO_4 )
{
outra_funcao_4 = ( String ) value;
}
else if( fieldName == ExameData.PROXIMO_EXAME )
{
proximo_exame = ( Date ) value;
}
else if( fieldName == ExameData.OUTRAS_RECOMENDACOES )
{
outras_recomendacoes = ( String ) value;
}
else if( fieldName == ExameData.TRABALHADOR )
{
trabalhador = ( Trabalhador ) value;
}
else if( fieldName == ExameData.MEDICO )
{
medico = ( Medico ) value;
}
else if( fieldName == ExameData.PDF )
{
pdf = ( byte[] ) value;
}
else if( fieldName == ExameData.FO )
{
fo = ( byte[] ) value;
}
else if( fieldName == ExameData.INACTIVO )
{
inactivo = ( String ) value;
}
else if( fieldName.equals( ExameData.ID ) )
{
id = ( Integer ) value;
}
else if( fieldName.equals( ExameData.DATA ) )
{
data = ( Date ) value;
}
else if( fieldName.equals( ExameData.TIPO ) )
{
tipo = ( Integer ) value;
}
else if( fieldName.equals( ExameData.OCASIONAL ) )
{
ocasional = ( Integer ) value;
}
else if( fieldName.equals( ExameData.OUTRO_TIPO ) )
{
outro_tipo = ( String ) value;
}
else if( fieldName.equals( ExameData.RESULTADO ) )
{
resultado = ( Integer ) value;
}
else if( fieldName.equals( ExameData.OUTRA_FUNCAO_1 ) )
{
outra_funcao_1 = ( String ) value;
}
else if( fieldName.equals( ExameData.OUTRA_FUNCAO_2 ) )
{
outra_funcao_2 = ( String ) value;
}
else if( fieldName.equals( ExameData.OUTRA_FUNCAO_3 ) )
{
outra_funcao_3 = ( String ) value;
}
else if( fieldName.equals( ExameData.OUTRA_FUNCAO_4 ) )
{
outra_funcao_4 = ( String ) value;
}
else if( fieldName.equals( ExameData.PROXIMO_EXAME ) )
{
proximo_exame = ( Date ) value;
}
else if( fieldName.equals( ExameData.OUTRAS_RECOMENDACOES ) )
{
outras_recomendacoes = ( String ) value;
}
else if( fieldName.equals( ExameData.TRABALHADOR ) )
{
trabalhador = ( Trabalhador ) value;
}
else if( fieldName.equals( ExameData.MEDICO ) )
{
medico = ( Medico ) value;
}
else if( fieldName.equals( ExameData.PDF ) )
{
pdf = ( byte[] ) value;
}
else if( fieldName.equals( ExameData.FO ) )
{
fo = ( byte[] ) value;
}
else if( fieldName.equals( ExameData.INACTIVO ) )
{
inactivo = ( String ) value;
}
}
public Class getOuterClass()
{
return ExameData.class;
}
}

@ -1,79 +0,0 @@
/*
* ExameData.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on 28/Jan/2005
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.util.HashMap;
import com.evolute.utils.jdo.JDOObject;
public final class ExameData extends JDOObject
implements DisableDeleteable
{
public static final String ID = "id";
public static final String DATA = "data";
public static final String TIPO = "tipo";
public static final String OCASIONAL = "ocasional";
public static final String OUTRO_TIPO = "outro_tipo";
public static final String RESULTADO = "resultado";
public static final String OUTRA_FUNCAO_1 = "outra_funcao_1";
public static final String OUTRA_FUNCAO_2 = "outra_funcao_2";
public static final String OUTRA_FUNCAO_3 = "outra_funcao_3";
public static final String OUTRA_FUNCAO_4 = "outra_funcao_4";
public static final String PROXIMO_EXAME = "proximo_exame";
public static final String OUTRAS_RECOMENDACOES = "outras_recomendacoes";
public static final String TRABALHADOR = "trabalhador";
public static final String MEDICO = "medico";
public static final String PDF = "pdf";
public static final String FO = "fo";
public static final String INACTIVO = "inactivo";
public static final String FIELD_NAMES[] = new String[]{
DATA, TIPO, OCASIONAL, OUTRO_TIPO, RESULTADO, OUTRA_FUNCAO_1, OUTRA_FUNCAO_2,
OUTRA_FUNCAO_3, OUTRA_FUNCAO_4, PROXIMO_EXAME, OUTRAS_RECOMENDACOES,
TRABALHADOR, MEDICO, PDF, FO, };
protected static final String ALL_FIELD_NAMES[] = new String[]{
ID, DATA, TIPO, OCASIONAL, OUTRO_TIPO, RESULTADO, OUTRA_FUNCAO_1, OUTRA_FUNCAO_2,
OUTRA_FUNCAO_3, OUTRA_FUNCAO_4, PROXIMO_EXAME, OUTRAS_RECOMENDACOES,
TRABALHADOR, MEDICO, PDF, FO, INACTIVO, };
private HashMap dataHash;
public ExameData()
{
dataHash = new HashMap();
}
protected Object innerGet( String fieldName )
throws Exception
{
return dataHash.get( fieldName );
}
protected void innerSet( String fieldName, Object value )
throws Exception
{
dataHash.put( fieldName, value );
}
public String []getFieldNames()
{
return FIELD_NAMES;
}
protected String []getAllFieldNames()
{
return ALL_FIELD_NAMES;
}
public Class getInnerClass()
{
return Exame.class;
}
}

@ -1,22 +0,0 @@
/*
* ExameID.java
*
* Generated by com.evolute.codegen.jdo.idclassgenerators.JPOXIDClassGenerator on 28/Jan/2005
*
* Use but DON'T TOUCH
*/
package siprp.data;
import com.evolute.utils.jdo.jpox.IntegerID;
public final class ExameID extends IntegerID
{
public ExameID()
{
}
public ExameID( String str )
{
super( str );
}
}

@ -9,13 +9,12 @@ package siprp.data;
import java.text.DateFormat;
import java.util.Date;
import com.evolute.utils.jdo.JDOObject;
import com.evolute.utils.tables.ColumnizedObject;
/**
*
* @author fpalma
*/
public abstract class Historico extends JDOObject
public abstract class Historico extends BaseObject
implements ColumnizedObject
{
protected static final DateFormat DATE_FORMAT = DateFormat.getDateInstance( DateFormat.SHORT );

@ -1,102 +0,0 @@
/*
* HistoricoEstabelecimento.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on 7/Dez/2004
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.util.Date;
import com.evolute.utils.jdo.JDOInnerObject;
public final class HistoricoEstabelecimento implements JDOInnerObject
{
private Integer id;
private Date data;
private String texto;
private Estabelecimento estabelecimento;
public HistoricoEstabelecimento()
{
}
public Object getField( String fieldName )
{
if( fieldName == HistoricoEstabelecimentoData.ID )
{
return id;
}
else if( fieldName == HistoricoEstabelecimentoData.DATA )
{
return data;
}
else if( fieldName == HistoricoEstabelecimentoData.TEXTO )
{
return texto;
}
else if( fieldName == HistoricoEstabelecimentoData.ESTABELECIMENTO )
{
return estabelecimento;
}
else if( fieldName.equals( HistoricoEstabelecimentoData.ID ) )
{
return id;
}
else if( fieldName.equals( HistoricoEstabelecimentoData.DATA ) )
{
return data;
}
else if( fieldName.equals( HistoricoEstabelecimentoData.TEXTO ) )
{
return texto;
}
else if( fieldName.equals( HistoricoEstabelecimentoData.ESTABELECIMENTO ) )
{
return estabelecimento;
}
return null;
}
public void setField( String fieldName, Object value )
{
if( fieldName == HistoricoEstabelecimentoData.ID )
{
id = ( Integer ) value;
}
else if( fieldName == HistoricoEstabelecimentoData.DATA )
{
data = ( Date ) value;
}
else if( fieldName == HistoricoEstabelecimentoData.TEXTO )
{
texto = ( String ) value;
}
else if( fieldName == HistoricoEstabelecimentoData.ESTABELECIMENTO )
{
estabelecimento = ( Estabelecimento ) value;
}
else if( fieldName.equals( HistoricoEstabelecimentoData.ID ) )
{
id = ( Integer ) value;
}
else if( fieldName.equals( HistoricoEstabelecimentoData.DATA ) )
{
data = ( Date ) value;
}
else if( fieldName.equals( HistoricoEstabelecimentoData.TEXTO ) )
{
texto = ( String ) value;
}
else if( fieldName.equals( HistoricoEstabelecimentoData.ESTABELECIMENTO ) )
{
estabelecimento = ( Estabelecimento ) value;
}
}
public Class getOuterClass()
{
return HistoricoEstabelecimentoData.class;
}
}

@ -1,59 +0,0 @@
/*
* HistoricoEstabelecimentoData.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on 7/Dez/2004
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.util.HashMap;
public final class HistoricoEstabelecimentoData extends Historico
{
public static final String ID = "id";
public static final String DATA = "data";
public static final String TEXTO = "texto";
public static final String ESTABELECIMENTO = "estabelecimento";
public static final String FIELD_NAMES[] = new String[]{
DATA, TEXTO, ESTABELECIMENTO, };
protected static final String ALL_FIELD_NAMES[] = new String[]{
ID, DATA, TEXTO, ESTABELECIMENTO, };
private HashMap dataHash;
public HistoricoEstabelecimentoData()
{
dataHash = new HashMap();
}
protected Object innerGet( String fieldName )
throws Exception
{
return dataHash.get( fieldName );
}
protected void innerSet( String fieldName, Object value )
throws Exception
{
dataHash.put( fieldName, value );
}
public String []getFieldNames()
{
return FIELD_NAMES;
}
protected String []getAllFieldNames()
{
return ALL_FIELD_NAMES;
}
public Class getInnerClass()
{
return HistoricoEstabelecimento.class;
}
}

@ -1,22 +0,0 @@
/*
* HistoricoEstabelecimentoID.java
*
* Generated by com.evolute.codegen.jdo.idclassgenerators.JPOXIDClassGenerator on 7/Dez/2004
*
* Use but DON'T TOUCH
*/
package siprp.data;
import com.evolute.utils.jdo.jpox.IntegerID;
public final class HistoricoEstabelecimentoID extends IntegerID
{
public HistoricoEstabelecimentoID()
{
}
public HistoricoEstabelecimentoID( String str )
{
super( str );
}
}

@ -7,19 +7,28 @@
package siprp.data;
import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;
import siprp.FichaDataProvider;
import siprp.data.outer.AvisosData;
import siprp.data.outer.EmpresasData;
import siprp.data.outer.EstabelecimentosData;
import siprp.data.outer.MarcacoesEmpresaData;
import siprp.data.outer.MarcacoesEstabelecimentoData;
import siprp.data.outer.MarcacoesTrabalhadorData;
import siprp.data.outer.TrabalhadoresData;
import siprp.medicina.MedicinaDataProvider;
import com.evolute.entity.ProviderInterface;
import com.evolute.entity.evo.EvoDataException;
import com.evolute.utils.Singleton;
import com.evolute.utils.jdo.JDOObject;
import com.evolute.utils.jdo.JDOProvider;
import com.evolute.utils.tables.ColumnizedObject;
/**
*
* @author fpalma
*/
public abstract class Marcacao extends JDOObject
public abstract class Marcacao extends BaseObject
implements ColumnizedObject
//, JDOOperationHandlerInterface
{
@ -42,21 +51,23 @@ public abstract class Marcacao extends JDOObject
public static final String ANTECEDENCIA_AVISO = "antecedencia_aviso";
protected static final DateFormat DATE_FORMAT = DateFormat.getDateInstance( DateFormat.SHORT );
protected static JDOProvider JDO;
protected static ProviderInterface JDO;
public static Marcacao getMarcacao( int tipo )
{
switch( tipo )
{
case TIPO_MARCACAO_TRABALHADOR_EXAMES: case TIPO_MARCACAO_TRABALHADOR_CONSULTA:
return new MarcacaoTrabalhadorData();
case TIPO_MARCACAO_TRABALHADOR_EXAMES:
case TIPO_MARCACAO_TRABALHADOR_CONSULTA:
return new MarcacoesTrabalhadorData();
case TIPO_MARCACAO_ESTABELECIMENTO:
return new MarcacaoEstabelecimentoData();
return new MarcacoesEstabelecimentoData();
case TIPO_MARCACAO_EMPRESA:
return new MarcacaoEmpresaData();
return new MarcacoesEmpresaData();
}
return null;
}
@ -72,7 +83,7 @@ public abstract class Marcacao extends JDOObject
case 1:
String realizada = (String) get( REALIZADA );
// if( this instanceof MarcacaoEmpresaData )
// if( this instanceof MarcacoesEmpresaData )
// {
// return new Boolean( "y".equals( realizada ) );
// }
@ -84,9 +95,9 @@ public abstract class Marcacao extends JDOObject
// }
case 2:
if( this instanceof MarcacaoEmpresaData )
if( this instanceof MarcacoesEmpresaData )
{
String textoStr = (String ) get( MarcacaoEmpresaData.TEXTO );
String textoStr = (String ) get( MarcacoesEmpresaData.TEXTO );
if( textoStr == null )
{
textoStr = "";
@ -124,7 +135,7 @@ public abstract class Marcacao extends JDOObject
return;
}
Integer marcacaoID = provider.getMarcacaoIDByTrabalhador( trabalhadorID );
MarcacaoTrabalhadorData marcacao;
MarcacoesTrabalhadorData marcacao;
if( marcacaoID == null )
{
marcacao = null;
@ -133,9 +144,9 @@ public abstract class Marcacao extends JDOObject
{
if( JDO == null )
{
JDO = ( JDOProvider ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
JDO = ( ProviderInterface ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
}
marcacao = ( MarcacaoTrabalhadorData ) JDO.load( MarcacaoTrabalhadorData.class, marcacaoID );
marcacao = ( MarcacoesTrabalhadorData ) JDO.load( MarcacoesTrabalhadorData.class, marcacaoID );
}
if( date == null && marcacao != null )
{
@ -148,206 +159,236 @@ public abstract class Marcacao extends JDOObject
}
else if( date != null && marcacao == null )
{
marcacao = new MarcacaoTrabalhadorData();
marcacao = new MarcacoesTrabalhadorData();
if( JDO == null )
{
JDO = ( JDOProvider ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
JDO = ( ProviderInterface ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
}
TrabalhadorData trab = (TrabalhadorData)JDO.load( TrabalhadorData.class, trabalhadorID );
marcacao.set( MarcacaoTrabalhadorData.TRABALHADOR, trab );
marcacao.set( MarcacaoTrabalhadorData.TIPO, new Integer( MarcacaoTrabalhadorData.TIPO_CONSULTA ) );
TrabalhadoresData trab = (TrabalhadoresData)JDO.load( TrabalhadoresData.class, trabalhadorID );
marcacao.set( MarcacoesTrabalhadorData.TO_TRABALHADOR_ID, trab );
marcacao.set( MarcacoesTrabalhadorData.TIPO, new Integer( MarcacoesTrabalhadorData.TIPO_CONSULTA ) );
marcacao.set( Marcacao.DATA, date );
marcacao.set( Marcacao.REALIZADA, "n" );
marcacao.set( MarcacaoTrabalhadorData.ESTADO, new Integer( siprp.medicina.MedicinaDataProvider.ESTADO_POR_REALIZAR ) );
marcacao.set( MarcacaoTrabalhadorData.MOTIVO, new Integer( 2 ) );
marcacao.set( MarcacoesTrabalhadorData.ESTADO, new Integer( siprp.medicina.MedicinaDataProvider.ESTADO_POR_REALIZAR ) );
marcacao.set( MarcacoesTrabalhadorData.MOTIVO, new Integer( 2 ) );
marcacao.save();
}
}
//
// public boolean handle( JDOObject object, int operation, int moment )
// throws Exception
// {
// switch( operation )
// {
// case JDOOperationHandlerInterface.OP_SAVE:
// switch( moment )
// {
// case JDOOperationHandlerInterface.MOMENT_BEFORE:
// return preSave( (Marcacao) object );
//
// case JDOOperationHandlerInterface.MOMENT_AFTER:
// return postSave( (Marcacao) object );
// }
// return false;
//
// case JDOOperationHandlerInterface.OP_DELETE:
// switch( moment )
// {
// case JDOOperationHandlerInterface.MOMENT_BEFORE:
// return preDelete( (Marcacao) object );
//
// case JDOOperationHandlerInterface.MOMENT_AFTER:
// return postDelete( (Marcacao) object );
// }
// return false;
// }
// return false;
// }
//
// protected boolean preSave( Marcacao object )
// throws Exception
// {
// return false;
// }
//
// protected boolean postSave( Marcacao object )
// throws Exception
// {
// if( object instanceof MarcacaoEmpresaData )
// {
// AvisoData aviso = (AvisoData) load( AvisoData.class, new Object[]{ get( MarcacaoEmpresaData.ID ), new Integer( AvisoData.TIPO_EMPRESA ) }, new String[]{ AvisoData.EVENTO_ID, AvisoData.TIPO } );
// if( aviso == null )
// {
// aviso = new AvisoData();
// }
// aviso.set( AvisoData.TIPO, new Integer( AvisoData.TIPO_EMPRESA ) );
// EmpresaData empresa = ( EmpresaData ) object.get( MarcacaoEmpresaData.EMPRESA );
// aviso.set( AvisoData.EMPRESA, empresa );
// aviso.set( AvisoData.EVENTO_ID, object.get( MarcacaoEmpresaData.ID ) );
// Date dataEvento = (Date) object.get( DATA );
// aviso.set( AvisoData.DATA_EVENTO, dataEvento );
// aviso.set( AvisoData.DATA_AVISO, dataEvento );
// String descricao = "Tarefa ";
// aviso.set( AvisoData.DESCRICAO, descricao );
// aviso.save();
// }
// else if( object instanceof MarcacaoEstabelecimentoData )
// {
// AvisoData aviso = (AvisoData) load( AvisoData.class, new Object[]{ get( MarcacaoEstabelecimentoData.ID ), new Integer( AvisoData.TIPO_ESTABELECIMENTO ) }, new String[]{ AvisoData.EVENTO_ID, AvisoData.TIPO } );
// if( aviso == null )
// {
// aviso = new AvisoData();
// }
// aviso.set( AvisoData.TIPO, new Integer( AvisoData.TIPO_ESTABELECIMENTO ) );
// EstabelecimentoData estabelecimento = ( EstabelecimentoData ) object.get( MarcacaoEstabelecimentoData.ESTABELECIMENTO );
// aviso.set( AvisoData.ESTABELECIMENTO, estabelecimento );
// EmpresaData empresa = ( EmpresaData )estabelecimento.get( EstabelecimentoData.EMPRESA );
// aviso.set( AvisoData.EMPRESA, empresa );
// aviso.set( AvisoData.EVENTO_ID, object.get( MarcacaoEstabelecimentoData.ID ) );
// Date dataEvento = (Date) object.get( DATA );
// Date dataAviso = new Date( dataEvento.getTime() );
// Calendar cal = Calendar.getInstance();
// cal.setTime( dataAviso );
// cal.add( Calendar.DAY_OF_MONTH, -14 );
// dataAviso = cal.getTime();
// aviso.set( AvisoData.DATA_AVISO, dataAviso );
// aviso.set( AvisoData.DATA_EVENTO, dataEvento );
// String descricao = "Visita ";
// aviso.set( AvisoData.DESCRICAO, descricao );
// cal = Calendar.getInstance();
// cal.setTime( dataEvento );
// cal.set( cal.get( Calendar.YEAR ), cal.get( Calendar.MONTH ), cal.get( Calendar.DAY_OF_MONTH ), 0, 0, 0 );
// cal.set( Calendar.MILLISECOND, 0 );
// dataEvento = cal.getTime();
//
// cal = Calendar.getInstance();
// cal.set( cal.get( Calendar.YEAR ), cal.get( Calendar.MONTH ), cal.get( Calendar.DAY_OF_MONTH ), 10, 0, 0 );
// cal.set( Calendar.MILLISECOND, 0 );
// Date hoje = cal.getTime();
// if( hoje.before( dataEvento ) )
// {
// aviso.save();
// }
// }
// if( object instanceof MarcacaoTrabalhadorData )
// {
// AvisoData aviso = (AvisoData) load( AvisoData.class, new Object[]{ object.get( MarcacaoTrabalhadorData.ID ), new Integer( AvisoData.TIPO_TRABALHADOR ) }, new String[]{ AvisoData.EVENTO_ID, AvisoData.TIPO } );
// if( aviso == null )
// {
// aviso = new AvisoData();
// }
// aviso.set( AvisoData.TIPO, new Integer( AvisoData.TIPO_TRABALHADOR ) );
// TrabalhadorData trab = ( TrabalhadorData ) object.get( MarcacaoTrabalhadorData.TRABALHADOR );
// aviso.set( AvisoData.TRABALHADOR, trab );
// EstabelecimentoData estabelecimento = ( EstabelecimentoData ) trab.get( TrabalhadorData.ESTABELECIMENTO );
// aviso.set( AvisoData.ESTABELECIMENTO, estabelecimento );
// EmpresaData empresa = ( EmpresaData ) estabelecimento.get( EstabelecimentoData.EMPRESA );
// aviso.set( AvisoData.EMPRESA, empresa );
// aviso.set( AvisoData.EVENTO_ID, object.get( MarcacaoTrabalhadorData.ID ) );
// Date dataEvento = (Date) object.get( DATA );
// Date dataAviso = new Date( dataEvento.getTime() );
// Calendar cal = Calendar.getInstance();
// cal.setTime( dataAviso );
// cal.add( Calendar.DAY_OF_MONTH, -14 );
// dataAviso = cal.getTime();
// aviso.set( AvisoData.DATA_AVISO, dataAviso );
// aviso.set( AvisoData.DATA_EVENTO, dataEvento );
// String descricao = "";
// switch( ( ( Integer ) object.get( MarcacaoTrabalhadorData.TIPO ) ).intValue() )
// {
// case MarcacaoTrabalhadorData.TIPO_EXAMES:
// descricao = "Exames ";
// break;
//
// case MarcacaoTrabalhadorData.TIPO_CONSULTA:
// descricao = "Consulta ";
// break;
// }
// aviso.set( AvisoData.DESCRICAO, descricao );
// cal = Calendar.getInstance();
// cal.setTime( dataEvento );
// cal.set( cal.get( Calendar.YEAR ), cal.get( Calendar.MONTH ), cal.get( Calendar.DAY_OF_MONTH ), 0, 0, 0 );
// cal.set( Calendar.MILLISECOND, 0 );
// dataEvento = cal.getTime();
//
// cal = Calendar.getInstance();
// cal.set( cal.get( Calendar.YEAR ), cal.get( Calendar.MONTH ), cal.get( Calendar.DAY_OF_MONTH ), 10, 0, 0 );
// cal.set( Calendar.MILLISECOND, 0 );
// Date hoje = cal.getTime();
// if( hoje.before( dataEvento ) )
// {
// aviso.save();
// }
// }
// else
// {
// return false;
// }
// return true;
// }
//
// protected boolean preDelete( Marcacao object )
// throws Exception
// {
// return false;
// }
//
// protected boolean postDelete( Marcacao object )
// throws Exception
// {
// Integer tipo;
// if( object instanceof MarcacaoEmpresaData )
// {
// tipo = new Integer( AvisoData.TIPO_EMPRESA );
// }
// else if( object instanceof MarcacaoEstabelecimentoData )
// {
// tipo = new Integer( AvisoData.TIPO_ESTABELECIMENTO );
// }
// if( object instanceof MarcacaoTrabalhadorData )
// {
// tipo = new Integer( AvisoData.TIPO_TRABALHADOR );
// }
// else
// {
// return false;
// }
// AvisoData aviso = (AvisoData) load( AvisoData.class, new Object[]{ object.get( "id" ), tipo }, new String[]{ AvisoData.EVENTO_ID, AvisoData.TIPO } );
// if( aviso != null )
// {
// aviso.delete();
// }
//
// return true;
// }
@Override
public void save() throws EvoDataException
{
super.save();
postSave(this);
}
@Override
public void delete() throws EvoDataException
{
if( preDelete(this) )
{
super.delete();
postDelete(this);
}
}
protected boolean postSave( Marcacao object )
throws EvoDataException
{
boolean result = false;
try
{
if( object instanceof MarcacoesEmpresaData )
{
AvisosData aviso = (AvisosData) JDO.load( AvisosData.class,
new Object[]{ object.get( MarcacoesEmpresaData.ID ), new Integer( AvisosData.TIPO_EMPRESA ) },
new String[]{ AvisosData.EVENTO_ID, AvisosData.TIPO } );
if( aviso == null )
{
aviso = new AvisosData();
}
aviso.setTipo( AvisosData.TIPO_EMPRESA );
EmpresasData empresa = ((MarcacoesEmpresaData)object).toEmpresa_id();
aviso.setToEmpresa_id( empresa );
aviso.set( AvisosData.EVENTO_ID, object.get( MarcacoesEmpresaData.ID ) );
Date dataEvento = (Date) object.get( Marcacao.DATA );
aviso.set( AvisosData.DATA_EVENTO, dataEvento );
aviso.set( AvisosData.DATA_AVISO, dataEvento );
String descricao = "Tarefa ";
aviso.set( AvisosData.DESCRICAO, descricao );
aviso.save();
empresa.save();
}
else if( object instanceof MarcacoesEstabelecimentoData )
{
AvisosData aviso = (AvisosData) JDO.load( AvisosData.class,
new Object[]{ object.get( MarcacoesEstabelecimentoData.ID ), new Integer( AvisosData.TIPO_ESTABELECIMENTO ) },
new String[]{ AvisosData.EVENTO_ID, AvisosData.TIPO } );
if( aviso == null )
{
aviso = new AvisosData();
}
aviso.set( AvisosData.TIPO, new Integer( AvisosData.TIPO_ESTABELECIMENTO ) );
EstabelecimentosData estabelecimento = ((MarcacoesEstabelecimentoData)object).toEstabelecimento_id();
aviso.setToEstabelecimento_id( estabelecimento );
EmpresasData empresa = estabelecimento.toEmpresa_id();
aviso.setToEmpresa_id( empresa );
aviso.set( AvisosData.EVENTO_ID, object.get( MarcacoesEstabelecimentoData.ID ) );
Date dataEvento = (Date) object.get( Marcacao.DATA );
Date dataAviso = new Date( dataEvento.getTime() );
Calendar cal = Calendar.getInstance();
cal.setTime( dataAviso );
cal.add( Calendar.DAY_OF_MONTH, -14 );
dataAviso = cal.getTime();
aviso.set( AvisosData.DATA_AVISO, dataAviso );
aviso.set( AvisosData.DATA_EVENTO, dataEvento );
String descricao = "Visita ";
aviso.set( AvisosData.DESCRICAO, descricao );
cal = Calendar.getInstance();
cal.setTime( dataEvento );
cal.set( cal.get( Calendar.YEAR ), cal.get( Calendar.MONTH ), cal.get( Calendar.DAY_OF_MONTH ), 0, 0, 0 );
cal.set( Calendar.MILLISECOND, 0 );
dataEvento = cal.getTime();
cal = Calendar.getInstance();
cal.set( cal.get( Calendar.YEAR ), cal.get( Calendar.MONTH ), cal.get( Calendar.DAY_OF_MONTH ), 10, 0, 0 );
cal.set( Calendar.MILLISECOND, 0 );
Date hoje = cal.getTime();
if( hoje.before( dataEvento ) )
{
aviso.save();
}
estabelecimento.save();
}
if( object instanceof MarcacoesTrabalhadorData )
{
AvisosData aviso = (AvisosData) JDO.load( AvisosData.class,
new Object[]{ object.get( MarcacoesTrabalhadorData.ID ), new Integer( AvisosData.TIPO_TRABALHADOR ) },
new String[]{ AvisosData.EVENTO_ID, AvisosData.TIPO } );
if( aviso == null )
{
aviso = new AvisosData();
}
aviso.set( AvisosData.TIPO, new Integer( AvisosData.TIPO_TRABALHADOR ) );
TrabalhadoresData trab = ((MarcacoesTrabalhadorData)object).toTrabalhador_id();
aviso.setToTrabalhador_id( trab );
EstabelecimentosData estabelecimento = trab.toEstabelecimento_id();
aviso.setToEstabelecimento_id( estabelecimento );
EmpresasData empresa = estabelecimento.toEmpresa_id();
aviso.setToEmpresa_id( empresa );
aviso.set( AvisosData.EVENTO_ID, object.get( MarcacoesTrabalhadorData.ID ) );
Date dataEvento = (Date) object.get( Marcacao.DATA );
Date dataAviso = new Date( dataEvento.getTime() );
Calendar cal = Calendar.getInstance();
cal.setTime( dataAviso );
cal.add( Calendar.DAY_OF_MONTH, -14 );
dataAviso = cal.getTime();
aviso.set( AvisosData.DATA_AVISO, dataAviso );
aviso.set( AvisosData.DATA_EVENTO, dataEvento.clone() );
String descricao = "";
switch( ( ( Integer ) object.get( MarcacoesTrabalhadorData.TIPO ) ).intValue() )
{
case MarcacoesTrabalhadorData.TIPO_EXAMES:
descricao = "Exames";
break;
case MarcacoesTrabalhadorData.TIPO_CONSULTA:
Integer motivo = ( ( Integer ) object.get( MarcacoesTrabalhadorData.MOTIVO ) );
descricao = "Consulta " + ( motivo == null ? "" : ("(" + MedicinaDataProvider.TIPOS_CONSULTAS[ motivo.intValue() ] + ")" ) );
break;
}
aviso.set( AvisosData.DESCRICAO, descricao );
cal = Calendar.getInstance();
cal.setTime( dataEvento );
cal.set( cal.get( Calendar.YEAR ), cal.get( Calendar.MONTH ), cal.get( Calendar.DAY_OF_MONTH ), 0, 0, 0 );
cal.set( Calendar.MILLISECOND, 0 );
dataEvento = cal.getTime();
cal = Calendar.getInstance();
cal.set( cal.get( Calendar.YEAR ), cal.get( Calendar.MONTH ), cal.get( Calendar.DAY_OF_MONTH ), 10, 0, 0 );
cal.set( Calendar.MILLISECOND, 0 );
Date hoje = cal.getTime();
if( hoje.before( dataEvento ) )
{
if( !hoje.before( dataAviso ) )
{
aviso.set( AvisosData.DATA_AVISO, dataEvento.clone() );
}
aviso.save();
}
trab.save();
}
else
{
result = false;
}
result = true;
}
catch (Exception e)
{
throw new EvoDataException( e );
}
return result;
}
protected boolean preDelete( Marcacao object )
throws EvoDataException
{
try
{
if( object instanceof MarcacoesTrabalhadorData &&
( ( Integer ) object.get( MarcacoesTrabalhadorData.TIPO ) ).intValue() == MarcacoesTrabalhadorData.TIPO_EXAMES )
{
((MedicinaDataProvider)MedicinaDataProvider.getProvider()).deleteDetalhesRealizadosForMarcacao( ( Integer ) object.get( MarcacoesTrabalhadorData.ID ) );
return true;
}
}
catch (Exception e)
{
throw new EvoDataException( e );
}
return false;
}
protected boolean postDelete( Marcacao object )
throws EvoDataException
{
try
{
Integer tipo;
if( object instanceof MarcacoesEmpresaData )
{
tipo = new Integer( AvisosData.TIPO_EMPRESA );
}
else if( object instanceof MarcacoesEstabelecimentoData )
{
tipo = new Integer( AvisosData.TIPO_ESTABELECIMENTO );
}
if( object instanceof MarcacoesTrabalhadorData )
{
tipo = new Integer( AvisosData.TIPO_TRABALHADOR );
}
else
{
return false;
}
AvisosData aviso = (AvisosData) JDO.load( AvisosData.class,
new Object[]{ object.get( "id" ), tipo },
new String[]{ AvisosData.EVENTO_ID, AvisosData.TIPO } );
if( aviso != null )
{
aviso.delete();
}
return true;
}
catch (Exception e)
{
throw new EvoDataException( e );
}
}
}

@ -1,119 +0,0 @@
/*
* MarcacaoEmpresa.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on 7/Dez/2004
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.util.Date;
import com.evolute.utils.jdo.JDOInnerObject;
public final class MarcacaoEmpresa implements JDOInnerObject
{
private Integer id;
private Date data;
private String texto;
private String realizada;
private Empresa empresa;
public MarcacaoEmpresa()
{
}
public Object getField( String fieldName )
{
if( fieldName == MarcacaoEmpresaData.ID )
{
return id;
}
else if( fieldName == MarcacaoEmpresaData.DATA )
{
return data;
}
else if( fieldName == MarcacaoEmpresaData.TEXTO )
{
return texto;
}
else if( fieldName == MarcacaoEmpresaData.REALIZADA )
{
return realizada;
}
else if( fieldName == MarcacaoEmpresaData.EMPRESA )
{
return empresa;
}
else if( fieldName.equals( MarcacaoEmpresaData.ID ) )
{
return id;
}
else if( fieldName.equals( MarcacaoEmpresaData.DATA ) )
{
return data;
}
else if( fieldName.equals( MarcacaoEmpresaData.TEXTO ) )
{
return texto;
}
else if( fieldName.equals( MarcacaoEmpresaData.REALIZADA ) )
{
return realizada;
}
else if( fieldName.equals( MarcacaoEmpresaData.EMPRESA ) )
{
return empresa;
}
return null;
}
public void setField( String fieldName, Object value )
{
if( fieldName == MarcacaoEmpresaData.ID )
{
id = ( Integer ) value;
}
else if( fieldName == MarcacaoEmpresaData.DATA )
{
data = ( Date ) value;
}
else if( fieldName == MarcacaoEmpresaData.TEXTO )
{
texto = ( String ) value;
}
else if( fieldName == MarcacaoEmpresaData.REALIZADA )
{
realizada = ( String ) value;
}
else if( fieldName == MarcacaoEmpresaData.EMPRESA )
{
empresa = ( Empresa ) value;
}
else if( fieldName.equals( MarcacaoEmpresaData.ID ) )
{
id = ( Integer ) value;
}
else if( fieldName.equals( MarcacaoEmpresaData.DATA ) )
{
data = ( Date ) value;
}
else if( fieldName.equals( MarcacaoEmpresaData.TEXTO ) )
{
texto = ( String ) value;
}
else if( fieldName.equals( MarcacaoEmpresaData.REALIZADA ) )
{
realizada = ( String ) value;
}
else if( fieldName.equals( MarcacaoEmpresaData.EMPRESA ) )
{
empresa = ( Empresa ) value;
}
}
public Class getOuterClass()
{
return MarcacaoEmpresaData.class;
}
}

@ -1,60 +0,0 @@
/*
* MarcacaoEmpresaData.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on 7/Dez/2004
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.util.HashMap;
public final class MarcacaoEmpresaData extends Marcacao
{
public static final String ID = "id";
public static final String DATA = "data";
public static final String TEXTO = "texto";
public static final String REALIZADA = "realizada";
public static final String EMPRESA = "empresa";
public static final String FIELD_NAMES[] = new String[]{
DATA, TEXTO, REALIZADA, EMPRESA, };
protected static final String ALL_FIELD_NAMES[] = new String[]{
ID, DATA, TEXTO, REALIZADA, EMPRESA, };
private HashMap dataHash;
public MarcacaoEmpresaData()
{
dataHash = new HashMap();
}
protected Object innerGet( String fieldName )
throws Exception
{
return dataHash.get( fieldName );
}
protected void innerSet( String fieldName, Object value )
throws Exception
{
dataHash.put( fieldName, value );
}
public String []getFieldNames()
{
return FIELD_NAMES;
}
protected String []getAllFieldNames()
{
return ALL_FIELD_NAMES;
}
public Class getInnerClass()
{
return MarcacaoEmpresa.class;
}
}

@ -1,22 +0,0 @@
/*
* MarcacaoEmpresaID.java
*
* Generated by com.evolute.codegen.jdo.idclassgenerators.JPOXIDClassGenerator on 7/Dez/2004
*
* Use but DON'T TOUCH
*/
package siprp.data;
import com.evolute.utils.jdo.jpox.IntegerID;
public final class MarcacaoEmpresaID extends IntegerID
{
public MarcacaoEmpresaID()
{
}
public MarcacaoEmpresaID( String str )
{
super( str );
}
}

@ -1,204 +0,0 @@
/*
* MarcacaoEstabelecimento.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on Feb 1, 2006
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.util.Date;
import com.evolute.utils.jdo.JDOInnerObject;
public final class MarcacaoEstabelecimento implements JDOInnerObject
{
private Integer id;
private Date data;
private String realizada;
private Integer estado;
private Integer tecnico_hst;
private Integer tecnico_superior_hst;
private Date data_email;
private Date data_relatorio;
private Estabelecimento estabelecimento;
private String observacoes;
public MarcacaoEstabelecimento()
{
}
public Object getField( String fieldName )
{
if( fieldName == MarcacaoEstabelecimentoData.ID )
{
return id;
}
else if( fieldName == MarcacaoEstabelecimentoData.DATA )
{
return data;
}
else if( fieldName == MarcacaoEstabelecimentoData.REALIZADA )
{
return realizada;
}
else if( fieldName == MarcacaoEstabelecimentoData.ESTADO )
{
return estado;
}
else if( fieldName == MarcacaoEstabelecimentoData.TECNICO_HST )
{
return tecnico_hst;
}
else if( fieldName == MarcacaoEstabelecimentoData.DATA_EMAIL )
{
return data_email;
}
else if( fieldName == MarcacaoEstabelecimentoData.DATA_RELATORIO )
{
return data_relatorio;
}
else if( fieldName == MarcacaoEstabelecimentoData.ESTABELECIMENTO )
{
return estabelecimento;
}
else if( fieldName == MarcacaoEstabelecimentoData.OBSERVACOES )
{
return observacoes;
}
else if( fieldName == MarcacaoEstabelecimentoData.TECNICO_SUPERIOR_HST )
{
return tecnico_superior_hst;
}
else if( fieldName.equals( MarcacaoEstabelecimentoData.ID ) )
{
return id;
}
else if( fieldName.equals( MarcacaoEstabelecimentoData.DATA ) )
{
return data;
}
else if( fieldName.equals( MarcacaoEstabelecimentoData.REALIZADA ) )
{
return realizada;
}
else if( fieldName.equals( MarcacaoEstabelecimentoData.ESTADO ) )
{
return estado;
}
else if( fieldName.equals( MarcacaoEstabelecimentoData.TECNICO_HST ) )
{
return tecnico_hst;
}
else if( fieldName.equals( MarcacaoEstabelecimentoData.DATA_EMAIL ) )
{
return data_email;
}
else if( fieldName.equals( MarcacaoEstabelecimentoData.DATA_RELATORIO ) )
{
return data_relatorio;
}
else if( fieldName.equals( MarcacaoEstabelecimentoData.ESTABELECIMENTO ) )
{
return estabelecimento;
}
else if( fieldName.equals( MarcacaoEstabelecimentoData.OBSERVACOES ) )
{
return observacoes;
}
else if( fieldName.equals( MarcacaoEstabelecimentoData.TECNICO_SUPERIOR_HST ) )
{
return tecnico_superior_hst;
}
return null;
}
public void setField( String fieldName, Object value )
{
if( fieldName == MarcacaoEstabelecimentoData.ID )
{
id = ( Integer ) value;
}
else if( fieldName == MarcacaoEstabelecimentoData.DATA )
{
data = ( Date ) value;
}
else if( fieldName == MarcacaoEstabelecimentoData.REALIZADA )
{
realizada = ( String ) value;
}
else if( fieldName == MarcacaoEstabelecimentoData.ESTADO )
{
estado = ( Integer ) value;
}
else if( fieldName == MarcacaoEstabelecimentoData.TECNICO_HST )
{
tecnico_hst = ( Integer ) value;
}
else if( fieldName == MarcacaoEstabelecimentoData.TECNICO_SUPERIOR_HST )
{
tecnico_superior_hst = ( Integer ) value;
}
else if( fieldName == MarcacaoEstabelecimentoData.DATA_EMAIL )
{
data_email = ( Date ) value;
}
else if( fieldName == MarcacaoEstabelecimentoData.DATA_RELATORIO )
{
data_relatorio = ( Date ) value;
}
else if( fieldName == MarcacaoEstabelecimentoData.ESTABELECIMENTO )
{
estabelecimento = ( Estabelecimento ) value;
}
else if( fieldName == MarcacaoEstabelecimentoData.OBSERVACOES )
{
observacoes = ( String ) value;
}
else if( fieldName.equals( MarcacaoEstabelecimentoData.ID ) )
{
id = ( Integer ) value;
}
else if( fieldName.equals( MarcacaoEstabelecimentoData.DATA ) )
{
data = ( Date ) value;
}
else if( fieldName.equals( MarcacaoEstabelecimentoData.REALIZADA ) )
{
realizada = ( String ) value;
}
else if( fieldName.equals( MarcacaoEstabelecimentoData.ESTADO ) )
{
estado = ( Integer ) value;
}
else if( fieldName.equals( MarcacaoEstabelecimentoData.TECNICO_HST ) )
{
tecnico_hst = ( Integer ) value;
}
else if( fieldName.equals( MarcacaoEstabelecimentoData.TECNICO_SUPERIOR_HST ) )
{
tecnico_superior_hst = ( Integer ) value;
}
else if( fieldName.equals( MarcacaoEstabelecimentoData.DATA_EMAIL ) )
{
data_email = ( Date ) value;
}
else if( fieldName.equals( MarcacaoEstabelecimentoData.DATA_RELATORIO ) )
{
data_relatorio = ( Date ) value;
}
else if( fieldName.equals( MarcacaoEstabelecimentoData.ESTABELECIMENTO ) )
{
estabelecimento = ( Estabelecimento ) value;
}
else if( fieldName.equals( MarcacaoEstabelecimentoData.OBSERVACOES ) )
{
observacoes = ( String ) value;
}
}
public Class getOuterClass()
{
return MarcacaoEstabelecimentoData.class;
}
}

@ -1,67 +0,0 @@
/*
* MarcacaoEstabelecimentoData.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on Feb 1, 2006
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.util.HashMap;
public final class MarcacaoEstabelecimentoData extends Marcacao
{
public static final String ID = "id";
public static final String DATA = "data";
public static final String REALIZADA = "realizada";
public static final String ESTADO = "estado";
public static final String TECNICO_HST = "tecnico_hst";
public static final String TECNICO_SUPERIOR_HST = "tecnico_superior_hst";
public static final String DATA_EMAIL = "data_email";
public static final String DATA_RELATORIO = "data_relatorio";
public static final String ESTABELECIMENTO = "estabelecimento";
public static final String OBSERVACOES = "observacoes";
public static final String FIELD_NAMES[] = new String[]{
DATA, REALIZADA, ESTADO, TECNICO_HST, TECNICO_SUPERIOR_HST, DATA_EMAIL, DATA_RELATORIO, ESTABELECIMENTO,
OBSERVACOES, };
protected static final String ALL_FIELD_NAMES[] = new String[]{
ID, DATA, REALIZADA, ESTADO, TECNICO_HST, TECNICO_SUPERIOR_HST, DATA_EMAIL, DATA_RELATORIO,
ESTABELECIMENTO, OBSERVACOES, };
private HashMap dataHash;
public MarcacaoEstabelecimentoData()
{
dataHash = new HashMap();
}
protected Object innerGet( String fieldName )
throws Exception
{
return dataHash.get( fieldName );
}
protected void innerSet( String fieldName, Object value )
throws Exception
{
dataHash.put( fieldName, value );
}
public String []getFieldNames()
{
return FIELD_NAMES;
}
protected String []getAllFieldNames()
{
return ALL_FIELD_NAMES;
}
public Class getInnerClass()
{
return MarcacaoEstabelecimento.class;
}
}

@ -1,25 +0,0 @@
/*
* MarcacaoEstabelecimentoID.java
*
* Generated by com.evolute.codegen.jdo.idclassgenerators.JPOXIDClassGenerator on Feb 1, 2006
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.io.Serializable;
import com.evolute.utils.jdo.jpox.IntegerID;
public final class MarcacaoEstabelecimentoID extends IntegerID
implements Serializable
{
public MarcacaoEstabelecimentoID()
{
}
public MarcacaoEstabelecimentoID( String str )
{
super( str );
}
}

@ -6,13 +6,13 @@
package siprp.data;
import java.util.Collection;
import java.util.List;
import javax.jdo.Query;
import siprp.data.outer.MarcacoesEstabelecimentoData;
import siprp.data.outer.MarcacoesTrabalhadorData;
import com.evolute.entity.ProviderInterface;
import com.evolute.utils.Singleton;
import com.evolute.utils.jdo.JDOInnerObject;
import com.evolute.utils.jdo.JDOProvider;
/**
*
* @author fpalma
@ -20,61 +20,63 @@ import com.evolute.utils.jdo.JDOProvider;
public class MarcacaoListLoader
{
// private static PersistenceManager MANAGER = null;
private JDOProvider JDO;
private ProviderInterface JDO;
/** Creates a new instance of MarcacaoListLoader */
public MarcacaoListLoader()
{
JDO = ( JDOProvider ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
JDO = ( ProviderInterface ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
}
public Marcacao[] load( int tipo, Integer targetID )
throws Exception
public Marcacao[] load( int tipo, Integer targetID ) throws Exception
{
Class theClass;
String filterString;
List<Marcacao> result = null;
Class<? extends Marcacao> theClass = null;
Object[] values = null;
String[] keys = null;
switch( tipo )
{
case Marcacao.TIPO_MARCACAO_TRABALHADOR_EXAMES: case Marcacao.TIPO_MARCACAO_TRABALHADOR_CONSULTA:
theClass = MarcacaoTrabalhador.class;
filterString = "(trabalhador.id == " + targetID + ") && (tipo == " + tipo + ")";
theClass = MarcacoesTrabalhadorData.class;
//"(trabalhador.id == " + targetID + ") && (tipo == " + tipo + ")";
keys = new String[]{ MarcacoesTrabalhadorData.TRABALHADOR_ID_FULL, MarcacoesTrabalhadorData.TIPO_FULL };
values = new Object[]{ targetID, tipo };
break;
case Marcacao.TIPO_MARCACAO_ESTABELECIMENTO:
theClass = MarcacaoEstabelecimento.class;
filterString = "estabelecimento.id == " + targetID;
theClass = MarcacoesEstabelecimentoData.class;
//"estabelecimento.id == " + targetID;
keys = new String[]{ MarcacoesEstabelecimentoData.ESTABELECIMENTO_ID_FULL };
values = new Object[]{ targetID };
break;
default:
return new Marcacao[ 0 ];
}
// if( MANAGER == null )
// {
// MANAGER = (PersistenceManager) Singleton.getInstance( SingletonConstants.PERSISTENCE_MANAGER );
// }
// Transaction tx = MANAGER.currentTransaction();
Object sessionID = null;
try
if( theClass != null )
{
sessionID = JDO.begin();
Query q = JDO.getManager().newQuery( theClass, filterString );
q.setOrdering( Marcacao.DATA + " descending" );
Collection c = ( Collection )q.execute();
JDOInnerObject innerObjects[] = ( JDOInnerObject [] ) c.toArray( new JDOInnerObject[0] );
JDO.commit( sessionID );
Marcacao marcacoes[] = new Marcacao[ innerObjects.length ];
for( int n = 0; n < marcacoes.length; n++ )
{
marcacoes[ n ] = ( Marcacao ) innerObjects[ n ].getOuterClass().newInstance();
marcacoes[ n ].setInnerObject( innerObjects[ n ] );
}
return marcacoes;
result = JDO.listLoad( theClass, values, keys, new String[]{ Marcacao.DATA + " descending" } );
}
catch( RuntimeException ex )
{
JDO.rollback( sessionID );
// Object sessionID = null;
// try
// {
// sessionID = JDO.begin();
// Query q = JDO.getManager().newQuery( theClass, filterString );
// q.setOrdering( Marcacao.DATA + " descending" );
// Collection c = ( Collection )q.execute();
// JDOInnerObject innerObjects[] = ( JDOInnerObject [] ) c.toArray( new JDOInnerObject[0] );
// JDO.commit( sessionID );
// Marcacao marcacoes[] = new Marcacao[ innerObjects.length ];
// for( int n = 0; n < marcacoes.length; n++ )
// {
// marcacoes[ n ] = ( Marcacao ) innerObjects[ n ].getOuterClass().newInstance();
// marcacoes[ n ].setInnerObject( innerObjects[ n ] );
// }
// return marcacoes;
// }
// catch( RuntimeException ex )
// {
// JDO.rollback( sessionID );
// Main.reconnectJDO();
throw ex;
}
// throw ex;
// }
return result == null ? new Marcacao[0] : result.toArray( new Marcacao[result.size()] );
}
}

@ -1,261 +0,0 @@
/*
* MarcacaoSaveAndDeleteHandler.java
*
* Created on 13 de Outubro de 2004, 18:31
*/
package siprp.data;
import java.util.Calendar;
import java.util.Date;
import siprp.medicina.MedicinaDataProvider;
import com.evolute.utils.Singleton;
import com.evolute.utils.jdo.JDOObject;
import com.evolute.utils.jdo.JDOOperationHandlerInterface;
import com.evolute.utils.jdo.JDOProvider;
/**
*
* @author fpalma
*/
public class MarcacaoSaveAndDeleteHandler
implements JDOOperationHandlerInterface
{
public static final MarcacaoSaveAndDeleteHandler INSTANCE = new MarcacaoSaveAndDeleteHandler();
public JDOProvider JDO;
protected MedicinaDataProvider medicinaProvider;
/** Creates a new instance of MarcacaoSaveAndDeleteHandler */
public MarcacaoSaveAndDeleteHandler()
{
JDO = ( JDOProvider ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
}
public boolean handle( JDOObject object, int operation, int moment )
throws Exception
{
if( JDO == null )
{
JDO = ( JDOProvider ) Singleton.getInstance( Singleton.DEFAULT_JDO_PROVIDER );
}
switch( operation )
{
case JDOOperationHandlerInterface.OP_SAVE:
switch( moment )
{
case JDOOperationHandlerInterface.MOMENT_BEFORE:
return preSave( (Marcacao) object );
case JDOOperationHandlerInterface.MOMENT_AFTER:
return postSave( (Marcacao) object );
}
return false;
case JDOOperationHandlerInterface.OP_DELETE:
switch( moment )
{
case JDOOperationHandlerInterface.MOMENT_BEFORE:
return preDelete( (Marcacao) object );
case JDOOperationHandlerInterface.MOMENT_AFTER:
return postDelete( (Marcacao) object );
}
return false;
}
return false;
}
protected boolean preSave( Marcacao object )
throws Exception
{
return false;
}
protected boolean postSave( Marcacao object )
throws Exception
{
if( object instanceof MarcacaoEmpresaData )
{
AvisoData aviso = (AvisoData) JDO.load( AvisoData.class,
new Object[]{ object.get( MarcacaoEmpresaData.ID ), new Integer( AvisoData.TIPO_EMPRESA ) },
new String[]{ AvisoData.EVENTO_ID, AvisoData.TIPO } );
if( aviso == null )
{
aviso = new AvisoData();
}
aviso.set( AvisoData.TIPO, new Integer( AvisoData.TIPO_EMPRESA ) );
EmpresaData empresa = ( EmpresaData ) object.get( MarcacaoEmpresaData.EMPRESA );
aviso.set( AvisoData.EMPRESA, empresa );
aviso.set( AvisoData.EVENTO_ID, object.get( MarcacaoEmpresaData.ID ) );
Date dataEvento = (Date) object.get( Marcacao.DATA );
aviso.set( AvisoData.DATA_EVENTO, dataEvento );
aviso.set( AvisoData.DATA_AVISO, dataEvento );
String descricao = "Tarefa ";
aviso.set( AvisoData.DESCRICAO, descricao );
aviso.save();
empresa.save();
}
else if( object instanceof MarcacaoEstabelecimentoData )
{
AvisoData aviso = (AvisoData) JDO.load( AvisoData.class,
new Object[]{ object.get( MarcacaoEstabelecimentoData.ID ), new Integer( AvisoData.TIPO_ESTABELECIMENTO ) },
new String[]{ AvisoData.EVENTO_ID, AvisoData.TIPO } );
if( aviso == null )
{
aviso = new AvisoData();
}
aviso.set( AvisoData.TIPO, new Integer( AvisoData.TIPO_ESTABELECIMENTO ) );
EstabelecimentoData estabelecimento = ( EstabelecimentoData ) object.get( MarcacaoEstabelecimentoData.ESTABELECIMENTO );
aviso.set( AvisoData.ESTABELECIMENTO, estabelecimento );
EmpresaData empresa = ( EmpresaData )estabelecimento.get( EstabelecimentoData.EMPRESA );
aviso.set( AvisoData.EMPRESA, empresa );
aviso.set( AvisoData.EVENTO_ID, object.get( MarcacaoEstabelecimentoData.ID ) );
Date dataEvento = (Date) object.get( Marcacao.DATA );
Date dataAviso = new Date( dataEvento.getTime() );
Calendar cal = Calendar.getInstance();
cal.setTime( dataAviso );
cal.add( Calendar.DAY_OF_MONTH, -14 );
dataAviso = cal.getTime();
aviso.set( AvisoData.DATA_AVISO, dataAviso );
aviso.set( AvisoData.DATA_EVENTO, dataEvento );
String descricao = "Visita ";
aviso.set( AvisoData.DESCRICAO, descricao );
cal = Calendar.getInstance();
cal.setTime( dataEvento );
cal.set( cal.get( Calendar.YEAR ), cal.get( Calendar.MONTH ), cal.get( Calendar.DAY_OF_MONTH ), 0, 0, 0 );
cal.set( Calendar.MILLISECOND, 0 );
dataEvento = cal.getTime();
cal = Calendar.getInstance();
cal.set( cal.get( Calendar.YEAR ), cal.get( Calendar.MONTH ), cal.get( Calendar.DAY_OF_MONTH ), 10, 0, 0 );
cal.set( Calendar.MILLISECOND, 0 );
Date hoje = cal.getTime();
if( hoje.before( dataEvento ) )
{
aviso.save();
}
estabelecimento.save();
}
if( object instanceof MarcacaoTrabalhadorData )
{
AvisoData aviso = (AvisoData) JDO.load( AvisoData.class,
new Object[]{ object.get( MarcacaoTrabalhadorData.ID ), new Integer( AvisoData.TIPO_TRABALHADOR ) },
new String[]{ AvisoData.EVENTO_ID, AvisoData.TIPO } );
System.out.println( "AVISO LOADED: " + aviso + " id: " + ( aviso != null ? aviso.get( AvisoData.ID ) : "n/a" )
+ " MT.ID: " + object.get( MarcacaoTrabalhadorData.ID )
+ " AD.TIPO: " + new Integer( AvisoData.TIPO_TRABALHADOR ) );
if( aviso == null )
{
System.out.println( "novo aviso" );
aviso = new AvisoData();
}
aviso.set( AvisoData.TIPO, new Integer( AvisoData.TIPO_TRABALHADOR ) );
TrabalhadorData trab = ( TrabalhadorData ) object.get( MarcacaoTrabalhadorData.TRABALHADOR );
aviso.set( AvisoData.TRABALHADOR, trab );
EstabelecimentoData estabelecimento = ( EstabelecimentoData ) trab.get( TrabalhadorData.ESTABELECIMENTO );
aviso.set( AvisoData.ESTABELECIMENTO, estabelecimento );
EmpresaData empresa = ( EmpresaData ) estabelecimento.get( EstabelecimentoData.EMPRESA );
aviso.set( AvisoData.EMPRESA, empresa );
aviso.set( AvisoData.EVENTO_ID, object.get( MarcacaoTrabalhadorData.ID ) );
Date dataEvento = (Date) object.get( Marcacao.DATA );
Date dataAviso = new Date( dataEvento.getTime() );
Calendar cal = Calendar.getInstance();
cal.setTime( dataAviso );
cal.add( Calendar.DAY_OF_MONTH, -14 );
dataAviso = cal.getTime();
aviso.set( AvisoData.DATA_AVISO, dataAviso );
aviso.set( AvisoData.DATA_EVENTO, dataEvento.clone() );
String descricao = "";
switch( ( ( Integer ) object.get( MarcacaoTrabalhadorData.TIPO ) ).intValue() )
{
case MarcacaoTrabalhadorData.TIPO_EXAMES:
descricao = "Exames";
break;
case MarcacaoTrabalhadorData.TIPO_CONSULTA:
Integer motivo = ( ( Integer ) object.get( MarcacaoTrabalhadorData.MOTIVO ) );
descricao = "Consulta " + ( motivo == null ? "" : ("(" + MedicinaDataProvider.TIPOS_CONSULTAS[ motivo.intValue() ] + ")" ) );
break;
}
aviso.set( AvisoData.DESCRICAO, descricao );
cal = Calendar.getInstance();
cal.setTime( dataEvento );
cal.set( cal.get( Calendar.YEAR ), cal.get( Calendar.MONTH ), cal.get( Calendar.DAY_OF_MONTH ), 0, 0, 0 );
cal.set( Calendar.MILLISECOND, 0 );
dataEvento = cal.getTime();
cal = Calendar.getInstance();
cal.set( cal.get( Calendar.YEAR ), cal.get( Calendar.MONTH ), cal.get( Calendar.DAY_OF_MONTH ), 10, 0, 0 );
cal.set( Calendar.MILLISECOND, 0 );
Date hoje = cal.getTime();
if( hoje.before( dataEvento ) )
{
if( !hoje.before( dataAviso ) )
{
aviso.set( AvisoData.DATA_AVISO, dataEvento.clone() );
}
aviso.save();
}
trab.save();
}
else
{
return false;
}
return true;
}
protected boolean preDelete( Marcacao object )
throws Exception
{
if( object instanceof MarcacaoTrabalhadorData &&
( ( Integer ) object.get( MarcacaoTrabalhadorData.TIPO ) ).intValue() == MarcacaoTrabalhadorData.TIPO_EXAMES )
{
if( medicinaProvider == null )
{
medicinaProvider = (MedicinaDataProvider)MedicinaDataProvider.getProvider();
}
medicinaProvider.deleteDetalhesRealizadosForMarcacao( ( Integer ) object.get( MarcacaoTrabalhadorData.ID ) );
return true;
}
return false;
}
protected boolean postDelete( Marcacao object )
throws Exception
{
System.out.println( "!delete!" );
Integer tipo;
if( object instanceof MarcacaoEmpresaData )
{
tipo = new Integer( AvisoData.TIPO_EMPRESA );
}
else if( object instanceof MarcacaoEstabelecimentoData )
{
tipo = new Integer( AvisoData.TIPO_ESTABELECIMENTO );
}
if( object instanceof MarcacaoTrabalhadorData )
{
tipo = new Integer( AvisoData.TIPO_TRABALHADOR );
}
else
{
return false;
}
AvisoData aviso = (AvisoData) JDO.load( AvisoData.class,
new Object[]{ object.get( "id" ), tipo },
new String[]{ AvisoData.EVENTO_ID, AvisoData.TIPO } );
if( aviso != null )
{
aviso.delete();
}
return true;
}
}

@ -1,204 +0,0 @@
/*
* MarcacaoTrabalhador.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on Jan 28, 2006
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.util.Date;
import com.evolute.utils.jdo.JDOInnerObject;
public final class MarcacaoTrabalhador implements JDOInnerObject
{
private Integer id;
private Date data;
private String realizada;
private Integer estado;
private Integer motivo;
private Date data_email;
private Date data_relatorio;
private Integer tipo;
private Trabalhador trabalhador;
private String observacoes;
public MarcacaoTrabalhador()
{
}
public Object getField( String fieldName )
{
if( fieldName == MarcacaoTrabalhadorData.ID )
{
return id;
}
else if( fieldName == MarcacaoTrabalhadorData.DATA )
{
return data;
}
else if( fieldName == MarcacaoTrabalhadorData.REALIZADA )
{
return realizada;
}
else if( fieldName == MarcacaoTrabalhadorData.ESTADO )
{
return estado;
}
else if( fieldName == MarcacaoTrabalhadorData.MOTIVO )
{
return motivo;
}
else if( fieldName == MarcacaoTrabalhadorData.DATA_EMAIL )
{
return data_email;
}
else if( fieldName == MarcacaoTrabalhadorData.DATA_RELATORIO )
{
return data_relatorio;
}
else if( fieldName == MarcacaoTrabalhadorData.TIPO )
{
return tipo;
}
else if( fieldName == MarcacaoTrabalhadorData.TRABALHADOR )
{
return trabalhador;
}
else if( fieldName == MarcacaoTrabalhadorData.OBSERVACOES )
{
return observacoes;
}
else if( fieldName.equals( MarcacaoTrabalhadorData.ID ) )
{
return id;
}
else if( fieldName.equals( MarcacaoTrabalhadorData.DATA ) )
{
return data;
}
else if( fieldName.equals( MarcacaoTrabalhadorData.REALIZADA ) )
{
return realizada;
}
else if( fieldName.equals( MarcacaoTrabalhadorData.ESTADO ) )
{
return estado;
}
else if( fieldName.equals( MarcacaoTrabalhadorData.MOTIVO ) )
{
return motivo;
}
else if( fieldName.equals( MarcacaoTrabalhadorData.DATA_EMAIL ) )
{
return data_email;
}
else if( fieldName.equals( MarcacaoTrabalhadorData.DATA_RELATORIO ) )
{
return data_relatorio;
}
else if( fieldName.equals( MarcacaoTrabalhadorData.TIPO ) )
{
return tipo;
}
else if( fieldName.equals( MarcacaoTrabalhadorData.TRABALHADOR ) )
{
return trabalhador;
}
else if( fieldName.equals( MarcacaoTrabalhadorData.OBSERVACOES ) )
{
return observacoes;
}
return null;
}
public void setField( String fieldName, Object value )
{
if( fieldName == MarcacaoTrabalhadorData.ID )
{
id = ( Integer ) value;
}
else if( fieldName == MarcacaoTrabalhadorData.DATA )
{
data = ( Date ) value;
}
else if( fieldName == MarcacaoTrabalhadorData.REALIZADA )
{
realizada = ( String ) value;
}
else if( fieldName == MarcacaoTrabalhadorData.ESTADO )
{
estado = ( Integer ) value;
}
else if( fieldName == MarcacaoTrabalhadorData.MOTIVO )
{
motivo = ( Integer ) value;
}
else if( fieldName == MarcacaoTrabalhadorData.DATA_EMAIL )
{
data_email = ( Date ) value;
}
else if( fieldName == MarcacaoTrabalhadorData.DATA_RELATORIO )
{
data_relatorio = ( Date ) value;
}
else if( fieldName == MarcacaoTrabalhadorData.TIPO )
{
tipo = ( Integer ) value;
}
else if( fieldName == MarcacaoTrabalhadorData.TRABALHADOR )
{
trabalhador = ( Trabalhador ) value;
}
else if( fieldName == MarcacaoTrabalhadorData.OBSERVACOES )
{
observacoes = ( String ) value;
}
else if( fieldName.equals( MarcacaoTrabalhadorData.ID ) )
{
id = ( Integer ) value;
}
else if( fieldName.equals( MarcacaoTrabalhadorData.DATA ) )
{
data = ( Date ) value;
}
else if( fieldName.equals( MarcacaoTrabalhadorData.REALIZADA ) )
{
realizada = ( String ) value;
}
else if( fieldName.equals( MarcacaoTrabalhadorData.ESTADO ) )
{
estado = ( Integer ) value;
}
else if( fieldName.equals( MarcacaoTrabalhadorData.MOTIVO ) )
{
motivo = ( Integer ) value;
}
else if( fieldName.equals( MarcacaoTrabalhadorData.DATA_EMAIL ) )
{
data_email = ( Date ) value;
}
else if( fieldName.equals( MarcacaoTrabalhadorData.DATA_RELATORIO ) )
{
data_relatorio = ( Date ) value;
}
else if( fieldName.equals( MarcacaoTrabalhadorData.TIPO ) )
{
tipo = ( Integer ) value;
}
else if( fieldName.equals( MarcacaoTrabalhadorData.TRABALHADOR ) )
{
trabalhador = ( Trabalhador ) value;
}
else if( fieldName.equals( MarcacaoTrabalhadorData.OBSERVACOES ) )
{
observacoes = ( String ) value;
}
}
public Class getOuterClass()
{
return MarcacaoTrabalhadorData.class;
}
}

@ -1,68 +0,0 @@
/*
* MarcacaoTrabalhadorData.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on Jan 28, 2006
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.util.HashMap;
public final class MarcacaoTrabalhadorData extends Marcacao
implements MarcacaoTrabalhadorConstants
{
public static final String ID = "id";
public static final String DATA = "data";
public static final String REALIZADA = "realizada";
public static final String ESTADO = "estado";
public static final String MOTIVO = "motivo";
public static final String DATA_EMAIL = "data_email";
public static final String DATA_RELATORIO = "data_relatorio";
public static final String TIPO = "tipo";
public static final String TRABALHADOR = "trabalhador";
public static final String OBSERVACOES = "observacoes";
public static final String FIELD_NAMES[] = new String[]{
DATA, REALIZADA, ESTADO, MOTIVO, DATA_EMAIL, DATA_RELATORIO, TIPO, TRABALHADOR,
OBSERVACOES, };
protected static final String ALL_FIELD_NAMES[] = new String[]{
ID, DATA, REALIZADA, ESTADO, MOTIVO, DATA_EMAIL, DATA_RELATORIO, TIPO, TRABALHADOR,
OBSERVACOES, };
private HashMap dataHash;
public MarcacaoTrabalhadorData()
{
dataHash = new HashMap();
}
protected Object innerGet( String fieldName )
throws Exception
{
return dataHash.get( fieldName );
}
protected void innerSet( String fieldName, Object value )
throws Exception
{
dataHash.put( fieldName, value );
}
public String []getFieldNames()
{
return FIELD_NAMES;
}
protected String []getAllFieldNames()
{
return ALL_FIELD_NAMES;
}
public Class getInnerClass()
{
return MarcacaoTrabalhador.class;
}
}

@ -1,25 +0,0 @@
/*
* MarcacaoTrabalhadorID.java
*
* Generated by com.evolute.codegen.jdo.idclassgenerators.JPOXIDClassGenerator on Jan 28, 2006
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.io.Serializable;
import com.evolute.utils.jdo.jpox.IntegerID;
public final class MarcacaoTrabalhadorID extends IntegerID
implements Serializable
{
public MarcacaoTrabalhadorID()
{
}
public MarcacaoTrabalhadorID( String str )
{
super( str );
}
}

@ -1,100 +0,0 @@
/*
* Medico.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on 27/Jan/2005
*
* Use but DON'T TOUCH
*/
package siprp.data;
import com.evolute.utils.jdo.JDOInnerObject;
public final class Medico implements JDOInnerObject
{
private Integer id;
private String nome;
private String numero_cedula;
private String inactivo;
public Medico()
{
}
public Object getField( String fieldName )
{
if( fieldName == MedicoData.ID )
{
return id;
}
else if( fieldName == MedicoData.NOME )
{
return nome;
}
else if( fieldName == MedicoData.NUMERO_CEDULA )
{
return numero_cedula;
}
else if( fieldName == MedicoData.INACTIVO )
{
return inactivo;
}
else if( fieldName.equals( MedicoData.ID ) )
{
return id;
}
else if( fieldName.equals( MedicoData.NOME ) )
{
return nome;
}
else if( fieldName.equals( MedicoData.NUMERO_CEDULA ) )
{
return numero_cedula;
}
else if( fieldName.equals( MedicoData.INACTIVO ) )
{
return inactivo;
}
return null;
}
public void setField( String fieldName, Object value )
{
if( fieldName == MedicoData.ID )
{
id = ( Integer ) value;
}
else if( fieldName == MedicoData.NOME )
{
nome = ( String ) value;
}
else if( fieldName == MedicoData.NUMERO_CEDULA )
{
numero_cedula = ( String ) value;
}
else if( fieldName == MedicoData.INACTIVO )
{
inactivo = ( String ) value;
}
else if( fieldName.equals( MedicoData.ID ) )
{
id = ( Integer ) value;
}
else if( fieldName.equals( MedicoData.NOME ) )
{
nome = ( String ) value;
}
else if( fieldName.equals( MedicoData.NUMERO_CEDULA ) )
{
numero_cedula = ( String ) value;
}
else if( fieldName.equals( MedicoData.INACTIVO ) )
{
inactivo = ( String ) value;
}
}
public Class getOuterClass()
{
return MedicoData.class;
}
}

@ -1,62 +0,0 @@
/*
* MedicoData.java
*
* Generated by com.evutils.codegen.JDOObjectGenerator on 27/Jan/2005
*
* Use but DON'T TOUCH
*/
package siprp.data;
import java.util.HashMap;
import com.evolute.utils.jdo.JDOObject;
public final class MedicoData extends JDOObject
implements DisableDeleteable
{
public static final String ID = "id";
public static final String NOME = "nome";
public static final String NUMERO_CEDULA = "numero_cedula";
public static final String INACTIVO = "inactivo";
public static final String FIELD_NAMES[] = new String[]{
NOME, NUMERO_CEDULA, };
protected static final String ALL_FIELD_NAMES[] = new String[]{
ID, NOME, NUMERO_CEDULA, INACTIVO, };
private HashMap dataHash;
public MedicoData()
{
dataHash = new HashMap();
}
protected Object innerGet( String fieldName )
throws Exception
{
return dataHash.get( fieldName );
}
protected void innerSet( String fieldName, Object value )
throws Exception
{
dataHash.put( fieldName, value );
}
public String []getFieldNames()
{
return FIELD_NAMES;
}
protected String []getAllFieldNames()
{
return ALL_FIELD_NAMES;
}
public Class getInnerClass()
{
return Medico.class;
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save