Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for VS Code #261

Merged
merged 7 commits into from
Jul 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added VS_Code/images/Adding_payara_server_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/Adding_payara_server_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/Adding_payara_server_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/Adding_payara_server_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/Running_payara_server_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/Running_payara_server_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/adding_payara_server_1.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/admin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/building_cargotracker_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/building_cargotracker_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/deployment_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/deployment_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/deployment_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/extension_pack_for_java.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/importing_cargotracker_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/importing_cargotracker_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/importing_cargotracker_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/payara_tools.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/stop1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/stop2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/sucess_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added VS_Code/images/tracking.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
102 changes: 102 additions & 0 deletions VS_Code/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# VS Code IDE

This section outlines how to set up the application in the VS Code IDE.

## Prerequisites

* Java SE 8, Java SE 11 or Java SE 17 is required.
* Payara Server 5 is required. You can download Payara Server 5 from https://www.payara.fish/downloads/
* The VS Code IDE is required. You can download the VS Code IDE from https://code.visualstudio.com/download

## Download

Download the source code zip file and expand it somewhere in your file system. Note that this is a Maven project. https://github.com/eclipse-ee4j/cargotracker/archive/master.zip

## VS Code IDE Set-up

### Installing Necessary Tools

Start the VS Code IDE

Go to ->Extensions (Ctrl+Shift+ X)

Search for [Payara Tools](https://marketplace.visualstudio.com/items?itemName=Payara.payara-vscode) and [Extension Pack for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack) and install Payara Tools and Extension Pack for Java.

![Payara_Tools](<images/payara_tools.PNG>)

![Extension_Pack_for_Java](<images/extension_pack_for_java.PNG>)

### Adding Payara Server

Once the Payara Tools plugin is installed,
1. Click on the Payara icon on the left side bar below the Extensions icon,then click on the '+' icon on the Servers.

![Adding_Server](<images/adding_payara_server_1.PNG>)

* Before doing the next step,please make sure that you have properly set up JAVA_HOME on your PC.
2. choose local domain -> browse the Payara server,then select the directory where you installed the Payara 5.

![Local_Domain](<images/Adding_payara_server_2.png>)


![browse](<images/Adding_payara_server_3.png>)

3. Name it Payara5 and hit next. Select default domain1.

![Payara5](<images/Adding_payara_server_4.png>)

![Local_domain1](<images/Adding_payara_server_5.png>)

4. Now ,a payara5 name icon with the Payara logo comes under the servers.Right-click on that icon,and select start,it will automatically start the Payara 5.

![running](<images/Running_payara_server_1.png>)

5. A small green color triangle comes under the Payara5 logo in the servers,this means your Payara server has been successfully started.You can verify if you wanted by visiting localhost:8080

![running_sucessful](<images/Running_payara_server_2.png>)

### Importing Code

1. Go to File -> Open Folder ->Select the root directory of the Cargo Tracker project in your file system, and Hit finish.VS Code will automatically identify it as a Maven project.

![import](<images/importing_cargotracker_1.png>)

2. This will take a few minutes to import the project for the first time.

![import2](<images/importing_cargotracker_2.png>)

![import3](<images/importing_cargotracker_3.png>)

### Building and Running on Payara 5
1. After the project loads,Go under the maven tab on the left bottom side,the eclipse cargo tracker name will be shown.Right-click on it and proceed with run maven commands clean and package(which will take a while the very first time as Maven downloads dependencies)

![build1](<images/building_cargotracker_1.png>)

![build2](<images/building_cargotracker_2.png>)

2. After this a war file of the name cargo-tracker.war will be built under the target section.

![target](<images/deployment_1.png>)

3. Right-click on that war file,select run on Payara server option

![cargo_tracker_war](<images/deployment_2.png>)
4. The first-time startup might take a bit of time. After this, VS Code will automatically open up a default browser window with the application.

![launch](<images/deployment_3.png>)

![sucess](<images/sucess_1.png>)

There is a tracking interface to track the current status of cargo and a booking interface to book and route cargo. You should explore both interfaces before diving into the code. You should also check out the [REST](https://github.com/eclipse-ee4j/cargotracker/blob/master/src/main/java/org/eclipse/cargotracker/interfaces/handling/rest/HandlingReportService.java) and [file processing](https://github.com/eclipse-ee4j/cargotracker/blob/master/src/main/java/org/eclipse/cargotracker/interfaces/handling/file/UploadDirectoryScanner.java) interfaces to register handling events as well as the mobile web interface. You can test against the REST interfaces using our [soapUI tests](https://github.com/eclipse-ee4j/cargotracker/tree/master/src/test/soapui).

![tracking](images/tracking.png)

![admin](images/admin.png)

### Stopping Cargo-tracker

* Click on the 'x' icon to stop the cargo-tracker application on Payara5.

![stop1](images/stop1.png)

![stop2](images/stop2.png)