diff --git a/Flutter/index.asciidoc b/Flutter/index.asciidoc new file mode 100644 index 000000000..31758b68d --- /dev/null +++ b/Flutter/index.asciidoc @@ -0,0 +1,32 @@ += Flutter +== How... +==== +Flutter + +## Prerequisites +* First prerequisite +* Second prerequisite + +## Learning goals +Describe in few words what the user is going to learn in this tutorial. + +Some additional text... +==== + +==== +The explanation for the step +[step] +-- +installDevonfwIde(["java", "mvn", "vscode"]) +-- +The explanation of the results +==== + +==== +The explanation for the step +[step] +-- +create file +-- +The explanation of the results +==== diff --git a/JumpTheQueue/index.asciidoc b/JumpTheQueue/index.asciidoc deleted file mode 100644 index 3defc6513..000000000 --- a/JumpTheQueue/index.asciidoc +++ /dev/null @@ -1,52 +0,0 @@ -= Jump start an end-to-end devonfw sample application. -==== -Jump The Queue is a small application based on the devonfw framework, which you can create yourself by following our simple step-by-step tutorial. By doing so, you will learn about the app development workflow and gain insight into the design of a professional business information system. - -### Prerequisites -* User should have Java, Angular development experience - -### Learning goals -* After completing this tutorial, you will have learned about a devonfw sample application Jump-The-Queue and its architecture. - -More information about Jump The Queue on https://github.com/devonfw/jump-the-queue -==== - -[step] --- -restoreDevonfwIde(["java", "mvn", "node", "ng", "npm"]) --- -First, clone the Jump-The-Queue Repository. -[step] --- -cloneRepository("", "https://github.com/devonfw/jump-the-queue.git") --- - -==== -[step] -== Build and Run Java Server --- -buildJava("jump-the-queue/java/jtqj", true) -runServerJava("jump-the-queue/java/jtqj/server", { "startupTime": 40, "port": 8081, "path": "jumpthequeue" }) --- -Now the Java Server should be running. -==== - -In the next steps we want build and run the Angular Frontend Server. For that you need to install the dependencies first. -[step] --- -npmInstall("jump-the-queue/angular") --- - -==== -Now build and run the Angular Server. -The following two steps are only needed in this tutorial. Normally you can simply execute "ng serve", open the https://localhost:4200/ and start using the app. -In the next step you need to change the Base URL for the REST Services. -[step] -== Serve the Frontend Server --- -changeFile("jump-the-queue/angular/src/environments/environment.ts", {"content": "https://[[HOST_SUBDOMAIN]]-8081-[[KATACODA_HOST]].environments.katacoda.com/jumpthequeue/services/rest", "placeholder": "http://localhost:8081/jumpthequeue/services/rest"}) -runClientNg("jump-the-queue/angular", { "startupTime": 200, "port": 4200, "path": "" }) --- -Now the Angular Frontend Server should be running. -==== - diff --git a/angular-mock-service/files/datatable.md b/angular-mock-service/files/datatable.md deleted file mode 100644 index 4217549b0..000000000 --- a/angular-mock-service/files/datatable.md +++ /dev/null @@ -1,2 +0,0 @@ -* A data table with all the elements -A data table with CRUD operations is very useful (in our case we only view details or delete an item, but they illustrate two important things: the details view shows how to navigate and consume a parametric route, the delete action shows how to invoke service operations over the loaded data - this means that the component is reusable and when the data comes with an API, only the service will need it’s implementation changed) \ No newline at end of file diff --git a/angular-mock-service/files/details.md b/angular-mock-service/files/details.md deleted file mode 100644 index caec3dd06..000000000 --- a/angular-mock-service/files/details.md +++ /dev/null @@ -1 +0,0 @@ -* A details page that reads a route parameter and displays the details of the element. \ No newline at end of file diff --git a/angular-mock-service/files/leaderboard.md b/angular-mock-service/files/leaderboard.md deleted file mode 100644 index 8d63d078b..000000000 --- a/angular-mock-service/files/leaderboard.md +++ /dev/null @@ -1,4 +0,0 @@ -The app presents 3 pages as follows: - -* A leader board with the top 3 elements -A leader board can be understood as "the most popular items in a set", "the latest updated items", "you favorite items" etc. \ No newline at end of file diff --git a/angular-mock-service/files/model.md b/angular-mock-service/files/model.md deleted file mode 100644 index 976159bfb..000000000 --- a/angular-mock-service/files/model.md +++ /dev/null @@ -1,3 +0,0 @@ -Let’s consider a 'box of data' represented in JSON. Physically this means a folder with some JSON/TS files in it. They are located in the app/mock folder. The example uses only one mock data file. The file is typed according to our data model. - -The model is represented by the interfaces we make. These interfaces describe the data structures we will use in our application. In this example, there is one data model, corresponding with the 'type' of data that was mocked. In the models folder you will find the .ts script file that describes chemical elements. The corresponding mock file defines a set is chemical element objects, in accordance to our interface definition. \ No newline at end of file diff --git a/angular-mock-service/files/services.md b/angular-mock-service/files/services.md deleted file mode 100644 index 8cb018623..000000000 --- a/angular-mock-service/files/services.md +++ /dev/null @@ -1,4 +0,0 @@ -A service is an injectable logic that can be consumed by all the components that need it. It can carry manipulation functions and ,in our case, fetch data from a provider. -Inside the Angular App, an Injector gives access to each component to their required services. It’s good coding practice to use a distinct service to each data type you want to manipulate. The type is described in a interface. - -Here we simply fetch and display the data of elements and their details. \ No newline at end of file diff --git a/angular-mock-service/images/architecture.png b/angular-mock-service/images/architecture.png deleted file mode 100644 index d21165e72..000000000 Binary files a/angular-mock-service/images/architecture.png and /dev/null differ diff --git a/angular-mock-service/images/data-box.jpg b/angular-mock-service/images/data-box.jpg deleted file mode 100644 index 6d38b8921..000000000 Binary files a/angular-mock-service/images/data-box.jpg and /dev/null differ diff --git a/angular-mock-service/images/data-table.png b/angular-mock-service/images/data-table.png deleted file mode 100644 index 55ce24d26..000000000 Binary files a/angular-mock-service/images/data-table.png and /dev/null differ diff --git a/angular-mock-service/images/detail.png b/angular-mock-service/images/detail.png deleted file mode 100644 index 2e53b5088..000000000 Binary files a/angular-mock-service/images/detail.png and /dev/null differ diff --git a/angular-mock-service/images/leaderboard.png b/angular-mock-service/images/leaderboard.png deleted file mode 100644 index b0e46d5a5..000000000 Binary files a/angular-mock-service/images/leaderboard.png and /dev/null differ diff --git a/angular-mock-service/images/project-structure.png b/angular-mock-service/images/project-structure.png deleted file mode 100644 index 75f2c6170..000000000 Binary files a/angular-mock-service/images/project-structure.png and /dev/null differ diff --git a/angular-mock-service/index.asciidoc b/angular-mock-service/index.asciidoc deleted file mode 100644 index c4656ff4b..000000000 --- a/angular-mock-service/index.asciidoc +++ /dev/null @@ -1,66 +0,0 @@ -= Angular Data Mocking and Service: A way to test the untestables -==== -In this scenario, you will learn how to write a simple mock service that helps us by feeding data into our components. - -## Prerequisites -* GitHub account -* Basic Angular knowledge - -## Learning goals -* After completing this scenario, You will learn how to test classes which have dependencies in isolation by using Mocks. - -More information about Angular Mock Service on https://github.com/devonfw/devon4ng/wiki/guide-angular-mock-service -==== - -[step] --- -restoreDevonfwIde(["ng", "npm", "vscode"]) --- - - -## Mock Data -Mock data is fake data which is artificially inserted into a piece of software. Mocking is essentially simulating the behaviour of real data in controlled ways. So in order to use mock data effectively, it is essential to have a good understanding of the software under test and more importantly how it uses its data. As with most things, there are both advantages and disadvantages to doing this. - -One of the big advantages with mock data is that it makes it possible to simulate errors and circumstances that would otherwise be very difficult to create in a real world environment. A disadvantage however is that without good understanding of the software, it will be possible to manipulate data in ways which would never actually happen in the real world. - -## Mock Service - -Services are often the smoothest files to unit test. A mock service imitates a real REST or SOAP API – it contains definitions for operations that clients call, receives requests, and returns simulated responses. - -When testing a component with service dependencies, the best practice is mocking them, in order to test the component in an isolated environment. In fact, our purpose is testing the component, not the services, that can be trouble, especially if they try to interact with a server. - -Here, we will go through a angular-mock-service sample app. - - -[step] --- -displayContent("What is mock data and service?", [{"image": "images/leaderboard.png"}, { "file": "files/leaderboard.md" }, {"image": "images/data-table.png"}, { "file": "files/datatable.md" }, {"image": "images/detail.png"}, { "file": "files/details.md" }]) - --- - -First, we have to clone the Devon4ng repository to access Angular Mock Service Sample. -[step] --- -cloneRepository("", "https://github.com/devonfw/devon4ng.git") - -openFile("devon4ng/samples/AngularMockService/src/app/models/periodicElement.ts") - -displayContent("Implementing Mock Data", [{ "file": "files/model.md" }, {"image": "images/data-box.jpg"}]) --- - - -[step] --- -openFile("devon4ng/samples/AngularMockService/src/app/services/chemical-elements.service.ts") - -displayContent("Implementing Mock Service", [{ "file": "files/services.md" }, {"image": "images/architecture.png"}]) --- - - -==== -## Conclusion -To conclude, in this tutorial you learned -* the concepts of mock data and services -* the mock architecture with the help of sample app - -==== \ No newline at end of file diff --git a/cobigen-setup/files/batchModeUsage.md b/cobigen-setup/files/batchModeUsage.md deleted file mode 100644 index 3e5d3879f..000000000 --- a/cobigen-setup/files/batchModeUsage.md +++ /dev/null @@ -1,9 +0,0 @@ -If there are multiple input elements selected, e.g., Java files, CobiGen will be started in batch mode. The generation preview will be constrained to the first selected input element. It does not preview the generation for each element of the selection or of a complex input. The selection of the files to be generated will be generated for each input element analogously afterwards. - -Thus the color encoding differs also a little bit: - - - yellow: files, which are configured to be merged. - - - red: files, which are not configured with any merge strategy and thus will be created if the file does not exist or overwritten if the file already exists - - - no color: files, which will be ignored during generation \ No newline at end of file diff --git a/cobigen-setup/files/cobiGenSetup.md b/cobigen-setup/files/cobiGenSetup.md deleted file mode 100644 index abfc6ca5c..000000000 --- a/cobigen-setup/files/cobiGenSetup.md +++ /dev/null @@ -1,18 +0,0 @@ -CobiGen CLI is installed inside your devonfw distribution. In order to execute it follow the next steps: - -* Execute the below command to navigate to devonfw installation directory repository. - -`cd devonfw`{{execute T1}} - -* Execute below command to install CobiGen. - -`devon cobigen`{{execute T1}} - -* Execute below command to setup devon environment. - -`devon`{{execute T1}} - -You have successfully setup CobiGen. -Execute the below command to verify the installation. - -`cobigen -V`{{execute T1}} \ No newline at end of file diff --git a/cobigen-setup/files/commandsAndOptions.md b/cobigen-setup/files/commandsAndOptions.md deleted file mode 100644 index 2145ec5cd..000000000 --- a/cobigen-setup/files/commandsAndOptions.md +++ /dev/null @@ -1,12 +0,0 @@ -* Execute the below command to know available CobiGen Commands - -`cobigen `{{execute T1}} - -* [generate, g]: Command used for code generation. -To know more about implementation of this command you can follow https://katacoda.com/devonfw/scenarios/cobigen. - -* [adapt-templates, a]: Generates a new templates folder next to the Cobigen CLI and stores its location inside a configuration file. After executing this command, the CLI will attempt to use the specified Templates folder. - -`cobigen a`{{execute T1}} - -To get more information about rest of all the command visit on https://devonfw.com/website/pages/docs/master-cobigen.asciidoc_cobigen-cli.html \ No newline at end of file diff --git a/cobigen-setup/files/eclipseIntegration.md b/cobigen-setup/files/eclipseIntegration.md deleted file mode 100644 index ae1403ede..000000000 --- a/cobigen-setup/files/eclipseIntegration.md +++ /dev/null @@ -1,9 +0,0 @@ - Insert the update site of your interest into the filed Work with and press Add - Stable releases: https://dl.bintray.com/devonfw/cobigen.p2/ - - * Follow the installation wizard - Select CobiGen Eclipse Plug-in → Next → Next → accept the license → Finish → OK → Yes - - * Once installed, a new menu entry named "CobiGen" will show up in the Package Explorer’s context menu. In the sub menu there will the Generate​ command, which may ask you to update the templates, and then you can start the generation wizard of CobiGen. - - * You can adapt the templates by clicking on Adapt Templates which will give you the possibility to import the CobiGen_Templates automatically so that you can modified them. \ No newline at end of file diff --git a/cobigen-setup/files/healthCheckTroubleshooting-Conclusion.md b/cobigen-setup/files/healthCheckTroubleshooting-Conclusion.md deleted file mode 100644 index a239f84d0..000000000 --- a/cobigen-setup/files/healthCheckTroubleshooting-Conclusion.md +++ /dev/null @@ -1,18 +0,0 @@ -## Health Check -However, you might face some errors while using CobiGen. So, we recommend to perform a Health Check for CobiGen Templates for better experience. - -To get more information on Health Check for CobiGen Templates visit on https://devonfw.com/website/pages/docs/master-cobigen.asciidoc_eclipse-integration.html#cobigen-eclipse_usage.asciidoc_health-check - -## Troubleshooting CLI -When generating code from a Java file, CobiGen makes use of Java reflection for generating templates. In order to do that, the CLI needs to find the compiled source code of your project. - -If you find an error like Compiled class foo\bar\EmployeeEntity.java has not been found, it means you need to run "mvn clean install" on the input project so that a new target folder gets created with the needed compiled sources. - -## Conclusion -From this tutorial you have learned the following: -* You can do CobiGen set up in your system. -* You can use the CobiGen CLI commands to generate the code. -* You can now integrate CobiGen with Eclipse and generate your crud services. -* Now you know how to use CobiGen in a particular project with Eclipse as well as CLI. - -More information about CobiGen on https://devonfw.com/website/pages/docs/master-cobigen.asciidoc.html \ No newline at end of file diff --git a/cobigen-setup/files/simpleModeUsage.md b/cobigen-setup/files/simpleModeUsage.md deleted file mode 100644 index 15548a5cb..000000000 --- a/cobigen-setup/files/simpleModeUsage.md +++ /dev/null @@ -1,11 +0,0 @@ - Selecting the menu entry Generate​ the generation wizard will be opened. - - The left side of the wizard shows all available increments, which can be selected to be generated. Increments are a container like concept encompassing multiple files to be generated, which should result in a semantically closed generation output. The type of modification of each file will be encoded into following color scheme if the files are selected for generation: - - - green: files, which are currently non-existent in the file system. These files will be created during generation - - - yellow: files, which are currently existent in the file system and which are configured to be merged with generated contents. - - - red: files, which are currently existent in the file system. These files will be overwritten if manually selected. - - - no color: files, which are currently existent in the file system. Additionally files, which were unselected and thus will be ignored during generation. \ No newline at end of file diff --git a/cobigen-setup/images/01-install-new-software.png b/cobigen-setup/images/01-install-new-software.png deleted file mode 100644 index be2acd4d2..000000000 Binary files a/cobigen-setup/images/01-install-new-software.png and /dev/null differ diff --git a/cobigen-setup/images/02-select-update-site.png b/cobigen-setup/images/02-select-update-site.png deleted file mode 100644 index 3d5f1739f..000000000 Binary files a/cobigen-setup/images/02-select-update-site.png and /dev/null differ diff --git a/cobigen-setup/images/03-simple-mode-usage.png b/cobigen-setup/images/03-simple-mode-usage.png deleted file mode 100644 index 376173a9c..000000000 Binary files a/cobigen-setup/images/03-simple-mode-usage.png and /dev/null differ diff --git a/cobigen-setup/images/04-batch-mode-usage.png b/cobigen-setup/images/04-batch-mode-usage.png deleted file mode 100644 index 93d686f71..000000000 Binary files a/cobigen-setup/images/04-batch-mode-usage.png and /dev/null differ diff --git a/cobigen-setup/index.asciidoc b/cobigen-setup/index.asciidoc deleted file mode 100644 index 22d28411c..000000000 --- a/cobigen-setup/index.asciidoc +++ /dev/null @@ -1,90 +0,0 @@ -= Setting up devonfw Code Generator(i.e. CobiGen) -==== -CobiGen is a generic incremental code generator. It allows you to generate application code based on the devonfw architecture including all software layers. -There is also a CobiGen Command Line Interface(CLI) where you can start the setup following the generation of code. - -This tutorial mainly focuses on the setup of CobiGen along with various commands to execute the generations. -## Prerequisites -* devonfw IDE -* User should have development experience of any language. - -## Learning goals. -Here in this tutorial you will learn -* To setup CobiGen -* To use commands on CobiGen CLI -* To integrate Eclipse with CobiGen -==== - -[step] --- -restoreDevonfwIde(["java","mvn"]) --- - -==== -devonfw IDE has been installed for you. - -[step] --- -displayContent("CobiGen Setup", [{ "file": "files/cobiGenSetup.md" }]) --- - -In next step, you will learn about CobiGen CLI commands. -==== - - -==== - -In this step, you will learn CobiGen commands. - -[step] --- -displayContent("CobiGen CLI Commands and Options", [{ "file": "files/commandsAndOptions.md" }]) --- - -In next step, you will learn about how to integrate CobiGen with Eclipse. -==== - - -Note: CobiGen comes preinstalled with devonfw IDE. - -1.1 Preconditions - - Eclipse 4.x - - - Atleast Java 7 Runtime (for starting eclipse with CobiGen). This is independent from the target version of your developed code - -1.2. Installation steps - * Open the eclipse installation dialog - menu bar → Help → Install new Software -[step] --- -displayContent("Integrate Eclipse with CobiGen", [{"image": "images/01-install-new-software.png"}]) --- - -==== -Here you can select the updates. - 2. Open CobiGen’s update site - -[step] --- -displayContent("Select Update Site", [{"image": "images/02-select-update-site.png"}, { "file": "files/eclipseIntegration.md" }]) --- - -* Checkout (clone) your project’s templates folder or use the current templates released with CobiGen (https://github.com/devonfw/cobigen/tree/master/cobigen-templates) and then choose -Import -> General -> Existing Projects into Workspace to import the templates into your workspace. -==== - - -[step] --- -displayContent("CobiGen Usage - Simple Mode", [{ "file": "files/simpleModeUsage.md" }, {"image": "images/03-simple-mode-usage.png"}]) --- - -[step] --- -displayContent("CobiGen Usage - Batch Mode", [{ "file": "files/batchModeUsage.md" }, {"image": "images/04-batch-mode-usage.png"}]) --- - -[step] --- -displayContent(" ", [{ "file": "files/healthCheckTroubleshooting-Conclusion.md" }]) --- diff --git a/create-your-own-tutorial/files/alternativeSyntax.md b/create-your-own-tutorial/files/alternativeSyntax.md deleted file mode 100644 index cad582361..000000000 --- a/create-your-own-tutorial/files/alternativeSyntax.md +++ /dev/null @@ -1,14 +0,0 @@ -If you want to add some additional text after the step to explain the results of a step then you have to use the following syntax. - -``` -==== -The explanation for the step -[step] --- -functionName(parameters) --- -The explanation of the results -==== -``` - -Here the whole block has to be surrounded by `====`. \ No newline at end of file diff --git a/create-your-own-tutorial/files/createNewBranch.md b/create-your-own-tutorial/files/createNewBranch.md deleted file mode 100644 index 7a655afa2..000000000 --- a/create-your-own-tutorial/files/createNewBranch.md +++ /dev/null @@ -1,11 +0,0 @@ -Create a new branch inside the cloned repository. - -Navigate into the tutorials directory. - -`cd tutorials`{{execute T1}} - -Create a new branch for your tutorial and switch into this branch. - -`git branch tutorial/myOwnTutorial`{{execute T1}} - -`git checkout tutorial/myOwnTutorial`{{execute T1}} diff --git a/create-your-own-tutorial/files/createPullRequest1.md b/create-your-own-tutorial/files/createPullRequest1.md deleted file mode 100644 index 7b5ac9b39..000000000 --- a/create-your-own-tutorial/files/createPullRequest1.md +++ /dev/null @@ -1,14 +0,0 @@ -Before starting write content into the tutorial, you have to create a pull request from your newly created branch into the main repository. -This has the advantage that your tutorial will automatically be build and pushed to https://katacoda.com/devonfw-dev. So you can directly test it. - -For this step you need to open you local terminal at your forked and cloned 'tutorials' folder and run the following commands: -1. 'git add .' -2. 'git commit -m "initial commit for tutorial myTutorial"' -3. 'git push' - -This will save all the changes and push them into your tutorials GitHub repository. - -Switch to your browser and open: -https://github.com/devonfw-tutorials/tutorials - -Click on 'Pull requests' > 'New pull request'. diff --git a/create-your-own-tutorial/files/createPullRequest2.md b/create-your-own-tutorial/files/createPullRequest2.md deleted file mode 100644 index 09af4ad87..000000000 --- a/create-your-own-tutorial/files/createPullRequest2.md +++ /dev/null @@ -1,15 +0,0 @@ - -Select - - * base repository: devonfw-tutorials - * base: main - * head repository: [your username]/tutorials - * compare: [your branch name] - -and finally create the pull request by clicking on 'Create pull request'. - -Write 'WIP:' in front of the pull request title to show that you are still working on this pull request. 'WIP' stands for 'Work In Progress'. - -A workflow in the tutorials repository will build the tutorial. Currently the pipeline will fails because a tutorial must contain at least a title, a description and one step. - -Let's fix that and fill the tutorial. \ No newline at end of file diff --git a/create-your-own-tutorial/files/description.txt b/create-your-own-tutorial/files/description.txt deleted file mode 100644 index 6d5e739e5..000000000 --- a/create-your-own-tutorial/files/description.txt +++ /dev/null @@ -1,6 +0,0 @@ -= Title of my new tutorial -==== -In this section you can write the description of the tutorial. This can consist of several lines. - -The description should explain the tutorial in a few words and explain what is to be learned. -==== diff --git a/create-your-own-tutorial/files/localTesting.md b/create-your-own-tutorial/files/localTesting.md deleted file mode 100644 index f11fd91dd..000000000 --- a/create-your-own-tutorial/files/localTesting.md +++ /dev/null @@ -1,34 +0,0 @@ -Now you should have a ideo how to create your own tutorials. - -There is also a way to test your tutorials on your local machine. For this you have to clone the tutorial-compiler repository. - -The directory with the tutorial-compiler has to be located next to the directory with the tutorials repository. - -So go back to the root directory and clone the repository. - -`cd /root`{{execute T1}} - -`git clone https://github.com/devonfw-tutorials/tutorial-compiler.git`{{execute T1}} - -The tutorial-compiler needs typescript to be installed to work. So install typescript on your machine. - -`npm install typescript -g`{{execute T1}} - -Now navigate into the tutorial-compiler directory and install the needed dependencies. - -`cd tutorial-compiler`{{execute T1}} - -`npm install`{{execute T1}} - - -# Test your tutorial locally -To run the tutorial-compiler execute the following command: - -`bash localBuildRun.sh -e katacoda -p myTutorial`{{execute T1}} - -This will execute your newly create tutorial in the 'katacoda' environment. If you obmit the '-e' and '-p' paramter, all tutorials are executed in all environments. - -The tutorial-compiler now generates the files needed for a katacoda tutorial. You can find the files in the 'build/output/katacoda/myTutorial' directory of the tutorial compiler. -The step you added to your tutorial is shown in the following file: - -`tutorial-compiler/build/output/katacoda/myTutorial/step1.md`{{open}} \ No newline at end of file diff --git a/create-your-own-tutorial/files/pushTutorial.md b/create-your-own-tutorial/files/pushTutorial.md deleted file mode 100644 index f6639048b..000000000 --- a/create-your-own-tutorial/files/pushTutorial.md +++ /dev/null @@ -1,13 +0,0 @@ -You now have a working tutorial. - -Push the changes again to GitHub by executing the following commands: - -1. 'git add .' -2. 'git commit -m "added createFile step to the tutorial"' -3. 'git push' - -This will automatically start the workflow in the tutorials repository. - -After a while you can find your tutorial on https://katacoda.com/devonfw-dev. - -After you have completed your tutorial and tested it on the katacoda account, remove the 'WIP' from your pull request to show that the tutorial is finished. \ No newline at end of file diff --git a/create-your-own-tutorial/files/step.txt b/create-your-own-tutorial/files/step.txt deleted file mode 100644 index a719fdc6c..000000000 --- a/create-your-own-tutorial/files/step.txt +++ /dev/null @@ -1,13 +0,0 @@ -= Title of my new tutorial -==== -In this section you can write the description of the tutorial. This can consist of several lines. - -The description should explain the tutorial in a few words and explain what is to be learned. -==== - -Before the '[step]' keyword the explanation is written. -The explanation can consist of multiple lines. -[step] --- -createFile("pathToTheFile/fileName.txt") --- \ No newline at end of file diff --git a/create-your-own-tutorial/images/clone_code.jpg b/create-your-own-tutorial/images/clone_code.jpg deleted file mode 100644 index b97f76a1a..000000000 Binary files a/create-your-own-tutorial/images/clone_code.jpg and /dev/null differ diff --git a/create-your-own-tutorial/images/compare.jpg b/create-your-own-tutorial/images/compare.jpg deleted file mode 100644 index 3ea763c8c..000000000 Binary files a/create-your-own-tutorial/images/compare.jpg and /dev/null differ diff --git a/create-your-own-tutorial/images/fork.jpg b/create-your-own-tutorial/images/fork.jpg deleted file mode 100644 index 2ed00515a..000000000 Binary files a/create-your-own-tutorial/images/fork.jpg and /dev/null differ diff --git a/create-your-own-tutorial/images/pull_request.jpg b/create-your-own-tutorial/images/pull_request.jpg deleted file mode 100644 index 70ef29bb5..000000000 Binary files a/create-your-own-tutorial/images/pull_request.jpg and /dev/null differ diff --git a/create-your-own-tutorial/index.asciidoc b/create-your-own-tutorial/index.asciidoc deleted file mode 100644 index 2822b5161..000000000 --- a/create-your-own-tutorial/index.asciidoc +++ /dev/null @@ -1,113 +0,0 @@ -= Create your own tutorial -==== -In this scenario, you will learn how to create your own tutorial using the tutorial compiler. - -## Prerequisites -* GitHub account - -## Learning goals -* You will learn how to set up the environment and get an introduction to the syntax for writing your own tutorial. - -You can find the documentation of the tutorial compiler here: - -https://github.com/devonfw-forge/tutorial-compiler/wiki -==== - -==== -# Setup your workspace -Let's start! - -First of all, go to the tutorials repository on GitHub: - -https://github.com/devonfw-tutorials/tutorials - -Fork the repository by clicking on the 'Fork' button. -This will create a copy of the repository in your own GitHub account. You will find it in 'Your repositories'. - -[step] --- -displayContent("Fork the tutorials repository", [{"image": "images/fork.jpg"}, {"content": "\nOpen the forked repository in your GitHub account and copy the repository URL as shown in image below.\n"}, {"image": "images/clone_code.jpg"}]) --- -==== - - -Paste the URL to the 'git clone' command to clone the repostitory. For this tutorial we will use the original tutorials repository of the 'devonfw-tutorials' GitHub account to show the workflow of creating the tutorial. - -When you run the command on your machine, you will of course need to customize the URL and add your personal GitHub name. So the command will be `git clone https://github.com/YourName/tutorials.git`. -[step] -== Clone the repository --- -cloneRepository("", "https://github.com/devonfw-tutorials/tutorials.git") --- - -==== -[step] --- -displayContent("Create a new branch", [{ "file": "files/createNewBranch.md" }]) --- -Now you can start to create the tutorial. This will be shown in the next steps. -==== - -# Create the tutorial - -Each tutorial is located in its own directory and consists of an asciidoc file, in which the tutorial is specified. The file is always named 'index.asciidoc'. - -So create a new folder in inside the tutorials directory and the file for the tutorial. -[step] --- -createFile("tutorials/myTutorial/index.asciidoc") --- - -[step] --- -displayContent("Create a pull request", [{ "file": "files/createPullRequest1.md" }, {"image": "images/pull_request.jpg"}, {"content": "\nYou might have to click on 'compare across forks'.\n"}, {"image": "images/compare.jpg"}, { "file": "files/createPullRequest2.md" }]) --- - -The syntax in which the tutorial is written can be found at https://github.com/devonfw-tutorials/tutorials/wiki/Development. - -At first we will add a title to the first line of the file. -[step] -== Add the title --- -changeFile("tutorials/myTutorial/index.asciidoc", {"content": "= Title of my new tutorial"}) --- - -The next step is to add some description lines below the title. The description has to be surrounded by `====`. -[step] -== Add the description --- -changeFile("tutorials/myTutorial/index.asciidoc", {"file": "files/description.txt", "placeholder": "= Title of my new tutorial" }) --- - -==== -Last but not least add a step. - -Each step consists of - -* an explanation -* a function to execute (You can find a list with the currently available functions on https://github.com/devonfw-tutorials/tutorial-compiler/wiki/Functions) -* and an optional explanation of the results of the step. - -In this tutorial we will add a simple step which creates a new file. -[step] -== Add a step --- -changeFile("tutorials/myTutorial/index.asciidoc", {"file": "files/step.txt" }) --- -This is the syntax without additional text after the step. There is an alternative syntax to display a text after the step (e.g. for describing the results of a step). This will be shown in the next step. -==== - -[step] --- -displayContent("Alternative syntax", [{ "file": "files/alternativeSyntax.md" }]) --- - -[step] --- -displayContent("Push tutorial", [{ "file": "files/pushTutorial.md" }]) --- - -[step] --- -displayContent("Local testing", [{ "file": "files/localTesting.md" }]) --- diff --git a/devon4j-app/images/devon4j_proj_structure1.jpg b/devon4j-app/images/devon4j_proj_structure1.jpg deleted file mode 100644 index 197462b2f..000000000 Binary files a/devon4j-app/images/devon4j_proj_structure1.jpg and /dev/null differ diff --git a/devon4j-app/index.asciidoc b/devon4j-app/index.asciidoc deleted file mode 100644 index a242c249e..000000000 --- a/devon4j-app/index.asciidoc +++ /dev/null @@ -1,104 +0,0 @@ -= Generate your Java application with devon4j -==== -devon4j is the Java stack of devonfw. It allows you to build business applications (backends) using Java technology in a highly efficient and standardized way based on established best-practices. - -# Prerequisites -* User should have Java development experience - -# Learning goals -* After completing this scenario, you will have learned how to generate Java application using devon4j. - -More information about devon4j on https://devonfw.com/website/pages/docs/devon4j.asciidoc.html - -==== - -[step] --- -restoreDevonfwIde (["java","mvn","vscode"]) --- -==== -### A devon4j Sample Application - -Note: Startup script will take some time for set up. After that you can proceed further. - -If you want to create devon4j application on your local machine there are two ways to do it: - -* In eclipse as shown [here](https://devonfw.com/website/pages/docs/devon4j.asciidoc_tutorials.html#tutorial-newapp.asciidoc_from-eclipse) - -* Using command line as shown [here](https://devonfw.com/website/pages/docs/devon4j.asciidoc_tutorials.html#tutorial-newapp.asciidoc_from-command-line) - -Now, you will create sample devon4j application with name *sampleapp*. This step will guide you on how to do it. - - -[step] --- -createDevon4jProject("com.example.application.sampleapp") --- - -Once sampleapp is created switch to next tab of IDE. In IDE explorer you can see folder structure like devonfw-> workspaces->main->sampleapp . - -Sampleapp contains 3 modules i.e api, core and server. - -**api**: It contains API for sampleapp.The API contains the required artifacts to interact with your application via remote services. This can be REST service interfaces, transfer-objects with their interfaces and datatypes but also OpenAPI or gRPC contracts. - -**core**: It is the core of the application.In this module you can write actual business logic with service implementation, as well as entire logic layer and dataaccess layer. - -**batch**: Optional module for batch layer. In this example we have not created it. To add batch module while generating from commandline use -Dbatch=batch parameter. And to generate it from eclipse using maven archetype, enter batch variable value as batch in project creation page. - -**server**: This module bundles the entire app (core with optional batch) typically as a bootified WAR file. - -If you want to know more about modules and project structure refer [here](#https://github.com/devonfw/devon4j/blob/master/documentation/guide-structure.asciidoc#project-structure). -==== - - -==== -[step] --- -displayContent("devon4j multilayer architecture", [{ "image": "images/devon4j_proj_structure1.jpg" }]) --- - -As shown in above image, devon4j application follows [multilayered architecture](https://en.wikipedia.org/wiki/Multitier_architecture). - -Each component is divided into following layers: - -* [client layer](https://github.com/devonfw/devon4j/blob/master/documentation/guide-client-layer.asciidoc) for the front-end (GUI). - -* [service layer](https://github.com/devonfw/devon4j/blob/master/documentation/guide-service-layer.asciidoc) for the services used to expose functionality of the back-end to the client or other consumers. For example, in sampleapp we generated com.example.application.sampleapp..service.impl will have all rest service implementation. - -* [batch layer](https://github.com/devonfw/devon4j/blob/master/documentation/guide-batch-layer.asciidoc) for exposing functionality in batch-processes (e.g. mass imports). - -* [logic layer](https://github.com/devonfw/devon4j/blob/master/documentation/guide-logic-layer.asciidoc) for the business logic. For example, in sampleapp we generated com.example.application.sampleapp..logic will contain business logic or usecase implementation. - -* [data-access layer](https://github.com/devonfw/devon4j/blob/master/documentation/guide-dataaccess-layer.asciidoc) for the data access (esp. persistence).For example, in sampleapp we generated com.example.application.sampleapp..dataaccess will contain entity, repositories etc. -==== - - -==== -Now you have to build a devon4j sample application i.e. sampleapp. - -[step] --- -buildJava("sampleapp", false) --- - -Once build is successful you will get bootified-war generated in server module target folder. In sampleapp check for path sampleapp/server/sampleapp-server-bootified.war - -==== - - -==== -## Conclusion - -In this tutorial you have learnt how to create devon4j application using command line or via Eclipse. Next you can check for other tutorials such as: - - * devon4j- contract first code generation - - * devon4j-Kafka - - * devon4j-security - - * devon4j with Spring JPA - - * devon4j rest services - - ==== diff --git a/devon4j-architecture/devon4j-app-arch.md b/devon4j-architecture/devon4j-app-arch.md deleted file mode 100644 index ae01d649b..000000000 --- a/devon4j-architecture/devon4j-app-arch.md +++ /dev/null @@ -1,18 +0,0 @@ -### Key Principles: -devon4j application follows some fundamental principles for all decisions about architecture, design, or choosing standards, libraries, and frameworks. -It follows key principles such as KISS, open,patterns, solid. More detils can be found [here](https://github.com/devonfw/devon4j/blob/master/documentation/architecture.asciidoc#key-principles). - -### Architecture Principles: -Additionally devon4j architecture is based on [architecture principles](https://github.com/devonfw/devon4j/blob/master/documentation/architecture.asciidoc#architecture-principles) such as Component Oriented Design, Homogeneity. - -### Application Architecture: - -For the architecture of an application we distinguish the following views: - -* The **Business Architecture** describes an application from the business perspective. It divides the application into business components and with full abstraction of technical aspects. - -* The **Technical Architecture** describes an application from the technical implementation perspective. It divides the application into technical layers and defines which technical products and frameworks are used to support these layers. - -* The **Infrastructure Architecture** describes an application from the operational infrastructure perspective. It defines the nodes used to run the application including clustering, load-balancing and networking. This view is not explored further in this guide. - -Detailed description about devon4j business and technical architecture can be found [here](https://github.com/devonfw/devon4j/blob/master/documentation/architecture.asciidoc#application-architecture) diff --git a/devon4j-architecture/images/jtqj_app_structure.jpg b/devon4j-architecture/images/jtqj_app_structure.jpg deleted file mode 100644 index a437e253b..000000000 Binary files a/devon4j-architecture/images/jtqj_app_structure.jpg and /dev/null differ diff --git a/devon4j-architecture/images/jtqj_detailed_app_structure.jpg b/devon4j-architecture/images/jtqj_detailed_app_structure.jpg deleted file mode 100644 index b857bc2a2..000000000 Binary files a/devon4j-architecture/images/jtqj_detailed_app_structure.jpg and /dev/null differ diff --git a/devon4j-architecture/index.asciidoc b/devon4j-architecture/index.asciidoc deleted file mode 100644 index 18385c11a..000000000 --- a/devon4j-architecture/index.asciidoc +++ /dev/null @@ -1,102 +0,0 @@ -= devon4j architecture in practice -==== -## Prerequisites - -Java programming knowledge - -## Learning goals - -This tutorial aims to explain concepts and principles of devon4j architecture with help of an sample application named JumpTheQueue. Below are the steps we will go through to understand it clearly. - -* Clone JumpTheQueue repository -* Understand devon4j application structure -* Understand Key and architectural principles followed by devon4j -* Understand devon4j application architecture - -By end of this tutorial you will have detailed understanding of principles followed by devon4j application as well as its structure and architecture. - -==== -### setup environment -We will start by setting up development environment. - -[step] --- -restoreDevonfwIde(["java", "vscode"]) --- -==== -### Clone jump the queue repository - -First, clone the Jump-The-Queue Repository.Jump the queue is a sample devonfw application. -[step] --- -cloneRepository("", "https://github.com/devonfw/jump-the-queue.git") --- -Once project is cloned switch to next tab of IDE. In IDE explorer you will be able to see folder structure like devonfw-> workspaces->main->jump-the-queue-> java->jtqj -==== -==== -### devon4j application structure -[step] --- -displayContent("devon4j application architecture", [{ "image": "images/jtqj_app_structure.jpg" }]) --- - -As shown above, jump-the-queue contains 3 modules i.e api, core and server. - -**api**: It contains API for sampleapp.The API contains the required artifacts to interact with your application via remote services. This can be REST service interfaces, transfer-objects with their interfaces and datatypes but also OpenAPI or gRPC contracts. - -**core**: It is the core of the application.In this module you can write actual business logic with service implementation, as well as entire logic layer and dataaccess layer. - -**batch**: optional module for batch layer. In this example we have not created it. - -**server**: This module bundles the entire app (core with optional batch) typically as a bootified WAR file. - -If you want to know more about modules and project structure refer [here](https://github.com/devonfw/devon4j/blob/master/documentation/guide-structure.asciidoc#project-structure). - -devon4j application follows [multilayered architecture](https://en.wikipedia.org/wiki/Multitier_architecture). We will understand more about it in next step. - -==== -==== -### devon4j layers explained - -[step] --- -displayContent("devon4j application layers", [{ "image": "images/jtqj_detailed_app_structure.jpg" }]) --- - -Above image display detailed structure of devon4j application. As shown above jump-the-queue application contains different components like queuemanagement, visitormanagement etc - -Each component is divided into following layers: -* [client layer](https://github.com/devonfw/devon4j/blob/master/documentation/guide-client-layer.asciidoc) for the front-end (GUI). - -* [service layer](https://github.com/devonfw/devon4j/blob/master/documentation/guide-service-layer.asciidoc) for the services used to expose functionality of the back-end to the client or other consumers. -For example, in jtqj-api->queuemangement->service->api-> rest contains interfaces for rest services. In core module jtqj-core->queuemanagement->service->impl-> rest you will be able to see implementation of service. - -* [batch layer](https://github.com/devonfw/devon4j/blob/master/documentation/guide-batch-layer.asciidoc) for exposing functionality in batch-processes (e.g. mass imports). - -* [logic layer](https://github.com/devonfw/devon4j/blob/master/documentation/guide-logic-layer.asciidoc) for the business logic. -For example, in jtqj-api->queuemangement->logic->api contains ETO(Entity Transfer Object) , CTO(Composite Transfer object), some logic interfaces. In core module jtqj-core->queuemanagement->logic->impl you will be able to see usecase implementation. - -* [data-access layer](https://github.com/devonfw/devon4j/blob/master/documentation/guide-dataaccess-layer.asciidoc) for the data access (esp. persistence). -For example, in jtqj-api->queuemangement->dataaccess->core contains entities, spring data repositories etc - -==== - -[step] --- -displayContent("Understand devon4j application architecture", [{ "file": "devon4j-app-arch.md" }]) --- - -==== -### Conclusion - -To summarize, in this tutorial we learned about devon4j architecture and key principle it follows. with help of example we also learned about devon4j different modules such as api, core ,server and its multilayered architecture. - -Next you can visit following tutorials to know more about devon4j: - * Java backend code generation using CobiGen (Code Generator) - * devon4j- contract first code generation - * devon4j-Kafka - * devon4j-security - * devon4j with Spring JPA - * devon4j rest services - ==== - diff --git a/devon4j-http-rest-client/files/BaseWebSecurityConfig.txt b/devon4j-http-rest-client/files/BaseWebSecurityConfig.txt deleted file mode 100644 index ef15ae1c2..000000000 --- a/devon4j-http-rest-client/files/BaseWebSecurityConfig.txt +++ /dev/null @@ -1,117 +0,0 @@ -package com.example.application.httprestserver.general.service.impl.config; - -import javax.inject.Inject; -import javax.servlet.Filter; - -import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; -import org.springframework.security.core.userdetails.UserDetailsService; -import org.springframework.security.crypto.password.PasswordEncoder; -import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler; -import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler; -import org.springframework.security.web.authentication.logout.LogoutFilter; -import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler; -import org.springframework.security.web.authentication.www.BasicAuthenticationFilter; -import org.springframework.security.web.util.matcher.AntPathRequestMatcher; - -import com.devonfw.module.security.common.api.config.WebSecurityConfigurer; -import com.devonfw.module.security.common.impl.rest.AuthenticationSuccessHandlerSendingOkHttpStatusCode; -import com.devonfw.module.security.common.impl.rest.JsonUsernamePasswordAuthenticationFilter; -import com.devonfw.module.security.common.impl.rest.LogoutSuccessHandlerReturningOkHttpStatusCode; - -/** - * This type serves as a base class for extensions of the {@code WebSecurityConfigurerAdapter} and provides a default - * configuration.
- * Security configuration is based on {@link WebSecurityConfigurerAdapter}. This configuration is by purpose designed - * most simple for two channels of authentication: simple login form and rest-url. - */ -public abstract class BaseWebSecurityConfig extends WebSecurityConfigurerAdapter { - - @Inject - private UserDetailsService userDetailsService; - - @Inject - private PasswordEncoder passwordEncoder; - - @Inject - private WebSecurityConfigurer webSecurityConfigurer; - - - - /** - * Configure spring security to enable a simple webform-login + a simple rest login. - */ - @Override - public void configure(HttpSecurity http) throws Exception { - - String[] unsecuredResources = new String[] { "/login", "/security/**", "/services/rest/login", - "/services/rest/logout" }; - - // disable CSRF protection by default, use csrf starter to override. - http = http.httpBasic().and().csrf().disable(); - // load starters as pluggins. - http = this.webSecurityConfigurer.configure(http); - - http - // - .userDetailsService(this.userDetailsService) - // define all urls that are not to be secured - .authorizeRequests().antMatchers(unsecuredResources).permitAll().anyRequest().authenticated().and() - // configure parameters for simple form login (and logout) - .formLogin().successHandler(new SimpleUrlAuthenticationSuccessHandler()).defaultSuccessUrl("/") - .failureUrl("/login.html?error").loginProcessingUrl("/j_spring_security_login").usernameParameter("username") - .passwordParameter("password").and() - // logout via POST is possible - .logout().logoutSuccessUrl("/login.html").and() - // register login and logout filter that handles rest logins - .addFilterAfter(getSimpleRestAuthenticationFilter(), BasicAuthenticationFilter.class) - .addFilterAfter(getSimpleRestLogoutFilter(), LogoutFilter.class); - } - - /** - * Create a simple filter that allows logout on a REST Url /services/rest/logout and returns a simple HTTP status 200 - * ok. - * - * @return the filter. - */ - protected Filter getSimpleRestLogoutFilter() { - - LogoutFilter logoutFilter = new LogoutFilter(new LogoutSuccessHandlerReturningOkHttpStatusCode(), - new SecurityContextLogoutHandler()); - - // configure logout for rest logouts - logoutFilter.setLogoutRequestMatcher(new AntPathRequestMatcher("/services/rest/logout")); - - return logoutFilter; - } - - /** - * Create a simple authentication filter for REST logins that reads user-credentials from a json-parameter and returns - * status 200 instead of redirect after login. - * - * @return the {@link JsonUsernamePasswordAuthenticationFilter}. - * @throws Exception if something goes wrong. - */ - protected JsonUsernamePasswordAuthenticationFilter getSimpleRestAuthenticationFilter() throws Exception { - - JsonUsernamePasswordAuthenticationFilter jsonFilter = new JsonUsernamePasswordAuthenticationFilter( - new AntPathRequestMatcher("/services/rest/login")); - jsonFilter.setPasswordParameter("j_password"); - jsonFilter.setUsernameParameter("j_username"); - jsonFilter.setAuthenticationManager(authenticationManager()); - // set failurehandler that uses no redirect in case of login failure; just HTTP-status: 401 - jsonFilter.setAuthenticationManager(authenticationManagerBean()); - jsonFilter.setAuthenticationFailureHandler(new SimpleUrlAuthenticationFailureHandler()); - // set successhandler that uses no redirect in case of login success; just HTTP-status: 200 - jsonFilter.setAuthenticationSuccessHandler(new AuthenticationSuccessHandlerSendingOkHttpStatusCode()); - return jsonFilter; - } - - @SuppressWarnings("javadoc") - @Inject - public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { - auth.inMemoryAuthentication().withUser("admin").password(this.passwordEncoder.encode("admin")).authorities("Admin"); - } - -} diff --git a/devon4j-http-rest-client/files/TestRestService.java b/devon4j-http-rest-client/files/TestRestService.java deleted file mode 100644 index 99cdc05c2..000000000 --- a/devon4j-http-rest-client/files/TestRestService.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.example.application.httprestclient.general.service.api.rest; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -@Path("/testrest/v1") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public interface TestRestService { - - @GET - @Path("/response/") - public String showResponse(); - - @GET - @Path("/verify/") - public String verifyServiceWork(); -} diff --git a/devon4j-http-rest-client/files/TestRestServiceImpl.java b/devon4j-http-rest-client/files/TestRestServiceImpl.java deleted file mode 100644 index b8b9e1421..000000000 --- a/devon4j-http-rest-client/files/TestRestServiceImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.example.application.httprestclient.general.service.impl.rest; - -import javax.inject.Inject; -import javax.inject.Named; - -import com.devonfw.module.service.common.api.client.ServiceClientFactory; -import com.devonfw.module.service.common.api.client.config.ServiceClientConfigBuilder; -import com.example.application.httprestclient.general.service.api.rest.TestRestService; -import com.example.application.httprestclient.general.service.api.rest.VisitormanagementRestService; - -@Named("TestRestService") -public class TestRestServiceImpl implements TestRestService { - - @Inject - private ServiceClientFactory serviceClientFactory; - - @Override - public String showResponse() { - - String result = callSynchronous(); - System.out.println("**********inside client method***********"); - System.out.println(result); - System.out.println("************Thank you for choosing devon4j ****************"); - return result; - - } - - private String callSynchronous() { - - System.out.println("***********inside synchronous call************"); - VisitormanagementRestService visitormanagementRestService = this.serviceClientFactory.create( - VisitormanagementRestService.class, - new ServiceClientConfigBuilder().authBasic().userLogin("admin").userPassword("admin").buildMap()); - // call of service over the wire, synchronously blocking until result is received or error occurred - String resultFromAPICall = visitormanagementRestService.returnResponseToClient(); - System.out.println("************************got result from api" + resultFromAPICall + "***************"); - return resultFromAPICall; - } - - @Override - public String verifyServiceWork() { - - return "Verified... service is working"; - } - -} diff --git a/devon4j-http-rest-client/files/VisitorManagementRestServiceClient.txt b/devon4j-http-rest-client/files/VisitorManagementRestServiceClient.txt deleted file mode 100644 index abd4f05cc..000000000 --- a/devon4j-http-rest-client/files/VisitorManagementRestServiceClient.txt +++ /dev/null @@ -1,20 +0,0 @@ -package com.example.application.httprestclient.general.service.api.rest; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -@Path("/visitormanagement/v1") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public interface VisitormanagementRestService { - - @GET - @Path("/clientrequest/") - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - public String returnResponseToClient(); - -} \ No newline at end of file diff --git a/devon4j-http-rest-client/files/VisitormanagementRestService.java b/devon4j-http-rest-client/files/VisitormanagementRestService.java deleted file mode 100644 index f61768500..000000000 --- a/devon4j-http-rest-client/files/VisitormanagementRestService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.example.application.httprestserver.visitormanagement.service.api.rest; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -@Path("/visitormanagement/v1") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public interface VisitormanagementRestService { - - @GET - @Path("/clientrequest/") - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - public String returnResponseToClient(); - -} \ No newline at end of file diff --git a/devon4j-http-rest-client/files/VisitormanagementRestServiceImpl.java b/devon4j-http-rest-client/files/VisitormanagementRestServiceImpl.java deleted file mode 100644 index 31c78ce85..000000000 --- a/devon4j-http-rest-client/files/VisitormanagementRestServiceImpl.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.example.application.httprestserver.visitormanagement.service.impl.rest; - -import javax.inject.Named; - -import com.example.application.httprestserver.visitormanagement.service.api.rest.VisitormanagementRestService; - -@Named("VisitormanagementRestService") -public class VisitormanagementRestServiceImpl implements VisitormanagementRestService { - - @Override - public String returnResponseToClient() { - - return "Welcome to REST API world"; - } - -} diff --git a/devon4j-http-rest-client/files/client_application.txt b/devon4j-http-rest-client/files/client_application.txt deleted file mode 100644 index ce01be013..000000000 --- a/devon4j-http-rest-client/files/client_application.txt +++ /dev/null @@ -1,44 +0,0 @@ -# This is the configuration file shipped with the application that contains reasonable defaults. -# Environment specific configurations are configured in config/application.properties. -# If you are running in a servlet container you may add this to lib/config/application.properties in case you do not -# want to touch the WAR file. - -server.port=8080 -spring.application.name=httprestclient -server.servlet.context-path=/httprestclient - -security.expose.error.details=false - -spring.jpa.hibernate.ddl-auto=validate - -# Datasource for accessing the database -# https://github.com/spring-projects/spring-boot/blob/d3c34ee3d1bfd3db4a98678c524e145ef9bca51c/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DatabaseDriver.java -spring.jpa.database=h2 -# spring.jpa.database-platform=org.hibernate.dialect.H2Dialect -# spring.datasource.driver-class-name=org.h2.Driver -spring.datasource.username=sa - -# Hibernate NamingStrategy has been deprecated and then removed in favor of two step naming strategy ImplicitNamingStrategy and PhysicalNamingStrategy -spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl -spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl - -# https://github.com/devonfw/devon4j/issues/65 -# https://vladmihalcea.com/the-open-session-in-view-anti-pattern/ -spring.jpa.open-in-view=false - -# to prevent that Spring Boot launches batch jobs on startup -# might otherwise lead to errors if job parameters are needed (or lead to unwanted modifications and longer startup times) -# see http://stackoverflow.com/questions/22318907/how-to-stop-spring-batch-scheduled-jobs-from-running-at-first-time-when-executin -spring.batch.job.enabled=false - -# Flyway for Database Setup and Migrations -spring.flyway.locations=classpath:db/migration - -# rest client setup -service.client.default.url=https://[[HOST_SUBDOMAIN]]-8081-[[KATACODA_HOST]].environments.katacoda.com/httprestserver/services/rest -service.client.app.httprestserver.url=https://[[HOST_SUBDOMAIN]]-8081-[[KATACODA_HOST]].environments.katacoda.com/httprestserver/services/rest -service.client.default.timeout.connection=120 -service.client.default.timeout.response=3600 -service.client.app.httprestserver.auth=basic -service.client.app.httprestserver.user.login=admin -service.client.app.httprestserver.user.password=admin \ No newline at end of file diff --git a/devon4j-http-rest-client/files/client_config_application.txt b/devon4j-http-rest-client/files/client_config_application.txt deleted file mode 100644 index 46c5aaee5..000000000 --- a/devon4j-http-rest-client/files/client_config_application.txt +++ /dev/null @@ -1,36 +0,0 @@ -# This is the spring boot configuration file for development. It will not be included into the application. -# In order to set specific configurations in a regular installed environment create an according file -# config/application.properties in the server. If you are deploying the application to a servlet container as untouched -# WAR file you can locate this config folder in ${symbol_dollar}{CATALINA_BASE}/lib. If you want to deploy multiple applications to -# the same container (not recommended by default) you need to ensure the WARs are extracted in webapps folder and locate -# the config folder inside the WEB-INF/classes folder of the webapplication. - -server.port=8080 -server.servlet.context-path=/httprestclient - -# Datasource for accessing the database -# See https://github.com/devonfw/devon4j/blob/develop/documentation/guide-configuration.asciidoc#security-configuration -#jasypt.encryptor.password=none -#spring.datasource.password=ENC(7CnHiadYc0Wh2FnWADNjJg==) -spring.datasource.password= -spring.datasource.url=jdbc:h2:./.httprestclient; - -# print SQL to console for debugging (e.g. detect N+1 issues) -spring.jpa.show-sql=true -spring.jpa.properties.hibernate.format_sql=true - -# Enable JSON pretty printing -spring.jackson.serialization.INDENT_OUTPUT=true - -# Flyway for Database Setup and Migrations -spring.flyway.enabled=true -spring.flyway.clean-on-validation-error=true - -# rest client setup -service.client.default.url=https://[[HOST_SUBDOMAIN]]-8081-[[KATACODA_HOST]].environments.katacoda.com/httprestserver/services/rest -service.client.app.httprestserver.url=https://[[HOST_SUBDOMAIN]]-8081-[[KATACODA_HOST]].environments.katacoda.com/httprestserver/services/rest -service.client.default.timeout.connection=120 -service.client.default.timeout.response=3600 -service.client.app.httprestserver.auth=basic -service.client.app.httprestserver.user.login=admin -service.client.app.httprestserver.user.password=admin diff --git a/devon4j-http-rest-client/files/dependency.txt b/devon4j-http-rest-client/files/dependency.txt deleted file mode 100644 index 1f6843baf..000000000 --- a/devon4j-http-rest-client/files/dependency.txt +++ /dev/null @@ -1,5 +0,0 @@ - - - com.devonfw.java.starters - devon4j-starter-cxf-client-rest - diff --git a/devon4j-http-rest-client/files/server_application.txt b/devon4j-http-rest-client/files/server_application.txt deleted file mode 100644 index 59fea029c..000000000 --- a/devon4j-http-rest-client/files/server_application.txt +++ /dev/null @@ -1,36 +0,0 @@ -# This is the configuration file shipped with the application that contains reasonable defaults. -# Environment specific configurations are configured in config/application.properties. -# If you are running in a servlet container you may add this to lib/config/application.properties in case you do not -# want to touch the WAR file. - -server.port=8081 -server.servlet.context-path=/httprestserver -spring.application.name=httprestserver - -security.expose.error.details=false - -spring.jpa.hibernate.ddl-auto=validate - -# Datasource for accessing the database -# https://github.com/spring-projects/spring-boot/blob/d3c34ee3d1bfd3db4a98678c524e145ef9bca51c/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DatabaseDriver.java -spring.jpa.database=h2 -# spring.jpa.database-platform=org.hibernate.dialect.H2Dialect -# spring.datasource.driver-class-name=org.h2.Driver -spring.datasource.username=sa - -# Hibernate NamingStrategy has been deprecated and then removed in favor of two step naming strategy ImplicitNamingStrategy and PhysicalNamingStrategy -spring.jpa.hibernate.naming.implicit-strategy=org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl -spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl - -# https://github.com/devonfw/devon4j/issues/65 -# https://vladmihalcea.com/the-open-session-in-view-anti-pattern/ -spring.jpa.open-in-view=false - -# to prevent that Spring Boot launches batch jobs on startup -# might otherwise lead to errors if job parameters are needed (or lead to unwanted modifications and longer startup times) -# see http://stackoverflow.com/questions/22318907/how-to-stop-spring-batch-scheduled-jobs-from-running-at-first-time-when-executin -spring.batch.job.enabled=false - -# Flyway for Database Setup and Migrations -spring.flyway.locations=classpath:db/migration - diff --git a/devon4j-http-rest-client/files/server_config_application.txt b/devon4j-http-rest-client/files/server_config_application.txt deleted file mode 100644 index 3a893a4b1..000000000 --- a/devon4j-http-rest-client/files/server_config_application.txt +++ /dev/null @@ -1,27 +0,0 @@ -# This is the spring boot configuration file for development. It will not be included into the application. -# In order to set specific configurations in a regular installed environment create an according file -# config/application.properties in the server. If you are deploying the application to a servlet container as untouched -# WAR file you can locate this config folder in ${symbol_dollar}{CATALINA_BASE}/lib. If you want to deploy multiple applications to -# the same container (not recommended by default) you need to ensure the WARs are extracted in webapps folder and locate -# the config folder inside the WEB-INF/classes folder of the webapplication. - -server.port=8081 -server.servlet.context-path=/httprestserver - -# Datasource for accessing the database -# See https://github.com/devonfw/devon4j/blob/develop/documentation/guide-configuration.asciidoc#security-configuration -#jasypt.encryptor.password=none -#spring.datasource.password=ENC(7CnHiadYc0Wh2FnWADNjJg==) -spring.datasource.password= -spring.datasource.url=jdbc:h2:./.httprestserver; - -# print SQL to console for debugging (e.g. detect N+1 issues) -spring.jpa.show-sql=true -spring.jpa.properties.hibernate.format_sql=true - -# Enable JSON pretty printing -spring.jackson.serialization.INDENT_OUTPUT=true - -# Flyway for Database Setup and Migrations -spring.flyway.enabled=true -spring.flyway.clean-on-validation-error=true diff --git a/devon4j-http-rest-client/index.asciidoc b/devon4j-http-rest-client/index.asciidoc deleted file mode 100644 index eb1081a9c..000000000 --- a/devon4j-http-rest-client/index.asciidoc +++ /dev/null @@ -1,221 +0,0 @@ -= Develop a devon4j CXF REST Client using Synchronous call -==== -REST (REpresentational State Transfer) is an inter-operable protocol for services that is more lightweight than SOAP. We give best practices that lead to simple, easy and pragmatic "HTTP APIs". - -## Prerequisites -* User should have development experience in JAVA. -* Basic knowledge of REST. - -## Learning Goal -Here in this tutorial you will learn the following things: -* JAX-RS standard for REST service implementation proposed by devonfw. -* How to create REST client with devon4j using Synchronous call. - -Let's get started!! -==== - -[step] --- -restoreDevonfwIde(["java", "vscode"]) --- - -==== -REST (REpresentational State Transfer) is an inter-operable protocol for services that is more lightweight than SOAP. - -For implementing REST services we use the JAX-RS standard. As an implementation we recommend CXF. For JSON bindings we use Jackson while XML binding works out-of-the-box with JAXB. To implement a service you write an interface with JAX-RS annotations for the API and a regular implementation class annotated with @Named to make it a spring-bean. - -The REST service implementation is a regular CDI bean that can use dependency injection. The separation of the API as a Java interface allows to use it for service client calls. - -**Why** **Should** **you** **prefer** **devon4j** **client** **over** **other** **clients?** - -devon4j supports flexible configuration, adding headers for authentication, mapping of errors from server, logging success/errors with duration for performance analysis, support for synchronous and asynchronous invocations. Easy invocation of service inside a micro-service. -For more details on REST visit https://devonfw.com/website/pages/docs/devon4j.asciidoc_guides.html#guide-rest.asciidoc - -For more details on devon4j Service Client https://devonfw.com/website/pages/docs/devon4j.asciidoc_guides.html#guide-service-client.asciidoc - -## Create the devon4j REST SERVER -As explained in REST document, With JAX-RS it is important to make sure that each service method is annotated with the proper HTTP annotation(@GET, @POST, etc). -Let's create devon4j server. -[step] -== REST --- -createDevon4jProject("com.example.application.httprestserver") --- -In next step, you will add configuration to allow basic authentication. -==== - - -Now, You have to modify BaseWebSecurityConfig file to allow application for basic authentication. -[step] -== Add configuration to allow basic authentication --- -changeFile("httprestserver/core/src/main/java/com/example/application/httprestserver/general/service/impl/config/BaseWebSecurityConfig.java", { "file": "files/BaseWebSecurityConfig.txt" }) --- - - -Now, you will create VisitormanagementRestService to provide functionality using JAX-RS standard. -[step] -== Create service for REST server --- -createFile("httprestserver/api/src/main/java/com/example/application/httprestserver/visitormanagement/service/api/rest/VisitormanagementRestService.java", "files/VisitormanagementRestService.java") --- - - -==== -Now, you will create VisitormanagementRestServiceImpl, the implementation class of VisitormanagementRestService using JAX-RS standard. -[step] -== Create implementation class for Service --- -createFile("httprestserver/core/src/main/java/com/example/application/httprestserver/visitormanagement/service/impl/rest/VisitormanagementRestServiceImpl.java", "files/VisitormanagementRestServiceImpl.java") --- -Here , you can see "VisitormanagementRestServiceImpl.java" is annotated with @Named to make it a spring-bean. To get return response to client "returnResponseToClient()" can be accessed via HTTP GET under the URL path "/visitormanagement/v1/clientrequest". It will return its result (String) as JSON (see @Produces in VisitormanagementRestService). -==== - - -Now, you will configure port in application properties. -[step] -== Modify properties files --- -changeFile("httprestserver/core/src/main/resources/application.properties", { "file": "files/server_application.txt" }) -changeFile("httprestserver/core/src/main/resources/config/application.properties", { "file": "files/server_config_application.txt" }) --- - - - -==== -You have successfully built the REST-server. Now, you have to start the build and then, start the server as mentioned below. -[step] -== Build and Start devon4j REST Server --- -buildJava("httprestserver", false) -runServerJava("httprestserver/server", { "startupTime": 1000, "port": 8081, "path": "httprestserver" }) --- -Once, Java server starts running. To test REST-server follow below steps: -* Click on "+" next to terminal tab -* Select "select port to view host" -* Enter the port number "8081" -* In the url, append "/httprestserver/services/rest/visitormanagement/v1/clientrequest/" -* Enter username as "admin" and password as "admin" -* You will be able to see response "Welcome to REST API world" -In next step, You have to create devon4j service Client. -==== - - -==== -To create devon4j service Client. First, You need to create a sample devon4j project. - -[step] -== Create devon4j REST Client --- -createDevon4jProject("com.example.application.httprestclient") --- -Then, You need to add required dependency to your application. - -Since in this tutorial you will build client on Synchronous call so, you have to add dependency for synchronous consuming REST services via Apache CXF (Java8+) -You will add below dependency in core folder pom.xml - ----- - - com.devonfw.java.starters - devon4j-starter-cxf-client-rest - - ----- -==== - -Modify pom.xml as below: -[step] -== Modify POM file --- -changeFile("httprestclient/core/pom.xml", { "file": "files/dependency.txt", "placeholder": "" }) --- - -Now, You will create a Java interface VisitormanagementRestService to invoke inside client. -[step] -== Create service to invoke server --- -createFile("httprestclient/api/src/main/java/com/example/application/httprestclient/general/service/api/rest/VisitormanagementRestService.java", "files/VisitorManagementRestServiceClient.txt") --- - - -Now, you will create service for client i.e. TestRestService.java to provide functionality using JAX-RS standard. -[step] -== Create service for CXF REST Client --- -createFile("httprestclient/api/src/main/java/com/example/application/httprestclient/general/service/api/rest/TestRestService.java", "files/TestRestService.java") --- - - -==== -Now, you will create TestRestServiceImpl, the implementation class of TestRestService using JAX-RS standard. - -[step] -== Create implementation class for client's service --- -createFile("httprestclient/core/src/main/java/com/example/application/httprestclient/general/service/impl/rest/TestRestServiceImpl.java", "files/TestRestServiceImpl.java") --- - -As you can see synchronous invocation of a service is very simple and type-safe. The actual call of showResponse will technically call the remote service(i.e. VisitormanagementRestService) over the wire ( via HTTP) including marshaling the arguments (converting String to JSON) and un-marshalling the result (e.g. converting the received JSON to String). -Here in TestRestServiceImpl, there is a method "callSynchronous" which will call the VisitormanagementRestService and return the object of VisitormanagementRestService to visitormanagementRestService. -With visitormanagementRestService, it is calling the method "returnResponseToClient()" of server. -The response from server will be stored in "resultFromAPICall" as the return type of result is String. -After getting response, you can handle the response further in your implementation. Here, you can see that response is getting handled in "showResponse" method. -==== - - -==== -An application needs to be configurable in order to allow internal setup but also to allow externalized configuration of a deployed package (e.g. integration into runtime environment). -Now, You need to modify the content of existing properties files and add configuration for Server. -[step] -== Modify properties for server configuration --- -changeFile("httprestclient/core/src/main/resources/application.properties", { "file": "files/client_application.txt" }) -changeFile("httprestclient/core/src/main/resources/config/application.properties", { "file": "files/client_config_application.txt" }) --- -## Service Discovery -**service.client.default.url** :- It is used to set the default url of server and it is added for service discovery. - -**service.client.app.httprestserver.url** :- This property provide base url of REST in your application. It follows format such as "service.client.app.«application».url". Here, «application» refers to the technical name of the application providing the service. - -## Timeouts -**service.client.default.timeout.connection** :- It is used to set the default timeout for particular connection. - -**service.client.default.timeout.response** :- It is used to set the default timeout for particular response. - -## Headers -**service.client.app.httprestserver.auth** :- It is used for customization of Service Header. Here it is used for basic authentication. - -## Authentication -**service.client.app.httprestserver.user.login** :- It is used to set username of server for authentication. - -**service.client.app.httprestserver.user.password** :- It is used to set password. -==== - -==== -Now, Let's build and start the service client application. -This might take some time for application to start. -[step] -== Build devon4j CXF REST Client --- -buildJava("httprestclient", false) --- - -* Once, application builds successfully. Open new terminal by clicking "+" and wait for it to load. -* Now, Copy and execute below command to navigate into client server. - `cd devonfw/workspaces/main/httprestclient/server` -* Now, Copy and execute below command to start the application. - `devon mvn spring-boot:run` - -To test Synchronous method, follow below steps. -* Click on "+" next to terminal tab -* Select "select port to view host" -* Enter the port number "8080" -* In the url, append "/httprestclient/services/rest/testrest/v1/response/" -* Enter username as "admin" and password as "admin" -* You will be able to see response "Welcome to REST API world" -==== - -==== -You have successfully created devon4j CXF REST Client. -For more details on devon4j follow https://devonfw.com/website/pages/docs/devon4j.asciidoc.html -==== \ No newline at end of file diff --git a/devon4j-migrate/index.asciidoc b/devon4j-migrate/index.asciidoc deleted file mode 100644 index d8ed8d1da..000000000 --- a/devon4j-migrate/index.asciidoc +++ /dev/null @@ -1,51 +0,0 @@ -= Migrate a devon4j project to the latest version -==== -This tutorial mainly focuses on migrating an older version of devon4j project to the latest version using devon4j migrate command. - - -## Prerequisites -* devonfw IDE - -## Learning goals. -Here in this tutorial you will learn -* How to migrate an older version of devon4j project to the latest version. -==== - -[step] --- -restoreDevonfwIde(["java","vscode"]) --- - - -[step] --- -restoreWorkspace({"workspace": "devon4j-migrate"}) --- - -==== -To demonstrate devon4j migrate you would need a sample devon4j project with any older version. Here, we have already created a project with an older version i.e. 2020.08.001 for you. - -It is already cloned in workspace. - -Execute below command for project migration from an older version to the latest version. -[step] -== Execute Migrate Command --- -executeCommand("devon java migrate", "devon java migrate", {"dir" : "devon4j-app-4tutorial"}) --- -You will see the message similar to the one below, if project migrated successfully. -`Successfully applied 4 migrations to migrate project from version devon4j:2020.08.001 to devon4j:2021.04.002.` - -Here, 2020.08.001 is the devon4j's older version and 2021.04.002 is devon4j's latest version. - -==== - - - -==== -## Conclusion -You have successfully migrated the sample project from an older version to the latest version using command line!! - -For more details on devon4j java commands for various functionalities and the arguments (devon java «args») follow -https://devonfw.com/website/pages/docs/devonfw-ide-usage.asciidoc.html#java.asciidoc -==== diff --git a/devon4ng-architecture/files/cloneProject.ps1 b/devon4ng-architecture/files/cloneProject.ps1 deleted file mode 100644 index ac0cb3e62..000000000 --- a/devon4ng-architecture/files/cloneProject.ps1 +++ /dev/null @@ -1,2 +0,0 @@ -cd devonfw/workspaces/main -git clone https://github.com/devonfw/devon4ng-application-template.git \ No newline at end of file diff --git a/devon4ng-architecture/files/cloneProject.sh b/devon4ng-architecture/files/cloneProject.sh deleted file mode 100644 index ac0cb3e62..000000000 --- a/devon4ng-architecture/files/cloneProject.sh +++ /dev/null @@ -1,2 +0,0 @@ -cd devonfw/workspaces/main -git clone https://github.com/devonfw/devon4ng-application-template.git \ No newline at end of file diff --git a/devon4ng-architecture/files/core-shared-modules.md b/devon4ng-architecture/files/core-shared-modules.md deleted file mode 100644 index 26713add7..000000000 --- a/devon4ng-architecture/files/core-shared-modules.md +++ /dev/null @@ -1 +0,0 @@ -In the `CoreModule`, you can see services like `TranslocoRootModule` (translation service), `HttpRequestInterceptorService` (HTTP interceptor sesrvice) and Angular Material related modules being part of this core module. This core module is then imported into every other module as the services are used throughout the application. diff --git a/devon4ng-architecture/files/core-shared-modules2.md b/devon4ng-architecture/files/core-shared-modules2.md deleted file mode 100644 index 2b283ea38..000000000 --- a/devon4ng-architecture/files/core-shared-modules2.md +++ /dev/null @@ -1,3 +0,0 @@ -In the `LayoutModule`, you can see components like `NavBar` and `Header` being part of this module. This module is comparable to a **shared** module which holds common components used throughout the application. The shared module is imported into other (feature) modules where the common components will be used. - -You can study in more detail about Angular architecture by following [this document](https://devonfw.com/website/pages/docs/master-devon4ng.asciidoc_architecture.html#meta-architecture.asciidoc_devonfw-reference-client-architecture). diff --git a/devon4ng-architecture/files/layers-explained.md b/devon4ng-architecture/files/layers-explained.md deleted file mode 100644 index 431bc5a40..000000000 --- a/devon4ng-architecture/files/layers-explained.md +++ /dev/null @@ -1,5 +0,0 @@ -The application you see here is a clone of devon4ng-application-template. You can find it [here](https://github.com/devonfw/devon4ng-application-template) - -The `SampleDataModule` is a nice example of the different layers explained. It holds some components (representing the *components* layer) and also has a `SampleDataService` (representing the *service* layer) which is imported in the required components. - -The service acts as the adapter element explained earlier (used to make XHR calls). \ No newline at end of file diff --git a/devon4ng-architecture/files/layers.md b/devon4ng-architecture/files/layers.md deleted file mode 100644 index 1bc71221b..000000000 --- a/devon4ng-architecture/files/layers.md +++ /dev/null @@ -1,7 +0,0 @@ -The architecture describes two layers: - -* [Components Layer](https://devonfw.com/website/pages/docs/master-devon4ng.asciidoc_layers.html#components-layer.asciidoc) encapsulates components which present the current application state. Components are separated into [Smart and Dumb Components](https://devonfw.com/website/pages/docs/master-devon4ng.asciidoc_layers.html#components-layer.asciidoc_smart-and-dumb-components). The only logic present is view logic inside Smart Components. - -* [Services Layer](https://devonfw.com/website/pages/docs/master-devon4ng.asciidoc_layers.html#services-layer.asciidoc) is more or less what we call 'business logic layer' on the server side. The layer defines the applications state, the transitions between state and classic business logic. Stores contain application state over time to which Smart Components subscribe to. Adapters are used to perform XHRs, WebSocket connections, etc. The business model is described inside the module. Use case services perform business logic needed for use cases. A use case services interacts with the store and adapters. Methods of use case services are the API for Smart Components. Those methods are Actions in reactive terminology. - -Let us refer the application to understand the above concepts. \ No newline at end of file diff --git a/devon4ng-architecture/files/modules.md b/devon4ng-architecture/files/modules.md deleted file mode 100644 index f78ca11ac..000000000 --- a/devon4ng-architecture/files/modules.md +++ /dev/null @@ -1,13 +0,0 @@ -Every Angular application requires a module called app which is the main entrance to an application at runtime - this module gets bootstrapped. Angular Styleguide defines feature modules and two special modules - core and shared. - -* A **feature** module is basically a vertical cut through both layers. - -* The **shared** module consists of components shared across feature modules. - -* The **core** module holds services shared across modules. - -So core module is a module only having a services layer and shared module is a module only having a components layer. - -The `SampleDataModule` which we visitied earlier is a typical example of a **feature** module - -Let us refer the application again for examples on **core** module and **shared** module. \ No newline at end of file diff --git a/devon4ng-architecture/files/overview.md b/devon4ng-architecture/files/overview.md deleted file mode 100644 index c712c8152..000000000 --- a/devon4ng-architecture/files/overview.md +++ /dev/null @@ -1,10 +0,0 @@ -An Angular application is component based like [devon4j](https://github.com/devonfw/devon4j), but different terminology is used as compared to devon4j. Primarily the term used is **module** instead of **component**. -To clarify this: - -* A **component** describes an UI element containing HTML, CSS and JavaScript - structure, design and logic encapsulated inside a reusable container called component. - -* A **module** describes an applications feature area. The application flight-app may have a module called booking. - -An application developed using Angular consists of multiple modules. There are feature modules and special modules - *core* and *shared*. Angular or Angular Styleguide give no guidance on how to structure a module internally. This is where this architecture comes in. - -We will refer a devon4ng application for better understanding. But before that, let us understand the Architectural Layers of a devon4ng application. \ No newline at end of file diff --git a/devon4ng-architecture/images/architecture-layers.png b/devon4ng-architecture/images/architecture-layers.png deleted file mode 100644 index 0073beb6a..000000000 Binary files a/devon4ng-architecture/images/architecture-layers.png and /dev/null differ diff --git a/devon4ng-architecture/images/architecture-modules.png b/devon4ng-architecture/images/architecture-modules.png deleted file mode 100644 index 5ad5d343c..000000000 Binary files a/devon4ng-architecture/images/architecture-modules.png and /dev/null differ diff --git a/devon4ng-architecture/index.asciidoc b/devon4ng-architecture/index.asciidoc deleted file mode 100644 index dc532cc8e..000000000 --- a/devon4ng-architecture/index.asciidoc +++ /dev/null @@ -1,73 +0,0 @@ -= devon4ng architecture -== Understand the architecture principles followed by devon4ng (the angular asset of devonfw) -==== -## Prerequisites - -Basic Angular knowledge - -## Learning goals - -This tutorial aims to explain concepts and principles of devon4ng architecture by refering an Angular application template. Below are the steps we will go through to understand it clearly. - -* Understand Angular architectural terminology (components and modules) -* Different layers of an Angular application -* Different types of modules - feature, core, shared - -You will be refering a devon4ng application while going through the theoretical aspects of the tutorial. - -By end of this tutorial you will have detailed understanding of principles followed by devon4ng application as well as its structure and architecture. - -==== - -[step] --- -restoreDevonfwIde(["npm", "ng", "vscode"]) -addSetupScript("files/cloneProject.sh", "files/cloneProject.ps1") --- - -[step] --- -displayContent("Overview", [{ "file": "files/overview.md" }]) --- - -[step] --- -displayContent("Architectural Layers", [{ "image": "images/architecture-layers.png" }, { "file": "files/layers.md" }]) --- - -[step] --- -openFile("devon4ng-application-template/src/app/sampledata/sampledata.module.ts") -displayContent("Architectural Layers explained", [{ "file": "files/layers-explained.md" }]) -openFile("devon4ng-application-template/src/app/sampledata/services/sampledata.service.ts") --- - -[step] --- -displayContent("Modules", [{ "image": "images/architecture-modules.png" }, { "file": "files/modules.md" }]) --- - -[step] --- -displayContent("Core module", [{ "file": "files/core-shared-modules.md" }]) -openFile("devon4ng-application-template/src/app/core/core.module.ts") --- - -[step] --- -displayContent("Shared module", [{ "file": "files/core-shared-modules2.md" }]) -openFile("devon4ng-application-template/src/app/layout/layout.module.ts") --- - -==== -Conclusion - -To conclude, in this tutorial you learned -* the concepts of modules and components -* the layers of the architecture - components and services -* the different types of modules - core, shared and feature - -Then we referred a devon4ng application by cloning it and traversing through its files. You can study in more detail about Angular architecture by following [this document](https://devonfw.com/website/pages/docs/master-devon4ng.asciidoc_architecture.html#meta-architecture.asciidoc_devonfw-reference-client-architecture). - -The idea with devon4ng is to define an architecture which is a compromise between, on the one hand, leveraging the best practices and latest trends like reactive style development, on the other hand, providing a short onboarding time while still using an architecture that helps us scale and be productive at the same time. -==== \ No newline at end of file diff --git a/devon4ng-lazy-loading/files/app-routing.module.ts.txt b/devon4ng-lazy-loading/files/app-routing.module.ts.txt deleted file mode 100644 index ca1b26d6f..000000000 --- a/devon4ng-lazy-loading/files/app-routing.module.ts.txt +++ /dev/null @@ -1,21 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; -import { FirstComponent } from './first/first/first.component'; - -const routes: Routes = [ - { - path: 'first', - component: FirstComponent - }, - { - path: '', - redirectTo: 'first', - pathMatch: 'full', - }, -]; - -@NgModule({ - imports: [RouterModule.forRoot(routes)], - exports: [RouterModule] -}) -export class AppRoutingModule { } diff --git a/devon4ng-lazy-loading/files/app-routing.module.update2.ts.txt b/devon4ng-lazy-loading/files/app-routing.module.update2.ts.txt deleted file mode 100644 index 66b1993f2..000000000 --- a/devon4ng-lazy-loading/files/app-routing.module.update2.ts.txt +++ /dev/null @@ -1,20 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; - -const routes: Routes = [ - { - path: 'first', - loadChildren: () => import('./first/first.module').then(m => m.FirstModule), - }, - { - path: '', - redirectTo: 'first', - pathMatch: 'full', - }, -]; - -@NgModule({ - imports: [RouterModule.forRoot(routes)], - exports: [RouterModule] -}) -export class AppRoutingModule { } diff --git a/devon4ng-lazy-loading/files/app.component.html.txt b/devon4ng-lazy-loading/files/app.component.html.txt deleted file mode 100644 index 90c6b6463..000000000 --- a/devon4ng-lazy-loading/files/app.component.html.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/devon4ng-lazy-loading/files/app.module.ts.txt b/devon4ng-lazy-loading/files/app.module.ts.txt deleted file mode 100644 index ec57d1d3b..000000000 --- a/devon4ng-lazy-loading/files/app.module.ts.txt +++ /dev/null @@ -1,20 +0,0 @@ -import { BrowserModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; - -import { AppRoutingModule } from './app-routing.module'; -import { AppComponent } from './app.component'; -import { FirstModule } from './first/first.module'; - -@NgModule({ - declarations: [ - AppComponent - ], - imports: [ - BrowserModule, - AppRoutingModule, - FirstModule - ], - providers: [], - bootstrap: [AppComponent] -}) -export class AppModule { } diff --git a/devon4ng-lazy-loading/files/app.module.ts.update2.txt b/devon4ng-lazy-loading/files/app.module.ts.update2.txt deleted file mode 100644 index d718d9ba2..000000000 --- a/devon4ng-lazy-loading/files/app.module.ts.update2.txt +++ /dev/null @@ -1,18 +0,0 @@ -import { BrowserModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; - -import { AppRoutingModule } from './app-routing.module'; -import { AppComponent } from './app.component'; - -@NgModule({ - declarations: [ - AppComponent - ], - imports: [ - BrowserModule, - AppRoutingModule, - ], - providers: [], - bootstrap: [AppComponent] -}) -export class AppModule { } diff --git a/devon4ng-lazy-loading/files/content-right.component.html.txt b/devon4ng-lazy-loading/files/content-right.component.html.txt deleted file mode 100644 index 0d2605158..000000000 --- a/devon4ng-lazy-loading/files/content-right.component.html.txt +++ /dev/null @@ -1,11 +0,0 @@ -
-

Welcome to 2nd level module (right)

- Angular Logo -
-
- -
diff --git a/devon4ng-lazy-loading/files/content.component.html.txt b/devon4ng-lazy-loading/files/content.component.html.txt deleted file mode 100644 index c32b105f0..000000000 --- a/devon4ng-lazy-loading/files/content.component.html.txt +++ /dev/null @@ -1,13 +0,0 @@ -
-

- Welcome to 2nd level module (left) -

- Angular Logo -
-
- -
\ No newline at end of file diff --git a/devon4ng-lazy-loading/files/content.component.ts.txt b/devon4ng-lazy-loading/files/content.component.ts.txt deleted file mode 100644 index bafad404f..000000000 --- a/devon4ng-lazy-loading/files/content.component.ts.txt +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-content', - templateUrl: './content.component.html', - styleUrls: ['./content.component.scss'] -}) -export class ContentComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { - } - -} diff --git a/devon4ng-lazy-loading/files/empty-file.txt b/devon4ng-lazy-loading/files/empty-file.txt deleted file mode 100644 index 0519ecba6..000000000 --- a/devon4ng-lazy-loading/files/empty-file.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/devon4ng-lazy-loading/files/first-routing.module.ts.txt b/devon4ng-lazy-loading/files/first-routing.module.ts.txt deleted file mode 100644 index 267407558..000000000 --- a/devon4ng-lazy-loading/files/first-routing.module.ts.txt +++ /dev/null @@ -1,10 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; - -const routes: Routes = []; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class FirstRoutingModule { } diff --git a/devon4ng-lazy-loading/files/first-routing.module.update1.ts.txt b/devon4ng-lazy-loading/files/first-routing.module.update1.ts.txt deleted file mode 100644 index ebaa1e461..000000000 --- a/devon4ng-lazy-loading/files/first-routing.module.update1.ts.txt +++ /dev/null @@ -1,26 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; -import { ContentComponent as ContentLeft} from './second-left/content/content.component'; -import { ContentComponent as ContentRight} from './second-right/content/content.component'; -import { FirstComponent } from './first/first.component'; - -const routes: Routes = [ - { - path: '', - component: FirstComponent - }, - { - path: 'first/second-left', - component: ContentLeft - }, - { - path: 'first/second-right', - component: ContentRight - } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class FirstRoutingModule { } diff --git a/devon4ng-lazy-loading/files/first-routing.module.update2.ts.txt b/devon4ng-lazy-loading/files/first-routing.module.update2.ts.txt deleted file mode 100644 index cb4a17c8a..000000000 --- a/devon4ng-lazy-loading/files/first-routing.module.update2.ts.txt +++ /dev/null @@ -1,26 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; -import { ContentComponent as ContentLeft} from './second-left/content/content.component'; -import { ContentComponent as ContentRight} from './second-right/content/content.component'; -import { FirstComponent } from './first/first.component'; - -const routes: Routes = [ - { - path: '', - component: FirstComponent - }, - { - path: 'second-left', - component: ContentLeft - }, - { - path: 'second-right', - component: ContentRight - } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class FirstRoutingModule { } diff --git a/devon4ng-lazy-loading/files/first-routing.module.update3.ts.txt b/devon4ng-lazy-loading/files/first-routing.module.update3.ts.txt deleted file mode 100644 index b73fc0da6..000000000 --- a/devon4ng-lazy-loading/files/first-routing.module.update3.ts.txt +++ /dev/null @@ -1,26 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; -import { ContentComponent as ContentLeft} from './second-left/content/content.component'; -import { ContentComponent as ContentRight} from './second-right/content/content.component'; -import { FirstComponent } from './first/first.component'; - -const routes: Routes = [ - { - path: '', - component: FirstComponent - }, - { - path: 'second-left', - loadChildren: () => import('./second-left/second-left.module').then(m => m.SecondLeftModule), - }, - { - path: 'second-right', - component: ContentRight - } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class FirstRoutingModule { } diff --git a/devon4ng-lazy-loading/files/first.component.html.txt b/devon4ng-lazy-loading/files/first.component.html.txt deleted file mode 100644 index 94ff7ada2..000000000 --- a/devon4ng-lazy-loading/files/first.component.html.txt +++ /dev/null @@ -1,14 +0,0 @@ -
-

- Welcome to 1st level module -

- Angular Logo -
-
- - -
\ No newline at end of file diff --git a/devon4ng-lazy-loading/files/first.component.ts.txt b/devon4ng-lazy-loading/files/first.component.ts.txt deleted file mode 100644 index 1d152df8d..000000000 --- a/devon4ng-lazy-loading/files/first.component.ts.txt +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-first', - templateUrl: './first.component.html', - styleUrls: ['./first.component.scss'] -}) -export class FirstComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { - } - -} diff --git a/devon4ng-lazy-loading/files/first.module.ts.txt b/devon4ng-lazy-loading/files/first.module.ts.txt deleted file mode 100644 index c33df7b0a..000000000 --- a/devon4ng-lazy-loading/files/first.module.ts.txt +++ /dev/null @@ -1,14 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; - -import { FirstRoutingModule } from './first-routing.module'; - - -@NgModule({ - declarations: [], - imports: [ - CommonModule, - FirstRoutingModule - ] -}) -export class FirstModule { } diff --git a/devon4ng-lazy-loading/files/first.module.ts.update1.ts.txt b/devon4ng-lazy-loading/files/first.module.ts.update1.ts.txt deleted file mode 100644 index 9f72da94b..000000000 --- a/devon4ng-lazy-loading/files/first.module.ts.update1.ts.txt +++ /dev/null @@ -1,19 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; - -import { FirstRoutingModule } from './first-routing.module'; -import { FirstComponent } from './first/first.component'; - -import { SecondLeftModule } from './second-left/second-left.module'; -import { SecondRightModule } from './second-right/second-right.module'; - -@NgModule({ - declarations: [FirstComponent], - imports: [ - CommonModule, - FirstRoutingModule, - SecondLeftModule, - SecondRightModule, - ] -}) -export class FirstModule { } diff --git a/devon4ng-lazy-loading/files/first.module.update3.ts.txt b/devon4ng-lazy-loading/files/first.module.update3.ts.txt deleted file mode 100644 index e1c763053..000000000 --- a/devon4ng-lazy-loading/files/first.module.update3.ts.txt +++ /dev/null @@ -1,17 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; - -import { FirstRoutingModule } from './first-routing.module'; -import { FirstComponent } from './first/first.component'; - -import { SecondRightModule } from './second-right/second-right.module'; - -@NgModule({ - declarations: [FirstComponent], - imports: [ - CommonModule, - FirstRoutingModule, - SecondRightModule, - ] -}) -export class FirstModule { } diff --git a/devon4ng-lazy-loading/files/second-left-routing.module.ts.txt b/devon4ng-lazy-loading/files/second-left-routing.module.ts.txt deleted file mode 100644 index 3b8fac1e1..000000000 --- a/devon4ng-lazy-loading/files/second-left-routing.module.ts.txt +++ /dev/null @@ -1,10 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; - -const routes: Routes = []; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class SecondLeftRoutingModule { } diff --git a/devon4ng-lazy-loading/files/second-left-routing.module.update3.ts.txt b/devon4ng-lazy-loading/files/second-left-routing.module.update3.ts.txt deleted file mode 100644 index 8b704a899..000000000 --- a/devon4ng-lazy-loading/files/second-left-routing.module.update3.ts.txt +++ /dev/null @@ -1,16 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; -import { ContentComponent } from './content/content.component'; - -const routes: Routes = [ - { - path: '', - component: ContentComponent - } -]; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class SecondLeftRoutingModule { } diff --git a/devon4ng-lazy-loading/files/second-left.module.ts.txt b/devon4ng-lazy-loading/files/second-left.module.ts.txt deleted file mode 100644 index 0eb395b69..000000000 --- a/devon4ng-lazy-loading/files/second-left.module.ts.txt +++ /dev/null @@ -1,15 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; - -import { SecondLeftRoutingModule } from './second-left-routing.module'; -import { ContentComponent } from './content/content.component'; - - -@NgModule({ - declarations: [ContentComponent], - imports: [ - CommonModule, - SecondLeftRoutingModule - ] -}) -export class SecondLeftModule { } diff --git a/devon4ng-lazy-loading/files/second-right-routing.module.ts.txt b/devon4ng-lazy-loading/files/second-right-routing.module.ts.txt deleted file mode 100644 index 20c8b6228..000000000 --- a/devon4ng-lazy-loading/files/second-right-routing.module.ts.txt +++ /dev/null @@ -1,10 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; - -const routes: Routes = []; - -@NgModule({ - imports: [RouterModule.forChild(routes)], - exports: [RouterModule] -}) -export class SecondRightRoutingModule { } diff --git a/devon4ng-lazy-loading/files/second-right.module.ts.txt b/devon4ng-lazy-loading/files/second-right.module.ts.txt deleted file mode 100644 index 8ab855b68..000000000 --- a/devon4ng-lazy-loading/files/second-right.module.ts.txt +++ /dev/null @@ -1,15 +0,0 @@ -import { NgModule } from '@angular/core'; -import { CommonModule } from '@angular/common'; - -import { SecondRightRoutingModule } from './second-right-routing.module'; -import { ContentComponent } from './content/content.component'; - - -@NgModule({ - declarations: [ContentComponent], - imports: [ - CommonModule, - SecondRightRoutingModule - ] -}) -export class SecondRightModule { } diff --git a/devon4ng-lazy-loading/images/compile-eager.png b/devon4ng-lazy-loading/images/compile-eager.png deleted file mode 100644 index ffce0d19d..000000000 Binary files a/devon4ng-lazy-loading/images/compile-eager.png and /dev/null differ diff --git a/devon4ng-lazy-loading/images/compile-first-lazy.png b/devon4ng-lazy-loading/images/compile-first-lazy.png deleted file mode 100644 index 8bd56e5d3..000000000 Binary files a/devon4ng-lazy-loading/images/compile-first-lazy.png and /dev/null differ diff --git a/devon4ng-lazy-loading/images/first-lvl-lazy.png b/devon4ng-lazy-loading/images/first-lvl-lazy.png deleted file mode 100644 index 7f89915db..000000000 Binary files a/devon4ng-lazy-loading/images/first-lvl-lazy.png and /dev/null differ diff --git a/devon4ng-lazy-loading/images/levels-app.png b/devon4ng-lazy-loading/images/levels-app.png deleted file mode 100644 index 0a147442d..000000000 Binary files a/devon4ng-lazy-loading/images/levels-app.png and /dev/null differ diff --git a/devon4ng-lazy-loading/images/second-lvl-lazy.png b/devon4ng-lazy-loading/images/second-lvl-lazy.png deleted file mode 100644 index 0afe2f5a6..000000000 Binary files a/devon4ng-lazy-loading/images/second-lvl-lazy.png and /dev/null differ diff --git a/devon4ng-lazy-loading/images/second-lvl-left-lazy.png b/devon4ng-lazy-loading/images/second-lvl-left-lazy.png deleted file mode 100644 index b2005351b..000000000 Binary files a/devon4ng-lazy-loading/images/second-lvl-left-lazy.png and /dev/null differ diff --git a/devon4ng-lazy-loading/images/second-lvl-right-eager.png b/devon4ng-lazy-loading/images/second-lvl-right-eager.png deleted file mode 100644 index c55c77e20..000000000 Binary files a/devon4ng-lazy-loading/images/second-lvl-right-eager.png and /dev/null differ diff --git a/devon4ng-lazy-loading/index.asciidoc b/devon4ng-lazy-loading/index.asciidoc deleted file mode 100644 index dce888b6f..000000000 --- a/devon4ng-lazy-loading/index.asciidoc +++ /dev/null @@ -1,118 +0,0 @@ -= Boost Angular’s Performance by Lazy Loading your Modules with devon4ng -== Learn how to defer initialization of modules in Angular until it is needed -==== -In single-page-applications as the application size increases its loading speed decreases (since typically the entire application is loaded at once). Lazy loading is a design pattern that defers initialization of objects until it is needed. Angular handles lazy loading through the routing module which redirects to requested pages. Those pages can be loaded at start or on demand. In this tutorial you will build a simple app to understand how lazyloading is implemented in Angular. - -## Prerequisites -* Basic Angular knowledge - -## Learning goals -In this tutorial you will learn how to: -* create an Angular application using the devon command -* look how all modules are loaded by an application at the begining (eager loading) -* implement lazy loading and understand its concept and advantages -==== - -[step] --- -restoreDevonfwIde(["npm", "ng", "vscode"]) --- - -To explain how lazy loading is implemented using angular, a basic sample app is going to be developed. This app will consist in a window named "level 1" that contains two buttons that redirects to other windows in a "second level". It is a simple example, but useful to understand the relation between angular modules and lazy loading. - -![levels-app](./assets/levels-app.png) - -This graphic shows that modules acts as gates to access components "inside" them. - -Because the objective of this guide is related mainly with logic, the html structure and scss styles are less relevant. - -Before creating a devon4ng application, you first have to install the devonfw ide. You will find more information about devonfw on https://devonfw.com/website/pages/welcome/welcome.html. -Once you have setup devonfw ide, you are ready to create your devon4ng application. (Please wait until the devon setup completes and the command prompt appears in the integrated terminal here). -[step] -== Introduction --- -createDevon4ngProject("level-app", "", ["--style=scss", "--routing=true", "--strict=false", "--skip-git=true"]) --- - -In the file app.component.html delete all the content and put in the `router-outlet` tag. -[step] -== Enable routing with router-outlet --- -changeFile("level-app/src/app/app.component.html", { "file": "files/app.component.html.txt" }) --- - -Next you will create the feature modules and components for the app. You will follow the structure shown in the image in the first step. You can use the CLI command `devon ng generate module` along with the `--routing` flag to generate the modules, and `devon ng generate component` command to generate the components. -[step] -== Create the modules and their components --- -createFile("level-app/src/app/first/first-routing.module.ts", "files/first-routing.module.ts.txt") -createFile("level-app/src/app/first/first.module.ts", "files/first.module.ts.txt") -createFile("level-app/src/app/first/second-left/second-left-routing.module.ts", "files/second-left-routing.module.ts.txt") -createFile("level-app/src/app/first/second-left/second-left.module.ts", "files/second-left.module.ts.txt") -createFile("level-app/src/app/first/second-right/second-right-routing.module.ts", "files/second-right-routing.module.ts.txt") -createFile("level-app/src/app/first/second-right/second-right.module.ts", "files/second-right.module.ts.txt") -createFile("level-app/src/app/first/first/first.component.html", "files/first.component.html.txt") -createFile("level-app/src/app/first/first/first.component.scss", "files/empty-file.txt") -createFile("level-app/src/app/first/first/first.component.ts", "files/first.component.ts.txt") -createFile("level-app/src/app/first/second-left/content/content.component.html", "files/content.component.html.txt") -createFile("level-app/src/app/first/second-left/content/content.component.scss", "files/empty-file.txt") -createFile("level-app/src/app/first/second-left/content/content.component.ts", "files/content.component.ts.txt") -createFile("level-app/src/app/first/second-right/content/content.component.html", "files/content-right.component.html.txt") -createFile("level-app/src/app/first/second-right/content/content.component.scss", "files/empty-file.txt") -createFile("level-app/src/app/first/second-right/content/content.component.ts", "files/content.component.ts.txt") --- - -To move between the components you will now configure the routes. You can refer the image in the first step to understand how you will configure the routes. -In `app-routing.module.ts` you will add a path 'first' to `FirstComponent` and a redirection from '' to 'first'. And then import the `FirstModule` in the main `app.module.ts` - -Next, for the feature modules, you will add the routes 'first/second-left' and 'first/second-right' pointing to their respective `ContentComponent` in `first-routing.module.ts`. And then import `SecondLeftModule` and `SecondRightModule` in `first.module.ts` -[step] -== Configure routing --- -changeFile("level-app/src/app/app-routing.module.ts", { "file": "files/app-routing.module.ts.txt" }) -changeFile("level-app/src/app/app.module.ts", { "file": "files/app.module.ts.txt" }) -changeFile("level-app/src/app/first/first-routing.module.ts", { "file": "files/first-routing.module.update1.ts.txt" }) -changeFile("level-app/src/app/first/first.module.ts", { "file": "files/first.module.ts.update1.ts.txt" }) -runClientNg("level-app", { "startupTime": 200, "port": 4200, "path": "" }) --- - -If you run the project at this point you can see in the terminal that just the main file is built. -![compile-eager](./assets/compile-eager.png) - -Go to port 4200 and check the Network tab in the Developer Tools. We can see a document named "first" is loaded. If you click on [Go to right module] a second level module opens, but there is no 'second-right' document. -![second-lvl-right-eager](./assets/second-lvl-right-eager.png) - -Now we will modify the app to lazily load the modules. Modifying an angular application to load its modules lazily is easy, you have to change the routing configuration of the desired module (for example `FirstModule`). Instead of loading a component, you dynamically import it in a `loadChildren` attribute because modules acts as gates to access components "inside" them. Updating this app to load lazily has four consecuences: no component attribute, no import of `FirstComponent`, `FirstModule` import has to be removed from the imports array at `app.module.ts`, and change of context. - -Also, in `first-routing.module.ts` you can change the path for the `ContentComponent`s from `first/second-left` and `first/second-right` to simply `second-left` and `second-right` respectively, because it aquires the context set by AppRoutingModule. -[step] -== Eager loading vs Lazy Loading --- -changeFile("level-app/src/app/app-routing.module.ts", { "file": "files/app-routing.module.update2.ts.txt" }) -changeFile("level-app/src/app/app.module.ts", { "file": "files/app.module.ts.update2.txt" }) -changeFile("level-app/src/app/first/first-routing.module.ts", { "file": "files/first-routing.module.update2.ts.txt" }) --- - -==== -Now when you check the terminal running the app, you could see the lazy loaded modules getting generated along with the main bundle. Also, if you check the Network tab in the developer tools, you could see the (lazy) modules getting loaded when needed. Since, `FirstModule` is the first path we visit, it is getting loaded at first only. -![compile-first-lazy](./assets/compile-first-lazy.png) -![first-lvl-lazy](./assets/first-lvl-lazy.png) - -Now, lets make the SecondLeftModule load lazily. For this, you need to change `component` to `loadChildren` and refer `SecondLeftModule` in the file `first-routing.module.ts`. Next, you need to remove `SecondLeftModule` from the `imports` array of `first.module.ts`. After that you need to route the `ContentComponent` within the `second-left-routing.module.ts`. -[step] -== Lazily load the second left module --- -changeFile("level-app/src/app/first/first-routing.module.ts", { "file": "files/first-routing.module.update3.ts.txt" }) -changeFile("level-app/src/app/first/first.module.ts", { "file": "files/first.module.update3.ts.txt" }) -changeFile("level-app/src/app/first/second-left/second-left-routing.module.ts", { "file": "files/second-left-routing.module.update3.ts.txt" }) --- -If you now check the terminal, you could also see `second-left-second-left-module` along with the `first-first-module` and the `main` bundle getting generated. -![second-lvl-lazy](./assets/second-lvl-lazy.png) - -Also, in the Network tab of the developer tools, you could see the `second-left-second-left-module.js` is only loading when we click on the [Go to left module] button -![second-lvl-left-lazy](./assets/second-lvl-left-lazy.png) -==== - -==== -Lazy loading is a pattern useful when new features are added, these features are usually identified as modules which can be loaded only if needed as shown in this tutorial, reducing the time spent loading an application. -==== \ No newline at end of file diff --git a/devon4ng-mat-layout/files/app-routing.module.txt b/devon4ng-mat-layout/files/app-routing.module.txt deleted file mode 100644 index c336bff97..000000000 --- a/devon4ng-mat-layout/files/app-routing.module.txt +++ /dev/null @@ -1,15 +0,0 @@ -import { NgModule } from '@angular/core'; -import { Routes, RouterModule } from '@angular/router'; -import { HomeComponent } from './pages/home/home.component'; -import { DataComponent } from './pages/data/data.component'; - -const routes: Routes = [ - { path: '', component: HomeComponent }, - { path: 'data', component: DataComponent } -]; - -@NgModule({ - imports: [RouterModule.forRoot(routes)], - exports: [RouterModule] -}) -export class AppRoutingModule { } diff --git a/devon4ng-mat-layout/files/app.component-navlinks.scss.txt b/devon4ng-mat-layout/files/app.component-navlinks.scss.txt deleted file mode 100644 index d0ed49dda..000000000 --- a/devon4ng-mat-layout/files/app.component-navlinks.scss.txt +++ /dev/null @@ -1,18 +0,0 @@ -.menu { - margin-right: auto; -} -mat-sidenav-container { - position: absolute; - top: 64px; - left: 0; - right: 0; - bottom: 0; - a.active { - background: #8e8d8d; - color: #fff; - - p { - color: #4a4a4a; - } - } -} \ No newline at end of file diff --git a/devon4ng-mat-layout/files/app.component-navlinks.txt b/devon4ng-mat-layout/files/app.component-navlinks.txt deleted file mode 100644 index 2b5c8741e..000000000 --- a/devon4ng-mat-layout/files/app.component-navlinks.txt +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - home -

Home

-

sample home page

-
- - grid_on -

Data

-

sample data page

-
-
-
- - - -
\ No newline at end of file diff --git a/devon4ng-mat-layout/files/app.component-routing.txt b/devon4ng-mat-layout/files/app.component-routing.txt deleted file mode 100644 index a98e8540e..000000000 --- a/devon4ng-mat-layout/files/app.component-routing.txt +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/devon4ng-mat-layout/files/app.component-sidenav.scss.txt b/devon4ng-mat-layout/files/app.component-sidenav.scss.txt deleted file mode 100644 index cfbc64a5f..000000000 --- a/devon4ng-mat-layout/files/app.component-sidenav.scss.txt +++ /dev/null @@ -1,10 +0,0 @@ -.menu { - margin-right: auto; -} -mat-sidenav-container { - position: absolute; - top: 64px; - left: 0; - right: 0; - bottom: 0; -} \ No newline at end of file diff --git a/devon4ng-mat-layout/files/app.component-sidenav.txt b/devon4ng-mat-layout/files/app.component-sidenav.txt deleted file mode 100644 index 234cfd80c..000000000 --- a/devon4ng-mat-layout/files/app.component-sidenav.txt +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Sidenav - - - - - \ No newline at end of file diff --git a/devon4ng-mat-layout/files/app.component.scss.txt b/devon4ng-mat-layout/files/app.component.scss.txt deleted file mode 100644 index 7e685f79e..000000000 --- a/devon4ng-mat-layout/files/app.component.scss.txt +++ /dev/null @@ -1,3 +0,0 @@ -.menu { - margin-right: auto; -} \ No newline at end of file diff --git a/devon4ng-mat-layout/files/app.component.txt b/devon4ng-mat-layout/files/app.component.txt deleted file mode 100644 index 4ec15ac87..000000000 --- a/devon4ng-mat-layout/files/app.component.txt +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/devon4ng-mat-layout/files/app.module-components.txt b/devon4ng-mat-layout/files/app.module-components.txt deleted file mode 100644 index f3efc70ae..000000000 --- a/devon4ng-mat-layout/files/app.module-components.txt +++ /dev/null @@ -1,34 +0,0 @@ -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { MatIconModule } from '@angular/material/icon'; -import { MatButtonModule } from '@angular/material/button'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatListModule } from '@angular/material/list'; -import { MatToolbarModule } from '@angular/material/toolbar'; -import { MatSidenavModule } from '@angular/material/sidenav'; -import { NgModule } from '@angular/core'; - -import { AppRoutingModule } from './app-routing.module'; -import { AppComponent } from './app.component'; -import { HomeComponent } from './pages/home/home.component'; -import { DataComponent } from './pages/data/data.component'; - -@NgModule({ - declarations: [ - AppComponent, - HomeComponent, - DataComponent - ], - imports: [ - BrowserAnimationsModule, - MatIconModule, - MatButtonModule, - MatMenuModule, - MatListModule, - MatToolbarModule, - MatSidenavModule, - AppRoutingModule - ], - providers: [], - bootstrap: [AppComponent] -}) -export class AppModule { } diff --git a/devon4ng-mat-layout/files/app.module.txt b/devon4ng-mat-layout/files/app.module.txt deleted file mode 100644 index a19944000..000000000 --- a/devon4ng-mat-layout/files/app.module.txt +++ /dev/null @@ -1,30 +0,0 @@ -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { MatIconModule } from '@angular/material/icon'; -import { MatButtonModule } from '@angular/material/button'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatListModule } from '@angular/material/list'; -import { MatToolbarModule } from '@angular/material/toolbar'; -import { MatSidenavModule } from '@angular/material/sidenav'; -import { NgModule } from '@angular/core'; - -import { AppRoutingModule } from './app-routing.module'; -import { AppComponent } from './app.component'; - -@NgModule({ - declarations: [ - AppComponent - ], - imports: [ - BrowserAnimationsModule, - MatIconModule, - MatButtonModule, - MatMenuModule, - MatListModule, - MatToolbarModule, - MatSidenavModule, - AppRoutingModule - ], - providers: [], - bootstrap: [AppComponent] -}) -export class AppModule { } diff --git a/devon4ng-mat-layout/files/data.component.ts.txt b/devon4ng-mat-layout/files/data.component.ts.txt deleted file mode 100644 index 054982eda..000000000 --- a/devon4ng-mat-layout/files/data.component.ts.txt +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-data', - templateUrl: './data.component.html', - styleUrls: ['./data.component.scss'] -}) -export class DataComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { - } - -} diff --git a/devon4ng-mat-layout/files/data.component.txt b/devon4ng-mat-layout/files/data.component.txt deleted file mode 100644 index 93cd7db31..000000000 --- a/devon4ng-mat-layout/files/data.component.txt +++ /dev/null @@ -1 +0,0 @@ -

Data Page

diff --git a/devon4ng-mat-layout/files/home.component.scss.txt b/devon4ng-mat-layout/files/home.component.scss.txt deleted file mode 100644 index 16e35314f..000000000 --- a/devon4ng-mat-layout/files/home.component.scss.txt +++ /dev/null @@ -1,4 +0,0 @@ -h2 { - text-align: center; - margin-top: 50px; -} \ No newline at end of file diff --git a/devon4ng-mat-layout/files/home.component.ts.txt b/devon4ng-mat-layout/files/home.component.ts.txt deleted file mode 100644 index 73acf06f0..000000000 --- a/devon4ng-mat-layout/files/home.component.ts.txt +++ /dev/null @@ -1,15 +0,0 @@ -import { Component, OnInit } from '@angular/core'; - -@Component({ - selector: 'app-home', - templateUrl: './home.component.html', - styleUrls: ['./home.component.scss'] -}) -export class HomeComponent implements OnInit { - - constructor() { } - - ngOnInit(): void { - } - -} diff --git a/devon4ng-mat-layout/files/home.component.txt b/devon4ng-mat-layout/files/home.component.txt deleted file mode 100644 index fe1d011f7..000000000 --- a/devon4ng-mat-layout/files/home.component.txt +++ /dev/null @@ -1 +0,0 @@ -

Home Page

diff --git a/devon4ng-mat-layout/files/index.txt b/devon4ng-mat-layout/files/index.txt deleted file mode 100644 index ec762e872..000000000 --- a/devon4ng-mat-layout/files/index.txt +++ /dev/null @@ -1,14 +0,0 @@ - - - - - Devon4ngMatLayout - - - - - - - - - diff --git a/devon4ng-mat-layout/files/styles.txt b/devon4ng-mat-layout/files/styles.txt deleted file mode 100644 index 959524dc9..000000000 --- a/devon4ng-mat-layout/files/styles.txt +++ /dev/null @@ -1,6 +0,0 @@ -@import "~@angular/material/prebuilt-themes/indigo-pink.css"; - -body { - margin: 0; - font-family: "Segoe UI", Roboto, sans-serif; - } \ No newline at end of file diff --git a/devon4ng-mat-layout/index.asciidoc b/devon4ng-mat-layout/index.asciidoc deleted file mode 100644 index ab912f6f0..000000000 --- a/devon4ng-mat-layout/index.asciidoc +++ /dev/null @@ -1,121 +0,0 @@ -= Create an Angular application with Angular Material components using devon4ng -==== -The purpose of this tutorial is to get a basic understanding of creating layouts using Angular Material in a devon4ng application. You will create an application with a header containing some menu links and a sidenav with some navigation links. - -### Prerequisites -* Basic Angular knowledge - -### Learning goals -In this tutorial you will learn how to: -* create an Angular application using the devon command -* add Angular Material to the application -* import Angular Material components into your modules -* use Material icons in the application -* use a prebulit theme to style the application -* create layout (containing a header with menu along with a sidenav with navigational links) with the Angular Material components -==== - -[step] --- -restoreDevonfwIde(["npm", "ng", "vscode"]) --- - -Before creating a devon4ng application, you first have to install the devonfw ide. You will find more information about devonfw on https://devonfw.com/website/pages/welcome/welcome.html. -Once you have setup devonfw ide, you are ready to create your first devon4ng project.(Please wait until the devon setup completes and the command prompt becomes ready for writing commands in the integrated terminal here). -[step] --- -createDevon4ngProject("devon4ng-mat-layout", "", ["--style=scss", "--routing=true", "--strict=false"]) -runClientNg("devon4ng-mat-layout", { "startupTime": 200, "port": 4200, "path": "" }) --- - -Next you will add Angular Material to your application. -[step] -== Add Angular Material --- -npmInstall("devon4ng-mat-layout", {"name": "@angular/material @angular/cdk @angular/animations", "args": ["--save"]}) --- - -Once the dependencies are installed, you need to import the BrowserAnimationsModule in your AppModule for animations support. -Also, Angular Material provides a host of components for designing your application. All the components are well structured into NgModules. For each component from the Angular Material library that you want to use, you have to import the respective NgModule. -[step] -== Import Material components --- -changeFile("devon4ng-mat-layout/src/app/app.module.ts", { "file": "files/app.module.txt" }) --- - -To use Material Design Icons along with the mat-icon component, you will load the Material Icons library in your `src/index.html` file. -[step] -== Load Material icons --- -changeFile("devon4ng-mat-layout/src/index.html", { "file": "files/index.txt" }) --- - -Now that you have all the Angular Material related dependencies set up in your project, you can start coding. Let’s begin by adding a suitable `margin` and `font` to the body element of your single page application. You will add it in the `src/styles.scss` file to apply it globally. -[step] -== Add global styles --- -changeFile("devon4ng-mat-layout/src/styles.scss", { "file": "files/styles.txt" }) --- - -==== -Clear the `app.component.html` file and setup a header with a menu button and some navigational links. You will use `mat-toolbar`, `mat-button`, `mat-menu`, `mat-icon` and `mat-icon-button` for this: -[step] -== Add a header --- -changeFile("devon4ng-mat-layout/src/app/app.component.html", { "file": "files/app.component.txt" }) --- -The color attribute on the mat-toolbar element will give it the primary (indigo) color as defined by your theme. The color attribute works with most Angular Material components; the possible values are `primary`, `accent` and `warn`. The `mat-toolbar` is a suitable component to represent a header. It serves as a placeholder for elements you want in your header. Inside the `mat-toolbar`, you start with a button having `mat-icon-button` attribute, which itself contains a `mat-icon` element having the value `menu`. This will serve as a menu button which you can use to toggle the `sidenav`. You follow it with some sample buttons having the `mat-button` attribute. Notice the first button has a property `matMenuTriggerFor` binded to a local reference submenu. As the property name suggests, the click of this button will display the mat-menu element with the specified local reference as a drop-down menu. The rest of the code is self explanatory. -==== - -You want to keep the sidenav toggling menu button on the left and move the rest to the right to make it look better. To do this add the following style to the `menu` class in `app.component.scss`: -[step] -== Shift header menu buttons to right --- -changeFile("devon4ng-mat-layout/src/app/app.component.scss", { "file": "files/app.component.scss.txt" }) --- - -Next, you will create a sidenav. But before that lets create a couple of components to navigate between, the links of which you will add to the sidenav. You can use the `ng generate component` (or `ng g c` command for short) to create Home and Data components. But here, you will create them manually. You nest them in the `pages` sub-directory since they represent your pages. And you will also add the new components to your AppModule. -[step] -== Create navigatable pages --- -createFile("devon4ng-mat-layout/src/app/pages/home/home.component.html", "files/home.component.txt") -createFile("devon4ng-mat-layout/src/app/pages/home/home.component.scss", "files/home.component.scss.txt") -createFile("devon4ng-mat-layout/src/app/pages/home/home.component.ts", "files/home.component.ts.txt") -createFile("devon4ng-mat-layout/src/app/pages/data/data.component.html", "files/data.component.txt") -createFile("devon4ng-mat-layout/src/app/pages/data/data.component.scss", "files/home.component.scss.txt") -createFile("devon4ng-mat-layout/src/app/pages/data/data.component.ts", "files/data.component.ts.txt") -changeFile("devon4ng-mat-layout/src/app/app.module.ts", { "file": "files/app.module-components.txt" }) --- - -Let us set up the routing such that when you visit the root url you see the `HomeComponent` and when you visit `/data` url you see the `DataComponent`. You had opted for routing while creating the application, so you have the routing module `app-routing.module.ts` setup for us. In this file, you have the empty routes array where you set up your routes: -[step] -== Add routing --- -changeFile("devon4ng-mat-layout/src/app/app-routing.module.ts", { "file": "files/app-routing.module.txt" }) --- - -You need to provide a hook where the components will be loaded when their respective URLs are loaded. You do that by using the `router-outlet` directive in the `app.component.html`: -[step] --- -changeFile("devon4ng-mat-layout/src/app/app.component.html", { "file": "files/app.component-routing.txt" }) --- - -Let us finally create the sidenav. To implement the sidenav you need to use 3 Angular Material components: `mat-sidenav-container`, `mat-sidenav` and `mat-sidenav-content`. The `mat-sidenav-container`, as the name suggests, acts as a container for the `sidenav` and the associated content. So it is the parent element, and `mat-sidenav` and `mat-sidenav-content` are the children sibling elements. `mat-sidenav` represents the sidenav. You can put any content you want, though it is usually used to conatain a list of navigational links. The `mat-sidenav-content` element is for conataining your main page content. Since you need the `sidenav` application-wide, you will put it in the `app.component.html` -[step] -== Create the sidenav --- -changeFile("devon4ng-mat-layout/src/app/app.component.html", { "file": "files/app.component-sidenav.txt" }) -changeFile("devon4ng-mat-layout/src/app/app.component.scss", { "file": "files/app.component-sidenav.scss.txt" }) --- - -The sidenav’s width will be corrected when you add the navigational links to it. That is the only thing remaining to be done. Lets implement it now: -[step] -== Style the sidenav --- -changeFile("devon4ng-mat-layout/src/app/app.component.html", { "file": "files/app.component-navlinks.txt" }) -changeFile("devon4ng-mat-layout/src/app/app.component.scss", { "file": "files/app.component-navlinks.scss.txt" }) --- - -==== -In this tutorial you learned how to create an angular application using devonfw-ide, add Angular Material to it and use its components to create a simple layout. -==== \ No newline at end of file diff --git a/devonfw-ide/index.asciidoc b/devonfw-ide/index.asciidoc deleted file mode 100644 index 4f11df6ce..000000000 --- a/devonfw-ide/index.asciidoc +++ /dev/null @@ -1,25 +0,0 @@ -= Bootstrap your devonfw development environment -==== -devonfw offers complete IDE solution integrated with a lot​ of integrated tooling and initial settings​. -It massively speeds up development, reduces risks and helps deliver better results. - -### Prerequisites -* User should have a prior experience with Eclipse or any IDE. - -### Learning goals -* After completing this scenario, you will have learned how to install devonfw development environment i.e., the devonfw IDE. - - -More information about devonfw IDE can be found on https://devonfw.com/website/pages/docs/devonfw-ide-introduction.asciidoc.html -==== -==== -Follow the below steps to setup your devonfw development environment. -[step] --- -installDevonfwIde(["java","mvn"]) --- -devonfw-ide is installed successfully with Maven and Java too. These tools can be customized by changing the configuration -in devon.properties. - -More information on devonfw-ide can be found at https://devonfw.com/website/pages/docs/devonfw-ide-introduction.asciidoc.html -==== \ No newline at end of file diff --git a/openapi-generation-servicedocgen/files/pom.xml b/openapi-generation-servicedocgen/files/pom.xml deleted file mode 100644 index 4cae6bcc2..000000000 --- a/openapi-generation-servicedocgen/files/pom.xml +++ /dev/null @@ -1,154 +0,0 @@ - - - 4.0.0 - org.acme - rest-json-quickstart - 1.0.0-SNAPSHOT - - quarkus-bom - io.quarkus - 2.5.1.Final - 3.0.0-M5 - UTF-8 - 11 - 11 - - - - - - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} - pom - import - - - - - - - io.quarkus - quarkus-resteasy-jackson - - - io.quarkus - quarkus-junit5 - test - - - io.rest-assured - rest-assured - test - - - - - - org.codehaus.mojo - servicedocgen-maven-plugin - 1.0.0 - - - - generate - - - - - - - Order Service REST API Documentation - This documentation describes the REST API of the order service - - icsddevonfwsupport.apps2@capgemini.com - devon4j support - https://devonfw.com - - - https://github.com/devonfw-sample/devon4quarkus-order/blob/master/LICENSE - Apache License 2.0 - - - / - - http - - - .*Resource.* - - - - - - - - maven-surefire-plugin - ${surefire-plugin.version} - - - org.jboss.logmanager.LogManager - ${maven.home} - - - - - ${quarkus.platform.group-id} - quarkus-maven-plugin - ${quarkus.platform.version} - - - - build - - - - - - - - - native - - - native - - - - native - - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${surefire-plugin.version} - - - - integration-test - verify - - - - ${project.build.directory}/${project.build.finalName}-runner - org.jboss.logmanager.LogManager - ${maven.home} - - - - - - - - - - diff --git a/openapi-generation-servicedocgen/index.asciidoc b/openapi-generation-servicedocgen/index.asciidoc deleted file mode 100644 index 1144e1cd7..000000000 --- a/openapi-generation-servicedocgen/index.asciidoc +++ /dev/null @@ -1,77 +0,0 @@ -= OpenAPI and Swagger UI generation with ServicedocGen plugin -==== -This tutorial will teach you how to use the [ServicedocGen maven plugin](http://www.mojohaus.org/servicedocgen-maven-plugin/) to generate the OpenAPI specification and Swagger UI from your REST APIs. - -The plugin analysis the REST APIs and the associated JavaDoc and then generates the OpenAPI specification as a static file. It is also able to create an HTML file that represents the Swagger UI and can be served by Quarkus to provide the Swagger UI in the browser. - -For more information about OpenAPI and the ServicedocGen plugin, see the [devon4j documentation](https://github.com/devonfw/devon4j/blob/master/documentation/guide-openapi.asciidoc). - -### Prerequisites -* Installed devonfw-ide (or at least Java and Maven installed) - -### Learning goals -* You will learn how to generate OpenAPI specifications and Swagger UI from REST services using ServicedocGen maven plugin - -==== - -[step] --- -restoreDevonfwIde(["java", "mvn"]) --- - -First, clone the `quarkus-quickstarts` repository from GitHub. It contains several sample applications for many extensions to Quarkus. For this tutorial, we will use an application with a simple REST service contained in the `rest-json-quickstart` subfolder. -[step] -== Clone quarkus-quickstarts repository --- -cloneRepository("", "https://github.com/quarkusio/quarkus-quickstarts.git") --- - -==== -Next step is to add the ServicedocGen plugin to the project's pom.xml -[step] -== Add the ServicedocGen maven plugin --- -changeFile("quarkus-quickstarts/rest-json-quickstart/pom.xml", { "file": "files/pom.xml" }) --- -Take a look at the `configuration` section of the plugin. In this section you can configure the behavior of the plugin. Not all options are necessary, such as the `info` section. This one is only used to add additional information to the OpenAPI file. - -Some other parts are necessary. The `classnameRegex` parameter is used to configure which name pattern the REST service classes must match. - -The `templates` section is used to configure what is created by the plugin. In this case, the OpenAPI specification is created in yaml format and the Swagger UI file is also created. -==== - -In this step we will buid the application. This will cause the ServicedocGen plugin to create the configured files. -[step] -== Build the application --- -executeCommand("mvn clean package","mvn clean package", { "dir": "quarkus-quickstarts/rest-json-quickstart" }) --- - -The files are created in the `target/site/servicedoc` folder. To serve them automatically when running the application, move the files to the `src/main/resources/META-INF/resources/` folder. Static files located in this folder are automatically served by Quarkus. -[step] -== Move generated file to META-INF/resources --- -executeCommand("copy target\\site\\servicedoc\\*.* src\\main\\resources\\META-INF\\resources","mv target/site/servicedoc/* src/main/resources/META-INF/resources/", { "dir": "quarkus-quickstarts/rest-json-quickstart" }) --- - -Now build the application again so that the static files are also included in the resulting jar file. -[step] -== Build the application again --- -executeCommand("mvn clean package","mvn clean package", { "dir": "quarkus-quickstarts/rest-json-quickstart" }) --- - -==== -Now run the application. -[step] -== Run the application --- -executeCommand("java -jar quarkus-run.jar","java -jar quarkus-run.jar", { "dir": "quarkus-quickstarts/rest-json-quickstart/target/quarkus-app", "asynchronous": true }, {"port":8080 , "startupTime": 120, "path": "fruits", "interval": 2}) --- - -After executing `java -jar quarkus-run.jar` you can access the REST service by opening the following URL: https://[[HOST_SUBDOMAIN]]-8080-[[KATACODA_HOST]].environments.katacoda.com/fruits - -You can access the OpenAPI specification of this REST API at https://[[HOST_SUBDOMAIN]]-8080-[[KATACODA_HOST]].environments.katacoda.com/OpenApi.yaml - -The Swagger UI is accessible at https://[[HOST_SUBDOMAIN]]-8080-[[KATACODA_HOST]].environments.katacoda.com/SwaggerUI.html -==== diff --git a/openapi-generation-smallrye/files/application.properties b/openapi-generation-smallrye/files/application.properties deleted file mode 100644 index 891c9bcf3..000000000 --- a/openapi-generation-smallrye/files/application.properties +++ /dev/null @@ -1 +0,0 @@ -quarkus.swagger-ui.always-include=true \ No newline at end of file diff --git a/openapi-generation-smallrye/files/pom.xml b/openapi-generation-smallrye/files/pom.xml deleted file mode 100644 index dd6d8bc56..000000000 --- a/openapi-generation-smallrye/files/pom.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - 4.0.0 - org.acme - rest-json-quickstart - 1.0.0-SNAPSHOT - - quarkus-bom - io.quarkus - 2.5.1.Final - 3.0.0-M5 - UTF-8 - 11 - 11 - - - - - - ${quarkus.platform.group-id} - ${quarkus.platform.artifact-id} - ${quarkus.platform.version} - pom - import - - - - - - - io.quarkus - quarkus-resteasy-jackson - - - io.quarkus - quarkus-smallrye-openapi - - - io.quarkus - quarkus-junit5 - test - - - io.rest-assured - rest-assured - test - - - - - - maven-surefire-plugin - ${surefire-plugin.version} - - - org.jboss.logmanager.LogManager - ${maven.home} - - - - - ${quarkus.platform.group-id} - quarkus-maven-plugin - ${quarkus.platform.version} - - - - build - - - - - - - - - native - - - native - - - - native - - - - - org.apache.maven.plugins - maven-failsafe-plugin - ${surefire-plugin.version} - - - - integration-test - verify - - - - ${project.build.directory}/${project.build.finalName}-runner - org.jboss.logmanager.LogManager - ${maven.home} - - - - - - - - - - \ No newline at end of file diff --git a/openapi-generation-smallrye/index.asciidoc b/openapi-generation-smallrye/index.asciidoc deleted file mode 100644 index 77446c987..000000000 --- a/openapi-generation-smallrye/index.asciidoc +++ /dev/null @@ -1,53 +0,0 @@ -= OpenAPI and Swagger UI generation with Quarkus Smallrye extension -==== -This tutorial will show you how to include the Quarkus Smallrye OpenAPI extension in Quarkus projects to automatically generate OpenAPI specifications and Swagger UI from your REST APIs. -For more information about OpenAPI and the Smallrye OpenAPI extension, see the [devon4j documentation](https://github.com/devonfw/devon4j/blob/master/documentation/guide-openapi.asciidoc) or the [official Quarkus guide](https://quarkus.io/guides/openapi-swaggerui). - -### Prerequisites -* Installed devonfw-ide (or at least Java and Maven installed) - -### Learning goals -* You will learn how to generate OpenAPI specifications and Swagger UI from REST services - -==== - -[step] --- -restoreDevonfwIde(["java", "mvn"]) --- - -First, clone the `quarkus-quickstarts` repository from GitHub. It contains several sample applications for many extensions to Quarkus. We will use a simple REST service for this tutorial and customize the application accordingly. -[step] -== Clone quarkus-quickstarts repository --- -cloneRepository("", "https://github.com/quarkusio/quarkus-quickstarts.git") --- - -The next step is to add the Smallrye OpenAPI extension to the project. Open the `pom.xml` file of project in the folder `rest-json-quickstart`. Add the extension `quarkus-smallrye-openapi` to the list of dependencies. -[step] -== Add the extension --- -changeFile("quarkus-quickstarts/rest-json-quickstart/pom.xml", { "file": "files/pom.xml" }) --- - -By default, the Swagger UI is enabled only in development mode. To enable it in all cases, set the property `quarkus.swagger-ui.always-include=true` in the application.properties file of the Quarkus project. -[step] --- -createFile("quarkus-quickstarts/rest-json-quickstart/src/main/resources/application.properties", "files/application.properties") --- - -==== -This was all to include the extension in the project. Now build and run the application. -[step] -== Build and run the application --- -executeCommand("mvn clean package","mvn clean package", { "dir": "quarkus-quickstarts/rest-json-quickstart" }) -executeCommand("java -jar quarkus-run.jar","java -jar quarkus-run.jar", { "dir": "quarkus-quickstarts/rest-json-quickstart/target/quarkus-app", "asynchronous": true }, {"port":8080 , "startupTime": 120, "path": "fruits", "interval": 2}) --- - -After executing `java -jar quarkus-run.jar`, the application should be running. It provides a simple REST service that can be accessed by opening the following URL: https://[[HOST_SUBDOMAIN]]-8080-[[KATACODA_HOST]].environments.katacoda.com/fruits - -You can access the OpenAPI specification of this REST API at https://[[HOST_SUBDOMAIN]]-8080-[[KATACODA_HOST]].environments.katacoda.com/q/openapi - -The Swagger UI is accessible at https://[[HOST_SUBDOMAIN]]-8080-[[KATACODA_HOST]].environments.katacoda.com/q/swagger-ui -====