Developing projection java implementation using Docker¶
Prerequisites: Developers should have Docker desktop installed.
Problem¶
Earlier when a developer has java implementation for a projection, it was not possible to check the functionality from the IFS Cloud Web locally. Developers had to use 3rd party tools like the postman to validate the implementation, which was challenging when it comes to complex functions and actions.
Solution¶
Developer Studio now supports deploying and testing projection java implementations using IFS Cloud Web, running locally in a docker container. Additionally, this allows developers to debug their java implementations using the Developer Studio.
How to setup¶
Open Project Properties. (RMB on the project node and select properties) Select General tab and add a project root Select Technologies tab and select Docker Support checkbox. (01)
Synchronize Libraries. ( RMB in the project node and select Synchronize Libraries ) (02)
How to deploy and run¶
Add your projection files which contain java implementations to the Application Server. (RMB on the projection file and select Add to Application Server)
Clean and Build the Application Server and make sure the build is successful without any errors
Start Docker. (RMB on the Application Server node and select Start Docker) (NOTE: This can take some time for the first time to download the docker image file)
Wait for the state of the server to change to Running
Deploy your Java implementations (RMB on the Application Server node and select Deploy)
The server will be running on localhost:8001 Sample : http://localhost:8001/main/ifsapplications/web/page/MovieManager/MovieDetails;path=0.146179876.1178091668;record=KE1vdmllSWQ9MSk%3D
Invoke your java implementation from the IFS Cloud Web.
If you want to change your java implementation, do necessary changes in the FunctionsImpl.java and ActionsImpl.java files and use quick deploy option to deploy them to the application server.
How to debug¶
Attach the java debugger from the developer studio.
Make sure the Debugger type is Java Debugger (JPDA) Connector is Socket Attach Port is 8787 and press OK
Place breakpoints at the lines that you want your code to break by clicking on the line numbers
Execute the function or action from the IFS Cloud Web that is running on the localhost.