[GitHub] [tomee] Daniel-Dos commented on a change in pull request #703: TOMEE-2895 Translate to Portuguese: examples/rest-xml-json

2020-08-11 Thread GitBox


Daniel-Dos commented on a change in pull request #703:
URL: https://github.com/apache/tomee/pull/703#discussion_r468946959



##
File path: examples/rest-xml-json/README_pt.adoc
##
@@ -0,0 +1,398 @@
+:index-group: Unrevised
+:jbake-type: page
+:jbake-status: status=published
+= REST Simples
+
+Definir um serviço REST é muito fácil, simplesmente anúncio a anotação @Path 
para a
+classe, então definir nos métodos, o método HTTP para usar (@GET, @POST, …).
+
+#O Código
+
+== O serviço REST: @Path, @Produces, @Consumes
+
+Aqui nós vemos um bean que utiliza a opção Concorrência Bean-Managed, bem
+como a anotação @Startup, que faz com que o bean seja instanciado pelo  
+contêiner, enquanto a aplicação inicia. Beans Singleton com 
+@ConcurrencyManagement(BEAN) são responsáveis por seus próprios 
+thread-safety. O bean mostrado é uma simples ``registro'' de propriedade e
+provisiona um lugar onde opções podem ser definidas e recuperadas por todos os 
beans
+na aplicação.

Review comment:
   the example does not contain annotations like @Startup, 
@ConcurrencyManagement(BEAN). 





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [tomee] Daniel-Dos commented on a change in pull request #703: TOMEE-2895 Translate to Portuguese: examples/rest-xml-json

2020-08-11 Thread GitBox


Daniel-Dos commented on a change in pull request #703:
URL: https://github.com/apache/tomee/pull/703#discussion_r468817715



##
File path: examples/rest-xml-json/README_pt.adoc
##
@@ -0,0 +1,398 @@
+:index-group: Unrevised
+:jbake-type: page
+:jbake-status: status=published
+= REST Simples
+
+Definir um serviço REST é muito fácil, simplesmente anúncio a anotação @Path 
para a
+classe, então definir nos métodos, o método HTTP para usar (@GET, @POST, …).
+
+#O Código

Review comment:
   change #O Código to  == O Código





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [tomee] Daniel-Dos merged pull request #696: TOMEE-2888 Translate to Portuguese: examples/quartz-app

2020-08-11 Thread GitBox


Daniel-Dos merged pull request #696:
URL: https://github.com/apache/tomee/pull/696


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [tomee] Daniel-Dos commented on pull request #696: TOMEE-2888 Translate to Portuguese: examples/quartz-app

2020-08-11 Thread GitBox


Daniel-Dos commented on pull request #696:
URL: https://github.com/apache/tomee/pull/696#issuecomment-672398682


   thanks @hbelmiro  for review.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [tomee] Daniel-Dos commented on a change in pull request #703: TOMEE-2895 Translate to Portuguese: examples/rest-xml-json

2020-08-11 Thread GitBox


Daniel-Dos commented on a change in pull request #703:
URL: https://github.com/apache/tomee/pull/703#discussion_r468821246



##
File path: examples/rest-xml-json/README_pt.adoc
##
@@ -0,0 +1,398 @@
+:index-group: Unrevised
+:jbake-type: page
+:jbake-status: status=published
+= REST Simples
+
+Definir um serviço REST é muito fácil, simplesmente anúncio a anotação @Path 
para a
+classe, então definir nos métodos, o método HTTP para usar (@GET, @POST, …).
+
+#O Código
+
+== O serviço REST: @Path, @Produces, @Consumes
+
+Aqui nós vemos um bean que utiliza a opção Concorrência Bean-Managed, bem
+como a anotação @Startup, que faz com que o bean seja instanciado pelo  
+contêiner, enquanto a aplicação inicia. Beans Singleton com 
+@ConcurrencyManagement(BEAN) são responsáveis por seus próprios 
+thread-safety. O bean mostrado é uma simples ``registro'' de propriedade e
+provisiona um lugar onde opções podem ser definidas e recuperadas por todos os 
beans
+na aplicação.

Review comment:
   the example described here does not reflect the current project code. 
Because it does not contain the elements described in the text. Here it is 
necessary to update to reflect the example and also to update the English 
version.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [tomee] Daniel-Dos commented on a change in pull request #703: TOMEE-2895 Translate to Portuguese: examples/rest-xml-json

2020-08-11 Thread GitBox


Daniel-Dos commented on a change in pull request #703:
URL: https://github.com/apache/tomee/pull/703#discussion_r468817715



##
File path: examples/rest-xml-json/README_pt.adoc
##
@@ -0,0 +1,398 @@
+:index-group: Unrevised
+:jbake-type: page
+:jbake-status: status=published
+= REST Simples
+
+Definir um serviço REST é muito fácil, simplesmente anúncio a anotação @Path 
para a
+classe, então definir nos métodos, o método HTTP para usar (@GET, @POST, …).
+
+#O Código

Review comment:
   remover please.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [tomee] Daniel-Dos commented on a change in pull request #704: TOMEE-2896 Translate to Portuguese: examples/tomee-jersey-eclipselink

2020-08-11 Thread GitBox


Daniel-Dos commented on a change in pull request #704:
URL: https://github.com/apache/tomee/pull/704#discussion_r468813549



##
File path: examples/tomee-jersey-eclipselink/README_pt.adoc
##
@@ -0,0 +1,188 @@
+= JPA com EclipseLink e Jersey
+:index-group: JPA
+:jbake-type: page
+:jbake-status: published
+
+Neste exemplo, um serviço da web é criado para armazenar e recuperar dados do 
banco de dados.
+https://jersey.github.io/[Jersey] será usado para criar o serviço da web..
+Para o banco de dados, https://www.eclipse.org/eclipselink/[EclipseLink] 
Provedor JPA será usado.
+
+O serviço da web irá armazenar e recuperar informações sobre pessoas:
+
+[source,java]
+
+@Entity
+@XmlRootElement
+@NamedQuery(name = "Person.findAll", query = "select p from Person p")
+public class Person {
+
+@Id
+@GeneratedValue
+private long id;
+private String name;
+
+public long getId() {
+return id;
+}
+
+public void setId(long id) {
+this.id = id;
+}
+
+public String getName() {
+return name;
+}
+
+public void setName(String name) {
+this.name = name;
+}
+
+
+Os dois serviços que nosso aplicativo oferece são: persistir uma pessoa, 
recuperando todas as pessoas do banco de dados:
+
+[source,java]
+
+@Singleton
+@Lock(LockType.READ)
+public class PersonDAO {
+
+@PersistenceContext
+private EntityManager em;
+
+public Person save(final String name) {
+final Person person = new Person();
+person.setName(name);
+em.persist(person);
+return person;
+}
+
+public List findAll() {
+return em.createNamedQuery("Person.findAll", 
Person.class).getResultList();
+}
+
+
+A seguir, estamos prontos para expor como um serviço esta lógica de negócios:
+
+[source,java]
+
+@Path("/person")
+@RequestScoped
+public class PersonService {
+
+@Inject
+private PersonDAO dao;
+
+public PersonService() {
+System.out.println();
+}
+
+@GET
+@Path("/create/{name}")
+public Person create(@PathParam("name") final String name) {
+return dao.save(name);
+}
+
+@GET
+@Path("/all")
+public List list() {
+return dao.findAll();
+}
+
+
+Agora que temos uma classe de serviço, definindo os recursos fornecidos pelo 
aplicativo, estendemos a classe `javax.ws.rs.core.Application` e adicionamos 
nosso `PersonService`:
+
+[source,java]
+
+public class JerseyApplication extends Application {
+
+@Override
+public Set> getClasses() {
+final Set> classes = new HashSet>();
+classes.add(PersonService.class);
+return classes;
+}
+}
+
+
+Há mais uma etapa a ser executada para configurar um servlet fornecido por 
Jersey.
+Isso pode ser feito em `webapp/WEB-INF/web.xml`:
+
+[source,xml]
+
+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/web-app_3_0.xsd;
+ version="3.0">
+  
+Jersey Web Application
+
com.sun.jersey.spi.container.servlet.ServletContainer
+
+  javax.ws.rs.Application
+  org.superbiz.service.JerseyApplication
+
+1
+  
+  
+Jersey Web Application
+/*
+  
+
+
+
+The web service is ready to be tested. For this, we will write an unit test 
using http://arquillian.org/[Arquillian]:
+
+[source,java]
+
+@RunWith(Arquillian.class)
+public class JerseyApplicationTest {
+
+@Deployment(testable = false)
+public static WebArchive createDeployment() {
+return ShrinkWrap.create(WebArchive.class, "jersey-application.war")
+.addPackage(JerseyApplication.class.getPackage())
+.addPackage(Person.class.getPackage())
+.addPackage(PersonDAO.class.getPackage())
+.addAsManifestResource(new FileAsset(new 
File("src/main/webapp/WEB-INF/web.xml")), "web.xml")
+.addAsManifestResource(new 
ClassLoaderAsset("META-INF/persistence.xml"), "persistence.xml")
+.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
+}
+
+@ArquillianResource
+private URL webapp;
+
+@Test
+public void test() {
+get("person/create/TestPerson");
+
+String allPersons = get("person/all");
+
+assertTrue(allPersons.contains("TestPerson"));
+}
+
+private String get(String url) {
+final CloseableHttpClient client = HttpClients.custom().build();
+final HttpHost httpHost = new HttpHost(webapp.getHost(), 
webapp.getPort(), webapp.getProtocol());
+final HttpClientContext context = HttpClientContext.create();
+
+final HttpGet get = new HttpGet(webapp.toExternalForm() + url);
+CloseableHttpResponse response = null;
+try {
+response = client.execute(httpHost, get, context);
+return 

[GitHub] [tomee] Daniel-Dos commented on a change in pull request #704: TOMEE-2896 Translate to Portuguese: examples/tomee-jersey-eclipselink

2020-08-11 Thread GitBox


Daniel-Dos commented on a change in pull request #704:
URL: https://github.com/apache/tomee/pull/704#discussion_r468815084



##
File path: examples/tomee-jersey-eclipselink/README_pt.adoc
##
@@ -0,0 +1,188 @@
+= JPA com EclipseLink e Jersey
+:index-group: JPA
+:jbake-type: page
+:jbake-status: published
+
+Neste exemplo, um serviço da web é criado para armazenar e recuperar dados do 
banco de dados.
+https://jersey.github.io/[Jersey] será usado para criar o serviço da web..
+Para o banco de dados, https://www.eclipse.org/eclipselink/[EclipseLink] 
Provedor JPA será usado.

Review comment:
   suggestion : 
   
   Para o banco de dados, o provedor JPA usado será : 
https://www.eclipse.org/eclipselink/[EclipseLink] 





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [tomee] Daniel-Dos commented on a change in pull request #704: TOMEE-2896 Translate to Portuguese: examples/tomee-jersey-eclipselink

2020-08-11 Thread GitBox


Daniel-Dos commented on a change in pull request #704:
URL: https://github.com/apache/tomee/pull/704#discussion_r468813549



##
File path: examples/tomee-jersey-eclipselink/README_pt.adoc
##
@@ -0,0 +1,188 @@
+= JPA com EclipseLink e Jersey
+:index-group: JPA
+:jbake-type: page
+:jbake-status: published
+
+Neste exemplo, um serviço da web é criado para armazenar e recuperar dados do 
banco de dados.
+https://jersey.github.io/[Jersey] será usado para criar o serviço da web..
+Para o banco de dados, https://www.eclipse.org/eclipselink/[EclipseLink] 
Provedor JPA será usado.
+
+O serviço da web irá armazenar e recuperar informações sobre pessoas:
+
+[source,java]
+
+@Entity
+@XmlRootElement
+@NamedQuery(name = "Person.findAll", query = "select p from Person p")
+public class Person {
+
+@Id
+@GeneratedValue
+private long id;
+private String name;
+
+public long getId() {
+return id;
+}
+
+public void setId(long id) {
+this.id = id;
+}
+
+public String getName() {
+return name;
+}
+
+public void setName(String name) {
+this.name = name;
+}
+
+
+Os dois serviços que nosso aplicativo oferece são: persistir uma pessoa, 
recuperando todas as pessoas do banco de dados:
+
+[source,java]
+
+@Singleton
+@Lock(LockType.READ)
+public class PersonDAO {
+
+@PersistenceContext
+private EntityManager em;
+
+public Person save(final String name) {
+final Person person = new Person();
+person.setName(name);
+em.persist(person);
+return person;
+}
+
+public List findAll() {
+return em.createNamedQuery("Person.findAll", 
Person.class).getResultList();
+}
+
+
+A seguir, estamos prontos para expor como um serviço esta lógica de negócios:
+
+[source,java]
+
+@Path("/person")
+@RequestScoped
+public class PersonService {
+
+@Inject
+private PersonDAO dao;
+
+public PersonService() {
+System.out.println();
+}
+
+@GET
+@Path("/create/{name}")
+public Person create(@PathParam("name") final String name) {
+return dao.save(name);
+}
+
+@GET
+@Path("/all")
+public List list() {
+return dao.findAll();
+}
+
+
+Agora que temos uma classe de serviço, definindo os recursos fornecidos pelo 
aplicativo, estendemos a classe `javax.ws.rs.core.Application` e adicionamos 
nosso `PersonService`:
+
+[source,java]
+
+public class JerseyApplication extends Application {
+
+@Override
+public Set> getClasses() {
+final Set> classes = new HashSet>();
+classes.add(PersonService.class);
+return classes;
+}
+}
+
+
+Há mais uma etapa a ser executada para configurar um servlet fornecido por 
Jersey.
+Isso pode ser feito em `webapp/WEB-INF/web.xml`:
+
+[source,xml]
+
+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/web-app_3_0.xsd;
+ version="3.0">
+  
+Jersey Web Application
+
com.sun.jersey.spi.container.servlet.ServletContainer
+
+  javax.ws.rs.Application
+  org.superbiz.service.JerseyApplication
+
+1
+  
+  
+Jersey Web Application
+/*
+  
+
+
+
+The web service is ready to be tested. For this, we will write an unit test 
using http://arquillian.org/[Arquillian]:
+
+[source,java]
+
+@RunWith(Arquillian.class)
+public class JerseyApplicationTest {
+
+@Deployment(testable = false)
+public static WebArchive createDeployment() {
+return ShrinkWrap.create(WebArchive.class, "jersey-application.war")
+.addPackage(JerseyApplication.class.getPackage())
+.addPackage(Person.class.getPackage())
+.addPackage(PersonDAO.class.getPackage())
+.addAsManifestResource(new FileAsset(new 
File("src/main/webapp/WEB-INF/web.xml")), "web.xml")
+.addAsManifestResource(new 
ClassLoaderAsset("META-INF/persistence.xml"), "persistence.xml")
+.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
+}
+
+@ArquillianResource
+private URL webapp;
+
+@Test
+public void test() {
+get("person/create/TestPerson");
+
+String allPersons = get("person/all");
+
+assertTrue(allPersons.contains("TestPerson"));
+}
+
+private String get(String url) {
+final CloseableHttpClient client = HttpClients.custom().build();
+final HttpHost httpHost = new HttpHost(webapp.getHost(), 
webapp.getPort(), webapp.getProtocol());
+final HttpClientContext context = HttpClientContext.create();
+
+final HttpGet get = new HttpGet(webapp.toExternalForm() + url);
+CloseableHttpResponse response = null;
+try {
+response = client.execute(httpHost, get, context);
+return 

[GitHub] [tomee] Daniel-Dos commented on a change in pull request #704: TOMEE-2896 Translate to Portuguese: examples/tomee-jersey-eclipselink

2020-08-11 Thread GitBox


Daniel-Dos commented on a change in pull request #704:
URL: https://github.com/apache/tomee/pull/704#discussion_r468811950



##
File path: examples/tomee-jersey-eclipselink/README_pt.adoc
##
@@ -0,0 +1,188 @@
+= JPA com EclipseLink e Jersey
+:index-group: JPA
+:jbake-type: page
+:jbake-status: published
+
+Neste exemplo, um serviço da web é criado para armazenar e recuperar dados do 
banco de dados.
+https://jersey.github.io/[Jersey] será usado para criar o serviço da web..
+Para o banco de dados, https://www.eclipse.org/eclipselink/[EclipseLink] 
Provedor JPA será usado.
+
+O serviço da web irá armazenar e recuperar informações sobre pessoas:
+
+[source,java]
+
+@Entity
+@XmlRootElement
+@NamedQuery(name = "Person.findAll", query = "select p from Person p")
+public class Person {
+
+@Id
+@GeneratedValue
+private long id;
+private String name;
+
+public long getId() {
+return id;
+}
+
+public void setId(long id) {
+this.id = id;
+}
+
+public String getName() {
+return name;
+}
+
+public void setName(String name) {
+this.name = name;
+}
+
+
+Os dois serviços que nosso aplicativo oferece são: persistir uma pessoa, 
recuperando todas as pessoas do banco de dados:
+
+[source,java]
+
+@Singleton
+@Lock(LockType.READ)
+public class PersonDAO {
+
+@PersistenceContext
+private EntityManager em;
+
+public Person save(final String name) {
+final Person person = new Person();
+person.setName(name);
+em.persist(person);
+return person;
+}
+
+public List findAll() {
+return em.createNamedQuery("Person.findAll", 
Person.class).getResultList();
+}
+
+
+A seguir, estamos prontos para expor como um serviço esta lógica de negócios:
+
+[source,java]
+
+@Path("/person")
+@RequestScoped
+public class PersonService {
+
+@Inject
+private PersonDAO dao;
+
+public PersonService() {
+System.out.println();
+}
+
+@GET
+@Path("/create/{name}")
+public Person create(@PathParam("name") final String name) {
+return dao.save(name);
+}
+
+@GET
+@Path("/all")
+public List list() {
+return dao.findAll();
+}
+
+
+Agora que temos uma classe de serviço, definindo os recursos fornecidos pelo 
aplicativo, estendemos a classe `javax.ws.rs.core.Application` e adicionamos 
nosso `PersonService`:
+
+[source,java]
+
+public class JerseyApplication extends Application {
+
+@Override
+public Set> getClasses() {
+final Set> classes = new HashSet>();
+classes.add(PersonService.class);
+return classes;
+}
+}
+
+
+Há mais uma etapa a ser executada para configurar um servlet fornecido por 
Jersey.
+Isso pode ser feito em `webapp/WEB-INF/web.xml`:
+
+[source,xml]
+
+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/web-app_3_0.xsd;
+ version="3.0">
+  
+Jersey Web Application
+
com.sun.jersey.spi.container.servlet.ServletContainer
+
+  javax.ws.rs.Application
+  org.superbiz.service.JerseyApplication
+
+1
+  
+  
+Jersey Web Application
+/*
+  
+
+
+
+The web service is ready to be tested. For this, we will write an unit test 
using http://arquillian.org/[Arquillian]:
+
+[source,java]
+
+@RunWith(Arquillian.class)
+public class JerseyApplicationTest {
+
+@Deployment(testable = false)
+public static WebArchive createDeployment() {
+return ShrinkWrap.create(WebArchive.class, "jersey-application.war")
+.addPackage(JerseyApplication.class.getPackage())
+.addPackage(Person.class.getPackage())
+.addPackage(PersonDAO.class.getPackage())
+.addAsManifestResource(new FileAsset(new 
File("src/main/webapp/WEB-INF/web.xml")), "web.xml")
+.addAsManifestResource(new 
ClassLoaderAsset("META-INF/persistence.xml"), "persistence.xml")
+.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
+}
+
+@ArquillianResource
+private URL webapp;
+
+@Test
+public void test() {
+get("person/create/TestPerson");
+
+String allPersons = get("person/all");
+
+assertTrue(allPersons.contains("TestPerson"));
+}
+
+private String get(String url) {
+final CloseableHttpClient client = HttpClients.custom().build();
+final HttpHost httpHost = new HttpHost(webapp.getHost(), 
webapp.getPort(), webapp.getProtocol());
+final HttpClientContext context = HttpClientContext.create();
+
+final HttpGet get = new HttpGet(webapp.toExternalForm() + url);
+CloseableHttpResponse response = null;
+try {
+response = client.execute(httpHost, get, context);
+return 

[GitHub] [tomee] Daniel-Dos commented on a change in pull request #704: TOMEE-2896 Translate to Portuguese: examples/tomee-jersey-eclipselink

2020-08-11 Thread GitBox


Daniel-Dos commented on a change in pull request #704:
URL: https://github.com/apache/tomee/pull/704#discussion_r468811540



##
File path: examples/tomee-jersey-eclipselink/README_pt.adoc
##
@@ -0,0 +1,188 @@
+= JPA com EclipseLink e Jersey
+:index-group: JPA
+:jbake-type: page
+:jbake-status: published
+
+Neste exemplo, um serviço da web é criado para armazenar e recuperar dados do 
banco de dados.
+https://jersey.github.io/[Jersey] será usado para criar o serviço da web..
+Para o banco de dados, https://www.eclipse.org/eclipselink/[EclipseLink] 
Provedor JPA será usado.
+
+O serviço da web irá armazenar e recuperar informações sobre pessoas:
+
+[source,java]
+
+@Entity
+@XmlRootElement
+@NamedQuery(name = "Person.findAll", query = "select p from Person p")
+public class Person {
+
+@Id
+@GeneratedValue
+private long id;
+private String name;
+
+public long getId() {
+return id;
+}
+
+public void setId(long id) {
+this.id = id;
+}
+
+public String getName() {
+return name;
+}
+
+public void setName(String name) {
+this.name = name;
+}
+
+
+Os dois serviços que nosso aplicativo oferece são: persistir uma pessoa, 
recuperando todas as pessoas do banco de dados:
+
+[source,java]
+
+@Singleton
+@Lock(LockType.READ)
+public class PersonDAO {
+
+@PersistenceContext
+private EntityManager em;
+
+public Person save(final String name) {
+final Person person = new Person();
+person.setName(name);
+em.persist(person);
+return person;
+}
+
+public List findAll() {
+return em.createNamedQuery("Person.findAll", 
Person.class).getResultList();
+}
+
+
+A seguir, estamos prontos para expor como um serviço esta lógica de negócios:
+
+[source,java]
+
+@Path("/person")
+@RequestScoped
+public class PersonService {
+
+@Inject
+private PersonDAO dao;
+
+public PersonService() {
+System.out.println();
+}
+
+@GET
+@Path("/create/{name}")
+public Person create(@PathParam("name") final String name) {
+return dao.save(name);
+}
+
+@GET
+@Path("/all")
+public List list() {
+return dao.findAll();
+}
+
+
+Agora que temos uma classe de serviço, definindo os recursos fornecidos pelo 
aplicativo, estendemos a classe `javax.ws.rs.core.Application` e adicionamos 
nosso `PersonService`:
+
+[source,java]
+
+public class JerseyApplication extends Application {
+
+@Override
+public Set> getClasses() {
+final Set> classes = new HashSet>();
+classes.add(PersonService.class);
+return classes;
+}
+}
+
+
+Há mais uma etapa a ser executada para configurar um servlet fornecido por 
Jersey.
+Isso pode ser feito em `webapp/WEB-INF/web.xml`:
+
+[source,xml]
+
+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/web-app_3_0.xsd;
+ version="3.0">
+  
+Jersey Web Application
+
com.sun.jersey.spi.container.servlet.ServletContainer
+
+  javax.ws.rs.Application
+  org.superbiz.service.JerseyApplication
+
+1
+  
+  
+Jersey Web Application
+/*
+  
+
+
+
+The web service is ready to be tested. For this, we will write an unit test 
using http://arquillian.org/[Arquillian]:
+
+[source,java]
+
+@RunWith(Arquillian.class)
+public class JerseyApplicationTest {
+
+@Deployment(testable = false)
+public static WebArchive createDeployment() {
+return ShrinkWrap.create(WebArchive.class, "jersey-application.war")
+.addPackage(JerseyApplication.class.getPackage())
+.addPackage(Person.class.getPackage())
+.addPackage(PersonDAO.class.getPackage())
+.addAsManifestResource(new FileAsset(new 
File("src/main/webapp/WEB-INF/web.xml")), "web.xml")
+.addAsManifestResource(new 
ClassLoaderAsset("META-INF/persistence.xml"), "persistence.xml")
+.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
+}
+
+@ArquillianResource
+private URL webapp;
+
+@Test
+public void test() {
+get("person/create/TestPerson");
+
+String allPersons = get("person/all");
+
+assertTrue(allPersons.contains("TestPerson"));
+}
+
+private String get(String url) {
+final CloseableHttpClient client = HttpClients.custom().build();
+final HttpHost httpHost = new HttpHost(webapp.getHost(), 
webapp.getPort(), webapp.getProtocol());
+final HttpClientContext context = HttpClientContext.create();
+
+final HttpGet get = new HttpGet(webapp.toExternalForm() + url);
+CloseableHttpResponse response = null;
+try {
+response = client.execute(httpHost, get, context);
+return 

[GitHub] [tomee] Daniel-Dos commented on a change in pull request #704: TOMEE-2896 Translate to Portuguese: examples/tomee-jersey-eclipselink

2020-08-11 Thread GitBox


Daniel-Dos commented on a change in pull request #704:
URL: https://github.com/apache/tomee/pull/704#discussion_r468810096



##
File path: examples/tomee-jersey-eclipselink/README_pt.adoc
##
@@ -0,0 +1,188 @@
+= JPA com EclipseLink e Jersey
+:index-group: JPA
+:jbake-type: page
+:jbake-status: published
+
+Neste exemplo, um serviço da web é criado para armazenar e recuperar dados do 
banco de dados.
+https://jersey.github.io/[Jersey] será usado para criar o serviço da web..
+Para o banco de dados, https://www.eclipse.org/eclipselink/[EclipseLink] 
Provedor JPA será usado.
+
+O serviço da web irá armazenar e recuperar informações sobre pessoas:
+
+[source,java]
+
+@Entity
+@XmlRootElement
+@NamedQuery(name = "Person.findAll", query = "select p from Person p")
+public class Person {
+
+@Id
+@GeneratedValue
+private long id;
+private String name;
+
+public long getId() {
+return id;
+}
+
+public void setId(long id) {
+this.id = id;
+}
+
+public String getName() {
+return name;
+}
+
+public void setName(String name) {
+this.name = name;
+}
+
+
+Os dois serviços que nosso aplicativo oferece são: persistir uma pessoa, 
recuperando todas as pessoas do banco de dados:
+
+[source,java]
+
+@Singleton
+@Lock(LockType.READ)
+public class PersonDAO {
+
+@PersistenceContext
+private EntityManager em;
+
+public Person save(final String name) {
+final Person person = new Person();
+person.setName(name);
+em.persist(person);
+return person;
+}
+
+public List findAll() {
+return em.createNamedQuery("Person.findAll", 
Person.class).getResultList();
+}
+
+
+A seguir, estamos prontos para expor como um serviço esta lógica de negócios:
+
+[source,java]
+
+@Path("/person")
+@RequestScoped
+public class PersonService {
+
+@Inject
+private PersonDAO dao;
+
+public PersonService() {
+System.out.println();
+}
+
+@GET
+@Path("/create/{name}")
+public Person create(@PathParam("name") final String name) {
+return dao.save(name);
+}
+
+@GET
+@Path("/all")
+public List list() {
+return dao.findAll();
+}
+
+
+Agora que temos uma classe de serviço, definindo os recursos fornecidos pelo 
aplicativo, estendemos a classe `javax.ws.rs.core.Application` e adicionamos 
nosso `PersonService`:
+
+[source,java]
+
+public class JerseyApplication extends Application {
+
+@Override
+public Set> getClasses() {
+final Set> classes = new HashSet>();
+classes.add(PersonService.class);
+return classes;
+}
+}
+
+
+Há mais uma etapa a ser executada para configurar um servlet fornecido por 
Jersey.
+Isso pode ser feito em `webapp/WEB-INF/web.xml`:
+
+[source,xml]
+
+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/web-app_3_0.xsd;
+ version="3.0">
+  
+Jersey Web Application
+
com.sun.jersey.spi.container.servlet.ServletContainer
+
+  javax.ws.rs.Application
+  org.superbiz.service.JerseyApplication
+
+1
+  
+  
+Jersey Web Application
+/*
+  
+
+
+
+The web service is ready to be tested. For this, we will write an unit test 
using http://arquillian.org/[Arquillian]:

Review comment:
   translate here.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [tomee] Daniel-Dos commented on pull request #699: TOMEE-2892 Add Spanish Translation: injection-of-entitymanager

2020-08-11 Thread GitBox


Daniel-Dos commented on pull request #699:
URL: https://github.com/apache/tomee/pull/699#issuecomment-672205185


   thanks @emecas for translate : )



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [tomee] Daniel-Dos merged pull request #699: TOMEE-2892 Add Spanish Translation: injection-of-entitymanager

2020-08-11 Thread GitBox


Daniel-Dos merged pull request #699:
URL: https://github.com/apache/tomee/pull/699


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [tomee] Daniel-Dos commented on pull request #697: TOMEE-2889 Translate to Portuguese: examples/realm-in-tomee

2020-08-11 Thread GitBox


Daniel-Dos commented on pull request #697:
URL: https://github.com/apache/tomee/pull/697#issuecomment-672201151


   thanks @gabrielbussolo  for review.



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [tomee] Daniel-Dos merged pull request #697: TOMEE-2889 Translate to Portuguese: examples/realm-in-tomee

2020-08-11 Thread GitBox


Daniel-Dos merged pull request #697:
URL: https://github.com/apache/tomee/pull/697


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




Re: How can I help

2020-08-11 Thread Cesar Hernandez
Hi José,

Welcome!
The following is a crosspost of latest activity:

We have prepared some materials to help people like you who are new to
TomEE at the following link:
http://tomee.apache.org/community/contributing/contribution-tips.html

There are a couple of items for you to choose from:

- Documentation translation is a great opportunity for new contributions.
Check for instance these tickets:
Portuguese:https://issues.apache.org/jira/browse/TOMEE-2473
Spanish: https://issues.apache.org/jira/browse/TOMEE-2442
Additional TomEE website development resources:
https://www.tomitribe.com/blog/how-to-contribute-to-the-tomee-website/

- When you are ready you can go to JIRA and look through the various tickets
that are still unassigned. Feel free to ask as many questions as you like
in the mailing list before, during, and after your first contribution!

https://issues.apache.org/jira/projects/TOMEE/issues/TOMEE-2496?filter=allopenissues

The recent work in progress:

 - Jakarta EE 8 compliance: Immediate: some help getting people to know how
to run the TCK. Long-term: help fixing tests

 - Jakarta EE 9 compliance: Immediate: help kicking the tires on the
prototype 'jakarta' TomEE server; i.e. writing apps that use
jakarta.ws.rs.Post, jakarta.persistence.Entity, etc and report issues.

 - User list: there might be some questions you know the answers to.

Base on your email it seems you gain experience migrating your application
from javax to jakarta namespace, that is a green field in terms of examples
and documentation that you can also contribute:

Let us know what kind of things sounds interesting and we'll see what might
fit.



El mar., 11 ago. 2020 a las 7:54, José Fernando Málaga Cardoza (<
malag...@tcd.ie>) escribió:

> Hi guys,
>
> I have been using TomEE mainly as a way to learn and to practice working
> with JavaEE. Recently I downloaded the 9.0.0 version and had some issues
> getting an old project to work on it. After lots of work and reading the
> comment in the downloads section I saw my issue and that is what made me
> decide to try and help TomEE. I am currently working as a software
> developer in Zurich and have been working with Java for 5 years now and
> most of the time I have worked with JavaEE or Spring.
>
> I guess my main area of interest is in working with online technologies so
> if I could contribute there, that would be a plus.
>
> Best regards,
> Jose Fernando
>


-- 
Atentamente:
César Hernández.


Re: Making Antora actionable

2020-08-11 Thread David Jencks
David Blevins and I had a long chat about the history of OpenEJB/TomEE 
documentation and I have a considerably different perspective now on the best 
way forward.  I’d say the most fundamental shift is my realizing that even if 
doing everything with Antora is the most elegant and efficient solution, it may 
not be appropriate for TomEE because it involves extending the doc build system 
with javascript, whereas TomEE developers are more likely to be comfortable 
with java.  Learning a new language in order to improve or even understand the 
doc build is too big a barrier.  I’m likely to continue to see how, for 
instance, “marketing pages” and the tricks in the examples can be implemented 
in Antora, but because I want to learn how to do those things rather than 
because they are appropriate to use in TomEE.

I think the following steps make sense:

- versioned doc consolidation: There are now 5 copies of the “tomee” versioned 
docs; one in common, and 4 identical copies done by asciidoc includes.  Looking 
at one of these includes, it’s not very obvious how to edit the page, and 
certainly having one copy in ‘common’ is silly.  So, the “originals” should be 
moved to one of the versions.  The obvious choices are 7.0.x and 8.0.x.  7 
might make it more obvious that changing the doc will change all 4 versions, 
but development is most convenient on master, 8.0.  To make it easiest to 
locate the actual source, I’ll move the ‘original’ to 8.0.  I hope that there 
will be a period of organization and improvement of the existing content 
followed by writing new content.  After reorganization has settled down it may 
make sense to replace the “include” copies with one or two actual copies in the 
7.0.x and 7.1.x branches so changes in master won’t inadvertently affect older 
versions.

- common doc consolidation.  The pages that show up in the common component 
come from two repos: tomee-site-generator and tomee-site.  I don’t think it’s a 
good idea to have content in the same repo as site generator code, so I’m 
planning to  move the content in tomee-site-generator to tomee-site.  David 
said something indicating that this may not be an appropriate location, so 
perhaps a new repo would be appropriate…. I’ll investigate.  Also, this content 
includes all the stuff that was previously in CMS and not served by the current 
site build.  It’s apt to need a lot of editing, consolidation, etc, and it’s 
possible that this entire component should not be produced by Antora.  However, 
at the moment, the only place all the content is accessible for consideration 
is in the Antora build, so I propose we leave it there for now, organize it, 
and consider what to do with it afterwards.  One possibility, since Antora 
deals well with multiple versions, is to have something similar to the current 
common content minus the doc pages mentioned above as a “historical content” 
component version with the “current common” component version redirect to 
elsewhere.

- examples.  I’ve accumulated a pile of asciidoc fixes for the READMEs and I’ll 
see about getting them back to the master branch.

- source directory structure.  David pointed out that the shorter the path to 
the actual adoc files the more likely people are to find them…. I’ll see how 
much the path can be shortened.

- publishing.  It’s very tempting to work hard to create a highly unified site 
where the Antora and non-antora pieces are indistinguishable, however that may 
not be the best plan here.  One of the persistent problems with documentation 
is that no one likes to work on it.  Any complexity or difficulty is likely to 
deter people from contributing.  A unified site would need a way for all the 
pieces of the site build to not step on each other, which could be hard to 
maintain.  It may well be simpler to have two sites, one containing the front 
page, “marketing material”, possibly eventually the “common” component, the 
examples, and the other the Antora generated docs.  This requires more 
investigation but the two-site approach is very attractive as reducing 
“friction”.


Possibly this can lead quickly to actually getting the Antora portion of the 
site published soon.

Thanks,
David Jencks


> On Aug 10, 2020, at 1:44 PM, David Jencks  wrote:
> 
> The reason Antora has a separate front page is that Dan didn’t write 
> asciidoctor-openblock . 
> Since I did, it’s easy to have a front page generated by Antora. He’s known 
> about this possibility for at least  5 years, but never found the time or 
> motivation to do it.
> 
> If you have specific complaints about the front page I wrote, please air them 
> rather than ignoring my request for feedback.
> 
> Could you be extremely specific about what you want generated by Antora and 
> what by tomee-site-generator and what by some other unnamed tool?  Are there 
> parts of the current antora preview site that you think should not be 
> generated by 

Re: [VOTE] Missing artifact - TomEE 8.0.4

2020-08-11 Thread Cesar Hernandez
+1

On Tue, Aug 11, 2020 at 06:49 Daniel Dias Dos Santos <
daniel.dias.analist...@gmail.com> wrote:

> +1
> --
>
> *Daniel Dias dos Santos*
> Java Developer
> SouJava & JCP Member
> GitHub: https://github.com/Daniel-Dos
> Linkedin: www.linkedin.com/in/danieldiasjava
> Twitter: http://twitter.com/danieldiasjava
>
>
> Em ter., 11 de ago. de 2020 às 06:53, Zowalla, Richard <
> richard.zowa...@hs-heilbronn.de> escreveu:
>
> > +1
> >
> > Am Dienstag, den 11.08.2020, 09:58 +0100 schrieb Jonathan Gallimore:
> > > Hi All,
> > >
> > > We're missing an artifact on our download page for TomEE 8.0.4
> > > Webprofile
> > > (thanks Richard Zowalla for pointing this out).
> > >
> > > This is already in Maven:
> > > https://repo1.maven.org/maven2/org/apache/tomee/apache-tomee/8.0.4/,
> > > but
> > > was missed in the staging directory for the vote, and hence is
> > > missing from
> > > the promotion to the website.
> > >
> > > I don't know if a vote is needed to add the missing artifact, but I
> > > think
> > > it covers us well to have one anyway. Here's the reference to the
> > > original
> > > vote:
> > >
> > >
> >
> https://lists.apache.org/thread.html/r5d6b2fe8998da647fdcf405ab721e6f882d40f271b9a92527257bd45%40%3Cdev.tomee.apache.org%3E
> > >
> > > I've added the missing artifacts to the staging area here:
> > > https://dist.apache.org/repos/dist/dev/tomee/staging-1173/tomee-8.0.4/
> > >
> > > Please VOTE:
> > >
> > > [+1] Yes, release it
> > > [+0] Not fussed
> > > [-1] Don't release, there's a showstopper (please specify what the
> > > showstopper is)
> > >
> > > Vote will be open for 72 hours.
> > >
> > > Thanks
> > >
> > > Jon
> >
>
-- 
Atentamente:
César Hernández.


How can I help

2020-08-11 Thread José Fernando Málaga Cardoza
Hi guys,

I have been using TomEE mainly as a way to learn and to practice working
with JavaEE. Recently I downloaded the 9.0.0 version and had some issues
getting an old project to work on it. After lots of work and reading the
comment in the downloads section I saw my issue and that is what made me
decide to try and help TomEE. I am currently working as a software
developer in Zurich and have been working with Java for 5 years now and
most of the time I have worked with JavaEE or Spring.

I guess my main area of interest is in working with online technologies so
if I could contribute there, that would be a plus.

Best regards,
Jose Fernando


Re: [VOTE] Missing artifact - TomEE 8.0.4

2020-08-11 Thread Daniel Dias Dos Santos
+1
--

*Daniel Dias dos Santos*
Java Developer
SouJava & JCP Member
GitHub: https://github.com/Daniel-Dos
Linkedin: www.linkedin.com/in/danieldiasjava
Twitter: http://twitter.com/danieldiasjava


Em ter., 11 de ago. de 2020 às 06:53, Zowalla, Richard <
richard.zowa...@hs-heilbronn.de> escreveu:

> +1
>
> Am Dienstag, den 11.08.2020, 09:58 +0100 schrieb Jonathan Gallimore:
> > Hi All,
> >
> > We're missing an artifact on our download page for TomEE 8.0.4
> > Webprofile
> > (thanks Richard Zowalla for pointing this out).
> >
> > This is already in Maven:
> > https://repo1.maven.org/maven2/org/apache/tomee/apache-tomee/8.0.4/,
> > but
> > was missed in the staging directory for the vote, and hence is
> > missing from
> > the promotion to the website.
> >
> > I don't know if a vote is needed to add the missing artifact, but I
> > think
> > it covers us well to have one anyway. Here's the reference to the
> > original
> > vote:
> >
> >
> https://lists.apache.org/thread.html/r5d6b2fe8998da647fdcf405ab721e6f882d40f271b9a92527257bd45%40%3Cdev.tomee.apache.org%3E
> >
> > I've added the missing artifacts to the staging area here:
> > https://dist.apache.org/repos/dist/dev/tomee/staging-1173/tomee-8.0.4/
> >
> > Please VOTE:
> >
> > [+1] Yes, release it
> > [+0] Not fussed
> > [-1] Don't release, there's a showstopper (please specify what the
> > showstopper is)
> >
> > Vote will be open for 72 hours.
> >
> > Thanks
> >
> > Jon
>


Re: [VOTE] Missing artifact - TomEE 8.0.4

2020-08-11 Thread Zowalla, Richard
+1

Am Dienstag, den 11.08.2020, 09:58 +0100 schrieb Jonathan Gallimore:
> Hi All,
> 
> We're missing an artifact on our download page for TomEE 8.0.4
> Webprofile
> (thanks Richard Zowalla for pointing this out).
> 
> This is already in Maven:
> https://repo1.maven.org/maven2/org/apache/tomee/apache-tomee/8.0.4/,
> but
> was missed in the staging directory for the vote, and hence is
> missing from
> the promotion to the website.
> 
> I don't know if a vote is needed to add the missing artifact, but I
> think
> it covers us well to have one anyway. Here's the reference to the
> original
> vote:
> 
> https://lists.apache.org/thread.html/r5d6b2fe8998da647fdcf405ab721e6f882d40f271b9a92527257bd45%40%3Cdev.tomee.apache.org%3E
> 
> I've added the missing artifacts to the staging area here:
> https://dist.apache.org/repos/dist/dev/tomee/staging-1173/tomee-8.0.4/
> 
> Please VOTE:
> 
> [+1] Yes, release it
> [+0] Not fussed
> [-1] Don't release, there's a showstopper (please specify what the
> showstopper is)
> 
> Vote will be open for 72 hours.
> 
> Thanks
> 
> Jon


smime.p7s
Description: S/MIME cryptographic signature


Re: [VOTE] Missing artifact - TomEE 8.0.4

2020-08-11 Thread Jean-Louis Monteiro
Don't think we need, but I'm still +1
--
Jean-Louis Monteiro
http://twitter.com/jlouismonteiro
http://www.tomitribe.com


On Tue, Aug 11, 2020 at 10:58 AM Jonathan Gallimore <
jonathan.gallim...@gmail.com> wrote:

> Hi All,
>
> We're missing an artifact on our download page for TomEE 8.0.4 Webprofile
> (thanks Richard Zowalla for pointing this out).
>
> This is already in Maven:
> https://repo1.maven.org/maven2/org/apache/tomee/apache-tomee/8.0.4/, but
> was missed in the staging directory for the vote, and hence is missing from
> the promotion to the website.
>
> I don't know if a vote is needed to add the missing artifact, but I think
> it covers us well to have one anyway. Here's the reference to the original
> vote:
>
>
> https://lists.apache.org/thread.html/r5d6b2fe8998da647fdcf405ab721e6f882d40f271b9a92527257bd45%40%3Cdev.tomee.apache.org%3E
>
> I've added the missing artifacts to the staging area here:
> https://dist.apache.org/repos/dist/dev/tomee/staging-1173/tomee-8.0.4/
>
> Please VOTE:
>
> [+1] Yes, release it
> [+0] Not fussed
> [-1] Don't release, there's a showstopper (please specify what the
> showstopper is)
>
> Vote will be open for 72 hours.
>
> Thanks
>
> Jon
>


[VOTE] Missing artifact - TomEE 8.0.4

2020-08-11 Thread Jonathan Gallimore
Hi All,

We're missing an artifact on our download page for TomEE 8.0.4 Webprofile
(thanks Richard Zowalla for pointing this out).

This is already in Maven:
https://repo1.maven.org/maven2/org/apache/tomee/apache-tomee/8.0.4/, but
was missed in the staging directory for the vote, and hence is missing from
the promotion to the website.

I don't know if a vote is needed to add the missing artifact, but I think
it covers us well to have one anyway. Here's the reference to the original
vote:

https://lists.apache.org/thread.html/r5d6b2fe8998da647fdcf405ab721e6f882d40f271b9a92527257bd45%40%3Cdev.tomee.apache.org%3E

I've added the missing artifacts to the staging area here:
https://dist.apache.org/repos/dist/dev/tomee/staging-1173/tomee-8.0.4/

Please VOTE:

[+1] Yes, release it
[+0] Not fussed
[-1] Don't release, there's a showstopper (please specify what the
showstopper is)

Vote will be open for 72 hours.

Thanks

Jon