Skip to content

Latest commit

 

History

History
 
 

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

TomEE Examples

These examples demonstrate particular features of the Java EE ecosystem to help developers in the creation of their own applications.

The idea is that each example focuses in a very specific framework feature and demonstrates its usage and behaviour in a simple way.

Rules to create a new example.

  • Demo just one feature with simple business logic.

  • Don’t use more than 4 names in the example’s name. Like in the cdi-basic example where @Inject is demontrated in the Course class.

  • If your example has already 1000 lines, consider either simplifying it or split it.

  • Don’t define a Parent in maven’s pom.xml. This will make the project completely self contained and independent, making the required dependencies clear.

  • Make sure you only include dependencies that are realy needed.

  • Always include an integration test with Arquillian or ApplicationComposer.

  • Document the bahaviour of each method with javadoc.

  • Include a README file explining the purpose and what’s doing on.

  • Make sure you add the new project to the parent project pom.xml modules section.

Translation

If you want to translate an existing example into another language you just need to:

  1. Find two letter code for the language you want to translate to: https://www.loc.gov/standards/iso639-2/php/code_list.php

For example, Spanish: es or Portuguese: pt

  1. Create the translated version of the readme file with the suffix:

    README_<TwoDigitLanguageCode>.adoc

For example, Spanish: README_es.adoc or Portuguese: README_pt.adoc

Check https://github.com/apache/tomee/tree/master/examples/access-timeout for an example on how the translation into Spanish looks like.

That’s it!, TomEE website generator will pickup the language and update the examples index automatically without any further configuration.