├── .gitignore ├── CONTRIBUTING.md ├── LICENSE.md ├── NOTICE.md ├── README.md ├── firstcup.xml ├── pom.xml └── src ├── main └── jbake │ ├── assets │ ├── CONTRIBUTING.md │ ├── LICENSE.md │ ├── README.md │ ├── _config.yml │ ├── css │ │ └── style.css │ ├── img │ │ ├── eclipse_foundation_logo_tiny.png │ │ └── new-firstcup-architecture.png │ └── pr_doc_workflow.md │ ├── content │ ├── creating-example.adoc │ ├── creating-example001.adoc │ ├── creating-example002.adoc │ ├── intro.adoc │ ├── intro001.adoc │ ├── intro002.adoc │ ├── jakarta-ee.adoc │ ├── jakarta-ee001.adoc │ ├── jakarta-ee002.adoc │ ├── next-steps.adoc │ ├── next-steps001.adoc │ ├── next-steps002.adoc │ ├── preface.adoc │ ├── title.adoc │ ├── web-application.adoc │ ├── web-application001.adoc │ ├── web-application002.adoc │ ├── web-application003.adoc │ ├── web-application004.adoc │ ├── web-application005.adoc │ └── web-application006.adoc │ ├── jbake.properties │ └── templates │ ├── footer.ftl │ ├── header.ftl │ ├── menu.ftl │ └── page.ftl └── theme └── jakartaee-theme.yml /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | src/main/jbake/content/toc.adoc 3 | *.project 4 | *.settings 5 | *.classpath 6 | .idea 7 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Eclipse Jakarta EE Platform 2 | 3 | Thanks for your interest in this project. 4 | 5 | ## Project description 6 | 7 | The Eclipse Jakarta EE Platform project produces the Jakarta EE 8 | platform specification, which is an umbrella specification that 9 | aggregates all other Jakarta EE specifications. 10 | 11 | * [https://projects.eclipse.org/projects/ee4j.jakartaee-platform](https://projects.eclipse.org/projects/ee4j.jakartaee-platform) 12 | 13 | ## Developer resources 14 | 15 | Information regarding source code management, builds, coding standards, and 16 | more. 17 | 18 | * [https://projects.eclipse.org/projects/ee4j.jakartaee-platform/developer](https://projects.eclipse.org/projects/ee4j.jakartaee-platform/developer) 19 | 20 | The project maintains the following source code repositories 21 | 22 | * [https://github.com/eclipse-ee4j/jakartaee-platform](https://github.com/eclipse-ee4j/jakartaee-platform) 23 | * [https://github.com/eclipse-ee4j/jakartaee-tutorial](https://github.com/eclipse-ee4j/jakartaee-tutorial) 24 | * [https://github.com/eclipse-ee4j/jakartaee-tutorial-examples](https://github.com/eclipse-ee4j/jakartaee-tutorial-examples) 25 | * [https://github.com/eclipse-ee4j/jakartaee-firstcup](https://github.com/eclipse-ee4j/jakartaee-firstcup) 26 | * [https://github.com/eclipse-ee4j/jakartaee-firstcup-examples](https://github.com/eclipse-ee4j/jakartaee-firstcup-examples) 27 | * [https://github.com/eclipse-ee4j/jakartaee-schemas](https://github.com/eclipse-ee4j/jakartaee-schemas) 28 | 29 | ## Eclipse Contributor Agreement 30 | 31 | Before your contribution can be accepted by the project team contributors must 32 | electronically sign the Eclipse Contributor Agreement (ECA). 33 | 34 | * [http://www.eclipse.org/legal/ECA.php](http://www.eclipse.org/legal/ECA.php) 35 | 36 | Commits that are provided by non-committers must have a Signed-off-by field in 37 | the footer indicating that the author is aware of the terms by which the 38 | contribution has been provided to the project. The non-committer must 39 | additionally have an Eclipse Foundation account and must have a signed Eclipse 40 | Contributor Agreement (ECA) on file. 41 | 42 | For more information, please see the Eclipse Committer Handbook: 43 | [https://www.eclipse.org/projects/handbook/#resources-commit](https://www.eclipse.org/projects/handbook/#resources-commit) 44 | 45 | ## Contact 46 | 47 | Contact the project developers via the project's "dev" list. 48 | 49 | * [https://accounts.eclipse.org/mailing-list/jakartaee-platform-dev](https://accounts.eclipse.org/mailing-list/jakartaee-platform-dev) 50 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # Eclipse Public License - v 2.0 2 | 3 | THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE 4 | PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION 5 | OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. 6 | 7 | 1. DEFINITIONS 8 | 9 | "Contribution" means: 10 | 11 | a) in the case of the initial Contributor, the initial content 12 | Distributed under this Agreement, and 13 | 14 | b) in the case of each subsequent Contributor: 15 | i) changes to the Program, and 16 | ii) additions to the Program; 17 | where such changes and/or additions to the Program originate from 18 | and are Distributed by that particular Contributor. A Contribution 19 | "originates" from a Contributor if it was added to the Program by 20 | such Contributor itself or anyone acting on such Contributor's behalf. 21 | Contributions do not include changes or additions to the Program that 22 | are not Modified Works. 23 | 24 | "Contributor" means any person or entity that Distributes the Program. 25 | 26 | "Licensed Patents" mean patent claims licensable by a Contributor which 27 | are necessarily infringed by the use or sale of its Contribution alone 28 | or when combined with the Program. 29 | 30 | "Program" means the Contributions Distributed in accordance with this 31 | Agreement. 32 | 33 | "Recipient" means anyone who receives the Program under this Agreement 34 | or any Secondary License (as applicable), including Contributors. 35 | 36 | "Derivative Works" shall mean any work, whether in Source Code or other 37 | form, that is based on (or derived from) the Program and for which the 38 | editorial revisions, annotations, elaborations, or other modifications 39 | represent, as a whole, an original work of authorship. 40 | 41 | "Modified Works" shall mean any work in Source Code or other form that 42 | results from an addition to, deletion from, or modification of the 43 | contents of the Program, including, for purposes of clarity any new file 44 | in Source Code form that contains any contents of the Program. Modified 45 | Works shall not include works that contain only declarations, 46 | interfaces, types, classes, structures, or files of the Program solely 47 | in each case in order to link to, bind by name, or subclass the Program 48 | or Modified Works thereof. 49 | 50 | "Distribute" means the acts of a) distributing or b) making available 51 | in any manner that enables the transfer of a copy. 52 | 53 | "Source Code" means the form of a Program preferred for making 54 | modifications, including but not limited to software source code, 55 | documentation source, and configuration files. 56 | 57 | "Secondary License" means either the GNU General Public License, 58 | Version 2.0, or any later versions of that license, including any 59 | exceptions or additional permissions as identified by the initial 60 | Contributor. 61 | 62 | 2. GRANT OF RIGHTS 63 | 64 | a) Subject to the terms of this Agreement, each Contributor hereby 65 | grants Recipient a non-exclusive, worldwide, royalty-free copyright 66 | license to reproduce, prepare Derivative Works of, publicly display, 67 | publicly perform, Distribute and sublicense the Contribution of such 68 | Contributor, if any, and such Derivative Works. 69 | 70 | b) Subject to the terms of this Agreement, each Contributor hereby 71 | grants Recipient a non-exclusive, worldwide, royalty-free patent 72 | license under Licensed Patents to make, use, sell, offer to sell, 73 | import and otherwise transfer the Contribution of such Contributor, 74 | if any, in Source Code or other form. This patent license shall 75 | apply to the combination of the Contribution and the Program if, at 76 | the time the Contribution is added by the Contributor, such addition 77 | of the Contribution causes such combination to be covered by the 78 | Licensed Patents. The patent license shall not apply to any other 79 | combinations which include the Contribution. No hardware per se is 80 | licensed hereunder. 81 | 82 | c) Recipient understands that although each Contributor grants the 83 | licenses to its Contributions set forth herein, no assurances are 84 | provided by any Contributor that the Program does not infringe the 85 | patent or other intellectual property rights of any other entity. 86 | Each Contributor disclaims any liability to Recipient for claims 87 | brought by any other entity based on infringement of intellectual 88 | property rights or otherwise. As a condition to exercising the 89 | rights and licenses granted hereunder, each Recipient hereby 90 | assumes sole responsibility to secure any other intellectual 91 | property rights needed, if any. For example, if a third party 92 | patent license is required to allow Recipient to Distribute the 93 | Program, it is Recipient's responsibility to acquire that license 94 | before distributing the Program. 95 | 96 | d) Each Contributor represents that to its knowledge it has 97 | sufficient copyright rights in its Contribution, if any, to grant 98 | the copyright license set forth in this Agreement. 99 | 100 | e) Notwithstanding the terms of any Secondary License, no 101 | Contributor makes additional grants to any Recipient (other than 102 | those set forth in this Agreement) as a result of such Recipient's 103 | receipt of the Program under the terms of a Secondary License 104 | (if permitted under the terms of Section 3). 105 | 106 | 3. REQUIREMENTS 107 | 108 | 3.1 If a Contributor Distributes the Program in any form, then: 109 | 110 | a) the Program must also be made available as Source Code, in 111 | accordance with section 3.2, and the Contributor must accompany 112 | the Program with a statement that the Source Code for the Program 113 | is available under this Agreement, and informs Recipients how to 114 | obtain it in a reasonable manner on or through a medium customarily 115 | used for software exchange; and 116 | 117 | b) the Contributor may Distribute the Program under a license 118 | different than this Agreement, provided that such license: 119 | i) effectively disclaims on behalf of all other Contributors all 120 | warranties and conditions, express and implied, including 121 | warranties or conditions of title and non-infringement, and 122 | implied warranties or conditions of merchantability and fitness 123 | for a particular purpose; 124 | 125 | ii) effectively excludes on behalf of all other Contributors all 126 | liability for damages, including direct, indirect, special, 127 | incidental and consequential damages, such as lost profits; 128 | 129 | iii) does not attempt to limit or alter the recipients' rights 130 | in the Source Code under section 3.2; and 131 | 132 | iv) requires any subsequent distribution of the Program by any 133 | party to be under a license that satisfies the requirements 134 | of this section 3. 135 | 136 | 3.2 When the Program is Distributed as Source Code: 137 | 138 | a) it must be made available under this Agreement, or if the 139 | Program (i) is combined with other material in a separate file or 140 | files made available under a Secondary License, and (ii) the initial 141 | Contributor attached to the Source Code the notice described in 142 | Exhibit A of this Agreement, then the Program may be made available 143 | under the terms of such Secondary Licenses, and 144 | 145 | b) a copy of this Agreement must be included with each copy of 146 | the Program. 147 | 148 | 3.3 Contributors may not remove or alter any copyright, patent, 149 | trademark, attribution notices, disclaimers of warranty, or limitations 150 | of liability ("notices") contained within the Program from any copy of 151 | the Program which they Distribute, provided that Contributors may add 152 | their own appropriate notices. 153 | 154 | 4. COMMERCIAL DISTRIBUTION 155 | 156 | Commercial distributors of software may accept certain responsibilities 157 | with respect to end users, business partners and the like. While this 158 | license is intended to facilitate the commercial use of the Program, 159 | the Contributor who includes the Program in a commercial product 160 | offering should do so in a manner which does not create potential 161 | liability for other Contributors. Therefore, if a Contributor includes 162 | the Program in a commercial product offering, such Contributor 163 | ("Commercial Contributor") hereby agrees to defend and indemnify every 164 | other Contributor ("Indemnified Contributor") against any losses, 165 | damages and costs (collectively "Losses") arising from claims, lawsuits 166 | and other legal actions brought by a third party against the Indemnified 167 | Contributor to the extent caused by the acts or omissions of such 168 | Commercial Contributor in connection with its distribution of the Program 169 | in a commercial product offering. The obligations in this section do not 170 | apply to any claims or Losses relating to any actual or alleged 171 | intellectual property infringement. In order to qualify, an Indemnified 172 | Contributor must: a) promptly notify the Commercial Contributor in 173 | writing of such claim, and b) allow the Commercial Contributor to control, 174 | and cooperate with the Commercial Contributor in, the defense and any 175 | related settlement negotiations. The Indemnified Contributor may 176 | participate in any such claim at its own expense. 177 | 178 | For example, a Contributor might include the Program in a commercial 179 | product offering, Product X. That Contributor is then a Commercial 180 | Contributor. If that Commercial Contributor then makes performance 181 | claims, or offers warranties related to Product X, those performance 182 | claims and warranties are such Commercial Contributor's responsibility 183 | alone. Under this section, the Commercial Contributor would have to 184 | defend claims against the other Contributors related to those performance 185 | claims and warranties, and if a court requires any other Contributor to 186 | pay any damages as a result, the Commercial Contributor must pay 187 | those damages. 188 | 189 | 5. NO WARRANTY 190 | 191 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT 192 | PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS" 193 | BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR 194 | IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF 195 | TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR 196 | PURPOSE. Each Recipient is solely responsible for determining the 197 | appropriateness of using and distributing the Program and assumes all 198 | risks associated with its exercise of rights under this Agreement, 199 | including but not limited to the risks and costs of program errors, 200 | compliance with applicable laws, damage to or loss of data, programs 201 | or equipment, and unavailability or interruption of operations. 202 | 203 | 6. DISCLAIMER OF LIABILITY 204 | 205 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT 206 | PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS 207 | SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 208 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST 209 | PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 210 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 211 | ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE 212 | EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE 213 | POSSIBILITY OF SUCH DAMAGES. 214 | 215 | 7. GENERAL 216 | 217 | If any provision of this Agreement is invalid or unenforceable under 218 | applicable law, it shall not affect the validity or enforceability of 219 | the remainder of the terms of this Agreement, and without further 220 | action by the parties hereto, such provision shall be reformed to the 221 | minimum extent necessary to make such provision valid and enforceable. 222 | 223 | If Recipient institutes patent litigation against any entity 224 | (including a cross-claim or counterclaim in a lawsuit) alleging that the 225 | Program itself (excluding combinations of the Program with other software 226 | or hardware) infringes such Recipient's patent(s), then such Recipient's 227 | rights granted under Section 2(b) shall terminate as of the date such 228 | litigation is filed. 229 | 230 | All Recipient's rights under this Agreement shall terminate if it 231 | fails to comply with any of the material terms or conditions of this 232 | Agreement and does not cure such failure in a reasonable period of 233 | time after becoming aware of such noncompliance. If all Recipient's 234 | rights under this Agreement terminate, Recipient agrees to cease use 235 | and distribution of the Program as soon as reasonably practicable. 236 | However, Recipient's obligations under this Agreement and any licenses 237 | granted by Recipient relating to the Program shall continue and survive. 238 | 239 | Everyone is permitted to copy and distribute copies of this Agreement, 240 | but in order to avoid inconsistency the Agreement is copyrighted and 241 | may only be modified in the following manner. The Agreement Steward 242 | reserves the right to publish new versions (including revisions) of 243 | this Agreement from time to time. No one other than the Agreement 244 | Steward has the right to modify this Agreement. The Eclipse Foundation 245 | is the initial Agreement Steward. The Eclipse Foundation may assign the 246 | responsibility to serve as the Agreement Steward to a suitable separate 247 | entity. Each new version of the Agreement will be given a distinguishing 248 | version number. The Program (including Contributions) may always be 249 | Distributed subject to the version of the Agreement under which it was 250 | received. In addition, after a new version of the Agreement is published, 251 | Contributor may elect to Distribute the Program (including its 252 | Contributions) under the new version. 253 | 254 | Except as expressly stated in Sections 2(a) and 2(b) above, Recipient 255 | receives no rights or licenses to the intellectual property of any 256 | Contributor under this Agreement, whether expressly, by implication, 257 | estoppel or otherwise. All rights in the Program not expressly granted 258 | under this Agreement are reserved. Nothing in this Agreement is intended 259 | to be enforceable by any entity that is not a Contributor or Recipient. 260 | No third-party beneficiary rights are created under this Agreement. 261 | 262 | Exhibit A - Form of Secondary Licenses Notice 263 | 264 | "This Source Code may also be made available under the following 265 | Secondary Licenses when the conditions for such availability set forth 266 | in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), 267 | version(s), and exceptions or additional permissions here}." 268 | 269 | Simply including a copy of this Agreement, including this Exhibit A 270 | is not sufficient to license the Source Code under Secondary Licenses. 271 | 272 | If it is not possible or desirable to put the notice in a particular 273 | file, then You may include the notice in a location (such as a LICENSE 274 | file in a relevant directory) where a recipient would be likely to 275 | look for such a notice. 276 | 277 | You may add additional accurate notices of copyright ownership. -------------------------------------------------------------------------------- /NOTICE.md: -------------------------------------------------------------------------------- 1 | # Notices for Eclipse Jakarta EE Platform 2 | 3 | This content is produced and maintained by the Eclipse Jakarta EE Platform 4 | project. 5 | 6 | * Project home: https://projects.eclipse.org/projects/ee4j.jakartaee-platform 7 | 8 | ## Trademarks 9 | 10 | Eclipse Jakarta EE Platform is a trademark of the Eclipse Foundation. 11 | 12 | ## Copyright 13 | 14 | All content is the property of the respective authors or their employers. For 15 | more information regarding authorship of content, please consult the listed 16 | source code repository logs. 17 | 18 | ## Declared Project Licenses 19 | 20 | This program and the accompanying materials are made available under the terms 21 | of the Eclipse Public License v. 2.0 which is available at 22 | http://www.eclipse.org/legal/epl-2.0. 23 | 24 | SPDX-License-Identifier: EPL-2.0 25 | 26 | ## Source Code 27 | 28 | The project maintains the following source code repositories: 29 | 30 | * https://github.com/eclipse-ee4j/jakartaee-platform 31 | * https://github.com/eclipse-ee4j/jakartaee-tutorial 32 | * https://github.com/eclipse-ee4j/jakartaee-tutorial-examples 33 | * https://github.com/eclipse-ee4j/jakartaee-firstcup 34 | * https://github.com/eclipse-ee4j/jakartaee-firstcup-examples 35 | * https://github.com/eclipse-ee4j/jakartaee-schemas 36 | 37 | ## Third-party Content 38 | 39 | This project leverages the following third party content. 40 | 41 | W3C Documents for JakartaEE Schemas (n/a) 42 | 43 | * License: W3C-19980720 44 | * Project: https://github.com/eclipse-ee4j/jakartaee-schemas 45 | * Source: http://www.w3.org/2001 46 | 47 | ## Cryptography 48 | 49 | Content may contain encryption software. The country in which you are currently 50 | may have restrictions on the import, possession, and use, and/or re-export to 51 | another country, of encryption software. BEFORE using any encryption software, 52 | please check the country's laws, regulations and policies concerning the import, 53 | possession, or use, and re-export of encryption software, to see if this is 54 | permitted. 55 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # First Cup Tutorial 2 | 3 | This repository contains the source files that are used to build the 4 | _Jakarta Enterprise Edition Your First Cup: An Introduction to Jakarta EE_. 5 | The source files 6 | are authored in [AsciiDoc](http://asciidoc.org/). AsciiDoc is similar 7 | to markdown but is particularly suited for user documentation. This 8 | project also uses [JBake](http://jbake.org/). JBake is a static site 9 | generator that is inspired from Jekyll and written in Java. JBake uses 10 | templates for the structure of the page and the body of the page is 11 | generated from AsciiDoc content. 12 | 13 | Note that the First Cup Tutorial code examples are located in a 14 | separate repository 15 | [eclipse-ee4j/jakartaee-firstcup-examples](https://github.com/eclipse-ee4j/jakartaee-firstcup-examples). 16 | 17 | ## Contributing 18 | The easiest way to contribute is by opening an issue in this project 19 | that contains feedback and review comments. 20 | 21 | The First Cup Tutorial project is also open for contributions and your 22 | help is greatly appreciated. If you have an idea for the tutorial and 23 | want to add a section or update an existing section, then review the 24 | following links: 25 | 26 | * [Contribute](CONTRIBUTING.md) 27 | * [Pull Request Acceptance Workflow](src/main/jbake/assets/pr_doc_workflow.md) 28 | * [License](LICENSE.md) 29 | 30 | ## Building the First Cup Tutorial 31 | 32 | The following directions explain how to do local builds of the 33 | tutorial. Note that any changes that are pushed to the master branch 34 | automatically trigger a build of the site files and tutorial sources. 35 | The results are automatically pushed to the gh-pages branch. You can 36 | view the published site 37 | [here](https://eclipse-ee4j.github.io/jakartaee-firstcup). 38 | 39 | ### Pre-Requisites 40 | 41 | - Maven 42 | - JDK8+ 43 | 44 | Note that manually deploying the site requires password-less 45 | authentication. This is done by exporting your SSH public key into your 46 | GitHub account. 47 | 48 | ### Build the Site Locally 49 | 50 | The site is generated under `target/staging`. Open 51 | `file:///PATH_TO_PROJECT_DIR/target/staging` in a browser to view the 52 | output. 53 | 54 | ``` 55 | mvn generate-resources 56 | ``` 57 | 58 | You can also invoke the JBake plugin directly: 59 | 60 | ``` 61 | mvn jbake:build 62 | ``` 63 | 64 | #### Rebuild the Site on Changes 65 | 66 | The following command builds the site and, if kept running, detects 67 | changes to the sources and incrementally renders the site. This is 68 | convenient when writing content. 69 | 70 | ``` 71 | mvn jbake:watch 72 | ``` 73 | 74 | #### Serve the Site locally 75 | 76 | If a web server is required (for example, absolute paths are used), you 77 | can use the following command to start a Jetty web server at 78 | `http://localhost:8820`. The command also watches for changes and 79 | rebuilds incrementally. 80 | 81 | ``` 82 | mvn jbake:serve 83 | ``` 84 | 85 | 86 | ### Deploy the Site to Github Pages 87 | 88 | If you want to manually push a build to the gh-pages branch, use: 89 | 90 | ``` 91 | mvn deploy -Ppublish-site 92 | ``` 93 | Never commit changes to the gh-pages branch directly. 94 | 95 | ### Produce a Zip File for Download 96 | 97 | To produce a zip file containing the generated HTML files, use: 98 | 99 | ``` 100 | mvn package 101 | ``` 102 | 103 | When making a release on GitHub, this zip file should be added to the release. 104 | 105 | ## Links 106 | 107 | - [JBake maven plugin documentation](https://github.com/Blazebit/jbake-maven-plugin) 108 | - [JBake documentation](http://jbake.org/docs/2.5.1) 109 | - [Freemarker documentation](http://freemarker.org/docs) 110 | - [AsciiDoc User Guide](http://asciidoc.org/userguide.html) 111 | - [Asciidoctor quick reference](http://asciidoctor.org/docs/asciidoc-syntax-quick-reference) 112 | -------------------------------------------------------------------------------- /firstcup.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | firstcup 22 | 23 | zip 24 | 25 | firstcup 26 | 27 | 28 | target/generated-docs 29 | 30 | 31 | 32 | target/staging 33 | doc 34 | 35 | _config.yml 36 | _layouts/** 37 | assets/** 38 | *.md 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | org.eclipse.ee4j 22 | project 23 | 1.0.5 24 | 25 | 4.0.0 26 | jakarta.firstcup 27 | firstcup 28 | pom 29 | 9.1-SNAPSHOT 30 | First Cup of Jakarta EE Tutorial 31 | 32 | 33 | ${project.build.directory}/staging 34 | true 35 | 1.5.7.1 36 | 37 | 1.6.2 38 | 1.5.0-alpha.16 39 | 9.2.6.0 40 | 41 | DRAFT 42 | 43 | 44 | scm:git:git@github.com:eclipse-ee4j/jakartaee-firstcup.git 45 | scm:git:git@github.com:eclipse-ee4j/jakartaee-firstcup.git 46 | https://github.com/eclipse-ee4j/jakartaee-firstcup 47 | HEAD 48 | 49 | 50 | 51 | scm:git:git@github.com:eclipse-ee4j/jakartaee-firstcup.git 52 | 53 | 54 | 55 | package 56 | 57 | 58 | org.apache.maven.plugins 59 | maven-enforcer-plugin 60 | 1.4.1 61 | 62 | 63 | enforce-versions 64 | 65 | enforce 66 | 67 | 68 | 69 | 70 | [1.8.0,1.9.0) 71 | You need JDK8 or lower 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | org.glassfish.doc 80 | glassfish-doc-maven-plugin 81 | 82 | 83 | generate-toc 84 | generate-resources 85 | 86 | toc 87 | 88 | 89 | 90 | [0-9]+\s.*,Preface.*,Part\s.* 91 | 92 | JEET.* 93 | 94 | 95 | 96 | generate-book 97 | generate-resources 98 | 99 | book 100 | 101 | 102 | 103 | 104 | 105 | com.blazebit 106 | jbake-maven-plugin 107 | 1.0.0 108 | 109 | ${site.output.dir} 110 | 111 | ${status} 112 | 113 | 114 | 115 | 116 | build-site 117 | generate-resources 118 | 119 | build 120 | 121 | 122 | 123 | 124 | 125 | org.asciidoctor 126 | asciidoctorj 127 | 1.5.5 128 | 129 | 130 | 131 | 132 | org.asciidoctor 133 | asciidoctor-maven-plugin 134 | ${asciidoctor.maven.plugin.version} 135 | 136 | 137 | org.jruby 138 | jruby-complete 139 | ${jruby.version} 140 | 141 | 142 | org.asciidoctor 143 | asciidoctorj 144 | ${asciidoctorj.version} 145 | 146 | 147 | org.asciidoctor 148 | asciidoctorj-pdf 149 | ${asciidoctorj.pdf.version} 150 | 151 | 152 | 153 | ${project.build.directory}/book 154 | book.adoc 155 | 156 | ${project.build.directory}/staging/ 157 | pdf 158 | FirstCup.pdf 159 | 160 | ${project.basedir}/src/theme 161 | jakartaee 162 | book 163 | ${status} 164 | 165 | font 166 | 167 | 168 | font 169 | true 170 | 171 | - 172 | true 173 | true 174 | 175 | 176 | 177 | 178 | generate-pdf-doc 179 | generate-resources 180 | 181 | process-asciidoc 182 | 183 | 184 | 185 | 186 | 187 | org.apache.maven.plugins 188 | maven-release-plugin 189 | 2.5.2 190 | 191 | forked-path 192 | false 193 | ${release.arguments} 194 | 195 | 196 | 197 | org.apache.maven.scm 198 | maven-scm-provider-gitexe 199 | 1.9.4 200 | 201 | 202 | 203 | 204 | 207 | 208 | maven-assembly-plugin 209 | false 210 | 211 | 212 | package 213 | 214 | single 215 | 216 | 217 | 218 | firstcup.xml 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | org.glassfish.doc 230 | glassfish-doc-maven-plugin 231 | 1.2 232 | 233 | 234 | org.apache.maven.plugins 235 | maven-assembly-plugin 236 | 2.4 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | publish-site 245 | 246 | ${project.build.directory}/staging 247 | true 248 | true 249 | 250 | 251 | 252 | 253 | org.apache.maven.plugins 254 | maven-scm-publish-plugin 255 | 1.1 256 | 257 | 258 | deploy-site 259 | deploy 260 | 261 | publish-scm 262 | 263 | 264 | gh-pages 265 | false 266 | Update site 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | -------------------------------------------------------------------------------- /src/main/jbake/assets/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Eclipse Jakarta EE Platform 2 | 3 | Thanks for your interest in this project. 4 | 5 | ## Project description 6 | 7 | The Eclipse Jakarta EE Platform project produces the Jakarta EE 8 | platform specification, which is an umbrella specification that 9 | aggregates all other Jakarta EE specifications. 10 | 11 | * [https://projects.eclipse.org/projects/ee4j.jakartaee-platform](https://projects.eclipse.org/projects/ee4j.jakartaee-platform) 12 | 13 | ## Developer resources 14 | 15 | Information regarding source code management, builds, coding standards, and 16 | more. 17 | 18 | * [https://projects.eclipse.org/projects/ee4j.jakartaee-platform/developer](https://projects.eclipse.org/projects/ee4j.jakartaee-platform/developer) 19 | 20 | The project maintains the following source code repositories 21 | 22 | * [https://github.com/eclipse-ee4j/jakartaee-platform](https://github.com/eclipse-ee4j/jakartaee-platform) 23 | * [https://github.com/eclipse-ee4j/jakartaee-tutorial](https://github.com/eclipse-ee4j/jakartaee-tutorial) 24 | * [https://github.com/eclipse-ee4j/jakartaee-tutorial-examples](https://github.com/eclipse-ee4j/jakartaee-tutorial-examples) 25 | * [https://github.com/eclipse-ee4j/jakartaee-firstcup](https://github.com/eclipse-ee4j/jakartaee-firstcup) 26 | * [https://github.com/eclipse-ee4j/jakartaee-firstcup-examples](https://github.com/eclipse-ee4j/jakartaee-firstcup-examples) 27 | * [https://github.com/eclipse-ee4j/jakartaee-schemas](https://github.com/eclipse-ee4j/jakartaee-schemas) 28 | 29 | ## Eclipse Contributor Agreement 30 | 31 | Before your contribution can be accepted by the project team contributors must 32 | electronically sign the Eclipse Contributor Agreement (ECA). 33 | 34 | * [http://www.eclipse.org/legal/ECA.php](http://www.eclipse.org/legal/ECA.php) 35 | 36 | Commits that are provided by non-committers must have a Signed-off-by field in 37 | the footer indicating that the author is aware of the terms by which the 38 | contribution has been provided to the project. The non-committer must 39 | additionally have an Eclipse Foundation account and must have a signed Eclipse 40 | Contributor Agreement (ECA) on file. 41 | 42 | For more information, please see the Eclipse Committer Handbook: 43 | [https://www.eclipse.org/projects/handbook/#resources-commit](https://www.eclipse.org/projects/handbook/#resources-commit) 44 | 45 | ## Contact 46 | 47 | Contact the project developers via the project's "dev" list. 48 | 49 | * [https://accounts.eclipse.org/mailing-list/jakartaee-platform-dev](https://accounts.eclipse.org/mailing-list/jakartaee-platform-dev) 50 | -------------------------------------------------------------------------------- /src/main/jbake/assets/LICENSE.md: -------------------------------------------------------------------------------- 1 | # Eclipse Public License - v 2.0 2 | 3 | THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE 4 | PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION 5 | OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. 6 | 7 | 1. DEFINITIONS 8 | 9 | "Contribution" means: 10 | 11 | a) in the case of the initial Contributor, the initial content 12 | Distributed under this Agreement, and 13 | 14 | b) in the case of each subsequent Contributor: 15 | i) changes to the Program, and 16 | ii) additions to the Program; 17 | where such changes and/or additions to the Program originate from 18 | and are Distributed by that particular Contributor. A Contribution 19 | "originates" from a Contributor if it was added to the Program by 20 | such Contributor itself or anyone acting on such Contributor's behalf. 21 | Contributions do not include changes or additions to the Program that 22 | are not Modified Works. 23 | 24 | "Contributor" means any person or entity that Distributes the Program. 25 | 26 | "Licensed Patents" mean patent claims licensable by a Contributor which 27 | are necessarily infringed by the use or sale of its Contribution alone 28 | or when combined with the Program. 29 | 30 | "Program" means the Contributions Distributed in accordance with this 31 | Agreement. 32 | 33 | "Recipient" means anyone who receives the Program under this Agreement 34 | or any Secondary License (as applicable), including Contributors. 35 | 36 | "Derivative Works" shall mean any work, whether in Source Code or other 37 | form, that is based on (or derived from) the Program and for which the 38 | editorial revisions, annotations, elaborations, or other modifications 39 | represent, as a whole, an original work of authorship. 40 | 41 | "Modified Works" shall mean any work in Source Code or other form that 42 | results from an addition to, deletion from, or modification of the 43 | contents of the Program, including, for purposes of clarity any new file 44 | in Source Code form that contains any contents of the Program. Modified 45 | Works shall not include works that contain only declarations, 46 | interfaces, types, classes, structures, or files of the Program solely 47 | in each case in order to link to, bind by name, or subclass the Program 48 | or Modified Works thereof. 49 | 50 | "Distribute" means the acts of a) distributing or b) making available 51 | in any manner that enables the transfer of a copy. 52 | 53 | "Source Code" means the form of a Program preferred for making 54 | modifications, including but not limited to software source code, 55 | documentation source, and configuration files. 56 | 57 | "Secondary License" means either the GNU General Public License, 58 | Version 2.0, or any later versions of that license, including any 59 | exceptions or additional permissions as identified by the initial 60 | Contributor. 61 | 62 | 2. GRANT OF RIGHTS 63 | 64 | a) Subject to the terms of this Agreement, each Contributor hereby 65 | grants Recipient a non-exclusive, worldwide, royalty-free copyright 66 | license to reproduce, prepare Derivative Works of, publicly display, 67 | publicly perform, Distribute and sublicense the Contribution of such 68 | Contributor, if any, and such Derivative Works. 69 | 70 | b) Subject to the terms of this Agreement, each Contributor hereby 71 | grants Recipient a non-exclusive, worldwide, royalty-free patent 72 | license under Licensed Patents to make, use, sell, offer to sell, 73 | import and otherwise transfer the Contribution of such Contributor, 74 | if any, in Source Code or other form. This patent license shall 75 | apply to the combination of the Contribution and the Program if, at 76 | the time the Contribution is added by the Contributor, such addition 77 | of the Contribution causes such combination to be covered by the 78 | Licensed Patents. The patent license shall not apply to any other 79 | combinations which include the Contribution. No hardware per se is 80 | licensed hereunder. 81 | 82 | c) Recipient understands that although each Contributor grants the 83 | licenses to its Contributions set forth herein, no assurances are 84 | provided by any Contributor that the Program does not infringe the 85 | patent or other intellectual property rights of any other entity. 86 | Each Contributor disclaims any liability to Recipient for claims 87 | brought by any other entity based on infringement of intellectual 88 | property rights or otherwise. As a condition to exercising the 89 | rights and licenses granted hereunder, each Recipient hereby 90 | assumes sole responsibility to secure any other intellectual 91 | property rights needed, if any. For example, if a third party 92 | patent license is required to allow Recipient to Distribute the 93 | Program, it is Recipient's responsibility to acquire that license 94 | before distributing the Program. 95 | 96 | d) Each Contributor represents that to its knowledge it has 97 | sufficient copyright rights in its Contribution, if any, to grant 98 | the copyright license set forth in this Agreement. 99 | 100 | e) Notwithstanding the terms of any Secondary License, no 101 | Contributor makes additional grants to any Recipient (other than 102 | those set forth in this Agreement) as a result of such Recipient's 103 | receipt of the Program under the terms of a Secondary License 104 | (if permitted under the terms of Section 3). 105 | 106 | 3. REQUIREMENTS 107 | 108 | 3.1 If a Contributor Distributes the Program in any form, then: 109 | 110 | a) the Program must also be made available as Source Code, in 111 | accordance with section 3.2, and the Contributor must accompany 112 | the Program with a statement that the Source Code for the Program 113 | is available under this Agreement, and informs Recipients how to 114 | obtain it in a reasonable manner on or through a medium customarily 115 | used for software exchange; and 116 | 117 | b) the Contributor may Distribute the Program under a license 118 | different than this Agreement, provided that such license: 119 | i) effectively disclaims on behalf of all other Contributors all 120 | warranties and conditions, express and implied, including 121 | warranties or conditions of title and non-infringement, and 122 | implied warranties or conditions of merchantability and fitness 123 | for a particular purpose; 124 | 125 | ii) effectively excludes on behalf of all other Contributors all 126 | liability for damages, including direct, indirect, special, 127 | incidental and consequential damages, such as lost profits; 128 | 129 | iii) does not attempt to limit or alter the recipients' rights 130 | in the Source Code under section 3.2; and 131 | 132 | iv) requires any subsequent distribution of the Program by any 133 | party to be under a license that satisfies the requirements 134 | of this section 3. 135 | 136 | 3.2 When the Program is Distributed as Source Code: 137 | 138 | a) it must be made available under this Agreement, or if the 139 | Program (i) is combined with other material in a separate file or 140 | files made available under a Secondary License, and (ii) the initial 141 | Contributor attached to the Source Code the notice described in 142 | Exhibit A of this Agreement, then the Program may be made available 143 | under the terms of such Secondary Licenses, and 144 | 145 | b) a copy of this Agreement must be included with each copy of 146 | the Program. 147 | 148 | 3.3 Contributors may not remove or alter any copyright, patent, 149 | trademark, attribution notices, disclaimers of warranty, or limitations 150 | of liability ("notices") contained within the Program from any copy of 151 | the Program which they Distribute, provided that Contributors may add 152 | their own appropriate notices. 153 | 154 | 4. COMMERCIAL DISTRIBUTION 155 | 156 | Commercial distributors of software may accept certain responsibilities 157 | with respect to end users, business partners and the like. While this 158 | license is intended to facilitate the commercial use of the Program, 159 | the Contributor who includes the Program in a commercial product 160 | offering should do so in a manner which does not create potential 161 | liability for other Contributors. Therefore, if a Contributor includes 162 | the Program in a commercial product offering, such Contributor 163 | ("Commercial Contributor") hereby agrees to defend and indemnify every 164 | other Contributor ("Indemnified Contributor") against any losses, 165 | damages and costs (collectively "Losses") arising from claims, lawsuits 166 | and other legal actions brought by a third party against the Indemnified 167 | Contributor to the extent caused by the acts or omissions of such 168 | Commercial Contributor in connection with its distribution of the Program 169 | in a commercial product offering. The obligations in this section do not 170 | apply to any claims or Losses relating to any actual or alleged 171 | intellectual property infringement. In order to qualify, an Indemnified 172 | Contributor must: a) promptly notify the Commercial Contributor in 173 | writing of such claim, and b) allow the Commercial Contributor to control, 174 | and cooperate with the Commercial Contributor in, the defense and any 175 | related settlement negotiations. The Indemnified Contributor may 176 | participate in any such claim at its own expense. 177 | 178 | For example, a Contributor might include the Program in a commercial 179 | product offering, Product X. That Contributor is then a Commercial 180 | Contributor. If that Commercial Contributor then makes performance 181 | claims, or offers warranties related to Product X, those performance 182 | claims and warranties are such Commercial Contributor's responsibility 183 | alone. Under this section, the Commercial Contributor would have to 184 | defend claims against the other Contributors related to those performance 185 | claims and warranties, and if a court requires any other Contributor to 186 | pay any damages as a result, the Commercial Contributor must pay 187 | those damages. 188 | 189 | 5. NO WARRANTY 190 | 191 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT 192 | PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS" 193 | BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR 194 | IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF 195 | TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR 196 | PURPOSE. Each Recipient is solely responsible for determining the 197 | appropriateness of using and distributing the Program and assumes all 198 | risks associated with its exercise of rights under this Agreement, 199 | including but not limited to the risks and costs of program errors, 200 | compliance with applicable laws, damage to or loss of data, programs 201 | or equipment, and unavailability or interruption of operations. 202 | 203 | 6. DISCLAIMER OF LIABILITY 204 | 205 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT 206 | PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS 207 | SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 208 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST 209 | PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 210 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 211 | ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE 212 | EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE 213 | POSSIBILITY OF SUCH DAMAGES. 214 | 215 | 7. GENERAL 216 | 217 | If any provision of this Agreement is invalid or unenforceable under 218 | applicable law, it shall not affect the validity or enforceability of 219 | the remainder of the terms of this Agreement, and without further 220 | action by the parties hereto, such provision shall be reformed to the 221 | minimum extent necessary to make such provision valid and enforceable. 222 | 223 | If Recipient institutes patent litigation against any entity 224 | (including a cross-claim or counterclaim in a lawsuit) alleging that the 225 | Program itself (excluding combinations of the Program with other software 226 | or hardware) infringes such Recipient's patent(s), then such Recipient's 227 | rights granted under Section 2(b) shall terminate as of the date such 228 | litigation is filed. 229 | 230 | All Recipient's rights under this Agreement shall terminate if it 231 | fails to comply with any of the material terms or conditions of this 232 | Agreement and does not cure such failure in a reasonable period of 233 | time after becoming aware of such noncompliance. If all Recipient's 234 | rights under this Agreement terminate, Recipient agrees to cease use 235 | and distribution of the Program as soon as reasonably practicable. 236 | However, Recipient's obligations under this Agreement and any licenses 237 | granted by Recipient relating to the Program shall continue and survive. 238 | 239 | Everyone is permitted to copy and distribute copies of this Agreement, 240 | but in order to avoid inconsistency the Agreement is copyrighted and 241 | may only be modified in the following manner. The Agreement Steward 242 | reserves the right to publish new versions (including revisions) of 243 | this Agreement from time to time. No one other than the Agreement 244 | Steward has the right to modify this Agreement. The Eclipse Foundation 245 | is the initial Agreement Steward. The Eclipse Foundation may assign the 246 | responsibility to serve as the Agreement Steward to a suitable separate 247 | entity. Each new version of the Agreement will be given a distinguishing 248 | version number. The Program (including Contributions) may always be 249 | Distributed subject to the version of the Agreement under which it was 250 | received. In addition, after a new version of the Agreement is published, 251 | Contributor may elect to Distribute the Program (including its 252 | Contributions) under the new version. 253 | 254 | Except as expressly stated in Sections 2(a) and 2(b) above, Recipient 255 | receives no rights or licenses to the intellectual property of any 256 | Contributor under this Agreement, whether expressly, by implication, 257 | estoppel or otherwise. All rights in the Program not expressly granted 258 | under this Agreement are reserved. Nothing in this Agreement is intended 259 | to be enforceable by any entity that is not a Contributor or Recipient. 260 | No third-party beneficiary rights are created under this Agreement. 261 | 262 | Exhibit A - Form of Secondary Licenses Notice 263 | 264 | "This Source Code may also be made available under the following 265 | Secondary Licenses when the conditions for such availability set forth 266 | in the Eclipse Public License, v. 2.0 are satisfied: {name license(s), 267 | version(s), and exceptions or additional permissions here}." 268 | 269 | Simply including a copy of this Agreement, including this Exhibit A 270 | is not sufficient to license the Source Code under Secondary Licenses. 271 | 272 | If it is not possible or desirable to put the notice in a particular 273 | file, then You may include the notice in a location (such as a LICENSE 274 | file in a relevant directory) where a recipient would be likely to 275 | look for such a notice. 276 | 277 | You may add additional accurate notices of copyright ownership. -------------------------------------------------------------------------------- /src/main/jbake/assets/README.md: -------------------------------------------------------------------------------- 1 | # About this Project 2 | 3 | The {{site.title}} Project is the official site for the 4 | _Jakarta Enterprise Edition Your First Cup: An Introduction to Jakarta EE_. 5 | The {{site.title}} teaches and demonstrates Jakarta EE basics and is 6 | intended for beginners. 7 | 8 | [View the First Cup of Jakarta EE Tutorial](toc.html) 9 | 10 | The latest build of the {{site.title}} is automatically published to 11 | this site as HTML via a Jenkins job that watches for changes to the 12 | master branch of the repository. The tutorial is authored in 13 | [AsciiDoc](http://asciidoc.org/). AsciiDoc is similar to markdown but 14 | is particularly suited for user documentation. If you are interested in 15 | forking the tutorial source files or building the tutorials locally, 16 | then see the [repository](https://github.com/eclipse-ee4j/jakartaee-firstcup). 17 | 18 | # Related Projects 19 | 20 | * [eclipse-ee4j/jakartaee-firstcup-examples](https://github.com/eclipse-ee4j/jakartaee-firstcup-examples): 21 | this repository contains the example code that is used in the {{site.title}}. 22 | 23 | * [Jakarta EE Tutorial](https://eclipse-ee4j.github.io/jakartaee-tutorial/): 24 | the Jakarta EE Tutorial teaches and demonstrates the Jakarta EE 25 | features that are used to develop enterprise applications. 26 | 27 | * [eclipse-ee4j/jakartaee-tutorial-examples](https://github.com/eclipse-ee4j/gla 28 | ssfish-tutorial-examples): 29 | this repository contains the example code that is used in the 30 | Jakarta EE Tutorial. 31 | 32 | # How-to Contribute 33 | The easiest way to contribute is by opening an 34 | [issue](https://github.com/eclipse-ee4j/jakartaee-firstcup/issues) 35 | that contains feedback and review comments. 36 | 37 | The {{site.title}} is open for contributions and your help is greatly 38 | appreciated. If you have an idea for the tutorial and want to add a 39 | section or update an existing section, then review the following 40 | links: 41 | 42 | * [Contribute](CONTRIBUTING) 43 | * [Pull Request Acceptance Workflow](pr_doc_workflow) 44 | * [License](LICENSE) 45 | -------------------------------------------------------------------------------- /src/main/jbake/assets/_config.yml: -------------------------------------------------------------------------------- 1 | remote_theme: jakartaee/jekyll-theme-jakarta-ee 2 | 3 | title: [First Cup of Jakarta EE Tutorial] 4 | description: [First Cup of Jakarta EE Tutorial Project] 5 | 6 | # sidebar links url 7 | links: 8 | source: https://github.com/eclipse-ee4j/jakartaee-firstcup 9 | download: https://github.com/eclipse-ee4j/jakartaee-firstcup/releases 10 | mailinglist: https://accounts.eclipse.org/mailing-list/jakartaee-plaform-dev 11 | #javadocs: 12 | docs: toc.html 13 | #faq: 14 | 15 | include: 16 | - LICENSE.md 17 | - CONTRIBUTING.md 18 | -------------------------------------------------------------------------------- /src/main/jbake/assets/css/style.css: -------------------------------------------------------------------------------- 1 | /* CSS */ 2 | /*! normalize.css v3.0.2 | MIT License | git.io/normalize */ 3 | /** 1. Set default font family to sans-serif. 2. Prevent iOS text size adjust after orientation change, without disabling user zoom. */ 4 | html { font-family: sans-serif; /* 1 */ -ms-text-size-adjust: 100%; /* 2 */ -webkit-text-size-adjust: 100%; /* 2 */ } 5 | 6 | /* HTML5 display definitions ========================================================================== */ 7 | /** Correct `block` display not defined for any HTML5 element in IE 8/9. Correct `block` display not defined for `details` or `summary` in IE 10/11 and Firefox. Correct `block` display not defined for `main` in IE 11. */ 8 | article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section, summary { display: block; } 9 | 10 | /** 1. Correct `inline-block` display not defined in IE 8/9. 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. */ 11 | audio, canvas, progress, video { display: inline-block; /* 1 */ vertical-align: baseline; /* 2 */ } 12 | 13 | /** Prevent modern browsers from displaying `audio` without controls. Remove excess height in iOS 5 devices. */ 14 | audio:not([controls]) { display: none; height: 0; } 15 | 16 | /** Address `[hidden]` styling not present in IE 8/9/10. Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. */ 17 | [hidden], template { display: none; } 18 | 19 | /* Links ========================================================================== */ 20 | /** Remove the gray background color from active links in IE 10. */ 21 | a { background-color: transparent; } 22 | 23 | /** Improve readability when focused and also mouse hovered in all browsers. */ 24 | a:active, a:hover { outline: 0; } 25 | 26 | /* Text-level semantics ========================================================================== */ 27 | /** Address styling not present in IE 8/9/10/11, Safari, and Chrome. */ 28 | abbr[title] { border-bottom: 1px dotted; } 29 | 30 | /** Address style set to `bolder` in Firefox 4+, Safari, and Chrome. */ 31 | b, strong { font-weight: bold; } 32 | 33 | /** Address styling not present in Safari and Chrome. */ 34 | dfn { font-style: italic; } 35 | 36 | /** Address variable `h1` font-size and margin within `section` and `article` contexts in Firefox 4+, Safari, and Chrome. */ 37 | h1 { font-size: 2em; margin: 0.67em 0; } 38 | 39 | /** Address styling not present in IE 8/9. */ 40 | mark { background: #ff0; color: #000; } 41 | 42 | /** Address inconsistent and variable font size in all browsers. */ 43 | small { font-size: 80%; } 44 | 45 | /** Prevent `sub` and `sup` affecting `line-height` in all browsers. */ 46 | sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } 47 | 48 | sup { top: -0.5em; } 49 | 50 | sub { bottom: -0.25em; } 51 | 52 | /* Embedded content ========================================================================== */ 53 | /** Remove border when inside `a` element in IE 8/9/10. */ 54 | img { border: 0; } 55 | 56 | /** Correct overflow not hidden in IE 9/10/11. */ 57 | svg:not(:root) { overflow: hidden; } 58 | 59 | /* Grouping content ========================================================================== */ 60 | /** Address margin not present in IE 8/9 and Safari. */ 61 | figure { margin: 1em 40px; } 62 | 63 | /** Address differences between Firefox and other browsers. */ 64 | hr { box-sizing: content-box; height: 0; } 65 | 66 | /** Contain overflow in all browsers. */ 67 | pre { overflow: auto; } 68 | 69 | /** Address odd `em`-unit font size rendering in all browsers. */ 70 | code, kbd, pre, samp { font-family: monospace, monospace; font-size: 1em; } 71 | 72 | /* Forms ========================================================================== */ 73 | /** Known limitation: by default, Chrome and Safari on OS X allow very limited styling of `select`, unless a `border` property is set. */ 74 | /** 1. Correct color not being inherited. Known issue: affects color of disabled elements. 2. Correct font properties not being inherited. 3. Address margins set differently in Firefox 4+, Safari, and Chrome. */ 75 | button, input, optgroup, select, textarea { color: inherit; /* 1 */ font: inherit; /* 2 */ margin: 0; /* 3 */ } 76 | 77 | /** Address `overflow` set to `hidden` in IE 8/9/10/11. */ 78 | button { overflow: visible; } 79 | 80 | /** Address inconsistent `text-transform` inheritance for `button` and `select`. All other form control elements do not inherit `text-transform` values. Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. Correct `select` style inheritance in Firefox. */ 81 | button, select { text-transform: none; } 82 | 83 | /** 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` and `video` controls. 2. Correct inability to style clickable `input` types in iOS. 3. Improve usability and consistency of cursor style between image-type `input` and others. */ 84 | button, html input[type="button"], input[type="reset"], input[type="submit"] { -webkit-appearance: button; /* 2 */ cursor: pointer; /* 3 */ } 85 | 86 | /** Re-set default cursor for disabled elements. */ 87 | button[disabled], html input[disabled] { cursor: default; } 88 | 89 | /** Remove inner padding and border in Firefox 4+. */ 90 | button::-moz-focus-inner, input::-moz-focus-inner { border: 0; padding: 0; } 91 | 92 | /** Address Firefox 4+ setting `line-height` on `input` using `!important` in the UA stylesheet. */ 93 | input { line-height: normal; } 94 | 95 | /** It's recommended that you don't attempt to style these elements. Firefox's implementation doesn't respect box-sizing, padding, or width. 1. Address box sizing set to `content-box` in IE 8/9/10. 2. Remove excess padding in IE 8/9/10. */ 96 | input[type="checkbox"], input[type="radio"] { box-sizing: border-box; /* 1 */ padding: 0; /* 2 */ } 97 | 98 | /** Fix the cursor style for Chrome's increment/decrement buttons. For certain `font-size` values of the `input`, it causes the cursor style of the decrement button to change from `default` to `text`. */ 99 | input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { height: auto; } 100 | 101 | /** 1. Address `appearance` set to `searchfield` in Safari and Chrome. 2. Address `box-sizing` set to `border-box` in Safari and Chrome (include `-moz` to future-proof). */ 102 | input[type="search"] { -webkit-appearance: textfield; /* 1 */ /* 2 */ box-sizing: content-box; } 103 | 104 | /** Remove inner padding and search cancel button in Safari and Chrome on OS X. Safari (but not Chrome) clips the cancel button when the search input has padding (and `textfield` appearance). */ 105 | input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } 106 | 107 | /** Define consistent border, margin, and padding. */ 108 | fieldset { border: 1px solid #c0c0c0; margin: 0 2px; padding: 0.35em 0.625em 0.75em; } 109 | 110 | /** 1. Correct `color` not being inherited in IE 8/9/10/11. 2. Remove padding so people aren't caught out if they zero out fieldsets. */ 111 | legend { border: 0; /* 1 */ padding: 0; /* 2 */ } 112 | 113 | /** Remove default vertical scrollbar in IE 8/9/10/11. */ 114 | textarea { overflow: auto; } 115 | 116 | /** Don't inherit the `font-weight` (applied by a rule above). NOTE: the default cannot safely be changed in Chrome and Safari on OS X. */ 117 | optgroup { font-weight: bold; } 118 | 119 | /* Tables ========================================================================== */ 120 | /** Remove most spacing between table cells. */ 121 | table { border-collapse: collapse; border-spacing: 0; } 122 | 123 | td, th { padding: 0; } 124 | 125 | /* LAYOUT STYLES */ 126 | 127 | p { margin-top: 0; } 128 | 129 | code, pre { margin-bottom: 30px; font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace; font-size: 13px; color: #222; } 130 | 131 | code { padding: 0 3px; background-color: #f2f8fc; border: solid 1px #dbe7f3; } 132 | 133 | pre { padding: 20px; overflow: auto; text-shadow: none; background: #fff; border: solid 1px #f2f2f2; } 134 | 135 | pre code { padding: 0; color: #2879d0; background-color: #fff; border: none; } 136 | 137 | ul, ol, dl { margin-bottom: 20px; } 138 | 139 | /* COMMON STYLES */ 140 | 141 | td.halign-right { text-align: right; } 142 | 143 | td.halign-center { text-align: center; } 144 | 145 | form { padding: 20px; background: #f2f2f2; } 146 | 147 | h2 { 148 | font-size: 2em; 149 | line-height: 1.2em; 150 | font-weight: 200; 151 | letter-spacing: 0; 152 | } 153 | 154 | h3 { 155 | font-size: 1.4em; 156 | line-height: 1.2em; 157 | font-weight: normal; 158 | letter-spacing: 0; 159 | } 160 | 161 | .sect1 { 162 | margin-left: 4%; 163 | margin-right: 4%; 164 | font: 13px/20px Arial, Helvetica, sans-serif 165 | } 166 | 167 | a:link { 168 | text-decoration: none; 169 | color: #09569d; 170 | } 171 | 172 | #preamble hr{ 173 | margin-left: 0%; 174 | margin-right: 0%; 175 | } 176 | 177 | #preamble .sectionbody table { 178 | font-weight: 200; 179 | margin-left: 4%; 180 | margin-right: 4%; 181 | } 182 | 183 | hr { 184 | margin-bottom: 12px; 185 | } 186 | 187 | table.tableblock.frame-all.grid-all.spread { 188 | font-size: 12px; 189 | } 190 | 191 | code { 192 | font-size:.9em; 193 | border: 1px solid #eaeaea; 194 | background-color: #f6f6f6; 195 | border-radius: 3px; 196 | padding: 1px; 197 | padding-left:2px; 198 | padding-right:2px; 199 | } 200 | 201 | pre.prettyprint.highlight { 202 | border: 1px solid #eaeaea; 203 | background-color: #f6f6f6; 204 | border-radius: 4px; 205 | padding: 8px; 206 | padding-top:4px; 207 | padding-bottom:4px; 208 | } 209 | 210 | .language-oac_no_warn { 211 | font-size:.9em; 212 | color:#222; 213 | background-color: transparent; 214 | } 215 | 216 | #doc-title { 217 | margin-left: 4%; 218 | } 219 | 220 | #top-nav { 221 | margin-left: 4%; 222 | font-size: 12px; 223 | } 224 | 225 | #bottom-nav { 226 | margin-left: 4%; 227 | font-size: 12px; 228 | } 229 | 230 | .vector-font { 231 | color:grey; 232 | font-size: 20px; 233 | } 234 | 235 | #copyright { 236 | padding-top: 10px; 237 | padding-bottom: 4px; 238 | display: table; 239 | margin:0 auto; 240 | color: grey; 241 | font-size: 12px; 242 | } 243 | 244 | .beta {color: #FF0000} 245 | 246 | /* GENERAL ELEMENT TYPE STYLES */ 247 | 248 | /* #Media Queries 249 | ================================================== */ 250 | /* Smaller than standard 960 (devices and browsers) */ 251 | /* Tablet Portrait size to standard 960 (devices and browsers) */ 252 | @media only screen and (min-width: 768px) and (max-width: 959px) { .inner { width: 740px; } 253 | header h1, header h2 { width: 340px; } 254 | header h1 { font-size: 60px; } 255 | header h2 { font-size: 30px; } 256 | } 257 | /* All Mobile Sizes (devices and browser) */ 258 | @media only screen and (max-width: 767px) { .inner { width: 93%; } 259 | header { padding: 20px 0; } 260 | header .inner { position: relative; } 261 | header h1, header h2 { width: 100%; } 262 | header h1 { font-size: 48px; } 263 | header h2 { font-size: 24px; } 264 | header a.button { position: relative; display: inline-block; width: auto; height: auto; padding: 5px 10px; margin-top: 15px; font-size: 13px; line-height: 1; color: #2879d0; text-align: center; background-color: #9ddcff; background-image: none; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; } 265 | header a.button small { display: inline; font-size: 13px; } 266 | } 267 | /* Mobile Landscape Size to Tablet Portrait (devices and browsers) */ 268 | /* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */ 269 | 270 | header h1 { padding-top: 14px; font-size: 2em; font-weight: 200; line-height: 1.4; color: #FFFFFF; letter-spacing: 0px; border-bottom: 0px; } 271 | 272 | header h2 { font-size: 1.2em; margin-top: 0; margin-bottom: 0; font-weight: 200; line-height: .8; color: #ec7D11; letter-spacing: 0; } 273 | 274 | header a.button { background: transparent url(../images/logo.png) 0 0 no-repeat; padding-left: 32px; } 275 | 276 | header a:hover { text-decoration: none; } 277 | 278 | /* Admonition (Note) block */ 279 | .admonitionblock > table { 280 | border: 0; 281 | background: none; 282 | width: 100%; 283 | table-layout: auto; 284 | margin-bottom: 10.5px; 285 | } 286 | .admonitionblock > table td.icon { 287 | text-align: center; 288 | width: 60px; 289 | } 290 | .admonitionblock > table td.icon img { 291 | max-width: none; 292 | } 293 | .admonitionblock > table td.icon .title { 294 | text-transform: uppercase; 295 | } 296 | .admonitionblock > table td.content { 297 | padding-left: 1em; 298 | padding-right: 1em; 299 | border-left: 3px solid #ddd; 300 | } 301 | .admonitionblock > table td.content > :last-child > :last-child { 302 | margin-bottom: 0; 303 | } 304 | .admonitionblock td.icon [class^="fa icon-"]:before { 305 | font-size: 2.5em; 306 | text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); 307 | cursor: default; 308 | } 309 | .admonitionblock td.icon .icon-note:before { 310 | content: "\f05a"; 311 | color: #5bc0de; 312 | } -------------------------------------------------------------------------------- /src/main/jbake/assets/img/eclipse_foundation_logo_tiny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-ee4j/jakartaee-firstcup/020c848286f298919d44fa47a2abe3986df9eafa/src/main/jbake/assets/img/eclipse_foundation_logo_tiny.png -------------------------------------------------------------------------------- /src/main/jbake/assets/img/new-firstcup-architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-ee4j/jakartaee-firstcup/020c848286f298919d44fa47a2abe3986df9eafa/src/main/jbake/assets/img/new-firstcup-architecture.png -------------------------------------------------------------------------------- /src/main/jbake/assets/pr_doc_workflow.md: -------------------------------------------------------------------------------- 1 | # Documentation Pull Request Acceptance Workflow 2 | 3 | ## One Time Setup 4 | * [Fork](https://help.github.com/articles/fork-a-repo/) the 5 | [tutorial](https://github.com/eclipse-ee4j/jakartaee-firstcup/) repository. 6 | * [Clone](https://help.github.com/articles/cloning-a-repository/) 7 | your forked repository. 8 | ``` 9 | $ git clone https://github.com/YOUR-USERNAME/jakartaee-firstcup.git 10 | ``` 11 | * [Configure](https://help.github.com/articles/configuring-a-remote-for-a-fork/) 12 | the remote for your fork. 13 | ``` 14 | $ git remote add upstream https://github.com/eclipse-ee4j/jakartaee-firstcup.git 15 | $ git remote -v 16 | origin https://github.com/YOUR-USERNAME/jakartaee-firstcup.git (fetch) 17 | origin https://github.com/YOUR-USERNAME/jakartaee-firstcup.git (push) 18 | upstream https://github.com/eclipse-ee4j/jakartaee-firstcup.git (fetch) 19 | upstream https://github.com/eclipse-ee4j/jakartaee-firstcup.git (push) 20 | ``` 21 | ## Raising a Pull Request 22 | * Sync the master of your fork with upstream master. 23 | ``` 24 | $ git fetch upstream 25 | $ git checkout master 26 | $ git merge upstream/master 27 | $ git push origin master # push local master to github fork. 28 | ``` 29 | * Create a local topic branch in your fork from your master. 30 | ``` 31 | $ git checkout -b doc_update 32 | ``` 33 | * Do the development in your branch. 34 | * Commit all the changes. 35 | ``` 36 | $ git add src/main/jbake/content/my.adoc 37 | $ git commit -m "my commit message" 38 | ``` 39 | * Push your changes in a remote branch of your fork. 40 | ``` 41 | $ git push origin doc_update 42 | ``` 43 | * Before raising a Pull Request, please raise an 44 | [issue](https://github.com/eclipse-ee4j/jakartaee-firstcup/issues) 45 | if it doesn't exist. We would like every Pull Request to be associated 46 | with an issue. Submit the Pull Request referring to the issue number. 47 | * Raise a [Pull Request](https://github.com/eclipse-ee4j/jakartaee-firstcup/pulls). 48 | * Make sure you put a proper 'title' for the Pull Request. The title of 49 | the Pull Request would become the commit message. Instead of giving 50 | 'title' like "Iss xxxx" or "Fixes #xxxxx", consider giving a proper one 51 | line 'title' for the Pull Request like "Fixes xxx : " 53 | * In the Pull Request description (body), please mention "Fixes #xxxxx" 54 | in order to link the Pull Request with the Issue you are fixing. 55 | * If you have signed the [ECA](https://www.eclipse.org/legal/ECA.php), 56 | one of the project team members will review your Pull Request. 57 | -------------------------------------------------------------------------------- /src/main/jbake/content/creating-example.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Creating Your First Jakarta EE Application 4 | next=creating-example001.html 5 | prev=jakarta-ee002.html 6 | ~~~~~~ 7 | = Creating Your First Jakarta EE Application 8 | 9 | 10 | [[GCRKP]][[creating-your-first-jakarta-ee-application]] 11 | 12 | 3 Creating Your First Jakarta EE Application 13 | -------------------------------------------- 14 | 15 | This chapter gives an overview of the example applications and 16 | step-by-step instructions on coding and running the `dukes-age` web 17 | service example application. 18 | -------------------------------------------------------------------------------- /src/main/jbake/content/creating-example001.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Architecture of the Example Applications 4 | next=creating-example002.html 5 | prev=creating-example.html 6 | ~~~~~~ 7 | = Architecture of the Example Applications 8 | 9 | 10 | [[GKHQT]][[architecture-of-the-example-applications]] 11 | 12 | Architecture of the Example Applications 13 | ---------------------------------------- 14 | 15 | The example applications consist of four main components: 16 | `DukesAgeResource`, a Jakarta RESTful Web Service; `DukesBirthdayBean`, 17 | an enterprise bean; `FirstcupUser`, a Jakarta Persistence entity; and 18 | `firstcup-war`, a web application created with Jakarta Faces Facelets 19 | technology. 20 | 21 | [[GJBEW]] 22 | 23 | .*Figure 3-1 Architecture of the First Cup Example Applications* 24 | image:img/new-firstcup-architecture.png[ 25 | "Architecture of First Cup example applications."] 26 | 27 | `DukesAgeResource` is a Jakarta RESTful Web Service resource that calculates the age of Duke, 28 | the Java mascot. Duke was born May 23, 1995, when the first demo of Java 29 | technology was publicly released. 30 | 31 | `DukesBirthdayBean` is a local, no-interface view stateless session bean 32 | that calculates the difference between the user's age and Duke's age and 33 | stores the user-submitted data in a Jakarta Persistence entity. 34 | 35 | `FirstcupUser` is a Jakarta Persistence entity that represents a 36 | particular user's birthday. It is stored in an Apache Derby table and 37 | managed by the `DukesBirthdayBean` business methods. 38 | 39 | The `firstcup-war` web application is a Jakarta Faces Facelets 40 | application that accesses `DukesAgeResource` to display Duke's age, 41 | reads in a date provided by the user, accesses `DukesBirthdayBean` to 42 | calculate who is older, and then displays the difference in years 43 | between the user and Duke and the average age difference of all users. 44 | 45 | The `firstcup-war` web application consists of the following: 46 | 47 | * `greeting.xhtml`: A Facelets-enabled XHTML page, which is a page that 48 | uses the Jakarta Faces Facelets tag libraries. Users can type their 49 | birth date in a field and submit it for comparison against Duke's birth 50 | date. 51 | * `response.xhtml`: A Facelets-enabled XHTML page that tells the user 52 | whether he or she is older or younger than Duke, based on the date the 53 | user entered in the `greeting.xhtml` page, and displays the average age 54 | difference of all users. 55 | * `DukesBDay.java`: A Jakarta Context and Dependency Injection managed bean that defines properties to hold 56 | the user's birth date, uses the Jakarta RESTful Web Service Client API to get Duke's current 57 | age from the `DukesAgeResource` web service, and calculates the age 58 | difference between the user and Duke from the enterprise bean. 59 | * `web.xml`: The web application's deployment descriptor, which is used 60 | to configure certain aspects of a web application when it is installed. 61 | In this case, it is used to provide a mapping to the application's 62 | `FacesServlet` instance, which accepts incoming requests, passes them to 63 | the life cycle for processing, and initializes resources. It also 64 | specifies `greeting.xhtml` as the welcome file for the application. 65 | * `WebMessages.properties` and `WebMessages_es.properties`: Java 66 | programming language properties files that contain the localized strings 67 | used in `greeting.xhtml` and `response.xhtml`. By default, the English 68 | language strings in `WebMessages.properties` are used, but Spanish 69 | language strings are also provided in `WebMessages_es.properties`. 70 | * `DukesBirthdayBean.java`: as described above, the enterprise bean 71 | packaged within the `firstcup-war` application. `DukesBirthdayBean` 72 | calculates the difference between the user's birthday and Duke's 73 | birthday. 74 | 75 | [[GCRLR]][[tiers-in-the-example-applications]] 76 | 77 | Tiers in the Example Applications 78 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 79 | 80 | The example applications have a web tier component (the `firstcup-war` 81 | web client), three business tier components (the `DukesAgeResource` web 82 | service, the `FirstcupUser` entity, and the `DukesBirthdayBean` 83 | enterprise bean), and an enterprise information system (EIS) tier (the 84 | data in the Apache Derby database table). The user's web browser is the 85 | client tier component, as it accesses the rest of the application 86 | through the web tier. 87 | 88 | [[GCRLU]][[jakarta-ee-technologies-used-in-the-example-applications]] 89 | 90 | Jakarta EE Technologies Used in the Example Applications 91 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 92 | 93 | The `DukesAgeResource` web service is a Jakarta RESTful Web Service resource. The 94 | `DukesBirthdayBean` enterprise bean is a stateless session bean. The 95 | `FirstcupUser` entity is a Jakarta Persistence entity. The `DukesBDay` 96 | Jakarta Context and Dependency Injection managed bean uses the Jakarta RESTful Web Service client API to access the 97 | `DukesAgeResource` web service. The `firstcup-war` web client is a 98 | Jakarta Faces application that runs in the web container of the Jakarta 99 | EE server. 100 | -------------------------------------------------------------------------------- /src/main/jbake/content/creating-example002.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Coding the dukes-age Example Application 4 | next=web-application.html 5 | prev=creating-example001.html 6 | ~~~~~~ 7 | = Coding the dukes-age Example Application 8 | 9 | 10 | [[GCRKM]][[coding-the-dukes-age-example-application]] 11 | 12 | Coding the dukes-age Example Application 13 | ---------------------------------------- 14 | 15 | This section describes how to code the `dukes-age` example application, 16 | a web application containing a Jakarta RESTful web service endpoint. 17 | 18 | [[GCSKG]][[getting-started]] 19 | 20 | Getting Started 21 | ~~~~~~~~~~~~~~~ 22 | 23 | Before you start coding the example, you need to perform some 24 | configuration tasks: 25 | 26 | 1. Register the server with your NetBeans IDE as described in 27 | link:intro002.html#GIOEW[Add GlassFish Server as a Server in Eclipse 28 | IDE]. 29 | 2. Install the Maven archetypes used to create the example 30 | applications. 31 | 32 | [[GCSKJ]][[install-the-maven-archetypes]] 33 | 34 | Install the Maven Archetypes 35 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 36 | 37 | Maven archetypes are templates that create the structure of a particular 38 | application. There are two archetypes included in the example, 39 | `dukes-age-archetype` and `firstcup-war-archetype`. These archetypes 40 | create Jakarta EE 8 web applications that you will then edit and deploy. 41 | 42 | Before you can create applications based on the archetypes, you must 43 | first install the archetypes and supporting projects to your local Maven 44 | repository by following these steps: 45 | 46 | 1. In Eclipse IDE select *File* -> *Import...*, then search for 47 | *Existing Maven Projects* and click *Next* 48 | 2. Click in *Browse...* and navigate to the location where you installed the 49 | tutorial (usually glassfish5/docs/firstcup`), select `example`, click *Open* 50 | and *Finish*. 51 | 3. Right-click the `firstcup-examples` project in the Project Explorer, 52 | than go to *Run As* -> *Maven Install* 53 | 54 | The required projects, including the archetypes, will be built. 55 | 56 | After that you can delete the `firstcup-examples` from your Project Explorer. 57 | Right-click the `firstcup-examples` than click *Delete*, check only 58 | *Delete 5 nested projects* than click *OK*. 59 | 60 | 61 | [[GCRKN]][[creating-the-web-service]] 62 | 63 | Creating the Web Service 64 | ~~~~~~~~~~~~~~~~~~~~~~~~ 65 | 66 | The `DukesAgeResource` endpoint is a simple RESTful web service. REST 67 | stands for _representational state transfer_, and software architectures 68 | that conform to the principles of REST are referred to as _RESTful_. 69 | RESTful web services are web-based applications that use the HTTP 70 | protocol to access, modify, or delete information contained within a 71 | _resource_. A RESTful web service resource is a source of specific 72 | information identifiable by a uniform resource identifier (URI), for 73 | example `http://example.com/someResource`, and may be manipulated by 74 | calling the HTTP protocol's methods, for example GET or POST. 75 | 76 | Web services are designed to be independent of their clients. Typically 77 | RESTful web services are publicly available to a wide variety of 78 | clients, and the clients are located throughout the Internet. This is 79 | called "loose coupling", because the clients and servers are connected only 80 | by the standard HTTP-based requests and responses, and do not need to 81 | know each other's implementation details. For this reason, `dukes-age` 82 | will be developed in its own application module and deployed separately 83 | from the `DukesBirthdayBean` enterprise bean and `firstcup-war` web 84 | client. The `dukes-age` web application could be deployed on a completely different machine 85 | without affecting the functionality of the `firstcup-war` web client. 86 | 87 | [[GCROM]][[jakarta-restful-web-services-resources]] 88 | 89 | Jakarta RESTful Web Services Resources 90 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 91 | 92 | The `DukesAgeResource` class is a Jakarta RESTful Web Services resource class that responds to HTTP GET 93 | requests and returns a `String` representing the age of Duke at the time 94 | of the request. 95 | 96 | The basic `DukesAgeResource` resource class is generated from the 97 | `dukes-age-archetype` Maven archetype. This class is annotated with the 98 | `jakarta.ws.rs.Path` annotation, which specifies the URL suffix to which 99 | the resource will respond. The `DukesAgeResource` class has a single method, 100 | `getText`, annotated with the `jakarta.ws.rs.GET` and 101 | `jakarta.ws.rs.Produces` annotations. The `@GET` annotation marks the method as a 102 | responder to HTTP GET requests, and `@Produces` specifies the MIME-type 103 | of the response sent back from `getText` to clients. In this case, the 104 | MIME-type is `text/plain`. 105 | 106 | [[GCROI]][[creating-the-dukes-age-application-using-the-maven-archetype]] 107 | 108 | Creating the dukes-age Application Using the Maven Archetype 109 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 110 | 111 | In Eclipse IDE, create a new web project using the 112 | `dukes-age-archetype` Maven archetype. 113 | 114 | Create the Project in Eclipse IDE  115 | 116 | 1. From the *File* menu, select *New* -> *Maven Project*. 117 | 2. Under *New Maven Project* dialog, click *Next*. 118 | 3. In the *Filter* field, enter `dukes-age` and check the *Include snapshot 119 | archetypes*. 120 | 4. Select `dukes-age-archetype` and click *Next*. 121 | 5. In the *Group Id* field, enter `jakarta.firstcup`. 122 | 6. In the *Artifact Id* field, enter `dukes-age`. 123 | 7. In the *Package* field, enter `jakarta.firstcup.dukesage`. 124 | 8. Click *Finish*. 125 | + 126 | You should now see the module you created in the Project Explorer tab. The 127 | project is created in the `eclipse-workspace` directory under your home 128 | directory. 129 | 130 | The `dukes-age-archetype` archetype creates the structure of the Jakarta RESTful Web Services 131 | endpoint application, including: 132 | 133 | * The `DukesAgeResource` resource class 134 | * The `web.xml` deployment descriptor 135 | 136 | After you create the basic application structure with the archetype, you 137 | will implement the functionality 138 | of the resource class, and then deploy the application. 139 | 140 | Implement the getText Method 141 | 142 | Add code to `DukesAgeResource.getText` that calculates Duke's age at the 143 | time of the request. To do this, use the `java.util.Calendar` and 144 | `java.util.GregorianCalendar` classes to create an object representing 145 | the date May 23, 1995, Duke's birthday. Then create another `Calendar` 146 | object representing today's date, and subtract today's year from Duke's 147 | birth year. If today's date falls before May 23, subtract a year from 148 | this result. Then return the result as a `String` representation. 149 | 150 | 1. Expand the *Source Packages* node, expand the 151 | `jakarta.firstcup.dukesage` node, then double-click the 152 | `DukesAgeResource.java` file to open it in the editor window. 153 | 2. Highlight the current code in `getText` and replace it with the 154 | following code: 155 | + 156 | [source,oac_no_warn] 157 | ---- 158 | // Create a new Calendar for Duke's birthday 159 | Calendar dukesBirthday = new GregorianCalendar(1995, Calendar.MAY, 23); 160 | // Create a new Calendar for today 161 | Calendar now = GregorianCalendar.getInstance(); 162 | 163 | // Subtract today's year from Duke's birth year, 1995 164 | int dukesAge = now.get(Calendar.YEAR) - dukesBirthday.get(Calendar.YEAR); 165 | dukesBirthday.add(Calendar.YEAR, dukesAge); 166 | 167 | // If today's date is before May 23, subtract a year from Duke's age 168 | if (now.before(dukesBirthday)) { 169 | dukesAge--; 170 | } 171 | // Return a String representation of Duke's age 172 | return "" + dukesAge; 173 | ---- 174 | 3. In the editor window, right-click and select *Source* -> *Format*. 175 | 4. From the *File* menu, select *Save* to save the file. 176 | 177 | [[sthref9]][[starting-glassfish-server-and-the-database-server]] 178 | 179 | Starting GlassFish Server and the Database Server 180 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 181 | 182 | Follow these steps to add the application to the server and start GlassFish Server. 183 | 184 | 1. Click the *Servers* tab. 185 | 2. Right-click the GlassFish Server instance and go to *Add and Remove...*. 186 | 3. At *Add and Remove...* dialog, select the `dukes-age` artifact and click *Add >*. 187 | 4. Click *Finish*. 188 | 5. Right-click the GlassFish Server instance and click *Start*. 189 | + 190 | Both the database server and the GlassFish Server instance will start. 191 | In the tab *Console* you can see the contents of the server log. 192 | 193 | [[GCTOZ]][[building-and-deploying-the-web-service-endpoint]] 194 | 195 | Building and Deploying the Web Service Endpoint 196 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 197 | 198 | 199 | With the previous step done, you will have built `dukes-age.war` 200 | the JAX-RS web application and deployed it to your GlassFish Server instance. 201 | 202 | After `dukes-age.war` deploys successfully to GlassFish Server, open your web 203 | browser and go to `http://localhost:8080/dukes-age/webapi/dukesAge`, and you'll see 204 | the returned `String` representing Duke's age. 205 | 206 | At this point, you've successfully created, deployed, and run your first 207 | Jakarta EE application. Now you will create a web application that uses 208 | this web service data. 209 | -------------------------------------------------------------------------------- /src/main/jbake/content/intro.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Introduction 4 | next=intro001.html 5 | prev=preface.html 6 | ~~~~~~ 7 | = Introduction 8 | 9 | 10 | [[GCQYB]][[introduction]] 11 | 12 | 1 Introduction 13 | -------------- 14 | 15 | This chapter outlines the goals and the prerequisites for completing 16 | this tutorial. 17 | -------------------------------------------------------------------------------- /src/main/jbake/content/intro001.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Goals of This Tutorial 4 | next=intro002.html 5 | prev=intro.html 6 | ~~~~~~ 7 | = Goals of This Tutorial 8 | 9 | 10 | [[GCQYJ]][[goals-of-this-tutorial]] 11 | 12 | Goals of This Tutorial 13 | ---------------------- 14 | 15 | At the completion of this tutorial, you will: 16 | 17 | * Understand the basics of tiered applications 18 | * Understand the basics of the Jakarta EE platform 19 | * Have created a multitiered Jakarta EE application 20 | * Have deployed and run your application on a Jakarta EE server 21 | * Know where to go next for more information on the Jakarta EE platform 22 | -------------------------------------------------------------------------------- /src/main/jbake/content/intro002.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Prerequisite Tasks for Completing This Tutorial 4 | next=jakarta-ee.html 5 | prev=intro001.html 6 | ~~~~~~ 7 | = Prerequisite Tasks for Completing This Tutorial 8 | 9 | 10 | [[GCQZL]][[prerequisite-tasks-for-completing-this-tutorial]] 11 | 12 | Prerequisite Tasks for Completing This Tutorial 13 | ----------------------------------------------- 14 | 15 | To complete this tutorial, you need to complete the following tasks 16 | first: 17 | 18 | * link:#software-compatibility[See the software compatibility notice] 19 | * link:#get-the-jakarta-ee-8-sdk[Get the Jakarta EE 8 SDK] 20 | * link:#install-the-eclipse-ide-distribution-for-java-ee[Install the Eclipse IDE for Enterprise Java Developers] 21 | * link:#add-glassfish-server-as-a-server-in-eclipse-ide[Add GlassFish Server as a server in Eclipse IDE] 22 | //// 23 | * link:#get-the-latest-updates-to-this-tutorial[Get the latest updates to this tutorial] 24 | //// 25 | 26 | [[software-compatibility]] 27 | 28 | Software Compatibility Notice 29 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 30 | 31 | This tutorial is compatible with the following software: 32 | 33 | [width="55%",cols="30%,60%"] 34 | |======================================================================= 35 | |*Software* |*Version* 36 | |link:http://www.oracle.com/technetwork/java/javase/downloads/index.html[Java Development Kit (JDK)] | 8 update 144 (8u144) or greater 37 | |link:https://github.com/eclipse-ee4j/glassfish/[GlassFish Server] | 6.0 or greater 38 | |link:https://netbeans.org/[NetBeans IDE] | 8.2 or greater 39 | |link:https://eclipse.org/ide/[Eclipse IDE] | 4.7.0 or greater 40 | 41 | |======================================================================= 42 | 43 | [[GCRNX]][[get-the-jakarta-ee-8-sdk]] 44 | 45 | Get the Glassfish Application Server 46 | ~~~~~~~~~~~~~~~~~~~~~~~~ 47 | 48 | To get the Glassfish, go to `https://eclipse-ee4j.github.io/glassfish/download`. 49 | Download and install the Glassfish. The location where you install it is typically 50 | `glassfish` in your home directory, but you can change this. 51 | 52 | The tutorial is installed in the `docs/firstcup` directory of your Glassfish 53 | installation. 54 | 55 | [[GCRNU]][[install-the-eclipse-ide-distribution-for-java-ee]] 56 | 57 | Install the IDE for Enterprise Java Developers 58 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 59 | 60 | To get Eclipse IDE, go to `https://www.eclipse.org/downloads/` and 61 | download the Enterprise Java Developers distribution through the installer or available packages. 62 | Install this distribution. 63 | 64 | To get NetBeans IDE, go to `https://netbeans.org/downloads/` and 65 | download the Jakarta EE distribution. Install this distribution. 66 | 67 | [[GIOEW]][[add-glassfish-server-as-a-server-in-eclipse-ide]] 68 | 69 | Add GlassFish Server as a Server in Eclipse IDE 70 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | 72 | Once you have all the necessary downloads, you must configure Eclipse 73 | IDE and get the latest tutorial updates. 74 | 75 | To run this tutorial in Eclipse IDE, you must register your GlassFish 76 | Server installation as a Eclipse server instance. Follow these 77 | instructions to register the GlassFish Server in Eclipse IDE. 78 | 79 | First of all it's needed to install Eclipse Sapphire, to install just follow the instructions: 80 | `https://download.eclipse.org/sapphire/9.1.1/repository/` 81 | 82 | After that just install GlassFish Tools it's the same process: 83 | `https://download.eclipse.org/glassfish-tools/1.0.1/repository/` 84 | 85 | Now we can add GlassFish as a server in Eclipse IDE 86 | 87 | 1. From the *File* > *New* > *Other...*, search for *Server*, select and click next. 88 | 2. In the New Server dialog, search for *Glassfish*, select *GlassFish* and click next. 89 | 3. Under *GlassFish Location*, browse to or enter the location of your 90 | GlassFish Server installation. 91 | 4. If *Java location* it's not automatically identified, look for the folder where your java 92 | is installed. 93 | 5. Under *Define GlassFish Application Server properties*, leave the default options. 94 | 6. Then click *Finish*. 95 | 96 | //// 97 | [[GIMVN]][[get-the-latest-updates-to-this-tutorial]] 98 | 99 | Get the Latest Updates to this Tutorial 100 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 101 | 102 | Check for any updates to this tutorial by using the Update Center 103 | included with the Jakarta EE 8 SDK. 104 | 105 | 1. In NetBeans IDE, select the *Services* tab and expand the *Servers* 106 | node. 107 | 2. Right-click the GlassFish Server instance and select *View Domain 108 | Update Center* to display the Update Tool. 109 | 3. In the tree, select *Available Updates* to display a list of updated 110 | packages. 111 | 4. Look for updates to the First Cup for Jakarta EE 8 112 | (`jakartaee-firstcup-tutorial`) package. 113 | 5. If there is an updated version, select First Cup for Jakarta EE 8 114 | (`jakartaee-firstcup-tutorial`) and click *Install*. 115 | //// 116 | -------------------------------------------------------------------------------- /src/main/jbake/content/jakarta-ee.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Understanding Jakarta Platform, Enterprise Edition 4 | next=jakarta-ee001.html 5 | prev=intro002.html 6 | ~~~~~~ 7 | = Understanding Jakarta Platform, Enterprise Edition 8 | 9 | 10 | [[GCRLO]][[understanding-jakarta-platform-enterprise-edition]] 11 | 12 | 2 Understanding Jakarta Platform, Enterprise Edition 13 | ---------------------------------------------------- 14 | 15 | This chapter describes the basic concepts behind enterprise application 16 | development and examines how an application server is the sum of its 17 | Jakarta EE containers. 18 | -------------------------------------------------------------------------------- /src/main/jbake/content/jakarta-ee001.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Overview of Enterprise Applications 4 | next=jakarta-ee002.html 5 | prev=jakarta-ee.html 6 | ~~~~~~ 7 | = Overview of Enterprise Applications 8 | 9 | 10 | [[GCRKY]][[overview-of-enterprise-applications]] 11 | 12 | Overview of Enterprise Applications 13 | ----------------------------------- 14 | 15 | This section describes enterprise applications and how they are designed 16 | and developed. 17 | 18 | As stated above, the Jakarta EE platform is designed to help developers 19 | create large-scale, multitiered, scalable, reliable, and secure network 20 | applications. A shorthand name for such applications is *enterprise 21 | applications*, so called because these applications are designed to 22 | solve the problems encountered by large enterprises. Enterprise 23 | applications are not only useful for large corporations, agencies, and 24 | governments, however. The benefits of an enterprise application are 25 | helpful, even essential, for individual developers and small 26 | organizations in an increasingly networked world. 27 | 28 | The features that make enterprise applications powerful, like security 29 | and reliability, often make these applications complex. The Jakarta EE 30 | platform reduces the complexity of enterprise application development by 31 | providing a development model, API, and runtime environment that allow 32 | developers to concentrate on functionality. 33 | 34 | [[GCRKR]][[tiered-applications]] 35 | 36 | Tiered Applications 37 | ~~~~~~~~~~~~~~~~~~~ 38 | 39 | In a multitiered application, the functionality of the application is 40 | separated into isolated functional areas, called tiers. Typically, 41 | multitiered applications have a client tier, a middle tier, and a data 42 | tier (often called the enterprise information systems tier). The client 43 | tier consists of a client program that makes requests to the middle 44 | tier. The middle tier is divided into a web tier and a business tier, 45 | which handle client requests and process application data, storing it in 46 | a permanent data store in the data tier. 47 | 48 | Jakarta EE application development concentrates on the middle tier to make 49 | enterprise application management easier, more robust, and more secure. 50 | 51 | [[GCRLA]][[the-client-tier]] 52 | 53 | The Client Tier 54 | ^^^^^^^^^^^^^^^ 55 | 56 | The client tier consists of application clients that access a Jakarta EE 57 | server and that are usually located on a different machine from the 58 | server. The clients make requests to the server. The server processes 59 | the requests and returns a response back to the client. Many different 60 | types of applications can be Jakarta EE clients, and they are not always, 61 | or even often, Java applications. Clients can be a web browser, a 62 | standalone application, or other servers, and they run on a different 63 | machine from the Jakarta EE server. 64 | 65 | [[GCRNL]][[the-web-tier]] 66 | 67 | The Web Tier 68 | ^^^^^^^^^^^^ 69 | 70 | The web tier consists of components that handle the interaction between 71 | clients and the business tier. Its primary tasks are the following: 72 | 73 | * Dynamically generate content in various formats for the client 74 | * Collect input from users of the client interface and return 75 | appropriate results from the components in the business tier 76 | * Control the flow of screens or pages on the client 77 | * Maintain the state of data for a user's session 78 | * Perform some basic logic and hold some data temporarily in managed 79 | beans 80 | 81 | link:#GCTOG[Table 2-1] lists some of the main Jakarta EE technologies that 82 | are used in the web tier in Jakarta EE applications. 83 | 84 | [[sthref6]][[GCTOG]] 85 | 86 | Table 2-1 Web-Tier Jakarta EE Technologies 87 | 88 | [width="80%",cols="25%,74%"] 89 | |======================================================================= 90 | |*Technology* |*Purpose* 91 | |Jakarta Faces technology |A user interface component framework for 92 | web applications that allows you to include UI components (such as 93 | fields and buttons) on a XHTML page, called a Facelets page; convert and 94 | validate UI component data; save UI component data to server-side data 95 | stores; and maintain component state 96 | 97 | |Jakarta Expression Language |A set of standard tags used in Facelets pages to 98 | refer to Jakarta EE components 99 | 100 | |Jakarta Servlets |Java programming language classes that dynamically process 101 | requests and construct responses, usually for HTML pages 102 | 103 | |Jakarta Contexts and Dependency Injection |A set of contextual 104 | services that make it easy for developers to use enterprise beans along 105 | with Jakarta Faces technology in web applications 106 | |======================================================================= 107 | 108 | 109 | [[GCRLS]][[the-business-tier]] 110 | 111 | The Business Tier 112 | ^^^^^^^^^^^^^^^^^ 113 | 114 | The business tier consists of components that provide the business logic 115 | for an application. Business logic is code that provides functionality 116 | to a particular business domain, like the financial industry, or an 117 | e-commerce site. In a properly designed enterprise application, the core 118 | functionality exists in the business tier components. 119 | 120 | The following Jakarta EE technologies are among those that are used in the 121 | business tier in Jakarta EE applications: 122 | 123 | * Jakarta Enterprise Beans components 124 | * Jakarta RESTful web services 125 | * Jakarta Persistence entities 126 | 127 | [[GCRKW]][[the-enterprise-information-systems-tier]] 128 | 129 | The Enterprise Information Systems Tier 130 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 131 | 132 | The enterprise information systems (EIS) tier consists of database 133 | servers, enterprise resource planning systems, and other legacy data 134 | sources, like mainframes. These resources typically are located on a 135 | separate machine from the Jakarta EE server, and are accessed by components 136 | on the business tier. 137 | 138 | The following Jakarta EE technologies are used to access the EIS tier in 139 | Jakarta EE applications: 140 | 141 | * The Java Database Connectivity API (JDBC) 142 | * The Jakarta Persistence 143 | * The Jakarta Connectors 144 | * The Jakarta Transactions 145 | -------------------------------------------------------------------------------- /src/main/jbake/content/jakarta-ee002.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Jakarta EE Servers and Containers 4 | next=creating-example.html 5 | prev=jakarta-ee001.html 6 | ~~~~~~ 7 | = Jakarta EE Servers and Containers 8 | 9 | 10 | [[GCRKQ]][[jakarta-ee-servers-and-containers]] 11 | 12 | Jakarta EE Servers and Containers 13 | --------------------------------- 14 | 15 | A Jakarta EE server is a server application that implements the Jakarta EE 16 | platform APIs and provides standard Jakarta EE services. Jakarta EE servers 17 | are sometimes called application servers, because they allow you to 18 | serve application data to clients, much as web servers serve web pages 19 | to web browsers. 20 | 21 | Jakarta EE servers host several application component types that correspond 22 | to the tiers in a multitiered application. The Jakarta EE server provides 23 | services to these components in the form of a container. 24 | 25 | Jakarta EE containers are the interface between the component and the 26 | lower-level functionality provided by the platform to support that 27 | component. The functionality of the container is defined by the platform 28 | and is different for each component type. Nonetheless, the server allows 29 | the different component types to work together to provide functionality 30 | in an enterprise application. 31 | 32 | [[GCRMB]][[the-web-container]] 33 | 34 | The Web Container 35 | ~~~~~~~~~~~~~~~~~ 36 | 37 | The web container is the interface between web components and the web 38 | server. A web component can be a servlet or a Jakarta Faces Facelets 39 | page. The container manages the component's life cycle, dispatches 40 | requests to application components, and provides interfaces to context 41 | data, such as information about the current request. 42 | 43 | [[GCRMA]][[the-jakarta-enterprise-beans-container]] 44 | 45 | The Jakarta Enterprise Beans Container 46 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 47 | 48 | The Jakarta Enterprise Beans container is the interface between enterprise beans, which 49 | provide the business logic in a Jakarta EE application, and the Jakarta EE 50 | server. The Jakarta Enterprise Beans container runs on the Jakarta EE server and manages the 51 | execution of an application's enterprise beans. 52 | 53 | [[GCRLJ]][[the-application-client-container]] 54 | 55 | The Application Client Container 56 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 57 | 58 | The application client container is the interface between Jakarta EE 59 | application clients (special Java SE applications that use Jakarta EE 60 | server components) and the Jakarta EE server. The application client 61 | container runs on the client machine and is the gateway between the 62 | client application and the Jakarta EE server components that the client 63 | uses. 64 | -------------------------------------------------------------------------------- /src/main/jbake/content/next-steps.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Next Steps 4 | next=next-steps001.html 5 | prev=web-application006.html 6 | ~~~~~~ 7 | = Next Steps 8 | 9 | 10 | [[GCRLL]][[next-steps]] 11 | 12 | 5 Next Steps 13 | ------------ 14 | 15 | This chapter provides additional resources for learning more about 16 | enterprise application architecture, the Jakarta EE platform, and GlassFish 17 | Server. 18 | -------------------------------------------------------------------------------- /src/main/jbake/content/next-steps001.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=The Jakarta EE Tutorial 4 | next=next-steps002.html 5 | prev=next-steps.html 6 | ~~~~~~ 7 | = The Jakarta EE Tutorial 8 | 9 | 10 | [[GCRLH]][[the-jakarta-ee-tutorial]] 11 | 12 | The Jakarta EE Tutorial 13 | ----------------------- 14 | 15 | The https://eclipse-ee4j.github.io/jakartaee-tutorial/[Jakarta EE Tutorial] documents the 16 | technologies that make up the Jakarta EE platform. The Jakarta EE Tutorial 17 | describes each piece of the platform in detail, and includes code 18 | examples that demonstrate how to use each piece of the platform. -------------------------------------------------------------------------------- /src/main/jbake/content/next-steps002.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=More Information on the Jakarta EE Platform 4 | prev=next-steps001.html 5 | ~~~~~~ 6 | = More Information on the Jakarta EE Platform 7 | 8 | 9 | [[GKHRA]][[more-information-on-the-jakarta-ee-platform]] 10 | 11 | More Information on the Jakarta EE Platform 12 | ------------------------------------------- 13 | 14 | For more information on the Jakarta EE platform, see these resources: 15 | 16 | * The Eclipse GlassFish project (`https://eclipse-ee4j.github.io/glassfish/`) 17 | * The Official Jakarta EE website (`https://jakarta.ee/`), with all the news about 18 | projects, community and events about Jakarta EE. 19 | -------------------------------------------------------------------------------- /src/main/jbake/content/preface.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Preface 4 | next=intro.html 5 | prev=title.html 6 | ~~~~~~ 7 | = Preface 8 | 9 | 10 | [[GCQYW]][[preface]] 11 | 12 | Preface 13 | ------- 14 | 15 | [NOTE] 16 | ======================================================================== 17 | 18 | This documentation is part of the Java Enterprise Edition contribution 19 | to the Eclipse Foundation and is not intended for use in relation to 20 | Java Enterprise Edition or Orace GlassFish. The documentation is in the 21 | process of being revised to reflect the new Jakarta EE branding. 22 | Additional changes will be made as requirements and procedures evolve 23 | for Jakarta EE. Where applicable, references to Java EE or Java 24 | Enterprise Edition should be considered references to Jakarta EE. 25 | 26 | Please see the Title page for additional license information. 27 | ======================================================================== 28 | 29 | This is Your First Cup: An Introduction to Jakarta Platform, Enterprise 30 | Edition, a short tutorial for beginning Jakarta EE programmers. This 31 | tutorial is designed to give you a hands-on lesson on developing an 32 | enterprise application from initial coding to deployment. 33 | 34 | [[sthref2]][[audience]] 35 | 36 | Audience 37 | ~~~~~~~~ 38 | 39 | This tutorial is intended for novice Jakarta EE developers. You should be 40 | familiar with the Java programming language, particularly the features 41 | introduced in Java Platform, Standard Edition 8. While familiarity with 42 | enterprise development and Jakarta EE technologies is helpful, this 43 | tutorial assumes you are new to developing Jakarta EE applications. 44 | 45 | 46 | [[GCQYU]][[before-you-read-this-book]] 47 | 48 | Before You Read This Book 49 | ~~~~~~~~~~~~~~~~~~~~~~~~~ 50 | 51 | Before you start this tutorial, you should: 52 | 53 | * Be familiar with the Java programming language 54 | * Be able to install software on your work machine 55 | * Have a modern web browser installed on your work machine 56 | 57 | [[GCQXV]][[related-books-and-projects]] 58 | 59 | Related Books and Projects 60 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ 61 | 62 | The following books and projects may be helpful to you in understanding 63 | this tutorial: 64 | 65 | * The https://eclipse-ee4j.github.io/jakartaee-tutorial[Jakarta EE Tutorial] 66 | * The GlassFish Server Open Source Edition documentation set 67 | * The NetBeans IDE documentation 68 | 69 | [[sthref5]][[conventions]] 70 | 71 | Conventions 72 | ~~~~~~~~~~~ 73 | 74 | The following table describes the typographic conventions that are used 75 | in this book. 76 | 77 | [width="75%",cols="20%,39%,39%"] 78 | |======================================================================= 79 | |*Convention* |*Meaning* |*Example* 80 | |*Boldface* |Boldface type indicates graphical user interface elements 81 | associated with an action, or terms defined in text. a| 82 | From the *File* menu, select *New Project*. 83 | 84 | A *cache* is a copy that is stored locally. 85 | 86 | |`Monospace` |Monospace type indicates the names of files and 87 | directories, commands within a paragraph, URLs, code in examples, text 88 | that appears on the screen, or text that you enter. a| 89 | Edit your `.login` file. 90 | 91 | Use `ls -a` to list all files. 92 | 93 | `_machine_name_% you have mail.` 94 | 95 | |_Italic_ |Italic type indicates book titles, emphasis, or placeholder 96 | variables for which you supply particular values. a| 97 | The command to remove a file is `rm _filename_`. 98 | 99 | Read Chapter 6 in the _User's Guide_. 100 | 101 | Do _not_ save the file. 102 | 103 | |======================================================================= 104 | -------------------------------------------------------------------------------- /src/main/jbake/content/title.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Jakarta Enterprise Edition Your First Cup: An Introduction to Jakarta EE, Release 9 4 | next=preface.html 5 | prev=toc.html 6 | ~~~~~~ 7 | = Jakarta Enterprise Edition Your First Cup: An Introduction to Jakarta EE, Release 9 8 | 9 | 10 | [[java-platform-enterprise-edition]] 11 | Jakarta Enterprise Edition 12 | -------------------------- 13 | 14 | Your First Cup: An Introduction to Jakarta EE 15 | 16 | Release 9 17 | 18 | Contributed 2021 19 | 20 | [[sthref1]] 21 | 22 | ''''' 23 | 24 | Jakarta Enterprise Edition Your First Cup: An Introduction to 25 | Jakarta EE, Release 9 26 | 27 | 28 | Copyright © 2021 Oracle and/or its affiliates. All rights reserved. 29 | 30 | This program and the accompanying materials are made available under the 31 | terms of the Eclipse Public License v. 2.0, which is available at 32 | http://www.eclipse.org/legal/epl-2.0. 33 | 34 | SPDX-License-Identifier: EPL-2.0 35 | 36 | Oracle and Java are registered trademarks of Oracle and/or its 37 | affiliates. Other names may be trademarks of their respective owners. 38 | 39 | Intel and Intel Xeon are trademarks or registered trademarks of Intel 40 | Corporation. All SPARC trademarks are used under license and are 41 | trademarks or registered trademarks of SPARC International, Inc. AMD, 42 | Opteron, the AMD logo, and the AMD Opteron logo are trademarks or 43 | registered trademarks of Advanced Micro Devices. UNIX is a registered 44 | trademark of The Open Group. 45 | 46 | -------------------------------------------------------------------------------- /src/main/jbake/content/web-application.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Creating Your Second Web Application 4 | next=web-application001.html 5 | prev=creating-example002.html 6 | ~~~~~~ 7 | = Creating Your Second Web Application 8 | 9 | 10 | [[GLCFC]][[creating-your-second-web-application]] 11 | 12 | 4 Creating Your Second Web Application 13 | -------------------------------------- 14 | 15 | This chapter gives step-by-step instructions on coding and running the 16 | `firstcup-war` web application, which uses the `dukes-age` web service 17 | described in link:creating-example.html#GCRKP[Chapter 3, "Creating Your 18 | First Jakarta EE Application"]. The `firstcup-war` web application is a 19 | more complicated application that uses several different Jakarta EE APIs. 20 | 21 | * link:web-application001.html#GJBCA[The firstcup-war Project] 22 | * link:web-application002.html#GIMNT[Creating the Web Application Project 23 | Using the Archetype] 24 | * link:web-application003.html#GJBCS[Modifying the Jakarta Persistence Entity] 25 | * link:web-application004.html#GCRLX[Modifying the Jakarta Enterprise Bean] 26 | * link:web-application005.html#GCRLT[Modifying the Web Client] 27 | * link:web-application006.html#GCTNX[Building, Packaging, Deploying, and 28 | Running the firstcup-war Web Application] 29 | -------------------------------------------------------------------------------- /src/main/jbake/content/web-application001.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=The firstcup-war Project 4 | next=web-application002.html 5 | prev=web-application.html 6 | ~~~~~~ 7 | = The firstcup-war Project 8 | 9 | 10 | [[GJBCA]][[the-firstcup-war-project]] 11 | 12 | The firstcup-war Project 13 | ------------------------ 14 | 15 | The `firstcup-war` web application project consists of the Jakarta 16 | Persistence entity, the Jakarta Enterprise Bean, and the Jakarta Faces 17 | web front end. 18 | 19 | The `firstcup-war` example application consumes the data from the 20 | `dukes-age` web service using the Jakarta RESTful Web Service client API. A Jakarta Faces 21 | web front end asks users to enter their birthdays to find out who is 22 | older, the user or Duke. This data is stored in an Apache Derby database table 23 | using the Jakarta Persistence. The business logic, which provides the 24 | core functionality of the application, is handled by an Jakarta Enterprise Bean. 25 | 26 | All the tiers described in link:jakarta-ee001.html#GCRKR[Tiered 27 | Applications] are present in the `firstcup-war` web application. The web 28 | or client tier is the Jakarta Faces front end. The enterprise 29 | information systems, or EIS, tier is the Derby database. The business 30 | tier is the Jakarta Enterprise Bean. 31 | -------------------------------------------------------------------------------- /src/main/jbake/content/web-application002.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Creating the Web Application Project Using the Archetype 4 | next=web-application003.html 5 | prev=web-application001.html 6 | ~~~~~~ 7 | = Creating the Web Application Project Using the Archetype 8 | 9 | 10 | [[GIMNT]][[creating-the-web-application-project-using-the-archetype]] 11 | 12 | Creating the Web Application Project Using the Archetype 13 | -------------------------------------------------------- 14 | 15 | Follow these steps to create a new web application project using the 16 | `firstcup-war-archetype` in Eclipse IDE. 17 | 18 | 1. From the *File* menu, select *New* -> *Maven Project*. 19 | 2. Under *New Maven Project* dialog, click *Next*. 20 | 3. In the *Filter* field, enter `firstcup` and check the *Include snapshot 21 | archetypes*. 22 | 4. Select `firstcup-war-archetype` and click *Next*. 23 | 5. In the *Group Id* field, enter `jakarta.firstcup`. 24 | 6. In the *Artifact Id* field, enter `firstcup-war`. 25 | 7. In the *Package* field, enter `jakarta.firstcup.firstcupwar`. 26 | 8. Click *Finish*. 27 | 28 | + 29 | You should now see the module you created in the *Project Explorer* tab. 30 | 31 | The `firstcup-war-archetype` archetype creates the structure of the web 32 | application, including the following: 33 | 34 | * Basic entity classes 35 | * Basic enterprise bean classes 36 | * Basic backing bean classes 37 | * Basic Facelets XHTML components and views 38 | * The `web.xml`, `faces-config.xml`, and `persistence.xml` deployment 39 | descriptors 40 | 41 | After you create the basic application structure with the archetype, you 42 | will configure how the application will run, implement the functionality 43 | of the classes, implement the Facelets views, and then deploy the 44 | application. 45 | -------------------------------------------------------------------------------- /src/main/jbake/content/web-application003.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Modifying the Jakarta Persistence Entity 4 | next=web-application004.html 5 | prev=web-application002.html 6 | ~~~~~~ 7 | = Modifying the Jakarta Persistence Entity 8 | 9 | 10 | [[GJBCS]][[modifying-the-jakarta-persistence-entity]] 11 | 12 | Modifying the Jakarta Persistence Entity 13 | ----------------------------------------- 14 | 15 | The Jakarta Persistence allows you to create and use Java programming 16 | language classes that represent data in a database table. A Jakarta 17 | Persistence _entity_ is a lightweight, persistent Java programming 18 | language object that represents data in a data store. To create or 19 | modify entities, or to remove them from the data store, call the 20 | operations of the Jakarta Persistence _entity manager_. To query 21 | entities, or to query the data encapsulated by the persistent fields or 22 | properties of a entity, use the Java Persistence Query Language (JPQL), 23 | a language similar to SQL that operates on entities. 24 | 25 | In `firstcup-war`, there is a single entity that defines one query. 26 | 27 | [[GKKNN]][[edit-the-constructor-of-the-firstcupuser-entity]] 28 | 29 | Edit the Constructor of the FirstcupUser Entity 30 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 31 | 32 | Add code to the constructor for `FirstcupUser`. 33 | 34 | 1. Expand the *Source Packages* node, expand the `jakarta.firstcup.firstcupwar.entity` node, 35 | then double-click the `FirstcupUser.java` file to open it in the editor 36 | window. 37 | 2. Below the field definitions in the `FirstcupUser` class, add the 38 | following code in bold to the second, two-argument constructor: 39 | + 40 | [source,oac_no_warn,subs=+quotes] 41 | ---- 42 | public FirstcupUser(Date date, int difference) { 43 | *Calendar cal = new GregorianCalendar(); 44 | cal.setTime(date); 45 | birthday = cal; 46 | ageDifference = difference;* 47 | } 48 | ---- 49 | 3. Right-click in the editor window and select *Source* -> *Format*. 50 | 51 | [[GJBCM]][[add-a-named-query-to-the-firstcupuser-entity]] 52 | 53 | Add a Named Query to the FirstcupUser Entity 54 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 55 | 56 | Add a JPQL named query to the `FirstcupUser` entity that returns the 57 | average age difference of all `firstcup-war` users. 58 | 59 | This query uses the `AVG` aggregate function to return the average of 60 | all the values of the `ageDifference` property of the `FirstcupUser` 61 | entities. 62 | 63 | 1. Directly before the class definition, copy and paste in the 64 | following code: 65 | + 66 | [source,oac_no_warn] 67 | ---- 68 | @NamedQuery(name="findAverageAgeDifferenceOfAllFirstcupUsers", 69 | query="SELECT AVG(u.ageDifference) FROM FirstcupUser u") 70 | ---- 71 | + 72 | The `@NamedQuery` annotation appears just before the class definition of 73 | the entity and has two required attributes: `name`, with the unique name 74 | for this query; and `query`, the JPQL query definition. 75 | 2. Right-click in the editor window and select *Source* -> *Format*. 76 | 3. From the *File* menu, select *Save*. 77 | -------------------------------------------------------------------------------- /src/main/jbake/content/web-application004.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Modifying the Jakarta Enterprise Bean 4 | next=web-application005.html 5 | prev=web-application003.html 6 | ~~~~~~ 7 | = Modifying the Jakarta Enterprise Bean 8 | 9 | 10 | [[GCRLX]][[modifying-the-enterprise-bean]] 11 | 12 | Modifying the Jakarta Enterprise Bean 13 | ------------------------------------ 14 | 15 | `DukesBirthdayBean` is a _stateless session bean_. Stateless session beans 16 | are Jakarta Enterprise Beans that do not maintain a conversational state with a 17 | client. With stateless session beans, the client makes isolated requests 18 | that do not depend on any previous state or requests. If an application 19 | requires conversational state, use _stateful session beans_. 20 | 21 | `DukesBirthdayBean` is a local enterprise bean that uses a no-interface 22 | view: 23 | 24 | * A _local enterprise bean_ is visible only within the application in 25 | which it is deployed. 26 | * Enterprise beans with a _no-interface_ view do not need a separate 27 | business interface that the enterprise bean class implements. The 28 | enterprise bean class is the only coding artifact needed to create a 29 | local, no-interface enterprise bean. 30 | 31 | `DukesBirthdayBean` will be packaged within the same WAR file as the 32 | Facelets web front end. 33 | 34 | [[GJBCU]][[implement-a-business-method-to-dukesbirthdaybean-that-gets-the-average-age-difference-of-firstcup-war-users]] 35 | 36 | Implement a Business Method to DukesBirthdayBean that Gets the Average Age Difference of firstcup-war Users 37 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 38 | 39 | Add code to a business method to the `DukesBirthdayBean` session bean to 40 | call the `findAverageAgeDifferenceOfAllFirstcupUsers` named query in 41 | `FirstcupUser` that returns the average age difference of all users. 42 | 43 | 1. Expand the *Source Packages* node, expand the `jakarta.firstcup.firstcupwar.ejb` node, 44 | then double-click the `DukesBirthdayBean.java` file to open it in the 45 | editor window. 46 | 2. Find the business method called `getAverageAgeDifference` and add 47 | the following code in bold by copying and pasting: 48 | + 49 | [source,oac_no_warn,subs=+quotes] 50 | ---- 51 | public Double getAverageAgeDifference() { 52 | *Double avgAgeDiff = (Double) 53 | em.createNamedQuery("findAverageAgeDifferenceOfAllFirstcupUsers") 54 | .getSingleResult(); 55 | logger.log(Level.INFO, "Average age difference is: {0}", avgAgeDiff); 56 | return avgAgeDiff;* 57 | } 58 | ---- 59 | + 60 | The named query in `FirstcupUser` is called by using the `createNamedQuery` method 61 | in `EntityManager`. Because this query returns 62 | a single number, the `getSingleResult` method is called on the returned 63 | `Query` object. The query returns a `Double`. 64 | 3. Right-click in the editor window and select *Source* -> *Format*. 65 | 66 | [[GKGOT]][[implement-a-business-method-for-calculating-the-age-difference-between-duke-and-the-user]] 67 | 68 | Implement a Business Method for Calculating the Age Difference Between Duke and the User 69 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | 71 | Add code to a business method that calculates the difference in age in 72 | years between Duke and the user and creates a new `FirstcupUser` entity. 73 | 74 | 1. Find the `getAgeDifference` business method and add the following 75 | code in bold: 76 | + 77 | [source,oac_no_warn,subs=+quotes] 78 | ---- 79 | public int getAgeDifference(Date date) { 80 | *int ageDifference; 81 | 82 | Calendar theirBirthday = new GregorianCalendar(); 83 | Calendar dukesBirthday = new GregorianCalendar(1995, Calendar.MAY, 23); 84 | 85 | // Set the Calendar object to the passed-in Date 86 | theirBirthday.setTime(date); 87 | 88 | // Subtract the user's age from Duke's age 89 | ageDifference = dukesBirthday.get(Calendar.YEAR) 90 | - theirBirthday.get(Calendar.YEAR); 91 | logger.log(Level.INFO, "Raw ageDifference is: {0}", ageDifference); 92 | // Check to see if Duke's birthday occurs before the user's. If so, 93 | // subtract one from the age difference 94 | if (dukesBirthday.before(theirBirthday) && (ageDifference> 0)) { 95 | ageDifference--; 96 | } 97 | 98 | // Create and store the user's birthday in the database 99 | FirstcupUser user = new FirstcupUser(date, ageDifference); 100 | em.persist(user); 101 | 102 | logger.log(Level.INFO, "Final ageDifference is: {0}", ageDifference); 103 | 104 | return ageDifference;* 105 | } 106 | ---- 107 | + 108 | This method creates the `Calendar` objects used to calculate the 109 | difference in age between the user and Duke and performs the actual 110 | calculation of the difference in age. 111 | + 112 | Similar to the `DukesAgeResource.getText` code, `getAgeDifference` 113 | subtracts Duke's birthday year from the user's birthday year to get a 114 | raw age difference. If Duke's birthday falls before the user's, and the 115 | raw difference is more than 0, it subtracts one year from the age 116 | difference. 117 | + 118 | A new `FirstcupUser` entity is created with the user's birthday and age 119 | difference, then stored in Derby by calling the `persist` method 120 | in `EntityManager`. 121 | + 122 | The final age difference is returned as an `int`. 123 | 2. Right-click in the editor window and select *Source* -> *Format*. 124 | 3. From the *File* menu, choose *Save*. 125 | -------------------------------------------------------------------------------- /src/main/jbake/content/web-application005.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Modifying the Web Client 4 | next=web-application006.html 5 | prev=web-application004.html 6 | ~~~~~~ 7 | = Modifying the Web Client 8 | 9 | 10 | [[GCRLT]][[modifying-the-web-client]] 11 | 12 | Modifying the Web Client 13 | ------------------------ 14 | 15 | To add the correct functionality to the web client, you need to perform 16 | the following tasks: 17 | 18 | * Modify the `DukesBDay` managed bean class 19 | * Modify the Facelets pages 20 | 21 | [[GCRQX]][[modify-the-dukesbday-managed-bean-class]] 22 | 23 | Modify the DukesBDay Managed Bean Class 24 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 25 | 26 | `DukesBDay` is a Jakarta Context and Dependency Injection managed bean that acts as a backing bean. A managed 27 | bean is a lightweight container-managed object that supports a set of 28 | basic services. A backing bean is a managed bean that provides temporary 29 | data storage for the values of the components included on a particular 30 | Jakarta Faces page. The Jakarta Faces application instantiates the 31 | managed bean and stores it in scope. The section following this one 32 | describes more about managed beans and how to configure them. 33 | 34 | This section describes how to modify the `DukesBDay` class. 35 | 36 | [[sthref10]][[call-the-dukes-age-web-service-to-retrieve-dukes-current-age]] 37 | 38 | Call the dukes-age Web Service to Retrieve Duke's Current Age 39 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 40 | 41 | Now modify the `getAge` method of `DukesBDay` to call the `dukes-age` 42 | web service using the Jakarta RESTful Web Services Client API. This will retrieve Duke's 43 | current age, so it can be compared to the user's age. 44 | 45 | 1. Expand the *Source Packages* node, expand the `jakarta.firstcup.firstcupwar.web` node, 46 | then double-click the `DukesBDay.java` file to open it in the editor 47 | window. 48 | 2. Find the `getAge` method and implement its functionality by copying 49 | and pasting the following code in bold: 50 | + 51 | [source,oac_no_warn,subs=+quotes] 52 | ---- 53 | public int getAge() { 54 | *try { 55 | Client client = ClientBuilder.newClient(); 56 | WebTarget target = 57 | client.target("http://localhost:8080/dukes-age/webapi/dukesAge"); 58 | String response = target.request().get(String.class); 59 | age = Integer.parseInt(response); 60 | } catch (IllegalArgumentException | NullPointerException | 61 | WebApplicationException ex) { 62 | logger.severe("processing of HTTP response failed"); 63 | } 64 | return age;* 65 | } 66 | ---- 67 | 3. In the editor window, right-click and select *Source* -> *Format*. 68 | 4. From the *File* menu, select *Save*. 69 | 70 | [[GCRSA]][[get-the-age-difference-from-the-dukesbirthdaybean-jakarta-enterprise-bean]] 71 | 72 | Get the Age Difference from the DukesBirthdayBean Jakarta Enterprise Bean 73 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 74 | 75 | Now modify the `processBirthday` method to get the difference in age 76 | between the user's age and Duke's age from the `DukesBirthdayBean` Jakarta Enterprise Bean, 77 | set the `absAgeDiff` variable to the absolute value of the age 78 | difference, and set a result string that will forward the user to the 79 | display page. 80 | 81 | 1. Find the `processBirthday` method and implement the functionality by 82 | copying and pasting the following code in bold: 83 | + 84 | [source,oac_no_warn,subs=+quotes] 85 | ---- 86 | public String processBirthday() { 87 | *this.setAgeDiff(dukesBirthdayBean.getAgeDifference(yourBD)); 88 | logger.log(Level.INFO, "age diff from dukesbday {0}", ageDiff); 89 | this.setAbsAgeDiff(Math.abs(this.getAgeDiff())); 90 | logger.log(Level.INFO, "absAgeDiff {0}", absAgeDiff); 91 | this.setAverageAgeDifference(dukesBirthdayBean.getAverageAgeDifference()); 92 | logger.log(Level.INFO, "averageAgeDifference {0}", averageAgeDifference); 93 | return "/response.xhtml";* 94 | } 95 | ---- 96 | + 97 | This method calls the `getAgeDifference` method of `DukesBirthdayBean` 98 | to get the age difference and store it in the `ageDiff` property, sets 99 | the absolute age difference stored in the `absAgeDiff` property, and 100 | sets the average age difference stored in the `averageAgeDifference` 101 | property. It returns the relative URL of the response page to which the 102 | user will be forwarded. 103 | 2. In the editor window, right-click and select *Source* -> *Format*. 104 | 3. From the *File* menu, select *Save*. 105 | 106 | [[GIMVD]][[creating-the-facelets-client]] 107 | 108 | Creating the Facelets Client 109 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 110 | 111 | The Facelets client consists of a _resource library_, a _composite 112 | component_, and two XHTML files. 113 | 114 | [[GIMUG]][[resource-libraries-in-firstcup-war]] 115 | 116 | Resource Libraries in firstcup-war 117 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 118 | 119 | A Jakarta Faces resource library is a collection of user-created 120 | components collected in a standard location in a web application. 121 | Resource libraries are identified according to a _resource identifier_, a 122 | string that represents a particular resource within a web application. 123 | Resources can be packaged either at the root of the web application or 124 | on the web application's classpath. 125 | 126 | A resource packaged in the web application root must be in a 127 | subdirectory of a `resources` directory at the web application root. 128 | 129 | [source,oac_no_warn,subs=+quotes] 130 | ---- 131 | resources/_resource-identifier_ 132 | ---- 133 | 134 | A resource packaged in the web application classpath must be in a 135 | subdirectory of the `META-INF/resources` directory within a web 136 | application. 137 | 138 | [source,oac_no_warn,subs=+quotes] 139 | ---- 140 | META-INF/resources/_resource-identifier_ 141 | ---- 142 | 143 | Resource identifiers are unique strings that conform to the following 144 | format: 145 | 146 | [source,oac_no_warn,subs=+quotes] 147 | ---- 148 | [_locale-prefix_/][_library-name_ /][_library-version_/]_resource-name_ [/_resource-version_] 149 | ---- 150 | 151 | Elements of the resource identifier in brackets (`[]`) are optional. A 152 | resource name, identifying a particular resource (a file or a graphic, 153 | for example), is required. In `firstcup-war`, a resource library with 154 | the name `components` is packaged in the web application root, and this 155 | library contains one resource, a file called `inputDate.xhtml`. The 156 | resource identifier for this resource is therefore 157 | `components/inputDate.xhtml`, and it is located in the web application 158 | root at `resources/components/inputDate.xhtml`. 159 | 160 | [[GIMTW]][[the-inputdate-composite-component]] 161 | 162 | The inputDate Composite Component 163 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 164 | 165 | A composite component is a set of user-defined Jakarta Faces and 166 | Facelets components located in a resource. In `firstcup-war`, the 167 | `inputDate.xhtml` resource, located in the `components` resource 168 | library, is a composite component that contains tags for reading in a 169 | date the user enters in a form. Composite components consist of an 170 | _interface_ definition and an _implementation_. 171 | 172 | The interface definition is specified with the `` tag to 173 | define which attributes are exposed to pages that use the composite 174 | component. Attributes are identified with the `` tag. 175 | 176 | The `inputDate.xhtml` interface definition is as follows. It defines a 177 | single attribute, `date`, that must be specified in pages that use the 178 | `inputDate` composite component. 179 | 180 | [source,oac_no_warn] 181 | ---- 182 | 183 | 184 | 185 | ---- 186 | 187 | The implementation of the composite component is specified with the 188 | `` tag. The tags within the `` are 189 | the actual component tags that will be added to pages that use the 190 | composite component. They can be any HTML render kit, Jakarta Faces, 191 | or Facelets tags. The `#{cc.attrs.``attribute-name``}` expression is 192 | used to get the value of the specified attribute from the page or 193 | component that is using the composite component. 194 | 195 | The implementation of the `inputDate` composite component is as follows. 196 | An HTML input text component will store the entered text into the `date` 197 | attribute, accessed by the `#{cc.attrs.date}` expression. A Jakarta 198 | Faces `convertDateTime` component will convert the entered text to a 199 | date with the form of `MM/dd/yyyy` (04/13/2014, for example). 200 | 201 | [source,oac_no_warn] 202 | ---- 203 | 204 | 205 | 206 | 207 |

208 | 209 | 210 | ---- 211 | 212 | If there's an error with the input of the `inputText` component, the 213 | form submission is unsuccessful, and a warning message is displayed. The 214 | message output is specified by the `` tag, which is connected 215 | to the `inputText` component that has the id `getdate`. 216 | 217 | [[GIMWV]][[implement-the-inputdate-composite-component]] 218 | 219 | Implement the inputDate Composite Component 220 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 221 | 222 | Modify the `inputDate` composite component in the `components` resource 223 | library. 224 | 225 | 1. Expand *Deployed Resources*, then `webapp`, then `resources`, then `components`, and open 226 | `inputDate.xhtml`. 227 | 2. Add the composite component interface definition between the opening 228 | and closing `` tags in `inputDate.xhtml`: 229 | + 230 | [source,oac_no_warn,subs=+quotes] 231 | ---- 232 | 233 | ** 234 | 235 | ---- 236 | 3. Add the composite component implementation between the opening and 237 | closing `cc:implementation` tags: 238 | + 239 | [source,oac_no_warn,subs=+quotes] 240 | ---- 241 | 242 | * 243 | 244 | 245 |

246 | * 247 | 248 | ---- 249 | 4. In the editor window, right-click and select *Source* -> *Format*. 250 | 5. From the *File* menu, select *Save*. 251 | 252 | [[GIMUM]][[the-facelets-web-interface]] 253 | 254 | The Facelets Web Interface 255 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 256 | 257 | The `firstcup-war` web application interface has two XHTML files. The 258 | `greeting.xhtml` file displays Duke's current age and the form where the 259 | user can enter a birthday. The `response.xhtml` file displays the age 260 | difference between the user and Duke. 261 | 262 | The `greeting.xhtml` file contains several pieces of the `firstcup-war` 263 | application detailed previously. It uses the localized strings contained 264 | in `WebMessages.properties` and `WebMessages_es.properties`. It uses the 265 | `DukesBDay` managed bean to call both the `DukesAgeResource` Jakarta RESTful web 266 | service and the `DukesBirthdayBean` Jakarta Enterprise Bean. It uses the 267 | `inputDate` composite component to create the input for the user to 268 | enter a birthday. 269 | 270 | Here's the content of the `greeting.xhtml` file. 271 | 272 | [source,oac_no_warn] 273 | ---- 274 | 275 | 278 | 281 | 282 | Firstcup Greeting Page 283 | 284 | 285 | 286 |

287 | 288 |

289 | 290 | 291 |

292 | 293 |

294 | 295 | 296 |

297 | 299 | 300 | 301 | 302 | 303 | ---- 304 | 305 | The `greeting.xhtml` file uses the HTML RenderKit and the `components` 306 | resource library tag libraries. The `components` tag library has a 307 | prefix of `fc`, and is used to specify the `inputDate` composite 308 | component in the form below. The 309 | `` tag has 310 | the required `date` attribute, and it stores the value in the `yourBD` 311 | property in the `DukesBDay` managed bean by using the Jakarta Expression Language 312 | `#{dukesBDay.yourBD}`. 313 | 314 | The localized strings are referenced by the Jakarta Expression Language 315 | `\#{bundle.``property-name``}`. For example, the 316 | `` tag will display the 317 | following string in English locales: 318 | 319 | [source,oac_no_warn] 320 | ---- 321 | Hi. I'm Duke. Let's find out who's older -- you or I. 322 | ---- 323 | 324 | The `` tag creates a Submit button and specifies that a 325 | successful submission should render the `response.xhtml` file by setting 326 | the `action` attribute to `#{dukesBDay.processBirthday}`. The 327 | `processBirthday` method returns the value `"/response.xhtml"`. The 328 | `action` attribute is used to define navigation rules for forms in 329 | Facelets pages. 330 | 331 | The `response.xhtml` file displays the age difference between the user 332 | and Duke and the average age difference of all users so far. Different 333 | strings are displayed based on whether the user is the same age, 334 | younger, or older than Duke. The text can be displayed or not based on 335 | the conditions specified by the `rendered` attribute of the 336 | `` tag. The conditions used in the `rendered` attribute 337 | are Jakarta Expression Language alternatives to the Java programming 338 | language conditional operators to allow XML parsing of the XHTML file. 339 | 340 | [[sthref11]][[GIMVG]] 341 | 342 | Table 4-1 Conditional Operator Jakarta Expression Language Alternatives 343 | 344 | [width="60%",cols="25%,40%,35%"] 345 | |======================================================================= 346 | |*Logical Condition* |*Java Programming Language Conditional Operator* |*Jakarta Expression Language 347 | Alternative* 348 | |AND a| 349 | `&&` 350 | 351 | 352 | a| 353 | `&&` 354 | 355 | 356 | |EQUALS a| 357 | `==` 358 | 359 | 360 | a| 361 | `==` 362 | 363 | 364 | |LESS THAN a| 365 | `<` 366 | 367 | 368 | |`lt` 369 | 370 | |GREATER THAN |`>` |`gt` 371 | |======================================================================= 372 | 373 | 374 | Here's the content of the `response.xhtml` file. 375 | 376 | [source,oac_no_warn] 377 | ---- 378 | 379 | 381 | 383 | 384 | Response Page 385 | 386 | 387 | 388 | 389 | 391 | 393 | 395 | 397 | 399 | 401 | 403 | 405 | 407 |

408 | 410 |

411 | 412 | 413 | 414 | 415 | ---- 416 | 417 | For example, the `\#{bundle.SameAge}` string is displayed if the user and 418 | Duke have the same birthday, as specified by the condition 419 | `#{dukesBDay.ageDiff == 0}` in the `rendered` attribute. That is, the 420 | following string is displayed when the `ageDiff` property of `DukesBDay` 421 | equals `0`: 422 | 423 | [source,oac_no_warn] 424 | ---- 425 | You are the same age as Duke! 426 | ---- 427 | 428 | The form also contains a `` tag that creates a *Back* 429 | button, which directs the user back to the `greeting.xhtml` page, as 430 | specified in the `action` attribute. 431 | 432 | [[GIMTA]][[add-the-form-to-greeting.xhtml]] 433 | 434 | Add the Form to greeting.xhtml 435 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 436 | 437 | Add the form that provides the user interface for displaying Duke's age 438 | and specifying the user's birthday. 439 | 440 | 1. Expand *Deployed Resources*, then `webapp`, and open `greeting.xhtml`, 441 | in the editor window, replace the text between the `` and `` 442 | tags with the following: 443 | + 444 | [source,oac_no_warn] 445 | ---- 446 |

447 | 448 |

449 | 450 | 451 |

452 | 453 |

454 | 455 | 456 |

457 | 459 | ---- 460 | 2. In the editor window, right-click and select *Source* -> *Format*. 461 | 3. From the *File* menu, select *Save*. 462 | 463 | [[GIMVW]][[add-the-form-to-response.html]] 464 | 465 | Add the Form to response.html 466 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 467 | 468 | Add a form that displays the age difference between Duke and the user, 469 | displays the average age difference of all users, and allows the user to 470 | navigate back to `greeting.xhtml`. 471 | 472 | 1. Expand *Deployed Resources*, then `webapp`, and open `response.xhtml`, 473 | in the editor window, replace the text between the `` and `` 474 | tags with the following: 475 | + 476 | [source,oac_no_warn] 477 | ---- 478 | 479 | 481 | 483 | 485 | 487 | 489 | 491 | 493 | 495 | 497 |

498 | 500 |

501 | 502 | ---- 503 | 2. In the editor window, right-click and select *Source* -> *Format*. 504 | 3. From the *File* menu, select *Save*. 505 | -------------------------------------------------------------------------------- /src/main/jbake/content/web-application006.adoc: -------------------------------------------------------------------------------- 1 | type=page 2 | status=published 3 | title=Building, Packaging, Deploying, and Running the firstcup-war Web Application 4 | next=next-steps.html 5 | prev=web-application005.html 6 | ~~~~~~ 7 | = Building, Packaging, Deploying, and Running the firstcup-war Web Application 8 | 9 | 10 | [[GCTNX]][[building-packaging-deploying-and-running-the-firstcup-war-web-application]] 11 | 12 | Building, Packaging, Deploying, and Running the firstcup-war Web Application 13 | ---------------------------------------------------------------------------- 14 | 15 | In this section, you will build the `firstcup-war` web application, 16 | deploy it to the server, and run the application. 17 | 18 | [[GCTOJ]][[build-package-and-deploy-the-firstcup-war-web-application]] 19 | 20 | Build, Package, and Deploy the firstcup-war Web Application 21 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 22 | 23 | Before we finish, we need to create a run configuraton to start the embedded 24 | database for us. 25 | 26 | 1. Go to *Run* -> *External Tools* -> *External Tools Configurations...*. 27 | 2. At *External Tools Configuration* dialog click in *Program* and *New launch configuration* icon. 28 | 3. Then give a name to the shortcut at field *Name:*. 29 | 4. At *Location:* field click in *Browse File System...* and search for your GlassFish installation. 30 | 5. In your Glassfish installation root folder, go to bin folder. 31 | 6. Select `asadmin.bat` if you are in Windows, otherwise select `asadmin.sh` and click *OK*. 32 | 7. In *Arguments:* text area put `start-database`. 33 | 8. Click *Apply* and *Run*. 34 | 35 | Now the internal database is already running. 36 | 37 | 38 | Now build and package the `DukesBirthdayBean` enterprise bean, the 39 | `FirstcupUser` entity, and the `firstcup-war` web client into a WAR 40 | file, `firstcup-war.war`, then deploy it to the server. 41 | 42 | 43 | 1. Click the *Servers* tab. 44 | 2. Right-click the GlassFish Server instance and go to *Add and Remove...*. 45 | 3. At *Add and Remove...* dialog, select the `firstcup-war` artifact and click *Add >*. 46 | 4. Click *Finish*. 47 | 5. Right-click the GlassFish Server instance and click *Start*. 48 | 49 | After `firstcup-war.war` deploys successfully to GlassFish Server, 50 | go to `http://localhost:8080/firstcup-war/` url. 51 | 52 | [[GCTQC]][[run-the-firstcup-war-application]] 53 | 54 | Run the firstcup-war Application 55 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 56 | 57 | 1. On the greeting page, enter your birth date in the *Your birthday* 58 | field. Make sure you use the date pattern specified on the page: 59 | MM/dd/yyyy. 60 | 2. Click *Submit*. 61 | 3. After the `response.xhtml` page is displayed, click *Back* to return 62 | to the `greeting.xhtml` page. 63 | 4. Enter a different birthday in the text field and click *Submit* again 64 | to see how the average age of First Cup users changes. 65 | 66 | Congrats ! -------------------------------------------------------------------------------- /src/main/jbake/jbake.properties: -------------------------------------------------------------------------------- 1 | site.host=http://jbake.org 2 | render.tags=false 3 | render.sitemap=false 4 | render.archive=false 5 | render.feed=false 6 | asciidoctor.option.safe=0 7 | asciidoctor.attributes.export=true 8 | -------------------------------------------------------------------------------- /src/main/jbake/templates/footer.ftl: -------------------------------------------------------------------------------- 1 | <#-- a footer template fragment included in the page template --> 2 |


3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | <#if content.prev??> 12 | 18 | 19 | 20 | <#if content.next??> 21 | 27 | 28 | 29 | 35 | 36 |
13 | 14 | 15 | Previous 16 | 17 | 22 | 23 | 24 | Next 25 | 26 | 30 | 31 | 32 | Contents 33 | 34 |
37 | 38 | 39 | Eclipse Foundation Logo  40 | Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 41 | 42 | 43 |

${config.status!}

44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/main/jbake/templates/header.ftl: -------------------------------------------------------------------------------- 1 | 2 | <#-- a header template fragment included in the page template --> 3 | 4 | 5 | 6 | <#if (content.title)??><#escape x as x?xml>${content.title}</#escape></#if> 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 18 | 19 |
15 | ${content.title}
16 |

${config.status!}

17 |
20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | <#if content.prev??> 30 | 36 | 37 | 38 | <#if content.next??> 39 | 45 | 46 | 47 | 53 | 54 |
31 | 32 | 33 | Previous 34 | 35 | 40 | 41 | 42 | Next 43 | 44 | 48 | 49 | 50 | Contents 51 | 52 |
55 | 56 | -------------------------------------------------------------------------------- /src/main/jbake/templates/menu.ftl: -------------------------------------------------------------------------------- 1 | <#-- a menu bar template fragment included in the page template --> -------------------------------------------------------------------------------- /src/main/jbake/templates/page.ftl: -------------------------------------------------------------------------------- 1 | <#-- a top level page layout template --> 2 | 3 | <#include "header.ftl"> 4 | <#include "menu.ftl"> 5 | 6 | ${content.body} 7 | 8 | <#include "footer.ftl"> -------------------------------------------------------------------------------- /src/theme/jakartaee-theme.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Following is the asciidoctor-pdf default theme [1], with small 3 | # customizations, mostly for header and footer, marked "EE". 4 | # 5 | # [1] https://github.com/asciidoctor/asciidoctor-pdf/blob/master/data/themes/default-theme.yml 6 | # 7 | font: 8 | catalog: 9 | # Noto Serif supports Latin, Latin-1 Supplement, Latin Extended-A, Greek, Cyrillic, Vietnamese & an assortment of symbols 10 | Noto Serif: 11 | normal: notoserif-regular-subset.ttf 12 | bold: notoserif-bold-subset.ttf 13 | italic: notoserif-italic-subset.ttf 14 | bold_italic: notoserif-bold_italic-subset.ttf 15 | # M+ 1mn supports ASCII and the circled numbers used for conums 16 | M+ 1mn: 17 | normal: mplus1mn-regular-ascii-conums.ttf 18 | bold: mplus1mn-bold-ascii.ttf 19 | italic: mplus1mn-italic-ascii.ttf 20 | bold_italic: mplus1mn-bold_italic-ascii.ttf 21 | # M+ 1p supports Latin, Latin-1 Supplement, Latin Extended, Greek, Cyrillic, Vietnamese, Japanese & an assortment of symbols 22 | # It also provides arrows for ->, <-, => and <= replacements in case these glyphs are missing from font 23 | M+ 1p Fallback: 24 | normal: mplus1p-regular-fallback.ttf 25 | bold: mplus1p-regular-fallback.ttf 26 | italic: mplus1p-regular-fallback.ttf 27 | bold_italic: mplus1p-regular-fallback.ttf 28 | fallbacks: 29 | - M+ 1p Fallback 30 | page: 31 | background_color: ffffff 32 | layout: portrait 33 | margin: [0.5in, 0.67in, 0.67in, 0.67in] 34 | # margin_inner and margin_outer keys are used for recto/verso print margins when media=prepress 35 | margin_inner: 0.75in 36 | margin_outer: 0.59in 37 | #size: A4 # EE 38 | size: Letter # EE 39 | base: 40 | align: justify 41 | # color as hex string (leading # is optional) 42 | font_color: 333333 43 | # color as RGB array 44 | #font_color: [51, 51, 51] 45 | # color as CMYK array (approximated) 46 | #font_color: [0, 0, 0, 0.92] 47 | #font_color: [0, 0, 0, 92%] 48 | font_family: Noto Serif 49 | # choose one of these font_size/line_height_length combinations 50 | #font_size: 14 51 | #line_height_length: 20 52 | #font_size: 11.25 53 | #line_height_length: 18 54 | #font_size: 11.2 55 | #line_height_length: 16 56 | font_size: 10.5 57 | #line_height_length: 15 58 | # correct line height for Noto Serif metrics 59 | line_height_length: 12 60 | #font_size: 11.25 61 | #line_height_length: 18 62 | line_height: $base_line_height_length / $base_font_size 63 | font_size_large: round($base_font_size * 1.25) 64 | font_size_small: round($base_font_size * 0.85) 65 | font_size_min: $base_font_size * 0.75 66 | font_style: normal 67 | border_color: eeeeee 68 | border_radius: 4 69 | border_width: 0.5 70 | # FIXME vertical_rhythm is weird; we should think in terms of ems 71 | #vertical_rhythm: $base_line_height_length * 2 / 3 72 | # correct line height for Noto Serif metrics (comes with built-in line height) 73 | vertical_rhythm: $base_line_height_length 74 | horizontal_rhythm: $base_line_height_length 75 | # QUESTION should vertical_spacing be block_spacing instead? 76 | vertical_spacing: $vertical_rhythm 77 | link: 78 | font_color: 428bca 79 | # literal is currently used for inline monospaced in prose and table cells 80 | literal: 81 | font_color: b12146 82 | font_family: M+ 1mn 83 | menu_caret_content: " \u203a " 84 | heading: 85 | align: left 86 | #font_color: 181818 87 | font_color: $base_font_color 88 | font_family: $base_font_family 89 | font_style: bold 90 | # h1 is used for part titles (book doctype) or the doctitle (article doctype) 91 | #h1_font_size: floor($base_font_size * 2.6) # EE 92 | h1_font_size: floor($base_font_size * 2.5) # EE, squeeze title onto one line 93 | # h2 is used for chapter titles (book doctype only) 94 | h2_font_size: floor($base_font_size * 2.15) 95 | h3_font_size: round($base_font_size * 1.7) 96 | h4_font_size: $base_font_size_large 97 | h5_font_size: $base_font_size 98 | h6_font_size: $base_font_size_small 99 | #line_height: 1.4 100 | # correct line height for Noto Serif metrics (comes with built-in line height) 101 | line_height: 1 102 | margin_top: $vertical_rhythm * 0.4 103 | margin_bottom: $vertical_rhythm * 0.9 104 | title_page: 105 | align: right 106 | logo: 107 | top: 10% 108 | title: 109 | top: 55% 110 | font_size: $heading_h1_font_size 111 | font_color: 999999 112 | line_height: 0.9 113 | subtitle: 114 | font_size: $heading_h3_font_size 115 | font_style: bold_italic 116 | line_height: 1 117 | authors: 118 | margin_top: $base_font_size * 1.25 119 | font_size: $base_font_size_large 120 | font_color: 181818 121 | revision: 122 | margin_top: $base_font_size * 1.25 123 | block: 124 | margin_top: 0 125 | margin_bottom: $vertical_rhythm 126 | caption: 127 | align: left 128 | font_size: $base_font_size * 0.95 129 | font_style: italic 130 | # FIXME perhaps set line_height instead of / in addition to margins? 131 | margin_inside: $vertical_rhythm / 3 132 | #margin_inside: $vertical_rhythm / 4 133 | margin_outside: 0 134 | lead: 135 | font_size: $base_font_size_large 136 | line_height: 1.4 137 | abstract: 138 | font_color: 5c6266 139 | font_size: $lead_font_size 140 | line_height: $lead_line_height 141 | font_style: italic 142 | first_line_font_style: bold 143 | title: 144 | align: center 145 | font_color: $heading_font_color 146 | font_family: $heading_font_family 147 | font_size: $heading_h4_font_size 148 | font_style: $heading_font_style 149 | admonition: 150 | column_rule_color: $base_border_color 151 | column_rule_width: $base_border_width 152 | padding: [0, $horizontal_rhythm, 0, $horizontal_rhythm] 153 | #icon: 154 | # tip: 155 | # name: fa-lightbulb-o 156 | # stroke_color: 111111 157 | # size: 24 158 | label: 159 | text_transform: uppercase 160 | font_style: bold 161 | blockquote: 162 | font_color: $base_font_color 163 | font_size: $base_font_size_large 164 | border_color: $base_border_color 165 | border_width: 5 166 | # FIXME disable negative padding bottom once margin collapsing is implemented 167 | padding: [0, $horizontal_rhythm, $block_margin_bottom * -0.75, $horizontal_rhythm + $blockquote_border_width / 2] 168 | cite_font_size: $base_font_size_small 169 | cite_font_color: 999999 170 | # code is used for source blocks (perhaps change to source or listing?) 171 | code: 172 | font_color: $base_font_color 173 | font_family: $literal_font_family 174 | font_size: ceil($base_font_size) 175 | padding: $code_font_size 176 | line_height: 1.25 177 | # line_gap is an experimental property to control how a background color is applied to an inline block element 178 | line_gap: 3.8 179 | background_color: f5f5f5 180 | border_color: cccccc 181 | border_radius: $base_border_radius 182 | border_width: 0.75 183 | conum: 184 | font_family: M+ 1mn 185 | font_color: $literal_font_color 186 | font_size: $base_font_size 187 | line_height: 4 / 3 188 | example: 189 | border_color: $base_border_color 190 | border_radius: $base_border_radius 191 | border_width: 0.75 192 | background_color: ffffff 193 | # FIXME reenable padding bottom once margin collapsing is implemented 194 | padding: [$vertical_rhythm, $horizontal_rhythm, 0, $horizontal_rhythm] 195 | image: 196 | align: left 197 | prose: 198 | margin_top: $block_margin_top 199 | margin_bottom: $block_margin_bottom 200 | sidebar: 201 | background_color: eeeeee 202 | border_color: e1e1e1 203 | border_radius: $base_border_radius 204 | border_width: $base_border_width 205 | # FIXME reenable padding bottom once margin collapsing is implemented 206 | padding: [$vertical_rhythm, $vertical_rhythm * 1.25, 0, $vertical_rhythm * 1.25] 207 | title: 208 | align: center 209 | font_color: $heading_font_color 210 | font_family: $heading_font_family 211 | font_size: $heading_h4_font_size 212 | font_style: $heading_font_style 213 | thematic_break: 214 | border_color: $base_border_color 215 | border_style: solid 216 | border_width: $base_border_width 217 | margin_top: $vertical_rhythm * 0.5 218 | margin_bottom: $vertical_rhythm * 1.5 219 | description_list: 220 | term_font_style: bold 221 | term_spacing: $vertical_rhythm / 4 222 | description_indent: $horizontal_rhythm * 1.25 223 | outline_list: 224 | indent: $horizontal_rhythm * 1.5 225 | #marker_font_color: 404040 226 | # NOTE outline_list_item_spacing applies to list items that do not have complex content 227 | item_spacing: $vertical_rhythm / 2 228 | table: 229 | background_color: $page_background_color 230 | #head_background_color: 231 | #head_font_color: $base_font_color 232 | head_font_style: bold 233 | #body_background_color: 234 | body_stripe_background_color: f9f9f9 235 | foot_background_color: f0f0f0 236 | border_color: dddddd 237 | border_width: $base_border_width 238 | cell_padding: 3 239 | toc: 240 | indent: $horizontal_rhythm 241 | line_height: 1.4 242 | dot_leader: 243 | #content: ". " 244 | font_color: a9a9a9 245 | #levels: 2 3 246 | # NOTE in addition to footer, header is also supported 247 | footer: 248 | font_size: $base_font_size_small 249 | # NOTE if background_color is set, background and border will span width of page 250 | #border_color: dddddd # EE 251 | #border_width: 0.25 # EE 252 | height: $base_line_height_length * 2.5 253 | line_height: 1 254 | padding: [$base_line_height_length / 2, 1, 0, 1] 255 | vertical_align: top 256 | #image_vertical_align: or 257 | # additional attributes for content: 258 | # * {page-count} 259 | # * {page-number} 260 | # * {document-title} 261 | # * {document-subtitle} 262 | # * {chapter-title} 263 | # * {section-title} 264 | # * {section-or-chapter-title} 265 | recto: 266 | #columns: "<50% =0% >50%" 267 | right: 268 | #content: '{page-number}' # EE 269 | #content: '{section-or-chapter-title} | {page-number}' 270 | #content: '{document-title} | {page-number}' 271 | content: '{document-title}{nbsp}{nbsp}{nbsp} *{page-number}*' # EE 272 | #center: 273 | # content: '{page-number}' 274 | left: # EE 275 | content: '{status}' # EE 276 | verso: 277 | #columns: $footer_recto_columns 278 | left: 279 | #content: $footer_recto_right_content # EE 280 | #content: '{page-number} | {chapter-title}' 281 | content: '*{page-number}* {nbsp}{nbsp}{nbsp}{document-title}' # EE 282 | #center: 283 | # content: '{page-number}' 284 | right: # EE 285 | content: '{status}' # EE 286 | header: # EE 287 | font_size: $base_font_size_small # EE 288 | border_color: dddddd # EE 289 | border_width: 0.25 # EE 290 | height: $base_line_height_length * 2.5 # EE 291 | line_height: 1 # EE 292 | padding: [$base_line_height_length / 2, 1, 0, 1] # EE 293 | vertical_align: top # EE 294 | recto: # EE 295 | right: # EE 296 | content: '{section-or-chapter-title}' # EE 297 | verso: # EE 298 | left: # EE 299 | content: '{section-or-chapter-title}' # EE 300 | --------------------------------------------------------------------------------