guided exercise 1.1: setting up the sample openedge data ... · guided exercise 1.1: setting up the...

13
Guided Exercise 1.1: Setting up the sample OpenEdge Data Object Services Overview Before you can develop a web app, you must set up the back-end services for the data providers that the web app will use. In this Guided Exercise you will extract the database files for the sample application and start the Database Server for the Sports3000 database. Then you will import the ABL Web App project that contains pre-written OpenEdge Data Object Service code into Progress Developer Studio for OpenEdge and modify some workspace configuration settings. Finally, you will deploy the OpenEdge Data Object Services to an instance of PAS for OpenEdge, which is the application server that hosts the sample application. These deployed OpenEdge Data Object Services will be the source of the data for the web app that you create in this course. This exercise has 3 parts. The exercise steps take approximately 30 minutes to complete. You perform this exercise in your live version of Progress OpenEdge and Kendo UI Builder by Progress. Important: If you already have a Developer Studio workspace where you have deployed the OpenEdge Data Object Services for SportsInc from the course Creating Progress OpenEdge Data Object Services for Kendo UI Builder, you can continue using that workspace (\progress_education\openedge\PDO-KUIB\workspace) for this course. Before you begin Before you begin, you must: Step Description 1. Complete the course setup instructions to extract the course files to the \progress_education\openedge\KUIB directory. 2. Ensure that Progress Developer Studio for OpenEdge (V 11.6.3) is installed. 3. Ensure that Kendo UI Builder by Progress: OpenEdge Edition (V 1.1) is installed. 4. Ensure the Admin Service for Progress OpenEdge 11.6 is running. Hint: Use the Windows Service Viewer to check it and start it if necessary. Location of files: Exercise files: \progress_education\openedge\KUIB\Exercise\Lesson01

Upload: vongoc

Post on 08-Nov-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Guided Exercise 1.1: Setting up the sample OpenEdge Data ... · Guided Exercise 1.1: Setting up the sample OpenEdge Data Object Services, Steps Steps, Part 1—Starting the Database

Guided Exercise 1.1: Setting up the sample OpenEdge Data Object Services

Overview

Before you can develop a web app, you must set up the back-end services for the data

providers that the web app will use. In this Guided Exercise you will extract the

database files for the sample application and start the Database Server for the

Sports3000 database. Then you will import the ABL Web App project that contains

pre-written OpenEdge Data Object Service code into Progress Developer Studio for

OpenEdge and modify some workspace configuration settings. Finally, you will

deploy the OpenEdge Data Object Services to an instance of PAS for OpenEdge,

which is the application server that hosts the sample application. These deployed

OpenEdge Data Object Services will be the source of the data for the web app that

you create in this course.

This exercise has 3 parts. The exercise steps take approximately 30 minutes to

complete. You perform this exercise in your live version of Progress OpenEdge and

Kendo UI Builder by Progress.

Important: If you already have a Developer Studio workspace where you have

deployed the OpenEdge Data Object Services for SportsInc from the course Creating

Progress OpenEdge Data Object Services for Kendo UI Builder, you can continue

using that workspace (\progress_education\openedge\PDO-KUIB\workspace) for

this course.

Before you begin

Before you begin, you must:

Step Description

1. Complete the course setup instructions to extract the course files to the

\progress_education\openedge\KUIB directory.

2. Ensure that Progress Developer Studio for OpenEdge (V 11.6.3) is installed.

3. Ensure that Kendo UI Builder by Progress: OpenEdge Edition (V 1.1) is

installed.

4. Ensure the Admin Service for Progress OpenEdge 11.6 is running.

Hint: Use the Windows Service Viewer to check it and start it if necessary.

Location of files:

Exercise files: \progress_education\openedge\KUIB\Exercise\Lesson01

Page 2: Guided Exercise 1.1: Setting up the sample OpenEdge Data ... · Guided Exercise 1.1: Setting up the sample OpenEdge Data Object Services, Steps Steps, Part 1—Starting the Database

Guided Exercise 1.1: Setting up the sample OpenEdge Data Object Services, Steps

Steps, Part 1—Starting the Database Server

Note: If you will be using the \progress_education\openedge\PDO-

KUIB\workspace from the course, Creating Progress OpenEdge Data Object

Services for Kendo UI Builder, you can skip this part of the exercise.

Before you can test the web app, the database for the application (Sports3000) must

be started. Follow these steps to set up and start the database that is used for the

sample application for this course.

Step Task

1. Extract the files in Sports3000_OE116.zip to C:\OpenEdge\WRK. The files

extracted are the database files, as well as a sub-folder of database triggers.

2. Open a Proenv window by selecting Start > Progress > OpenEdge >

Proenv.

3. Start the database server for the sports3000 database as follows:

proserve sports3000 –H localhost –S 9999

Note: If port 9999 is unavailable on your system, use a different port number.

4. Close the Proenv window.

Steps, Part 2—Preparing your workspace and project in Progress Developer Studio for OpenEdge

Note: If you will be using the \progress_education\openedge\PDO-

KUIB\workspace from the course, Creating Progress OpenEdge Data Object

Services for Kendo UI Builder, you can skip this part of the exercise.

Page 3: Guided Exercise 1.1: Setting up the sample OpenEdge Data ... · Guided Exercise 1.1: Setting up the sample OpenEdge Data Object Services, Steps Steps, Part 1—Starting the Database

The OpenEdge Data Object Services have been already written for you. In this part of

the exercise, you will set up your workspace in Developer Studio, import the project

that contains the OpenEdge Data Object Services, and modify some settings in your

workspace.

Step Task

1. Start Developer Studio by selecting Start > Progress > OpenEdge >

Developer Studio.

2. You will first see the welcome screen as shown here. Click the Workbench

icon to continue to the workspace for Developer Studio.

3. If this is the first time you are using Developer Studio, the first dialog box is

for you to specify where your workspace is located.

a. Specify \progress_education\openedge\KUIB\workspace as the

workspace location.

b. Click OK.

c. Click the Workbench icon to start the workspace.

4. If you have previously used Developer Studio for OpenEdge, you must

switch to a new workspace.

a. Select File > Switch Workspace > Other….

Page 4: Guided Exercise 1.1: Setting up the sample OpenEdge Data ... · Guided Exercise 1.1: Setting up the sample OpenEdge Data Object Services, Steps Steps, Part 1—Starting the Database

b. Specify \progress_education\openedge\KUIB\workspace as the

workspace location.

c. Click OK. Developer Studio will restart.

d. Click the Workbench icon to start the workspace.

5. Next, you must ensure that Developer Studio has a valid connection to the

Admin Server and that when you start the PAS for OpenEdge instance from

Developer Studio, it will use the launch configuration you set up.

a. Select Window > Preferences.

b. In the Preferences window, navigate to Progress OpenEdge > Server.

c. Ensure that in the Run/Debug area, Update properties from server

before starting/launching is not selected.

d. Navigate to Progress OpenEdge > Server > OpenEdge Explorer

Connections.

e. In the OpenEdge Explorer Connections window, select Explorer 1.

f. Click Edit….

g. Click Test Connection.

h. If the connection does not succeed, you must enter a valid password for

the admin user. The default password for first-time use is admin, but

when you access the Admin Server for the first time, you are asked to

change the password. You should enter the latest password configured

for the admin user.

i. Click Test Connection to confirm that you can successfully log in to the

Admin Server.

j. Click Create Servers & Finish.

k. Click OK.

l. If you do not see a Servers tab in the lower area of your Developer Studio

workspace, ensure that this view is visible by selecting Window > Show

View > Servers.

Hint: If Servers is not visible, it will be under Other…

Page 5: Guided Exercise 1.1: Setting up the sample OpenEdge Data ... · Guided Exercise 1.1: Setting up the sample OpenEdge Data Object Services, Steps Steps, Part 1—Starting the Database

m. The Servers tab should appear as follows:

6. Next, you will import the project that contains the back-end service code.

a. Select File > Import….

b. Select General > Existing Projects into Workspace.

c. Click Next.

d. Select Archive File.

e. Browse to and select Exercise\Lesson01\SportsInc.zip.

f. Click Finish.

The newly imported project should appear as follows:

Page 6: Guided Exercise 1.1: Setting up the sample OpenEdge Data ... · Guided Exercise 1.1: Setting up the sample OpenEdge Data Object Services, Steps Steps, Part 1—Starting the Database

7. Next, you will define a database connection in Developer Studio and ensure

that the SportsInc project has a connection to the Sports3000 database.

a. Right-click the SportsInc project and then select Properties.

b. Navigate to Progress OpenEdge > Database Connections.

c. Click the Configure database connections link.

d. Click New to open the Add Connection Profile wizard

e. Enter the connection name, Sports3000DB.

f. Click the Browse button and then navigate to and select

c:\OpenEdge\wrk\sports3000.db.

g. Specify the host name as localhost.

h. Specify 9999 as the port number.

Note: If port 9999 is unavailable on your system, use a different port

number. It must be the same port number that you specified when you

started the Database Server.

i. Click the Test Connection button.

j. The AVM runs the code to test the connection. After the test completes

successfully, click OK. If the connection did not succeed, you will need

to investigate why the connection failed. Is the Database Server for the

database running?

k. Click Next. The Define a SQL connection window opens.

l. Click Next. The Add SQL Connection Profile window opens. Here,

retain the values that have been automatically set for you.

Note: The Database name specified must be in lower case. If the name

has upper-case letters in it, you must modify them to be lower case.

m. Click the Test Connection button. Then click OK when the connection

succeeds.

n. Click Next. The Define Database Server Configuration window opens.

Notice that the Auto-start database server is selected. Leave that box

selected. Developer Studio will automatically start the Database Server

for you. Do not select Auto-shutdown database server.

o. Click Finish.

p. After the configuration is completed, the connection string is shown as:

-db C:\OpenEdge\WRK\sports3000.db -H localhost -S 9999

q. Click OK. You are taken back to the Database Connections.

r. Select the connection profile you just configured.

Page 7: Guided Exercise 1.1: Setting up the sample OpenEdge Data ... · Guided Exercise 1.1: Setting up the sample OpenEdge Data Object Services, Steps Steps, Part 1—Starting the Database

s. Click OK to complete the configuration.

8. Next you will configure the PAS for OpenEdge Instance, oepas1 so that it

starts with a database connection and uses the SportsInc/AppServer folder

in its PROPATH.

a. In the Servers tab at the bottom of your workspace, double-click oepas1.

b. The configuration properties for this application server opens.

c. In the General Information area, click the Open launch configuration

link.

d. Click the Databases tab.

e. Select the Sports3000DB database connection.

Page 8: Guided Exercise 1.1: Setting up the sample OpenEdge Data ... · Guided Exercise 1.1: Setting up the sample OpenEdge Data Object Services, Steps Steps, Part 1—Starting the Database

f. Click the PROPATH tab.

g. Click Add Workspace Directory….

h. Select the SportsInc/AppServer folder.

i. Click OK.

j. Click OK.

k. Close the oepas1 configuration properties window.

Page 9: Guided Exercise 1.1: Setting up the sample OpenEdge Data ... · Guided Exercise 1.1: Setting up the sample OpenEdge Data Object Services, Steps Steps, Part 1—Starting the Database

Steps, Part 3—Deploying the OpenEdge Data Object Services and testing them

Note: If you will be using the \progress_education\openedge\PDO-

KUIB\workspace from the course, Creating Progress OpenEdge Data Object

Services for Kendo UI Builder, you can skip Step 1, but you should test that you can

access the OpenEdge Data Object Services from your browser.

Now that you have configured your workspace to use a database connection to the

Database Server for the Sports3000 database and have imported the OpenEdge Data

Object Services project, you are ready to deploy the OpenEdge Data Object Services

to the PAS for OpenEdge instance, oepas1, and test them.

Step Task

1. Next, you will deploy the SportsInc services to the PAS for OpenEdge instance,

oepas1.

a. In the Servers tab, right-click oepas1.

b. Select Add and Remove….

c. Select the CustomerService and SportsIncService services.

d. Click Add.

e. Click Finish.

2. Next, you will start oepas1.

a. In the Servers tab, select oepas1.

Page 10: Guided Exercise 1.1: Setting up the sample OpenEdge Data ... · Guided Exercise 1.1: Setting up the sample OpenEdge Data Object Services, Steps Steps, Part 1—Starting the Database

b. Click the Start icon. It will take a few minutes for the server to start.

Everything is started when you see the following:

3. Finally, you will test that you can access the OpenEdge Data Object Services and

their corresponding catalogs in oepas1. The catalog for a Data Object Service

contains details about the resources you can access for a data service in a web app.

a. In a browser (preferably Google Chrome), type the following URL to access

the Catalog for CustomerService:

http://localhost:8810/SportsInc/static/CustomerService.json

b. You should see the following:

c. In the browser, type the following URL to access the data for

CustomerService:

d. http://localhost:8810/SportsInc/rest/CustomerService/Customer

e. You should see the following:

Page 11: Guided Exercise 1.1: Setting up the sample OpenEdge Data ... · Guided Exercise 1.1: Setting up the sample OpenEdge Data Object Services, Steps Steps, Part 1—Starting the Database

f. In the browser, type the following URL to access the Catalog for the

SportsIncService:

http://localhost:8810/SportsInc/static/SportsIncService.json

g. You should see the following:

h. In the browser, type the following URL to access the data for

SportsIncService:

http://localhost:8810/SportsInc/web/pdo/SportsIncService/Employee

i. You should see the following:

Page 12: Guided Exercise 1.1: Setting up the sample OpenEdge Data ... · Guided Exercise 1.1: Setting up the sample OpenEdge Data Object Services, Steps Steps, Part 1—Starting the Database
Page 13: Guided Exercise 1.1: Setting up the sample OpenEdge Data ... · Guided Exercise 1.1: Setting up the sample OpenEdge Data Object Services, Steps Steps, Part 1—Starting the Database

Guided Exercise 1.1: Setting up the sample OpenEdge Data Object Services, Wrap-up

Exercise summary

In this Guided Exercise you extracted the database files for the sample application

and started the Database Server for the Sports3000 database. Then you imported the

ABL Web App project that contains the pre-written OpenEdge Data Object Service

code into Progress Developer Studio for OpenEdge and modified some workspace

configuration settings. Finally, you deployed the OpenEdge Data Object Services to

an instance of PAS for OpenEdge, which is the application server that hosts the

sample application. These deployed OpenEdge Data Object Services will be the

source of the data for the web app you create in this course.