Upload
others
View
0
Download
0
Embed Size (px)
Citation preview
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 1
APEX Workshop – Creating a Service Management Web Application
APEX Version 4.1
Created by: Alexander Guédez Email: [email protected] Doc Version: 1.0 Date: 10/16/2011
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 2
Contents General Workshop Information .................................................................................................................... 3
Virtual BOX - Oracle Linux Virtual Machine .............................................................................................. 3
Oracle APEX 4.1 access ............................................................................................................................. 3
Service Management Application Background ............................................................................................. 4
Logging in Oracle APEX Workspace .............................................................................................................. 5
Taking notice of the APEX Development environment ............................................................................ 5
Creating Your Application Tables (Database) ............................................................................................... 6
Creating Your Database Application ........................................................................................................... 10
Running your Application for the First Time ............................................................................................... 17
Modifying Fields in your Application .......................................................................................................... 19
Modifying the Application Reporting Environment .................................................................................... 32
Adding more information to your Database Tables ................................................................................... 37
Example 1 ................................................................................................................................................ 37
Example 2 ................................................................................................................................................ 38
Interactive Report Tip ................................................................................................................................. 39
GB Advisors, Inc. ......................................................................................................................................... 40
Contact Us ............................................................................................................................................... 40
Errata ....................................................................................................................................................... 40
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 3
General Workshop Information
Virtual BOX - Oracle Linux Virtual Machine username: root
password: oracle
Oracle APEX 4.1 access URL: http://192.168.56.101:8080/apex
Workspace: ORACLE
User: ADMIN
Password: oracle
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 4
Service Management Application Background
We wish to create an application that manages all types of service tickets. This application should store
the following service tickets information:
Service #
Service Title
Service Category
Contact Information (Name, email, phone number)
Description of the Service
Resolution
Created date
Resolved date
Last modified by
Last modified date
Additionally the web application should be password protected and have a login page to access the
application.
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 5
Logging in Oracle APEX Workspace
Open a browser (Chrome, Firefox or explorer) and Login into Oracle Application Express using the URL:
http://192.168.56.101:8080/apex
For the login information use the following:
Workspace: ORACLE
Username: ADMIN
Password: oracle
Click on the Login button.
Taking notice of the APEX Development environment
After successfully logging in, you are redirected to the APEX development environment. Navigate some
of the pages to get the feeling of the environment. After you are done click on the Home tab to go back
to the APEX home page.
Application Builder
o (Create, Edit, Import, Export & Delete applications)
SQL Workshop
o (All related database actions)
Team Development
o (Software development task manager and maintenance )
Administration
o (Workspace Administration, users, monitor of activities)
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 6
Creating Your Application Tables (Database)
Development of Applications starts at the database level first. After carefully gathering the requirements
about the functionality and data you wish to store in the new application, we can start creating our
tables
Click on the menu SQL Workshop > Object Browser
Click on Create > Table
Table Definition
Below you will find the table column definition that we will use for our application.
Table Name: GB_SERVICES
Column Name Datatype
SERV_ID NUMBER Not Null
SERV_TITLE VARCHAR2(100) Not Null
SERV_CAT VARCHAR2(50)
CONTACT_NAME VARCHAR2(100)
CONTACT_EMAIL VARCHAR2(100)
CONTACT_PHONE VARCHAR2(20)
SERV_DESC VARCHAR2(4000)
SERV_RESOLUTION VARCHAR2(4000)
SERV_DATE DATE
SERV_RES_DATE DATE
LAST_MODIFIED_BY VARCHAR2(100)
LAST_MODIFIED_DATE DATE
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 7
Fill out the information for your new table
Click Next >
Primary Key
From radio button Select Primary Key: Populated from a new sequence
From drop list Select Primary Key: SERV_ID(NUMBER)
Click Next >
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 8
Foreign Keys
We have no need for foreign keys at this moment
Click Next >
Constraints
Click Next >
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 9
Create Table
Click Create >
Review Table
Review the Created table and click on the properties tabs of the table and review the results (Table,
Data, Indexes, Model, etc.)
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 10
Creating Your Database Application
After we have created our table GB_SERVICES we can move to the User Interface (UI). In this section we
create the Application.
Click on the menu SQL Workshop > Object Browser
Creating an Application
Click Create >
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 11
Types of Applications
Select the type of application you wish to create. Regularly it will be a Database Application.
Select from the radio buttons: Database
Click Next >
Application Precedence
We are creating an application from “0” meaning scratch. If you had an Excel spreadsheet Oracle APEX
could create a functional application from it in just a couple of simple steps. However this is not part of
this workshop.
Select from the radio buttons: From Scratch
Click Next >
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 12
Application Name and ID
Let’s assign a Name and unique ID to our application. It is required by APEX that the Application ID
should be unique.
Write in form field “Name”: GB Service Management
Write in form field “Application”: 300
Click Next >
Adding Pages to the Application
During the application creation process we can create a couple of pages of our application.
Select from the “Add Page” section radio buttons: Report and Form
Select from form field “Table Name”: GB_SERVICES
Click Add Page >
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 13
The resulting page should look like this
Click Next >
Adding Navigation Tabs to the Application
Select from the radio buttons: One Level of Tabs
Click Next >
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 14
Copy Shared Components from another Application
Click Next >
Select Authentication Scheme, Date and Language Preferences
Click Next >
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 15
Selecting a Theme for your Applications Look and Feel
Here you can select a customized look and feel for your application. We have selected theme – 23.
Scroll to the end of the Page
Select from radio buttons: Theme - 23
Click Next >
Final Review
Click Create >
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 16
The resulting page should look like this. If take a close look you will find that the application creation
process has automatically build for us 3 pages:
Page 1: Gb Services
o Search and reports page that will be our home page.
Page 2: Gb Services
o A form page to input, update and delete data from the database table.
Page 101: Login
o Login page with username and password.
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 17
Running your Application for the First Time
After completing the creation of the application we wish to run the application to see the final result. To
accomplish this we click on the large icon called “Run Application”
Click on the “Sub Menu Icon”: Run Application
Entering your Application Credentials
During the application creation process we can create a couple of pages of our application.
Write in form field “Username”: admin
Write in form field “Password”: oracle
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 18
Navigating the GB Services Application
This is you Page 1 in your application also referred as Home Page. Notice that in the Home Page we have
created a report with a search box automatically during the creation of the application. Let’s navigate to
the next page that was created automatically.
Click Create >
This is our Page 2, this page will help us insert, delete and update information from our database table.
Please take a closer look at the navigation buttons at the bottom of this page. During the process of
programing this buttons appear in all pages as quick links for a faster development.
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 19
Modifying Fields in your Application
Let’s enable the “Edit Links” in our application to make changes quicker on the page items.
On the “Bottom Menu” click: Show Edit Links
Now we will edit the item definition of our field. By clicking on the yellow icon on the right side of the
item, a new popup window will appear with the detailed information of our item. Don’t close the
original window with the form, please maintain both windows opened.
Click on the Yellow Icon located on the right side of the “Serv Title”.
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 20
Changing an Item Appearance
We now will modify the visible length of the Item “Serv Item” (P2_SERV_TITLE) and make the value of
the Item required.
In the “Displayed” section write in form field “Width”: 100
In the “Settings” section select from drop list field “Value Required”: Yes
Click Apply Changes
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 21
Reviewing Changes
To review the changes go to the original form window (Page 2 of our application) and click on the
browser “Refresh” button to see the changes on our form item. Let’s continue with the changes of our
other items.
In the Original Gb Services form window of our application click “Refresh” on the browser window
Click on the Yellow Icon located on the right side of the “Serv Cat”.
In the “Page Item” section select from drop list field “Display As”: Select List
In the “List of Values” section click on the link: Create or edit status List of Values
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 22
In the “Static List of Values” section write the information of the ticket types:
IT Ticket / Telephony
Facilities Management
Human Resources
Click Apply
Review the item changes and submit the information.
Click Apply Changes
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 23
Click on the Yellow Icon located on the right side of the “Serv Desc”.
In the “Page Item” section select from drop list field “Display As”: Textarea
In the “Displayed” section write in form field “Width”: 100
In the “Displayed” section write in form field “Height”: 4
Click Apply Changes
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 24
In the Original Gb Services form window of our application click “Refresh” on the browser window
Click on the Yellow Icon located on the right side of the “Serv Resolution”.
In the “Page Item” section select from drop list field “Display As”: Textarea
In the “Displayed” section write in form field “Width”: 100
In the “Displayed” section write in form field “Height”: 4
Click Apply Changes
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 25
In the Original Gb Services form window of our application click “Refresh” on the browser window
Click on the Yellow Icon located on the right side of the “Serv Date”.
In the “Default Value” section write in form field “Default Value (used when both….)”: return sysdate
In the “Default Value” section select from drop list field “Default Value Type”: PL/SQL Function Body
Click Apply Changes
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 26
In the Original Gb Services form window of our application click “Refresh” on the browser window
Click on the Yellow Icon located on the right side of the “Last Modified by”.
In the “Read Only” section select from drop list field “Read Only Condition Type”: Always
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 27
In the Original Gb Services form window of our application click “Refresh” on the browser window
Click on the Yellow Icon located on the right side of the “Last Modified Date”.
In the “Read Only” section select from drop list field “Read Only Condition Type”: Always
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 28
In the Original Gb Services form window of our application click “Refresh” on the browser window
On the “Bottom Menu” click: Hide Edit Links
On the “Bottom Menu” click: Edit Page 2
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 29
In the “Page Processing” section right click on top of “Processes” object and select “Create”.
Select from radio buttons: PL/SQL
Click Next >
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 30
Write in form field “Name”: Assign_security_data
Write in form field “Sequence”: 0
Click Next >
Write in form text area “Enter PL/SQL Page Process”:
:P2_LAST_MODIFIED_BY := :APP_USER;
:P2_LAST_MODIFIED_DATE := SYSDATE;
Click Create Process >
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 31
Click Run >
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 32
Modifying the Application Reporting Environment
Create a record similar or equal to the one created in the screen shot
Fill the Form
Click Create >
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 33
Click on the “Actions” button and select “Select Columns”
Select the columns that you want to appear in your default report.
Click Apply >
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 34
Click on the “Actions” button, under “Format” select “Compute”
Write in form field “Column Heading”: Status
Write in form text area “Computation Expression”: DECODE(J,null,'Open','Closed')
Click Apply >
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 35
Review the new compute column called “Status” in your report .
Click on the “Actions” button and select “Save Report”
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 36
Select from drop list field “Save”: As Default Report Settings
Click Apply >
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 37
Adding more information to your Database Tables
Now is the moment to start adding more records to your database tables, feel free to add all the records
that you wish. Below you will find a couple of examples that you could use. Your GB Service application
is complete. Note: Use some time to look at the Interactive report, it has many features and is very
powerful.
From the Home Page (Gb Services page 1) Click Create
Fill the Form
Click Create >
Repeat steps as deem necessary
Example 1
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 38
Example 2
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 39
Interactive Report Tip
In any point in time you can reset your interactive report by going to the Actions button and clicking on
Reset. This will place your report in the last Saved State.
g b a d v i s o r s
ORACLE APEX Workshop – Creating a Service Web Application
Email: [email protected], Website: http://www.gb-advisors.com
Copyright - GB Advisors, Inc. 2011 40
GB Advisors, Inc.
GB Advisors is a high-level company specialized in the development of integral technical solutions. It was
established in 2004, and currently serves clients in Puerto Rico and the Caribbean. Our personnel’s high
level of expertise, and the quality of our services, has resulted in a rapid increase in the demand for our
solutions, as well as in the diversification of the services we offer.
We boast a highly trained multidisciplinary team, and ample experience in the implementation of
corporate and government solutions. This allows us to deploy customized solutions for a wide variety of
organizations, in all kinds of environments. For more information go to http://www.gb-advisors.com.
Contact Us
At GB Advisors we are at your disposal to answer any questions, inquiries or doubts you may have
regarding the services that we offer.
Our Staff may be reached through the following telephone numbers and e-mail addresses in order to
provide you with the answers that you need.
Sales: [email protected]
Support: [email protected]
Resumes: [email protected]
Telephone: +1 (787) 708-6743
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you
find a mistake in this document—maybe a mistake in the text or the code—we would be grateful if you
would report this to us. By doing so, you can save other readers from frustration and help us improve
subsequent versions of this document. If you find any errata, please report them by
emailing: [email protected] , once your errata are verified, your submission will be accepted and
the errata will be uploaded on our website, or added to any list of existing errata, under the Errata
section of that title.