This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/juneau-website.git
The following commit(s) were added to refs/heads/asf-site by this push:
new 32e385c Petstore documentation.
32e385c is described below
commit 32e385c753656cb6144147633fce0b97f5d39963
Author: JamesBognar <[email protected]>
AuthorDate: Mon Sep 9 21:29:10 2019 -0400
Petstore documentation.
---
content/petstore.html | 218 +++++++++++++++++++++++++-------------------------
1 file changed, 111 insertions(+), 107 deletions(-)
diff --git a/content/petstore.html b/content/petstore.html
index fe0aad2..59bf57a 100644
--- a/content/petstore.html
+++ b/content/petstore.html
@@ -23,49 +23,51 @@
height="0" width="0"
style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
-<p>
- The <c>PetStore</c> application is an functional application meant to
demonstrate using Juneau with other technologies
- such as Spring Boot, Spring Data, Bootstrap, and Datatables to create
fully-functional applications with end-to-end
- REST integration support.
-</p>
-<p>
- What makes Juneau unique is the ability to create Java interfaces that
behave just like RPC, but using REST
- as the underlying protocol. And the technology it not tied to any
platform so it can be used in any environment
- by simply pulling in Maven dependencies. The server-side need only
provide the ability to host a servlet.
-</p>
-<p>
- The GitHub project hosting the application can be found <a
href='https://github.com/apache/juneau-petstore'>here</a>.
-</p>
-<p>
- The project is broken down into the following subprojects:
-</p>
-<ul class='spaced-list'>
- <li><c>juneau-petstore-api</c> - Contains the Java interface and DTOs
for the petstore application.
- <li><c>juneau-petstore-server</c> - Contains the server-side Java
implementation of the petstore Java interface as a REST resource.
- <li><c>juneau-petstore-client</c> - Contains the client-side Java proxy
of the petstore Java interface.
-</ul>
-
-<p>
- When the application is started up, you should see this page:
-</p>
-<p class='bpcode w800'>
- http://localhost:5000/petstore
-</p>
-<img class='bordered w800' src='petstore/1.png'>
-
-<h5 class='topic'>juneau-petstore-api</h5>
-
-<p>
- The <o>juneau-petstore-api</o> module contains the Java interface of
our application and the DTOs that go along
- with it. These classes are meant to be shared between the server and
client side code.
-</p>
-
-<p>
- The <c>PetStore</c> class is our primary class for defining our
application. It's a standard Java interface with
- annotations used to describe how the methods map to REST calls.
-</p>
-<h5 class='figure'>PetStore.java</h5>
-<p class='bpcode w800'>
+<h2 class='topic'>PetStore Application</h2>
+<div class='topic'>
+ <p>
+ The <c>PetStore</c> application is an functional application
meant to demonstrate using Juneau with other technologies
+ such as Spring Boot, Spring Data, Bootstrap, and Datatables to
create fully-functional applications with end-to-end
+ REST integration support.
+ </p>
+ <p>
+ What makes Juneau unique is the ability to create Java
interfaces that behave just like RPC, but using REST
+ as the underlying protocol. And the technology it not tied to
any platform so it can be used in any environment
+ by simply pulling in Maven dependencies. The server-side need
only provide the ability to host a servlet.
+ </p>
+ <p>
+ The GitHub project hosting the application can be found <a
href='https://github.com/apache/juneau-petstore'>here</a>.
+ </p>
+ <p>
+ The project is broken down into the following subprojects:
+ </p>
+ <ul class='spaced-list'>
+ <li><c>juneau-petstore-api</c> - Contains the Java interface
and DTOs for the petstore application.
+ <li><c>juneau-petstore-server</c> - Contains the server-side
Java implementation of the petstore Java interface as a REST resource.
+ <li><c>juneau-petstore-client</c> - Contains the client-side
Java proxy of the petstore Java interface.
+ </ul>
+
+ <p>
+ When the application is started up, you should see this page:
+ </p>
+ <p class='bpcode w800'>
+ http://localhost:5000/petstore
+ </p>
+ <img class='bordered w800' src='petstore/1.png'>
+
+ <h3 class='topic'>juneau-petstore-api</h3>
+ <div class='topic'>
+ <p>
+ The <o>juneau-petstore-api</o> module contains the Java
interface of our application and the DTOs that go along
+ with it. These classes are meant to be shared between
the server and client side code.
+ </p>
+
+ <p>
+ The <c>PetStore</c> class is our primary class for
defining our application. It's a standard Java interface with
+ annotations used to describe how the methods map to
REST calls.
+ </p>
+ <h5 class='figure'>PetStore.java</h5>
+ <p class='bpcode w800'>
<ja>@RemoteResource</ja>(path=<js>"/petstore"</js>)
<jk>public interface</jk> PetStore {
@@ -91,32 +93,32 @@
...
}
-</p>
-<p>
- <ja>@RemoteResource</ja> and <ja>@RemoteMethod</ja> are client-side
annotations used to map the method calls to REST
- and will be describe in the <c>juneau-petstore-client</c> section.
-</p>
-<p>
- <ja>@Path</ja> and <ja>@Body</ja> are used by both the client and
server side code to map to REST artifacts on both
- sides.
-</p>
-<p>
- Both sets of annotations are provided by pulling in the Juneau
dependency below:
-
-<h5 class='figure'>Maven Dependency</h5>
-<p class='bpcode w500'>
+ </p>
+ <p>
+ <ja>@RemoteResource</ja> and <ja>@RemoteMethod</ja> are
client-side annotations used to map the method calls to REST
+ and will be describe in the
<c>juneau-petstore-client</c> section.
+ </p>
+ <p>
+ <ja>@Path</ja> and <ja>@Body</ja> are used by both the
client and server side code to map to REST artifacts on both
+ sides.
+ </p>
+ <p>
+ Both sets of annotations are provided by pulling in the
Juneau dependency below:
+
+ <h5 class='figure'>Maven Dependency</h5>
+ <p class='bpcode w500'>
<xt><dependency></xt>
<xt><groupId></xt>org.apache.juneau<xt></groupId></xt>
<xt><artifactId></xt>juneau-marshall<xt></artifactId></xt>
<xt><version></xt>8.1.0<xt></version></xt>
<xt></dependency></xt>
-</p>
-<p>
- The <c>Pet</c> class is a DTO that gets serialized over the REST
connection. It is also annotated with JPA annotations
- so that they can easily be stored in a JPA datastore on the server side.
-</p>
-<h5 class='figure'>Pet.java</h5>
-<p class='bpcode w800'>
+ </p>
+ <p>
+ The <c>Pet</c> class is a DTO that gets serialized over
the REST connection. It is also annotated with JPA annotations
+ so that they can easily be stored in a JPA datastore on
the server side.
+ </p>
+ <h5 class='figure'>Pet.java</h5>
+ <p class='bpcode w800'>
<ja>@Bean</ja>(typeName=<js>"Pet"</js>, fluentSetters=<jk>true</jk>,
properties=<js>"id,species,name,tags,price,status"</js>)
<ja>@Entity</ja>(name=<js>"PetstorePet"</js>)
<jk>public class</jk> Pet {
@@ -137,25 +139,26 @@
...
}
-</p>
-<p>
- The annotations here are a combination of Juneau annotations for
controlling marshalling (<ja>@Bean</ja>, <ja>@Html</ja>)
- and documentation/validation (<ja>@Schema</ja>), and JPA annoations for
database persistence (<ja>@Entity</ja>, <ja>@Column</ja>).
-</p>
-<div class='info'>
- Most applications may choose to have separate classes for DTOs and JPA
beans since you typically are not going to want
- to expose server-side details to client-side code. In these examples
however they were combined into the same classes for brevity.
-</div>
-
-<h5 class='topic'>juneau-petstore-client</h5>
-
-<p>
- The <c>juneau-petstore-client</c> module contains a single <c>Main</c>
class used to instantiate the proxy against
- our remote REST interface using the Java interface described above.
-</p>
-
-<h5 class='figure'>Main.java</h5>
-<p class='bpcode w800'>
+ </p>
+ <p>
+ The annotations here are a combination of Juneau
annotations for controlling marshalling (<ja>@Bean</ja>, <ja>@Html</ja>)
+ and documentation/validation (<ja>@Schema</ja>), and
JPA annoations for database persistence (<ja>@Entity</ja>, <ja>@Column</ja>).
+ </p>
+ <div class='info'>
+ Most applications may choose to have separate classes
for DTOs and JPA beans since you typically are not going to want
+ to expose server-side details to client-side code. In
these examples however they were combined into the same classes for brevity.
+ </div>
+ </div>
+
+ <h3 class='topic'>juneau-petstore-client</h3>
+ <div class='topic'>
+ <p>
+ The <c>juneau-petstore-client</c> module contains a
single <c>Main</c> class used to instantiate the proxy against
+ our remote REST interface using the Java interface
described above.
+ </p>
+
+ <h5 class='figure'>Main.java</h5>
+ <p class='bpcode w800'>
<jk>public class</jk> Main {
<jk>public static void</jk> main(String[] args) {
@@ -177,20 +180,21 @@
}
}
}
-</p>
-<p>
- Notice how little code is necessary to construct a remote proxy.
-</p>
-
-<h5 class='topic'>juneau-petstore-server</h5>
-
-<p>
- The <c>juneau-petstore-server</c> module contains all of the guts of
the application. It's a standard Spring Boot
- application with Juneau integration support.
-</p>
-
-<h5 class='figure'>App.java</h5>
-<p class='bpcode w800'>
+ </p>
+ <p>
+ Notice how little code is necessary to construct a
remote proxy.
+ </p>
+ </div>
+
+ <h3 class='topic'>juneau-petstore-server</h3>
+ <div class='topic'>
+ <p>
+ The <c>juneau-petstore-server</c> module contains all
of the guts of the application. It's a standard Spring Boot
+ application with Juneau integration support.
+ </p>
+
+ <h5 class='figure'>App.java</h5>
+ <p class='bpcode w800'>
<ja>@SpringBootApplication</ja>
<jk>public class</jk> App {
@@ -204,11 +208,10 @@
.run(args);
}
}
-</p>
-
-<h5 class='figure'>AppConfiguration.java</h5>
-<p class='bpcode w800'>
-
+ </p>
+
+ <h5 class='figure'>AppConfiguration.java</h5>
+ <p class='bpcode w800'>
<ja>@Configuration</ja>
<jk>public class</jk> AppConfiguration {
@@ -228,11 +231,12 @@
<jk>return new</jk> PetStoreResource();
}
}
-</p>
-<p>
- The <c>JuneauRestInitializer</c> is used to allow Juneau resource
classes to reference child Spring beans.
-</p>
-
+ </p>
+ <p>
+ The <c>JuneauRestInitializer</c> is used to allow
Juneau resource classes to reference child Spring beans.
+ </p>
+ </div>
+</div>
<hr>
<b>*** WORK-IN-PROGRESS***</b>
<hr>