Copyright © 2008 Skyway Software
Abstract
This document is a step-by-step guide on how to develop a web application from scratch using Skyway Builder. This tutorial is the first tutorial in a series of tutorials that are available from the Skyway Community Portal.
Table of Contents
List of Figures
List of Tables
Table of Contents
Welcome to the Introduction to Skyway Builder tutorial. This document is a step-by-step guide on how to develop a web application from scratch using Skyway Builder. This tutorial is the first tutorial in a series of tutorials.
This tutorial will introduce new users to application development using Skyway Builder through the development and deployment of a simple web application.
This tutorial is intended for developers with familiarity with Java-based web development and Eclipse. It is assumed that the developer has basic experience with running a JEE Application Server and a database management system.
The prerequisites completing this tutorial are
Skyway Builder 6.0 Community Edition or Skyway 6.0 Enterprise Edition
Java Application Server: Apache Tomcat 6.0
Database Management System (DBMS): Postgres 8.1 -or- MySQL 5.1 Database
The setup of the application server and database management system is beyond the scope of this tutorial. If you need assistance setting up a sandbox which includes Tomcat and MySQL, please see refer to the Skyway Builder Sandbox Setup guide or Video Tutorial that can found in the Resources section of the Skyway Community Portal.
The goal of this tutorial is to provide a step-by-step example of building a web application using Skyway Builder. Skyway Builder CE is a subset of the development functionality, and this tutorial isn't making use of any of the additional Skyway Builder EE features. So this tutorial is applicable to all versions of Skyway Builder (CE and EE). While it is intentionally limited in scope, it introduces new users to application development using Skyway Builder.
The web application that will be implemented is a tool for managing the performance reviews of team members, and the application is called Performance Appraisal Management (PAM).
Here's a description of the requirements of PAM using user stories:
User Stories
Reviewer can list all performance appraisals.
Reviewer can add a performance appraisal.
An appraisal has employee first name, last name, and employee number.
An appraisal covers three topics: design, programming, testing.
A optional comment can be included for each appraisal.
There are three appraisal ratings: 3-does not meet expectations, 2-meets expectations, 1-exceeds expectations.
If you need help, there is a forum on the Skyway Community portal dedicated to the Skyway Tutorials.
Application development using Skyway Builder is accomplished by using (assembling and configuring) graphical development artifacts:
Summary of Skyway Development Artifacts
Projects are the top level artifact within the developer's workspace. All other objects must be made within projects but can access objects within and across project boundaries.
Data Types are used to define the domain model. Developers can specify standard primitive types for the fields within a Data Type and can also specify relationships to other Data Types and their cardinality.
Data Stores are abstract representations of real databases that are used in the modelling environment when persistence is needed. During deployment Data Stores are bound to a real, physical implementation of a database.
Services are used to implement the Service layer of an application.
Operations are discrete application functions defined in a Service.
Actions are the model-based implementation of application. Actions are created by sequencing Steps together.
Web Controllers are used to implement the Web layer of an application, and they have one or more Conversations.
Web Conversations are task-based groupings of logic for handling user event. Conversations are implemented using Actions.
Views are Java Server Pages (JSP) that implement the Presentation layer.
Exceptions are definitions of certain types of errors that the developer may want to surface as the models become code and are executed.
This application will implemented in three layers:
The web layer (also referred to as the UI layer) is primarily concerned with presenting the user interface and handling user interactions/events. The Skyway artifacts for implementing the web layer are the Web Controller, Web Conversation, Action, Steps and JSP pages.
The service layer (also referred to as the logic layer or business layer) represents the core functionality of the application being built. The Skyway artifacts for implementing the service layer are the Service, Operation, Action, and Steps.
The data layer (also referred to as the persistence layer or domain object layer) is represented by a domain model; a distinct set of inter-related application objects that embody the functionality and characteristics of the system being built. This layer also encompasses the persistence of the domain model to and from a database. The Skyway artifacts for implementing the data layer are the Data Type and Data Store artifacts.
End-User View of Application
Step 1: End-user goes to index.jsp, the starting page of the application. From here the user will see a list of performance appraisals in the database. There is also a "New Appraisal" hyperlink that the user can click on to start the new appraisal process.
Step 2: Clicking on the "New Appraisal" hyperlink loads edit.jsp, the appraisal entry form. The end-user enters all the data, and clicks the "Next" button.
Step 3: After clicking on the "Next" button, then appraisal will be validated on the server. If the appraisal passes validation, the confirm.jsp page will load. If the appraisal doesn't pass validation, the edit.jsp will be reloaded.
Step 4: From the confirm.jsp page, the end-user will confirm that the appraisal should be submitted to PAM system.
Step 5: Upon a successfull save, the user will be returned to the index.jsp page.
Developer View of Application using Skyway Builder
Step 1: Prior to the page rendering, there is some data loading and variable housecleaning (clearing data) that needs to occur. This is implemented in the InitConversation action. The URL Action Mapping (UAM) is configured to fire the InitConversation action prior to the /home page (index.jsp) page being rendered.
Step 2: The "New Appraisal" hyperlink on the index.jsp page is configured with a URL that is mapped by the UAM to call the InitNewAppraisal action. This action will initialize variables, and upon completion the UAM will defer to the /edit page (edit.jsp) to render the view (or response).
Step 3: The end-user will press the "Next" button when finished filling in the appraisal form. The "Next" button is configured with a URL that is mapped by the UAM to call the ValidateAppraisal action. This action will verify that all the required appraisal details were specified by the end-user. This action can go to one of two pages based on the result of the validation logic. This is accomplished with a project variable that the UAM uses to determine the view. If the appraisal passes validation, the action will set the project variable to /confirm page (confirm.jsp). If the appraisal doesn't pass validation, the action will set the project variable to the /edit page (edit.jsp).
Step 4: The "Confirm" button on the confirm.jsp page is configured with a URL that is mapped by the UAM to call the SaveAppraisal action. This action will call the SaveAppraisal operation (which will persist the appraisal).
Step 5: Upon completion the UAM will reload the /home page (index.jsp).
Use the following Skyway Navigator screenshot as a guideline for implementing the project
![]() |
Application development with Skyway Builder generally consists of five steps, and the tutorial is structured according to these steps.
![]() |
High-level Development Steps Defined
Project - create a project
Data Layer - define the data layer
Services Layer - define the service layer
Web Layer - define the web layer
Deploy - deploy the project
Please refer to the Skyway Builder Developer Guide for a more detailed explanation of these development steps.
Table of Contents
![]() |
This chapter will outline the steps for creating the PAM project.
Projects are the top level development artifact within Skyway Builder. All other Skyway artifacts must reside inside a project. In many cases (as is the case with PAM) a web application is implemented as a single project, with the project containing any and all artifacts needed to provide its functionality. Since a project can reference development artifacts in other projects, there are cases where an application consists of multiple projects.
Steps:
Right click in Skyway Navigator, and select New-->Project
From the New Project Wizard, pick "Skyway Project" from the "Skyway" folder. This will open the Create Skyway Project Wizard, which is used to specify name, location and sub-folders to be used for the project.
Configure the Create Skyway Project Wizard as follows:
Table 2.1. Project Wizard Configuration
| Panel | Field | Value |
|---|---|---|
| Skyway Project | Project Name: | PAM |
| Skyway Project | Use default location: | yes (default) |
| Folder Names | Folder to create for web content: | WebContents (default) |
| Folder Names | Folder to create for models: | models (default) |
When done, click Finish.
You now have a Skyway project that you can version control using Eclipse, just like any other Eclipse project.
Project variables are variables that are available to any and all project artifacts. Project variables are session scoped, so they exist for the life of the user session.
For the PAM project we will define one variable (page) for dynamic page navigation. In certain parts of the implementation we will use this variable to control page flow.
Steps:
Open the Project Editor by double-clicking on the PAM project icon. Switch to the Variables tab, which is located along the bottom of the editor, and add variables per the following table. As you add variables, the type picker will show you the Skyway Basic types plus any data types defined in any open Skyway projects.
Save the project using File-->Save.
Table of Contents
![]() |
The data layer (also referred to as the persistence layer or domain object layer) is represented by a domain model; a distinct set of inter-related application objects that embody the functionality and characteristics of the system being built. This layer also encompasses the persistence of the domain model to and from a database. The Skyway artifacts for implementing the data layer are the Data Type and Data Store artifacts.
This chapter will outline the steps for implementing the data layer for PAM.
A Skyway Service is a container for data and logic artifacts. This task entails creating data artifacts. Defining logic will done in a later task
Steps:
Right click on PAM project, and select New-->Service
From the New Skyway Service Wizard, enter "AppraisalService" for the filename. This will be the name of the new service. The container for this service should be the project (PAM). If the project is not highlighted, then select the project.
When done, click Finish.
Data Types are used to define domain objects that will be utilized within an application. You can add object attributes by using the basic data types, and you can also specify relationships to other Data Types and their cardinality.
Steps:
Righ click on the AppraisalService service, and select New-->Data Type
From the New Data Type Wizard, enter "Appraisal" for the filename. This will be the name of the new data type. The container for this data type should be the service (AppraisalService). If the service not highlighted, then select the service.
When done, click Finish. This will open the Data Type editor.
From the Overview tab of the Data Type editor, add the following fields.
Table 3.1. Data Type: Appraisal Fields
| Display Name | Type | Primary Key |
|---|---|---|
| employeeNo | Text | Yes |
| lastName | Text | |
| firstName | Text | |
| ratingDesign | Integer | |
| ratingProgramming | Integer | |
| ratingTesting | Integer | |
| comments | LargeText |
Save the data type using File-->Save. You may also close the editor.
Data Stores are abstract representations of real databases (or persistence mechanisms), and they manage persistence for a set of data types. When designing the models there is no need to know the detail of the database (vendor, version, IP, etc.), but simply a need to know that one exists for modeling database activity. When models are deployed, the developer late binds each Data Store to a real, physical implementation of a database.
Steps:
Right click on the AppraisalService service, and select New-->Data Store
From the New Data Store Wizard, enter "AppraisalDS" for the filename. This will be the name of the new data store. The container for this data type should be the service (AppraisalService). If the service not highlighted, then click on it before clicking Next to go to the next panel.
From the Add Data Type panel, click the Add button, and select the "Appraisal" data type from the Data Types list.
When done, click Finish. This will open the Data Store editor.
On the Database Configuration tab the database connection should be defaulted to the data connection you created when you performed the Sandbox setup prerequisites. Per the sandbox setup guide, the db connection is called SkywayDB. If you haven't created a connection yet, you can create a new connection from here.
Save the data store using File-->Save.
Table of Contents
![]() |
The service layer (also referred to as the logic layer or business layer) represents the core functionality of the application being built. The Skyway artifacts for implementing the service layer are the Service, Operation, Action, and Steps.
This chapter will outline the steps for implementing the service layer of PAM.
For the PAM project there is only one operation in the service layer. The SaveAppraisal operation is intended to handle all persistence logic associated with saving an appraisal. For the tutorial the logic is very basic; the appraisal will simply be persisted to a database. However as the application requirements change in the future, you can add additional functionality (i.e. checking for duplicate entries, sending email notifications, updating HR system).
Service functions are specified as Operations, which represent stateless application logic. In addition to a name and description, the operation definition consists of an operation interface and operation resources. The actual application logic of an operation is implemented using Actions (which will be covered in a later task).
In the case of PAM, the approval logic is implemented as a Service. It could have been implemented in the web layer, but it would have (a) limited the reusability of the logic, and (b) not given you a chance to implement a Service.
Steps:
Right click on the AppraisalService service, and select New-->Operation
Configure the Create Skyway Project Wizard as follows:
Table 4.1. Operation Wizard Configuration: SaveAppraisal
| Panel | Field | Value |
|---|---|---|
| New Skyway Operation | File Name: | SaveAppraisal |
| Entry Point Action | Create an entry point action: | yes (default) |
| Entry Point Action | Action Name: | Save |
When done, click Finish. This will open the Operation editor.
The operation name will be used when referencing this operation from elsewhere in the application.
Depending on the amount of functionality in an operation, an operation can be implemented with one or more actions. In the event there's multiple actions, one of the actions must be defined as the entry point. When you initially create an operation, you can have the initial action automatically created for you, and you can also have the action preconfigured as the entry point.
Inputs and Output variables partly define the operation contract. When another application artifact wants to call an operation, it must pass in the input variables and accept the output variables.
In the case of the SaveAppraisal action, the input will be an appraisal object, and there are no outputs.
Steps:
From the Inputs/Outputs tab of the Operation Editor, add an input variable per the following table. Adding variables is very similar to adding variables to a project. As you add variables, the type picker will show you the Skyway Basic types plus the data types of any open Skyway projects.
Save the operation using File-->Save.
While the operation defines the interface and resources needed for an application function, the functionality is actually implemented using Actions. The developer defines the logic to be performed by sequencing steps together.
Adding actions to the an operation is normally accomplished by right-clicking on the Operation, and selecting "New-->Action". However during the creation of the operation, we were given the option to have an action automatically created and preconfigured as the entry point. If you expand the SaveAppraisal operation, you will see the "Save" action.
Steps:
Open the Save action by double-clicking on the action in the Skyway Navigator. This will open the Action editor.
From here you will model the implementation of the operation. In this case the operation will be implemented with one step, so it can be modeled using only the entry-point action. However in other cases, as described earlier, you may choose to decompose the logic into multiple actions that are strung together by the entry-point action.
To implement the Action, open the step palette.
Implementing the Action consists of dropping the desired steps onto the canvas, configuring the steps (properties), and stringing the steps together into a flow. Click on the Modify Data Store step and then click on the canvas. Repeat this for all the steps listed in the following table.
Once the steps are added the canvas, you can configure the steps by double-clicking on the step to open the step properties. Configure the step properties using the following table as a reference.
Table 4.3. Action Implementation: Save Action
| Step Name | Step Type | Configuration | |
|---|---|---|---|
| Persist Appraisal |
![]() |
Properties-->Modify Tab
|
|
| Stop |
![]() | ||
| Note | Optional Text: "This action persists the appraisal to the data source." | ||
To connect the steps, click on the Connector in the palette, click on the first step (Persist Appraisal) and drag to the second step (Stop).
![]() |
Save the action using File-->Save.
Table of Contents
![]() |
The web layer (also referred to as the UI layer) is primarily concerned with presenting the user interface and implementing the behavior of the application. The Skyway artifacts for implementing the web layer are the Web Controller, Web Conversation, Action, Steps, and JSP pages.
This chapter will outline the steps for implementing the web layer of PAM.
The web layer of the PAM application is implemented using a variety of different Skyway artifacts, and the user interface is implemented using JSP pages. During the flow of the application, control will be passed back-and-forth between Actions and JSP pages. As an action performs it's function, a corresponding JSP page will render the response. Rather than hard-coding references to specific JSP pages from the Actions, which is generally regarded a bad practice, a common solution is to define and use aliases to JSP pages. View mappings are the mechanism for defining and associating aliases to JSP pages. When an Action needs to reference a JSP page, it references an alias to the page instead of the actual JSP page.
Before we can define the aliases, we must first create the JSP pages. The JSP pages won't actually be implemented until the next chapter.
Steps for creating index.jsp:
Right click on WebContent folder, and select New-->JSP. This will open the New JavaServer Page Wizard.
Enter index.jsp as the filename, and click the Next button.
Select Skyway JSP File (html) as the template, and click the Finish button.
Steps for creating edit.jsp:
Create another JSP page called edit.jsp using Skyway JSP File (html) as the template.
Steps for creating confirm.jsp:
Create another JSP page called confirm.jsp using Skyway JSP File (html) as the template.
To create a View Mapping, double click the PAM project to bring up it’s properties. Then select the View Mappings tab on the bottom.
The following figure shows how the view mappings are configured to associate an alias with an actual JSP page. Start by adding (Add...) each JSP page as a View Resource and specify the alias to be associated with the JSP page.
As described earlier Web Controllers are used along with the JSP pages (located in the WebContent) to implement the Web layer of an application. The JSP pages represent the View in MVC, and Web Controllers represent the Controller in MVC. Per the project meta-data model, a Web Controller can have one or more Web Conversations, which will be described in a subsequent task.
Steps:
Right click on PAM project, and select New-->Web Controller
From the New Web Controller Wizard, enter "PAMController" for the filename. This will be the name of the new web controller. The container for this web controller should be the project (PAM). If the project is not highlighted, then select the project.
When done, click Finish.
A Web Conversation facilitates the grouping of processing logic around application tasks, which is typically comprised of a series of steps between the end-user and the application. Therefore each application task is implemented as it's own conversation, and each conversation contains the variables, constants, and Actions needed to orchestrate the task and support the user events associated with the task. These types of Web Conversations will typically be session scoped. When the task is done, the conversation state can be discarded using the Clear Conversations step.
Steps:
Right click the on PAMController web controller, and select New-->Web Conversation
From the New Web Conversation Wizard, enter "PerformanceMgmt" for the filename. This will be the name of the new web conversation. The container for this web conversation should be the web controller (PAMController). If the web controller is not highlighted, then select the web controller.
When done, click Finish. This will open the Web Conversation editor.
Web Conversation variables are the variables used by Actions. All actions in a Web Conversation share the same variables. This reinforces the concept of a conversation being oriented around an application task or function where different steps in the task will need to share variables and state. In the case of PAM there will be two variables. One variable (appraisals) is for holding all appraisals for the purpose of listing on the front page, and another variable (currentAppraisal) is for storing the appraisal details entered by the end user.
Steps:
From the Variables tab of the Web Conversation Editor, add variables per the following table. As you add variables, the type picker will show you the Skyway Basic types plus any data types in Skyway projects.
Table 5.1. Conversation Variables: PerformanceMgmt
| Name | Type | Collection | Public |
|---|---|---|---|
| currentAppraisal | Appraisal | No | Yes |
| appraisals | Appraisal | Yes | Yes |
Save the conversation using File-->Save.
Actions in the context of a web conversation (as opposed to a service operation) implement the logic for handling user-generated events. The developer defines the logic to be performed by the action by sequencing steps together.
The first action, InitConversation, is intended to do some housecleaning. Since the end-user dictates the flow of the application, the state of the application cannot be assumed. Therefore this action is intended to assure that the application is in a predetermined state. Prior to loading the index page and listing all current appraisals, the appraisals should be loaded into the appraisals variable.
When this action is created, a partially configured URL Action Mapping will also be created. In a later section we will complete the configuration of the URL Action Mapping to fire prior to displaying the index page.
Steps:
Right click the on PerformanceMgmt web conversation, and select New-->Action
From the New Action Wizard, enter "InitConversation" for the filename. This will be the name of the new action. The container for this action should be the web conversation(PerformanceMgmt). If the web conversation is not highlighted, then select the web conversation.
When done, click Finish. This will open the Action editor.
From here you will model the implementation of the action. Implementing the Action consists of dropping steps onto the canvas, configuring the steps, and stringing the steps together into a flow. The following diagram shows the implementation of the InitConversation action.
In this case there are only two steps. Once a step is added the canvas, you can configure the step by double-clicking on the step to open the step properties.
Table 5.2. Action Implementation: InitConversation Action
| Step Name | Step Type | Configuration | |
|---|---|---|---|
| Retrieve All Appraisal |
![]() |
Properties-->Select Data Store Info
Properties-->Search Criteria
Properties-->Sort Fields
|
|
| Stop |
![]() | ||
| Note | Optional Text: "This action persists the appraisal to the data source." | ||
A Note can be optionally added to an action to describe the functionality of the action.
The InitNewAppraisal action is intended to prepare the conversation for creating a new appraisal. When the "New" hyperlink is clicked by the end-user, the InitNewAppraisal action will be invoked, which will create a new appraisal object to make sure that any data that may have been previously entered by the end-user is discarded.
Steps:
Right click the on PerformanceMgmt web conversation, and select New-->Action
From the New Action Wizard, enter "InitNewAppraisal" for the filename. This will be the name of the new action. The container for this action should be the web conversation(PerformanceMgmt). If the web conversation is not highlighted, then select the web conversation.
When done, click Finish. This will open the Action editor.
From here you will model the implementation of the action. Implementing the Action consists of dropping steps onto the canvas, configuring the steps, and stringing the steps together into a flow. The following diagram shows the implementation of the InitConversation action.
![]() |
In this case there are only two steps. Once a step is added the canvas, you can configure the step by double-clicking on the step to open the step properties.
Table 5.3. Action Implementation: InitNewAppraisal Action
| Step Name | Step Type | Configuration | |
|---|---|---|---|
| New Appraisal |
![]() |
Properties-->Variable Editor
Insert the currentAppraisal variable using the Insert Variable button, and then press the Reset button. The Reset button will append the "= RESET" to the expression. |
|
| Stop |
![]() | ||
| Note | Optional Text: "This action persists the appraisal to the data source." | ||
A Note can be optionally added to an action to describe the functionality of the action.
The ValidateAppraisal action is responsible for validating the appraisal data that was entered by the end-user. In this implementation the validation logic is very basic. The only thing that is being verified is that an employeeNo is specified. Based on the evaluation of the appraisal object, this action will direct the end-user either to the /confirm page (alias) or back to the /edit page (alias). In contrast with the other actions in the PerformanceMgmt conversation which go to one and only one page, the next page will be determined by the page project variable which will be set with a page alias.
Steps:
Right click the on PerformanceMgmt web conversation, and select New-->Action
From the New Action Wizard, enter "ValidateAppraisal" for the filename. This will be the name of the new action. The container for this action should be the web conversation (PerformanceMgmt). If the web conversation is not highlighted, then select the web conversation.
When done, click Finish. This will open the Action editor.
From here you will model the implementation of the action. Implementing the Action consists of dropping steps onto the canvas, configuring the steps, and stringing the steps together into a flow. The following diagram shows the implementation of the InitConversation action.
In this case there are only two steps. Once a step is added the canvas, you can configure the step by double-clicking on the step to open the step properties.
Table 5.4. Action Implementation: ValidateAppraisal Action
| Step Name | Step Type | Configuration | |
|---|---|---|---|
| Required Fields Specified? |
![]() |
Properties-->Decision Criteria
|
|
| Proceed to Confirm Page |
![]() |
Properties-->Variable Editor
|
|
| Proceed to Edit Page |
![]() |
Properties-->Variable Editor
|
|
| Stop |
![]() | ||
| Note | Optional Text: "This action persists the appraisal to the data source." | ||
A Note can be optionally added to an action to describe the functionality of the action.
This action handles the logic when the user clicks on the "Next" button, in which case the validated appraisal object should be persisted. This action defers to the Save Appraisal operation that was created in chapter 4. This action will also invoke the InitConversation action which is responsible for getting the application back to the starting state.
Steps:
Right click the on PerformanceMgmt web conversation, and select New-->Action
From the New Action Wizard, enter "SaveAppraisal" for the filename. This will be the name of the new action. The container for this action should be the web conversation(PerformanceMgmt). If the web conversation is not highlighted, then select the web conversation.
When done, click Finish. This will open the Action editor.
From here you will model the implementation of the action. Implementing the Action consists of dropping steps onto the canvas, configuring the steps, and stringing the steps together into a flow. The following diagram shows the implementation of the InitConversation action.
In this case there are only two steps. Once a step is added the canvas, you can configure the step by double-clicking on the step to open the step properties.
Table 5.5. Action Implementation: SaveAppraisal Action
| Step Name | Step Type | Configuration | |
|---|---|---|---|
| Invoke Save Appraisal Operation |
![]() |
Properties-->Operation
Properties-->Inputs
Properties-->Outputs
|
|
| Invoke InitConversation Action |
![]() |
Properties-->Operation
|
|
| Stop |
![]() | ||
| Note | Optional Text: "This action persists the appraisal to the data source." | ||
A Note can be optionally added to an action to describe the functionality of the action.
The user interface is implemented using JSP pages, which were created at the beginning of the chapter. The WebContent folder holds all JSP pages and web-related resources, including javascript libraries, stylesheets, flash controls, and images. Skyway provides a palette of web controls to build user interfaces. The web controls can be wired to the Web Controller and associated Web Conversations that were defined in an earlier section. Each web control has it's own properties panel for configuring.
You can further augment Skyway's web controls with the additional functionality available from JSP.
The following figure shows how the index.jsp page will look to the end-user of PAM.
Steps for implementing index.jsp:
The pages are comprised of a combination of html and Skyway web controls. Using the Web Control palette, build the page according to the following listing. Following the listing there is a description of key web controls and their configuration.
Skyway Form ( <skyway:form> ) - used to define a form. The action attribute is configured with "/PAM/PAMController/PerformanceMgmt/InitNewAppraisal", the fully qualified path of the web conversation action that will be invoked when the form is posted.
<skyway:form action="/PAM/PAMController/PerformanceMgmt/InitNewAppraisal"> ...Form Contents... </skyway:form>
Skyway Button ( <skyway:button> ) - used to provide the user a button to click. The label attribute is configured with "New", the title of the button. To configure the button to submit the form, the type should be set to "submit".
<skyway:button label="New" type ="submit"></skyway:button>
Skyway Iterator ( <skyway:iterator> ) - used to define a fragment that should be repeated for as many objects that exist in the collection. This is very useful for listing the contents of a collection. The items attribute is configured with "PAMController.PerformanceMgmt.appraisals", the variable collection that should be iterated. The var attribute is configured to "current", a variable that is used by embedded web controls (see label) to reference an individual object as the collection is iterated.
<skyway:iterator items="${PAMController.PerformanceMgmt.appraisals }" var="current">
</skyway:iterator>
Skyway Label ( <skyway:label> ) - used to output the value of a variable. The value attribute is configured with the variable that should be output. Since this label is referencing a variable from an iterated collection, the variable is referenced as "current.", the var attribute from the iterator web control.
<skyway:label value="${current.employeeNo}"></skyway:label>
Figure 5.25. index.jsp - full listing
<%@taglib uri="http://www.skywaysoftware.com/taglibs/core"
prefix="skyway"%><%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<skyway:form action="/PAM/PAMController/PerformanceMgmt/InitNewAppraisal">
<skyway:button label="New" type ="submit"></skyway:button>
</skyway:form>
<table>
<tr>
<td>Employee No</td>
<td>Last Name</td>
<td>First Name</td>
<td>Design</td>
<td>Program</td>
<td>Test</td>
<td>Comments</td>
</tr>
<skyway:iterator items="${PAMController.PerformanceMgmt.appraisals }" var="current">
<tr>
<td><skyway:label value="${current.employeeNo}"></skyway:label></td>
<td><skyway:label value="${current.lastName}"></skyway:label></td>
<td><skyway:label value="${current.firstName}"></skyway:label></td>
<td><skyway:label value="${current.ratingDesign}"></skyway:label></td>
<td><skyway:label value="${current.ratingProgramming}"></skyway:label></td>
<td><skyway:label value="${current.ratingTesting}"></skyway:label></td>
<td><skyway:label value="${current.comments}"></skyway:label></td>
</tr>
</skyway:iterator>
</table>
</body>
</html>
The following figure shows how the edit.jsp page will look to the end-user of PAM.
Steps for implementing edit.jsp:
Using the Web Control palette, build the page according to the following listing. Following the listing there is a description of key web controls and their configuration.
Skyway Form ( <skyway:form> ) - used to define a form. The action attribute is configured with "/PAM/PAMController/PerformanceMgmt/ValidateAppraisal", the fully qualified path of the web conversation action that will be invoked when the form is posted.
<skyway:form action="/PAM/PAMController/PerformanceMgmt/ValidateAppraisal"> ...Form Contents... </skyway:form>
Skyway Input ( <skyway:input> ) - used to solicit input from the user. The path attribute is the path of the variable that the contents of the input field should be stored.
<skyway:input path="PAMController.PerformanceMgmt.currentAppraisal.employeeNo"></skyway:input>
Skyway Dropdown ( <skyway:dropdown> ) - used to let the user select one of multiple preset values. The path attribute is the path of the variable that the contents of the selected value should be stored.
<skyway:dropdown path="PAMController.PerformanceMgmt.currentAppraisal.ratingDesign"> ...options... </skyway:dropdown><br>
Skyway Option ( <skyway:option> ) - used to specify a preset value for the dropdown control. The label attribute is displayed to the end user, and the value attribute is the value that's submitted for the option.
<skyway:option label="Exceeds Expectations" value="1"></skyway:option> <skyway:option label="Meets Expectations" value="2"></skyway:option> <skyway:option label="Does Not Meet Expectations" value="3"></skyway:option>
Skyway Textarea ( <skyway:textarea> ) - used to solicit input from the user. The path attribute is the path of the variable that the contents of the input field should be stored.
<skyway:textarea path="PAMController.PerformanceMgmt.currentAppraisal.comments"></skyway:textarea>
Skyway Button ( <skyway:button> ) - used to provide the user a button to click. The label attribute is configured with "Save", the title of the button. To configure the button to submit the form, the type should be set to "submit".
<skyway:button type="submit" label="Next" ></skyway:button>
Figure 5.27. edit.jsp - full listing
<%@taglib uri="http://www.skywaysoftware.com/taglibs/core" prefix="skyway"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<skyway:form action="/PAM/PAMController/PerformanceMgmt/ValidateAppraisal">
Employee No
<skyway:input path="PAMController.PerformanceMgmt.currentAppraisal.employeeNo"></skyway:input>
<br>
Last Name
<skyway:input path="PAMController.PerformanceMgmt.currentAppraisal.lastName"></skyway:input>
<br>
First Name
<skyway:input path="PAMController.PerformanceMgmt.currentAppraisal.firstName"></skyway:input>
<h2>Ratings:</h2>
Design
<skyway:dropdown path="PAMController.PerformanceMgmt.currentAppraisal.ratingDesign">
<skyway:option label="Exceeds Expectations" value="1"></skyway:option>
<skyway:option label="Meets Expectations" value="2"></skyway:option>
<skyway:option label="Does Not Meet Expectations" value="3"></skyway:option>
</skyway:dropdown><br>
Programming
<skyway:dropdown path="PAMController.PerformanceMgmt.currentAppraisal.ratingProgramming">
<skyway:option label="Exceeds Expectations" value="1"></skyway:option>
<skyway:option label="Meets Expectations" value="2"></skyway:option>
<skyway:option label="Does Not Meet Expectations" value="3"></skyway:option>
</skyway:dropdown><br>
Testing
<skyway:dropdown path="PAMController.PerformanceMgmt.currentAppraisal.ratingTesting">
<skyway:option label="Exceeds Expectations" value="1"></skyway:option>
<skyway:option label="Meets Expectations" value="2"></skyway:option>
<skyway:option label="Does Not Meet Expectations" value="3"></skyway:option>
</skyway:dropdown>
<br>
Comments:
<skyway:textarea path="PAMController.PerformanceMgmt.currentAppraisal.comments"></skyway:textarea>
<br>
<skyway:button type="submit" label="Next" ></skyway:button>
</skyway:form>
</body>
</html>
The following figure shows how the confirm.jsp page will look to the end-user of PAM.
Steps for implementing confirm.jsp:
Using the Web Control palette, build the page according to the following listing. Following the listing there is a description of key web controls and their configuration.
Skyway Form ( <skyway:form> ) - used to define a form. The action attribute is configured with "/PAM/PAMController/PerformanceMgmt/SaveAppraisal", the fully qualified path of the web conversation action that will be invoked when the form is posted.
<skyway:form action="${webContextRoot}/PAMController/PerformanceMgmt/SaveAppraisal">
...form...
</skyway:form>
Skyway But