Compare commits
21 Commits
dev
...
revert-4ae
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cec37b8edd | ||
|
|
ed1938f44a | ||
|
|
917e128d7e | ||
|
|
a65e7fb885 | ||
|
|
18f2524412 | ||
|
|
26c3ec6a33 | ||
|
|
b75199840e | ||
|
|
a8dd4f2674 | ||
|
|
06388f9449 | ||
|
|
f62f4df779 | ||
|
|
14f4ac42ac | ||
|
|
aee0f9deaf | ||
|
|
6a413357e5 | ||
|
|
45c9de6546 | ||
|
|
03f34d4a83 | ||
|
|
b6d68df139 | ||
|
|
d179280321 | ||
|
|
904976f2cb | ||
|
|
3adff14da6 | ||
|
|
bece7c58d2 | ||
|
|
cf2140d6c7 |
@@ -1,13 +1,13 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
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.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
|
||||
@@ -49,8 +49,17 @@
|
||||
<target name="compileEjb" depends="init">
|
||||
<copy file="${sourcesrc}/META-INF/persistence.xml" todir="${buildjar}/META-INF" />
|
||||
<copy file="${sourcesrc}/log4j.properties" todir="${buildjar}" />
|
||||
<javac encoding="${java.encoding}" srcdir="${sourcesrc}" destdir="${buildjar}" includes="ejb/**/*.java, jpa/**/*.java, TO/**/*.java, common/**/*.java" classpathref="jboss.classpath"
|
||||
includeantruntime="true" />
|
||||
<javac encoding="${java.encoding}" srcdir="${sourcesrc}" destdir="${buildjar}" includeantruntime="true" source="1.8" target="1.8">
|
||||
<classpath>
|
||||
<path refid="jboss.classpath" />
|
||||
</classpath>
|
||||
<include name="ejb/**/*.java" />
|
||||
<include name="jpa/**/*.java" />
|
||||
<include name="TO/**/*.java" />
|
||||
<include name="common/**/*.java" />
|
||||
<exclude name="managedbean/**/*.java" />
|
||||
</javac>
|
||||
<delete verbose="true" dir="${buildjar}/managedbean" />
|
||||
</target>
|
||||
|
||||
<!-- Update the EJB jar file and create if not exist -->
|
||||
@@ -63,11 +72,16 @@
|
||||
<copy todir="${buildwar}">
|
||||
<fileset dir="${docroot}" />
|
||||
</copy>
|
||||
<javac encoding="${java.encoding}" srcdir="${sourcesrc}" destdir="${buildwar}/WEB-INF/classes" includes="managedbean/**/*.java" includeantruntime="true">
|
||||
<javac encoding="${java.encoding}" srcdir="${sourcesrc}" destdir="${buildwar}/WEB-INF/classes" includeantruntime="true" source="1.8" target="1.8">
|
||||
<classpath>
|
||||
<path refid="jboss.classpath" />
|
||||
<path refid="lib.dir" />
|
||||
</classpath>
|
||||
<include name="managedbean/**/*.java" />
|
||||
<exclude name="ejb/**/*.java" />
|
||||
<exclude name="jpa/**/*.java" />
|
||||
<exclude name="TO/**/*.java" />
|
||||
<exclude name="common/**/*.java" />
|
||||
</javac>
|
||||
<delete verbose="true" dir="${buildwar}/WEB-INF/classes/ejb" />
|
||||
<delete verbose="true" dir="${buildwar}/WEB-INF/classes/jpa" />
|
||||
|
||||
@@ -9,25 +9,12 @@
|
||||
<title>MyHealth Online Services</title>
|
||||
<h:outputStylesheet name="primeicons/primeicons.css" library="primefaces" />
|
||||
<h:outputStylesheet library="css" name="estilos.css" />
|
||||
<h:outputScript library="js" name="common.js" />
|
||||
</h:head>
|
||||
<h:outputScript>
|
||||
function handleLoginRequest(xhr, status, args) {
|
||||
if(args.validationFailed || !args.loggedIn) {
|
||||
PF('dlgLogin').jq.effect("shake", {times:5}, 100);
|
||||
PF('btnLogin').enable();
|
||||
}
|
||||
else {
|
||||
PF('btnLogin').enable();
|
||||
PF('dlgLogin').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function startLogin() {
|
||||
PF('btnLogin').disable();
|
||||
}
|
||||
|
||||
// Si hay un error AJAX, lo más probable es que la sesión expirase, vamos a la página de error
|
||||
function onAjaxError() {
|
||||
alert('Ajax error');
|
||||
window.location.href = "#{request.contextPath}/error.xhtml?type=expired";
|
||||
}
|
||||
</h:outputScript>
|
||||
<h:body>
|
||||
@@ -39,10 +26,12 @@
|
||||
<div id="menuDiv" style="margin-bottom: 10px;">
|
||||
<p:ajaxStatus style="width:32px; height:32px; position:fixed; right:32px; bottom:32px" onerror="onAjaxError()">
|
||||
<f:facet name="start">
|
||||
<i id="loginSpin" class="pi pi-spin pi-spinner" style="font-size: 3em"></i>
|
||||
<i id="loginSpin" class="pi pi-spin pi-spinner" style="font-size: 3em" />
|
||||
</f:facet>
|
||||
|
||||
<f:facet name="error">Error!</f:facet>
|
||||
<f:facet name="error">
|
||||
<i class="pi pi-exclamation-triangle" style="font-size: 3em" />
|
||||
</f:facet>
|
||||
</p:ajaxStatus>
|
||||
|
||||
<h:form id="frmLogin">
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:p="http://primefaces.org/ui" xmlns:o="http://omnifaces.org/ui">
|
||||
<f:metadata>
|
||||
<f:viewParam name="refresh" value="#{home.refresh}" />
|
||||
</f:metadata>
|
||||
|
||||
<ui:composition template="./header.xhtml">
|
||||
<ui:define name="content">
|
||||
<h:form>
|
||||
@@ -16,20 +12,17 @@
|
||||
<div class="ui-g-2 ui-md-2">
|
||||
<p:outputLabel for="selectorTema" value="Cambio de tema" />
|
||||
</div>
|
||||
<div class="ui-g-6 ui-md-6">
|
||||
<div class="ui-g-3 ui-md-3">
|
||||
<p:themeSwitcher id="selectorTema" style="width:300px" value="#{sessionPreferences.currentTheme}">
|
||||
<f:selectItem itemLabel="Seleccione un tema" itemValue="" noSelectionOption="true" />
|
||||
<f:selectItems value="#{home.themes}" var="theme" itemLabel="#{theme.displayName}" itemValue="#{theme.name}" />
|
||||
<p:ajax listener="#{sessionPreferences.updateCurrentTheme}" />
|
||||
</p:themeSwitcher>
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-1" />
|
||||
|
||||
<div class="ui-g-4 ui-md-4" />
|
||||
<div class="ui-g-4 ui-md-4 ">
|
||||
<div class="ui-g-2 ui-md-2">
|
||||
<p:commandButton value="Usar tema en este sesión" update="mesgs" action="#{sessionPreferences.updateCurrentTheme}" icon="pi pi-save" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4" />
|
||||
<div class="ui-g-5 ui-md-5" />
|
||||
|
||||
<div class="ui-g-2 ui-md-2">
|
||||
<div class="ui-inputgroup">
|
||||
|
||||
@@ -3,23 +3,6 @@
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
|
||||
xmlns:p="http://primefaces.org/ui" xmlns:o="http://omnifaces.org/ui">
|
||||
|
||||
<h:head>
|
||||
<title>login</title>
|
||||
</h:head>
|
||||
<h:outputScript>
|
||||
<script type="text/javascript">
|
||||
function handleLoginRequest(xhr, status, args) {
|
||||
if(args.validationFailed || !args.loggedIn) {
|
||||
PF('dlg').jq.effect("shake", {times:5}, 100);
|
||||
}
|
||||
else {
|
||||
PF('dlg').hide();
|
||||
$('#loginLink').fadeOut();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</h:outputScript>
|
||||
<ui:composition template="./header.xhtml">
|
||||
<ui:define name="content">
|
||||
<h:form>
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
<div class="ui-g-12 ui-g-nopad">
|
||||
<div class="ui-g-4 ui-md-4" />
|
||||
<div class="ui-g-2 ui-md-2 ">
|
||||
<p:commandButton validateClient="true" value="Guardar" update="TestForm" action="#{BeanName.actionMethod}" icon="pi pi-check" />
|
||||
<p:commandButton validateClient="true" value="Guardar" update="TestForm" action="#{PendingQuestions.saveData}" icon="pi pi-check" />
|
||||
</div>
|
||||
<div class="ui-g-2 ui-md-2">
|
||||
<p:button value="Volver" outcome="/home" icon="pi pi-home" />
|
||||
|
||||
@@ -31,18 +31,18 @@
|
||||
<p:panel id="PanelPHC" header="Cambiar médico de familia asignado" rendered="#{home.patient}">
|
||||
<div class="ui-g ui-fluid">
|
||||
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-2">
|
||||
<p:outputLabel value="Médico de familia actualmente asignado:" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-4">
|
||||
<p:outputLabel id="lblCurrentCenter" style="font-weight: bold;" value="#{ChangeFD.currentFamilyDoctor.displayName}" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4" />
|
||||
<div class="ui-g-6" />
|
||||
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-2">
|
||||
<p:outputLabel value="Nuevo médico de familia:" for="newFamilyDocAC" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-4">
|
||||
<p:autoComplete id="newFamilyDocAC" dropdown="true" required="true" value="#{ChangeFD.newFamilyDoctor}" completeMethod="#{ChangeFD.completeFamilyDoctor}" var="fd"
|
||||
itemLabel="#{fd.displayName}" itemValue="#{fd}" forceSelection="true" requiredMessage="Por favor, selecciona un médico de familia"
|
||||
placeholder="Seleccione su nuevo médico de familia o teclee para buscar...">
|
||||
@@ -58,7 +58,7 @@
|
||||
</p:column>
|
||||
</p:autoComplete>
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-6">
|
||||
<p:message for="newFamilyDocAC" />
|
||||
</div>
|
||||
|
||||
@@ -73,7 +73,6 @@
|
||||
<div class="ui-g-4 ui-md-4" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</p:panel>
|
||||
</h:form>
|
||||
</ui:define>
|
||||
|
||||
@@ -31,18 +31,18 @@
|
||||
<p:panel id="PanelPHC" header="Cambiar centro de antención primaria asignado" rendered="#{home.familyDoctor}">
|
||||
<div class="ui-g ui-fluid">
|
||||
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:outputLabel value="Centro de antención primaria actualmente asignado:" />
|
||||
<div class="ui-g-2">
|
||||
<p:outputLabel value="Centro de antención primaria actual:" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-4">
|
||||
<p:outputLabel id="lblCurrentCenter" style="font-weight: bold;" value="#{ChangeCAP.currentCenter.displayName}" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4" />
|
||||
<div class="ui-g-6" />
|
||||
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-2">
|
||||
<p:outputLabel value="Nuevo centro de atención primaria:" for="newCenter" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-4">
|
||||
<p:autoComplete id="newCenter" dropdown="true" required="true" value="#{ChangeCAP.newCenter}" completeMethod="#{ChangeCAP.completePrimaryHealCareCenter}" var="phc"
|
||||
itemLabel="#{phc.displayName}" itemValue="#{phc}" forceSelection="true" requiredMessage="Por favor, selecciona un nuevo centro de antención primaria"
|
||||
placeholder="Seleccione una CAP o teclee para buscar...">
|
||||
@@ -55,7 +55,7 @@
|
||||
</p:column>
|
||||
</p:autoComplete>
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-g-6">
|
||||
<p:message for="newCenter" />
|
||||
</div>
|
||||
|
||||
|
||||
@@ -44,25 +44,6 @@
|
||||
</h:form>
|
||||
|
||||
<h:form id="frmRegisterUser" rendered="#{not RegisterUser.registered}">
|
||||
<h:outputScript>
|
||||
function handleRequest(xhr, status, args) {
|
||||
var nif = PF('nifButton');
|
||||
if ( args.NIFisDupe == false ) {
|
||||
nif.jq.children(".ui-icon").removeClass("pi pi-times");
|
||||
nif.jq.removeClass('red-button');
|
||||
|
||||
nif.jq.children(".ui-icon").addClass("pi pi-check");
|
||||
nif.jq.addClass('green-button');
|
||||
}
|
||||
else if (nif.jq.hasClass('red-button') == false) {
|
||||
nif.jq.children(".ui-icon").removeClass("pi pi-check");
|
||||
nif.jq.removeClass('green-button');
|
||||
|
||||
nif.jq.children(".ui-icon").addClass("pi pi-times");
|
||||
nif.jq.addClass('red-button');
|
||||
}
|
||||
}
|
||||
</h:outputScript>
|
||||
<p:growl id="mesgs" globalOnly="true" showDetail="true" closable="true" autoupdate="true" />
|
||||
<p:panel id="tipoUsuario" header="Especifique el tipo de usuario que desea registrarse">
|
||||
<div class="ui-g ui-fluid">
|
||||
@@ -86,7 +67,7 @@
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-inputgroup">
|
||||
<p:inputText id="nif" value="#{RegisterUser.nif}" validator="nifValidator" maxlength="20" required="true" requiredMessage="Por favor, indque su NIF">
|
||||
<p:ajax event="blur" update="nifmsg" listener="#{RegisterUser.hadleNIFValueChange}" oncomplete="handleRequest(xhr, status, args)" />
|
||||
<p:ajax event="blur" update="nifmsg" listener="#{RegisterUser.hadleNIFValueChange}" oncomplete="handleNIFResponse(xhr, status, args)" />
|
||||
</p:inputText>
|
||||
<p:commandButton widgetVar="nifButton" icon="pi pi-times" styleClass="red-button" />
|
||||
</div>
|
||||
|
||||
@@ -7,25 +7,6 @@
|
||||
<ui:composition template="../header.xhtml">
|
||||
<ui:define name="content">
|
||||
<h:form id="frmUpdateProfile">
|
||||
<h:outputScript>
|
||||
function handleRequest(xhr, status, args) {
|
||||
var nif = PF('nifButton');
|
||||
if ( args.NIFisDupe == false ) {
|
||||
nif.jq.children(".ui-icon").removeClass("pi pi-times");
|
||||
nif.jq.removeClass('red-button');
|
||||
|
||||
nif.jq.children(".ui-icon").addClass("pi pi-check");
|
||||
nif.jq.addClass('green-button');
|
||||
}
|
||||
else if (nif.jq.hasClass('red-button') == false) {
|
||||
nif.jq.children(".ui-icon").removeClass("pi pi-check");
|
||||
nif.jq.removeClass('green-button');
|
||||
|
||||
nif.jq.children(".ui-icon").addClass("pi pi-times");
|
||||
nif.jq.addClass('red-button');
|
||||
}
|
||||
}
|
||||
</h:outputScript>
|
||||
<p:growl id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||
|
||||
<p:panel id="tipoUsuario" header="Tipo de usuario registrado">
|
||||
@@ -61,7 +42,7 @@
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<div class="ui-inputgroup">
|
||||
<p:inputText id="nif" value="#{UpdateProfile.nif}" validator="nifValidator" maxlength="20" required="true" requiredMessage="Por favor, indque su NIF">
|
||||
<p:ajax event="blur" update="nifmsg" listener="#{UpdateProfile.hadleNIFValueChange}" oncomplete="handleRequest(xhr, status, args)" />
|
||||
<p:ajax event="blur" update="nifmsg" listener="#{UpdateProfile.hadleNIFValueChange}" oncomplete="handleNIFResponse(xhr, status, args)" />
|
||||
</p:inputText>
|
||||
<p:commandButton widgetVar="nifButton" icon="pi pi-check" styleClass="green-button" />
|
||||
</div>
|
||||
@@ -138,7 +119,7 @@
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:autoComplete id="selPHC" dropdown="true" value="#{UpdateProfile.primaryHealthCareCenter}" completeMethod="#{UpdateProfile.completePrimaryHealCareCenter}" var="phc"
|
||||
itemLabel="#{phc.displayName}" itemValue="#{phc}" forceSelection="true" requiredMessage="Por favor, selecciona un nuevo centro de antención primaria">
|
||||
itemLabel="#{phc.displayName}" itemValue="#{phc}" forceSelection="true" required="true" requiredMessage="Por favor, selecciona un nuevo centro de antención primaria">
|
||||
<o:converter converterId="omnifaces.ListConverter" list="#{UpdateProfile.phcList}" />
|
||||
<p:column headerText="Nombre">
|
||||
<h:outputText value="#{phc.name}" />
|
||||
@@ -159,7 +140,7 @@
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:autoComplete id="selMS" dropdown="true" value="#{UpdateProfile.medicalSpecialty}" completeMethod="#{UpdateProfile.completeMedicalSpecialty}" var="ms"
|
||||
itemLabel="#{ms.displayName}" itemValue="#{ms}" forceSelection="true" requiredMessage="Por favor, selecciona una especialidad médica">
|
||||
itemLabel="#{ms.displayName}" itemValue="#{ms}" forceSelection="true" required="true" requiredMessage="Por favor, selecciona una especialidad médica">
|
||||
<o:converter converterId="omnifaces.ListConverter" list="#{UpdateProfile.medicalSpecialtiesList}" />
|
||||
<p:column headerText="Nombre">
|
||||
<h:outputText value="#{ms.name}" />
|
||||
|
||||
@@ -11,7 +11,7 @@ BODY {
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
ul.ui-menu-child {
|
||||
ul.ui-menu-list {
|
||||
white-space: nowrap;
|
||||
width: auto !important;
|
||||
}
|
||||
|
||||
41
1.sources/MyHealth/docroot/resources/js/common.js
Normal file
41
1.sources/MyHealth/docroot/resources/js/common.js
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Funciones comunes JavaScript para el proyecto MyHealth
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
// Gestiona la ventana de login
|
||||
function handleLoginRequest(xhr, status, args) {
|
||||
if (args.validationFailed || !args.loggedIn) {
|
||||
PF('dlgLogin').jq.effect("shake", {
|
||||
times : 5
|
||||
}, 100);
|
||||
PF('btnLogin').enable();
|
||||
} else {
|
||||
PF('btnLogin').enable();
|
||||
PF('dlgLogin').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// Tras empezar la petición AJAX de login desabilita el botón para evitar doble login
|
||||
function startLogin() {
|
||||
PF('btnLogin').disable();
|
||||
}
|
||||
|
||||
// Valida si un NIF está duplicado.
|
||||
function handleNIFResponse(xhr, status, args) {
|
||||
var nif = PF('nifButton');
|
||||
if (args.NIFisDupe == false) {
|
||||
nif.jq.children(".ui-icon").removeClass("pi pi-times");
|
||||
nif.jq.removeClass('red-button');
|
||||
|
||||
nif.jq.children(".ui-icon").addClass("pi pi-check");
|
||||
nif.jq.addClass('green-button');
|
||||
} else if (nif.jq.hasClass('red-button') == false) {
|
||||
nif.jq.children(".ui-icon").removeClass("pi pi-check");
|
||||
nif.jq.removeClass('green-button');
|
||||
|
||||
nif.jq.children(".ui-icon").addClass("pi pi-times");
|
||||
nif.jq.addClass('red-button');
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
<ui:define name="content">
|
||||
<h:form id="frmManageSpecialties">
|
||||
<p:growl id="mesgs" showDetail="true" closable="true" autoupdate="true" />
|
||||
<p:panel id="PanelMS" header="Modificación y borrado de especialidades">
|
||||
<p:panel id="PanelMS" header="Página Gestión de Especialidades">
|
||||
<div class="ui-g ui-fluid">
|
||||
<div class="ui-g-2 ui-md-2">
|
||||
<p:outputLabel for="ms"/>
|
||||
@@ -20,42 +20,19 @@
|
||||
</p:selectOneMenu>
|
||||
</div>
|
||||
<div class="ui-g-1 ui-md-1" >
|
||||
<p:outputLabel value="Nombre: " for="name"/>
|
||||
<p:outputLabel value="Editar nombre" for="name"/>
|
||||
</div>
|
||||
<div class="ui-g-2 ui-md-2">
|
||||
<p:inputText id="name" value="#{ManageSpecialities.medicalSpecialty.name}" readonly="false" required="true" requiredMessage="Es necesario un nombre" />
|
||||
</div>
|
||||
<div class="ui-g-1 ui-md-1">
|
||||
<p:outputLabel value="Descripción: " for="description" />
|
||||
<p:outputLabel value="Editar descripción" for="description" />
|
||||
</div>
|
||||
<div class="ui-g-4 ui-md-4">
|
||||
<p:inputText id="description" value="#{ManageSpecialities.medicalSpecialty.description}" readonly="false" required="true" requiredMessage="Es necesaria una descripción" />
|
||||
</div>
|
||||
<div class="ui-g-1 ui-md-1 ">
|
||||
<p:commandButton validateClient="true" value="Guardar" update="mesgs" action="#{ManageSpecialities.saveData}" icon="pi pi-save" />
|
||||
</div>
|
||||
<div class="ui-g-1 ui-md-1 ">
|
||||
<p:commandButton validateClient="true" value="Borrar" update="mesgs" action="#{ManageSpecialities.deleteData}" icon="fa fa-remove" />
|
||||
</div>
|
||||
</div>
|
||||
</p:panel>
|
||||
|
||||
<p:panel id="PanelNewMS" header="Alta de especialidades">
|
||||
<div class="ui-g ui-fluid">
|
||||
<div class="ui-g-1 ui-md-1" >
|
||||
<p:outputLabel value="Nombre: " for="nameNew"/>
|
||||
</div>
|
||||
<div class="ui-g-2 ui-md-2 ">
|
||||
<p:inputText id="nameNew" value="#{ManageSpecialities.name}" readonly="false" required="ManageSpecialities.medicalSpecialty.name eq null" requiredMessage="Es necesario un nombre" />
|
||||
</div>
|
||||
<div class="ui-g-1 ui-md-1">
|
||||
<p:outputLabel value="Descripción: " for="descriptionNew" />
|
||||
</div>
|
||||
<div class="ui-g-6 ui-md-6">
|
||||
<p:inputText id="descriptionNew" value="#{ManageSpecialities.description}" readonly="false" required="ManageSpecialities.medicalSpecialty.description eq null" requiredMessage="Es necesaria una descripción" />
|
||||
</div>
|
||||
<div class="ui-g-2 ui-md-2 ">
|
||||
<p:commandButton validateClient="true" value="Crear" update="mesgs" action="#{ManageSpecialities.insertData}" icon="pi pi-check" />
|
||||
<p:commandButton validateClient="true" value="Guardar" update="mesgs" action="#{ManageSpecialities.saveData}" icon="pi pi-check" />
|
||||
</div>
|
||||
</div>
|
||||
</p:panel>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<application>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" version="6">
|
||||
<application-name>MyHealth</application-name>
|
||||
<display-name>MyHealth</display-name>
|
||||
<module>
|
||||
<web>
|
||||
@@ -10,4 +13,3 @@
|
||||
<ejb>MyHealth.jar</ejb>
|
||||
</module>
|
||||
</application>
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ import java.io.Serializable;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import jpa.FamilyDoctorJPA;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Marcos García Núñez (mgarcianun@uoc.edu)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package ejb.common;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Remote;
|
||||
@@ -10,9 +9,6 @@ import TO.MedicalSpecialtyTO;
|
||||
import TO.PatientTO;
|
||||
import TO.PrimaryHealthCareCenterTO;
|
||||
import TO.SpecialistDoctorTO;
|
||||
import jpa.FamilyDoctorJPA;
|
||||
import jpa.PatientJPA;
|
||||
import jpa.SpecialistDoctorJPA;
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -278,8 +278,6 @@ public class ProfileFacadeBean implements ProfileFacadeRemote {
|
||||
* @return FamilyDoctorTO (Transfer Object del médico de familia al que se la ha cambiado el CAP).
|
||||
*/
|
||||
public FamilyDoctorTO changePrimaryHealthCareCenter(int professionalId, PrimaryHealthCareCenterTO newCenter) throws Exception {
|
||||
FamilyDoctorTO fdTO = null;
|
||||
|
||||
FamilyDoctorJPA fd = entman.find(FamilyDoctorJPA.class, professionalId);
|
||||
if (fd == null) {
|
||||
throw new Exception("No se encuentra en la base de datos ningún médico de familia con id: " + String.valueOf(professionalId));
|
||||
|
||||
@@ -16,6 +16,7 @@ import common.UserType;
|
||||
import ejb.common.CommonFacadeLocal;
|
||||
import jpa.AdministratorJPA;
|
||||
import jpa.MedicalSpecialtyJPA;
|
||||
import jpa.PatientJPA;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -125,24 +126,4 @@ public class SystemAdminFacadeBean implements SystemAdminFacadeRemote {
|
||||
|
||||
return this.commonServices.getPOJOforMedicalSpecialtyJPA(ms);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSpecialtyData(int id, String name, String description) throws Exception {
|
||||
MedicalSpecialtyJPA ms = entman.find(MedicalSpecialtyJPA.class, id);
|
||||
|
||||
if (ms == null) {
|
||||
throw new Exception("No se puede borrar la especialidad porque no se encuentra en la base de datos ningún registro con id: " + String.valueOf(id));
|
||||
}
|
||||
|
||||
entman.remove(ms);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MedicalSpecialtyTO insertSpecialtyData(String name, String description) throws Exception {
|
||||
|
||||
MedicalSpecialtyJPA ms = new MedicalSpecialtyJPA(name, description);
|
||||
entman.persist(ms);
|
||||
|
||||
return this.commonServices.getPOJOforMedicalSpecialtyJPA(ms);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
package ejb.systemAdmin;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.ejb.Remote;
|
||||
|
||||
import TO.LoggedUserTO;
|
||||
import TO.MedicalSpecialtyTO;
|
||||
import TO.PatientTO;
|
||||
import TO.PrimaryHealthCareCenterTO;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -19,8 +23,4 @@ public interface SystemAdminFacadeRemote {
|
||||
public LoggedUserTO login(String id, String pwd);
|
||||
|
||||
public MedicalSpecialtyTO updateSpecialtyData(int id, String name, String description) throws Exception;
|
||||
|
||||
public void deleteSpecialtyData(int id, String name, String description) throws Exception;
|
||||
|
||||
public MedicalSpecialtyTO insertSpecialtyData(String name, String description) throws Exception;
|
||||
}
|
||||
@@ -4,8 +4,6 @@ import java.io.Serializable;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.inject.Named;
|
||||
|
||||
import org.primefaces.model.menu.DefaultMenuItem;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package managedbean.common;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ThemeService {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class ThemeService implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String DEFAULT_THEME = "nova-light";
|
||||
public static final List<Theme> THEMES = new ArrayList<Theme>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
{
|
||||
int i = 1;
|
||||
add(new Theme(i++, "afterdark", "afterdark"));
|
||||
|
||||
@@ -12,8 +12,6 @@ import org.primefaces.model.LazyDataModel;
|
||||
import org.primefaces.model.SortOrder;
|
||||
|
||||
import TO.QuestionTO;
|
||||
import common.Constants;
|
||||
import ejb.medicalTest.MedicalTestFacadeRemote;
|
||||
import managedbean.common.ManagedBeanBase;
|
||||
import managedbean.common.SessionUtils;
|
||||
|
||||
@@ -50,4 +48,8 @@ public class PendingQuestionsMBean extends ManagedBeanBase implements Serializab
|
||||
public LazyDataModel<QuestionTO> getLazyDataModelQuestionList() {
|
||||
return lazyDataModelQuestionList;
|
||||
}
|
||||
|
||||
public void saveData() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,12 +84,13 @@ public class ChangeFamilyDoctorMBean extends ManagedBeanBase implements Serializ
|
||||
int error = 0;
|
||||
|
||||
if (this.getNewFamilyDoctor() == null) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Nuevo médico de familia no seleccionado", "Por favor, especifique un nuevvo médico de familia.");
|
||||
this.addFacesMessage("frmChangeFD:newFamilyDocAC", FacesMessage.SEVERITY_WARN, "Nuevo médico de familia no seleccionado",
|
||||
"Por favor, especifique un nuevvo médico de familia.");
|
||||
error++;
|
||||
}
|
||||
|
||||
if (this.getCurrentFamilyDoctor() != null && this.getNewFamilyDoctor().getId() == this.getCurrentFamilyDoctor().getId()) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "El médico de familia debe ser diferente",
|
||||
this.addFacesMessage("frmChangeFD:newFamilyDocAC", FacesMessage.SEVERITY_WARN, "El médico de familia debe ser diferente",
|
||||
"Por favor, seleccione un médico de familia diferente al que tiene actualmente asignado.");
|
||||
error++;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package managedbean.profile;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
@@ -86,12 +85,12 @@ public class ChangePrimaryHealthCareCenterMBean extends ManagedBeanBase implemen
|
||||
int error = 0;
|
||||
|
||||
if (this.getNewCenter() == null) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Centro de atención primaria no seleccionado", "Por favor, especifique un nuevvo centro de atención primaria.");
|
||||
this.addFacesMessage("frmChangePHCC:newCenter", FacesMessage.SEVERITY_WARN, "Centro de atención primaria no seleccionado", "Por favor, especifique un nuevvo centro de atención primaria.");
|
||||
error++;
|
||||
}
|
||||
|
||||
if (this.getNewCenter().getName().equals(this.getCurrentCenter().getName())) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "El centro de atención primeria debe ser diferente", "Por favor, seleccione un centro de atención primaria diferente al cual está actualmente asignado.");
|
||||
this.addFacesMessage("frmChangePHCC:newCenter", FacesMessage.SEVERITY_WARN, "El centro de atención primeria debe ser diferente", "Por favor, seleccione un centro de atención primaria diferente al cual está actualmente asignado.");
|
||||
error++;
|
||||
}
|
||||
|
||||
|
||||
@@ -198,11 +198,11 @@ public class RegisterUserMBean extends ManagedBeanBase implements Serializable {
|
||||
int error = 0;
|
||||
|
||||
if (this.isFamilyDoctor() && this.primaryHealthCareCenter == null) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Centro de atención primaria no seleccionado", "Por favor, especifique un centro de atención primaria.");
|
||||
this.addFacesMessage("frmRegisterUser:selPHC", FacesMessage.SEVERITY_WARN, "Centro de atención primaria no seleccionado", "Por favor, especifique un centro de atención primaria.");
|
||||
error++;
|
||||
}
|
||||
if (this.isSpecialistDoctor() && this.medicalSpecialty == null) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Especialidad médica no seleccionada", "Por favor, especifique una especialidad médica.");
|
||||
this.addFacesMessage("frmRegisterUser:selMS", FacesMessage.SEVERITY_WARN, "Especialidad médica no seleccionada", "Por favor, especifique una especialidad médica.");
|
||||
error++;
|
||||
}
|
||||
if (ValidationUtils.isValid(nif) == false) {
|
||||
|
||||
@@ -1,19 +1,12 @@
|
||||
package managedbean.systemAdmin;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.inject.Named;
|
||||
import javax.naming.Context;
|
||||
import javax.naming.InitialContext;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.primefaces.PrimeFaces;
|
||||
|
||||
import TO.LoggedUserTO;
|
||||
import ejb.systemAdmin.SystemAdminFacadeRemote;
|
||||
import managedbean.common.ManagedBeanBase;
|
||||
import managedbean.common.SessionUtils;
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.util.List;
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.inject.Named;
|
||||
|
||||
import TO.LoggedUserTO;
|
||||
@@ -114,49 +115,4 @@ public class ManageSpecialitiesMBean extends ManagedBeanBase implements Serializ
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteData() {
|
||||
int error = 0;
|
||||
|
||||
if (this.medicalSpecialty.getName() == null) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Nombre no relleno", "Por favor, escriba un nombre de especialidad.");
|
||||
error++;
|
||||
}
|
||||
if (this.medicalSpecialty.getDescription() == null) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Descripción no rellena", "Por favor, escriba una descripción.");
|
||||
error++;
|
||||
}
|
||||
|
||||
if (error == 0) {
|
||||
try {
|
||||
this.getRemoteManagerSystemAdmin().deleteSpecialtyData(this.medicalSpecialty.getId(), this.medicalSpecialty.getName(), this.medicalSpecialty.getDescription());
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_INFO, "Los especialidad se ha borrado", "Los datos de la especialidad se han borrado correctamente.");
|
||||
} catch (Exception e) {
|
||||
this.manageException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void insertData() {
|
||||
int error = 0;
|
||||
|
||||
if (name == null || name.trim().length() == 0) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Nombre no relleno", "Por favor, escriba un nombre de especialidad.");
|
||||
error++;
|
||||
}
|
||||
if (description == null || description.trim().length() == 0) {
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_WARN, "Descripción no rellena", "Por favor, escriba una descripción.");
|
||||
error++;
|
||||
}
|
||||
|
||||
if (error == 0) {
|
||||
try {
|
||||
MedicalSpecialtyTO ms = this.getRemoteManagerSystemAdmin().insertSpecialtyData(name, description);
|
||||
this.setSpecialtyData(ms);
|
||||
this.addFacesMessage(FacesMessage.SEVERITY_INFO, "Los datos se han guardado", "Los datos de la especialidad se han guardado correctamente.");
|
||||
} catch (Exception e) {
|
||||
this.manageException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,12 +14,12 @@ import javax.faces.validator.ValidatorException;
|
||||
import org.primefaces.validate.ClientValidator;
|
||||
|
||||
@FacesValidator("emailValidator")
|
||||
public class EmailValidator implements Validator, ClientValidator {
|
||||
public class EmailValidator implements Validator<String>, ClientValidator {
|
||||
|
||||
private final static String EMAIL_PATTERN = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
|
||||
private final static Pattern EMAIL_COMPILED_PATTERN = Pattern.compile(EMAIL_PATTERN);
|
||||
|
||||
public void validate(FacesContext context, UIComponent comp, Object value) throws ValidatorException {
|
||||
public void validate(FacesContext context, UIComponent comp, String value) throws ValidatorException {
|
||||
String strValue = "";
|
||||
|
||||
if (value != null)
|
||||
|
||||
@@ -14,9 +14,9 @@ import org.primefaces.validate.ClientValidator;
|
||||
import managedbean.common.ValidationUtils;
|
||||
|
||||
@FacesValidator("nifValidator")
|
||||
public class NifValidator implements Validator, ClientValidator {
|
||||
public class NifValidator implements Validator<String>, ClientValidator {
|
||||
|
||||
public void validate(FacesContext context, UIComponent comp, Object value) throws ValidatorException {
|
||||
public void validate(FacesContext context, UIComponent comp, String value) throws ValidatorException {
|
||||
String strValue = "";
|
||||
|
||||
if (value != null)
|
||||
|
||||
@@ -71,7 +71,7 @@ INSERT INTO myhealth.specialistdoctor(professionalnumber, password, nif, surname
|
||||
INSERT INTO myhealth.patient(personalidentificationcode, password, nif, surname, email, name, familydoctorid) VALUES
|
||||
('PAT#100','912EC803B2CE49E4A541068D495AB570','97758900E','Singh Vila', 'Soledad@example.ecom','Soledad', 1)
|
||||
,('PAT#101','912EC803B2CE49E4A541068D495AB570','Z9518183Y','Jimenez Merino', 'Ainhoa@example.ecom','Ainhoa', 2)
|
||||
,('PAT#102','912EC803B2CE49E4A541068D495AB570','97758900E','Jesus Chen Barba', 'Abel@example.ecom','Abel', 3)
|
||||
,('PAT#102','912EC803B2CE49E4A541068D495AB570','49426296D','Jesus Chen Barba', 'Abel@example.ecom','Abel', 3)
|
||||
,('PAT#103','912EC803B2CE49E4A541068D495AB570','95014341F','Lorenzo Tapia Navas', 'Francisco@example.ecom','Francisco', 4)
|
||||
,('PAT#104','912EC803B2CE49E4A541068D495AB570','17873499S','Gimenez Gutierrez', 'Teodora@example.ecom','Teodora', 5)
|
||||
,('PAT#105','912EC803B2CE49E4A541068D495AB570','07320674G','Escobar Marquez', 'Jorge@example.ecom','Jorge', 6)
|
||||
|
||||
92
4.config/createApplicationUser.sh
Executable file
92
4.config/createApplicationUser.sh
Executable file
@@ -0,0 +1,92 @@
|
||||
#!/usr/bin/expect -f
|
||||
#
|
||||
# This Expect script was generated by autoexpect on Wed Dec 18 17:32:33 2019
|
||||
# Expect and autoexpect were both written by Don Libes, NIST.
|
||||
#
|
||||
# Note that autoexpect does not guarantee a working script. It
|
||||
# necessarily has to guess about certain things. Two reasons a script
|
||||
# might fail are:
|
||||
#
|
||||
# 1) timing - A surprising number of programs (rn, ksh, zsh, telnet,
|
||||
# etc.) and devices discard or ignore keystrokes that arrive "too
|
||||
# quickly" after prompts. If you find your new script hanging up at
|
||||
# one spot, try adding a short sleep just before the previous send.
|
||||
# Setting "force_conservative" to 1 (see below) makes Expect do this
|
||||
# automatically - pausing briefly before sending each character. This
|
||||
# pacifies every program I know of. The -c flag makes the script do
|
||||
# this in the first place. The -C flag allows you to define a
|
||||
# character to toggle this mode off and on.
|
||||
|
||||
set force_conservative 0 ;# set to 1 to force conservative mode even if
|
||||
;# script wasn't run conservatively originally
|
||||
if {$force_conservative} {
|
||||
set send_slow {1 .1}
|
||||
proc send {ignore arg} {
|
||||
sleep .1
|
||||
exp_send -s -- $arg
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# 2) differing output - Some programs produce different output each time
|
||||
# they run. The "date" command is an obvious example. Another is
|
||||
# ftp, if it produces throughput statistics at the end of a file
|
||||
# transfer. If this causes a problem, delete these patterns or replace
|
||||
# them with wildcards. An alternative is to use the -p flag (for
|
||||
# "prompt") which makes Expect only look for the last line of output
|
||||
# (i.e., the prompt). The -P flag allows you to define a character to
|
||||
# toggle this mode off and on.
|
||||
#
|
||||
# Read the man page for more info.
|
||||
#
|
||||
# -Don
|
||||
|
||||
|
||||
set timeout -1
|
||||
spawn ./add-user.sh
|
||||
match_max 100000
|
||||
expect -exact "\r
|
||||
What type of user do you wish to add? \r
|
||||
a) Management User (mgmt-users.properties) \r
|
||||
b) Application User (application-users.properties)\r
|
||||
(a): "
|
||||
send -- "b\r"
|
||||
expect -exact "b\r
|
||||
\r
|
||||
Enter the details of the new user to add.\r
|
||||
Using realm 'ApplicationRealm' as discovered from the existing property files.\r
|
||||
Username : "
|
||||
send -- "USER\r"
|
||||
expect -exact "USER\r
|
||||
Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.\r
|
||||
- The password should be different from the username\r
|
||||
- The password should not be one of the following restricted values {root, admin, administrator}\r
|
||||
- The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)\r
|
||||
Password : "
|
||||
send -- "PASSWORD\r"
|
||||
expect -exact "\r
|
||||
WFLYDM0101: Password should have at least 1 digit.\r
|
||||
Are you sure you want to use the password entered yes/no? "
|
||||
send -- "Y\r"
|
||||
expect -exact "Y\r
|
||||
Re-enter Password : "
|
||||
send -- "PASSWORD\r"
|
||||
expect -exact "\r
|
||||
What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)\[ \]: "
|
||||
send -- " User,Trainer,Administrator"
|
||||
expect -exact " User,Trainer,Administrator"
|
||||
send -- "\r"
|
||||
expect -exact "\r
|
||||
About to add user 'USER' for realm 'ApplicationRealm'\r
|
||||
Is this correct yes/no? "
|
||||
send -- "Y\r"
|
||||
expect -exact "Y\r
|
||||
Added user 'USER' to file '/opt/jboss/wildfly/standalone/configuration/application-users.properties'\r
|
||||
Added user 'USER' to file '/opt/jboss/wildfly/domain/configuration/application-users.properties'\r
|
||||
Added user 'USER' with groups User,Trainer,Administrator to file '/opt/jboss/wildfly/standalone/configuration/application-roles.properties'\r
|
||||
Added user 'USER' with groups User,Trainer,Administrator to file '/opt/jboss/wildfly/domain/configuration/application-roles.properties'\r
|
||||
Is this new user going to be used for one AS process to connect to another AS process? \r
|
||||
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.\r
|
||||
yes/no? "
|
||||
send -- "Y\r"
|
||||
expect eof
|
||||
92
4.config/createManagementUser.sh
Executable file
92
4.config/createManagementUser.sh
Executable file
@@ -0,0 +1,92 @@
|
||||
#!/usr/bin/expect -f
|
||||
#
|
||||
# This Expect script was generated by autoexpect on Wed Dec 18 17:37:57 2019
|
||||
# Expect and autoexpect were both written by Don Libes, NIST.
|
||||
#
|
||||
# Note that autoexpect does not guarantee a working script. It
|
||||
# necessarily has to guess about certain things. Two reasons a script
|
||||
# might fail are:
|
||||
#
|
||||
# 1) timing - A surprising number of programs (rn, ksh, zsh, telnet,
|
||||
# etc.) and devices discard or ignore keystrokes that arrive "too
|
||||
# quickly" after prompts. If you find your new script hanging up at
|
||||
# one spot, try adding a short sleep just before the previous send.
|
||||
# Setting "force_conservative" to 1 (see below) makes Expect do this
|
||||
# automatically - pausing briefly before sending each character. This
|
||||
# pacifies every program I know of. The -c flag makes the script do
|
||||
# this in the first place. The -C flag allows you to define a
|
||||
# character to toggle this mode off and on.
|
||||
|
||||
set force_conservative 0 ;# set to 1 to force conservative mode even if
|
||||
;# script wasn't run conservatively originally
|
||||
if {$force_conservative} {
|
||||
set send_slow {1 .1}
|
||||
proc send {ignore arg} {
|
||||
sleep .1
|
||||
exp_send -s -- $arg
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# 2) differing output - Some programs produce different output each time
|
||||
# they run. The "date" command is an obvious example. Another is
|
||||
# ftp, if it produces throughput statistics at the end of a file
|
||||
# transfer. If this causes a problem, delete these patterns or replace
|
||||
# them with wildcards. An alternative is to use the -p flag (for
|
||||
# "prompt") which makes Expect only look for the last line of output
|
||||
# (i.e., the prompt). The -P flag allows you to define a character to
|
||||
# toggle this mode off and on.
|
||||
#
|
||||
# Read the man page for more info.
|
||||
#
|
||||
# -Don
|
||||
|
||||
|
||||
set timeout -1
|
||||
spawn ./add-user.sh
|
||||
match_max 100000
|
||||
expect -exact "\r
|
||||
What type of user do you wish to add? \r
|
||||
a) Management User (mgmt-users.properties) \r
|
||||
b) Application User (application-users.properties)\r
|
||||
(a): "
|
||||
send -- "A\r"
|
||||
expect -exact "A\r
|
||||
\r
|
||||
Enter the details of the new user to add.\r
|
||||
Using realm 'ManagementRealm' as discovered from the existing property files.\r
|
||||
Username : "
|
||||
send -- "USER\r"
|
||||
expect -exact "USER\r
|
||||
Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.\r
|
||||
- The password should be different from the username\r
|
||||
- The password should not be one of the following restricted values {root, admin, administrator}\r
|
||||
- The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)\r
|
||||
Password : "
|
||||
send -- "PASSWORD\r"
|
||||
expect -exact "\r
|
||||
WFLYDM0101: Password should have at least 1 digit.\r
|
||||
Are you sure you want to use the password entered yes/no? "
|
||||
send -- "Y\r"
|
||||
expect -exact "Y\r
|
||||
Re-enter Password : "
|
||||
send -- "PASSWORD\r"
|
||||
expect -exact "\r
|
||||
What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)\[ \]: "
|
||||
send -- " User,Trainer,Administrator"
|
||||
expect -exact " User,Trainer,Administrator"
|
||||
send -- "\r"
|
||||
expect -exact "\r
|
||||
About to add user 'USER' for realm 'ManagementRealm'\r
|
||||
Is this correct yes/no? "
|
||||
send -- "Y\r"
|
||||
expect -exact "Y\r
|
||||
Added user 'USER' to file '/opt/jboss/wildfly/standalone/configuration/mgmt-users.properties'\r
|
||||
Added user 'USER' to file '/opt/jboss/wildfly/domain/configuration/mgmt-users.properties'\r
|
||||
Added user 'USER' with groups User,Trainer,Administrator to file '/opt/jboss/wildfly/standalone/configuration/mgmt-groups.properties'\r
|
||||
Added user 'USER' with groups User,Trainer,Administrator to file '/opt/jboss/wildfly/domain/configuration/mgmt-groups.properties'\r
|
||||
Is this new user going to be used for one AS process to connect to another AS process? \r
|
||||
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.\r
|
||||
yes/no? "
|
||||
send -- "Y\r"
|
||||
expect eof
|
||||
10
4.config/module.xml
Normal file
10
4.config/module.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module xmlns="urn:jboss:module:1.0" name="org.postgresql">
|
||||
<resources>
|
||||
<resource-root path="postgresql-9.4.1209.jar"/>
|
||||
</resources>
|
||||
<dependencies>
|
||||
<module name="javax.api"/>
|
||||
<module name="javax.transaction.api"/>
|
||||
</dependencies>
|
||||
</module>
|
||||
BIN
4.config/postgresql-9.4.1209.jar
Executable file
BIN
4.config/postgresql-9.4.1209.jar
Executable file
Binary file not shown.
524
4.config/standalone.xml
Normal file
524
4.config/standalone.xml
Normal file
@@ -0,0 +1,524 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
|
||||
<server xmlns="urn:jboss:domain:8.0">
|
||||
<extensions>
|
||||
<extension module="org.jboss.as.clustering.infinispan"/>
|
||||
<extension module="org.jboss.as.connector"/>
|
||||
<extension module="org.jboss.as.deployment-scanner"/>
|
||||
<extension module="org.jboss.as.ee"/>
|
||||
<extension module="org.jboss.as.ejb3"/>
|
||||
<extension module="org.jboss.as.jaxrs"/>
|
||||
<extension module="org.jboss.as.jdr"/>
|
||||
<extension module="org.jboss.as.jmx"/>
|
||||
<extension module="org.jboss.as.jpa"/>
|
||||
<extension module="org.jboss.as.jsf"/>
|
||||
<extension module="org.jboss.as.logging"/>
|
||||
<extension module="org.jboss.as.mail"/>
|
||||
<extension module="org.jboss.as.naming"/>
|
||||
<extension module="org.jboss.as.pojo"/>
|
||||
<extension module="org.jboss.as.remoting"/>
|
||||
<extension module="org.jboss.as.sar"/>
|
||||
<extension module="org.jboss.as.security"/>
|
||||
<extension module="org.jboss.as.transactions"/>
|
||||
<extension module="org.jboss.as.webservices"/>
|
||||
<extension module="org.jboss.as.weld"/>
|
||||
<extension module="org.wildfly.extension.batch.jberet"/>
|
||||
<extension module="org.wildfly.extension.bean-validation"/>
|
||||
<extension module="org.wildfly.extension.core-management"/>
|
||||
<extension module="org.wildfly.extension.discovery"/>
|
||||
<extension module="org.wildfly.extension.ee-security"/>
|
||||
<extension module="org.wildfly.extension.elytron"/>
|
||||
<extension module="org.wildfly.extension.io"/>
|
||||
<extension module="org.wildfly.extension.microprofile.config-smallrye"/>
|
||||
<extension module="org.wildfly.extension.microprofile.health-smallrye"/>
|
||||
<extension module="org.wildfly.extension.microprofile.opentracing-smallrye"/>
|
||||
<extension module="org.wildfly.extension.request-controller"/>
|
||||
<extension module="org.wildfly.extension.security.manager"/>
|
||||
<extension module="org.wildfly.extension.undertow"/>
|
||||
</extensions>
|
||||
<management>
|
||||
<security-realms>
|
||||
<security-realm name="ManagementRealm">
|
||||
<authentication>
|
||||
<local default-user="$local" skip-group-loading="true"/>
|
||||
<properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>
|
||||
</authentication>
|
||||
<authorization map-groups-to-roles="false">
|
||||
<properties path="mgmt-groups.properties" relative-to="jboss.server.config.dir"/>
|
||||
</authorization>
|
||||
</security-realm>
|
||||
<security-realm name="ApplicationRealm">
|
||||
<server-identities>
|
||||
<ssl>
|
||||
<keystore path="application.keystore" relative-to="jboss.server.config.dir" keystore-password="password" alias="server" key-password="password" generate-self-signed-certificate-host="localhost"/>
|
||||
</ssl>
|
||||
</server-identities>
|
||||
<authentication>
|
||||
<local default-user="$local" allowed-users="*" skip-group-loading="true"/>
|
||||
<properties path="application-users.properties" relative-to="jboss.server.config.dir"/>
|
||||
</authentication>
|
||||
<authorization>
|
||||
<properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>
|
||||
</authorization>
|
||||
</security-realm>
|
||||
</security-realms>
|
||||
<audit-log>
|
||||
<formatters>
|
||||
<json-formatter name="json-formatter"/>
|
||||
</formatters>
|
||||
<handlers>
|
||||
<file-handler name="file" formatter="json-formatter" path="audit-log.log" relative-to="jboss.server.data.dir"/>
|
||||
</handlers>
|
||||
<logger log-boot="true" log-read-only="false" enabled="false">
|
||||
<handlers>
|
||||
<handler name="file"/>
|
||||
</handlers>
|
||||
</logger>
|
||||
</audit-log>
|
||||
<management-interfaces>
|
||||
<http-interface security-realm="ManagementRealm">
|
||||
<http-upgrade enabled="true"/>
|
||||
<socket-binding http="management-http"/>
|
||||
</http-interface>
|
||||
</management-interfaces>
|
||||
<access-control provider="simple">
|
||||
<role-mapping>
|
||||
<role name="SuperUser">
|
||||
<include>
|
||||
<user name="$local"/>
|
||||
</include>
|
||||
</role>
|
||||
</role-mapping>
|
||||
</access-control>
|
||||
</management>
|
||||
<profile>
|
||||
<subsystem xmlns="urn:jboss:domain:logging:6.0">
|
||||
<console-handler name="CONSOLE">
|
||||
<level name="INFO"/>
|
||||
<formatter>
|
||||
<named-formatter name="COLOR-PATTERN"/>
|
||||
</formatter>
|
||||
</console-handler>
|
||||
<periodic-rotating-file-handler name="FILE" autoflush="true">
|
||||
<formatter>
|
||||
<named-formatter name="PATTERN"/>
|
||||
</formatter>
|
||||
<file relative-to="jboss.server.log.dir" path="server.log"/>
|
||||
<suffix value=".yyyy-MM-dd"/>
|
||||
<append value="true"/>
|
||||
</periodic-rotating-file-handler>
|
||||
<logger category="com.arjuna">
|
||||
<level name="WARN"/>
|
||||
</logger>
|
||||
<logger category="org.jboss.as.config">
|
||||
<level name="DEBUG"/>
|
||||
</logger>
|
||||
<logger category="sun.rmi">
|
||||
<level name="WARN"/>
|
||||
</logger>
|
||||
<root-logger>
|
||||
<level name="INFO"/>
|
||||
<handlers>
|
||||
<handler name="CONSOLE"/>
|
||||
<handler name="FILE"/>
|
||||
</handlers>
|
||||
</root-logger>
|
||||
<formatter name="PATTERN">
|
||||
<pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
|
||||
</formatter>
|
||||
<formatter name="COLOR-PATTERN">
|
||||
<pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
|
||||
</formatter>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:batch-jberet:2.0">
|
||||
<default-job-repository name="in-memory"/>
|
||||
<default-thread-pool name="batch"/>
|
||||
<job-repository name="in-memory">
|
||||
<in-memory/>
|
||||
</job-repository>
|
||||
<thread-pool name="batch">
|
||||
<max-threads count="10"/>
|
||||
<keepalive-time time="30" unit="seconds"/>
|
||||
</thread-pool>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:bean-validation:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:core-management:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:datasources:5.0">
|
||||
<datasources>
|
||||
<datasource jta="false" jndi-name="java:jboss/postgresDS" pool-name="postgresDS" enabled="true" use-java-context="true" use-ccm="false">
|
||||
<connection-url>jdbc:postgresql://postgres:5432/myhealth</connection-url>
|
||||
<driver-class>org.postgresql.Driver</driver-class>
|
||||
<driver>postgresql</driver>
|
||||
<security>
|
||||
<user-name>USER</user-name>
|
||||
<password>PASSWORD</password>
|
||||
</security>
|
||||
</datasource>
|
||||
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
|
||||
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
|
||||
<driver>h2</driver>
|
||||
<security>
|
||||
<user-name>sa</user-name>
|
||||
<password>sa</password>
|
||||
</security>
|
||||
</datasource>
|
||||
<drivers>
|
||||
<driver name="postgresql" module="org.postgresql">
|
||||
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
|
||||
</driver>
|
||||
<driver name="h2" module="com.h2database.h2">
|
||||
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
|
||||
</driver>
|
||||
</drivers>
|
||||
</datasources>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
|
||||
<deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:discovery:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:ee:4.0">
|
||||
<spec-descriptor-property-replacement>false</spec-descriptor-property-replacement>
|
||||
<concurrent>
|
||||
<context-services>
|
||||
<context-service name="default" jndi-name="java:jboss/ee/concurrency/context/default" use-transaction-setup-provider="true"/>
|
||||
</context-services>
|
||||
<managed-thread-factories>
|
||||
<managed-thread-factory name="default" jndi-name="java:jboss/ee/concurrency/factory/default" context-service="default"/>
|
||||
</managed-thread-factories>
|
||||
<managed-executor-services>
|
||||
<managed-executor-service name="default" jndi-name="java:jboss/ee/concurrency/executor/default" context-service="default" hung-task-threshold="60000" keepalive-time="5000"/>
|
||||
</managed-executor-services>
|
||||
<managed-scheduled-executor-services>
|
||||
<managed-scheduled-executor-service name="default" jndi-name="java:jboss/ee/concurrency/scheduler/default" context-service="default" hung-task-threshold="60000" keepalive-time="3000"/>
|
||||
</managed-scheduled-executor-services>
|
||||
</concurrent>
|
||||
<default-bindings context-service="java:jboss/ee/concurrency/context/default" datasource="java:jboss/datasources/ExampleDS" managed-executor-service="java:jboss/ee/concurrency/executor/default" managed-scheduled-executor-service="java:jboss/ee/concurrency/scheduler/default" managed-thread-factory="java:jboss/ee/concurrency/factory/default"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:ee-security:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:ejb3:5.0">
|
||||
<session-bean>
|
||||
<stateless>
|
||||
<bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
|
||||
</stateless>
|
||||
<stateful default-access-timeout="5000" cache-ref="simple" passivation-disabled-cache-ref="simple"/>
|
||||
<singleton default-access-timeout="5000"/>
|
||||
</session-bean>
|
||||
<pools>
|
||||
<bean-instance-pools>
|
||||
<strict-max-pool name="mdb-strict-max-pool" derive-size="from-cpu-count" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
|
||||
<strict-max-pool name="slsb-strict-max-pool" derive-size="from-worker-pools" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
|
||||
</bean-instance-pools>
|
||||
</pools>
|
||||
<caches>
|
||||
<cache name="simple"/>
|
||||
<cache name="distributable" passivation-store-ref="infinispan" aliases="passivating clustered"/>
|
||||
</caches>
|
||||
<passivation-stores>
|
||||
<passivation-store name="infinispan" cache-container="ejb" max-size="10000"/>
|
||||
</passivation-stores>
|
||||
<async thread-pool-name="default"/>
|
||||
<timer-service thread-pool-name="default" default-data-store="default-file-store">
|
||||
<data-stores>
|
||||
<file-data-store name="default-file-store" path="timer-service-data" relative-to="jboss.server.data.dir"/>
|
||||
</data-stores>
|
||||
</timer-service>
|
||||
<remote connector-ref="http-remoting-connector" thread-pool-name="default">
|
||||
<channel-creation-options>
|
||||
<option name="READ_TIMEOUT" value="${prop.remoting-connector.read.timeout:20}" type="xnio"/>
|
||||
<option name="MAX_OUTBOUND_MESSAGES" value="1234" type="remoting"/>
|
||||
</channel-creation-options>
|
||||
</remote>
|
||||
<thread-pools>
|
||||
<thread-pool name="default">
|
||||
<max-threads count="10"/>
|
||||
<keepalive-time time="100" unit="milliseconds"/>
|
||||
</thread-pool>
|
||||
</thread-pools>
|
||||
<default-security-domain value="other"/>
|
||||
<default-missing-method-permissions-deny-access value="true"/>
|
||||
<log-system-exceptions value="true"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:wildfly:elytron:4.0" final-providers="combined-providers" disallowed-providers="OracleUcrypto">
|
||||
<providers>
|
||||
<aggregate-providers name="combined-providers">
|
||||
<providers name="elytron"/>
|
||||
<providers name="openssl"/>
|
||||
</aggregate-providers>
|
||||
<provider-loader name="elytron" module="org.wildfly.security.elytron"/>
|
||||
<provider-loader name="openssl" module="org.wildfly.openssl"/>
|
||||
</providers>
|
||||
<audit-logging>
|
||||
<file-audit-log name="local-audit" path="audit.log" relative-to="jboss.server.log.dir" format="JSON"/>
|
||||
</audit-logging>
|
||||
<security-domains>
|
||||
<security-domain name="ApplicationDomain" default-realm="ApplicationRealm" permission-mapper="default-permission-mapper">
|
||||
<realm name="ApplicationRealm" role-decoder="groups-to-roles"/>
|
||||
<realm name="local"/>
|
||||
</security-domain>
|
||||
<security-domain name="ManagementDomain" default-realm="ManagementRealm" permission-mapper="default-permission-mapper">
|
||||
<realm name="ManagementRealm" role-decoder="groups-to-roles"/>
|
||||
<realm name="local" role-mapper="super-user-mapper"/>
|
||||
</security-domain>
|
||||
</security-domains>
|
||||
<security-realms>
|
||||
<identity-realm name="local" identity="$local"/>
|
||||
<properties-realm name="ApplicationRealm">
|
||||
<users-properties path="application-users.properties" relative-to="jboss.server.config.dir" digest-realm-name="ApplicationRealm"/>
|
||||
<groups-properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>
|
||||
</properties-realm>
|
||||
<properties-realm name="ManagementRealm">
|
||||
<users-properties path="mgmt-users.properties" relative-to="jboss.server.config.dir" digest-realm-name="ManagementRealm"/>
|
||||
<groups-properties path="mgmt-groups.properties" relative-to="jboss.server.config.dir"/>
|
||||
</properties-realm>
|
||||
</security-realms>
|
||||
<mappers>
|
||||
<simple-permission-mapper name="default-permission-mapper" mapping-mode="first">
|
||||
<permission-mapping>
|
||||
<principal name="anonymous"/>
|
||||
<permission-set name="default-permissions"/>
|
||||
</permission-mapping>
|
||||
<permission-mapping match-all="true">
|
||||
<permission-set name="login-permission"/>
|
||||
<permission-set name="default-permissions"/>
|
||||
</permission-mapping>
|
||||
</simple-permission-mapper>
|
||||
<constant-realm-mapper name="local" realm-name="local"/>
|
||||
<simple-role-decoder name="groups-to-roles" attribute="groups"/>
|
||||
<constant-role-mapper name="super-user-mapper">
|
||||
<role name="SuperUser"/>
|
||||
</constant-role-mapper>
|
||||
</mappers>
|
||||
<permission-sets>
|
||||
<permission-set name="login-permission">
|
||||
<permission class-name="org.wildfly.security.auth.permission.LoginPermission"/>
|
||||
</permission-set>
|
||||
<permission-set name="default-permissions">
|
||||
<permission class-name="org.wildfly.extension.batch.jberet.deployment.BatchPermission" module="org.wildfly.extension.batch.jberet" target-name="*"/>
|
||||
<permission class-name="org.wildfly.transaction.client.RemoteTransactionPermission" module="org.wildfly.transaction.client"/>
|
||||
<permission class-name="org.jboss.ejb.client.RemoteEJBPermission" module="org.jboss.ejb-client"/>
|
||||
</permission-set>
|
||||
</permission-sets>
|
||||
<http>
|
||||
<http-authentication-factory name="management-http-authentication" security-domain="ManagementDomain" http-server-mechanism-factory="global">
|
||||
<mechanism-configuration>
|
||||
<mechanism mechanism-name="DIGEST">
|
||||
<mechanism-realm realm-name="ManagementRealm"/>
|
||||
</mechanism>
|
||||
</mechanism-configuration>
|
||||
</http-authentication-factory>
|
||||
<provider-http-server-mechanism-factory name="global"/>
|
||||
</http>
|
||||
<sasl>
|
||||
<sasl-authentication-factory name="application-sasl-authentication" sasl-server-factory="configured" security-domain="ApplicationDomain">
|
||||
<mechanism-configuration>
|
||||
<mechanism mechanism-name="JBOSS-LOCAL-USER" realm-mapper="local"/>
|
||||
<mechanism mechanism-name="DIGEST-MD5">
|
||||
<mechanism-realm realm-name="ApplicationRealm"/>
|
||||
</mechanism>
|
||||
</mechanism-configuration>
|
||||
</sasl-authentication-factory>
|
||||
<sasl-authentication-factory name="management-sasl-authentication" sasl-server-factory="configured" security-domain="ManagementDomain">
|
||||
<mechanism-configuration>
|
||||
<mechanism mechanism-name="JBOSS-LOCAL-USER" realm-mapper="local"/>
|
||||
<mechanism mechanism-name="DIGEST-MD5">
|
||||
<mechanism-realm realm-name="ManagementRealm"/>
|
||||
</mechanism>
|
||||
</mechanism-configuration>
|
||||
</sasl-authentication-factory>
|
||||
<configurable-sasl-server-factory name="configured" sasl-server-factory="elytron">
|
||||
<properties>
|
||||
<property name="wildfly.sasl.local-user.default-user" value="$local"/>
|
||||
</properties>
|
||||
</configurable-sasl-server-factory>
|
||||
<mechanism-provider-filtering-sasl-server-factory name="elytron" sasl-server-factory="global">
|
||||
<filters>
|
||||
<filter provider-name="WildFlyElytron"/>
|
||||
</filters>
|
||||
</mechanism-provider-filtering-sasl-server-factory>
|
||||
<provider-sasl-server-factory name="global"/>
|
||||
</sasl>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:infinispan:7.0">
|
||||
<cache-container name="server" default-cache="default" module="org.wildfly.clustering.server">
|
||||
<local-cache name="default">
|
||||
<transaction mode="BATCH"/>
|
||||
</local-cache>
|
||||
</cache-container>
|
||||
<cache-container name="web" default-cache="passivation" module="org.wildfly.clustering.web.infinispan">
|
||||
<local-cache name="passivation">
|
||||
<locking isolation="REPEATABLE_READ"/>
|
||||
<transaction mode="BATCH"/>
|
||||
<file-store passivation="true" purge="false"/>
|
||||
</local-cache>
|
||||
</cache-container>
|
||||
<cache-container name="ejb" aliases="sfsb" default-cache="passivation" module="org.wildfly.clustering.ejb.infinispan">
|
||||
<local-cache name="passivation">
|
||||
<locking isolation="REPEATABLE_READ"/>
|
||||
<transaction mode="BATCH"/>
|
||||
<file-store passivation="true" purge="false"/>
|
||||
</local-cache>
|
||||
</cache-container>
|
||||
<cache-container name="hibernate" module="org.infinispan.hibernate-cache">
|
||||
<local-cache name="entity">
|
||||
<transaction mode="NON_XA"/>
|
||||
<object-memory size="10000"/>
|
||||
<expiration max-idle="100000"/>
|
||||
</local-cache>
|
||||
<local-cache name="local-query">
|
||||
<object-memory size="10000"/>
|
||||
<expiration max-idle="100000"/>
|
||||
</local-cache>
|
||||
<local-cache name="timestamps"/>
|
||||
</cache-container>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:io:3.0">
|
||||
<worker name="default"/>
|
||||
<buffer-pool name="default"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:jca:5.0">
|
||||
<archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
|
||||
<bean-validation enabled="true"/>
|
||||
<default-workmanager>
|
||||
<short-running-threads>
|
||||
<core-threads count="50"/>
|
||||
<queue-length count="50"/>
|
||||
<max-threads count="50"/>
|
||||
<keepalive-time time="10" unit="seconds"/>
|
||||
</short-running-threads>
|
||||
<long-running-threads>
|
||||
<core-threads count="50"/>
|
||||
<queue-length count="50"/>
|
||||
<max-threads count="50"/>
|
||||
<keepalive-time time="10" unit="seconds"/>
|
||||
</long-running-threads>
|
||||
</default-workmanager>
|
||||
<cached-connection-manager/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:jmx:1.3">
|
||||
<expose-resolved-model/>
|
||||
<expose-expression-model/>
|
||||
<remoting-connector/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:jpa:1.1">
|
||||
<jpa default-datasource="" default-extended-persistence-inheritance="DEEP"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:jsf:1.1"/>
|
||||
<subsystem xmlns="urn:jboss:domain:mail:3.0">
|
||||
<mail-session name="default" jndi-name="java:jboss/mail/Default">
|
||||
<smtp-server outbound-socket-binding-ref="mail-smtp"/>
|
||||
</mail-session>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:wildfly:microprofile-config-smallrye:1.0"/>
|
||||
<subsystem xmlns="urn:wildfly:microprofile-health-smallrye:1.0" security-enabled="false"/>
|
||||
<subsystem xmlns="urn:wildfly:microprofile-opentracing-smallrye:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:naming:2.0">
|
||||
<remote-naming/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:pojo:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:remoting:4.0">
|
||||
<http-connector name="http-remoting-connector" connector-ref="default" security-realm="ApplicationRealm"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:request-controller:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:resource-adapters:5.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:sar:1.0"/>
|
||||
<subsystem xmlns="urn:jboss:domain:security:2.0">
|
||||
<security-domains>
|
||||
<security-domain name="other" cache-type="default">
|
||||
<authentication>
|
||||
<login-module code="Remoting" flag="optional">
|
||||
<module-option name="password-stacking" value="useFirstPass"/>
|
||||
</login-module>
|
||||
<login-module code="RealmDirect" flag="required">
|
||||
<module-option name="password-stacking" value="useFirstPass"/>
|
||||
</login-module>
|
||||
</authentication>
|
||||
</security-domain>
|
||||
<security-domain name="jboss-web-policy" cache-type="default">
|
||||
<authorization>
|
||||
<policy-module code="Delegating" flag="required"/>
|
||||
</authorization>
|
||||
</security-domain>
|
||||
<security-domain name="jaspitest" cache-type="default">
|
||||
<authentication-jaspi>
|
||||
<login-module-stack name="dummy">
|
||||
<login-module code="Dummy" flag="optional"/>
|
||||
</login-module-stack>
|
||||
<auth-module code="Dummy"/>
|
||||
</authentication-jaspi>
|
||||
</security-domain>
|
||||
<security-domain name="jboss-ejb-policy" cache-type="default">
|
||||
<authorization>
|
||||
<policy-module code="Delegating" flag="required"/>
|
||||
</authorization>
|
||||
</security-domain>
|
||||
</security-domains>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:security-manager:1.0">
|
||||
<deployment-permissions>
|
||||
<maximum-set>
|
||||
<permission class="java.security.AllPermission"/>
|
||||
</maximum-set>
|
||||
</deployment-permissions>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:transactions:5.0">
|
||||
<core-environment node-identifier="${jboss.tx.node.id:1}">
|
||||
<process-id>
|
||||
<uuid/>
|
||||
</process-id>
|
||||
</core-environment>
|
||||
<recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
|
||||
<object-store path="tx-object-store" relative-to="jboss.server.data.dir"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:undertow:7.0" default-server="default-server" default-virtual-host="default-host" default-servlet-container="default" default-security-domain="other">
|
||||
<buffer-cache name="default"/>
|
||||
<server name="default-server">
|
||||
<http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
|
||||
<https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/>
|
||||
<host name="default-host" alias="localhost">
|
||||
<location name="/" handler="welcome-content"/>
|
||||
<http-invoker security-realm="ApplicationRealm"/>
|
||||
</host>
|
||||
</server>
|
||||
<servlet-container name="default">
|
||||
<jsp-config/>
|
||||
<websockets/>
|
||||
</servlet-container>
|
||||
<handlers>
|
||||
<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/>
|
||||
</handlers>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:webservices:2.0">
|
||||
<wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
|
||||
<endpoint-config name="Standard-Endpoint-Config"/>
|
||||
<endpoint-config name="Recording-Endpoint-Config">
|
||||
<pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
|
||||
<handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
|
||||
</pre-handler-chain>
|
||||
</endpoint-config>
|
||||
<client-config name="Standard-Client-Config"/>
|
||||
</subsystem>
|
||||
<subsystem xmlns="urn:jboss:domain:weld:4.0"/>
|
||||
</profile>
|
||||
<interfaces>
|
||||
<interface name="management">
|
||||
<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
|
||||
</interface>
|
||||
<interface name="public">
|
||||
<inet-address value="${jboss.bind.address:127.0.0.1}"/>
|
||||
</interface>
|
||||
</interfaces>
|
||||
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
|
||||
<socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
|
||||
<socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
|
||||
<socket-binding name="ajp" port="${jboss.ajp.port:8009}"/>
|
||||
<socket-binding name="http" port="${jboss.http.port:8080}"/>
|
||||
<socket-binding name="https" port="${jboss.https.port:8443}"/>
|
||||
<socket-binding name="txn-recovery-environment" port="4712"/>
|
||||
<socket-binding name="txn-status-manager" port="4713"/>
|
||||
<outbound-socket-binding name="mail-smtp">
|
||||
<remote-destination host="localhost" port="25"/>
|
||||
</outbound-socket-binding>
|
||||
</socket-binding-group>
|
||||
</server>
|
||||
29
Dockerfile
Normal file
29
Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
||||
FROM jboss/wildfly:14.0.1.Final
|
||||
|
||||
# User root user to install software
|
||||
USER root
|
||||
RUN yum -y install expect
|
||||
RUN yum -y install postgresql
|
||||
RUN yum -y install ant
|
||||
|
||||
# Compile and copy .ear to deployments
|
||||
ADD ./1.sources/ /opt/jboss/
|
||||
RUN cd /opt/jboss/MyHealth && ant
|
||||
RUN mv /opt/jboss/MyHealth/dist/MyHealth.ear /opt/jboss/wildfly/standalone/deployments
|
||||
|
||||
# Switch back to jboss user
|
||||
USER jboss
|
||||
|
||||
ADD ./4.config/createApplicationUser.sh /opt/jboss/wildfly/bin/
|
||||
ADD ./4.config/createManagementUser.sh /opt/jboss/wildfly/bin/
|
||||
|
||||
RUN cd /opt/jboss/wildfly/bin && ./createApplicationUser.sh
|
||||
RUN cd /opt/jboss/wildfly/bin && ./createManagementUser.sh
|
||||
|
||||
RUN mkdir /opt/jboss/wildfly/modules/system/layers/base/org/postgresql/
|
||||
RUN mkdir /opt/jboss/wildfly/modules/system/layers/base/org/postgresql/main
|
||||
ADD ./4.config/postgresql-9.4.1209.jar /opt/jboss/wildfly/modules/system/layers/base/org/postgresql/main
|
||||
ADD ./4.config/module.xml /opt/jboss/wildfly/modules/system/layers/base/org/postgresql/main
|
||||
ADD ./4.config/standalone.xml /opt/jboss/wildfly/standalone/configuration/standalone.xml
|
||||
|
||||
CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0"]
|
||||
24
docker-compose.yml
Normal file
24
docker-compose.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
version: '3'
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:10.11-alpine
|
||||
ports:
|
||||
- "5432:5432"
|
||||
environment:
|
||||
- POSTGRES_USER=USER
|
||||
- POSTGRES_PASSWORD=PASSWORD
|
||||
- POSTGRES_DB=myhealth
|
||||
volumes:
|
||||
- ./2.database/01.CreateTables.sql:/docker-entrypoint-initdb.d/01.CreateTables.sql
|
||||
- ./2.database/02.Datos_prueba.sql:/docker-entrypoint-initdb.d/02.Datos_prueba.sql
|
||||
wildfly:
|
||||
build: .
|
||||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
- DB_USER=USER
|
||||
- DB_PASS=PASSWORD
|
||||
- JBOSS_HOME=/opt/jboss/wildfly
|
||||
depends_on:
|
||||
- postgres
|
||||
|
||||
@@ -24,3 +24,11 @@ El usuario y contraseña de base de datos que se han utilizado en el datasource
|
||||
|
||||
### 4. Ejecutar la compilación y despliegue del proyecto
|
||||
Acceder al directorio con el código fuente ([git-folder]/1.sources/MyHealth), y donde está ubicado el archivo de compilación de ant build.xml, ejecutar `ant` en este directorio, el proyecto debería compilarse y desplegarse automáticamente en el servidor JBOSS local.
|
||||
|
||||
## Instrucciones de despliegue alternativo con docker
|
||||
|
||||
### pre-requisitos:
|
||||
Instalar docker desktop
|
||||
|
||||
### Levantar ambiente con un solo comando:
|
||||
Abrimos la consola y nos posicionamos en el root del proyecto donde se encuentra el archivo `docker-compose.yml` y mediante la ejecución del comando `docker-compose up` levantaremos un contenedor de postgresql con el schema, tablas y permisos configurado y un contenedor con jboss/wildfly también configurado en el que compilaremos la ultima versión del producto y la desplegaremos.
|
||||
Reference in New Issue
Block a user