Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Commit

Permalink
Cleaned up pom.xml and fixed AsciiDoctor warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Guillermo González de Agüero <z06.guillermo@gmail.com>
  • Loading branch information
ggam committed Apr 26, 2020
1 parent d65ebfb commit 3f2fb02
Show file tree
Hide file tree
Showing 19 changed files with 186 additions and 450 deletions.
135 changes: 1 addition & 134 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,7 @@

<properties>
<maven.site.skip>true</maven.site.skip>
<asciidoctor.maven.plugin.version>1.5.7.1</asciidoctor.maven.plugin.version>
<!-- XXX - jbake needs an older version than this -->
<asciidoctorj.version>1.6.2</asciidoctorj.version>
<asciidoctorj.pdf.version>1.5.0-alpha.16</asciidoctorj.pdf.version>
<jruby.version>9.2.6.0</jruby.version>
<!-- status: DRAFT, BETA, etc., or blank for final -->
<status>DRAFT</status>
<asciidoctor.maven.plugin.version>2.0.0-RC.1</asciidoctor.maven.plugin.version>
</properties>
<scm>
<connection>scm:git:git@github.com:eclipse-ee4j/jakartaee-tutorial.git</connection>
Expand All @@ -53,101 +47,10 @@
<build>
<defaultGoal>package</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<id>enforce-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireJavaVersion>
<version>[1.8.0,1.9.0)</version>
<message>You need JDK8 or lower</message>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<!--<plugin>
<groupId>org.glassfish.doc</groupId>
<artifactId>glassfish-doc-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-toc</id>
<phase>generate-resources</phase>
<goals>
<goal>toc</goal>
</goals>
<configuration>
<chapterPatterns>
[0-9]+\s.*,Preface.*,Part\s.*
</chapterPatterns>
<ignoreTagPatterns>JEET.*</ignoreTagPatterns>
</configuration>
</execution>
<execution>
<id>generate-book</id>
<phase>generate-resources</phase>
<goals>
<goal>book</goal>
</goals>
</execution>
</executions>
</plugin>-->
<!--<plugin>
<groupId>com.blazebit</groupId>
<artifactId>jbake-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<outputDirectory>${site.output.dir}</outputDirectory>
<properties>
<status>${status}</status>
</properties>
</configuration>
<executions>
<execution>
<id>build-site</id>
<phase>generate-resources</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj</artifactId>
<version>1.5.5</version>
</dependency>
</dependencies>
</plugin>-->
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>${asciidoctor.maven.plugin.version}</version>
<dependencies>
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-complete</artifactId>
<version>${jruby.version}</version>
</dependency>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj</artifactId>
<version>${asciidoctorj.version}</version>
</dependency>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj-pdf</artifactId>
<version>${asciidoctorj.pdf.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>asciidoc-to-html</id>
Expand Down Expand Up @@ -194,43 +97,7 @@
</dependency>
</dependencies>
</plugin>

<!--
This is the rule that builds the zip file for download.
-->
<!--<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<inherited>false</inherited>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>tutorial.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>-->
</plugins>

<pluginManagement>
<plugins>
<plugin>
<groupId>org.glassfish.doc</groupId>
<artifactId>glassfish-doc-maven-plugin</artifactId>
<version>1.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
</plugin>
</plugins>
</pluginManagement>
</build>

<profiles>
Expand Down
30 changes: 8 additions & 22 deletions src/main/asciidoc/batch-processing/batch-processing002.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,14 @@ Java classes to run the jobs in a batch application.
The process for creating a batch application in Jakarta EE is the
following.

1. Design the batch application.
1. Identify the input sources, the format of the input data, the
desired final result, and the required processing phases.
2. Organize the application as a job with chunk-oriented steps,
task-oriented steps, and decision elements. Determine the dependencies
between them.
3. Determine the order of execution in terms of transitions between
steps.
4. Identify steps that can run in parallel and steps that can run in
more than one thread.
2. Create the batch artifacts as Java classes by implementing the
interfaces specified by the framework for steps, decision elements, and
so on. These Java classes contain the code to read data from input
sources, format items, process items, and store results. Batch artifacts
can access context objects from the batch runtime using dependency
injection.
3. Define jobs, steps, and their execution flow in XML files using the
Job Specification Language. The elements in the XML files reference
batch artifacts implemented as Java classes. The batch artifacts can
access properties declared in the XML files, such as names of files and
databases.
4. Use the Java API provided by the batch runtime to launch the batch
. Design the batch application.
.. Identify the input sources, the format of the input data, the desired final result, and the required processing phases.
.. Organize the application as a job with chunk-oriented steps, task-oriented steps, and decision elements. Determine the dependencies between them.
.. Determine the order of execution in terms of transitions between steps.
.. Identify steps that can run in parallel and steps that can run in more than one thread.
. Create the batch artifacts as Java classes by implementing the interfaces specified by the framework for steps, decision elements, and so on. These Java classes contain the code to read data from input sources, format items, process items, and store results. Batch artifacts can access context objects from the batch runtime using dependency injection.
. Define jobs, steps, and their execution flow in XML files using the Job Specification Language. The elements in the XML files reference batch artifacts implemented as Java classes. The batch artifacts can access properties declared in the XML files, such as names of files and databases.
. Use the Java API provided by the batch runtime to launch the batch
application.

The following sections describe in detail how to use the components of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ public String doSomething(String param1, String param2) { ... }
In the preceding example, the target is set to the return value of the
method.

==== Implementing Temporal Constraints Using ClockProvider

[[implementing-temporal-constraints-using-clockprovider]]

==== Implementing Temporal Constraints Using ClockProvider

In Jakarta Bean Validation 2.0, a Clock instance is available for validator implementations to validate any temporal date or time based constraints.
[source,java]
----
Expand Down Expand Up @@ -140,9 +140,9 @@ public class CustomConstraintValidator implements ConstraintValidator<CustomCons
----
See ClockProvider in `https://jakarta.ee/specifications/platform/8/apidocs/`.

[[custom-constraints]]
==== Custom Constraints

[[custom-constraints]]
Consider an employee in a firm located in U.S.A. When you register the phone number of an employee or modify the phone number, the phone number needs to be validated to ensure that the phone number conforms to US phone number pattern.
[source,java]
----
Expand All @@ -167,8 +167,10 @@ public class Employee extends Person {
The constraint definition `@USPhoneNumber` is define in the sample listed under link:#GKAIA[Using the Built-In Constraints to Make a New Constraint].
In the sample, another constraint `@Pattern` is used to validate the phone number.

==== Using In-Built Value Extractors in Custom Containers
[[using-in-built-value-extractors-in-custom-containers]]

==== Using In-Built Value Extractors in Custom Containers

Cascading validation:

Bean Validation supports cascading validation for various entities. You can specify `@Valid` on a member of the object that is validated to ensure that the member is also validated in a cascading fashion. You can validate type arguments, for example, parameterized types and its members if the members have the specified `@Valid` annotation.
Expand Down
18 changes: 7 additions & 11 deletions src/main/asciidoc/ejb-gettingstarted/ejb-gettingstarted003.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,20 @@ the exchange rate in the `dollarToYen` business method of the

To modify `ConverterServlet`, the procedure is the same.

1. Edit `ConverterBean.java` and save the file.
2. Recompile the source file.
* To recompile `ConverterBean.java` in NetBeans IDE, right-click the
. Edit `ConverterBean.java` and save the file.
. Recompile the source file.
.. To recompile `ConverterBean.java` in NetBeans IDE, right-click the
`converter` project and select Run.
+
This recompiles the `ConverterBean.java` file, replaces the old class
file in the build directory, and redeploys the application to GlassFish
Server.
* Recompile `ConverterBean.java` using Maven.
1. In a terminal window, go to the
This recompiles the `ConverterBean.java` file, replaces the old class file in the build directory, and redeploys the application to GlassFish Server.
.. Recompile `ConverterBean.java` using Maven.
... In a terminal window, go to the
tut-install`/examples/ejb/converter/` directory.
2. Enter the following command:
... Enter the following command:
+
[source,java]
----
mvn install
----
+
This command repackages and deploys the application.


53 changes: 16 additions & 37 deletions src/main/asciidoc/jaxrs/jaxrs003.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,15 @@ The following topics are addressed here:

====== To Create a RESTful Web Service Using NetBeans IDE

1. Ensure you have installed the tutorial archetypes as described in
link:#CHDJGCCA[Installing the Tutorial Archetypes].
2. In NetBeans IDE, create a simple web application using the
`jaxrs-service-archetype` Maven archetype. This archetype creates a very
simple "Hello, World" web application.
1. From the File menu, choose New Project.
2. From Categories, select Maven. From Projects, select Project From
Archetype. Click Next.
3. Under Search enter `jaxrs-service`, select the
`jaxrs-service-archetype`, and click Next.
4. Under Project Name enter `HelloWorldApplication`, set the Project
Location, and set the Package name to `jakarta.tutorial.hello`, and click
Finish.
. Ensure you have installed the tutorial archetypes as described in link:#CHDJGCCA[Installing the Tutorial Archetypes].
. In NetBeans IDE, create a simple web application using the `jaxrs-service-archetype` Maven archetype. This archetype creates a very simple "Hello, World" web application.
.. From the File menu, choose New Project.
.. From Categories, select Maven. From Projects, select Project From Archetype. Click Next.
.. Under Search enter `jaxrs-service`, select the `jaxrs-service-archetype`, and click Next.
.. Under Project Name enter `HelloWorldApplication`, set the Project Location, and set the Package name to `jakarta.tutorial.hello`, and click Finish.
+
The project is created.
3. In `HelloWorld.java`, find the `getHtml()` method. Replace the
`//TODO` comment with the following text, so that the finished product
resembles the following method:
. In `HelloWorld.java`, find the `getHtml()` method. Replace the `//TODO` comment with the following text, so that the finished product resembles the following method:
+
[source,java]
----
Expand All @@ -72,11 +63,10 @@ return statement.

|=======================================================================

4. Right-click the `HelloWorldApplication` project in the Projects pane
and select Run.
. Right-click the `HelloWorldApplication` project in the Projects pane and select Run.
+
This will build and deploy the application to GlassFish Server.
5. In a browser, open the following URL:
. In a browser, open the following URL:
+
[source,java]
----
Expand Down Expand Up @@ -245,13 +235,10 @@ Server. A web browser window will open to the following URL:
----
http://localhost:8080/rsvp/index.xhtml
----
8. In the web browser window, click the Event status link for the
Duke's Birthday event.
8. In the web browser window, click the Event status link for the Duke's Birthday event.
+
You'll see the current invitees and their responses.
9. Click the current response of one of the invitees in the Status
column of the table, select a new response, and click Update your
status.
9. Click the current response of one of the invitees in the Status column of the table, select a new response, and click Update your status.
+
The invitee's new status should now be displayed in the table of
invitees and their response statuses.
Expand All @@ -261,12 +248,8 @@ invitees and their response statuses.
To Run the rsvp Example Application Using Maven
+++++++++++++++++++++++++++++++++++++++++++++++

1. If the database server is not already running, start it by following
the instructions in link:#BNADK[Starting and
Stopping Apache Derby].
2. Make sure that GlassFish Server has been started (see
link:#BNADI[Starting and Stopping GlassFish
Server]).
1. If the database server is not already running, start it by following the instructions in link:#BNADK[Starting and Stopping Apache Derby].
2. Make sure that GlassFish Server has been started (see link:#BNADI[Starting and Stopping GlassFish Server]).
3. In a terminal window, go to:
+
[source,java]
Expand All @@ -287,16 +270,12 @@ This command builds, assembles, and deploys `rsvp` to GlassFish Server.
----
http://localhost:8080/rsvp/
----
6. In the web browser window, click the Event status link for the
Duke's Birthday event.
6. In the web browser window, click the Event status link for the Duke's Birthday event.
+
You'll see the current invitees and their responses.
7. Click the current response of one of the invitees in the Status
column of the table, select a new response, and click Update your
status.
7. Click the current response of one of the invitees in the Status column of the table, select a new response, and click Update your status.
+
The invitee's new status should now be displayed in the table of
invitees and their response statuses.
The invitee's new status should now be displayed in the table of invitees and their response statuses.

[[GIRCI]][[real-world-examples]]

Expand Down
Loading

0 comments on commit 3f2fb02

Please sign in to comment.