From: Michele Silva Date: Wed, 26 Oct 2011 16:46:32 +0000 (-0200) Subject: Initial import. X-Git-Url: http://200.18.67.61/gitweb/?a=commitdiff_plain;h=59e4c94ab159eb155adc5e1a2e402819f54bf6bd;p=simdecs_seam.git Initial import. --- diff --git a/SimDeCS/.classpath b/SimDeCS/.classpath new file mode 100644 index 0000000..e86686f --- /dev/null +++ b/SimDeCS/.classpath @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/SimDeCS/.project b/SimDeCS/.project new file mode 100644 index 0000000..4bba974 --- /dev/null +++ b/SimDeCS/.project @@ -0,0 +1,49 @@ + + + SimDeCS + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.jboss.tools.jst.web.kb.kbbuilder + + + + + org.jboss.tools.seam.core.seambuilder + + + + + org.hibernate.eclipse.console.hibernateBuilder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + org.jboss.tools.jsf.jsfnature + org.jboss.tools.jst.web.kb.kbnature + org.jboss.tools.seam.core.seamnature + org.hibernate.eclipse.console.hibernateNature + + diff --git a/SimDeCS/.settings/org.eclipse.jdt.core.prefs b/SimDeCS/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..cbda75d --- /dev/null +++ b/SimDeCS/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,12 @@ +#Sat Aug 13 08:15:35 BRT 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/SimDeCS/.settings/org.eclipse.jst.j2ee.ejb.annotations.xdoclet.prefs b/SimDeCS/.settings/org.eclipse.jst.j2ee.ejb.annotations.xdoclet.prefs new file mode 100644 index 0000000..38989f5 --- /dev/null +++ b/SimDeCS/.settings/org.eclipse.jst.j2ee.ejb.annotations.xdoclet.prefs @@ -0,0 +1,6 @@ +#Sat Aug 13 08:25:30 BRT 2011 +XDOCLETBUILDERACTIVE=true +XDOCLETHOME= +XDOCLETUSEGLOBAL=true +XDOCLETVERSION=1.2.1 +eclipse.preferences.version=1 diff --git a/SimDeCS/.settings/org.eclipse.wst.common.component b/SimDeCS/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..567cf5f --- /dev/null +++ b/SimDeCS/.settings/org.eclipse.wst.common.component @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/SimDeCS/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml b/SimDeCS/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml new file mode 100644 index 0000000..8c42ed3 --- /dev/null +++ b/SimDeCS/.settings/org.eclipse.wst.common.project.facet.core.prefs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/SimDeCS/.settings/org.eclipse.wst.common.project.facet.core.xml b/SimDeCS/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..2c5c118 --- /dev/null +++ b/SimDeCS/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/SimDeCS/.settings/org.eclipse.wst.xsl.core.prefs b/SimDeCS/.settings/org.eclipse.wst.xsl.core.prefs new file mode 100644 index 0000000..fce25a4 --- /dev/null +++ b/SimDeCS/.settings/org.eclipse.wst.xsl.core.prefs @@ -0,0 +1,12 @@ +#Sat Aug 13 08:25:30 BRT 2011 +CHECK_CALL_TEMPLATES=2 +CHECK_XPATHS=2 +CIRCULAR_REF=2 +DUPLICATE_PARAMETER=2 +EMPTY_PARAM=1 +MISSING_INCLUDE=2 +MISSING_PARAM=1 +NAME_ATTRIBUTE_EMPTY=2 +NAME_ATTRIBUTE_MISSING=2 +TEMPLATE_CONFLICT=2 +eclipse.preferences.version=1 diff --git a/SimDeCS/.settings/org.hibernate.eclipse.console.prefs b/SimDeCS/.settings/org.hibernate.eclipse.console.prefs new file mode 100644 index 0000000..0f89762 --- /dev/null +++ b/SimDeCS/.settings/org.hibernate.eclipse.console.prefs @@ -0,0 +1,4 @@ +#Thu Apr 21 18:54:36 BRT 2011 +default.configuration=SimDeCS +eclipse.preferences.version=1 +hibernate3.enabled=true diff --git a/SimDeCS/.settings/org.jboss.ide.eclipse.as.core.prefs b/SimDeCS/.settings/org.jboss.ide.eclipse.as.core.prefs new file mode 100644 index 0000000..2697bf5 --- /dev/null +++ b/SimDeCS/.settings/org.jboss.ide.eclipse.as.core.prefs @@ -0,0 +1,3 @@ +#Sat Aug 13 09:07:37 BRT 2011 +eclipse.preferences.version=1 +org.jboss.ide.eclipse.as.core.singledeployable.deployableList= diff --git a/SimDeCS/.settings/org.jboss.tools.seam.core.prefs b/SimDeCS/.settings/org.jboss.tools.seam.core.prefs new file mode 100644 index 0000000..94ad7ab --- /dev/null +++ b/SimDeCS/.settings/org.jboss.tools.seam.core.prefs @@ -0,0 +1,17 @@ +#Sat Aug 13 08:15:27 BRT 2011 +action.package=org.ufcspa.simdecs.session +action.sources=/SimDeCS/src/hot +eclipse.preferences.version=1 +model.package=org.ufcspa.simdecs.entity +model.sources=/SimDeCS/src/main +seam.ejb.project=SimDeCS +seam.project.connection.profile=SimDeCS Database +seam.project.deployment.type=war +seam.project.settings.version=1.1 +seam.project.web.root.folder=/SimDeCS/WebContent +seam.runtime.name=jboss-seam-2.2.1 +seam.settings.changed.by.user=true +seam.test.creating=false +seam.test.project=SimDeCS-test +test.package=org.domain.simdecs.test +test.sources=/SimDeCS-test/test-src diff --git a/SimDeCS/SimDeCS.launch b/SimDeCS/SimDeCS.launch new file mode 100644 index 0000000..ac469d7 --- /dev/null +++ b/SimDeCS/SimDeCS.launch @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/SimDeCS/WebContent/META-INF/MANIFEST.MF b/SimDeCS/WebContent/META-INF/MANIFEST.MF new file mode 100644 index 0000000..5e94951 --- /dev/null +++ b/SimDeCS/WebContent/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/SimDeCS/WebContent/WEB-INF/SimDeCS-ds.xml b/SimDeCS/WebContent/WEB-INF/SimDeCS-ds.xml new file mode 100644 index 0000000..ca0b305 --- /dev/null +++ b/SimDeCS/WebContent/WEB-INF/SimDeCS-ds.xml @@ -0,0 +1,16 @@ + + + + + + SimDeCSDatasource + true + jdbc:postgresql://localhost:5432/simdecs + org.postgresql.Driver + simdecs + tatuira + + + diff --git a/SimDeCS/WebContent/WEB-INF/components.xml b/SimDeCS/WebContent/WEB-INF/components.xml new file mode 100644 index 0000000..1de84a9 --- /dev/null +++ b/SimDeCS/WebContent/WEB-INF/components.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + /security.drl + + + + + + + + + + + + + + + + + + + diff --git a/SimDeCS/WebContent/WEB-INF/faces-config.xml b/SimDeCS/WebContent/WEB-INF/faces-config.xml new file mode 100644 index 0000000..0a19858 --- /dev/null +++ b/SimDeCS/WebContent/WEB-INF/faces-config.xml @@ -0,0 +1,21 @@ + + + + + com.sun.facelets.FaceletViewHandler + + pt_BR + en + bg + de + en + fr + tr + + + + diff --git a/SimDeCS/WebContent/WEB-INF/jboss-web.xml b/SimDeCS/WebContent/WEB-INF/jboss-web.xml new file mode 100644 index 0000000..d4db00f --- /dev/null +++ b/SimDeCS/WebContent/WEB-INF/jboss-web.xml @@ -0,0 +1,11 @@ + + + + + seam.jboss.org:loader=SimDeCS + java2ParentDelegation=false + + + diff --git a/SimDeCS/WebContent/WEB-INF/lib/antlr-runtime.jar b/SimDeCS/WebContent/WEB-INF/lib/antlr-runtime.jar new file mode 100644 index 0000000..d90a086 Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/antlr-runtime.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/commons-beanutils.jar b/SimDeCS/WebContent/WEB-INF/lib/commons-beanutils.jar new file mode 100644 index 0000000..b1b89c9 Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/commons-beanutils.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/commons-digester.jar b/SimDeCS/WebContent/WEB-INF/lib/commons-digester.jar new file mode 100644 index 0000000..7abda96 Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/commons-digester.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/core.jar b/SimDeCS/WebContent/WEB-INF/lib/core.jar new file mode 100644 index 0000000..310fe9f Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/core.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/drools-api.jar b/SimDeCS/WebContent/WEB-INF/lib/drools-api.jar new file mode 100644 index 0000000..d33d6c6 Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/drools-api.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/drools-compiler.jar b/SimDeCS/WebContent/WEB-INF/lib/drools-compiler.jar new file mode 100644 index 0000000..02b719a Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/drools-compiler.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/drools-core.jar b/SimDeCS/WebContent/WEB-INF/lib/drools-core.jar new file mode 100644 index 0000000..7e8b791 Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/drools-core.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/itext-rtf.jar b/SimDeCS/WebContent/WEB-INF/lib/itext-rtf.jar new file mode 100644 index 0000000..3f6f50a Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/itext-rtf.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/itext.jar b/SimDeCS/WebContent/WEB-INF/lib/itext.jar new file mode 100644 index 0000000..b81af6e Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/itext.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/jboss-el.jar b/SimDeCS/WebContent/WEB-INF/lib/jboss-el.jar new file mode 100644 index 0000000..d4a893f Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/jboss-el.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-debug.jar b/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-debug.jar new file mode 100644 index 0000000..dd105ba Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-debug.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-excel.jar b/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-excel.jar new file mode 100644 index 0000000..016030b Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-excel.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-ioc.jar b/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-ioc.jar new file mode 100644 index 0000000..d5eb47c Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-ioc.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-mail.jar b/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-mail.jar new file mode 100644 index 0000000..d88d434 Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-mail.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-pdf.jar b/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-pdf.jar new file mode 100644 index 0000000..45901f5 Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-pdf.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-remoting.jar b/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-remoting.jar new file mode 100644 index 0000000..efd0a7d Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-remoting.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-ui.jar b/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-ui.jar new file mode 100644 index 0000000..4183828 Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/jboss-seam-ui.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/jboss-seam.jar b/SimDeCS/WebContent/WEB-INF/lib/jboss-seam.jar new file mode 100644 index 0000000..28b5cd4 Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/jboss-seam.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/jbpm-jpdl.jar b/SimDeCS/WebContent/WEB-INF/lib/jbpm-jpdl.jar new file mode 100644 index 0000000..6495b33 Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/jbpm-jpdl.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/jcommon.jar b/SimDeCS/WebContent/WEB-INF/lib/jcommon.jar new file mode 100644 index 0000000..4cd6807 Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/jcommon.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/jfreechart.jar b/SimDeCS/WebContent/WEB-INF/lib/jfreechart.jar new file mode 100644 index 0000000..8b9f952 Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/jfreechart.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/jsf-facelets.jar b/SimDeCS/WebContent/WEB-INF/lib/jsf-facelets.jar new file mode 100644 index 0000000..5830289 Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/jsf-facelets.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/jxl.jar b/SimDeCS/WebContent/WEB-INF/lib/jxl.jar new file mode 100644 index 0000000..e120802 Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/jxl.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/mvel2.jar b/SimDeCS/WebContent/WEB-INF/lib/mvel2.jar new file mode 100644 index 0000000..03b1463 Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/mvel2.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/richfaces-api.jar b/SimDeCS/WebContent/WEB-INF/lib/richfaces-api.jar new file mode 100644 index 0000000..0aeb97a Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/richfaces-api.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/richfaces-impl.jar b/SimDeCS/WebContent/WEB-INF/lib/richfaces-impl.jar new file mode 100644 index 0000000..6c61a7f Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/richfaces-impl.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/lib/richfaces-ui.jar b/SimDeCS/WebContent/WEB-INF/lib/richfaces-ui.jar new file mode 100644 index 0000000..6b02e05 Binary files /dev/null and b/SimDeCS/WebContent/WEB-INF/lib/richfaces-ui.jar differ diff --git a/SimDeCS/WebContent/WEB-INF/pages.xml b/SimDeCS/WebContent/WEB-INF/pages.xml new file mode 100644 index 0000000..1ea222c --- /dev/null +++ b/SimDeCS/WebContent/WEB-INF/pages.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + Record not found + + + + + + Record not found + + + + + + Duplicate record + + + + + + + Another user changed the same data, please try again + + + + + + You don't have permission to access this resource + + + + + + Por favor, efetue login para acessar este recurso! + + + + + + Your session has timed out, please try again + + + + + + + + + + Unexpected error, please try again + + + + diff --git a/SimDeCS/WebContent/WEB-INF/web.xml b/SimDeCS/WebContent/WEB-INF/web.xml new file mode 100644 index 0000000..81a5428 --- /dev/null +++ b/SimDeCS/WebContent/WEB-INF/web.xml @@ -0,0 +1,64 @@ + + + SimDeCS + + index.html + index.htm + index.jsp + default.html + default.htm + default.jsp + + + Faces Servlet + javax.faces.webapp.FacesServlet + 1 + + + Faces Servlet + *.seam + + + org.jboss.jbossfaces.JSF_CONFIG_NAME + Mojarra-1.2 + + + org.richfaces.SKIN + DEFAULT + + + org.jboss.seam.servlet.SeamListener + + + Seam Filter + org.jboss.seam.servlet.SeamFilter + + + Seam Filter + /* + + + Seam Resource Servlet + org.jboss.seam.servlet.SeamResourceServlet + + + Seam Resource Servlet + /seam/resource/* + + + facelets.DEVELOPMENT + true + + + javax.faces.DEFAULT_SUFFIX + .xhtml + + + Restrict raw XHTML Documents + + XHTML + *.xhtml + + + + \ No newline at end of file diff --git a/SimDeCS/WebContent/error.xhtml b/SimDeCS/WebContent/error.xhtml new file mode 100644 index 0000000..a4a2af1 --- /dev/null +++ b/SimDeCS/WebContent/error.xhtml @@ -0,0 +1,19 @@ + + + + + + +

Error

+

Something bad happened :-(

+ + + +
+
diff --git a/SimDeCS/WebContent/home.xhtml b/SimDeCS/WebContent/home.xhtml new file mode 100644 index 0000000..47ecd8d --- /dev/null +++ b/SimDeCS/WebContent/home.xhtml @@ -0,0 +1,26 @@ + + + + + +

Bem vindo SimDeCs!

+ + + + +

Simulador de Tomadas de Decisão em Cuidados de Saúde:

+

Ambiente de aprendizado multiagente na área da saúde.

+
+ +
+
+ +
+
diff --git a/SimDeCS/WebContent/img/btnmanageroles.png b/SimDeCS/WebContent/img/btnmanageroles.png new file mode 100644 index 0000000..b70ce6e Binary files /dev/null and b/SimDeCS/WebContent/img/btnmanageroles.png differ diff --git a/SimDeCS/WebContent/img/btnmanageusers.png b/SimDeCS/WebContent/img/btnmanageusers.png new file mode 100644 index 0000000..6f15ae4 Binary files /dev/null and b/SimDeCS/WebContent/img/btnmanageusers.png differ diff --git a/SimDeCS/WebContent/img/btnnewpermission.png b/SimDeCS/WebContent/img/btnnewpermission.png new file mode 100644 index 0000000..e0a23f6 Binary files /dev/null and b/SimDeCS/WebContent/img/btnnewpermission.png differ diff --git a/SimDeCS/WebContent/img/btnnewrole.png b/SimDeCS/WebContent/img/btnnewrole.png new file mode 100644 index 0000000..3b457cc Binary files /dev/null and b/SimDeCS/WebContent/img/btnnewrole.png differ diff --git a/SimDeCS/WebContent/img/btnnewuser.png b/SimDeCS/WebContent/img/btnnewuser.png new file mode 100644 index 0000000..e1a563f Binary files /dev/null and b/SimDeCS/WebContent/img/btnnewuser.png differ diff --git a/SimDeCS/WebContent/img/dtpick.gif b/SimDeCS/WebContent/img/dtpick.gif new file mode 100644 index 0000000..8526cf5 Binary files /dev/null and b/SimDeCS/WebContent/img/dtpick.gif differ diff --git a/SimDeCS/WebContent/img/error.gif b/SimDeCS/WebContent/img/error.gif new file mode 100644 index 0000000..34d667d Binary files /dev/null and b/SimDeCS/WebContent/img/error.gif differ diff --git a/SimDeCS/WebContent/img/false.png b/SimDeCS/WebContent/img/false.png new file mode 100644 index 0000000..fbe46a5 Binary files /dev/null and b/SimDeCS/WebContent/img/false.png differ diff --git a/SimDeCS/WebContent/img/manytoone.gif b/SimDeCS/WebContent/img/manytoone.gif new file mode 100644 index 0000000..5e05f71 Binary files /dev/null and b/SimDeCS/WebContent/img/manytoone.gif differ diff --git a/SimDeCS/WebContent/img/msgerror.png b/SimDeCS/WebContent/img/msgerror.png new file mode 100644 index 0000000..d94cf89 Binary files /dev/null and b/SimDeCS/WebContent/img/msgerror.png differ diff --git a/SimDeCS/WebContent/img/msginfo.png b/SimDeCS/WebContent/img/msginfo.png new file mode 100644 index 0000000..fb9031c Binary files /dev/null and b/SimDeCS/WebContent/img/msginfo.png differ diff --git a/SimDeCS/WebContent/img/msgwarn.png b/SimDeCS/WebContent/img/msgwarn.png new file mode 100644 index 0000000..69a83fb Binary files /dev/null and b/SimDeCS/WebContent/img/msgwarn.png differ diff --git a/SimDeCS/WebContent/img/onetomany.gif b/SimDeCS/WebContent/img/onetomany.gif new file mode 100644 index 0000000..982d5e5 Binary files /dev/null and b/SimDeCS/WebContent/img/onetomany.gif differ diff --git a/SimDeCS/WebContent/img/seamlogo.png b/SimDeCS/WebContent/img/seamlogo.png new file mode 100644 index 0000000..ab274a6 Binary files /dev/null and b/SimDeCS/WebContent/img/seamlogo.png differ diff --git a/SimDeCS/WebContent/img/simdecs-logo.png b/SimDeCS/WebContent/img/simdecs-logo.png new file mode 100644 index 0000000..c10d714 Binary files /dev/null and b/SimDeCS/WebContent/img/simdecs-logo.png differ diff --git a/SimDeCS/WebContent/img/true.png b/SimDeCS/WebContent/img/true.png new file mode 100644 index 0000000..f449096 Binary files /dev/null and b/SimDeCS/WebContent/img/true.png differ diff --git a/SimDeCS/WebContent/img/unasus.jpg b/SimDeCS/WebContent/img/unasus.jpg new file mode 100644 index 0000000..78be850 Binary files /dev/null and b/SimDeCS/WebContent/img/unasus.jpg differ diff --git a/SimDeCS/WebContent/img/vrmed/bodyEditarDiagrama.png b/SimDeCS/WebContent/img/vrmed/bodyEditarDiagrama.png new file mode 100644 index 0000000..e04a1ff Binary files /dev/null and b/SimDeCS/WebContent/img/vrmed/bodyEditarDiagrama.png differ diff --git a/SimDeCS/WebContent/img/vrmed/bodyExcluirDiagrama.png b/SimDeCS/WebContent/img/vrmed/bodyExcluirDiagrama.png new file mode 100644 index 0000000..197b376 Binary files /dev/null and b/SimDeCS/WebContent/img/vrmed/bodyExcluirDiagrama.png differ diff --git a/SimDeCS/WebContent/img/vrmed/bodyNovoDiagrama.png b/SimDeCS/WebContent/img/vrmed/bodyNovoDiagrama.png new file mode 100644 index 0000000..4c28a8f Binary files /dev/null and b/SimDeCS/WebContent/img/vrmed/bodyNovoDiagrama.png differ diff --git a/SimDeCS/WebContent/img/vrmed/cenarios/cenarioCasa.png b/SimDeCS/WebContent/img/vrmed/cenarios/cenarioCasa.png new file mode 100644 index 0000000..b9ec799 Binary files /dev/null and b/SimDeCS/WebContent/img/vrmed/cenarios/cenarioCasa.png differ diff --git a/SimDeCS/WebContent/img/vrmed/cenarios/cenarioHospital.png b/SimDeCS/WebContent/img/vrmed/cenarios/cenarioHospital.png new file mode 100644 index 0000000..7fed6c3 Binary files /dev/null and b/SimDeCS/WebContent/img/vrmed/cenarios/cenarioHospital.png differ diff --git a/SimDeCS/WebContent/img/vrmed/cenarios/cenarioUBS.png b/SimDeCS/WebContent/img/vrmed/cenarios/cenarioUBS.png new file mode 100644 index 0000000..698f527 Binary files /dev/null and b/SimDeCS/WebContent/img/vrmed/cenarios/cenarioUBS.png differ diff --git a/SimDeCS/WebContent/img/vrmed/footerEditarDiagrama.png b/SimDeCS/WebContent/img/vrmed/footerEditarDiagrama.png new file mode 100644 index 0000000..ff100dd Binary files /dev/null and b/SimDeCS/WebContent/img/vrmed/footerEditarDiagrama.png differ diff --git a/SimDeCS/WebContent/img/vrmed/footerExcluirDiagrama.png b/SimDeCS/WebContent/img/vrmed/footerExcluirDiagrama.png new file mode 100644 index 0000000..aac27a6 Binary files /dev/null and b/SimDeCS/WebContent/img/vrmed/footerExcluirDiagrama.png differ diff --git a/SimDeCS/WebContent/img/vrmed/footerNovoDiagrama.png b/SimDeCS/WebContent/img/vrmed/footerNovoDiagrama.png new file mode 100644 index 0000000..2a19020 Binary files /dev/null and b/SimDeCS/WebContent/img/vrmed/footerNovoDiagrama.png differ diff --git a/SimDeCS/WebContent/img/vrmed/headerEditarDiagrama.png b/SimDeCS/WebContent/img/vrmed/headerEditarDiagrama.png new file mode 100644 index 0000000..67fd19d Binary files /dev/null and b/SimDeCS/WebContent/img/vrmed/headerEditarDiagrama.png differ diff --git a/SimDeCS/WebContent/img/vrmed/headerExcluirDiagrama.png b/SimDeCS/WebContent/img/vrmed/headerExcluirDiagrama.png new file mode 100644 index 0000000..a4b99ca Binary files /dev/null and b/SimDeCS/WebContent/img/vrmed/headerExcluirDiagrama.png differ diff --git a/SimDeCS/WebContent/img/vrmed/headerNovoDiagrama.png b/SimDeCS/WebContent/img/vrmed/headerNovoDiagrama.png new file mode 100644 index 0000000..fad6d21 Binary files /dev/null and b/SimDeCS/WebContent/img/vrmed/headerNovoDiagrama.png differ diff --git a/SimDeCS/WebContent/img/vrmed/inteira.png b/SimDeCS/WebContent/img/vrmed/inteira.png new file mode 100644 index 0000000..158b669 Binary files /dev/null and b/SimDeCS/WebContent/img/vrmed/inteira.png differ diff --git a/SimDeCS/WebContent/index.html b/SimDeCS/WebContent/index.html new file mode 100644 index 0000000..a6974eb --- /dev/null +++ b/SimDeCS/WebContent/index.html @@ -0,0 +1 @@ + diff --git a/SimDeCS/WebContent/layout/display.xhtml b/SimDeCS/WebContent/layout/display.xhtml new file mode 100644 index 0000000..ea92dee --- /dev/null +++ b/SimDeCS/WebContent/layout/display.xhtml @@ -0,0 +1,16 @@ + + +
+ + + + + + +
+ +
diff --git a/SimDeCS/WebContent/layout/edit.xhtml b/SimDeCS/WebContent/layout/edit.xhtml new file mode 100644 index 0000000..9728c2c --- /dev/null +++ b/SimDeCS/WebContent/layout/edit.xhtml @@ -0,0 +1,27 @@ + + +
+ + + + * + + + + + + + + + + + + + +
+ +
diff --git a/SimDeCS/WebContent/layout/menu.xhtml b/SimDeCS/WebContent/layout/menu.xhtml new file mode 100644 index 0000000..3d91a3b --- /dev/null +++ b/SimDeCS/WebContent/layout/menu.xhtml @@ -0,0 +1,56 @@ + + + + + + + Cadastros + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SimDeCS/WebContent/layout/sort.xhtml b/SimDeCS/WebContent/layout/sort.xhtml new file mode 100644 index 0000000..cbe30fc --- /dev/null +++ b/SimDeCS/WebContent/layout/sort.xhtml @@ -0,0 +1,11 @@ + + + + + + diff --git a/SimDeCS/WebContent/layout/template.xhtml b/SimDeCS/WebContent/layout/template.xhtml new file mode 100644 index 0000000..23c3caa --- /dev/null +++ b/SimDeCS/WebContent/layout/template.xhtml @@ -0,0 +1,39 @@ + + + + + + + + SimDeCS + + + + + + + + + +
+ + +
+ + + +
diff --git a/SimDeCS/WebContent/login.page.xml b/SimDeCS/WebContent/login.page.xml new file mode 100644 index 0000000..3818f57 --- /dev/null +++ b/SimDeCS/WebContent/login.page.xml @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/SimDeCS/WebContent/login.xhtml b/SimDeCS/WebContent/login.xhtml new file mode 100644 index 0000000..64125dc --- /dev/null +++ b/SimDeCS/WebContent/login.xhtml @@ -0,0 +1,46 @@ + + + + + + + + + Acesso ao SimDeCS + +

Informe abaixo seu usuário e senha:

+ +
+ + Usuário + + Senha + + Lembrar-me + + + &nbpsp; + + +
+ +

+ Atenção - A senha diferencia letras maiúsculas e minúsculas. +

+
+ + +
+ +
+
diff --git a/SimDeCS/WebContent/projectConverter.xhtml b/SimDeCS/WebContent/projectConverter.xhtml new file mode 100644 index 0000000..cefac26 --- /dev/null +++ b/SimDeCS/WebContent/projectConverter.xhtml @@ -0,0 +1,28 @@ + + + + + + + projectConverter + + + + + + + + + + + + diff --git a/SimDeCS/WebContent/seguro/admin/grupo/Grupo.page.xml b/SimDeCS/WebContent/seguro/admin/grupo/Grupo.page.xml new file mode 100644 index 0000000..b099cf9 --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/grupo/Grupo.page.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/SimDeCS/WebContent/seguro/admin/grupo/Grupo.xhtml b/SimDeCS/WebContent/seguro/admin/grupo/Grupo.xhtml new file mode 100644 index 0000000..30f06d7 --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/grupo/Grupo.xhtml @@ -0,0 +1,73 @@ + + + + + + + Grupo + + + + Ativo + + + + + Nome + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + +
+ + + + + + + + + diff --git a/SimDeCS/WebContent/seguro/admin/grupo/GrupoEdit.page.xml b/SimDeCS/WebContent/seguro/admin/grupo/GrupoEdit.page.xml new file mode 100644 index 0000000..ee149f8 --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/grupo/GrupoEdit.page.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SimDeCS/WebContent/seguro/admin/grupo/GrupoEdit.xhtml b/SimDeCS/WebContent/seguro/admin/grupo/GrupoEdit.xhtml new file mode 100644 index 0000000..9ce2c91 --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/grupo/GrupoEdit.xhtml @@ -0,0 +1,111 @@ + + + + + + + + + #{grupoHome.managed ? 'Editar' : 'Novo'} Grupo + + + + + Ativo + + + + + + Nome + + + + + + + + +
+ * + Informações Obrigatórias +
+ + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+
+ +
+ +
diff --git a/SimDeCS/WebContent/seguro/admin/grupo/GrupoList.page.xml b/SimDeCS/WebContent/seguro/admin/grupo/GrupoList.page.xml new file mode 100644 index 0000000..2c40722 --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/grupo/GrupoList.page.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + diff --git a/SimDeCS/WebContent/seguro/admin/grupo/GrupoList.xhtml b/SimDeCS/WebContent/seguro/admin/grupo/GrupoList.xhtml new file mode 100644 index 0000000..fcf99ce --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/grupo/GrupoList.xhtml @@ -0,0 +1,150 @@ + + + + + + + + + + + Nome + + + + + Opções de Pesquisa + + + + + + + + +
+ + +
+ +
+ + + Resultados da Pesquisa (#{empty grupoList.resultList ? 0 : (grupoList.paginated ? grupoList.resultCount : grupoList.resultList.size)}) +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ação + + + + #{' '} + + + + + + +
+
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ +
diff --git a/SimDeCS/WebContent/seguro/admin/instituicao/Instituicao.page.xml b/SimDeCS/WebContent/seguro/admin/instituicao/Instituicao.page.xml new file mode 100644 index 0000000..b7c9ebd --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/instituicao/Instituicao.page.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/SimDeCS/WebContent/seguro/admin/instituicao/Instituicao.xhtml b/SimDeCS/WebContent/seguro/admin/instituicao/Instituicao.xhtml new file mode 100644 index 0000000..275b828 --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/instituicao/Instituicao.xhtml @@ -0,0 +1,49 @@ + + + + + + + Instituição + + + Nome + + + + + Endereço + + + + + Telefone + + + +
+ + + +
+ + + + + +
+ + + + diff --git a/SimDeCS/WebContent/seguro/admin/instituicao/InstituicaoEdit.page.xml b/SimDeCS/WebContent/seguro/admin/instituicao/InstituicaoEdit.page.xml new file mode 100644 index 0000000..59ec3f3 --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/instituicao/InstituicaoEdit.page.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SimDeCS/WebContent/seguro/admin/instituicao/InstituicaoEdit.xhtml b/SimDeCS/WebContent/seguro/admin/instituicao/InstituicaoEdit.xhtml new file mode 100644 index 0000000..6bfc029 --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/instituicao/InstituicaoEdit.xhtml @@ -0,0 +1,96 @@ + + + + + + + + + #{instituicaoHome.managed ? 'Editar' : 'Nova'} Instituição + + + + Nome + + + + + + + + Endereço + + + + + + + + Telefone + + + + + +
+ * + Informações Obrigatórias +
+ +
+ +
+ + + + + + + + + + + +
+
+ +
+ +
diff --git a/SimDeCS/WebContent/seguro/admin/instituicao/InstituicaoList.page.xml b/SimDeCS/WebContent/seguro/admin/instituicao/InstituicaoList.page.xml new file mode 100644 index 0000000..71215a4 --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/instituicao/InstituicaoList.page.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/SimDeCS/WebContent/seguro/admin/instituicao/InstituicaoList.xhtml b/SimDeCS/WebContent/seguro/admin/instituicao/InstituicaoList.xhtml new file mode 100644 index 0000000..c3f4465 --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/instituicao/InstituicaoList.xhtml @@ -0,0 +1,170 @@ + + + + + + + + + + + Nome + + + + + Endereço + + + + + Telefone + + + + + Opções de Pesquisa + + + + + + + + +
+ + +
+ +
+ + + Resultados da Pesquisa (#{empty instituicaoList.resultList ? 0 : (instituicaoList.paginated ? instituicaoList.resultCount : instituicaoList.resultList.size)}) +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ação + + + + #{' '} + + + + + + +
+
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ +
diff --git a/SimDeCS/WebContent/seguro/admin/privilegio/Privilegio.page.xml b/SimDeCS/WebContent/seguro/admin/privilegio/Privilegio.page.xml new file mode 100644 index 0000000..9f9e330 --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/privilegio/Privilegio.page.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/SimDeCS/WebContent/seguro/admin/privilegio/Privilegio.xhtml b/SimDeCS/WebContent/seguro/admin/privilegio/Privilegio.xhtml new file mode 100644 index 0000000..10b2c2a --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/privilegio/Privilegio.xhtml @@ -0,0 +1,45 @@ + + + + + + + Privilégio + + + + Nome + + + + + Token + + + +
+ + + +
+ + + + + +
+ + + + diff --git a/SimDeCS/WebContent/seguro/admin/privilegio/PrivilegioEdit.page.xml b/SimDeCS/WebContent/seguro/admin/privilegio/PrivilegioEdit.page.xml new file mode 100644 index 0000000..5be209c --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/privilegio/PrivilegioEdit.page.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SimDeCS/WebContent/seguro/admin/privilegio/PrivilegioEdit.xhtml b/SimDeCS/WebContent/seguro/admin/privilegio/PrivilegioEdit.xhtml new file mode 100644 index 0000000..5963b67 --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/privilegio/PrivilegioEdit.xhtml @@ -0,0 +1,83 @@ + + + + + + + + + #{privilegioHome.managed ? 'Editar' : 'Novo'} Privilégio + + + Nome + + + + + + + + Token + + + +
+ * + Informações Obrigatórias +
+ +
+ +
+ + + + + + + + + + + +
+
+ +
+ +
diff --git a/SimDeCS/WebContent/seguro/admin/privilegio/PrivilegioList.page.xml b/SimDeCS/WebContent/seguro/admin/privilegio/PrivilegioList.page.xml new file mode 100644 index 0000000..0afdb31 --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/privilegio/PrivilegioList.page.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/SimDeCS/WebContent/seguro/admin/privilegio/PrivilegioList.xhtml b/SimDeCS/WebContent/seguro/admin/privilegio/PrivilegioList.xhtml new file mode 100644 index 0000000..96c468c --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/privilegio/PrivilegioList.xhtml @@ -0,0 +1,155 @@ + + + + + + + + + + + Nome + + + + + Token + + + + + Opções de Pesquisa + + + + + + + + +
+ + +
+ +
+ + + Resultados da Pesquisa(#{empty privilegioList.resultList ? 0 : (privilegioList.paginated ? privilegioList.resultCount : privilegioList.resultList.size)}) +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Action + + + + #{' '} + + + + + + +
+
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ +
diff --git a/SimDeCS/WebContent/seguro/admin/regra/Regra.page.xml b/SimDeCS/WebContent/seguro/admin/regra/Regra.page.xml new file mode 100644 index 0000000..45588fa --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/regra/Regra.page.xml @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/SimDeCS/WebContent/seguro/admin/regra/Regra.xhtml b/SimDeCS/WebContent/seguro/admin/regra/Regra.xhtml new file mode 100644 index 0000000..2188dfb --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/regra/Regra.xhtml @@ -0,0 +1,44 @@ + + + + + + + Regra + + + + Nome + + + + + Token + + + +
+ + + +
+ + + + +
+ + + + diff --git a/SimDeCS/WebContent/seguro/admin/regra/RegraEdit.page.xml b/SimDeCS/WebContent/seguro/admin/regra/RegraEdit.page.xml new file mode 100644 index 0000000..d8b3d44 --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/regra/RegraEdit.page.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SimDeCS/WebContent/seguro/admin/regra/RegraEdit.xhtml b/SimDeCS/WebContent/seguro/admin/regra/RegraEdit.xhtml new file mode 100644 index 0000000..a5be9a8 --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/regra/RegraEdit.xhtml @@ -0,0 +1,86 @@ + + + + + + + + + #{regraHome.managed ? 'Editar' : 'Nova'} Regra + + + + + + Nome + + + + + + + + Token + + + +
+ * + Informações Obrigatórias +
+ +
+ +
+ + + + + + + + + + + +
+
+ +
+ +
diff --git a/SimDeCS/WebContent/seguro/admin/regra/RegraList.page.xml b/SimDeCS/WebContent/seguro/admin/regra/RegraList.page.xml new file mode 100644 index 0000000..ba4648d --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/regra/RegraList.page.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + diff --git a/SimDeCS/WebContent/seguro/admin/regra/RegraList.xhtml b/SimDeCS/WebContent/seguro/admin/regra/RegraList.xhtml new file mode 100644 index 0000000..2854134 --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/regra/RegraList.xhtml @@ -0,0 +1,155 @@ + + + + + + + + + + + Nome + + + + + Token + + + + + Opções de Pesquisa + + + + + + + + +
+ + +
+ +
+ + + Resultados da Pesquisa(#{empty regraList.resultList ? 0 : (regraList.paginated ? regraList.resultCount : regraList.resultList.size)}) +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ação + + + + #{' '} + + + + + + +
+
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ +
diff --git a/SimDeCS/WebContent/seguro/admin/usuario/Usuario.page.xml b/SimDeCS/WebContent/seguro/admin/usuario/Usuario.page.xml new file mode 100644 index 0000000..04b7fc7 --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/usuario/Usuario.page.xml @@ -0,0 +1,9 @@ + + + + + + + diff --git a/SimDeCS/WebContent/seguro/admin/usuario/Usuario.xhtml b/SimDeCS/WebContent/seguro/admin/usuario/Usuario.xhtml new file mode 100644 index 0000000..4dd6fe7 --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/usuario/Usuario.xhtml @@ -0,0 +1,145 @@ + + + + + + + Usuário + + + + Aprovado + + + + + Ativo + + + + + Data criacao + + + + + + + Data nascimento + + + + + + + Email + + + + + Funcao + + + + + Login + + + + + Nome + + + + + Senha + + + + + Sexo + + + + + Telefone + + + +
+ + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + Criado por + +
+ + + + + + Id + + + + Nome + + + + Ação + + + + + + +
+
+
+ + + diff --git a/SimDeCS/WebContent/seguro/admin/usuario/UsuarioEdit.page.xml b/SimDeCS/WebContent/seguro/admin/usuario/UsuarioEdit.page.xml new file mode 100644 index 0000000..0527d32 --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/usuario/UsuarioEdit.page.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SimDeCS/WebContent/seguro/admin/usuario/UsuarioEdit.xhtml b/SimDeCS/WebContent/seguro/admin/usuario/UsuarioEdit.xhtml new file mode 100644 index 0000000..23f9ccf --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/usuario/UsuarioEdit.xhtml @@ -0,0 +1,212 @@ + + + + + + + + + #{usuarioHome.managed ? 'Editar' : 'Novo'} Usuário + + + + + Aprovado + + + + + + Ativo + + + + + + + Data criacao + + + + + + Data nascimento + + + + + + Email + + + + + + + + Funcao + + + + + + + + + Login + + + + + + + + Nome + + + + + + + + Senha + + + + + + + + Sexo + + + + + + + + Telefone + + + + + +
+ * + Informações Obrigatórias +
+ +
+ + + + + + + + +
+ + + + + + + + + + + +
+
+ + + + +
+ + + + + + Id + + + + Nome + + + +
+
+
+
+ +
diff --git a/SimDeCS/WebContent/seguro/admin/usuario/UsuarioList.page.xml b/SimDeCS/WebContent/seguro/admin/usuario/UsuarioList.page.xml new file mode 100644 index 0000000..7d60a70 --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/usuario/UsuarioList.page.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/SimDeCS/WebContent/seguro/admin/usuario/UsuarioList.xhtml b/SimDeCS/WebContent/seguro/admin/usuario/UsuarioList.xhtml new file mode 100644 index 0000000..c98a14a --- /dev/null +++ b/SimDeCS/WebContent/seguro/admin/usuario/UsuarioList.xhtml @@ -0,0 +1,247 @@ + + + + + + + + + + + Nome + + + + + Login + + + + + Email + + + + + Funcao + + + + + Sexo + + + + + Telefone + + + + + Opções de Pesquisa + + + + + + + + +
+ + +
+ +
+ + + Resultado da Pesquisa(#{empty usuarioList.resultList ? 0 : (usuarioList.paginated ? usuarioList.resultCount : usuarioList.resultList.size)}) +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Ação + + + + #{' '} + + + + + + +
+
+ +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ +
diff --git a/SimDeCS/WebContent/seguro/vrmed/criarNovoDiagrama.xhtml b/SimDeCS/WebContent/seguro/vrmed/criarNovoDiagrama.xhtml new file mode 100644 index 0000000..1be41b4 --- /dev/null +++ b/SimDeCS/WebContent/seguro/vrmed/criarNovoDiagrama.xhtml @@ -0,0 +1,48 @@ + + + + + + + +
+ Bem vindo ao seu novo diagrama! +

+ Para criar seu caso clínico são necessárias algumas informações. Informe abaixo um texto introdutório sobre o caso em questão (digitando no campo abaixo) e selecione um cenário onde irá se desenvolver a história (clicando sobre a imagem). +

+ Após clique sobre a opção “Adicionar Ator” para prosseguir com o processo. +


+ + Introdução:
+ +
+
+ + + + +
+ +
+ +
+
+ + +
+
+ + +
+ +
diff --git a/SimDeCS/WebContent/seguro/vrmed/selecionarDiagrama.page.xml b/SimDeCS/WebContent/seguro/vrmed/selecionarDiagrama.page.xml new file mode 100644 index 0000000..99c4061 --- /dev/null +++ b/SimDeCS/WebContent/seguro/vrmed/selecionarDiagrama.page.xml @@ -0,0 +1,13 @@ + + + + + + + + + + \ No newline at end of file diff --git a/SimDeCS/WebContent/seguro/vrmed/selecionarDiagrama.xhtml b/SimDeCS/WebContent/seguro/vrmed/selecionarDiagrama.xhtml new file mode 100644 index 0000000..37bdfdc --- /dev/null +++ b/SimDeCS/WebContent/seguro/vrmed/selecionarDiagrama.xhtml @@ -0,0 +1,63 @@ + + + + + + selecionarDiagrama + + + + + + + + + + + + + + + + + + + + + + + + + +
  
+ + + + + + + + + + +
Nome do Diagrama
+
+ +
+
  +   +
  
+
+ +
+ +
diff --git a/SimDeCS/WebContent/stylesheet/theme.css b/SimDeCS/WebContent/stylesheet/theme.css new file mode 100644 index 0000000..41e89af --- /dev/null +++ b/SimDeCS/WebContent/stylesheet/theme.css @@ -0,0 +1,228 @@ +html { + overflow-y: scroll; +} + +body { + font-family: Arial, Helvetica; + font-size: 12px; + margin: 0px; +} +.top{ + vertical-align:top; +} +.pbody{ + padding:0px; + height:120px; + width:150px; + overflow:auto; +} + +a img { + border: none; +} + +h1 { + font-size: 1.6em; + margin-top: 0; +} + +input[type=submit], input[type=button] { + font-size: 11px; + margin: 5px 5px 5px 0; + cursor: pointer; +} + +input[type=text], input[type=password], textarea { + font-size: 12px; + padding-left: 1px; +} + +select { + font-size: 13px; +} + +.tableControl, .actionButtons { + width: 100%; +} + +.tableControl a { + padding-left: 10px; +} + +.tableControl { + text-align: right; +} + +.footer { + text-align: center; + font-size: 11px; + margin-bottom: 10px; +} + +.rich-table { + width: 100%; +} + +.body { + padding: 30px; +} +.message { + padding: 5px; + list-style: none; + border: 0; + background: none; + padding: 0; + color: #000000; + margin: 5px 0 8px 0; + font-size: 12px; +} + +.message li { + background: no-repeat left center; + padding-top: 1px; + padding-left: 20px; + margin-left: 3px; +} + +.message li.infomsg { + background-image: url(../img/msginfo.png); +} + +.message li.errormsg { + background-image: url(../img/msgerror.png); +} + +.message li.warnmsg { + background-image: url(../img/msgwarn.png); +} + +.name { + vertical-align: top; + font-weight: bold; + width: 115px; + float: left; + padding: 5px; + margin-top: 3px; + clear: left; +} + +.value { + float: left; + padding: 5px; +} + +.error { + float: left; + padding: 5px; +} + +.errors { + color: #FF0000; + vertical-align: middle; +} + +img.errors { + padding-right: 5px; +} + +.errors input, .errors textarea, .errors select { + border: 1px solid red !important; +} + +.required { + color: #FF0000; + padding-left: 2px; +} + +.rich-stglpanel-body { + overflow: auto; +} + +/* the specificity here is necessary to override the defaults */ +/* +.rich-panel .rich-panel-header, +.rich-stglpanel .rich-stglpanel-header { + padding: 2px 3px; +}*/ + +.rich-panel input[type=submit], .rich-panel input[type=button], +.rich-tabpanel input[type=submit], .rich-tabpanel input[type=button] { + margin-bottom: 0; +} + +.tableControl input[type=submit], .tableControl input[type=button], .tableControl select { + margin: 5px 0 5px 5px; +} + +/* I don't know why this is necessary, but the select is off by a pixel on the top and is padding too much on the left */ +.tableControl select { + margin-left: 2px; + position: relative; + top: 1px; +} + +.actionButtons { + padding-left: 1px; +} + +.actionButtons select { + margin: 5px 5px 5px 0; + vertical-align: bottom; +} + +.rich-toolbar-item a { + text-decoration: none; +} + +.rich-toolbar-item a:hover, .rich-ddmenu-label-select { + text-decoration: underline; +} + +.rich-toolbar-item .rich-menu-item a:hover { + text-decoration: none; +} + +.rich-datalist { + list-style: square; + margin: 6px 0 1px 0; + padding-left: 18px; +} + +.rich-list-item { + padding-bottom: 4px; +} + +div.info { + font-size: 1.2em; +} + +ul.bullets { + list-style: square; +} + +ul.bullets li { + padding-bottom: 2px; +} + +td.action { + text-align: center; + width: 8em; + white-space: nowrap; +} + +td.action a { + padding-left: 1px; + padding-right: 1px; +} + +table.radio { + border: 0; +} + +table.radio td { + padding: 0 2px; +} + +table.radio input[type=radio] { + vertical-align: bottom; +} diff --git a/SimDeCS/WebContent/stylesheet/theme.xcss b/SimDeCS/WebContent/stylesheet/theme.xcss new file mode 100644 index 0000000..73f88a1 --- /dev/null +++ b/SimDeCS/WebContent/stylesheet/theme.xcss @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SimDeCS/WebContent/stylesheet/useradmin.css b/SimDeCS/WebContent/stylesheet/useradmin.css new file mode 100644 index 0000000..46a4f4e --- /dev/null +++ b/SimDeCS/WebContent/stylesheet/useradmin.css @@ -0,0 +1,112 @@ +input.newuser { + background: url(../img/btnnewuser.png) top left no-repeat; + height: 39px; + width: 113px; + margin: 4px 4px 4px 4px; + border: 0px; + cursor: pointer; +} + +input.newrole { + background: url(../img/btnnewrole.png) top left no-repeat; + height: 39px; + width: 113px; + margin: 4px 4px 4px 4px; + border: 0px; + cursor: pointer; +} + +input.newpermission { + background: url(../img/btnnewpermission.png) top left no-repeat; + height: 39px; + width: 113px; + margin: 4px 4px 4px 4px; + border: 0px; + cursor: pointer; +} + +input.manageusers { + display: block; + background: url(../img/btnmanageusers.png) top left no-repeat; + height: 88px; + width: 300px; + padding-left: 10px; + font-size: 19px; + font-weight: bold; + color: #333333; + border: 0px; + cursor: pointer; + margin-top: 20px; + margin-left: 20px; +} + +input.manageroles { + display: block; + background: url(../img/btnmanageroles.png) top left no-repeat; + height: 88px; + width: 300px; + padding-left: 10px; + font-size: 19px; + font-weight: bold; + color: #333333; + border: 0px; + cursor: pointer; + margin-top: 20px; + margin-left: 20px; +} + +.roles { + width: 120px; + border: 1px solid #7F9DB9; + background-color: #E7EDF7; +} + +div.selectMany label { + float: none; +} + +div.selectMany input[type="checkbox"] { + vertical-align: middle; +} + +div.status-true { + background: url(../img/true.png) top left no-repeat; + width: 14px; + height: 15px; + margin-left: auto; + margin-right: auto; +} + +div.status-false { + background: url(../img/false.png) top left no-repeat; + width: 14px; + height: 15px; + margin-left: auto; + margin-right: auto; +} + +table.useradmin, div.useradmin { + width: 500px; +} + +/* +table.useradmin tr.odd { + background-color: #FFFFFF; +} + +table.useradmin tr.even { + background-color: #E9F5FF; +} +*/ + +td.enabled { + text-align: center; +} + +fieldset.roles .roles { + border: none; +} + +table.iceSelMnyCb td { + text-align: left; +} diff --git a/SimDeCS/hibernate-console.properties b/SimDeCS/hibernate-console.properties new file mode 100644 index 0000000..e545bf4 --- /dev/null +++ b/SimDeCS/hibernate-console.properties @@ -0,0 +1,10 @@ +#File used by hibernate tools to override and other container specific settings in persistence.xml +hibernate.connection.password=tatuira +hibernate.connection.username=simdecs +hibernate.connection.driver_class=org.postgresql.Driver +hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect +hibernate.connection.url=jdbc:postgresql://localhost:5432/simdecs + +hibernate.connection.provider_class=org.hibernate.connection.DriverManagerConnectionProvider +hibernate.datasource= +hibernate.transaction.manager_lookup_class= diff --git a/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/Authenticator.java b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/Authenticator.java new file mode 100644 index 0000000..22c4c79 --- /dev/null +++ b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/Authenticator.java @@ -0,0 +1,57 @@ +package org.ufcspa.simdecs.session; + +import java.util.Iterator; + +import javax.persistence.EntityManager; +import javax.persistence.NoResultException; + +import org.jboss.seam.annotations.In; +import org.jboss.seam.annotations.Logger; +import org.jboss.seam.annotations.Name; +import org.jboss.seam.log.Log; +import org.jboss.seam.security.Credentials; +import org.jboss.seam.security.Identity; +import org.ufcspa.simdecs.entities.Regra; +import org.ufcspa.simdecs.entities.Usuario; + +@Name("authenticator") +public class Authenticator +{ + @Logger private Log log; + + @In Identity identity; + @In Credentials credentials; + + @In + private EntityManager entityManager; + + public boolean authenticate() + { +log.info("entrou no metodo autenticate"); + Usuario usuario; + try { + usuario= (Usuario) entityManager.createQuery("select usu from Usuario as usu where usu.login=:login and usu.senha=:senha") + .setParameter("login", credentials.getUsername()) + .setParameter("senha", credentials.getPassword()) + .getSingleResult(); + } catch (NoResultException ne) { + log.info("Não encontrou usuário"); + return false; + } + +log.info("usuario nao é nulo"); + + Iterator rolesIt = entityManager.createQuery("Select reg From Regra as reg inner join reg.grupos gru inner join gru.usuarios usu where usu.id=:idUsuario") + .setParameter("idUsuario", usuario.getId()) + .getResultList() + .iterator(); + + while(rolesIt.hasNext()) + identity.addRole(((Regra) rolesIt.next()).getToken()); + + log.info("authenticating {0}", credentials.getUsername()); + + return true; + } + +} diff --git a/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/GrupoHome.java b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/GrupoHome.java new file mode 100644 index 0000000..f227feb --- /dev/null +++ b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/GrupoHome.java @@ -0,0 +1,42 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Grupo; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityHome; + +@Name("grupoHome") +public class GrupoHome extends SimDeCSEntityHome { + + public void setGrupoId(Long id) { + setId(id); + } + + public Long getGrupoId() { + return (Long) getId(); + } + + @Override + protected Grupo createInstance() { + Grupo grupo = new Grupo(); + return grupo; + } + + public void load() { + if (isIdDefined()) { + wire(); + } + } + + public void wire() { + getInstance(); + } + + public boolean isWired() { + return true; + } + + public Grupo getDefinedInstance() { + return isIdDefined() ? getInstance() : null; + } + +} diff --git a/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/GrupoList.java b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/GrupoList.java new file mode 100644 index 0000000..6c47fe8 --- /dev/null +++ b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/GrupoList.java @@ -0,0 +1,27 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import java.util.Arrays; + +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Grupo; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityQuery; + +@Name("grupoList") +public class GrupoList extends SimDeCSEntityQuery { + + private static final String EJBQL = "select grupo from Grupo grupo"; + + private static final String[] RESTRICTIONS = { "lower(grupo.nome) like lower(concat(#{grupoList.grupo.nome},'%'))", }; + + private Grupo grupo = new Grupo(); + + public GrupoList() { + setEjbql(EJBQL); + setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS)); + setMaxResults(25); + } + + public Grupo getGrupo() { + return grupo; + } +} diff --git a/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/InstituicaoHome.java b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/InstituicaoHome.java new file mode 100644 index 0000000..0ec8ff9 --- /dev/null +++ b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/InstituicaoHome.java @@ -0,0 +1,42 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Instituicao; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityHome; + +@Name("instituicaoHome") +public class InstituicaoHome extends SimDeCSEntityHome { + + public void setInstituicaoId(Long id) { + setId(id); + } + + public Long getInstituicaoId() { + return (Long) getId(); + } + + @Override + protected Instituicao createInstance() { + Instituicao instituicao = new Instituicao(); + return instituicao; + } + + public void load() { + if (isIdDefined()) { + wire(); + } + } + + public void wire() { + getInstance(); + } + + public boolean isWired() { + return true; + } + + public Instituicao getDefinedInstance() { + return isIdDefined() ? getInstance() : null; + } + +} diff --git a/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/InstituicaoList.java b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/InstituicaoList.java new file mode 100644 index 0000000..91ddd83 --- /dev/null +++ b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/InstituicaoList.java @@ -0,0 +1,30 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import java.util.Arrays; + +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Instituicao; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityQuery; + +@Name("instituicaoList") +public class InstituicaoList extends SimDeCSEntityQuery { + + private static final String EJBQL = "select instituicao from Instituicao instituicao"; + + private static final String[] RESTRICTIONS = { + "lower(instituicao.endereco) like lower(concat(#{instituicaoList.instituicao.endereco},'%'))", + "lower(instituicao.nome) like lower(concat(#{instituicaoList.instituicao.nome},'%'))", + "lower(instituicao.telefone) like lower(concat(#{instituicaoList.instituicao.telefone},'%'))", }; + + private Instituicao instituicao = new Instituicao(); + + public InstituicaoList() { + setEjbql(EJBQL); + setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS)); + setMaxResults(25); + } + + public Instituicao getInstituicao() { + return instituicao; + } +} diff --git a/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/PrivilegioHome.java b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/PrivilegioHome.java new file mode 100644 index 0000000..07dd39c --- /dev/null +++ b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/PrivilegioHome.java @@ -0,0 +1,42 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Privilegio; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityHome; + +@Name("privilegioHome") +public class PrivilegioHome extends SimDeCSEntityHome { + + public void setPrivilegioId(Long id) { + setId(id); + } + + public Long getPrivilegioId() { + return (Long) getId(); + } + + @Override + protected Privilegio createInstance() { + Privilegio privilegio = new Privilegio(); + return privilegio; + } + + public void load() { + if (isIdDefined()) { + wire(); + } + } + + public void wire() { + getInstance(); + } + + public boolean isWired() { + return true; + } + + public Privilegio getDefinedInstance() { + return isIdDefined() ? getInstance() : null; + } + +} diff --git a/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/PrivilegioList.java b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/PrivilegioList.java new file mode 100644 index 0000000..95e2271 --- /dev/null +++ b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/PrivilegioList.java @@ -0,0 +1,29 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import java.util.Arrays; + +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Privilegio; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityQuery; + +@Name("privilegioList") +public class PrivilegioList extends SimDeCSEntityQuery { + + private static final String EJBQL = "select privilegio from Privilegio privilegio"; + + private static final String[] RESTRICTIONS = { + "lower(privilegio.nome) like lower(concat(#{privilegioList.privilegio.nome},'%'))", + "lower(privilegio.token) like lower(concat(#{privilegioList.privilegio.token},'%'))", }; + + private Privilegio privilegio = new Privilegio(); + + public PrivilegioList() { + setEjbql(EJBQL); + setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS)); + setMaxResults(25); + } + + public Privilegio getPrivilegio() { + return privilegio; + } +} diff --git a/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/RegraHome.java b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/RegraHome.java new file mode 100644 index 0000000..22ce650 --- /dev/null +++ b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/RegraHome.java @@ -0,0 +1,42 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Regra; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityHome; + +@Name("regraHome") +public class RegraHome extends SimDeCSEntityHome { + + public void setRegraId(Long id) { + setId(id); + } + + public Long getRegraId() { + return (Long) getId(); + } + + @Override + protected Regra createInstance() { + Regra regra = new Regra(); + return regra; + } + + public void load() { + if (isIdDefined()) { + wire(); + } + } + + public void wire() { + getInstance(); + } + + public boolean isWired() { + return true; + } + + public Regra getDefinedInstance() { + return isIdDefined() ? getInstance() : null; + } + +} diff --git a/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/RegraList.java b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/RegraList.java new file mode 100644 index 0000000..159b8d7 --- /dev/null +++ b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/RegraList.java @@ -0,0 +1,29 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import java.util.Arrays; + +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Regra; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityQuery; + +@Name("regraList") +public class RegraList extends SimDeCSEntityQuery { + + private static final String EJBQL = "select regra from Regra regra"; + + private static final String[] RESTRICTIONS = { + "lower(regra.nome) like lower(concat(#{regraList.regra.nome},'%'))", + "lower(regra.token) like lower(concat(#{regraList.regra.token},'%'))", }; + + private Regra regra = new Regra(); + + public RegraList() { + setEjbql(EJBQL); + setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS)); + setMaxResults(25); + } + + public Regra getRegra() { + return regra; + } +} diff --git a/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioGrupoList.java b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioGrupoList.java new file mode 100644 index 0000000..9542b32 --- /dev/null +++ b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioGrupoList.java @@ -0,0 +1,28 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import java.util.Arrays; + +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Grupo; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityQuery; + +@Name("usuarioGrupoList") +public class UsuarioGrupoList extends SimDeCSEntityQuery { + + private static final String EJBQL = "select grupo from Grupo grupo"; + + private static final String[] RESTRICTIONS = { "lower(grupo.nome) like lower(concat(#{grupoList.grupo.nome},'%'))", }; + + private Grupo grupo = new Grupo(); + + @Factory("usuarioGrupoList") + public UsuarioGrupoList() { + setEjbql(EJBQL); + setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS)); + setMaxResults(25); + } + + public Grupo getGrupo() { + return grupo; + } +} diff --git a/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioHome.java b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioHome.java new file mode 100644 index 0000000..314dc27 --- /dev/null +++ b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioHome.java @@ -0,0 +1,46 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import org.jboss.seam.annotations.In; +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Usuario; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityHome; + +@Name("usuarioHome") +public class UsuarioHome extends SimDeCSEntityHome { + + @In(create = true) + UsuarioHome usuarioHome; + + public void setUsuarioId(Long id) { + setId(id); + } + + public Long getUsuarioId() { + return (Long) getId(); + } + + @Override + protected Usuario createInstance() { + Usuario usuario = new Usuario(); + return usuario; + } + + public void load() { + if (isIdDefined()) { + wire(); + } + } + + public void wire() { + getInstance(); + } + + public boolean isWired() { + return true; + } + + public Usuario getDefinedInstance() { + return isIdDefined() ? getInstance() : null; + } + +} diff --git a/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioList.java b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioList.java new file mode 100644 index 0000000..3bca60b --- /dev/null +++ b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioList.java @@ -0,0 +1,34 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import java.util.Arrays; + +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Usuario; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityQuery; + +@Name("usuarioList") +public class UsuarioList extends SimDeCSEntityQuery { + + private static final String EJBQL = "select usuario from Usuario usuario"; + + private static final String[] RESTRICTIONS = { + "lower(usuario.email) like lower(concat(#{usuarioList.usuario.email},'%'))", + "lower(usuario.funcao) like lower(concat(#{usuarioList.usuario.funcao},'%'))", + "lower(usuario.login) like lower(concat(#{usuarioList.usuario.login},'%'))", + "lower(usuario.nome) like lower(concat(#{usuarioList.usuario.nome},'%'))", + "lower(usuario.senha) like lower(concat(#{usuarioList.usuario.senha},'%'))", + "lower(usuario.sexo) like lower(concat(#{usuarioList.usuario.sexo},'%'))", + "lower(usuario.telefone) like lower(concat(#{usuarioList.usuario.telefone},'%'))", }; + + private Usuario usuario = new Usuario(); + + public UsuarioList() { + setEjbql(EJBQL); + setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS)); + setMaxResults(25); + } + + public Usuario getUsuario() { + return usuario; + } +} diff --git a/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/defaults/SimDeCSEntityHome.java b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/defaults/SimDeCSEntityHome.java new file mode 100644 index 0000000..f441e18 --- /dev/null +++ b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/defaults/SimDeCSEntityHome.java @@ -0,0 +1,17 @@ +package org.ufcspa.simdecs.session.crud.defaults; + +import org.jboss.seam.core.Expressions; +import org.jboss.seam.framework.EntityHome; + +public abstract class SimDeCSEntityHome extends EntityHome { + + protected void initDefaultMessages() + { + super.initDefaultMessages(); + Expressions expressions = new Expressions(); + setCreatedMessage(expressions.createValueExpression("Registro criado com sucesso!")); + setDeletedMessage(expressions.createValueExpression("Registro excluido com sucesso!")); + setUpdatedMessage(expressions.createValueExpression("Registro alterado com sucesso!")); + } + +} diff --git a/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/defaults/SimDeCSEntityQuery.java b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/defaults/SimDeCSEntityQuery.java new file mode 100644 index 0000000..a5b9ab9 --- /dev/null +++ b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/crud/defaults/SimDeCSEntityQuery.java @@ -0,0 +1,8 @@ +package org.ufcspa.simdecs.session.crud.defaults; + +import org.jboss.seam.framework.EntityQuery; + +public abstract class SimDeCSEntityQuery extends EntityQuery { + + +} diff --git a/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/vrmed/SelecionarDiagrama.java b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/vrmed/SelecionarDiagrama.java new file mode 100644 index 0000000..358ef96 --- /dev/null +++ b/SimDeCS/resources/src/hot/org/ufcspa/simdecs/session/vrmed/SelecionarDiagrama.java @@ -0,0 +1,96 @@ +package org.ufcspa.simdecs.session.vrmed; + +import java.util.Iterator; +import java.util.List; + +import javax.persistence.EntityManager; + +import org.jboss.seam.ScopeType; +import org.jboss.seam.annotations.Begin; +import org.jboss.seam.annotations.In; +import org.jboss.seam.annotations.Logger; +import org.jboss.seam.annotations.Name; +import org.jboss.seam.annotations.Scope; +import org.jboss.seam.international.StatusMessages; +import org.jboss.seam.log.Log; +import org.ufcspa.simdecs.entities.Cenario; + +@Name("SelecionarDiagrama") +@Scope(ScopeType.CONVERSATION) +public class SelecionarDiagrama +{ + @Logger private Log log; + + @In StatusMessages statusMessages; + + @In + private EntityManager entityManager; + + + // Informações do diagrama + private String nomeNovoDiagrama; + private String textoIntroducao; + private Long cenario; + private List listaCenarios; + + public String getNomeNovoDiagrama() { + return nomeNovoDiagrama; + } + + public void setNomeNovoDiagrama(String nomeNovoDiagrama) { + this.nomeNovoDiagrama = nomeNovoDiagrama; + } + + // Criação de novo diagrama + @Begin(join=false) + public String criarNovoDiagrama() + { + if (nomeNovoDiagrama == null || nomeNovoDiagrama.equals("")) { + statusMessages.add("O nome do novo diagrama deve ser informado!"); + return null; + } + + listaCenarios = entityManager.createQuery("From Cenario cenario order by id").getResultList(); + Iterator it = listaCenarios.iterator(); + while(it.hasNext()) { + log.info("Cenario: " + ((Cenario)it.next()).getNome()); + } + return "novoDiagrama"; + } + + public void selecionarIntroducaoCenario() + { + + // implement your business logic here + log.info("teste de conversacao: " + nomeNovoDiagrama); + statusMessages.add("criarNovoDiagrama"); + } + + public String getTextoIntroducao() { + return textoIntroducao; + } + + public void setTextoIntroducao(String textoIntroducao) { + this.textoIntroducao = textoIntroducao; + } + + public Long getCenario() { + return cenario; + } + + public void setCenario(Long cenario) { + this.cenario = cenario; + } + + public List getListaCenarios() { + return listaCenarios; + } + + public void setListaCenarios(List listaCenarios) { + this.listaCenarios = listaCenarios; + } + + + // add additional action methods + +} diff --git a/SimDeCS/resources/src/hot/seam.properties b/SimDeCS/resources/src/hot/seam.properties new file mode 100644 index 0000000..e69de29 diff --git a/SimDeCS/resources/src/main/META-INF/persistence.xml b/SimDeCS/resources/src/main/META-INF/persistence.xml new file mode 100644 index 0000000..d87cfdb --- /dev/null +++ b/SimDeCS/resources/src/main/META-INF/persistence.xml @@ -0,0 +1,20 @@ + + + + + + org.hibernate.ejb.HibernatePersistence + java:/SimDeCSDatasource + + + + + + + + + + diff --git a/SimDeCS/resources/src/main/components.properties b/SimDeCS/resources/src/main/components.properties new file mode 100644 index 0000000..c598420 --- /dev/null +++ b/SimDeCS/resources/src/main/components.properties @@ -0,0 +1,4 @@ +# +#Thu Apr 21 18:54:34 BRT 2011 +jndiPattern=\#{ejbName}/local +embeddedEjb=false diff --git a/SimDeCS/resources/src/main/import.sql b/SimDeCS/resources/src/main/import.sql new file mode 100644 index 0000000..3c28ee8 --- /dev/null +++ b/SimDeCS/resources/src/main/import.sql @@ -0,0 +1 @@ +-- SQL statements which are executed at application startup if hibernate.hbm2ddl.auto is 'create' or 'create-drop' diff --git a/SimDeCS/resources/src/main/messages_en.properties b/SimDeCS/resources/src/main/messages_en.properties new file mode 100644 index 0000000..fdc41bd --- /dev/null +++ b/SimDeCS/resources/src/main/messages_en.properties @@ -0,0 +1,90 @@ +up=\u2191 +down=\u2193 +left=\u2039 +right=\u203A + +validator.assertFalse=validation failed +validator.assertTrue=validation failed +validator.future=must be a future date +validator.length=length must be between {min} and {max} +validator.max=must be less than or equal to {value} +validator.min=must be greater than or equal to {value} +validator.notNull=may not be null +validator.past=must be a past date +validator.pattern=must match "{regex}" +validator.range=must be between {min} and {max} +validator.size=size must be between {min} and {max} +validator.email=must be a well-formed email address + +org.jboss.seam.loginFailed=Login failed +org.jboss.seam.loginSuccessful=Welcome, #0! + +org.jboss.seam.TransactionFailed=Transaction failed +org.jboss.seam.NoConversation=The conversation ended, timed out or was processing another request +org.jboss.seam.IllegalNavigation=Illegal navigation +org.jboss.seam.ProcessEnded=Process #0 already ended +org.jboss.seam.ProcessNotFound=Process #0 not found +org.jboss.seam.TaskEnded=Task #0 already ended +org.jboss.seam.TaskNotFound=Task #0 not found +org.jboss.seam.NotLoggedIn=Please log in first + +javax.faces.component.UIInput.CONVERSION=value could not be converted to the expected type +javax.faces.component.UIInput.REQUIRED=value is required +javax.faces.component.UIInput.UPDATE=an error occurred when processing your submitted information +javax.faces.component.UISelectOne.INVALID=value is not valid +javax.faces.component.UISelectMany.INVALID=value is not valid + +javax.faces.converter.BigDecimalConverter.DECIMAL=value must be a number +javax.faces.converter.BigDecimalConverter.DECIMAL_detail=value must be a signed decimal number consisting of zero or more digits, optionally followed by a decimal point and fraction, eg. {1} +javax.faces.converter.BigIntegerConverter.BIGINTEGER=value must be an integer +javax.faces.converter.BigIntegerConverter.BIGINTEGER_detail=value must be a signed integer number consisting of zero or more digits +javax.faces.converter.BooleanConverter.BOOLEAN=value must be true or false +javax.faces.converter.BooleanConverter.BOOLEAN_detail=value must be true or false (any value other than true will evaluate to false) +javax.faces.converter.ByteConverter.BYTE=value must be a number between 0 and 255 +javax.faces.converter.ByteConverter.BYTE_detail=value must be a number between 0 and 255 +javax.faces.converter.CharacterConverter.CHARACTER=value must be a character +javax.faces.converter.CharacterConverter.CHARACTER_detail=value must be a valid ASCII character +javax.faces.converter.DateTimeConverter.DATE=value must be a date +javax.faces.converter.DateTimeConverter.DATE_detail=value must be a date, eg. {1} +javax.faces.converter.DateTimeConverter.TIME=value must be a time +javax.faces.converter.DateTimeConverter.TIME_detail=value must be a time, eg. {1} +javax.faces.converter.DateTimeConverter.DATETIME=value must be a date and time +javax.faces.converter.DateTimeConverter.DATETIME_detail=value must be a date and time, eg. {1} +javax.faces.converter.DateTimeConverter.PATTERN_TYPE=a pattern or type attribute must be specified to convert the value +javax.faces.converter.DoubleConverter.DOUBLE=value must be a number +javax.faces.converter.DoubleConverter.DOUBLE_detail=value must be a number between 4.9E-324 and 1.7976931348623157E308 +javax.faces.converter.EnumConverter.ENUM=value must be convertible to an enum +javax.faces.converter.EnumConverter.ENUM_detail=value must be convertible to an enum or from the enum that contains the constant {1} +javax.faces.converter.EnumConverter.ENUM_NO_CLASS=value must be convertible to an enum or from the enum, but no enum class provided +javax.faces.converter.EnumConverter.ENUM_NO_CLASS_detail=value must be convertible to an enum or from the enum, but no enum class provided +javax.faces.converter.FloatConverter.FLOAT=value must be a number +javax.faces.converter.FloatConverter.FLOAT_detail=value must be a number between 1.4E-45 and 3.4028235E38 +javax.faces.converter.IntegerConverter.INTEGER=value must be an integer +javax.faces.converter.IntegerConverter.INTEGER_detail=value must be an integer number between -2147483648 and 2147483647 +javax.faces.converter.LongConverter.LONG=value must be an integer +javax.faces.converter.LongConverter.LONG_detail=value must be an integer number between -9223372036854775808 and 9223372036854775807 +javax.faces.converter.NumberConverter.CURRENCY=value must be a currency amount +javax.faces.converter.NumberConverter.CURRENCY_detail=value must be a currency amount, eg. {1} +javax.faces.converter.NumberConverter.PERCENT=value must be a percentage amount +javax.faces.converter.NumberConverter.PERCENT_detail=value must be a percentage amount, eg. {1} +javax.faces.converter.NumberConverter.NUMBER=value must be a number +javax.faces.converter.NumberConverter.NUMBER_detail=value must be a number +javax.faces.converter.NumberConverter.PATTERN=value must be a number +javax.faces.converter.NumberConverter.PATTERN_detail=value must be a number +javax.faces.converter.ShortConverter.SHORT=value must be an integer +javax.faces.converter.ShortConverter.SHORT_detail=value must be an integer number between -32768 and 32767 + +javax.faces.validator.DoubleRangeValidator.MAXIMUM=value must be less than or equal to {0} +javax.faces.validator.DoubleRangeValidator.MINIMUM=value must be greater than or equal to {0} +javax.faces.validator.DoubleRangeValidator.NOT_IN_RANGE=value must be between {0} and {1} +javax.faces.validator.DoubleRangeValidator.TYPE=value is not of the correct type +javax.faces.validator.LengthValidator.MAXIMUM=value must be shorter than or equal to {0} characters +javax.faces.validator.LengthValidator.MINIMUM=value must be longer than or equal to {0} characters +javax.faces.validator.LongRangeValidator.MAXIMUM=value must be less than or equal to {0} +javax.faces.validator.LongRangeValidator.MINIMUM=value must be greater than or equal to {0} +javax.faces.validator.LongRangeValidator.NOT_IN_RANGE=value must be between {0} and {1} +javax.faces.validator.LongRangeValidator.TYPE=value is not of the correct type + +javax.faces.validator.NOT_IN_RANGE=value must be between {0} and {1} +javax.faces.converter.STRING=value could not be converted to a string + diff --git a/SimDeCS/resources/src/main/messages_pt_BR.properties b/SimDeCS/resources/src/main/messages_pt_BR.properties new file mode 100644 index 0000000..833b84d --- /dev/null +++ b/SimDeCS/resources/src/main/messages_pt_BR.properties @@ -0,0 +1,90 @@ +up=\u2191 +down=\u2193 +left=\u2039 +right=\u203A + +validator.assertFalse=validation failed +validator.assertTrue=validation failed +validator.future=must be a future date +validator.length=length must be between {min} and {max} +validator.max=must be less than or equal to {value} +validator.min=must be greater than or equal to {value} +validator.notNull=may not be null +validator.past=must be a past date +validator.pattern=must match "{regex}" +validator.range=must be between {min} and {max} +validator.size=size must be between {min} and {max} +validator.email=must be a well-formed email address + +org.jboss.seam.loginFailed=Usu\u00E1rio / senha inv\u00E1lidos +org.jboss.seam.loginSuccessful=Bem vindo, \#0\! + +org.jboss.seam.TransactionFailed=Transa\u00E7\u00E3o falhou +org.jboss.seam.NoConversation=The conversation ended, timed out or was processing another request +org.jboss.seam.IllegalNavigation=Illegal navigation +org.jboss.seam.ProcessEnded=Process #0 already ended +org.jboss.seam.ProcessNotFound=Process #0 not found +org.jboss.seam.TaskEnded=Task #0 already ended +org.jboss.seam.TaskNotFound=Task #0 not found +org.jboss.seam.NotLoggedIn=Por favor, efetue login + +javax.faces.component.UIInput.CONVERSION=value could not be converted to the expected type +javax.faces.component.UIInput.REQUIRED=value is required +javax.faces.component.UIInput.UPDATE=an error occurred when processing your submitted information +javax.faces.component.UISelectOne.INVALID=value is not valid +javax.faces.component.UISelectMany.INVALID=value is not valid + +javax.faces.converter.BigDecimalConverter.DECIMAL=value must be a number +javax.faces.converter.BigDecimalConverter.DECIMAL_detail=value must be a signed decimal number consisting of zero or more digits, optionally followed by a decimal point and fraction, eg. {1} +javax.faces.converter.BigIntegerConverter.BIGINTEGER=value must be an integer +javax.faces.converter.BigIntegerConverter.BIGINTEGER_detail=value must be a signed integer number consisting of zero or more digits +javax.faces.converter.BooleanConverter.BOOLEAN=value must be true or false +javax.faces.converter.BooleanConverter.BOOLEAN_detail=value must be true or false (any value other than true will evaluate to false) +javax.faces.converter.ByteConverter.BYTE=value must be a number between 0 and 255 +javax.faces.converter.ByteConverter.BYTE_detail=value must be a number between 0 and 255 +javax.faces.converter.CharacterConverter.CHARACTER=value must be a character +javax.faces.converter.CharacterConverter.CHARACTER_detail=value must be a valid ASCII character +javax.faces.converter.DateTimeConverter.DATE=value must be a date +javax.faces.converter.DateTimeConverter.DATE_detail=value must be a date, eg. {1} +javax.faces.converter.DateTimeConverter.TIME=value must be a time +javax.faces.converter.DateTimeConverter.TIME_detail=value must be a time, eg. {1} +javax.faces.converter.DateTimeConverter.DATETIME=value must be a date and time +javax.faces.converter.DateTimeConverter.DATETIME_detail=value must be a date and time, eg. {1} +javax.faces.converter.DateTimeConverter.PATTERN_TYPE=a pattern or type attribute must be specified to convert the value +javax.faces.converter.DoubleConverter.DOUBLE=value must be a number +javax.faces.converter.DoubleConverter.DOUBLE_detail=value must be a number between 4.9E-324 and 1.7976931348623157E308 +javax.faces.converter.EnumConverter.ENUM=value must be convertible to an enum +javax.faces.converter.EnumConverter.ENUM_detail=value must be convertible to an enum or from the enum that contains the constant {1} +javax.faces.converter.EnumConverter.ENUM_NO_CLASS=value must be convertible to an enum or from the enum, but no enum class provided +javax.faces.converter.EnumConverter.ENUM_NO_CLASS_detail=value must be convertible to an enum or from the enum, but no enum class provided +javax.faces.converter.FloatConverter.FLOAT=value must be a number +javax.faces.converter.FloatConverter.FLOAT_detail=value must be a number between 1.4E-45 and 3.4028235E38 +javax.faces.converter.IntegerConverter.INTEGER=value must be an integer +javax.faces.converter.IntegerConverter.INTEGER_detail=value must be an integer number between -2147483648 and 2147483647 +javax.faces.converter.LongConverter.LONG=value must be an integer +javax.faces.converter.LongConverter.LONG_detail=value must be an integer number between -9223372036854775808 and 9223372036854775807 +javax.faces.converter.NumberConverter.CURRENCY=value must be a currency amount +javax.faces.converter.NumberConverter.CURRENCY_detail=value must be a currency amount, eg. {1} +javax.faces.converter.NumberConverter.PERCENT=value must be a percentage amount +javax.faces.converter.NumberConverter.PERCENT_detail=value must be a percentage amount, eg. {1} +javax.faces.converter.NumberConverter.NUMBER=value must be a number +javax.faces.converter.NumberConverter.NUMBER_detail=value must be a number +javax.faces.converter.NumberConverter.PATTERN=value must be a number +javax.faces.converter.NumberConverter.PATTERN_detail=value must be a number +javax.faces.converter.ShortConverter.SHORT=value must be an integer +javax.faces.converter.ShortConverter.SHORT_detail=value must be an integer number between -32768 and 32767 + +javax.faces.validator.DoubleRangeValidator.MAXIMUM=value must be less than or equal to {0} +javax.faces.validator.DoubleRangeValidator.MINIMUM=value must be greater than or equal to {0} +javax.faces.validator.DoubleRangeValidator.NOT_IN_RANGE=value must be between {0} and {1} +javax.faces.validator.DoubleRangeValidator.TYPE=value is not of the correct type +javax.faces.validator.LengthValidator.MAXIMUM=value must be shorter than or equal to {0} characters +javax.faces.validator.LengthValidator.MINIMUM=value must be longer than or equal to {0} characters +javax.faces.validator.LongRangeValidator.MAXIMUM=value must be less than or equal to {0} +javax.faces.validator.LongRangeValidator.MINIMUM=value must be greater than or equal to {0} +javax.faces.validator.LongRangeValidator.NOT_IN_RANGE=value must be between {0} and {1} +javax.faces.validator.LongRangeValidator.TYPE=value is not of the correct type + +javax.faces.validator.NOT_IN_RANGE=value must be between {0} and {1} +javax.faces.converter.STRING=value could not be converted to a string + diff --git a/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Ator.java b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Ator.java new file mode 100644 index 0000000..7752f97 --- /dev/null +++ b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Ator.java @@ -0,0 +1,152 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +import org.hibernate.annotations.Index; + + +@Entity +@Table(name="Ator") +// Shortname: "ator" +@SequenceGenerator(name = "sequenceAtor", sequenceName = "sqAtor", initialValue = 1, allocationSize=1) +public abstract class Ator implements Serializable { + + private static final long serialVersionUID = 1095865636605383931L; + + @GeneratedValue(generator = "sequenceAtor", strategy = GenerationType.AUTO) + @Id + private Long id; + + @Column(length=100, nullable=false) + private String nome; + + @Column(length=2, nullable=false, unique=true) + private Integer ordem; + + @Column(nullable=true) + private Float altura; + @Column(nullable=true) + private Float peso; + @Column(nullable=false, length=3) + private Integer idade; + @Column(nullable=false, length=1) + private String sexo; + + @ManyToOne + @JoinColumn(name = "ava_id", referencedColumnName = "id", nullable = true) + @Index(name="ator_ava_fk_i") + private Avatar avatar; + + @ManyToOne + @JoinColumn(name = "caso_id", referencedColumnName = "id", nullable = true) + @Index(name="ator_caso_fk_i") + private CasoClinico casoClinico; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public Integer getOrdem() { + return ordem; + } + + public void setOrdem(Integer ordem) { + this.ordem = ordem; + } + + public Float getAltura() { + return altura; + } + + public void setAltura(Float altura) { + this.altura = altura; + } + + public Float getPeso() { + return peso; + } + + public void setPeso(Float peso) { + this.peso = peso; + } + + public Integer getIdade() { + return idade; + } + + public void setIdade(Integer idade) { + this.idade = idade; + } + + public String getSexo() { + return sexo; + } + + public void setSexo(String sexo) { + this.sexo = sexo; + } + + public Avatar getAvatar() { + return avatar; + } + + public void setAvatar(Avatar avatar) { + this.avatar = avatar; + } + + public CasoClinico getCasoClinico() { + return casoClinico; + } + + public void setCasoClinico(CasoClinico casoClinico) { + this.casoClinico = casoClinico; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Ator other = (Ator) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + +} diff --git a/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Avatar.java b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Avatar.java new file mode 100644 index 0000000..6229b70 --- /dev/null +++ b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Avatar.java @@ -0,0 +1,114 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +import org.hibernate.annotations.Index; +import org.ufcspa.simdecs.entities.exceptions.InvalidSexoException; + +@Entity +@Table(name="Avatar") +// Shortname: "ava" +@SequenceGenerator(name = "sequenceAvatar", sequenceName = "sqAvatar", initialValue = 1, allocationSize=1) +public class Avatar implements Serializable { + + private static final long serialVersionUID = 3841381292539475339L; + + @GeneratedValue(generator = "sequenceAvatar", strategy = GenerationType.AUTO) + @Id + private Long id; + + @Column(nullable=false, length=100) + private String nome; + + @Column(length=1, nullable=true) + private String sexo; + + @Column(nullable=false, length=300) + private String thumbnailURL; + + @ManyToOne + @JoinColumn(name = "faiet_id", referencedColumnName = "id", nullable = true) + @Index(name="ava_faiet_fk_i") + private FaixaEtaria faixaEtaria; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public String getSexo() { + return sexo; + } + + public void setSexo(String sexo) throws InvalidSexoException { + if (sexo.equals("F") || sexo.equals("M")) + this.sexo = sexo; + else + throw new InvalidSexoException("O sexo deverá ser 'F' ou 'M'!"); + } + + public FaixaEtaria getFaixaEtaria() { + return faixaEtaria; + } + + public void setFaixaEtaria(FaixaEtaria faixaEtaria) { + this.faixaEtaria = faixaEtaria; + } + + public String getThumbnailURL() { + return thumbnailURL; + } + + public void setThumbnailURL(String thumbnailURL) { + this.thumbnailURL = thumbnailURL; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Avatar other = (Avatar) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + + +} diff --git a/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/CasoClinico.java b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/CasoClinico.java new file mode 100644 index 0000000..b834779 --- /dev/null +++ b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/CasoClinico.java @@ -0,0 +1,152 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.Index; + +@Entity +@Table(name="CasoClinico") +// Shortname: "caso" +@SequenceGenerator(name = "sequenceCasoClinico", sequenceName = "sqCasoClinico", initialValue = 1, allocationSize=1) +public class CasoClinico implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 7701987863551764750L; + + @GeneratedValue(generator = "sequenceCasoClinico", strategy = GenerationType.AUTO) + @Id + private Long id; + + @Column(nullable=false, length=100) + private String nome; + + @Column(nullable=false, length=400) + private String autores; + + @Column(nullable=false) + @Temporal(TemporalType.TIMESTAMP) + private Date dataCriacao; + + @Column(length=1, nullable=false) + private boolean concluido; + + @Column(length=32768, nullable=false) + private String introducao; + + @ManyToOne + @JoinColumn(name = "usu_id", referencedColumnName = "id", nullable = true) + @Index(name="caso_usu_fk_i") + private Usuario criadoPor; + + @ManyToOne + @JoinColumn(name = "cena_id", referencedColumnName = "id", nullable = true) + @Index(name="caso_cena_fk_i") + private Cenario cenario; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public String getAutores() { + return autores; + } + + public void setAutores(String autores) { + this.autores = autores; + } + + public Date getDataCriacao() { + return dataCriacao; + } + + public void setDataCriacao(Date dataCriacao) { + this.dataCriacao = dataCriacao; + } + + public boolean isConcluido() { + return concluido; + } + + public void setConcluido(boolean concluido) { + this.concluido = concluido; + } + + public String getIntroducao() { + return introducao; + } + + public void setIntroducao(String introducao) { + this.introducao = introducao; + } + + public Usuario getCriadoPor() { + return criadoPor; + } + + public void setCriadoPor(Usuario criadoPor) { + this.criadoPor = criadoPor; + } + + public Cenario getCenario() { + return cenario; + } + + public void setCenario(Cenario cenario) { + this.cenario = cenario; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + CasoClinico other = (CasoClinico) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + + + +} diff --git a/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Cenario.java b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Cenario.java new file mode 100644 index 0000000..fa644f3 --- /dev/null +++ b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Cenario.java @@ -0,0 +1,82 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +@Entity +@Table(name="Cenario") +// Shortname: "cena" +@SequenceGenerator(name = "sequenceCenario", sequenceName = "sqCenario", initialValue = 1, allocationSize=1) +public class Cenario implements Serializable { + + private static final long serialVersionUID = -5325804840992891837L; + + @GeneratedValue(generator = "sequenceCenario", strategy = GenerationType.AUTO) + @Id + private Long id; + + @Column(nullable=false, length=50) + private String nome; + + @Column(nullable=false, length=300) + private String thumbnailURL; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public String getThumbnailURL() { + return thumbnailURL; + } + + public void setThumbnailURL(String thumbnailURL) { + this.thumbnailURL = thumbnailURL; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Cenario other = (Cenario) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + + + +} diff --git a/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/FaixaEtaria.java b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/FaixaEtaria.java new file mode 100644 index 0000000..e235b05 --- /dev/null +++ b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/FaixaEtaria.java @@ -0,0 +1,93 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Transient; + +@Entity +// Short name: "faiet" +@Table(name="FaixaEtaria") +@SequenceGenerator(name = "sequenceFaixaEtaria", sequenceName = "sqFaixaEtaria", initialValue = 1, allocationSize=1) +public class FaixaEtaria implements Serializable { + + + private static final long serialVersionUID = -7880046977930536898L; + + @GeneratedValue(generator = "sequenceFaixaEtaria", strategy = GenerationType.AUTO) + @Id + private Long id; + + @Column(length=3, nullable=true) + private Integer idadeMinima; + + @Column(length=3, nullable=true) + private Integer idadeMaxima; + + @Transient + public String getNome() { + if (idadeMinima != null && idadeMaxima != null) + return "Entre " + getIdadeMinima() + " e " + getIdadeMaxima() + " anos"; + if (idadeMinima == null && idadeMaxima != null) + return "Entre zero e " + getIdadeMaxima() + " anos"; + else + return getIdadeMinima() + " anos ou mais"; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Integer getIdadeMinima() { + return idadeMinima; + } + + public void setIdadeMinima(Integer idadeMinima) { + this.idadeMinima = idadeMinima; + } + + public Integer getIdadeMaxima() { + return idadeMaxima; + } + + public void setIdadeMaxima(Integer idadeMaxima) { + this.idadeMaxima = idadeMaxima; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + FaixaEtaria other = (FaixaEtaria) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + + +} diff --git a/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Grupo.java b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Grupo.java new file mode 100644 index 0000000..4472320 --- /dev/null +++ b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Grupo.java @@ -0,0 +1,129 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; +import java.util.Collection; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.UniqueConstraint; + +@Entity +@Table(name="Grupo") +// Shortname: "gru" +@SequenceGenerator(name = "sequenceGrupo", sequenceName = "sqGrupo", initialValue = 1, allocationSize=1) +public class Grupo implements Serializable { + + private static final long serialVersionUID = 3819490399218258321L; + + @GeneratedValue(generator = "sequenceGrupo", strategy = GenerationType.AUTO) + @Id + private Long id; + + @Column(length=50, nullable=false) + private String nome; + + @Column(length=1, nullable=false) + private boolean ativo; + + @ManyToMany(mappedBy = "grupos") + private Collection usuarios; + + @ManyToMany + @JoinTable( name = "GrupoRegra", + joinColumns = {@JoinColumn(name = "gru_id")}, + inverseJoinColumns = {@JoinColumn(name = "reg_id")}, + uniqueConstraints={@UniqueConstraint(columnNames={"gru_id", "reg_id"})}) + private Collection regras; + + @ManyToMany + @JoinTable( name = "GrupoPrivilegio", + joinColumns = {@JoinColumn(name = "gru_id")}, + inverseJoinColumns = {@JoinColumn(name = "priv_id")}, + uniqueConstraints={@UniqueConstraint(columnNames={"gru_id", "priv_id"})}) + private Collection privilegios; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public boolean isAtivo() { + return ativo; + } + + public void setAtivo(boolean ativo) { + this.ativo = ativo; + } + + public Collection getUsuarios() { + return usuarios; + } + + public void setUsuarios(Collection usuarios) { + this.usuarios = usuarios; + } + + + + public Collection getRegras() { + return regras; + } + + public void setRegras(Collection regras) { + this.regras = regras; + } + + public Collection getPrivilegios() { + return privilegios; + } + + public void setPrivilegios(Collection privilegios) { + this.privilegios = privilegios; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Grupo other = (Grupo) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + + +} diff --git a/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Instituicao.java b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Instituicao.java new file mode 100644 index 0000000..63d690d --- /dev/null +++ b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Instituicao.java @@ -0,0 +1,89 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + + +@Entity +@Table(name="Instituicao") +// Shortname: "inst" +@SequenceGenerator(name = "sequenceInstituicao", sequenceName = "sqInstituicao", initialValue = 1, allocationSize=1) +public class Instituicao implements Serializable { + + private static final long serialVersionUID = 6879782331178330999L; + + @Id + @GeneratedValue(generator="sequenceInstituicao", strategy=GenerationType.AUTO) + private Long id; + + @Column(length=100, nullable=false) + private String nome; + @Column(length=20, nullable=true) + private String telefone; + @Column(length=100, nullable=true) + private String endereco; + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + public String getNome() { + return nome; + } + public void setNome(String nome) { + this.nome = nome; + } + public String getTelefone() { + return telefone; + } + public void setTelefone(String telefone) { + this.telefone = telefone; + } + public String getEndereco() { + return endereco; + } + public void setEndereco(String endereco) { + this.endereco = endereco; + } + + public String toString() { + return id + " - " + nome; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Instituicao other = (Instituicao) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + + public Instituicao() { + + } +} diff --git a/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Privilegio.java b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Privilegio.java new file mode 100644 index 0000000..a3e1af1 --- /dev/null +++ b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Privilegio.java @@ -0,0 +1,93 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; +import java.util.Collection; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.ManyToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +@Entity +//Short name: "pri" +@Table(name="Privilegio") +@SequenceGenerator(name = "sequencePrivilegio", sequenceName = "sqPrivilegio", initialValue = 1, allocationSize=1) +public class Privilegio implements Serializable { + + private static final long serialVersionUID = 4061273194728272687L; + + @Id + @GeneratedValue(generator="sequencePrivilegio", strategy=GenerationType.AUTO) + private Long id; + + @Column(length=100, nullable=false) + private String nome; + + @Column(length=300, nullable=false, unique=true) + private String token; + + @ManyToMany(mappedBy = "privilegios") + private Collection grupos; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public Collection getGrupos() { + return grupos; + } + + public void setGrupos(Collection grupos) { + this.grupos = grupos; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Privilegio other = (Privilegio) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + +} diff --git a/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Rede.java b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Rede.java new file mode 100644 index 0000000..0fd0401 --- /dev/null +++ b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Rede.java @@ -0,0 +1,112 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; +import java.util.Collection; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.UniqueConstraint; + +@Entity +//Short name: "rede" +@Table(name="Rede") +@SequenceGenerator(name = "sequenceRede", sequenceName = "sqRede", initialValue = 1, allocationSize=1) +public class Rede implements Serializable { + + private static final long serialVersionUID = -8764281348427990153L; + + @GeneratedValue(generator = "sequenceRede", strategy = GenerationType.AUTO) + @Id + private Long id; + + @Column(nullable=false, length=50) + private String nome; + + @Column(length=1, nullable=false) + private boolean aplicavelSexoMasculino; + + @Column(length=1, nullable=false) + private boolean aplicavelSexoFeminino; + + @ManyToMany + @JoinTable( name = "FaixaEtariaRede", + joinColumns = {@JoinColumn(name = "rede_id")}, + inverseJoinColumns = {@JoinColumn(name = "faiet_id")}, + uniqueConstraints={@UniqueConstraint(columnNames={"rede_id", "faiet_id"})}) + private Collection faixasEtarias; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public boolean isAplicavelSexoMasculino() { + return aplicavelSexoMasculino; + } + + public void setAplicavelSexoMasculino(boolean aplicavelSexoMasculino) { + this.aplicavelSexoMasculino = aplicavelSexoMasculino; + } + + public boolean isAplicavelSexoFeminino() { + return aplicavelSexoFeminino; + } + + public void setAplicavelSexoFeminino(boolean aplicavelSexoFeminino) { + this.aplicavelSexoFeminino = aplicavelSexoFeminino; + } + + public Collection getFaixasEtarias() { + return faixasEtarias; + } + + public void setFaixasEtarias(Collection faixasEtarias) { + this.faixasEtarias = faixasEtarias; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Rede other = (Rede) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + +} diff --git a/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Regra.java b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Regra.java new file mode 100644 index 0000000..42cb873 --- /dev/null +++ b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Regra.java @@ -0,0 +1,92 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; +import java.util.Collection; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.ManyToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +@Entity +//Short name: "reg" +@Table(name="Regra") +@SequenceGenerator(name = "sequenceRegra", sequenceName = "sqRegra", initialValue = 1, allocationSize=1) +public class Regra implements Serializable { + private static final long serialVersionUID = 6538831479698908253L; + + @Id + @GeneratedValue(generator="sequenceRegra", strategy=GenerationType.AUTO) + private Long id; + + @Column(length=100, nullable=false) + private String nome; + + @Column(length=300, nullable=false, unique=true) + private String token; + + @ManyToMany(mappedBy = "regras") + private Collection grupos; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + public Collection getGrupos() { + return grupos; + } + + public void setGrupos(Collection grupos) { + this.grupos = grupos; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Regra other = (Regra) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + +} diff --git a/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Usuario.java b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Usuario.java new file mode 100644 index 0000000..8d6b80d --- /dev/null +++ b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/Usuario.java @@ -0,0 +1,222 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.UniqueConstraint; + +import org.hibernate.annotations.Index; +import org.ufcspa.simdecs.entities.exceptions.InvalidSexoException; + +@Entity +// Short name: "usu" +@Table(name="Usuario") +@SequenceGenerator(name = "sequenceUsuario", sequenceName = "sqUsuario", initialValue = 1, allocationSize=1) +public class Usuario implements Serializable { + + private static final long serialVersionUID = 3970972520019742992L; + + @GeneratedValue(generator = "sequenceUsuario", strategy = GenerationType.AUTO) + @Id + private Long id; + + @Column(length=30, nullable=false, unique=true) + private String login; + + @Column(length=20, nullable=false) + private String senha; + + @Column(length=70, nullable=false) + private String nome; + + @Column(length=40, nullable=false, unique=true) + private String email; + + @Column(length=100) + private String funcao; + + @Column(length=1, nullable=true) + private String sexo; + + @Column(length=20, nullable=true) + private String telefone; + + @Temporal(TemporalType.DATE) + private Date dataNascimento; + + @Column(length=1, nullable=false) + private boolean aprovado; + + @Column(length=1, nullable=false) + private boolean ativo; + + @Temporal(TemporalType.DATE) + private Date dataCriacao; + + @ManyToOne + @JoinColumn(name = "usu_id", referencedColumnName = "id", nullable = true) + @Index(name="usu_usu_fk_i") + private Usuario criadoPor; + + @ManyToMany + @JoinTable( name = "UsuarioGrupo", + joinColumns = {@JoinColumn(name = "usu_id")}, + inverseJoinColumns = {@JoinColumn(name = "gru_id")}, + uniqueConstraints={@UniqueConstraint(columnNames={"usu_id", "gru_id"})}) + private Collection grupos; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getLogin() { + return login; + } + + public void setLogin(String login) { + this.login = login; + } + + public String getSenha() { + return senha; + } + + public void setSenha(String senha) { + this.senha = senha; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getFuncao() { + return funcao; + } + + public void setFuncao(String funcao) { + this.funcao = funcao; + } + + public String getSexo() { + return sexo; + } + + public void setSexo(String sexo) throws InvalidSexoException { + if (sexo.equals("F") || sexo.equals("M")) + this.sexo = sexo; + else + throw new InvalidSexoException("O sexo deverá ser 'F' ou 'M'!"); + } + + public String getTelefone() { + return telefone; + } + + public void setTelefone(String telefone) { + this.telefone = telefone; + } + + public Date getDataNascimento() { + return dataNascimento; + } + + public void setDataNascimento(Date dataNascimento) { + this.dataNascimento = dataNascimento; + } + + public boolean isAprovado() { + return aprovado; + } + + public void setAprovado(boolean aprovado) { + this.aprovado = aprovado; + } + + public boolean isAtivo() { + return ativo; + } + + public void setAtivo(boolean ativo) { + this.ativo = ativo; + } + + public Date getDataCriacao() { + return dataCriacao; + } + + public void setDataCriacao(Date dataCriacao) { + this.dataCriacao = dataCriacao; + } + + public Usuario getCriadoPor() { + return criadoPor; + } + + public void setCriadoPor(Usuario criadoPor) { + this.criadoPor = criadoPor; + } + + public Collection getGrupos() { + return grupos; + } + + public void setGrupos(Collection grupos) { + this.grupos = grupos; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Usuario other = (Usuario) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + +} diff --git a/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/exceptions/InvalidDomainException.java b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/exceptions/InvalidDomainException.java new file mode 100644 index 0000000..e058ff4 --- /dev/null +++ b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/exceptions/InvalidDomainException.java @@ -0,0 +1,10 @@ +package org.ufcspa.simdecs.entities.exceptions; + +public class InvalidDomainException extends Exception { + + private static final long serialVersionUID = -8819708917989477984L; + + public InvalidDomainException(String message) { + super(message); + } +} diff --git a/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/exceptions/InvalidSexoException.java b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/exceptions/InvalidSexoException.java new file mode 100644 index 0000000..250149b --- /dev/null +++ b/SimDeCS/resources/src/main/org/ufcspa/simdecs/entities/exceptions/InvalidSexoException.java @@ -0,0 +1,10 @@ +package org.ufcspa.simdecs.entities.exceptions; + +public class InvalidSexoException extends InvalidDomainException { + + private static final long serialVersionUID = 1501154204732377528L; + + public InvalidSexoException(String message) { + super(message); + } +} diff --git a/SimDeCS/resources/src/main/seam.properties b/SimDeCS/resources/src/main/seam.properties new file mode 100644 index 0000000..e69de29 diff --git a/SimDeCS/resources/src/main/security.drl b/SimDeCS/resources/src/main/security.drl new file mode 100644 index 0000000..b015775 --- /dev/null +++ b/SimDeCS/resources/src/main/security.drl @@ -0,0 +1,6 @@ +package Permissions; + +import java.security.Principal; + +import org.jboss.seam.security.permission.PermissionCheck; +import org.jboss.seam.security.Role; \ No newline at end of file diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/Authenticator.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/Authenticator.java new file mode 100644 index 0000000..6c642e8 --- /dev/null +++ b/SimDeCS/src/hot/org/ufcspa/simdecs/session/Authenticator.java @@ -0,0 +1,58 @@ +package org.ufcspa.simdecs.session; + +import java.util.Iterator; + +import javax.persistence.EntityManager; +import javax.persistence.NoResultException; + +import org.jboss.seam.annotations.In; +import org.jboss.seam.annotations.Logger; +import org.jboss.seam.annotations.Name; +import org.jboss.seam.log.Log; +import org.jboss.seam.security.Credentials; +import org.jboss.seam.security.Identity; +import org.ufcspa.simdecs.entities.Regra; +import org.ufcspa.simdecs.entities.Usuario; + +@Name("authenticator") +public class Authenticator +{ + @Logger private Log log; + + @In Identity identity; + @In Credentials credentials; + + @In + private EntityManager entityManager; + + public boolean authenticate() + { +log.info("entrou no metodo autenticate"); + Usuario usuario; + try { + usuario= (Usuario) entityManager.createQuery("select usu from Usuario as usu where usu.login=:login and usu.senha=:senha") + .setParameter("login", credentials.getUsername()) + .setParameter("senha", credentials.getPassword()) + .getSingleResult(); + } catch (NoResultException ne) { + log.info("Não encontrou usuário"); + return false; + } + +log.info("usuario nao é nulo"); + + Iterator rolesIt = entityManager.createQuery("Select reg From Regra as reg inner join reg.grupos gru inner join gru.usuarios usu where usu.id=:idUsuario") + .setParameter("idUsuario", usuario.getId()) + .getResultList() + .iterator(); + + while(rolesIt.hasNext()) + identity.addRole(((Regra) rolesIt.next()).getToken()); + + + log.info("authenticating {0}", credentials.getUsername()); + + return true; + } + +} diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/Bean.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/Bean.java new file mode 100644 index 0000000..c675043 --- /dev/null +++ b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/Bean.java @@ -0,0 +1,81 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import java.util.ArrayList; +import java.util.List; + +import javax.faces.model.SelectItem; +import javax.persistence.EntityManager; +import javax.persistence.NoResultException; + +import org.jboss.seam.annotations.In; +import org.jboss.annotation.factory.*; +import org.jboss.seam.annotations.Factory; +import org.jboss.seam.annotations.Logger; +import org.jboss.seam.annotations.Name; +import org.jboss.seam.annotations.Out; +import org.jboss.seam.international.StatusMessages; +import org.jboss.seam.log.Log; +import org.ufcspa.simdecs.entities.Grupo; + +@Name("bean") +public class Bean +{ + @Logger private Log log; + + @In StatusMessages statusMessages; + + + private List listaDestino; + private List listaOrigem; + + + + private EntityManager entityManager; + + + public void bean() + { + // implement your business logic here + log.info("bean.bean() action called"); + statusMessages.add("bean"); + + } + + // add additional action methods + + public List getListaDestino() { + if (listaDestino == null) { + + listaDestino = new ArrayList(); + System.out.println("Nova Lista"); + } + return listaDestino; + } + + @Factory("getListaOrigem") + public List getListaOrigem() { + if (listaOrigem == null) { + listaOrigem = new ArrayList(); + + /* Criei esse objeto apenas a título de exemplo. + * Num caso real, você poderia buscar a lista do banco. + */ + + Grupo o = new Grupo(); + o.setNome("teste"); + o.setId(Long.valueOf(2)); + o.setAtivo(true); + listaOrigem.add(new SelectItem(o, o.getNome())); + } + return listaOrigem; + } + + + + public void setListaDestino(List listaDestino) { + this.listaDestino = listaDestino; + } + public void setListaOrigem(List listaOrigem) { + this.listaOrigem = listaOrigem; + } +} diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/GrupoHome.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/GrupoHome.java new file mode 100644 index 0000000..f227feb --- /dev/null +++ b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/GrupoHome.java @@ -0,0 +1,42 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Grupo; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityHome; + +@Name("grupoHome") +public class GrupoHome extends SimDeCSEntityHome { + + public void setGrupoId(Long id) { + setId(id); + } + + public Long getGrupoId() { + return (Long) getId(); + } + + @Override + protected Grupo createInstance() { + Grupo grupo = new Grupo(); + return grupo; + } + + public void load() { + if (isIdDefined()) { + wire(); + } + } + + public void wire() { + getInstance(); + } + + public boolean isWired() { + return true; + } + + public Grupo getDefinedInstance() { + return isIdDefined() ? getInstance() : null; + } + +} diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/GrupoList.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/GrupoList.java new file mode 100644 index 0000000..6c47fe8 --- /dev/null +++ b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/GrupoList.java @@ -0,0 +1,27 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import java.util.Arrays; + +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Grupo; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityQuery; + +@Name("grupoList") +public class GrupoList extends SimDeCSEntityQuery { + + private static final String EJBQL = "select grupo from Grupo grupo"; + + private static final String[] RESTRICTIONS = { "lower(grupo.nome) like lower(concat(#{grupoList.grupo.nome},'%'))", }; + + private Grupo grupo = new Grupo(); + + public GrupoList() { + setEjbql(EJBQL); + setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS)); + setMaxResults(25); + } + + public Grupo getGrupo() { + return grupo; + } +} diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/InstituicaoHome.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/InstituicaoHome.java new file mode 100644 index 0000000..0ec8ff9 --- /dev/null +++ b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/InstituicaoHome.java @@ -0,0 +1,42 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Instituicao; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityHome; + +@Name("instituicaoHome") +public class InstituicaoHome extends SimDeCSEntityHome { + + public void setInstituicaoId(Long id) { + setId(id); + } + + public Long getInstituicaoId() { + return (Long) getId(); + } + + @Override + protected Instituicao createInstance() { + Instituicao instituicao = new Instituicao(); + return instituicao; + } + + public void load() { + if (isIdDefined()) { + wire(); + } + } + + public void wire() { + getInstance(); + } + + public boolean isWired() { + return true; + } + + public Instituicao getDefinedInstance() { + return isIdDefined() ? getInstance() : null; + } + +} diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/InstituicaoList.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/InstituicaoList.java new file mode 100644 index 0000000..91ddd83 --- /dev/null +++ b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/InstituicaoList.java @@ -0,0 +1,30 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import java.util.Arrays; + +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Instituicao; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityQuery; + +@Name("instituicaoList") +public class InstituicaoList extends SimDeCSEntityQuery { + + private static final String EJBQL = "select instituicao from Instituicao instituicao"; + + private static final String[] RESTRICTIONS = { + "lower(instituicao.endereco) like lower(concat(#{instituicaoList.instituicao.endereco},'%'))", + "lower(instituicao.nome) like lower(concat(#{instituicaoList.instituicao.nome},'%'))", + "lower(instituicao.telefone) like lower(concat(#{instituicaoList.instituicao.telefone},'%'))", }; + + private Instituicao instituicao = new Instituicao(); + + public InstituicaoList() { + setEjbql(EJBQL); + setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS)); + setMaxResults(25); + } + + public Instituicao getInstituicao() { + return instituicao; + } +} diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/ListBeanPendente.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/ListBeanPendente.java new file mode 100644 index 0000000..36a8fd2 --- /dev/null +++ b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/ListBeanPendente.java @@ -0,0 +1,107 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import javax.ejb.Remove; +import javax.ejb.Stateful; +import javax.ejb.Stateless; +import javax.faces.model.SelectItem; +import javax.persistence.EntityManager; + +import org.hibernate.loader.custom.Return; +import org.jboss.seam.ScopeType; +import org.jboss.seam.annotations.In; +import org.jboss.annotation.factory.*; +import org.jboss.seam.annotations.Begin; +import org.jboss.seam.annotations.Destroy; +import org.jboss.seam.annotations.End; +import org.jboss.seam.annotations.Factory; +import org.jboss.seam.annotations.Logger; +import org.jboss.seam.annotations.Name; +import org.jboss.seam.annotations.Out; +import org.jboss.seam.annotations.Scope; +import org.jboss.seam.annotations.datamodel.DataModel; +import org.jboss.seam.annotations.datamodel.DataModelSelection; +import org.jboss.seam.international.StatusMessages; +import org.jboss.seam.log.Log; +import org.omg.Security.Public; +import org.ufcspa.simdecs.entities.Grupo; +import org.ufcspa.simdecs.entities.Usuario; + + +@Name("listBeanPendente") +@Scope(ScopeType.EVENT) +public class ListBeanPendente +{ + @Logger private Log log; + @In private EntityManager entityManager; + @In StatusMessages statusMessages; + + private List gruposPendentes = new ArrayList();; +// private Collection novaListaGrupo; +// + + + + +// public Collection getNovaListaGrupo() { +// return novaListaGrupo; +// } + + + + + public void listBeanPendente(){ + } + + + @SuppressWarnings("unchecked") + public List gruposPendentes() + { + if (gruposPendentes.isEmpty()) { + System.out.println("Carrega Lista"); + gruposPendentes = (List)entityManager.createQuery("from Grupo grupo where grupo.id not in (select g.id From Grupo as g inner join g.usuarios usu where usu.id=:idDoUsuario)") + .setParameter("idDoUsuario", Integer.getInteger("#{usuarioHome.usuarioId}")) + .getResultList(); + } + for (Grupo a:gruposPendentes ){ + System.out.println(a.getNome()); + } + return gruposPendentes; + } + + + public void setGruposPendentes(List gruposPendentes) { + this.gruposPendentes = gruposPendentes; + } + +// public void setNovaListaGrupo(List novaListaGrupo) { +// this.novaListaGrupo = novaListaGrupo; +// } + + +// @SuppressWarnings("unchecked") +// public void setaNovaLista(){ +// Usuario user = new Usuario(); +// user = (Usuario) entityManager.createQuery("from Usuario usu where usu.id usu.id=:idDoUsuario)") +// .setParameter("idDoUsuario", Integer.getInteger("#{usuarioHome.usuarioId}")) +// .getSingleResult(); +// user.setGrupos(novaListaGrupo); +// +// } + + +// @SuppressWarnings("unused") +// @Remove +// @Destroy +// private void destruicaoObrigatoria() { +// // TODO Auto-generated method stub +// log.info("Cahmado metodo de destruição obrigatoria"); +// +// } + + + +} diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/PrivilegioHome.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/PrivilegioHome.java new file mode 100644 index 0000000..07dd39c --- /dev/null +++ b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/PrivilegioHome.java @@ -0,0 +1,42 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Privilegio; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityHome; + +@Name("privilegioHome") +public class PrivilegioHome extends SimDeCSEntityHome { + + public void setPrivilegioId(Long id) { + setId(id); + } + + public Long getPrivilegioId() { + return (Long) getId(); + } + + @Override + protected Privilegio createInstance() { + Privilegio privilegio = new Privilegio(); + return privilegio; + } + + public void load() { + if (isIdDefined()) { + wire(); + } + } + + public void wire() { + getInstance(); + } + + public boolean isWired() { + return true; + } + + public Privilegio getDefinedInstance() { + return isIdDefined() ? getInstance() : null; + } + +} diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/PrivilegioList.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/PrivilegioList.java new file mode 100644 index 0000000..95e2271 --- /dev/null +++ b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/PrivilegioList.java @@ -0,0 +1,29 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import java.util.Arrays; + +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Privilegio; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityQuery; + +@Name("privilegioList") +public class PrivilegioList extends SimDeCSEntityQuery { + + private static final String EJBQL = "select privilegio from Privilegio privilegio"; + + private static final String[] RESTRICTIONS = { + "lower(privilegio.nome) like lower(concat(#{privilegioList.privilegio.nome},'%'))", + "lower(privilegio.token) like lower(concat(#{privilegioList.privilegio.token},'%'))", }; + + private Privilegio privilegio = new Privilegio(); + + public PrivilegioList() { + setEjbql(EJBQL); + setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS)); + setMaxResults(25); + } + + public Privilegio getPrivilegio() { + return privilegio; + } +} diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/RegraHome.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/RegraHome.java new file mode 100644 index 0000000..22ce650 --- /dev/null +++ b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/RegraHome.java @@ -0,0 +1,42 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Regra; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityHome; + +@Name("regraHome") +public class RegraHome extends SimDeCSEntityHome { + + public void setRegraId(Long id) { + setId(id); + } + + public Long getRegraId() { + return (Long) getId(); + } + + @Override + protected Regra createInstance() { + Regra regra = new Regra(); + return regra; + } + + public void load() { + if (isIdDefined()) { + wire(); + } + } + + public void wire() { + getInstance(); + } + + public boolean isWired() { + return true; + } + + public Regra getDefinedInstance() { + return isIdDefined() ? getInstance() : null; + } + +} diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/RegraList.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/RegraList.java new file mode 100644 index 0000000..159b8d7 --- /dev/null +++ b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/RegraList.java @@ -0,0 +1,29 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import java.util.Arrays; + +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Regra; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityQuery; + +@Name("regraList") +public class RegraList extends SimDeCSEntityQuery { + + private static final String EJBQL = "select regra from Regra regra"; + + private static final String[] RESTRICTIONS = { + "lower(regra.nome) like lower(concat(#{regraList.regra.nome},'%'))", + "lower(regra.token) like lower(concat(#{regraList.regra.token},'%'))", }; + + private Regra regra = new Regra(); + + public RegraList() { + setEjbql(EJBQL); + setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS)); + setMaxResults(25); + } + + public Regra getRegra() { + return regra; + } +} diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioGrupoList.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioGrupoList.java new file mode 100644 index 0000000..a6ba07c --- /dev/null +++ b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioGrupoList.java @@ -0,0 +1,30 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import java.util.Arrays; +import java.util.ArrayList; +import java.util.List; +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Grupo; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityQuery; + +@Name("usuarioGrupoList") +public class UsuarioGrupoList extends SimDeCSEntityQuery { + + + private static final String EJBQL = "select grupo From Grupo as grupo inner join grupo.usuarios usu"; + private static final String[] RESTRICTIONS = { "usu.id= #{usuarioList.usuario.id}"}; + private Grupo grupo = new Grupo(); + + public UsuarioGrupoList() { + setEjbql(EJBQL); + setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS)); + setMaxResults(25); + + } + + public Grupo getGrupo() { + return grupo; + } + + +} diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioHome.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioHome.java new file mode 100644 index 0000000..314dc27 --- /dev/null +++ b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioHome.java @@ -0,0 +1,46 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import org.jboss.seam.annotations.In; +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Usuario; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityHome; + +@Name("usuarioHome") +public class UsuarioHome extends SimDeCSEntityHome { + + @In(create = true) + UsuarioHome usuarioHome; + + public void setUsuarioId(Long id) { + setId(id); + } + + public Long getUsuarioId() { + return (Long) getId(); + } + + @Override + protected Usuario createInstance() { + Usuario usuario = new Usuario(); + return usuario; + } + + public void load() { + if (isIdDefined()) { + wire(); + } + } + + public void wire() { + getInstance(); + } + + public boolean isWired() { + return true; + } + + public Usuario getDefinedInstance() { + return isIdDefined() ? getInstance() : null; + } + +} diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioLisGrupoPickList.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioLisGrupoPickList.java new file mode 100644 index 0000000..bad7e0e --- /dev/null +++ b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioLisGrupoPickList.java @@ -0,0 +1,68 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import java.util.List; +import java.util.ArrayList; +import javax.faces.model.SelectItem; +import javax.faces.model.SelectItemGroup; +import javax.persistence.EntityManager; +import javax.persistence.NoResultException; +import org.jboss.seam.annotations.Name; +import org.jboss.seam.annotations.In; +import org.jboss.seam.annotations.Logger; +import org.jboss.seam.log.Log; +import org.ufcspa.simdecs.entities.Grupo; + + + +@Name("usuarioLisGrupoPickList") +public class UsuarioLisGrupoPickList +{ + @Logger private Log log; + + // @In StatusMessages statusMessages; + + private EntityManager entityManager; + // private List option; + private List listSelecionada; + + public List UsuarioLisGrupoPickList() + { + // implement your business logic here + log.info("usuarioLisGrupoPickList.usuarioLisGrupoPickList() action called"); +// statusMessages.add("usuarioLisGrupoPickList"); + log.info("entrou no metodo usuarioLisGrupoPickList"); + + ArrayList listaSelect = new ArrayList(); + + + + try { + List gruposLidos = entityManager.createQuery("select grupo From Grupo as grupo inner join grupo.usuarios usu where usu.id=:id") + .setParameter("id", "#{usuarioList.usuario.id}") + .getResultList(); + for (Grupo gr : gruposLidos ) { + //List selecionavel = new ArrayList(); + SelectItem selecionavel = new SelectItem(gr.getNome().toString()); + + listaSelect.add(selecionavel); + } + + } catch (NoResultException ne) { + log.info("Não encontrou grupo"); + // return false; + } + return listaSelect; + } + + // add additional action methods + + + + public List getListSelecionada() { + return listSelecionada; + } + + public void setListSelecionada(List listSelecionada) { + this.listSelecionada = listSelecionada; + } +} diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioList.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioList.java new file mode 100644 index 0000000..6bb44e9 --- /dev/null +++ b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/admin/UsuarioList.java @@ -0,0 +1,46 @@ +package org.ufcspa.simdecs.session.crud.admin; + +import java.util.Arrays; +import java.util.Collection; +import java.util.List; + +import org.jboss.seam.annotations.Name; +import org.ufcspa.simdecs.entities.Usuario; +import org.ufcspa.simdecs.entities.Grupo; +import org.ufcspa.simdecs.session.crud.defaults.SimDeCSEntityQuery; + +import com.lowagie.text.pdf.hyphenation.TernaryTree.Iterator; + +@Name("usuarioList") +public class UsuarioList extends SimDeCSEntityQuery { + + private static final String EJBQL = "select usuario from Usuario usuario"; + + private static final String[] RESTRICTIONS = { + "lower(usuario.email) like lower(concat(#{usuarioList.usuario.email},'%'))", + "lower(usuario.funcao) like lower(concat(#{usuarioList.usuario.funcao},'%'))", + "lower(usuario.login) like lower(concat(#{usuarioList.usuario.login},'%'))", + "lower(usuario.nome) like lower(concat(#{usuarioList.usuario.nome},'%'))", + "lower(usuario.senha) like lower(concat(#{usuarioList.usuario.senha},'%'))", + "lower(usuario.sexo) like lower(concat(#{usuarioList.usuario.sexo},'%'))", + "lower(usuario.telefone) like lower(concat(#{usuarioList.usuario.telefone},'%'))", }; + + private Usuario usuario = new Usuario(); + + + + public UsuarioList() { + setEjbql(EJBQL); + setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS)); + setMaxResults(25); + } + + + public Usuario getUsuario() { + return usuario; + } + + + + +} diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/defaults/SimDeCSEntityHome.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/defaults/SimDeCSEntityHome.java new file mode 100644 index 0000000..f441e18 --- /dev/null +++ b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/defaults/SimDeCSEntityHome.java @@ -0,0 +1,17 @@ +package org.ufcspa.simdecs.session.crud.defaults; + +import org.jboss.seam.core.Expressions; +import org.jboss.seam.framework.EntityHome; + +public abstract class SimDeCSEntityHome extends EntityHome { + + protected void initDefaultMessages() + { + super.initDefaultMessages(); + Expressions expressions = new Expressions(); + setCreatedMessage(expressions.createValueExpression("Registro criado com sucesso!")); + setDeletedMessage(expressions.createValueExpression("Registro excluido com sucesso!")); + setUpdatedMessage(expressions.createValueExpression("Registro alterado com sucesso!")); + } + +} diff --git a/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/defaults/SimDeCSEntityQuery.java b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/defaults/SimDeCSEntityQuery.java new file mode 100644 index 0000000..a5b9ab9 --- /dev/null +++ b/SimDeCS/src/hot/org/ufcspa/simdecs/session/crud/defaults/SimDeCSEntityQuery.java @@ -0,0 +1,8 @@ +package org.ufcspa.simdecs.session.crud.defaults; + +import org.jboss.seam.framework.EntityQuery; + +public abstract class SimDeCSEntityQuery extends EntityQuery { + + +} diff --git a/SimDeCS/src/hot/seam.properties b/SimDeCS/src/hot/seam.properties new file mode 100644 index 0000000..e69de29 diff --git a/SimDeCS/src/main/META-INF/persistence.xml b/SimDeCS/src/main/META-INF/persistence.xml new file mode 100644 index 0000000..d87cfdb --- /dev/null +++ b/SimDeCS/src/main/META-INF/persistence.xml @@ -0,0 +1,20 @@ + + + + + + org.hibernate.ejb.HibernatePersistence + java:/SimDeCSDatasource + + + + + + + + + + diff --git a/SimDeCS/src/main/components.properties b/SimDeCS/src/main/components.properties new file mode 100644 index 0000000..c598420 --- /dev/null +++ b/SimDeCS/src/main/components.properties @@ -0,0 +1,4 @@ +# +#Thu Apr 21 18:54:34 BRT 2011 +jndiPattern=\#{ejbName}/local +embeddedEjb=false diff --git a/SimDeCS/src/main/import.sql b/SimDeCS/src/main/import.sql new file mode 100644 index 0000000..3c28ee8 --- /dev/null +++ b/SimDeCS/src/main/import.sql @@ -0,0 +1 @@ +-- SQL statements which are executed at application startup if hibernate.hbm2ddl.auto is 'create' or 'create-drop' diff --git a/SimDeCS/src/main/messages_en.properties b/SimDeCS/src/main/messages_en.properties new file mode 100644 index 0000000..fdc41bd --- /dev/null +++ b/SimDeCS/src/main/messages_en.properties @@ -0,0 +1,90 @@ +up=\u2191 +down=\u2193 +left=\u2039 +right=\u203A + +validator.assertFalse=validation failed +validator.assertTrue=validation failed +validator.future=must be a future date +validator.length=length must be between {min} and {max} +validator.max=must be less than or equal to {value} +validator.min=must be greater than or equal to {value} +validator.notNull=may not be null +validator.past=must be a past date +validator.pattern=must match "{regex}" +validator.range=must be between {min} and {max} +validator.size=size must be between {min} and {max} +validator.email=must be a well-formed email address + +org.jboss.seam.loginFailed=Login failed +org.jboss.seam.loginSuccessful=Welcome, #0! + +org.jboss.seam.TransactionFailed=Transaction failed +org.jboss.seam.NoConversation=The conversation ended, timed out or was processing another request +org.jboss.seam.IllegalNavigation=Illegal navigation +org.jboss.seam.ProcessEnded=Process #0 already ended +org.jboss.seam.ProcessNotFound=Process #0 not found +org.jboss.seam.TaskEnded=Task #0 already ended +org.jboss.seam.TaskNotFound=Task #0 not found +org.jboss.seam.NotLoggedIn=Please log in first + +javax.faces.component.UIInput.CONVERSION=value could not be converted to the expected type +javax.faces.component.UIInput.REQUIRED=value is required +javax.faces.component.UIInput.UPDATE=an error occurred when processing your submitted information +javax.faces.component.UISelectOne.INVALID=value is not valid +javax.faces.component.UISelectMany.INVALID=value is not valid + +javax.faces.converter.BigDecimalConverter.DECIMAL=value must be a number +javax.faces.converter.BigDecimalConverter.DECIMAL_detail=value must be a signed decimal number consisting of zero or more digits, optionally followed by a decimal point and fraction, eg. {1} +javax.faces.converter.BigIntegerConverter.BIGINTEGER=value must be an integer +javax.faces.converter.BigIntegerConverter.BIGINTEGER_detail=value must be a signed integer number consisting of zero or more digits +javax.faces.converter.BooleanConverter.BOOLEAN=value must be true or false +javax.faces.converter.BooleanConverter.BOOLEAN_detail=value must be true or false (any value other than true will evaluate to false) +javax.faces.converter.ByteConverter.BYTE=value must be a number between 0 and 255 +javax.faces.converter.ByteConverter.BYTE_detail=value must be a number between 0 and 255 +javax.faces.converter.CharacterConverter.CHARACTER=value must be a character +javax.faces.converter.CharacterConverter.CHARACTER_detail=value must be a valid ASCII character +javax.faces.converter.DateTimeConverter.DATE=value must be a date +javax.faces.converter.DateTimeConverter.DATE_detail=value must be a date, eg. {1} +javax.faces.converter.DateTimeConverter.TIME=value must be a time +javax.faces.converter.DateTimeConverter.TIME_detail=value must be a time, eg. {1} +javax.faces.converter.DateTimeConverter.DATETIME=value must be a date and time +javax.faces.converter.DateTimeConverter.DATETIME_detail=value must be a date and time, eg. {1} +javax.faces.converter.DateTimeConverter.PATTERN_TYPE=a pattern or type attribute must be specified to convert the value +javax.faces.converter.DoubleConverter.DOUBLE=value must be a number +javax.faces.converter.DoubleConverter.DOUBLE_detail=value must be a number between 4.9E-324 and 1.7976931348623157E308 +javax.faces.converter.EnumConverter.ENUM=value must be convertible to an enum +javax.faces.converter.EnumConverter.ENUM_detail=value must be convertible to an enum or from the enum that contains the constant {1} +javax.faces.converter.EnumConverter.ENUM_NO_CLASS=value must be convertible to an enum or from the enum, but no enum class provided +javax.faces.converter.EnumConverter.ENUM_NO_CLASS_detail=value must be convertible to an enum or from the enum, but no enum class provided +javax.faces.converter.FloatConverter.FLOAT=value must be a number +javax.faces.converter.FloatConverter.FLOAT_detail=value must be a number between 1.4E-45 and 3.4028235E38 +javax.faces.converter.IntegerConverter.INTEGER=value must be an integer +javax.faces.converter.IntegerConverter.INTEGER_detail=value must be an integer number between -2147483648 and 2147483647 +javax.faces.converter.LongConverter.LONG=value must be an integer +javax.faces.converter.LongConverter.LONG_detail=value must be an integer number between -9223372036854775808 and 9223372036854775807 +javax.faces.converter.NumberConverter.CURRENCY=value must be a currency amount +javax.faces.converter.NumberConverter.CURRENCY_detail=value must be a currency amount, eg. {1} +javax.faces.converter.NumberConverter.PERCENT=value must be a percentage amount +javax.faces.converter.NumberConverter.PERCENT_detail=value must be a percentage amount, eg. {1} +javax.faces.converter.NumberConverter.NUMBER=value must be a number +javax.faces.converter.NumberConverter.NUMBER_detail=value must be a number +javax.faces.converter.NumberConverter.PATTERN=value must be a number +javax.faces.converter.NumberConverter.PATTERN_detail=value must be a number +javax.faces.converter.ShortConverter.SHORT=value must be an integer +javax.faces.converter.ShortConverter.SHORT_detail=value must be an integer number between -32768 and 32767 + +javax.faces.validator.DoubleRangeValidator.MAXIMUM=value must be less than or equal to {0} +javax.faces.validator.DoubleRangeValidator.MINIMUM=value must be greater than or equal to {0} +javax.faces.validator.DoubleRangeValidator.NOT_IN_RANGE=value must be between {0} and {1} +javax.faces.validator.DoubleRangeValidator.TYPE=value is not of the correct type +javax.faces.validator.LengthValidator.MAXIMUM=value must be shorter than or equal to {0} characters +javax.faces.validator.LengthValidator.MINIMUM=value must be longer than or equal to {0} characters +javax.faces.validator.LongRangeValidator.MAXIMUM=value must be less than or equal to {0} +javax.faces.validator.LongRangeValidator.MINIMUM=value must be greater than or equal to {0} +javax.faces.validator.LongRangeValidator.NOT_IN_RANGE=value must be between {0} and {1} +javax.faces.validator.LongRangeValidator.TYPE=value is not of the correct type + +javax.faces.validator.NOT_IN_RANGE=value must be between {0} and {1} +javax.faces.converter.STRING=value could not be converted to a string + diff --git a/SimDeCS/src/main/messages_pt_BR.properties b/SimDeCS/src/main/messages_pt_BR.properties new file mode 100644 index 0000000..833b84d --- /dev/null +++ b/SimDeCS/src/main/messages_pt_BR.properties @@ -0,0 +1,90 @@ +up=\u2191 +down=\u2193 +left=\u2039 +right=\u203A + +validator.assertFalse=validation failed +validator.assertTrue=validation failed +validator.future=must be a future date +validator.length=length must be between {min} and {max} +validator.max=must be less than or equal to {value} +validator.min=must be greater than or equal to {value} +validator.notNull=may not be null +validator.past=must be a past date +validator.pattern=must match "{regex}" +validator.range=must be between {min} and {max} +validator.size=size must be between {min} and {max} +validator.email=must be a well-formed email address + +org.jboss.seam.loginFailed=Usu\u00E1rio / senha inv\u00E1lidos +org.jboss.seam.loginSuccessful=Bem vindo, \#0\! + +org.jboss.seam.TransactionFailed=Transa\u00E7\u00E3o falhou +org.jboss.seam.NoConversation=The conversation ended, timed out or was processing another request +org.jboss.seam.IllegalNavigation=Illegal navigation +org.jboss.seam.ProcessEnded=Process #0 already ended +org.jboss.seam.ProcessNotFound=Process #0 not found +org.jboss.seam.TaskEnded=Task #0 already ended +org.jboss.seam.TaskNotFound=Task #0 not found +org.jboss.seam.NotLoggedIn=Por favor, efetue login + +javax.faces.component.UIInput.CONVERSION=value could not be converted to the expected type +javax.faces.component.UIInput.REQUIRED=value is required +javax.faces.component.UIInput.UPDATE=an error occurred when processing your submitted information +javax.faces.component.UISelectOne.INVALID=value is not valid +javax.faces.component.UISelectMany.INVALID=value is not valid + +javax.faces.converter.BigDecimalConverter.DECIMAL=value must be a number +javax.faces.converter.BigDecimalConverter.DECIMAL_detail=value must be a signed decimal number consisting of zero or more digits, optionally followed by a decimal point and fraction, eg. {1} +javax.faces.converter.BigIntegerConverter.BIGINTEGER=value must be an integer +javax.faces.converter.BigIntegerConverter.BIGINTEGER_detail=value must be a signed integer number consisting of zero or more digits +javax.faces.converter.BooleanConverter.BOOLEAN=value must be true or false +javax.faces.converter.BooleanConverter.BOOLEAN_detail=value must be true or false (any value other than true will evaluate to false) +javax.faces.converter.ByteConverter.BYTE=value must be a number between 0 and 255 +javax.faces.converter.ByteConverter.BYTE_detail=value must be a number between 0 and 255 +javax.faces.converter.CharacterConverter.CHARACTER=value must be a character +javax.faces.converter.CharacterConverter.CHARACTER_detail=value must be a valid ASCII character +javax.faces.converter.DateTimeConverter.DATE=value must be a date +javax.faces.converter.DateTimeConverter.DATE_detail=value must be a date, eg. {1} +javax.faces.converter.DateTimeConverter.TIME=value must be a time +javax.faces.converter.DateTimeConverter.TIME_detail=value must be a time, eg. {1} +javax.faces.converter.DateTimeConverter.DATETIME=value must be a date and time +javax.faces.converter.DateTimeConverter.DATETIME_detail=value must be a date and time, eg. {1} +javax.faces.converter.DateTimeConverter.PATTERN_TYPE=a pattern or type attribute must be specified to convert the value +javax.faces.converter.DoubleConverter.DOUBLE=value must be a number +javax.faces.converter.DoubleConverter.DOUBLE_detail=value must be a number between 4.9E-324 and 1.7976931348623157E308 +javax.faces.converter.EnumConverter.ENUM=value must be convertible to an enum +javax.faces.converter.EnumConverter.ENUM_detail=value must be convertible to an enum or from the enum that contains the constant {1} +javax.faces.converter.EnumConverter.ENUM_NO_CLASS=value must be convertible to an enum or from the enum, but no enum class provided +javax.faces.converter.EnumConverter.ENUM_NO_CLASS_detail=value must be convertible to an enum or from the enum, but no enum class provided +javax.faces.converter.FloatConverter.FLOAT=value must be a number +javax.faces.converter.FloatConverter.FLOAT_detail=value must be a number between 1.4E-45 and 3.4028235E38 +javax.faces.converter.IntegerConverter.INTEGER=value must be an integer +javax.faces.converter.IntegerConverter.INTEGER_detail=value must be an integer number between -2147483648 and 2147483647 +javax.faces.converter.LongConverter.LONG=value must be an integer +javax.faces.converter.LongConverter.LONG_detail=value must be an integer number between -9223372036854775808 and 9223372036854775807 +javax.faces.converter.NumberConverter.CURRENCY=value must be a currency amount +javax.faces.converter.NumberConverter.CURRENCY_detail=value must be a currency amount, eg. {1} +javax.faces.converter.NumberConverter.PERCENT=value must be a percentage amount +javax.faces.converter.NumberConverter.PERCENT_detail=value must be a percentage amount, eg. {1} +javax.faces.converter.NumberConverter.NUMBER=value must be a number +javax.faces.converter.NumberConverter.NUMBER_detail=value must be a number +javax.faces.converter.NumberConverter.PATTERN=value must be a number +javax.faces.converter.NumberConverter.PATTERN_detail=value must be a number +javax.faces.converter.ShortConverter.SHORT=value must be an integer +javax.faces.converter.ShortConverter.SHORT_detail=value must be an integer number between -32768 and 32767 + +javax.faces.validator.DoubleRangeValidator.MAXIMUM=value must be less than or equal to {0} +javax.faces.validator.DoubleRangeValidator.MINIMUM=value must be greater than or equal to {0} +javax.faces.validator.DoubleRangeValidator.NOT_IN_RANGE=value must be between {0} and {1} +javax.faces.validator.DoubleRangeValidator.TYPE=value is not of the correct type +javax.faces.validator.LengthValidator.MAXIMUM=value must be shorter than or equal to {0} characters +javax.faces.validator.LengthValidator.MINIMUM=value must be longer than or equal to {0} characters +javax.faces.validator.LongRangeValidator.MAXIMUM=value must be less than or equal to {0} +javax.faces.validator.LongRangeValidator.MINIMUM=value must be greater than or equal to {0} +javax.faces.validator.LongRangeValidator.NOT_IN_RANGE=value must be between {0} and {1} +javax.faces.validator.LongRangeValidator.TYPE=value is not of the correct type + +javax.faces.validator.NOT_IN_RANGE=value must be between {0} and {1} +javax.faces.converter.STRING=value could not be converted to a string + diff --git a/SimDeCS/src/main/org/ufcspa/simdecs/entities/Ator.java b/SimDeCS/src/main/org/ufcspa/simdecs/entities/Ator.java new file mode 100644 index 0000000..7752f97 --- /dev/null +++ b/SimDeCS/src/main/org/ufcspa/simdecs/entities/Ator.java @@ -0,0 +1,152 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +import org.hibernate.annotations.Index; + + +@Entity +@Table(name="Ator") +// Shortname: "ator" +@SequenceGenerator(name = "sequenceAtor", sequenceName = "sqAtor", initialValue = 1, allocationSize=1) +public abstract class Ator implements Serializable { + + private static final long serialVersionUID = 1095865636605383931L; + + @GeneratedValue(generator = "sequenceAtor", strategy = GenerationType.AUTO) + @Id + private Long id; + + @Column(length=100, nullable=false) + private String nome; + + @Column(length=2, nullable=false, unique=true) + private Integer ordem; + + @Column(nullable=true) + private Float altura; + @Column(nullable=true) + private Float peso; + @Column(nullable=false, length=3) + private Integer idade; + @Column(nullable=false, length=1) + private String sexo; + + @ManyToOne + @JoinColumn(name = "ava_id", referencedColumnName = "id", nullable = true) + @Index(name="ator_ava_fk_i") + private Avatar avatar; + + @ManyToOne + @JoinColumn(name = "caso_id", referencedColumnName = "id", nullable = true) + @Index(name="ator_caso_fk_i") + private CasoClinico casoClinico; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public Integer getOrdem() { + return ordem; + } + + public void setOrdem(Integer ordem) { + this.ordem = ordem; + } + + public Float getAltura() { + return altura; + } + + public void setAltura(Float altura) { + this.altura = altura; + } + + public Float getPeso() { + return peso; + } + + public void setPeso(Float peso) { + this.peso = peso; + } + + public Integer getIdade() { + return idade; + } + + public void setIdade(Integer idade) { + this.idade = idade; + } + + public String getSexo() { + return sexo; + } + + public void setSexo(String sexo) { + this.sexo = sexo; + } + + public Avatar getAvatar() { + return avatar; + } + + public void setAvatar(Avatar avatar) { + this.avatar = avatar; + } + + public CasoClinico getCasoClinico() { + return casoClinico; + } + + public void setCasoClinico(CasoClinico casoClinico) { + this.casoClinico = casoClinico; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Ator other = (Ator) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + +} diff --git a/SimDeCS/src/main/org/ufcspa/simdecs/entities/Avatar.java b/SimDeCS/src/main/org/ufcspa/simdecs/entities/Avatar.java new file mode 100644 index 0000000..ca12aca --- /dev/null +++ b/SimDeCS/src/main/org/ufcspa/simdecs/entities/Avatar.java @@ -0,0 +1,103 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +import org.hibernate.annotations.Index; +import org.ufcspa.simdecs.entities.exceptions.InvalidSexoException; + +@Entity +@Table(name="Avatar") +// Shortname: "ava" +@SequenceGenerator(name = "sequenceAvatar", sequenceName = "sqAvatar", initialValue = 1, allocationSize=1) +public class Avatar implements Serializable { + + private static final long serialVersionUID = 3841381292539475339L; + + @GeneratedValue(generator = "sequenceAvatar", strategy = GenerationType.AUTO) + @Id + private Long id; + + @Column(nullable=false, length=100) + private String nome; + + @Column(length=1, nullable=true) + private String sexo; + + @ManyToOne + @JoinColumn(name = "faiet_id", referencedColumnName = "id", nullable = true) + @Index(name="ava_faiet_fk_i") + private FaixaEtaria faixaEtaria; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public String getSexo() { + return sexo; + } + + public void setSexo(String sexo) throws InvalidSexoException { + if (sexo.equals("F") || sexo.equals("M")) + this.sexo = sexo; + else + throw new InvalidSexoException("O sexo deverá ser 'F' ou 'M'!"); + } + + public FaixaEtaria getFaixaEtaria() { + return faixaEtaria; + } + + public void setFaixaEtaria(FaixaEtaria faixaEtaria) { + this.faixaEtaria = faixaEtaria; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Avatar other = (Avatar) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + + +} diff --git a/SimDeCS/src/main/org/ufcspa/simdecs/entities/CasoClinico.java b/SimDeCS/src/main/org/ufcspa/simdecs/entities/CasoClinico.java new file mode 100644 index 0000000..b834779 --- /dev/null +++ b/SimDeCS/src/main/org/ufcspa/simdecs/entities/CasoClinico.java @@ -0,0 +1,152 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import org.hibernate.annotations.Index; + +@Entity +@Table(name="CasoClinico") +// Shortname: "caso" +@SequenceGenerator(name = "sequenceCasoClinico", sequenceName = "sqCasoClinico", initialValue = 1, allocationSize=1) +public class CasoClinico implements Serializable { + + /** + * + */ + private static final long serialVersionUID = 7701987863551764750L; + + @GeneratedValue(generator = "sequenceCasoClinico", strategy = GenerationType.AUTO) + @Id + private Long id; + + @Column(nullable=false, length=100) + private String nome; + + @Column(nullable=false, length=400) + private String autores; + + @Column(nullable=false) + @Temporal(TemporalType.TIMESTAMP) + private Date dataCriacao; + + @Column(length=1, nullable=false) + private boolean concluido; + + @Column(length=32768, nullable=false) + private String introducao; + + @ManyToOne + @JoinColumn(name = "usu_id", referencedColumnName = "id", nullable = true) + @Index(name="caso_usu_fk_i") + private Usuario criadoPor; + + @ManyToOne + @JoinColumn(name = "cena_id", referencedColumnName = "id", nullable = true) + @Index(name="caso_cena_fk_i") + private Cenario cenario; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public String getAutores() { + return autores; + } + + public void setAutores(String autores) { + this.autores = autores; + } + + public Date getDataCriacao() { + return dataCriacao; + } + + public void setDataCriacao(Date dataCriacao) { + this.dataCriacao = dataCriacao; + } + + public boolean isConcluido() { + return concluido; + } + + public void setConcluido(boolean concluido) { + this.concluido = concluido; + } + + public String getIntroducao() { + return introducao; + } + + public void setIntroducao(String introducao) { + this.introducao = introducao; + } + + public Usuario getCriadoPor() { + return criadoPor; + } + + public void setCriadoPor(Usuario criadoPor) { + this.criadoPor = criadoPor; + } + + public Cenario getCenario() { + return cenario; + } + + public void setCenario(Cenario cenario) { + this.cenario = cenario; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + CasoClinico other = (CasoClinico) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + + + +} diff --git a/SimDeCS/src/main/org/ufcspa/simdecs/entities/Cenario.java b/SimDeCS/src/main/org/ufcspa/simdecs/entities/Cenario.java new file mode 100644 index 0000000..fa644f3 --- /dev/null +++ b/SimDeCS/src/main/org/ufcspa/simdecs/entities/Cenario.java @@ -0,0 +1,82 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +@Entity +@Table(name="Cenario") +// Shortname: "cena" +@SequenceGenerator(name = "sequenceCenario", sequenceName = "sqCenario", initialValue = 1, allocationSize=1) +public class Cenario implements Serializable { + + private static final long serialVersionUID = -5325804840992891837L; + + @GeneratedValue(generator = "sequenceCenario", strategy = GenerationType.AUTO) + @Id + private Long id; + + @Column(nullable=false, length=50) + private String nome; + + @Column(nullable=false, length=300) + private String thumbnailURL; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public String getThumbnailURL() { + return thumbnailURL; + } + + public void setThumbnailURL(String thumbnailURL) { + this.thumbnailURL = thumbnailURL; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Cenario other = (Cenario) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + + + +} diff --git a/SimDeCS/src/main/org/ufcspa/simdecs/entities/FaixaEtaria.java b/SimDeCS/src/main/org/ufcspa/simdecs/entities/FaixaEtaria.java new file mode 100644 index 0000000..e235b05 --- /dev/null +++ b/SimDeCS/src/main/org/ufcspa/simdecs/entities/FaixaEtaria.java @@ -0,0 +1,93 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Transient; + +@Entity +// Short name: "faiet" +@Table(name="FaixaEtaria") +@SequenceGenerator(name = "sequenceFaixaEtaria", sequenceName = "sqFaixaEtaria", initialValue = 1, allocationSize=1) +public class FaixaEtaria implements Serializable { + + + private static final long serialVersionUID = -7880046977930536898L; + + @GeneratedValue(generator = "sequenceFaixaEtaria", strategy = GenerationType.AUTO) + @Id + private Long id; + + @Column(length=3, nullable=true) + private Integer idadeMinima; + + @Column(length=3, nullable=true) + private Integer idadeMaxima; + + @Transient + public String getNome() { + if (idadeMinima != null && idadeMaxima != null) + return "Entre " + getIdadeMinima() + " e " + getIdadeMaxima() + " anos"; + if (idadeMinima == null && idadeMaxima != null) + return "Entre zero e " + getIdadeMaxima() + " anos"; + else + return getIdadeMinima() + " anos ou mais"; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Integer getIdadeMinima() { + return idadeMinima; + } + + public void setIdadeMinima(Integer idadeMinima) { + this.idadeMinima = idadeMinima; + } + + public Integer getIdadeMaxima() { + return idadeMaxima; + } + + public void setIdadeMaxima(Integer idadeMaxima) { + this.idadeMaxima = idadeMaxima; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + FaixaEtaria other = (FaixaEtaria) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + + +} diff --git a/SimDeCS/src/main/org/ufcspa/simdecs/entities/Grupo.java b/SimDeCS/src/main/org/ufcspa/simdecs/entities/Grupo.java new file mode 100644 index 0000000..7739649 --- /dev/null +++ b/SimDeCS/src/main/org/ufcspa/simdecs/entities/Grupo.java @@ -0,0 +1,130 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; +import java.util.Collection; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.UniqueConstraint; + +@Entity +@Table(name="Grupo") +// Shortname: "gru" +@SequenceGenerator(name = "sequenceGrupo", sequenceName = "sqGrupo", initialValue = 1, allocationSize=1) +public class Grupo implements Serializable { + + private static final long serialVersionUID = 3819490399218258321L; + + @GeneratedValue(generator = "sequenceGrupo", strategy = GenerationType.AUTO) + @Id + private Long id; + + @Column(length=50, nullable=false) + private String nome; + + @Column(length=1, nullable=false) + private boolean ativo; + + @ManyToMany(mappedBy = "grupos") + private List usuarios; + + @ManyToMany + @JoinTable( name = "GrupoRegra", + joinColumns = {@JoinColumn(name = "gru_id")}, + inverseJoinColumns = {@JoinColumn(name = "reg_id")}, + uniqueConstraints={@UniqueConstraint(columnNames={"gru_id", "reg_id"})}) + private List regras; + + @ManyToMany + @JoinTable( name = "GrupoPrivilegio", + joinColumns = {@JoinColumn(name = "gru_id")}, + inverseJoinColumns = {@JoinColumn(name = "priv_id")}, + uniqueConstraints={@UniqueConstraint(columnNames={"gru_id", "priv_id"})}) + private List privilegios; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public boolean isAtivo() { + return ativo; + } + + public void setAtivo(boolean ativo) { + this.ativo = ativo; + } + + public List getUsuarios() { + return usuarios; + } + + public void setUsuarios(List usuarios) { + this.usuarios = usuarios; + } + + + + public List getRegras() { + return regras; + } + + public void setRegras(List regras) { + this.regras = regras; + } + + public List getPrivilegios() { + return privilegios; + } + + public void setPrivilegios(List privilegios) { + this.privilegios = privilegios; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Grupo other = (Grupo) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + + +} diff --git a/SimDeCS/src/main/org/ufcspa/simdecs/entities/Instituicao.java b/SimDeCS/src/main/org/ufcspa/simdecs/entities/Instituicao.java new file mode 100644 index 0000000..63d690d --- /dev/null +++ b/SimDeCS/src/main/org/ufcspa/simdecs/entities/Instituicao.java @@ -0,0 +1,89 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + + +@Entity +@Table(name="Instituicao") +// Shortname: "inst" +@SequenceGenerator(name = "sequenceInstituicao", sequenceName = "sqInstituicao", initialValue = 1, allocationSize=1) +public class Instituicao implements Serializable { + + private static final long serialVersionUID = 6879782331178330999L; + + @Id + @GeneratedValue(generator="sequenceInstituicao", strategy=GenerationType.AUTO) + private Long id; + + @Column(length=100, nullable=false) + private String nome; + @Column(length=20, nullable=true) + private String telefone; + @Column(length=100, nullable=true) + private String endereco; + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + public String getNome() { + return nome; + } + public void setNome(String nome) { + this.nome = nome; + } + public String getTelefone() { + return telefone; + } + public void setTelefone(String telefone) { + this.telefone = telefone; + } + public String getEndereco() { + return endereco; + } + public void setEndereco(String endereco) { + this.endereco = endereco; + } + + public String toString() { + return id + " - " + nome; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Instituicao other = (Instituicao) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + + public Instituicao() { + + } +} diff --git a/SimDeCS/src/main/org/ufcspa/simdecs/entities/Nodo.java b/SimDeCS/src/main/org/ufcspa/simdecs/entities/Nodo.java new file mode 100644 index 0000000..20f1003 --- /dev/null +++ b/SimDeCS/src/main/org/ufcspa/simdecs/entities/Nodo.java @@ -0,0 +1,108 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +import org.hibernate.annotations.Index; + + +@Entity +@Table(name="Nodo") +@SequenceGenerator(name = "sequenceNodo", sequenceName = "sqNodo", initialValue = 1, allocationSize=1) +public class Nodo implements Serializable { + + private static final long serialVersionUID = 6879782331178330999L; + + @Id + @GeneratedValue(generator="sequenceNodo", strategy=GenerationType.AUTO) + private Long id; + + @Column(length=100, nullable=false) + private String nome; + + @Column(length=10, nullable=true) + private Float custo; + + @Column(length=10, nullable=true) + private Long tempo; + + @ManyToOne + @JoinColumn(name = "rede_id", referencedColumnName = "id", nullable = true) + @Index(name="nodo_rede_fk_i") + private Rede rede; + + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + public String getNome() { + return nome; + } + public void setNome(String nome) { + this.nome = nome; + } + public Float getCusto() { + return custo; + } + public void setCusto(Float custo) { + this.custo = custo; + } + public Long getTempo() { + return tempo; + } + public void setTempo(Long tempo) { + this.tempo = tempo; + } + + public Rede getRede() { + return rede; + } + + public void setRede(Rede rede) { + this.rede = rede; + } + + public String toString() { + return id + " - " + nome; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Nodo other = (Nodo) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + + public Nodo() { + + } +} diff --git a/SimDeCS/src/main/org/ufcspa/simdecs/entities/PerguntaNodo.java b/SimDeCS/src/main/org/ufcspa/simdecs/entities/PerguntaNodo.java new file mode 100644 index 0000000..d89e0ea --- /dev/null +++ b/SimDeCS/src/main/org/ufcspa/simdecs/entities/PerguntaNodo.java @@ -0,0 +1,90 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +import org.hibernate.annotations.Index; + + +@Entity +@Table(name="PerguntaNodo") +@SequenceGenerator(name = "sequencePerguntaNodo", sequenceName = "sqPerguntaNodo", initialValue = 1, allocationSize=1) +public class PerguntaNodo implements Serializable { + + private static final long serialVersionUID = 6879782331178330999L; + + @Id + @GeneratedValue(generator="sequencePerguntaNodo", strategy=GenerationType.AUTO) + private Long id; + + @Column(length=100, nullable=false) + private String pergunta; + + @ManyToOne + @JoinColumn(name = "nodo_id", referencedColumnName = "id", nullable = true) + @Index(name="pergunta_nodo_fk_i") + private Nodo nodo; + + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + public String getPergunta() { + return pergunta; + } + public void setPergunta(String pergunta) { + this.pergunta = pergunta; + } + + public Nodo getNodo() { + return nodo; + } + + public void getNodo(Nodo nodo) { + this.nodo = nodo; + } + + public String toString() { + return id + " - " + pergunta; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + PerguntaNodo other = (PerguntaNodo) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + + public PerguntaNodo() { + + } +} diff --git a/SimDeCS/src/main/org/ufcspa/simdecs/entities/Privilegio.java b/SimDeCS/src/main/org/ufcspa/simdecs/entities/Privilegio.java new file mode 100644 index 0000000..a3e1af1 --- /dev/null +++ b/SimDeCS/src/main/org/ufcspa/simdecs/entities/Privilegio.java @@ -0,0 +1,93 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; +import java.util.Collection; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.ManyToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +@Entity +//Short name: "pri" +@Table(name="Privilegio") +@SequenceGenerator(name = "sequencePrivilegio", sequenceName = "sqPrivilegio", initialValue = 1, allocationSize=1) +public class Privilegio implements Serializable { + + private static final long serialVersionUID = 4061273194728272687L; + + @Id + @GeneratedValue(generator="sequencePrivilegio", strategy=GenerationType.AUTO) + private Long id; + + @Column(length=100, nullable=false) + private String nome; + + @Column(length=300, nullable=false, unique=true) + private String token; + + @ManyToMany(mappedBy = "privilegios") + private Collection grupos; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public Collection getGrupos() { + return grupos; + } + + public void setGrupos(Collection grupos) { + this.grupos = grupos; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Privilegio other = (Privilegio) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + +} diff --git a/SimDeCS/src/main/org/ufcspa/simdecs/entities/Rede.java b/SimDeCS/src/main/org/ufcspa/simdecs/entities/Rede.java new file mode 100644 index 0000000..bf75f8d --- /dev/null +++ b/SimDeCS/src/main/org/ufcspa/simdecs/entities/Rede.java @@ -0,0 +1,122 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; +import java.util.Collection; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.UniqueConstraint; + +@Entity +//Short name: "rede" +@Table(name="Rede") +@SequenceGenerator(name = "sequenceRede", sequenceName = "sqRede", initialValue = 1, allocationSize=1) +public class Rede implements Serializable { + + private static final long serialVersionUID = -8764281348427990153L; + + @GeneratedValue(generator = "sequenceRede", strategy = GenerationType.AUTO) + @Id + private Long id; + + @Column(nullable=false, length=50) + private String nome; + + @Column(nullable=false, length=50) + private String arquivo; + + @Column(length=1, nullable=false) + private boolean aplicavelSexoMasculino; + + @Column(length=1, nullable=false) + private boolean aplicavelSexoFeminino; + + @ManyToMany + @JoinTable( name = "FaixaEtariaRede", + joinColumns = {@JoinColumn(name = "rede_id")}, + inverseJoinColumns = {@JoinColumn(name = "faiet_id")}, + uniqueConstraints={@UniqueConstraint(columnNames={"rede_id", "faiet_id"})}) + private Collection faixasEtarias; + + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public String getArquivo() { + return arquivo; + } + + public void setArquivo(String arquivo) { + this.arquivo = arquivo; + } + public boolean isAplicavelSexoMasculino() { + return aplicavelSexoMasculino; + } + + public void setAplicavelSexoMasculino(boolean aplicavelSexoMasculino) { + this.aplicavelSexoMasculino = aplicavelSexoMasculino; + } + + public boolean isAplicavelSexoFeminino() { + return aplicavelSexoFeminino; + } + + public void setAplicavelSexoFeminino(boolean aplicavelSexoFeminino) { + this.aplicavelSexoFeminino = aplicavelSexoFeminino; + } + + public Collection getFaixasEtarias() { + return faixasEtarias; + } + + public void setFaixasEtarias(Collection faixasEtarias) { + this.faixasEtarias = faixasEtarias; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Rede other = (Rede) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + +} diff --git a/SimDeCS/src/main/org/ufcspa/simdecs/entities/Regra.java b/SimDeCS/src/main/org/ufcspa/simdecs/entities/Regra.java new file mode 100644 index 0000000..42cb873 --- /dev/null +++ b/SimDeCS/src/main/org/ufcspa/simdecs/entities/Regra.java @@ -0,0 +1,92 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; +import java.util.Collection; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.ManyToMany; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +@Entity +//Short name: "reg" +@Table(name="Regra") +@SequenceGenerator(name = "sequenceRegra", sequenceName = "sqRegra", initialValue = 1, allocationSize=1) +public class Regra implements Serializable { + private static final long serialVersionUID = 6538831479698908253L; + + @Id + @GeneratedValue(generator="sequenceRegra", strategy=GenerationType.AUTO) + private Long id; + + @Column(length=100, nullable=false) + private String nome; + + @Column(length=300, nullable=false, unique=true) + private String token; + + @ManyToMany(mappedBy = "regras") + private Collection grupos; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + public Collection getGrupos() { + return grupos; + } + + public void setGrupos(Collection grupos) { + this.grupos = grupos; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Regra other = (Regra) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + +} diff --git a/SimDeCS/src/main/org/ufcspa/simdecs/entities/RespostaNodo.java b/SimDeCS/src/main/org/ufcspa/simdecs/entities/RespostaNodo.java new file mode 100644 index 0000000..2e8bfbc --- /dev/null +++ b/SimDeCS/src/main/org/ufcspa/simdecs/entities/RespostaNodo.java @@ -0,0 +1,99 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; + +import org.hibernate.annotations.Index; + + +@Entity +@Table(name="RespostaNodo") +@SequenceGenerator(name = "sequenceRespostaNodo", sequenceName = "sqRespostaNodo", initialValue = 1, allocationSize=1) +public class RespostaNodo implements Serializable { + + private static final long serialVersionUID = 6879782331178330999L; + + @Id + @GeneratedValue(generator="sequenceRespostaNodo", strategy=GenerationType.AUTO) + private Long id; + + @Column(length=100, nullable=false) + private String resposta; + + @Column(length=10, nullable=true) + private Float percentual; + + @ManyToOne + @JoinColumn(name = "nodo_id", referencedColumnName = "id", nullable = true) + @Index(name="resposta_nodo_fk_i") + private Nodo nodo; + + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + public String getResposta() { + return resposta; + } + public void setResposta(String resposta) { + this.resposta = resposta; + } + public Float getPercentual() { + return percentual; + } + public void setPercentual(Float percentual) { + this.percentual = percentual; + } + + public Nodo getNodo() { + return nodo; + } + + public void getNodo(Nodo nodo) { + this.nodo = nodo; + } + + public String toString() { + return id + " - " + resposta + " - " + percentual ; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + RespostaNodo other = (RespostaNodo) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + + public RespostaNodo() { + + } +} diff --git a/SimDeCS/src/main/org/ufcspa/simdecs/entities/Usuario.java b/SimDeCS/src/main/org/ufcspa/simdecs/entities/Usuario.java new file mode 100644 index 0000000..5601f20 --- /dev/null +++ b/SimDeCS/src/main/org/ufcspa/simdecs/entities/Usuario.java @@ -0,0 +1,223 @@ +package org.ufcspa.simdecs.entities; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Date; +import java.util.List; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinTable; +import javax.persistence.ManyToMany; +import javax.persistence.ManyToOne; +import javax.persistence.SequenceGenerator; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.UniqueConstraint; + +import org.hibernate.annotations.Index; +import org.ufcspa.simdecs.entities.exceptions.InvalidSexoException; + +@Entity +// Short name: "usu" +@Table(name="Usuario") +@SequenceGenerator(name = "sequenceUsuario", sequenceName = "sqUsuario", initialValue = 1, allocationSize=1) +public class Usuario implements Serializable { + + private static final long serialVersionUID = 3970972520019742992L; + + @GeneratedValue(generator = "sequenceUsuario", strategy = GenerationType.AUTO) + @Id + private Long id; + + @Column(length=30, nullable=false, unique=true) + private String login; + + @Column(length=20, nullable=false) + private String senha; + + @Column(length=70, nullable=false) + private String nome; + + @Column(length=40, nullable=false, unique=true) + private String email; + + @Column(length=100) + private String funcao; + + @Column(length=1, nullable=true) + private String sexo; + + @Column(length=20, nullable=true) + private String telefone; + + @Temporal(TemporalType.DATE) + private Date dataNascimento; + + @Column(length=1, nullable=false) + private boolean aprovado; + + @Column(length=1, nullable=false) + private boolean ativo; + + @Temporal(TemporalType.DATE) + private Date dataCriacao; + + @ManyToOne + @JoinColumn(name = "usu_id", referencedColumnName = "id", nullable = true) + @Index(name="usu_usu_fk_i") + private Usuario criadoPor; + + @ManyToMany + @JoinTable( name = "UsuarioGrupo", + joinColumns = {@JoinColumn(name = "usu_id")}, + inverseJoinColumns = {@JoinColumn(name = "gru_id")}, + uniqueConstraints={@UniqueConstraint(columnNames={"usu_id", "gru_id"})}) + private List grupos; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getLogin() { + return login; + } + + public void setLogin(String login) { + this.login = login; + } + + public String getSenha() { + return senha; + } + + public void setSenha(String senha) { + this.senha = senha; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getFuncao() { + return funcao; + } + + public void setFuncao(String funcao) { + this.funcao = funcao; + } + + public String getSexo() { + return sexo; + } + + public void setSexo(String sexo) throws InvalidSexoException { + if (sexo.equals("F") || sexo.equals("M")) + this.sexo = sexo; + else + throw new InvalidSexoException("O sexo deverá ser 'F' ou 'M'!"); + } + + public String getTelefone() { + return telefone; + } + + public void setTelefone(String telefone) { + this.telefone = telefone; + } + + public Date getDataNascimento() { + return dataNascimento; + } + + public void setDataNascimento(Date dataNascimento) { + this.dataNascimento = dataNascimento; + } + + public boolean isAprovado() { + return aprovado; + } + + public void setAprovado(boolean aprovado) { + this.aprovado = aprovado; + } + + public boolean isAtivo() { + return ativo; + } + + public void setAtivo(boolean ativo) { + this.ativo = ativo; + } + + public Date getDataCriacao() { + return dataCriacao; + } + + public void setDataCriacao(Date dataCriacao) { + this.dataCriacao = dataCriacao; + } + + public Usuario getCriadoPor() { + return criadoPor; + } + + public void setCriadoPor(Usuario criadoPor) { + this.criadoPor = criadoPor; + } + + public List getGrupos() { + return grupos; + } + + public void setGrupos(List grupos) { + this.grupos = grupos; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((id == null) ? 0 : id.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + Usuario other = (Usuario) obj; + if (id == null) { + if (other.id != null) + return false; + } else if (!id.equals(other.id)) + return false; + return true; + } + +} diff --git a/SimDeCS/src/main/org/ufcspa/simdecs/entities/exceptions/InvalidDomainException.java b/SimDeCS/src/main/org/ufcspa/simdecs/entities/exceptions/InvalidDomainException.java new file mode 100644 index 0000000..e058ff4 --- /dev/null +++ b/SimDeCS/src/main/org/ufcspa/simdecs/entities/exceptions/InvalidDomainException.java @@ -0,0 +1,10 @@ +package org.ufcspa.simdecs.entities.exceptions; + +public class InvalidDomainException extends Exception { + + private static final long serialVersionUID = -8819708917989477984L; + + public InvalidDomainException(String message) { + super(message); + } +} diff --git a/SimDeCS/src/main/org/ufcspa/simdecs/entities/exceptions/InvalidSexoException.java b/SimDeCS/src/main/org/ufcspa/simdecs/entities/exceptions/InvalidSexoException.java new file mode 100644 index 0000000..250149b --- /dev/null +++ b/SimDeCS/src/main/org/ufcspa/simdecs/entities/exceptions/InvalidSexoException.java @@ -0,0 +1,10 @@ +package org.ufcspa.simdecs.entities.exceptions; + +public class InvalidSexoException extends InvalidDomainException { + + private static final long serialVersionUID = 1501154204732377528L; + + public InvalidSexoException(String message) { + super(message); + } +} diff --git a/SimDeCS/src/main/seam.properties b/SimDeCS/src/main/seam.properties new file mode 100644 index 0000000..e69de29 diff --git a/SimDeCS/src/main/security.drl b/SimDeCS/src/main/security.drl new file mode 100644 index 0000000..b015775 --- /dev/null +++ b/SimDeCS/src/main/security.drl @@ -0,0 +1,6 @@ +package Permissions; + +import java.security.Principal; + +import org.jboss.seam.security.permission.PermissionCheck; +import org.jboss.seam.security.Role; \ No newline at end of file