This is an automated email from the ASF dual-hosted git repository. jamesbognar pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/juneau.git
commit ed1bf330f1f10cc239bbd33764b9ffba199b0122 Author: JamesBognar <[email protected]> AuthorDate: Sat Jun 18 10:27:36 2022 -0400 Javadocs --- .../01.jrs.HelloWorldExample.html | 88 ------- .../06.juneau-rest-server/01.jrs.Overview.html | 155 +++++++++++ .../doc-files/jrs.Overview.HelloWorldResource.png | Bin 0 -> 71127 bytes .../doc-files/jrs.Overview.RootResources.json.png | Bin 0 -> 122559 bytes .../doc-files/jrs.Overview.RootResources.png | Bin 0 -> 193666 bytes .../16.juneau-examples-core/01.jec.Installing.html | 37 --- .../16.juneau-examples-core/02.jec.Examples.html | 66 ----- .../doc-files/jec.Installing.1.png | Bin 84524 -> 0 bytes .../doc-files/jec.Installing.2.png | Bin 91900 -> 0 bytes .../doc-files/jec.Installing.3.png | Bin 79555 -> 0 bytes .../01.jer.RootResources.html | 152 ----------- .../02.jer.HelloWorldResource.html | 82 ------ .../03.jer.DtoExamples.html | 234 ----------------- .../04.jer.ConfigResource.html | 168 ------------ .../05.jer.LogsResource.html | 30 --- .../doc-files/jer.AtomFeedResource.1.png | Bin 176439 -> 0 bytes .../doc-files/jer.AtomFeedResource.2.png | Bin 266611 -> 0 bytes .../doc-files/jer.AtomFeedResource.3.png | Bin 147615 -> 0 bytes .../doc-files/jer.ConfigResource.1.png | Bin 153114 -> 0 bytes .../doc-files/jer.ConfigResource.2.png | Bin 269953 -> 0 bytes .../doc-files/jer.HelloWorldResource.1.png | Bin 71562 -> 0 bytes .../doc-files/jer.HelloWorldResource.2.png | Bin 15098 -> 0 bytes .../doc-files/jer.JsonSchemaResource.1.png | Bin 172354 -> 0 bytes .../doc-files/jer.JsonSchemaResource.2.png | Bin 110715 -> 0 bytes .../doc-files/jer.LogsResource.1.png | Bin 206285 -> 0 bytes .../doc-files/jer.RootResources.1.png | Bin 224036 -> 0 bytes .../01.jerj.Installing.html | 291 --------------------- .../02.jerj.Running.html | 49 ---- .../03.jerj.Building.html | 60 ----- .../doc-files/jerj.Installing.1.png | Bin 84524 -> 0 bytes .../doc-files/jerj.Installing.2.png | Bin 160013 -> 0 bytes .../doc-files/jerj.Installing.3.png | Bin 158863 -> 0 bytes .../doc-files/jerj.Running.1.png | Bin 98777 -> 0 bytes .../Topics/19.juneau-examples-rest-springboot.html | 38 --- .../01.jers.Installing.html | 157 ----------- .../02.jers.Running.html | 48 ---- .../03.jers.Building.html | 57 ---- .../04.jers.DeployingToHeroku.html | 153 ----------- .../doc-files/jers.Heroku.1.png | Bin 100781 -> 0 bytes .../doc-files/jers.Heroku.2.png | Bin 136990 -> 0 bytes .../doc-files/jers.Heroku.3.png | Bin 293130 -> 0 bytes .../doc-files/jers.Heroku.4.png | Bin 105931 -> 0 bytes .../doc-files/jers.Heroku.5.png | Bin 13946 -> 0 bytes .../doc-files/jers.Heroku.6.png | Bin 243630 -> 0 bytes .../doc-files/jers.Installing.1.png | Bin 84524 -> 0 bytes .../doc-files/jers.Installing.2.png | Bin 162296 -> 0 bytes .../doc-files/jers.Installing.3.png | Bin 173827 -> 0 bytes .../doc-files/jers.Running.1.png | Bin 98777 -> 0 bytes juneau-doc/docs/Topics/20.juneau-petstore.html | 22 -- juneau-doc/docs/Topics/21.Glossaries.html | 21 -- juneau-doc/docs/Topics/22.Security.html | 26 -- .../org/apache/juneau/examples/rest/jetty/App.java | 1 - .../juneau/examples/rest/springboot/App.java | 2 +- .../rest/springboot/HelloWorldMessageProvider.java | 2 +- .../rest/springboot/HelloWorldResource.java | 2 +- .../examples/rest/springboot/RootResources.java | 2 +- .../apache/juneau/examples/rest/RootResources.java | 6 +- 57 files changed, 162 insertions(+), 1787 deletions(-) diff --git a/juneau-doc/docs/Topics/06.juneau-rest-server/01.jrs.HelloWorldExample.html b/juneau-doc/docs/Topics/06.juneau-rest-server/01.jrs.HelloWorldExample.html deleted file mode 100644 index 42308fb0d..000000000 --- a/juneau-doc/docs/Topics/06.juneau-rest-server/01.jrs.HelloWorldExample.html +++ /dev/null @@ -1,88 +0,0 @@ -<!-- -/*************************************************************************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - ***************************************************************************************************************************/ - --> - -{title:'Hello World Example', updated:'9.0.0'} - -<div class='topic'> - <p> - A REST resource is simply a Java class annotated with {@link oajr.annotation.Rest @Rest}. - The most common case is a class that extends {@link oajr.servlet.BasicRestServlet}, which itself is simply an - extension of {@link javax.servlet.http.HttpServlet} which allows it to be deployed as a servlet. - </p> - <p> - In this example, we define a resource called <l>HelloWorldResource</l>. - This example is located in the <l>juneau-examples-rest</l> project. - It's assumed the reader is familiar with defining servlets in web applications. - </p> - <p> - Like any servlet, we could define our resource in the <l>web.xml</l> file of the web application like so... - </p> - <p class='bxml'> - | <xt><?xml</xt> <xa>version</xa>=<xs>"1.0"</xs> <xa>encoding</xa>=<xs>"UTF-8"</xs><xt>?></xt> - | <xt><web-app</xt> <xa>version</xa>=<xs>"2.3"</xs><xt>></xt> - | <xt><servlet></xt> - | <xt><servlet-name></xt>HelloWorldResource<xt></servlet-name></xt> - | <xt><servlet-class></xt>com.foo.sample.HelloWorldResource<xt></servlet-class></xt> - | <xt></servlet></xt> - | <xt><servlet-mapping></xt> - | <xt><servlet-name></xt>HelloWorldResource<xt></servlet-name></xt> - | <xt><url-pattern></xt>/*<xt></url-pattern></xt> - | <xt></servlet-mapping></xt> - | <xt></web-app></xt> - </p> - <p> - Our servlet code is shown below: - </p> - <p class='bjava'> - | <jc>// Sample REST resource that prints out a simple "Hello world!" message.</jc> - | <ja>@Rest</ja>( - | path=<js>"/helloWorld"</js>, - | title=<js>"Hello World"</js>, - | description=<js>"An example of the simplest-possible resource"</js> - | ) - | <ja>@HtmlDoc</ja>( - | navlinks={ - | <js>"up: request:/.."</js>, - | <js>"options: servlet:/?method=OPTIONS"</js> - | }, - | aside={ - | <js>"<div style='max-width:400px' class='text'>"</js>, - | <js>" <p>This page shows a resource that simply response with a 'Hello world!' message</p>"</js>, - | <js>" <p>The POJO serialized is a simple String.</p>"</js>, - | <js>"</div>"</js> - | } - | ) - | <jk>public class</jk> HelloWorldResource <jk>extends</jk> BasicRestServlet <jk>implements</jk> BasicUniversalConfig { - | - | <ja>@RestGet</ja>(path=<js>"/*"</js>, summary=<js>"Responds with \"Hello world!\""</js>) - | <jk>public</jk> String sayHello() { - | <jk>return</jk> <js>"Hello world!"</js>; - | } - | } - </p> - <p> - This is what it looks like in a browser: - </p> - <p class='bcode'> - | http://localhost:10000/helloWorld - </p> - <img class='bordered w800' src='doc-files/jrs.HelloWorldExample.1.png'> - <p> - It doesn't much simpler than that. - In this case, we're simply returning a string that will be converted to any of the supported languages (e.g. - JSON, XML, HTML, ...). - However, we could have returned any POJO consisting of beans, maps, collections, etc... - </p> -</div> \ No newline at end of file diff --git a/juneau-doc/docs/Topics/06.juneau-rest-server/01.jrs.Overview.html b/juneau-doc/docs/Topics/06.juneau-rest-server/01.jrs.Overview.html new file mode 100644 index 000000000..38d378507 --- /dev/null +++ b/juneau-doc/docs/Topics/06.juneau-rest-server/01.jrs.Overview.html @@ -0,0 +1,155 @@ +<!-- +/*************************************************************************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + ***************************************************************************************************************************/ + --> + +{title:'Overview', created:'9.0.0'} + +<div class='topic'> + <p> + A REST resource is simply a Java class annotated with {@link oajr.annotation.Rest @Rest}. + The most common case is a class that extends {@link oajr.servlet.BasicRestServlet}, which itself is simply an + extension of {@link javax.servlet.http.HttpServlet} which allows it to be deployed as a servlet. + </p> + <p> + Juneau has two sample applications for demonstrating how to use the REST API, one using Jetty and one using + Spring Boot: + </p> + <ul class='javatree'> + <li class='jp'>{@link oaj.examples.rest.jetty} + <li class='jp'>{@link oaj.examples.rest.springboot} + </ul> + <p> + The {@link oaj.examples.rest.springboot} application is described in the section {@doc jrss.Overview}. + </p> + <p> + The Jetty application consists of the following application class that registers our top-level servlet: + </p> + <p class='bjava'> + | <jk>public class</jk> App { + | + | <jk>public static void</jk> main(String[] <jv>args</jv>) <jk>throws</jk> Exception { + | JettyMicroservice + | .<jsm>create</jsm>() + | .args(<jv>args</jv>) + | .servlet(RootResources.<jk>class</jk>) + | .build() + | .start() + | .startConsole() + | .join(); + | } + | } + </p> + <p> + The root resources class is an example of a router page that is used to attach children to: + </p> + <p class='bjava'> + | <ja>@Rest</ja>( + | title=<js>"Root resources"</js>, + | description=<js>"Example of a router resource page."</js>, + | children={ + | HelloWorldResource.<jk>class</jk>, + | DtoExamples.<jk>class</jk>, + | UtilityBeansResource.<jk>class</jk>, + | HtmlBeansResource.<jk>class</jk>, + | ConfigResource.<jk>class</jk>, + | ShutdownResource.<jk>class</jk> + | } + | ) + | <ja>@HtmlDocConfig</ja>( + | widgets={ + | ContentTypeMenuItem.<jk>class</jk> + | }, + | navlinks={ + | <js>"api: servlet:/api"</js>, + | <js>"stats: servlet:/stats"</js>, + | <js>"$W{ContentTypeMenuItem}"</js>, + | <js>"source: $C{Source/gitHub}/org/apache/juneau/examples/rest/RootResources.java"</js> + | }, + | aside={ + | <js>"<div class='text'>"</js>, + | <js>" <p>This is an example of a 'router' page that serves as a jumping-off point to child resources.</p>"</js>, + | <js>" <p>Resources can be nested arbitrarily deep through router pages.</p>"</js>, + | <js>" <p>Note the <span class='link'>API</span> link provided that lets you see the generated swagger doc for this page.</p>"</js>, + | <js>" <p>Also note the <span class='link'>STATS</span> link to view runtime statistics on this page.</p>"</js>, + | <js>" <p>Also note the <span class='link'>SOURCE</span> link to view the source code for the page.</p>"</js>, + | <js>" <p>All content on pages in the UI are serialized POJOs. In this case, it's a serialized array of beans with 2 properties, 'name' and 'description'.</p>"</js>, + | <js>" <p>Other features (such as this aside) are added through annotations.</p>"</js>, + | <js>"</div>"</js> + | }, + | asideFloat=<js>"RIGHT"</js> + | ) + | <ja>@SerializerConfig</ja>( + | <jc>// For testing purposes, we want to use single quotes in all the serializers so it's easier to do simple + | // String comparisons. + | // You can apply any of the Serializer/Parser/BeanContext settings this way.</jc> + | quoteChar=<js>"'"</js> + | ) + | <jk>public class</jk> RootResources <jk>extends</jk> BasicRestServletGroup <jk>implements</jk> BasicUniversalJenaConfig { + | <jc>// IMPORTANT! If you don't need RDF support, change the parent interface to BasicUniversalConfig. + | // It allows you to remove the Jena prerequisite.</jc> + | + | <jk>private static final long</jk> <jsf>serialVersionUID</jsf> = 1L; + | } + </p> + <p> + This is what it looks like in a browser: + </p> + + <h5 class='figure'>HTML representation</h5> + <img class='bordered w800' src='doc-files/jrs.Overview.RootResources.png'> + + <h5 class='figure'>JSON representation</h5> + <img class='bordered w800' src='doc-files/jrs.Overview.RootResources.json.png'> + + <p> + The {@link oaj.examples.rest.HelloWorldResource} class is our basic example of a child REST resource: + </p> + + <p class='bjava'> + | <ja>@Rest</ja>( + | title=<js>"Hello World"</js>, + | description=<js>"An example of the simplest-possible resource"</js>, + | path=<js>"/helloWorld"</js> + | ) + | <ja>@HtmlDocConfig</ja>( + | aside={ + | <js>"<div style='max-width:400px' class='text'>"</js>, + | <js>" <p>This page shows a resource that simply response with a 'Hello world!' message</p>"</js>, + | <js>" <p>The POJO serialized is a simple String.</p>"</js>, + | <js>"</div>"</js> + | } + | ) + | <jk>public class</jk> HelloWorldResource <jk>extends</jk> BasicRestObject <jk>implements</jk> BasicUniversalConfig { + | + | <ja>@RestGet</ja>(path=<js>"/*"</js>, summary=<js>"Responds with \"Hello world!\""</js>) + | <jk>public</jk> String sayHello() { + | <jk>return</jk> <js>"Hello world!"</js>; + | } + | } + </p> + + <p> + This is what it looks like in a browser: + </p> + + <h5 class='figure'>HTML representation</h5> + <img class='bordered w800' src='doc-files/jrs.Overview.HelloWorldResource.png'> + + <p> + It doesn't much simpler than that. + In this case, we're simply returning a string that will be converted to any of the supported languages (e.g. + JSON, XML, HTML, ...). + However, we could have returned any POJO consisting of beans, maps, collections, etc... + </p> +</div> \ No newline at end of file diff --git a/juneau-doc/docs/Topics/06.juneau-rest-server/doc-files/jrs.Overview.HelloWorldResource.png b/juneau-doc/docs/Topics/06.juneau-rest-server/doc-files/jrs.Overview.HelloWorldResource.png new file mode 100644 index 000000000..5a42a7409 Binary files /dev/null and b/juneau-doc/docs/Topics/06.juneau-rest-server/doc-files/jrs.Overview.HelloWorldResource.png differ diff --git a/juneau-doc/docs/Topics/06.juneau-rest-server/doc-files/jrs.Overview.RootResources.json.png b/juneau-doc/docs/Topics/06.juneau-rest-server/doc-files/jrs.Overview.RootResources.json.png new file mode 100644 index 000000000..c350b6dc5 Binary files /dev/null and b/juneau-doc/docs/Topics/06.juneau-rest-server/doc-files/jrs.Overview.RootResources.json.png differ diff --git a/juneau-doc/docs/Topics/06.juneau-rest-server/doc-files/jrs.Overview.RootResources.png b/juneau-doc/docs/Topics/06.juneau-rest-server/doc-files/jrs.Overview.RootResources.png new file mode 100644 index 000000000..00f43312f Binary files /dev/null and b/juneau-doc/docs/Topics/06.juneau-rest-server/doc-files/jrs.Overview.RootResources.png differ diff --git a/juneau-doc/docs/Topics/16.juneau-examples-core/01.jec.Installing.html b/juneau-doc/docs/Topics/16.juneau-examples-core/01.jec.Installing.html deleted file mode 100644 index d11653fec..000000000 --- a/juneau-doc/docs/Topics/16.juneau-examples-core/01.jec.Installing.html +++ /dev/null @@ -1,37 +0,0 @@ -<!-- -/*************************************************************************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - ***************************************************************************************************************************/ - --> - -{title:'Installing in Eclipse', created:'8.0.0'} - -<div class='topic'> - <p> - Follow these instructions to import the Juneau project into Eclipse. - </p> - <ol class='spaced-list'> - <li> - Download the <c>juneau-examples-core-{@property juneauVersion}.zip</c> file from the downloads page - (located in the binaries) and import it into your workspace as an existing project: - <br><br> - <img class='bordered' src='doc-files/jec.Installing.1.png' style='width:524px'> - <li> - Select the archive file and import the project: - <br><br> - <img class='bordered' src='doc-files/jec.Installing.2.png' style='width:549px'> - <li> - In your workspace, you should now see the following project: - <br><br> - <img class='bordered' src='doc-files/jec.Installing.3.png' style='width:400px'> - </ol> -</div> \ No newline at end of file diff --git a/juneau-doc/docs/Topics/16.juneau-examples-core/02.jec.Examples.html b/juneau-doc/docs/Topics/16.juneau-examples-core/02.jec.Examples.html deleted file mode 100644 index 9c47e28d4..000000000 --- a/juneau-doc/docs/Topics/16.juneau-examples-core/02.jec.Examples.html +++ /dev/null @@ -1,66 +0,0 @@ -<!-- -/*************************************************************************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - ***************************************************************************************************************************/ - --> - -{title:'Examples', created:'8.0.0'} - -<div class='topic'> - <p> - The following shows the core examples provided: - </p> - <ul class='javatree'> - <li class='jp'>{@link oaj.examples.core.json} - <ul> - <li class='jc'>{@link oaj.examples.core.json.JsonSimpleExample} - JsonSerializer and JsonParser usage on serialize and deserialize simple Pojo bean. - <li class='jc'>{@link oaj.examples.core.json.JsonComplexExample} - JsonSerializer and JsonParser usage on serialize and deserialize complex Pojo bean. - <li class='jc'>{@link oaj.examples.core.json.JsonConfigurationExample} - Json Serializers configured using properties defined in JsonSerializer class. - </ul> - </li> - <li class='jp'>{@link oaj.examples.core.xml} - <ul> - <li class='jc'>{@link oaj.examples.core.xml.XmlSimpleExample} - XmlSerializer and XmlParser usage on serialize and deserialize simple Pojo bean. - <li class='jc'>{@link oaj.examples.core.xml.XmlComplexExample} - XmlSerializer and XmlParser usage on serialize and deserialize complex Pojo bean. - <li class='jc'>{@link oaj.examples.core.xml.XmlConfigurationExample} - XmlSerializers configured using properties defined in XmlSerializer class. - </ul> - </li> - <li class='jp'>{@link oaj.examples.core.dto} - <ul> - <li class='jc'>{@link oaj.examples.core.dto.DtoExample} - Usage of core dto module. - </ul> - </li> - <li class='jp'>{@link oaj.examples.core.rdf} - <ul> - <li class='jc'>{@link oaj.examples.core.rdf.RdfExample} - RdfXmlSerializer usage on serialize simple Pojo bean. - <li class='jc'>{@link oaj.examples.core.rdf.RdfComplexExample} - RdfXmlSerializer usage on serialize complex Pojo bean. - </ul> - </li> - <li class='jp'>{@link oaj.examples.core.html} - <ul> - <li class='jc'>{@link oaj.examples.core.html.HtmlSimpleExample} - HtmlSerializer usage on serialize and deserialize simple Pojo bean. - <li class='jc'>{@link oaj.examples.core.html.HtmlComplexExample} - HtmlSerializer usage on serialize and deserialize complex Pojo bean. - </ul> - </li> - <li class='jp'>{@link oaj.examples.core.uon} - <ul> - <li class='jc'>{@link oaj.examples.core.uon.UonExample} - UonSerializer usage on serialize and deserialize simple Pojo bean. - <li class='jc'>{@link oaj.examples.core.uon.UonComplexExample} - UonSerializer usage on serialize and deserialize complex Pojo bean. - </ul> - </li> - <li class='jp'>{@link oaj.examples.core.svl} - <ul> - <li class='jc'>{@link oaj.examples.core.svl.SvlExample} - Usage of Svl module in juneau. - </ul> - </li> - </ul> -</div> \ No newline at end of file diff --git a/juneau-doc/docs/Topics/16.juneau-examples-core/doc-files/jec.Installing.1.png b/juneau-doc/docs/Topics/16.juneau-examples-core/doc-files/jec.Installing.1.png deleted file mode 100644 index 3b9b4e177..000000000 Binary files a/juneau-doc/docs/Topics/16.juneau-examples-core/doc-files/jec.Installing.1.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/16.juneau-examples-core/doc-files/jec.Installing.2.png b/juneau-doc/docs/Topics/16.juneau-examples-core/doc-files/jec.Installing.2.png deleted file mode 100644 index dc73f291a..000000000 Binary files a/juneau-doc/docs/Topics/16.juneau-examples-core/doc-files/jec.Installing.2.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/16.juneau-examples-core/doc-files/jec.Installing.3.png b/juneau-doc/docs/Topics/16.juneau-examples-core/doc-files/jec.Installing.3.png deleted file mode 100644 index 0e572bb97..000000000 Binary files a/juneau-doc/docs/Topics/16.juneau-examples-core/doc-files/jec.Installing.3.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/17.juneau-examples-rest/01.jer.RootResources.html b/juneau-doc/docs/Topics/17.juneau-examples-rest/01.jer.RootResources.html deleted file mode 100644 index 021ecb829..000000000 --- a/juneau-doc/docs/Topics/17.juneau-examples-rest/01.jer.RootResources.html +++ /dev/null @@ -1,152 +0,0 @@ -<!-- -/*************************************************************************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - ***************************************************************************************************************************/ - --> - -{title:'RootResources', updated:'8.0.0,8.1.0', flags:'todo'} - -<div class='topic'> - <p> - The <l>RootResources</l> class is the main page for the REST microservice. - It serves as the jumping-off point for the other resources. - </p> - <p> - The class hierarchy for this class is: - </p> - <ul class='javatree'> - <li class='jac'> - {@link oajr.servlet.RestServlet} - Contains all the REST servlet logic. - <ul> - <li class='jac'> - {@link oajr.servlet.BasicRestServlet} - Defines default serializers and parsers, and OPTIONs page logic. - <ul> - <li class='jac'> - {@link oajr.servlet.BasicRestServletGroup} - Specialized subclass for grouping other resources. - <ul> - <li class='jc'> - <c>RootResources</c> - </ul> - </li> - </ul> - </li> - </ul> - </li> - </ul> - <p> - Pointing a browser to the resource shows the following: - </p> - <p class='bcode'> - | http://localhost:10000 - </p> - <img class='bordered w800' src='doc-files/jer.RootResources.1.png'> - <p> - The <l>RootResources</l> class can also be defined as a servlet in a <l>web.xml</l> file: - </p> - <p class='bxml'> - | <xt><web-app</xt> <xa>version</xa>=<xs>'3.0'</xs><xt>></xt> - | <xt><servlet></xt> - | <xt><servlet-name></xt>RootResources<xt></servlet-name></xt> - | <xt><servlet-class></xt>org.apache.juneau.examples.rest.RootResources<xt></servlet-class></xt> - | <xt></servlet></xt> - | <xt><servlet-mapping></xt> - | <xt><servlet-name></xt>RootResources<xt></servlet-name></xt> - | <xt><url-pattern></xt>/*<xt></url-pattern></xt> - | <xt></servlet-mapping></xt> - | <xt></web-app></xt> - </p> - <p> - The <l>RootResources</l> class consists entirely of annotations: - </p> - - <h5 class='figure'>RootResources.java</h5> - <p class='bjava'> - | <jd>/** - | * Sample REST resource showing how to implement a "router" resource page. - | */</jd> - | <ja>@Rest</ja>( - | path=<js>"/"</js>, - | title=<js>"Root resources"</js>, - | description=<js>"Example of a router resource page."</js>, - | htmldoc=<ja>@HtmlDoc</ja>( - | widgets={ - | ContentTypeMenuItem.<jk>class</jk>, - | StyleMenuItem.<jk>class</jk> - | }, - | navlinks={ - | <js>"options: ?method=OPTIONS"</js>, - | <js>"$W{ContentTypeMenuItem}"</js>, - | <js>"$W{StyleMenuItem}"</js>, - | <js>"source: $C{Source/gitHub}/org/apache/juneau/examples/rest/$R{servletClassSimple}.java"</js> - | }, - | aside={ - | <js>"<div style='max-width:400px' class='text'>"</js>, - | <js>" <p>This is an example of a 'router' page that serves as a jumping-off point to child resources.</p>"</js>, - | <js>" <p>Resources can be nested arbitrarily deep through router pages.</p>"</js>, - | <js>" <p>Note the <span class='link'>options</span> link provided that lets you see the generated swagger doc for this page.</p>"</js>, - | <js><js>" <p>Also note the <span class='link'>sources</span> link on these pages to view the source code for the page.</p>"</js>, - | " <p>All content on pages in the UI are serialized POJOs. In this case, it's a serialized array of beans with 2 properties, 'name' and 'description'.</p>"</js>, - | <js>" <p>Other features (such as this aside) are added through annotations.</p>"</js>, - | <js>"</div>"</js> - | } - | ), - | children={ - | HelloWorldResource.<jk>class</jk>, - | PetStoreResource.<jk>class</jk>, - | DtoExamples.<jk>class</jk>, - | ConfigResource.<jk>class</jk>, - | LogsResource.<jk>class</jk>, - | DebugResource.<jk>class</jk>, - | ShutdownResource.<jk>class</jk> - | } - | ) - | <ja>@SerializerConfig</ja>( - | <jc>// For testing purposes, we want to use single quotes in all the serializers so it's easier to do simple - | // String comparisons.</jc> - | quoteChar=<js>"'"</js> - | ) - | <jk>public class</jk> RootResources <jk>extends</jk> BasicRestServletGroup <jk>implements</jk> BasicUniversalConfig { - | <jc>// No code!</jc> - | } - </p> - <p> - The <l>children</l> annotation defines the child resources of this router resource. - These are resources whose paths are direct descendants to the parent resource. - </p> - <p> - Child resources must be annotated with the {@link oajr.annotation.Rest#path() @Rest(path)} annotation to - identify the subpath of the child. - Children CAN extend from {@link oajr.servlet.BasicRestServlet} but it is not a requirement. - </p> - <p> - Note that these router pages can be arbitrarily nested deep. - You can define many levels of router pages for arbitrarily hierarchical REST interfaces. - </p> - <p> - Let's step back and describe what's going on here: - </p> - <p> - During servlet initialization of the <l>RootResources</l> object, the toolkit looks for the - <l>@Rest(children)</l> annotation. - If it finds it, it instantiates instances of each class and recursively performs servlet initialization - on them. - It then associates the child resource with the parent by the name specified by the - <l>@Rest(path)</l> annotation on the child class. - </p> - <p> - When a request for the child URL (<l>/helloWorld</l>) is received, the <l>RootResources</l> servlet - gets the request and sees that the URL remainder matches one of its child resources. - It then forwards the request to the child resource for processing. - The request passed to the child resource is the same as if the child resource had been deployed - independently (e.g. path-info, resource-URI, and so forth). - </p> -</div> \ No newline at end of file diff --git a/juneau-doc/docs/Topics/17.juneau-examples-rest/02.jer.HelloWorldResource.html b/juneau-doc/docs/Topics/17.juneau-examples-rest/02.jer.HelloWorldResource.html deleted file mode 100644 index 6cd666ce9..000000000 --- a/juneau-doc/docs/Topics/17.juneau-examples-rest/02.jer.HelloWorldResource.html +++ /dev/null @@ -1,82 +0,0 @@ -<!-- -/*************************************************************************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - ***************************************************************************************************************************/ - --> - -{title:'HelloWorldResource', updated:'8.0.0', flags:'todo'} - -<div class='topic'> - <p> - The <l>HelloWorldResource</l> class is a simple resource that prints a "Hello world!" message. - </p> - - <h5 class='figure'>HelloWorldResource.java</h5> - <p class='bjava'> - | <jd>/** - | * Sample REST resource that prints out a simple "Hello world!" message. - | */</jd> - | <ja>@Rest</ja>( - | title=<js>"Hello World"</js>, - | description=<js>"An example of the simplest-possible resource"</js>, - | path=<js>"/helloWorld"</js>, - | htmldoc=<ja>@HtmlDoc</ja>( - | aside={ - | <js>"<div style='max-width:400px' class='text'>"</js>, - | <js>" <p>This page shows a resource that simply response with a 'Hello world!' message</p>"</js>, - | <js>" <p>The POJO serialized is a simple String.</p>"</js>, - | <js>"</div>"</js> - | } - | ) - | ) - | <jk>public class</jk> HelloWorldResource <jk>implements</jk> BasicRestConfig { - | - | <jd>/** GET request handler */</jd> - | <ja>@RestGet</ja>(path=<js>"/*"</js>, summary=<js>"Responds with \"Hello world!\""</js>) - | <jk>public</jk> String sayHello() { - | <jk>return</jk> <js>"Hello world!"</js>; - | } - | } - </p> - <p> - Notice that in this case we're not extending from {@link oajr.servlet.RestServlet}. - We are however implementing {@del oajr.BasicRestConfig} which is a no-op - interface that defines a default <ja>@Rest</ja> annotation with all the serializers, parsers, - and configuration defined on the {@link oajr.servlet.BasicRestServlet} class. - </p> - <p> - The only difference between implementing <l>BasicRestConfig</l> and extending from <l>BasicRestServlet</l> - is that the latter provides the following additional features: - </p> - <ul class='spaced-list'> - <li>A default OPTIONS method. - <li>It can be deployed like any servlet. - </ul> - <p> - All other examples in this project extend from <l>BasicRestServlet</l> so that they provide automatic OPTIONS page support. - </p> - <p> - Pointing a browser to the resource shows the following: - </p> - <p class='bcode'> - | http://localhost:10000/helloWorld - </p> - <img class='bordered w800' src='doc-files/jer.HelloWorldResource.1.png'> - <p> - Using the special <l>&Accept=text/json</l> and <l>&plainText=true</l> parameters - allows us to see this page rendered as JSON: - </p> - <p class='bcode'> - | http://localhost:10000/helloWorld?Accept=text/json&plainText=true - </p> - <img class='bordered w800' src='doc-files/jer.HelloWorldResource.2.png'> -</div> \ No newline at end of file diff --git a/juneau-doc/docs/Topics/17.juneau-examples-rest/03.jer.DtoExamples.html b/juneau-doc/docs/Topics/17.juneau-examples-rest/03.jer.DtoExamples.html deleted file mode 100644 index 8962d7b07..000000000 --- a/juneau-doc/docs/Topics/17.juneau-examples-rest/03.jer.DtoExamples.html +++ /dev/null @@ -1,234 +0,0 @@ -<!-- -/*************************************************************************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - ***************************************************************************************************************************/ - --> - -{title:'DtoExamples', created:'8.0.0', updated:'8.1.0', flags:'todo'} - -<div class='topic'> - <p> - The <l>DtoExamples</l> resource is a resource group for demonstrating various DTO examples. - </p> - <p> - The <l>AtomFeedResource</l> class shows examples of the following: - </p> - <ul class='spaced-list'> - <li> - Using the {@doc org.apache.juneau.dto.atom#TOC ATOM Feed DTO} API. - </ul> - <p> - Pointing a browser to the resource shows the following: - </p> - <p class='bcode'> - | http://localhost:10000/atom - </p> - <img class='bordered w800' src='doc-files/jer.AtomFeedResource.1.png'> - <p> - True ATOM feeds require using an <l>Accept:text/xml</l> header: - </p> - <p class='bcode'> - | http://localhost:10000/atom?Accept=text/xml&plainText=true - </p> - <img class='bordered w800' src='doc-files/jer.AtomFeedResource.2.png'> - <p> - Other languages, such as JSON are also supported: - </p> - <p class='bcode'> - | http://localhost:10000/atom?Accept=text/json&plainText=true - </p> - <img class='bordered w800' src='doc-files/jer.AtomFeedResource.3.png'> - - <h5 class='figure'>AtomFeedResource.java</h5> - <p class='bjava'> - | <jd>/** - | * Sample resource that shows how to generate ATOM feeds. - | */</jd> - | <ja>@Rest</ja>( - | path=<js>"/atom"</js>, - | title=<js>"Sample ATOM feed resource"</js>, - | description=<js>"Sample resource that shows how to render ATOM feeds"</js>, - | htmldoc=<ja>@HtmlDoc</ja>( - | widgets={ - | ContentTypeMenuItem.<jk>class</jk>, - | StyleMenuItem.<jk>class</jk> - | }, - | navlinks={ - | <js>"up: request:/.."</js>, - | <js>"options: servlet:/?method=OPTIONS"</js>, - | <js>"$W{ContentTypeMenuItem}"</js>, - | <js>"$W{StyleMenuItem}"</js>, - | <js>"source: $C{Source/gitHub}/org/apache/juneau/examples/rest/$R{servletClassSimple}.java"</js> - | } - | ), - | encoders=GzipEncoder.<jk>class</jk> - | ) - | <ja>@SerializerConfig</ja>(quoteChar=<js>"'"</js>) - | <ja>@RdfConfig</ja>(rdfxml_tab=<js>"5"</js>, addRootProperty=<js>"true"</js>) - | <jk>public class</jk> AtomFeedResource <jk>extends</jk> BasicRestServlet <jk>implements</jk> BasicUniversalConfig { - | - | <jk>private</jk> Feed <jf>feed</jf>; <jc>// The root resource object</jc> - | - | <ja>@Override</ja> <jc>/* Servlet */</jc> - | <jk>public void</jk> init() { - | <jk>try</jk> { - | <jf>feed</jf> = - | <jsm>feed</jsm>(<js>"tag:juneau.sample.com,2013:1"</js>, <js>"Juneau ATOM specification"</js>, <js>"2013-05-08T12:29:29Z"</js>) - | .subtitle(<jsm>text</jsm>(<js>"html"</js>).text(<js>"A <em>lot</em> of effort went into making this effortless"</js>)) - | .links( - | <jsm>link</jsm>(<js>"alternate"</js>, <js>"text/html"</js>, <js>"http://www.sample.com/"</js>).hreflang(<js>"en"</js>), - | <jsm>link</jsm>(<js>"self"</js>, <js>"application/atom+xml"</js>, <js>"http://www.sample.com/feed.atom"</js>) - | ) - | .generator( - | <jsm>generator</jsm>(<js>"Juneau"</js>).uri(<js>"http://juneau.apache.org/"</js>).version(<js>"1.0"</js>) - | ) - | .entries( - | <jsm>entry</jsm>(<js>"tag:juneau.sample.com,2013:1.2345"</js>, <js>"Juneau ATOM specification snapshot"</js>, <js>"2013-05-08T12:29:29Z"</js>) - | .links( - | <jsm>link</jsm>(<js>"alternate"</js>, <js>"text/html"</js>, <js>"http://www.sample.com/2012/05/08/juneau.atom"</js>), - | <jsm>link</jsm>(<js>"enclosure"</js>, <js>"audio/mpeg"</js>, <js>"http://www.sample.com/audio/juneau_podcast.mp3"</js>).length(1337) - | ) - | .published(<js>"2013-05-08T12:29:29Z"</js>) - | .authors( - | <jsm>person</jsm>(<js>"James Bognar"</js>).uri(<jk>new</jk> URI(<js>"http://www.sample.com/"</js>)).email(<js>"[email protected]"</js>) - | ) - | .contributors( - | <jsm>person</jsm>(<js>"Barry M. Caceres"</js>) - | ) - | .content( - | <jsm>content</jsm>(<js>"xhtml"</js>) - | .lang(<js>"en"</js>) - | .base(<js>"http://www.apache.org/"</js>) - | .text(<js>"<div><p>[Update: Juneau supports ATOM.]</p></div>"</js>) - | ) - | ); - | } <jk>catch</jk> (Exception e) { - | <jk>throw new</jk> RuntimeException(e); - | } - | } - | - | <jd>/** - | * GET request handler - | */</jd> - | <ja>@RestGet</ja>(<js>"/"</js>) - | <jk>public</jk> Feed getFeed() <jk>throws</jk> Exception { - | <jk>return</jk> <jf>feed</jf>; - | } - | - | <jd>/** - | * PUT request handler. - | * Replaces the feed with the specified content, and then mirrors it as the response. - | */</jd> - | <ja>@RestPut</ja>(<js>"/"</js>) - | <jk>public</jk> Feed setFeed(<ja>@Body</ja> Feed <jv>feed</jv>) <jk>throws</jk> Exception { - | <jk>this</jk>.<jf>feed</jf> = <jv>feed</jv>; - | <jk>return</jk> <jv>feed</jv>; - | } - | } - </p> - <p> - The <l>JsonSchemaResource</l> class shows examples of the following: - </p> - <ul class='spaced-list'> - <li> - Using the {@link oaj.dto.jsonschema JSON Schema DTO} API. - </ul> - <p> - The resource consists of a pre-initialized {@link oaj.dto.jsonschema.JsonSchema} object. - Pointing a browser to the resource shows the following: - </p> - <p class='bcode'> - | http://localhost:10000/jsonSchema - </p> - <img class='bordered w800' src='doc-files/jer.JsonSchemaResource.1.png'> - <p> - For true JSON-Schema, you need to specify the header <l>Accept: text/json</l>: - </p> - <p class='bcode'> - | http://localhost:10000/jsonSchema?Accept=text/json&plainText=true - </p> - <img class='bordered w800' src='doc-files/jer.JsonSchemaResource.2.png'> - - <h5 class='figure'>JsonSchemaResource.java</h5> - <p class='bjava'> - | <jd>/** - | * Sample resource that shows how to serialize JSON-Schema documents. - | */</jd> - | <ja>@Rest</ja>( - | path=<js>"/jsonSchema"</js>, - | messages=<js>"nls/JsonSchemaResource"</js>, - | title=<js>"Sample JSON-Schema document"</js>, - | description=<js>"Sample resource that shows how to generate JSON-Schema documents"</js>, - | htmldoc=<ja>@HtmlDoc</ja>( - | widgets={ - | ContentTypeMenuItem.<jk>class</jk>, - | StyleMenuItem.<jk>class</jk> - | }, - | navlinks={ - | <js>"up: request:/.."</js>, - | <js>"options: servlet:/?method=OPTIONS"</js>, - | <js>"$W{ContentTypeMenuItem}"</js>, - | <js>"$W{StyleMenuItem}"</js>, - | <js>"source: $C{Source/gitHub}/org/apache/juneau/examples/rest/$R{servletClassSimple}.java"</js> - | }, - | aside={ - | <js>"<div style='min-width:200px' class='text'>"</js>, - | <js>" <p>Shows how to produce JSON-Schema documents in a variety of languages using the JSON-Schema DTOs.</p>"</js>, - | <js>"</div>"</js> - | } - | ) - | ) - | <jk>public class</jk> JsonSchemaResource <jk>extends</jk> BasicRestServlet <jk>implements</jk> BasicUniversalConfig { - | <jk>private static final long</jk> <jsf>serialVersionUID</jsf> = 1L; - | - | <jk>private</jk> JsonSchema schema; <jc>// The schema document</jc> - | - | <ja>@Override</ja> /* Servlet */ - | <jk>public void</jk> init() { - | - | <jk>try</jk> { - | <jf>schema</jf> = <jk>new</jk> JsonSchema() - | .setId(<js>"http://example.com/sample-schema#"</js>) - | .setSchemaVersionUri(<js>"http://json-schema.org/draft-04/schema#"</js>) - | .setTitle(<js>"Example Schema"</js>) - | .setType(JsonType.<jsf>OBJECT</jsf>) - | .addProperties( - | <jk>new</jk> JsonSchemaProperty(<js>"firstName"</js>, JsonType.<jsf>STRING</jsf>), - | <jk>new</jk> JsonSchemaProperty(<js>"lastName"</js>, JsonType.<jsf>STRING</jsf>), - | <jk>new</jk> JsonSchemaProperty(<js>"age"</js>, JsonType.<jsf>INTEGER</jsf>) - | .setDescription(<js>"Age in years"</js>) - | .setMinimum(0) - | ) - | .addRequired(<js>"firstName"</js>, <js>"lastName"</js>); - | } <jk>catch</jk> (Exception e) { - | <jk>throw new</jk> RuntimeException(e); - | } - | } - | - | <jd>/** GET request handler */</jd> - | <ja>@RestGet</ja>(<js>"/"</js>) - | <jk>public</jk> JsonSchema getSchema() <jk>throws</jk> Exception { - | <jk>return</jk> <jf>schema</jf>; - | } - | - | <jd>/** - | * PUT request handler. - | * Replaces the schema document with the specified content, and then mirrors it as the response. - | */</jd> - | <ja>@RestPut</ja>(<js>"/"</js>) - | <jk>public</jk> JsonSchema setSchema(<ja>@Body</ja> JsonSchema schema) <jk>throws</jk> Exception { - | <jk>this</jk>.<jf>schema</jf> = schema; - | <jk>return</jk> schema; - | } - | } - </p> -</div> \ No newline at end of file diff --git a/juneau-doc/docs/Topics/17.juneau-examples-rest/04.jer.ConfigResource.html b/juneau-doc/docs/Topics/17.juneau-examples-rest/04.jer.ConfigResource.html deleted file mode 100644 index 349020d40..000000000 --- a/juneau-doc/docs/Topics/17.juneau-examples-rest/04.jer.ConfigResource.html +++ /dev/null @@ -1,168 +0,0 @@ -<!-- -/*************************************************************************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - ***************************************************************************************************************************/ - --> - -{title:'ConfigResource', flags:'todo'} - -<div class='topic'> - <p> - The {@link oaj.microservice.resources.ConfigResource} class is a predefined reusable resource. - It provides a REST interface for reading and altering the microservice config file. - </p> - <p> - Pointing a browser to the resource shows the following: - </p> - <p class='bcode'> - | http://localhost:10000/config - </p> - <img class='bordered w800' src='doc-files/jer.ConfigResource.1.png'> - <p> - An edit page is provided for altering the raw config file: - </p> - <p class='bcode'> - | http://localhost:10000/config/edit - </p> - <img class='bordered w800' src='doc-files/jer.ConfigResource.2.png'> - <p> - The {@link oaj.config.Config} class is a serializable POJO, which makes the resource - relatively straightforward to implement. - </p> - - <h5 class='figure'>ConfigResource.java</h5> - <p class='bjava'> - | <jd>/** - | * Shows contents of the microservice configuration file. - | */</jd> - | <ja>@Rest</ja>( - | path=<js>"/config"</js>, - | title=<js>"Configuration"</js>, - | description=<js>"Contents of configuration file."</js>, - | htmldoc=<ja>@HtmlDoc</ja>( - | navlinks={ - | <js>"up: request:/.."</js>, - | <js>"options: servlet:/?method=OPTIONS"</js>, - | <js>"edit: servlet:/edit"</js> - | } - | ) - | ) - | <jk>public class</jk> ConfigResource <jk>extends</jk> BasicRestServlet <jk>implements</jk> BasicUniversalConfig { - | - | <ja>@RestGet</ja>(path=<js>"/"</js>, description=<js>"Show contents of config file."</js>) - | <jk>public</jk> JsonMap getConfig() <jk>throws</jk> Exception { - | <jk>return</jk> getServletConfig().getConfig().asMap(); - | } - | - | <ja>@RestGet</ja>(path=<js>"/edit"</js>, description=<js>"Edit config file."</js>) - | <jk>public</jk> Form getConfigEditForm(RestRequest <jv>req</jv>) <jk>throws</jk> Exception { - | <jk>return</jk> <jsm>form</jsm>().id(<js>"form"</js>).action(<js>"servlet:/"</js>).method(<js>"POST"</js>).enctype(<js>"application/x-www-form-urlencoded"</js>).children( - | <jsm>div</jsm>()._class(<js>"data"</js>).children( - | <jsm>table</jsm>( - | <jsm>tr</jsm>(<jsm>td</jsm>().style(<js>"text-align:right"</js>).children(<jsm>button</jsm>(<js>"submit"</js>,<js>"Submit"</js>),<jsm>button</jsm>(<js>"reset"</js>,<js>"Reset"</js>))), - | <jsm>tr</jsm>(<jsm>th</jsm>().child(<js>"Contents"</js>)), - | <jsm>tr</jsm>(<jsm>th</jsm>().child( - | <jsm>textarea</jsm>().name(<js>"contents"</js>).rows(40).cols(120).style(<js>"white-space:pre;word-wrap:normal;overflow-x:scroll;font-family:monospace;"</js>) - | .text(getServletConfig().getConfig().toString())) - | ) - | ) - | ) - | ); - | } - | - | <ja>@RestGet</ja>(<js>"/{section}"</js>, - | description=<js>"Show config file section."</js>, - | swagger={ - | <js>"parameters:["</js>, - | <js>"{name:'section',in:'path',description:'Section name.'}"</js>, - | <js>"]"</js> - | } - | ) - | <jk>public</jk> JsonMap getConfigSection(<ja>@Path</ja>(<js>"section"</js>) String <jv>section</jv>) <jk>throws</jk> Exception { - | <jk>return</jk> getSection(<jv>section</jv>); - | } - | - | <ja>@RestGet</ja>(<js>"/{section}/{key}"</js>, - | description=<js>"Show config file entry."</js>, - | swagger={ - | <js>"parameters:["</js>, - | <js>"{name:'section',in:'path',description:'Section name.'},"</js>, - | <js>"{name:'key',in:'path',description:'Entry name.'}"</js>, - | <js>"]"</js> - | } - | ) - | <jk>public</jk> String getConfigEntry(<ja>@Path</ja>(<js>"section"</js>) String <jv>section</jv>, <ja>@Path</ja>(<js>"key"</js>) String <jv>key</jv>) <jk>throws</jk> Exception { - | <jk>return</jk> getSection(<jv>section</jv>).getString(<jv>key</jv>); - | } - | - | <ja>@RestPost</ja>(<js>"/"</js>, - | description=<js>"Sets contents of config file from a FORM post."</js>, - | swagger={ - | <js>"parameters:["</js>, - | <js>"{name:'contents',in:'formData',description:'New contents in INI file format.'}"</js>, - | <js>"]"</js> - | } - | ) - | <jk>public</jk> Config setConfigContentsFormPost(<ja>@FormData</ja>(<js>"contents"</js>) String <jv>contents</jv>) <jk>throws</jk> Exception { - | <jk>return</jk> setConfigContents(<jk>new</jk> StringReader(<jv>contents</jv>)); - | } - | - | <ja>@RestPut</ja>(path=<js>"/"</js>, - | description=<js>"Sets contents of config file."</js>, - | swagger={ - | <js>"parameters:["</js>, - | <js>"{in:'body',description:'New contents in INI file format.'}"</js>, - | <js>"]"</js> - | } - | ) - | <jk>public</jk> Config setConfigContents(<ja>@Body</ja> Reader <jv>contents</jv>) <jk>throws</jk> Exception { - | <jk>return</jk> getServletConfig().getConfig().load(<jv>contents</jv>, <jk>true</jk>).asMap(); - | } - | - | <ja>@RestPut</ja>(path=<js>"/{section}"</js>, - | description=<js>"Add or overwrite a config file section."</js>, - | swagger={ - | <js>"parameters:["</js>, - | <js>"{name:'section',in:'path',description:'Section name.'}"</js>, - | <js>"{in:'body',description:'New contents for section as a simple map with string keys and values.'}"</js>, - | <js>"]"</js> - | } - | ) - | <jk>public</jk> JsonMap setConfigSection(<ja>@Path</ja>(<js>"section"</js>) String <jv>section</jv>, <ja>@Body</ja> Map<String,String> <jv>contents</jv>) <jk>throws</jk> Exception { - | getServletConfig().getConfig().setSection(<jv>section</jv>, <jv>contents</jv>); - | <jk>return</jk> getSection(section); - | } - | - | <ja>@RestPut</ja>(path=<js>"/{section}/{key}"</js>, - | description=<js>"Add or overwrite a config file entry."</js>, - | swagger={ - | <js>"parameters:["</js>, - | <js>"{name:'section',in:'path',description:'Section name.'}"</js>, - | <js>"{name:'key',in:'path',description:'Entry name.'}"</js>, - | <js>"{in:'body',description:'New value as a string.'}"</js>, - | <js>"]"</js> - | } - | ) - | <jk>public</jk> String setConfigSection(<ja>@Path</ja>(<js>"section"</js>) String <jv>section</jv>, <ja>@Path</ja>(<js>"key"</js>) String <jv>key</jv>, <ja>@Body</ja> String <jv>value</jv>) <jk>throws</jk> Exception { - | getServletConfig().getConfig().put(<jv>section</jv>, <jv>key</jv>, <jv>value</jv>, <jk>false</jk>); - | <jk>return</jk> getSection(<jv>section</jv>).getString(<jv>key</jv>); - | } - | - | <jk>private</jk> JsonMap getSection(String <jv>name</jv>) { - | JsonMap <jv>map</jv> = getServletConfig().getConfig().getSectionMap(<jv>name</jv>); - | <jk>if</jk> (<jv>map</jv> == <jk>null</jk>) - | <jk>throw new</jk> RestException(<jsf>SC_NOT_FOUND</jsf>, <js>"Section not found."</js>); - | <jk>return</jk> <jv>map</jv>; - | } - | } - </p> -</div> \ No newline at end of file diff --git a/juneau-doc/docs/Topics/17.juneau-examples-rest/05.jer.LogsResource.html b/juneau-doc/docs/Topics/17.juneau-examples-rest/05.jer.LogsResource.html deleted file mode 100644 index b93308acd..000000000 --- a/juneau-doc/docs/Topics/17.juneau-examples-rest/05.jer.LogsResource.html +++ /dev/null @@ -1,30 +0,0 @@ -<!-- -/*************************************************************************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - ***************************************************************************************************************************/ - --> - -{title:'LogsResource', flags:'todo'} - -<div class='topic'> - <p> - The {@link oaj.microservice.resources.LogsResource} class is a reusable predefined resource. - It provides a REST interface for the log files generated by the microservice. - </p> - <p> - Pointing a browser to the resource shows the following: - </p> - <p class='bcode'> - | http://localhost:10000/logs - </p> - <img class='bordered w800' src='doc-files/jer.LogsResource.1.png'> -</div> \ No newline at end of file diff --git a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.AtomFeedResource.1.png b/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.AtomFeedResource.1.png deleted file mode 100644 index 89ad0cb41..000000000 Binary files a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.AtomFeedResource.1.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.AtomFeedResource.2.png b/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.AtomFeedResource.2.png deleted file mode 100644 index 3f7ff40e4..000000000 Binary files a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.AtomFeedResource.2.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.AtomFeedResource.3.png b/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.AtomFeedResource.3.png deleted file mode 100644 index 1c6aebd17..000000000 Binary files a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.AtomFeedResource.3.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.ConfigResource.1.png b/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.ConfigResource.1.png deleted file mode 100644 index 38fb7346e..000000000 Binary files a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.ConfigResource.1.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.ConfigResource.2.png b/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.ConfigResource.2.png deleted file mode 100644 index 0a33d35a5..000000000 Binary files a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.ConfigResource.2.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.HelloWorldResource.1.png b/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.HelloWorldResource.1.png deleted file mode 100644 index a826c988e..000000000 Binary files a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.HelloWorldResource.1.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.HelloWorldResource.2.png b/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.HelloWorldResource.2.png deleted file mode 100644 index 97726358a..000000000 Binary files a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.HelloWorldResource.2.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.JsonSchemaResource.1.png b/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.JsonSchemaResource.1.png deleted file mode 100644 index e2755341b..000000000 Binary files a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.JsonSchemaResource.1.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.JsonSchemaResource.2.png b/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.JsonSchemaResource.2.png deleted file mode 100644 index 68c65d37d..000000000 Binary files a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.JsonSchemaResource.2.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.LogsResource.1.png b/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.LogsResource.1.png deleted file mode 100644 index f6cea03ad..000000000 Binary files a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.LogsResource.1.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.RootResources.1.png b/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.RootResources.1.png deleted file mode 100644 index f5cdf9b89..000000000 Binary files a/juneau-doc/docs/Topics/17.juneau-examples-rest/doc-files/jer.RootResources.1.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/01.jerj.Installing.html b/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/01.jerj.Installing.html deleted file mode 100644 index 34b0ad433..000000000 --- a/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/01.jerj.Installing.html +++ /dev/null @@ -1,291 +0,0 @@ -<!-- -/*************************************************************************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - ***************************************************************************************************************************/ - --> - -{title:'Installing in Eclipse', created:'8.0.0', deprecated:'8.1.2', flags:'todo'} - -<div class='topic'> - <p> - Follow these instructions to import the REST examples project using Jetty into Eclipse. - </p> - <ol class='spaced-list'> - <li> - Download the <c>juneau-examples-rest-jetty-{@property juneauVersion}.zip</c> file from the downloads page - (located in the binaries) and import it into your workspace as an existing project: - <br><br> - <img class='bordered' src='doc-files/jerj.Installing.1.png' style='width:524px'> - <li> - Select the archive file and import the project: - <br><br> - <img class='bordered' src='doc-files/jerj.Installing.2.png' style='width:549px'> - <li> - In your workspace, you should now see the following project: - <br><br> - <img class='bordered' src='doc-files/jerj.Installing.3.png' style='width:400px'> - </ol> - <p> - The important elements in this project are: - </p> - <ul class='spaced-list'> - <li> - <l>App.java</l> - The entry point. - <br>This class creates and starts our microservice: - <br><br> - <p class='bjava'> - <jk>public class</jk> App { - - <jk>public static void</jk> main(String[] args) <jk>throws</jk> Exception { - JettyMicroservice - .<jsm>create</jsm>() - .args(args) - .servlet(RootResources.<jk>class</jk>) - .build() - .start() - .startConsole() - .join(); - } - } - </p> - <li> - <l>RootResources.java</l> - The top-level REST resource. - <br>This class routes HTTP requests to child resources: - <br><br> - <p class='bjava'> - <ja>@Rest</ja>( - path=<js>"/*"</js>, - title=<js>"Root resources"</js>, - description=<js>"Example of a router resource page."</js>, - htmldoc=<ja>@HtmlDoc</ja>( - widgets={ - ContentTypeMenuItem.<jk>class</jk>, - ThemeMenuItem.<jk>class</jk> - }, - navlinks={ - <js>"options: ?method=OPTIONS"</js>, - <js>"$W{ContentTypeMenuItem}"</js>, - <js>"$W{ThemeMenuItem}"</js>, - <js>"source: $C{Source/gitHub}/org/apache/juneau/examples/rest/$R{servletClassSimple}.java"</js> - }, - aside={ - <js>"<div style='max-width:400px' class='text'>"</js>, - <js>" <p>This is an example of a 'router' page that serves as a jumping-off point to child resources.</p>"</js>, - <js>" <p>Resources can be nested arbitrarily deep through router pages.</p>"</js>, - <js>" <p>Note the <span class='link'>options</span> link provided that lets you see the generated swagger doc for this page.</p>"</js>, - <js>" <p>Also note the <span class='link'>sources</span> link on these pages to view the source code for the page.</p>"</js>, - <js>" <p>All content on pages in the UI are serialized POJOs. In this case, it's a serialized array of beans with 2 properties, 'name' and 'description'.</p>"</js>, - <js>" <p>Other features (such as this aside) are added through annotations.</p>"</js>, - <js>"</div>"</js> - } - ), - children={ - HelloWorldResource.<jk>class</jk>, - PetStoreResource.<jk>class</jk>, - DtoExamples.<jk>class</jk>, - ConfigResource.<jk>class</jk>, - LogsResource.<jk>class</jk>, - ShutdownResource.<jk>class</jk> - } - ) - <ja>@SerializerConfig</ja>( - <jc>// For testing purposes, we want to use single quotes in all the serializers so it's easier to do simple - // String comparisons.</jc> - quoteChar=<js>"'"</js> - ) - <jk>public class</jk> RootResources <jk>extends</jk> BasicRestServletGroup <jk>implements</jk> BasicUniversalConfig { - <jc>// No code</jc> - } - </p> - <li> - <l>jerj.cfg</l> - The external configuration file. - <br>Contains various useful settings. - <br>Can be used for your own resource configurations. - <br><br> - <p class='bini'> - <cc>#======================================================================================================================= - # Basic configuration file for REST microservices - # Subprojects can use this as a starting point. - #=======================================================================================================================</cc> - - <cc>#======================================================================================================================= - # Jetty settings - #=======================================================================================================================</cc> - <cs>[Jetty]</cs> - - <cc># Path of the jetty.xml file used to configure the Jetty server.</cc> - <ck>config</ck> = <cv>jetty.xml</cv> - - <cc># Resolve Juneau variables in the jetty.xml file.</cc> - <ck>resolveVars</ck> = <cv>true</cv> - - <cc># Port to use for the jetty server. - # You can specify multiple ports. The first available will be used. '0' indicates to try a random port. - # The resulting available port gets set as the system property "availablePort" which can be referenced in the - # jetty.xml file as "$S{availablePort}" (assuming resolveVars is enabled).</cc> - <ck>port</ck> = <cv>10000,0,0,0</cv> - - <cc># Optionally specify your servlets here: - #servlets = org.apache.juneau.microservice.sample.RootResources</cc> - - <cc>#======================================================================================================================= - # REST settings - #=======================================================================================================================</cc> - <cs>[REST]</cs> - - <cc># Comma-delimited list of key-value pairs that represent locations of static files that can be served up by your @Rest-annotated - # classes. These are static files that are served up by the servlet under the specified sub-paths. - # For example, given the following setting... - # staticFiles = htdocs:my-docs,styles/my-styles - # ...the URI "/servletPath/htdocs/javadoc.css" resolves to the path "/my-docs/javadoc.css". - # This path can be relative to the working directory, classpath root, or package of your resource class. - # Used by the BasicRestConfig interface that defines the following value: - # staticFiles="$C{REST/staticFiles}"</cc> - <ck>staticFiles</ck> = htdocs:htdocs - - <cc># Stylesheet to use for HTML views. - # Used by the BasicRestConfig interface that defines the following value: - # stylesheet="$C{REST/theme,servlet:/htdocs/themes/devops.css}"</cc> - <ck>theme</ck> = <cv>servlet:/htdocs/themes/devops.css</cv> - - <cc># Various look-and-feel settings used in the BasicRestConfig interface.</cc> - <ck>headerIcon</ck> = <cv>servlet:/htdocs/images/juneau.png</cv> - <ck>headerLink</ck> = <cv>http://juneau.apache.org</cv> - <ck>footerIcon</ck> = <cv>servlet:/htdocs/images/asf.png</cv> - <ck>footerLink</ck> = <cv>http://www.apache.org</cv> - <ck>favicon</ck> = <cv>$C{REST/headerIcon}</cv> - <ck>header</ck> = - <cv><a href='$U{$C{REST/headerLink}}'> - <img src='$U{$C{REST/headerIcon}}' style='position:absolute;top:5;right:5;background-color:transparent;height:30px'/> - </a></cv> - <ck>footer</ck> = - <cv><a href='$U{$C{REST/footerLink}}'> - <img src='$U{$C{REST/footerIcon}}' style='float:right;padding-right:20px;height:32px'/> - </a></cv> - - <cc>#======================================================================================================================= - # Console settings - #=======================================================================================================================</cc> - <cs>[Console]</cs> - - <ck>enabled</ck> = <cv>true</cv> - - <cc># List of available console commands. - # These are classes that implements ConsoleCommand that allow you to submit commands to the microservice via - # the console. - # When listed here, the implementations must provide a no-arg constructor. - # They can also be provided dynamically by overriding the Microservice.createConsoleCommands() method.</cc> - <ck>commands</ck> = - <cv>org.apache.juneau.microservice.console.ExitCommand, - org.apache.juneau.microservice.console.RestartCommand, - org.apache.juneau.microservice.console.HelpCommand, - org.apache.juneau.microservice.console.ConfigCommand</cv> - - <cc>#======================================================================================================================= - # Logger settings - #----------------------------------------------------------------------------------------------------------------------- - # See FileHandler Java class for details. - #=======================================================================================================================</cc> - <cs>[Logging]</cs> - - ... - - <cc>#======================================================================================================================= - # System properties - #----------------------------------------------------------------------------------------------------------------------- - # These are arbitrary system properties that are set during startup. - #=======================================================================================================================</cc> - <cs>[SystemProperties]</cs> - - <cc># Configure Jetty for StdErrLog Logging - # org.eclipse.jetty.util.log.class = org.eclipse.jetty.util.log.StrErrLog</cc> - - <cc># Configure Jetty to log using java-util logging</cc> - <ck>org.eclipse.jetty.util.log.class</ck> = <cv>org.apache.juneau.microservice.jetty.JettyLogger</cv> - - <cc># Jetty logging level - # Possible values: ALL, DEBUG, INFO, WARN, OFF</cc> - <ck>org.eclipse.jetty.LEVEL</ck> = <cv>WARN - - <ck>derby.stream.error.file</ck> = <cv>$C{Logging/logDir}/derby-errors.log</cv> - </p> - <li> - <l>jetty.xml</l> - The Jetty configuration file. - <br>A bare-bones config file that can be extended to use any Jetty features. - <br><br> - <p class='bxml'> - <xt><Configure</xt> <xa>id</xa>=<xs>"ExampleServer"</xs> <xa>class</xa>=<xs>"org.eclipse.jetty.server.Server"</xs>></xt> - - <xt><Set</xt> <xa>name</xa>=<xs>"connectors"</xs><xt>></xt> - <xt><Array</xt> <xa>type</xa>=<xs>"org.eclipse.jetty.server.Connector"</xs><xt>></xt> - <xt><Item></xt> - <xt><New</xt> <xa>class</xa>=<xs>"org.eclipse.jetty.server.ServerConnector"</xs><xt>></xt> - <xt><Arg></xt> - <xt><Ref</xt> <xa>refid</xa>=<xs>"ExampleServer"</xs><xt>/></xt> - <xt></Arg></xt> - <xt><Set</xt> <xa>name</xa>=<xs>"port"</xs><xt>></xt>$S{availablePort,8080}<xt></Set></xt> - <xt></New></xt> - <xt></Item></xt> - <xt></Array></xt> - <xt></Set></xt> - - <xt><New</xt> <xa>id</xa>=<xs>"context"</xs> <xa>class</xa>=<xs>"org.eclipse.jetty.servlet.ServletContextHandler"</xs><xt>></xt> - <xt><Set</xt> <xa>name</xa>=<xs>"contextPath"</xs><xt>>/</Set></xt> - <xc><!-- Optionally specify your servlets here --> - <!--Call name="addServlet"> - <Arg>org.apache.juneau.microservice.sample.RootResources</Arg> - <Arg>/*</Arg> - </Call--></xc> - <xt><Set</xt> <xa>name</xa>=<xs>"sessionHandler"</xs><xt>></xt> - <xt><New</xt> <xa>class</xa>=<xs>"org.eclipse.jetty.server.session.SessionHandler"</xs><xt>/></xt> - <xt></Set></xt> - <xt></New></xt> - - <xt><Set</xt> <xa>name</xa>=<xs>"handler"</xs><xt>></xt> - <xt><New</xt> <xa>class</xa>=<xs>"org.eclipse.jetty.server.handler.HandlerCollection"</xs><xt>></xt> - <xt><Set</xt> <xa>name</xa>=<xs>"handlers"</xs><xt>></xt> - <xt><Array</xt> <xa>type</xa>=<xs>"org.eclipse.jetty.server.Handler"</xs><xt>></xt> - <xt><Item></xt> - <xt><Ref</xt> <xa>refid</xa>=<xs>"context"</xs><xt>/></xt> - <xt></Item></xt> - <xt><Item></xt> - <xt><New</xt> <xa>class</xa>=<xs>"org.eclipse.jetty.server.handler.DefaultHandler"</xs><xt>/></xt> - <xt></Item></xt> - <xt></Array></xt> - <xt></Set></xt> - <xt></New></xt> - <xt></Set></xt> - - <xt><Set</xt> <xa>name</xa>=<xs>"requestLog"</xs><xt>></xt> - <xt><New</xt> <xa>id</xa>=<xs>"RequestLogImpl"</xs> <xa>class</xa>=<xs>"org.eclipse.jetty.server.NCSARequestLog"</xs><xt>></xt> - <xt><Set</xt> <xa>name</xa>=<xs>"filename"</xs><xt>><Property</xt> <xa>name</xa>=<xs>"jetty.logs"</xs> <xa>default</xa>=<xs>"$C{Logging/logDir,logs}"</xs><xt>/></xt>/jetty-requests.log<xt></Set></xt> - <xt><Set</xt> <xa>name</xa>=<xs>"filenameDateFormat</xs><xt>"></xt>yyyy_MM_dd<xt></Set></xt> - <xt><Set</xt> <xa>name</xa>=<xs>"LogTimeZone"</xs><xt>></xt>GMT<xt></Set></xt> - <xt><Set</xt> <xa>name</xa>=<xs>"retainDays"</xs><xt>></xt>90<xt></Set></xt> - <xt><Set</xt> <xa>name</xa>=<xs>"append"</xs><xt>></xt>false<xt></Set></xt> - <xt><Set</xt> <xa>name</xa>=<xs>"LogLatency"</xs><xt>></xt>true<xt></Set></xt> - <xt></New></xt> - <xt></Set></xt> - - <xt><Get</xt> <xa>name</xa>=<xs>"ThreadPool"</xs><xt>></xt> - <xt><Set</xt> <xa>name</xa>=<xs>"minThreads"</xs> <xa>type</xa>=<xs>"int"</xs><xt>></xt>10<xt></Set></xt> - <xt><Set</xt> <xa>name</xa>=<xs>"maxThreads"</xs> <xa>type</xa>=<xs>"int"</xs><xt>></xt>100<xt></Set></xt> - <xt><Set</xt> <xa>name</xa>=<xs>"idleTimeout"</xs> <xa>type</xa>=<xs>"int"</xs><xt>></xt>60000<xt></Set></xt> - <xt><Set</xt> <xa>name</xa>=<xs>"detailedDump"</xs><xt>></xt>true<xt></Set></xt> - <xt></Get></xt> - <xt></Configure></xt> - </p> - </ul> - <p> - At this point, you're ready to start the microservice from your workspace. - </p> -</div> \ No newline at end of file diff --git a/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/02.jerj.Running.html b/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/02.jerj.Running.html deleted file mode 100644 index 65754a46c..000000000 --- a/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/02.jerj.Running.html +++ /dev/null @@ -1,49 +0,0 @@ -<!-- -/*************************************************************************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - ***************************************************************************************************************************/ - --> - -{title:'Running in Eclipse', created:'8.0.0', deprecated:'8.1.2', flags:'todo'} - -<div class='topic'> - <p> - The <l>jerj.launch</l> file is already provided to allow you to quickly start - your new microservice. - </p> - <p> - Go to <b>Run -> Run Configurations -> Java Application -> juneau-examples-rest-jetty</b> and click <b>Run</b>. - In your console view, you should see the following output: - </p> - <p class='bconsole'> - | Running class 'JettyMicroservice' using config file 'jerj.cfg'. - | Server started on port 10000 - | - | List of available commands: - | exit -- Shut down service - | restart -- Restarts service - | help -- Commands help - | - | > - </p> - <p> - Now open your browser and point to <l>http://localhost:10000</l>. - You should see the following: - </p> - <p class='bcode w400'> - | http://localhost:10000 - </p> - <img class='bordered w400' src='doc-files/jerj.Running.1.png'> - <p> - You can enter the command <c>exit</c> to shut it down. - </p> -</div> \ No newline at end of file diff --git a/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/03.jerj.Building.html b/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/03.jerj.Building.html deleted file mode 100644 index 73d81260b..000000000 --- a/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/03.jerj.Building.html +++ /dev/null @@ -1,60 +0,0 @@ -<!-- -/*************************************************************************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - ***************************************************************************************************************************/ - --> - -{title:'Building and Running from Command-Line', created:'8.0.0', deprecated:'8.1.2', flags:'todo'} - -<div class='topic'> - <p> - The <l>pom.xml</l> file is a basic Maven build script for creating the examples microservice - as an executable uber-jar. - </p> - <p> - The easiest way to build the microservice is to run the following from the project root. - </p> - <p class='bconsole'> - | mvn clean install - </p> - <p> - Your <c>target</c> directory should now contain the following files: - </p> - <ul> - <li><c>juneau-examples-rest-jetty-1.0.jar</c> - <li><c>jerj.cfg</c> - </ul> - <p> - To start from a command line, run the following command from inside your <c>target</c> directory: - </p> - <p class='bconsole'> - | java -jar juneau-examples-rest-jetty-1.0.jar - </p> - <p> - You should see the following console output: - </p> - <p class='bconsole'> - | Running class 'JettyMicroservice' using config file 'jerj.cfg'. - | Server started on port 10000 - | - | List of available commands: - | exit -- Shut down service - | restart -- Restarts service - | help -- Commands help - | - | > - </p> - <p> - If you get this error message: <code class='snippet'>java.net.BindException: Address already in use</code>, - then this microservice is already running elsewhere and so it cannot bind to port 10000. - </p> -</div> \ No newline at end of file diff --git a/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/doc-files/jerj.Installing.1.png b/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/doc-files/jerj.Installing.1.png deleted file mode 100644 index 3b9b4e177..000000000 Binary files a/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/doc-files/jerj.Installing.1.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/doc-files/jerj.Installing.2.png b/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/doc-files/jerj.Installing.2.png deleted file mode 100644 index 38ffe393c..000000000 Binary files a/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/doc-files/jerj.Installing.2.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/doc-files/jerj.Installing.3.png b/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/doc-files/jerj.Installing.3.png deleted file mode 100644 index d01d24ff3..000000000 Binary files a/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/doc-files/jerj.Installing.3.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/doc-files/jerj.Running.1.png b/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/doc-files/jerj.Running.1.png deleted file mode 100644 index 3eff3a5b7..000000000 Binary files a/juneau-doc/docs/Topics/18.juneau-examples-rest-jetty/doc-files/jerj.Running.1.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot.html b/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot.html deleted file mode 100644 index b74c01dc6..000000000 --- a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot.html +++ /dev/null @@ -1,38 +0,0 @@ -<!-- -/*************************************************************************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - ***************************************************************************************************************************/ - --> - -{title:'juneau-examples-rest-springboot', created:'8.0.0', flags:'todo'} - -<div class='topic'> - <h5 class='figure'>Starter Project Zip</h5> - <p class='bcode w500'> - | juneau-examples-rest-springboot-{@property juneauVersion}.zip - </p> - - <p> - The <c>juneau-examples-rest-springboot</c> library contains the same examples as <c>juneau-examples-rest</c> - but also includes the following: - </p> - <ul class='spaced-list'> - <li> - A starter class for invoking the examples using Spring Boot. - <li> - A resource resolver for resolving REST resources as injectable beans. - <li> - A POM that extends from <c>spring-boot-starter-parent</c> that allows you to build a fully-shaded executable jar. - <li> - Configuration files for deploying the microservice to Heroku. - </ul> -</div> \ No newline at end of file diff --git a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/01.jers.Installing.html b/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/01.jers.Installing.html deleted file mode 100644 index 5a392929a..000000000 --- a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/01.jers.Installing.html +++ /dev/null @@ -1,157 +0,0 @@ -<!-- -/*************************************************************************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - ***************************************************************************************************************************/ - --> - -{title:'Installing in Eclipse', created:'8.0.0', flags:'todo'} - -<div class='topic'> - <p> - Follow these instructions to import the REST examples project using Spring Boot into Eclipse. - </p> - <ol class='spaced-list'> - <li> - Download the <c>juneau-examples-rest-springboot-{@property juneauVersion}.zip</c> file from the downloads page - (located in the binaries) and import it into your workspace as an existing project: - <br><br> - <img class='bordered' src='doc-files/jers.Installing.1.png' style='width:524px'> - <li> - Select the archive file and import the project: - <br><br> - <img class='bordered' src='doc-files/jers.Installing.2.png' style='width:549px'> - <li> - In your workspace, you should now see the following project: - <br><br> - <img class='bordered' src='doc-files/jers.Installing.3.png' style='width:400px'> - </ol> - <p> - The important elements in this project are: - </p> - <ul class='spaced-list'> - <li> - <l>App.java</l> - The entry point. - <br>This class creates and starts our microservice. - <br>Note that we're using the existing Spring Boot application logic for the microservice and we're retrieving - our root resource as a spring bean. - <br>Only the top-level resource needs to be annotated with {@del oaj.rest.springboot.annotation.JuneauRestRoot @JuneauRestRoot} - <br><br> - <p class='bjava'> - <ja>@SpringBootApplication</ja> - <ja>@Controller</ja> - <jk>public class</jk> App { - - <jk>public static void</jk> main(String[] args) { - <jk>new</jk> SpringApplicationBuilder(App.<jk>class</jk>) - .initializers(<jk>new</jk> JuneauRestInitializer(App.<jk>class</jk>)) - .run(args); - } - - <ja>@Bean @JuneauRestRoot</ja> - <jk>public</jk> RootResources getRootResources() { - <jk>return new</jk> RootResources(); - } - } - </p> - <li> - <l>RootResources.java</l> - The top-level REST resource. - <br>This class routes HTTP requests to child resources: - <br><br> - <p class='bjava'> - <ja>@Rest</ja>( - path=<js>"/*"</js>, - title=<js>"Root resources"</js>, - description=<js>"Example of a router resource page."</js>, - htmldoc=<ja>@HtmlDoc</ja>( - widgets={ - ContentTypeMenuItem.<jk>class</jk>, - ThemeMenuItem.<jk>class</jk> - }, - navlinks={ - <js>"options: ?method=OPTIONS"</js>, - <js>"$W{ContentTypeMenuItem}"</js>, - <js>"$W{ThemeMenuItem}"</js>, - <js>"source: $C{Source/gitHub}/org/apache/juneau/examples/rest/$R{servletClassSimple}.java"</js> - }, - aside={ - <js>"<div style='max-width:400px' class='text'>"</js>, - <js>" <p>This is an example of a 'router' page that serves as a jumping-off point to child resources.</p>"</js>, - <js>" <p>Resources can be nested arbitrarily deep through router pages.</p>"</js>, - <js>" <p>Note the <span class='link'>options</span> link provided that lets you see the generated swagger doc for this page.</p>"</js>, - <js>" <p>Also note the <span class='link'>sources</span> link on these pages to view the source code for the page.</p>"</js>, - <js>" <p>All content on pages in the UI are serialized POJOs. In this case, it's a serialized array of beans with 2 properties, 'name' and 'description'.</p>"</js>, - <js>" <p>Other features (such as this aside) are added through annotations.</p>"</js>, - <js>"</div>"</js> - } - ), - children={ - HelloWorldResource.<jk>class</jk>, - PetStoreResource.<jk>class</jk>, - DtoExamples.<jk>class</jk>, - ConfigResource.<jk>class</jk>, - LogsResource.<jk>class</jk>, - ShutdownResource.<jk>class</jk> - } - ) - <ja>@SerializerConfig</ja>( - <jc>// For testing purposes, we want to use single quotes in all the serializers so it's easier to do simple - // String comparisons.</jc> - quoteChar=<js>"'"</js> - ) - <jk>public class</jk> RootResources <jk>extends</jk> BasicRestServletGroup <jk>implements</jk> BasicUniversalConfig { - <jc>// No code</jc> - } - </p> - <li> - <l>juneau.cfg</l> - The configuration file. - <br>Contains various useful settings. - <br>Can be used for your own resource configurations. - <br>Note that the Jetty configuration is not present. - <br>Also it's located in the classpath so that our microservice can be built as a single executable jar. - <br><br> - <p class='bini'> - <cc>#======================================================================================================================= - # Basic configuration file for REST microservices - # Subprojects can use this as a starting point. - #=======================================================================================================================</cc> - - <cc>#======================================================================================================================= - # REST settings - #=======================================================================================================================</cc> - <cs>[REST]</cs> - - <cc># URL mappings to static files in the working directory or classpath.</cc> - <ck>staticFiles</ck> = htdocs:files/htdocs - - <cc># Stylesheet to use for HTML views.</cc> - <ck>theme</ck> = <cv>servlet:/htdocs/themes/devops.css</cv> - - <ck>headerIcon</ck> = <cv>servlet:/htdocs/images/juneau.png</cv> - <ck>headerLink</ck> = <cv>http://juneau.apache.org</cv> - <ck>footerIcon</ck> = <cv>servlet:/htdocs/images/asf.png</cv> - <ck>footerLink</ck> = <cv>http://www.apache.org</cv> - - <ck>favicon</ck> = <cv>$C{REST/headerIcon}</cv> - <ck>header</ck> = - <cv><a href='$U{$C{REST/headerLink}}'> - <img src='$U{$C{REST/headerIcon}}' style='position:absolute;top:5;right:5;background-color:transparent;height:30px'/> - </a></cv> - <ck>footer</ck> = - <cv><a href='$U{$C{REST/footerLink}}'> - <img src='$U{$C{REST/footerIcon}}' style='float:right;padding-right:20px;height:32px'/> - </a></cv> - </p> - </ul> - <p> - At this point, you're ready to start the microservice from your workspace. - </p> -</div> \ No newline at end of file diff --git a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/02.jers.Running.html b/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/02.jers.Running.html deleted file mode 100644 index 24cff6e2c..000000000 --- a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/02.jers.Running.html +++ /dev/null @@ -1,48 +0,0 @@ -<!-- -/*************************************************************************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - ***************************************************************************************************************************/ - --> - -{title:'Running in Eclipse', created:'8.0.0', flags:'todo'} - -<div class='topic'> - <p> - The <l>jers.launch</l> file is already provided to allow you to quickly start - your new microservice. - </p> - <p> - Go to <b>Run -> Run Configurations -> Java Application -> juneau-examples-rest-springboot</b> and click <b>Run</b>. - In your console view, you should see the following output: - </p> - <p class='bconsole'> - | . ____ _ __ _ _ - | /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ - | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ - | \\/ ___)| |_)| | | | | || (_| | ) ) ) ) - | ' |____| .__|_| |_|_| |_\__, | / / / / - | =========|_|==============|___/=/_/_/_/ - | :: Spring Boot :: (v2.0.1.RELEASE) - | ... - | INFO: Tomcat started on port(s): 8080 (http) with context path '' - | Dec 21, 2012 12:30:00 AM org.springframework.boot.StartupInfoLogger logStarted - | INFO: Started App in 1.999 seconds (JVM running for 2.999) - </p> - <p> - Now open your browser and point to <l>http://localhost:5000</l>. - You should see the following: - </p> - <p class='bcode w400'> - | http://localhost:5000 - </p> - <img class='bordered w400' src='doc-files/jers.Running.1.png'> -</div> \ No newline at end of file diff --git a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/03.jers.Building.html b/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/03.jers.Building.html deleted file mode 100644 index edded7a7b..000000000 --- a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/03.jers.Building.html +++ /dev/null @@ -1,57 +0,0 @@ -<!-- -/*************************************************************************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - ***************************************************************************************************************************/ - --> - -{title:'Building and Running from Command-Line', created:'8.0.0', flags:'todo'} - -<div class='topic'> - <p> - The <l>pom.xml</l> file is a basic Maven build script for creating your microservice - as an executable uber-jar. - </p> - <p> - The easiest way to build your microservice is to run the following from the project root. - </p> - <p class='bconsole'> - | mvn clean install - </p> - <p> - Your <c>target</c> directory should now contain the following files: - </p> - <ul> - <li><c>juneau-examples-rest-springboot-1.0.jar</c> - </ul> - <p> - To start from a command line, run the following command from inside your <c>target</c> directory: - </p> - <p class='bconsole'> - | java -jar juneau-examples-rest-springboot-1.0.jar - </p> - <p> - You should see the following console output: - </p> - <p class='bconsole'> - | . ____ _ __ _ _ - | /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ - | ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ - | \\/ ___)| |_)| | | | | || (_| | ) ) ) ) - | ' |____| .__|_| |_|_| |_\__, | / / / / - | =========|_|==============|___/=/_/_/_/ - | :: Spring Boot :: (v2.0.1.RELEASE) - | ... - | INFO: Tomcat started on port(s): 8080 (http) with context path '' - | Dec 21, 2012 12:30:00 AM org.springframework.boot.StartupInfoLogger logStarted - | INFO: Started App in 1.999 seconds (JVM running for 2.999) - </p> -</div> \ No newline at end of file diff --git a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/04.jers.DeployingToHeroku.html b/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/04.jers.DeployingToHeroku.html deleted file mode 100644 index 504eea4ee..000000000 --- a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/04.jers.DeployingToHeroku.html +++ /dev/null @@ -1,153 +0,0 @@ -<!-- -/*************************************************************************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - ***************************************************************************************************************************/ - --> - -{title:'Deploying to Heroku', created:'8.0.0', flags:'todo'} - -<div class='topic'> - <p> - <a href='https://www.heroku.com'>Heroku</a> is a platform-as-a-service that allows applications to be quickly hosted - in the cloud. - The <l>juneau-examples-rest-springboot</l> project contains additional metadata files for quickly - deploying and running the examples in Heroku using free services. - </p> - <ul class='spaced-list'> - <li> - <l>app.json</l> - <br><br> - This class provides basic metadata information to Heroku about our application. - <br><br> - <p class='bjson'> - | { - | <jok>"name"</jok>: <jov>"Start on Heroku: Juneau REST Examples"</jov>, - | <jok>"description"</jok>: <jov>"Deployable REST examples to Heroku."</jov> - | } - </p> - <li> - <l>Procfile</l> - <br><br> - This class tells Heroku how to deploy our application using the Web dyno. - <br><br> - <p class='bcode'> - | web: java -jar target/juneau-examples-rest-springboot-8.0.0-SNAPSHOT.jar - </p> - <li> - <l>settings.xml</l> - <br><br>This is an optional Maven settings file that points to both the main Maven repo in - addition to the Apache snapshots repo if you happen to be using a snapshot version of Juneau. - </ul> - <p> - You'll need to sign up for an account on Heroku. - Afterwards, you can go to the apps page to create a new application: - </p> - <p class='bcode w1000'> - | https://dashboard.heroku.com/apps - </p> - <img class='bordered w1000' src='doc-files/jers.Heroku.1.png'> - - <p> - Click the <l>New</l> button to create a new app, give it a unique name: - </p> - <p class='bcode w1000'> - | https://dashboard.heroku.com/new-app - </p> - <img class='bordered w1000' src='doc-files/jers.Heroku.2.png'> - - <p> - After clicking the <l>Create app</l> button, you should see this page: - </p> - <p class='bcode w1000'> - | https://dashboard.heroku.com/apps/juneau-examples-rest/deploy/heroku-git - </p> - <img class='bordered w1000' src='doc-files/jers.Heroku.3.png'> - - <p> - For this example, we'll use the <l>Heroku Git</l> option for deploying our application. - Follow the instructions for installing the Heroku CLI and logging into Heroku: - </p> - <p class='bcode w1000'> - | https://dashboard.heroku.com/apps/juneau-examples-rest/deploy/heroku-git - </p> - <img class='bordered w1000' src='doc-files/jers.Heroku.4.png'> - - <p> - Next, run the following commands to cd into our Eclipse project and initialize it as a local git repo: - </p> - <p class='bconsole'> - | $ cd juneau-examples-rest-springboot/ - | $ git init - </p> - <h5 class='figure'>Output</h5> - <p class='bconsole'> - | $ cd juneau-examples-rest-springboot/ - | $ git init - | Initialized empty Git repository in /.../juneau-examples-rest-springboot/.git/ - </p> - - <p> - Next, run the following command to link our project to the Heroku app: - </p> - <p class='bconsole'> - | $ heroku git:remote -a juneau-examples-rest - </p> - <h5 class='figure'>Output</h5> - <p class='bconsole'> - | $ heroku git:remote -a juneau-examples-rest - | set git remote heroku to https://git.heroku.com/juneau-examples-rest.git - </p> - - <p> - Next, run the following commands to add our files to the git repo and push to the Heroku master branch: - </p> - <p class='bconsole'> - | $ git add . - | $ git commit -am "Initial deploy" - | $ git push heroku master - </p> - <h5 class='figure'>Output</h5> - <p class='bconsole'> - | $ git add . - | master (root-commit) 7c94cb9] Initial deploy - | 123 files changed, 11986 insertions(+) - | Counting objects: 127, done. - | $ git commit -am "Initial deploy" - | $ git push heroku master - | Delta compression using up to 8 threads. - | Compressing objects: 100% (113/113), done. - | Writing objects: 100% (127/127), 363.91 KiB | 21.41 MiB/s, done. - | ... - | remote: -----> Compressing... - | remote: Done: 85.9M - | remote: -----> Launching... - | remote: Released v3 - | remote: https://juneau-examples-rest.herokuapp.com/ deployed to Heroku - | remote: - | remote: Verifying deploy... done. - | To https://git.heroku.com/juneau-examples-rest.git - | * [new branch] master -> master - </p> - <p> - If no errors were shown, then our application should now be live. - You can click on the <l>Open app</l> button to open the examples application in a browser: - </p> - <img class='bordered w400' src='doc-files/jers.Heroku.5.png'> - - <p> - If everything worked, your browser should now be loaded with our example REST app: - </p> - <p class='bcode w1000'> - | https://juneau-examples-rest.herokuapp.com - </p> - <img class='bordered w1000' src='doc-files/jers.Heroku.6.png'> -</div> \ No newline at end of file diff --git a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Heroku.1.png b/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Heroku.1.png deleted file mode 100644 index d44ee0610..000000000 Binary files a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Heroku.1.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Heroku.2.png b/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Heroku.2.png deleted file mode 100644 index 24d3c2605..000000000 Binary files a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Heroku.2.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Heroku.3.png b/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Heroku.3.png deleted file mode 100644 index 47abc87ff..000000000 Binary files a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Heroku.3.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Heroku.4.png b/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Heroku.4.png deleted file mode 100644 index 7aa189ee2..000000000 Binary files a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Heroku.4.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Heroku.5.png b/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Heroku.5.png deleted file mode 100644 index d32ce52eb..000000000 Binary files a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Heroku.5.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Heroku.6.png b/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Heroku.6.png deleted file mode 100644 index 7bbce5d54..000000000 Binary files a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Heroku.6.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Installing.1.png b/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Installing.1.png deleted file mode 100644 index 3b9b4e177..000000000 Binary files a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Installing.1.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Installing.2.png b/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Installing.2.png deleted file mode 100644 index 045030b21..000000000 Binary files a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Installing.2.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Installing.3.png b/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Installing.3.png deleted file mode 100644 index 0563e0b4d..000000000 Binary files a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Installing.3.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Running.1.png b/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Running.1.png deleted file mode 100644 index 3eff3a5b7..000000000 Binary files a/juneau-doc/docs/Topics/19.juneau-examples-rest-springboot/doc-files/jers.Running.1.png and /dev/null differ diff --git a/juneau-doc/docs/Topics/20.juneau-petstore.html b/juneau-doc/docs/Topics/20.juneau-petstore.html deleted file mode 100644 index 57002a5db..000000000 --- a/juneau-doc/docs/Topics/20.juneau-petstore.html +++ /dev/null @@ -1,22 +0,0 @@ -<!-- -/*************************************************************************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - ***************************************************************************************************************************/ - --> - -{title:'juneau-pestore', created:'8.2.0', flags:'todo'} - -<div class='topic'> - <p> - TODO - </p> -</div> \ No newline at end of file diff --git a/juneau-doc/docs/Topics/21.Glossaries.html b/juneau-doc/docs/Topics/21.Glossaries.html deleted file mode 100644 index d173bc493..000000000 --- a/juneau-doc/docs/Topics/21.Glossaries.html +++ /dev/null @@ -1,21 +0,0 @@ -<!-- -/*************************************************************************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - ***************************************************************************************************************************/ - --> - -{title:'Glossaries', created:'8.1.3'} - -<div class='topic'> - <p> - </p> -</div> \ No newline at end of file diff --git a/juneau-doc/docs/Topics/22.Security.html b/juneau-doc/docs/Topics/22.Security.html deleted file mode 100644 index 05f0d6352..000000000 --- a/juneau-doc/docs/Topics/22.Security.html +++ /dev/null @@ -1,26 +0,0 @@ -<!-- -/*************************************************************************************************************************** - * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the - * specific language governing permissions and limitations under the License. - ***************************************************************************************************************************/ - --> - -{title:'Security Best-Practices'} - -<div class='topic'> - <p> - Security is always an ongoing concern in any library. - If you discover any security vulnerabilities in this code, please refer to the instructions found here: - </p> - <ul class='spaced-list'> - <li class='extlink'>{@doc http://www.apache.org/security SECURITY} - </ul> -</div> \ No newline at end of file diff --git a/juneau-examples/juneau-examples-rest-jetty/src/main/java/org/apache/juneau/examples/rest/jetty/App.java b/juneau-examples/juneau-examples-rest-jetty/src/main/java/org/apache/juneau/examples/rest/jetty/App.java index 54e601082..9018e3e26 100644 --- a/juneau-examples/juneau-examples-rest-jetty/src/main/java/org/apache/juneau/examples/rest/jetty/App.java +++ b/juneau-examples/juneau-examples-rest-jetty/src/main/java/org/apache/juneau/examples/rest/jetty/App.java @@ -27,7 +27,6 @@ import org.apache.juneau.microservice.jetty.*; * the resources and commands defined in that file. * * <ul class='seealso'> - * <li class='link'>{@doc juneau-examples-rest-jetty} * <li class='extlink'>{@source} * </ul> */ diff --git a/juneau-examples/juneau-examples-rest-springboot/src/main/java/org/apache/juneau/examples/rest/springboot/App.java b/juneau-examples/juneau-examples-rest-springboot/src/main/java/org/apache/juneau/examples/rest/springboot/App.java index 3351de7c8..ff9fe9e4a 100644 --- a/juneau-examples/juneau-examples-rest-springboot/src/main/java/org/apache/juneau/examples/rest/springboot/App.java +++ b/juneau-examples/juneau-examples-rest-springboot/src/main/java/org/apache/juneau/examples/rest/springboot/App.java @@ -26,7 +26,7 @@ import org.springframework.stereotype.Controller; * Entry point for Examples REST application when deployed as a Spring Boot application. * * <ul class='seealso'> - * <li class='link'>{@doc juneau-examples-rest-springboot} + * <li class='link'>{@doc jrss.Overview} * <li class='extlink'>{@source} * </ul> */ diff --git a/juneau-examples/juneau-examples-rest-springboot/src/main/java/org/apache/juneau/examples/rest/springboot/HelloWorldMessageProvider.java b/juneau-examples/juneau-examples-rest-springboot/src/main/java/org/apache/juneau/examples/rest/springboot/HelloWorldMessageProvider.java index 843708097..a634622a7 100644 --- a/juneau-examples/juneau-examples-rest-springboot/src/main/java/org/apache/juneau/examples/rest/springboot/HelloWorldMessageProvider.java +++ b/juneau-examples/juneau-examples-rest-springboot/src/main/java/org/apache/juneau/examples/rest/springboot/HelloWorldMessageProvider.java @@ -18,7 +18,7 @@ import java.util.function.*; * An example of a Spring bean that can be used for injecting messages into {@link HelloWorldResource}. * * <ul class='seealso'> - * <li class='link'>{@doc juneau-examples-rest-springboot} + * <li class='link'>{@doc jrss.Overview} * <li class='extlink'>{@source} * </ul> */ diff --git a/juneau-examples/juneau-examples-rest-springboot/src/main/java/org/apache/juneau/examples/rest/springboot/HelloWorldResource.java b/juneau-examples/juneau-examples-rest-springboot/src/main/java/org/apache/juneau/examples/rest/springboot/HelloWorldResource.java index 8a19c649b..ee1775904 100644 --- a/juneau-examples/juneau-examples-rest-springboot/src/main/java/org/apache/juneau/examples/rest/springboot/HelloWorldResource.java +++ b/juneau-examples/juneau-examples-rest-springboot/src/main/java/org/apache/juneau/examples/rest/springboot/HelloWorldResource.java @@ -23,7 +23,7 @@ import org.apache.juneau.rest.servlet.*; * Sample REST resource that prints out a simple "Hello world!" message. * * <ul class='seealso'> - * <li class='link'>{@doc juneau-examples-rest-springboot} + * <li class='link'>{@doc jrss.Overview} * <li class='extlink'>{@source} * </ul> */ diff --git a/juneau-examples/juneau-examples-rest-springboot/src/main/java/org/apache/juneau/examples/rest/springboot/RootResources.java b/juneau-examples/juneau-examples-rest-springboot/src/main/java/org/apache/juneau/examples/rest/springboot/RootResources.java index ac76a6104..1df56b6b8 100644 --- a/juneau-examples/juneau-examples-rest-springboot/src/main/java/org/apache/juneau/examples/rest/springboot/RootResources.java +++ b/juneau-examples/juneau-examples-rest-springboot/src/main/java/org/apache/juneau/examples/rest/springboot/RootResources.java @@ -26,7 +26,7 @@ import org.apache.juneau.serializer.annotation.*; * Sample REST resource showing how to implement a "router" resource page. * * <ul class='seealso'> - * <li class='link'>{@doc juneau-examples-rest-springboot} + * <li class='link'>{@doc jrss.Overview} * <li class='extlink'>{@source} * </ul> * diff --git a/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/RootResources.java b/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/RootResources.java index f90517184..af53c3d73 100644 --- a/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/RootResources.java +++ b/juneau-examples/juneau-examples-rest/src/main/java/org/apache/juneau/examples/rest/RootResources.java @@ -32,7 +32,6 @@ import org.apache.juneau.serializer.annotation.*; * @serial exclude */ @Rest( - path="/*", title="Root resources", description="Example of a router resource page.", children={ @@ -58,8 +57,9 @@ import org.apache.juneau.serializer.annotation.*; "<div class='text'>", " <p>This is an example of a 'router' page that serves as a jumping-off point to child resources.</p>", " <p>Resources can be nested arbitrarily deep through router pages.</p>", - " <p>Note the <span class='link'>options</span> link provided that lets you see the generated swagger doc for this page.</p>", - " <p>Also note the <span class='link'>sources</span> link on these pages to view the source code for the page.</p>", + " <p>Note the <span class='link'>API</span> link provided that lets you see the generated swagger doc for this page.</p>", + " <p>Also note the <span class='link'>STATS</span> link to view runtime statistics on this page.</p>", + " <p>Also note the <span class='link'>SOURCE</span> link to view the source code for the page.</p>", " <p>All content on pages in the UI are serialized POJOs. In this case, it's a serialized array of beans with 2 properties, 'name' and 'description'.</p>", " <p>Other features (such as this aside) are added through annotations.</p>", "</div>"
