Lab 5 Using Remote Worklight Server
Table of Contents 5. Using Remote Worklight Server... 5-3 5.1. Lab Setup...5-4 5.1.1. Delete the mobile app in the Worklight Console... 5-4 5.2. Using the Remote Worklight Server...5-6 5.2.1. Connecting to Remote Worklight Server... 5-7 5.2.2. Deploy the MyMemories App to the Remote Server... 5-9 Page 5-2 Worklight 6.0 POT - Lab 5
5. Using Remote Worklight Server In Lab 5, we will prepare the MyMemories app for external deployment. This lab assumes you have completed the Lab 3 exercise. If you have skipped Lab 3, you may import the Lab5_MyMemories_Begin.zip from C:\WorklightLab\imports\lab5 to continue Lab 5. The step in this lab includes: Clean up app in the Worklight Development Server Connect remote server to Eclipse Deploy app to remote server Worklight 6.0 POT - Lab 5 Page 5-3
5.1. Lab Setup In this section, we will remove the app that has been deployed to the embedded Worklight Development Server. This lab assumes you have finished Lab 3 and has the MyMemories project deployed to the development server. We will perform a complete cleanup of the deployed project in the setup step. 5.1.1. Delete the mobile app in the Worklight Console 1. From the Eclipse workbench, right click on MyMemories project > Open Worklight Console. Page 5-4 Worklight 6.0 POT - Lab 5
2. In the Worklight Console, click Delete to remove the MyMemories app. Click Yes to confirm. Note that the port number for this Worklight Console is 10080. Later on in the Remote server, the Worklight Console will have a different port number. 3. Click Delete to remove the GPSLocator adapter. Click Yes to confirm. Worklight 6.0 POT - Lab 5 Page 5-5
4. 5. Close the browser. In the Worklight Studio workbench, change to the Design perspective. 6. Change to the Servers view. 7. Expand Worklight Development Server > right-click on MyMemories > Remove. Press OK to confirm. 8. The mobile app is now fully removed from the Worklight Development Server. 5.2. Using the Remote Worklight Server There is an external Worklight Server installed in the VMWare image. This will be acting as the remote server. In this section, we will connect to the remote server using the Servers tools. Page 5-6 Worklight 6.0 POT - Lab 5
5.2.1. Connecting to Remote Worklight Server 1. In the Servers view, right click on the whitespace > New > Server. 2. In the dialog, select WebSphere Application Server V8.5 Liberty Profile. Change the Server name to Remote Worklight Server. Click Add to add a new Server runtime Environment. Worklight 6.0 POT - Lab 5 Page 5-7
3. Click Browse to browse to the path C:\IBM\WebSphere\Liberty. This is where the external Worklight Server is installed. Click Finish. 4. Ensure that the WebSphere Application Server V8.5 Liberty Profile is selected for the Server runtime environment. Press Finish. Page 5-8 Worklight 6.0 POT - Lab 5
5. The Remote Worklight Server is connected in the Servers view. 5.2.2. Deploy the MyMemories App to the Remote Server There are multiple ways to deploy an app to the remote server. We will use the graphical way in this section. You can also setup Ant script to generate the packages automatically. 1. Right click on MyMemories project > Change Worklight Target Server. 2. Select Remote Worklight Server from the drop-down box. Press Save. Worklight 6.0 POT - Lab 5 Page 5-9
3. Expand to MyMemories project > apps > right click on MyMemories folder > select Build All and Deploy. This step will automatically start the Remote Worklight Server and deploy the app. 4. In the Console view, confirm that the mobile app was deployed successfully. Page 5-10 Worklight 6.0 POT - Lab 5
5. Expand to MyMemories project > adapters > right click on GPSLocator folder > select Deploy Worklight Adapter. 6. From the Eclipse workbench, right click on MyMemories project > Open Worklight Console. Worklight 6.0 POT - Lab 5 Page 5-11
7. Notice that the Worklight Console because it s running off the Remote Worklight Server, it has a port number of 9080. 8. Switch to the Servers view, expand Remote Worklight Server and notice that MyMemories app is deployed. Page 5-12 Worklight 6.0 POT - Lab 5
9. You can stop the Worklight Development Server to conserve memory as we will not be using it for the rest of the lab. Select Worklight Development Server and click on the Stop icon. 10. Switch the Worklight Console in the chrome browser. Click the eye to open the simulator. Worklight 6.0 POT - Lab 5 Page 5-13
11. The app is running using the Remote Worklight Server. This concludes Lab 5. Page 5-14 Worklight 6.0 POT - Lab 5