Professional Documents
Culture Documents
ADP Fundamentals
Module 01
Overview
Module Objectives
Ebase Xi Architecture
Demonstration of an application developed in Ebase Xi
Client / Server environment
Ebase Xi Architecture
Ebase Designer is
a multi-user,
security controlled
GUI
Ebase
Server
Repository
Stores all Ebase
elements
Processes forms
at runtime
Runs design
environment for
Ebase clients
Module Summary
In this module you have learnt about:
Ebase Xi Architecture
Client / Server environment
Starting Ebase Xi Server and Client
Module Review
1. What is the purpose of the Ebase server?
2. What is the purpose of the Ebase Client?
3. What is the Ebase repository?
Lab Exercise
Ebase Xi Version 4
ADP Fundamentals
Module 02
Form Concepts
Module Objectives
High level introduction to:
Forms
Pages
Controls
Fields
Tables
Texts
Languages
External resources, field mappings
Events model
Page sequencing
Introduction
Form:
Introduction
Page:
Introduction
Control: is anything which can be placed on a page
e.g. field control, table control, button control, image control
tabs
text
fields
image
button
menu
Introduction
Field:
Each of these is
a Field control,
Most have a label
Introduction
Table:
Introduction
Texts:
Embedded texts
Languages
A form can support any number of languages
Default language is English (configuration parameter)
At runtime, all texts will be shown in the required language
http://localhost:3030/ufs/ufsmain?formid=MYWORLD&LANGUAGE=EN
External resources
External resources
Allow interchange of data with Ebase form fields, e.g. Form fields may be:
Read from / written to a database
Sent in an email
Mappings
Form fields are mapped to resource fields
Only the mapped fields take part in interchange of data
Mappings
ADP Fundamentals Module 2 - 11
Event Model
Events get fired at various stages throughout form processing
e.g. when the form starts, when user clicks a button etc
Action scripts can be attached to these events
update accounts;
Page Sequencing
A form can contain any number of pages
Form pages follow a sequence
Form
Page 1
Page 2
Page 3
Done
Module Summary
In this module, you have had a High level introduction to:
Forms
Pages
Controls
Fields
Tables
Texts
Languages
External resources, field mappings
Events model
Page sequencing
Module Review
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
Lab Exercise
Ebase Xi Version 4
ADP Fundamentals
Module 03
The Designer
Module Objectives
Upon completion of this module you will know about:
Tree view of the designer
Functions of the designer
Projects
Internationalization
Documentation and help
Importing and exporting elements
Lists
Presentation
Workflow
Integration Server
System
ADP Fundamentals Module 3 - 3
Designer
Can contain any number of open elements
Multiple
open
elements
Basic Functions
Open an existing element
Double click on an element from the tree view
Close an element
Click X in top right-hand corner of the visual editor
Save an element
Click the Save button in the visual editor
Designer Locks
Opening a lock:
Selecting an element from the tree view will open and lock the element
so that other users may not edit the element, but they may view the
element
Closing a lock:
The lock is released by closing the element
When a user exits the Ebase Designer all their locks are released
Only a system administrator can remove locks , using
Tools System Administration Designer Locks
Removing a lock could cause another users element to be overwritten
Users should regularly close elements that are not in use
Project
Project is a collection of:
Forms
Scripts
Messages
Search
Quick search Ctrl-Q or
As characters are entered into the search
box, elements starting with these
characters are shown in the list
Search
Element search Ctrl-Alt-F or
Any combination of the search criteria can
be specified
Wild cards * and ? can be used
Results are displayed in the References
Panel
Double clicking on a displayed element will
open it
Form Editor
Form Editor
Target window size
Synchronize WYSIWYG
view with outline view
Toggle
designer view
Each of the 7
views, except
WYSIWYG,
may be closed,
docked etc.
Right click
Toggle
print view
New fields
wizard
html source
View manager
Undo / Redo
All controls can be dragged onto either the WYSIWYG or Outline views
Controls can be copied or cut from one location and pasted to another
Its also possible to copy from one form and paste into another
When pasting, controls are inserted as the last child of the selected item
Paste is only enabled when the pasted controls can legitimately be added as a
child of the selected item
Undo / Redo
Configure browser
Internationalization
A form can support any number of languages
Default language is English (configured inside UfsSetup.properties)
Languages may be configured using
Tools -> System Preferences -> Internationalization
Internationalization
Elements allowing multiple languages:
All Texts
Form
Shared
System
Messages
Static lists
Formatting language
determines format used for
numbers and dates
Help
General Help
Via the designer drop-down menu
icon, or
Pressing F1
Online Documentation
Searchable Help
Import/Export
Is used for:
Migrating elements from one server to another
Import/Export:
Allows users to import and export all elements
Can export an application with all its related elements
Export
Enter the export file name
Import
Browse available
import files
Import
Select what to
import
Module Summary
In this module you have learnt that:
Ebase elements consist of Business projects, IT elements,
Presentation and a few others
Projects are in turn broken down into form, script, and message
elements
Search is available to locate elements
Every Ebase element can be edited with its own editor
Help is available via the top drop-down menu, the various function
editors, and a browser
Import / export is used for migrating elements from one server to
another
Module Review
1.
2.
3.
4.
5.
IT elements
Scripts
Messages
6. For what purposes might you want to use the import/export facility?
Lab Exercise
Ebase Xi Version 4
ADP Fundamentals
Module 04
Form Design
Module Objectives
Message
Text
Control
Database
Page 1
City
YORK
Field
XML
CITY : YORK
Page 2
Web
Service
Welcome to YORK
Others?
Any text
in the form
ADP Fundamentals Module 4 - 3
Programming
Logic
Fields
Properties View
Allows viewing and changing properties for all controls, pages, fields and
tables
Fields
Editor properties
Label
Help
Field properties
Display length
Date/Time options
Contains HTML Character field types only
NO field controls
Field controls
Surname
Fields
SURNAME
..
Type: char
Label: Surname
Value: Smith
...
..
Smith
Page 2
Field controls
Surname
..
Smith
Control Properties
The general tab lists control properties which are common to most controls
Display only
Hidden
New line
Configure visible
parts of the field
2) Drag a field
control from
the palette to
outline or
WYSIWYG
view
Buttons
Messages
Module Summary
Module Review
1. What is a Field?
Name a few Field properties.
Lab Exercise
Ebase Xi Version 4
ADP Fundamentals
Module 05
Web Page Design 1
Module Objectives
Upon completion of this module you will:
Understand what controls and containers are and their properties
Have a good understanding of layouts
What is a Form
A form contains pages
Form
Page 1
Page 2
Page 3
Field 1
Field 4
Field 2
Field 5
Field 3
Field 6
Field 7
Container
Controls
Containers
Containers
Panel
Is a simple container whose primary purpose is to act as a container for other
controls - controls will be laid out according to the selected layout
Panels are used frequently primarily for applying a specific layout and style to
controls contained within each panel
Layout properties
Once a container is given a layout, an additional property, Layout
properties, is shown.
Interim Review
1.
2.
3.
4.
5.
Column Layout
Each Column Layout has a defined number of columns
Controls are laid out in a grid formation where each control is placed in
the next available table cell
A sample panel with column layout 3 columns
Flow Layout
Similar to no layout allows for gaps and alignment to be configured
Results in successive controls being displayed horizontally across the
page
Window re-sizing by the user effects the point at which output flows onto
the next line
Label
Editor
Help
This is the only layout which enables the New line property for all
controls; when New line is unchecked for control, the control will be
placed on the same line as the previous control
Interim Review
1. What is a layout applied to?
2. What is the purpose of a layout?
3. What is a flow layout?
4. What is a Field Grid?
5. How is a Field control displayed within a Field Grid layout?
6. How are other controls displayed within a Field Grid layout?
7. How is a Field control displayed within a Flow layout?
8. How are other controls displayed within a Flow layout?
9. What happens to the contents of a container with flow layout, when the browser
window is re-sized?
10. How many rows and columns can a container have where the layout is Column?
11. How many rows and columns can a container have where the layout is Vertical?
Understanding width
The width property is used to set an explicit width for a control
Can be %
Understanding width
If the width property of a container control is omitted:
the control will be as wide as it needs to be to accommodate its content
if there is no content, the control will be invisible
no content
Understanding width
It is possible for a control to break out of the width occupied by its parent
Panel Width 400px
Group panel width 100%
Left aligned
Center aligned
Right aligned
Left aligned
Center aligned
Right aligned
Horizontal alignment only has meaning when the containers width is large
enough to accommodate horizontal repositioning of child controls
ADP Fundamentals Module 5 - 26
Block Alignment
Cell Alignment
Left
Left
Center
Center
Right
Right
3 possible ways:
1) Use the Gaps Between Controls property
Applies to all controls within a container
Available in Horizontal box Layout, Vertical Box Layout and Flow Layout
2) Use the Spacer control to introduce horizontal and/or vertical space between
controls
Other Containers
Group Panel
Is a titled box which has three texts header, information and trailer
Other Containers
Titled Panel
Is a container with a title bar and border
Other Containers
Grid
Represents a grid consisting of any number of rows and columns
Other Containers
Grid
Content
Content
Content
Content
Content
Any control, including other container controls, can be added to any cell
Other Containers
Grid
2 rows and
3 columns
rows 1
rows 2
Containers
Group Panel
Panel
Titled panel
Page Panel
Grid cell
Tab
Grid
Layouts
Module Summary
In this module you have learnt that:
Pages contain Controls - A Control is anything which is placed on a
page
Some controls are capable of containing other controls these are
Container controls
Each control has its own properties
Each container is given a Layout
Each layout has properties which allow spacing and alignment of
contents to be configured
Widths, Alignment and spacing / gaps between controls can all be
configured
Module Review
1.
2.
3.
4.
5.
6.
7.
8.
If you change the alignment of a layout, and this has no effect, what is the
reason?
9.
10. What is the main difference between a panel container and a group container?
11. Can layout be specified for a grid cell?
How about for a grid?
Lab Exercise
Ebase Xi Version 4
ADP Fundamentals
Module 06
Web Page Design 2
Module Objectives
Upon completion of this module you will:
Understand what most controls are and their properties
Understand how to use the styling assistant
Controls - Recap
Everything which is placed on a page is a Control
Image
Field
Hyperlink
Button
Text
Controls - Recap
All controls, are available from the
Controls
Field control
Button control
Image control
Text control
Hyperlink control
Html control
Message control
Include control
Tab control
General
Miscellaneous
Tabs
Menus
Controls
Page Control
Controls
Button Control
when the user clicks the button, the on click event scripts are executed
covered later
Controls
Image Control
image loaded from a URL can be configured in one of 3 ways:
1. is not clickable nothing happens when the user clicks on the image
Controls
Text Control
represents a text
can contain form field variables which are dynamically substituted at runtime
Controls
Hyperlink Control
is a text displayed as a hyperlink
text is configured in the same way as a Text Control
Controls
Html Control
any content that is valid within the BODY of an HTML page can be inserted
similar to a Text Control, except that multiple languages are not supported
Controls
Message Control
represents a location on a page where messages are displayed
allows the designer to set up message areas and send messages to these areas
Controls
Include Control
represents an external JSP or HTML file that can be inserted into any location
on the page
Controls
Tab Set Control and Tab Control
any number of tabs
may be added to a
Tab Set
Tab Set Control represents the entire tabbed set - most configuration
properties are configured on this control, e.g. border, selected, unselected etc
Tab Control represents a single tab plus the contents of that tab it is a
container control and therefore:
has layout
any other control may be added to it
ADP Fundamentals Module 6 - 16
Controls
Menu Controls
Vertical Menu
Horizontal Menu
Controls
Horizontal Menu Control
Top level menu is always visible
Lower levels dropdown
dynamically as the user
moves the mouse over the
menu items
Controls
Vertical Menu Control
Top level menu is
always visible
Property Levels Before Dropdown controls the number of menu levels, including Top
level, that will expand vertically. After this, subsequent menu levels will be shown as
dynamic dropdowns. For the above menu example, this was set to value of 2.
ADP Fundamentals Module 6 - 19
Controls
Shared menus
It is often desirable to place the same menu on several forms and or pages of the
same form, in such a way that its runtime state is shared and the correct menu
item is marked as selected as the user moves between pages and forms
To achieve this, use shared menus (see notes page), then:
either copy the menu onto all required pages,
or
Recommendation:
Instead of copying the menu, Place the Menu Control in a part-page
component then insert the component into form pages as required
Components are covered in a later module
ADP Fundamentals Module 6 - 20
Styling Assistant
The styling assistant allows you to quickly and easily style the control
e.g. apply a border to a container, change text to bold, set colors etc.
Styling Assistant
Each styling assistant has an interactive preview so you can see the effect of
each change you make
Hint:
Adding a border to a container
helps during initial design.
Remove it later if not required.
Hint:
A border has 3 attributes:
Thickness: e.g. 2px
Style: e.g. Dotted
Colour (Default is Black)
If you forget to set thickness or
style, you will have NO border
Styling Assistant
To get from
to
Set layout of each inner panel to 2-column layout
Styling Assistant
To get from
to
Module Summary
In this module you have learnt about:
Most controls are and their properties
How to use the styling assistant
Module Review
1. What are page navigation buttons?
2. What is the purpose of chaining pages at design time?
3. What happens when the display only property of a container is set?
Module Review
10. What are Tab and Tab Set controls?
Lab Exercise
Ebase Xi Version 4
ADP Fundamentals
Module 07
Web Page Design 3
Module Objectives
Upon completion of this module you will know about :
Property Sets
Presentation Templates
Style Sheets
Property Sets
It is often desirable to apply the same style to many controls
Using the styling assistant to style
each control is an option
A property set allows you to save
a collection of styling properties,
for a specific control, and then
apply this to any control of the
same type
Presentation Templates
A form may be associated with a Presentation Template using form
properties
More than 1
property set
may be
defined for
each control
Same styling
assistant as
for styling a
form control
Designer Preferences
Each designer can set their own preferences
2)
Orphaned Controls
Attempting to delete or rename a property set which is linked to one or
more controls, causes warning messages
If these warnings are ignored, all controls linked to that property set
become orphaned:
The Property Set name is shown in red at the top of the Properties View and is
marked as Not found.
The control loses its styling and all configured properties revert to using the
internal system defaults
Recommendation
Check property set references
(within presentation template)
before deleting or renaming
Advanced Styling
In addition to facilities provided by styling assistants, it is also possible to
apply CSS classes and inline styles to individual controls
Selectors
ADP Fundamentals Module 7 - 10
Design View
Always synchronised
Code View
Clicking the Preview CSS button allows the external style sheet to be
viewed in read-only mode
An internal style sheet may be created by copying and pasting the style
sheet content into a new style sheet definition
Module Summary
In this module, you have learnt about:
Property Sets
Presentation Templates
Style Sheets
Module Review
1.
What is an alternate way of styling a control, not using the styling assistant?
2.
3.
4.
5.
6.
7.
8.
Module Review
9. Can a property set be automatically applied to all new controls of a given type?
10. When loading/linking a property set, is there an option to use one in a
presentation template other than the one associated with the form?
11. What is the relationship between presentation templates and style sheets?
12. Are all classes in all style sheets associated with a presentation template
available to controls within a form?
Lab Exercise
Ebase Xi Version 4
ADP Fundamentals
Module 08
Validation & Events
Module Objectives
Client side validation happens locally and does not require a trip back
to the server
Server side validation cannot happen locally and requires a trip back
to the server
System Validation
Mandatory fields
Blank field results in an error message
Field types
Boolean, Character, Integer, Numeric, Date, Currency
Incorrect or incompatible type results in error message
Validators
Min / Max lengths
Patterns / Regular Expressions
Email address
Credit card
Mandatory Fields
Indicates
field is
required
Mandatory Fields
Field Types
Ebase allows use of XML regular expressions. Any form field defined
with a pattern will be validated server side only - and rejected if
entered data does not match the pattern
Regex is beyond the scope of this
training course
Heres a pattern to find a match for an
email address using regular
expressions \w+@\w+\.\w+((\.\w+)*)?
Current script
Rule1
If the loan amount the user enters is less than 15,000 then display an error
message to the user and make them try again.
Rule2
If the loan amount the user enters is greater than the property value they
enter, then display an error message to the user and make them try again.
Example 1
Rule1
if [fields.LOANAMOUNT.value < 15000]
event.owner.addErrorMessage(Sorry. Properties worth less
than 15,000 do not qualify.);
endif
Rule2
if [fields.LOANAMOUNT.value > fields.PROPERTY_VALUE.value]
event.owner.addErrorMessage(You may not borrow an amount
which exceeds your property value.);
endif
Example 1
After Form
Event
On Error Event Runs whenever the form fails for any reason
Browser Back
Button Event
Before Form
Event
After Form
Event
Previous Page
Button Event
Previous Page
Button Event
Validation
Event
On Change
Event
Validation
Event
On Change
Event
Form Events
An * denotes
presence of a
script for that
event
Click on form
properties to
access form
events
Page Events
Control Events
Immediate Validation
Button
Hyperlink
(and normal field)
Understanding Events
Design Time
Run Time
Normal field
No immediate validation
Field has a Validation event
Property Value
Property Value
Next Page
Validation Event
if (fields.PROPERTY_VALUE.value < 15000) {
event.owner.addErrorMessage('Sorry...');
}
10,000
Next Page
Understanding Events
Design Time
Run Time
Normal field
No immediate validation
Field has a Validation event
Field also has an On Change event
Property Value
Property Value
Next Page
Validation Event
if (fields.PROPERTY_VALUE.value < 15000) {
event.owner.addErrorMessage('Sorry...');
}
On Change Event
log ('Property value has changed to ' +
fields.PROPERTY_VALUE.value);
10,000
Next Page
Messages
Error
Warning
Final
Message texts have multilingual support and are maintained within the
forms designer
Messages
Message texts can include parameters for dynamic substitution from the
issuing script
Text contains && to represent parameter value substitution
Unlimited number of parameter substitutions
Order of parameters is important
Example:
You may not borrow an amount which makes your total borrowing
(&&) exceed your property value
Error Messages
Issued from within scripts that are tied to previous page, after page and
field control validation events only
Error Messages
Warning Messages
Issued from within scripts that are tied to after page and field control
validation events only
Final Messages
Normally contain information about what the form has done or feedback
to the user
Are displayed on the final page only Final page is displayed only if the
Finish button is pressed by the user
Are issued from scripts
Can be issued any time during form processing
Are accumulated until final page is displayed
Example:
An order number that was created
Maintaining Messages
Multiple
languages
Messages
for this
project
Double click on
Message No. to
open edit box
ADP Fundamentals Module 8 - 35
Module Summary
Ebase events for forms, pages, and controls offer many convenient
application control points during form processing
Module Review
1. Which field control property determines whether or not validation
happens as soon as the user inputs/changes the value?
2. How can you verify the order in which Ebase events are executed?
3. What is the difference between error messages and warning
messages?
4. When are after page events executed? What about before page
events?
5. What is an on change event used for?
6. Can a field control have a validation event and also an on change
event?
7. Can a normal (not immediate validation) field control have an on click
event?
Lab Exercise
Ebase Xi Version 4
ADP Fundamentals
Module 09
Scripting Language
(Javascript)
Module Objectives
Use Javascript scripts to dynamically change form values and control form
behaviour at runtime
Use functions in your scripts
Understand how to debug Javascript scripts
Javascript
server-side Javascript includes all the features of core Javascript (as described
by the ECMAScript V5 standard)
c = "Hello";
n = 1;
d = new Date();
cond1 = true;
//
//
//
//
Note that
variable types are
dynamic
i.e. Not declared but determined by content
If statements
if (n == 0) {
n++;
}
else {
n = +3;
}
Debugging
The Execution log, available from the designer (View > Execution log) contains
the following information:
The start of each script is logged
Each failure is logged, including a Javascript stacktrace that shows the stack
of invoked functions. Script line numbers are shown.
All output from the log() function, which is supplied by Ebase
The print() function, also supplied by Ebase, writes its output to System.out (the
server console or log file)
value
items
in
this
array
Or
var aList = [];
aList[0]= "5";
aList[1]= "items";
aList[alist.length]= "in";
aList[alist.length]= "this";
aList[alist.length]= "array";
then
for each (var x in aList)
{
log (x);
}
Loops
// loop thru parms
for each (var p in parms)
{
log (p);
}
Or
for (var n in parms)
{
log (parms[n]);
}
Example code
Configure the script as a Library script, using the form Events tab
Java objects and classes can be accessed directly from Javascript code
Possible to use any available Java package or to write specific functionality in Java and
invoke this directly from a Javascript script
See section Adding Java libraries in Server-Side Javascript Developers Guide of the
documentation for more on this
Example code
var path = "C:/temp/myfile.xml";
var f1 = new java.io.File(path);
Or
importPackage(java.io);
var path = "C:/temp/myfile.xml";
var f1 = new File(path);
then
var c = f1.getName();
log (c + " exists? " + f1.exists());
Ebase API
Access to the Ebase form elements e.g. to fields, controls, pages etc is provided via a
comprehensive API (the API is written in Java)
The API is accessible to Javascript scripts via a number of variables which are added
automatically to each script:
Variable
Name
Description
fields
Access to all fields in the form or integration service, or process attributes in a workflow process
controls
pages
event
Access to the controlling event e.g. Button Control on-click event, before page event
form
Core object for the form API. Provides methods to access all other form elements. It also provides a
number of methods to perform user actions such as: go to page, call form, call URL, generate PDF,
upload file etc.
system
Access to many additional system services: includes system variables, transactions, sequences,
security etc
client
resources
Access to all resources within the business view of the form, integration service or workflow process
components Access to all elements for a deployed component this supports changing the context so that
elements are accessed as if from a specific deployed component e.g. to load data from a table
defined within a component
tables
Javascript editor
The linked form determines the list of available fields, tables, controls etc shown
when using code-assist features
Code-assist shows lists of form fields, tables, controls etc and available methods
and properties
A Javadoc block is a comment block that begins with /** and ends with */
/**
* Multiplies two numbers together and returns the result
* @param n1 the first number
* @param n2 the second number
* @return the result
*/
function multiplyTwoNumbers( n1, n2 ) {
return n1 * n2;
}
Issuing Messages
controls.FIELDCONTROL13.addErrorMessage("You entered diff... ");
// Message location is as configured for FIELDCONTROL13
event.owner.addErrorMessage("Your input is invalid.");
// Message location is as configured for the triggering control
event.owner.addWarningMessage("Additional charges apply for this service.");
event.owner.addErrorMessage(1001, null);
Conditional statements
value: returns a (Java) Object when read, and accepts different Object types
when set see documentation for details. For character and numeric types, these
work as expected. Fields of type DATE, TIME and DATETIME are different:
// 3 form fields are Date, Time and DateTime
fields.CURRENT_DATE.value = new Date();
fields.CURRENT_TIME.value = new Date();
fields.CURRENT_DATE_TIME.value = new Date();
displayValue: useful for fields of type DATE, TIME, DATETIME and Lists
fields.ADATE.value;
// returns the date as the number of milliseconds since 1 st Jan 1970
fields.ADATE.displayValue;
// returns a displayable date with local formatting e.g. 25/12/2012,
12/25/2012, 25.12.2012 etc
// no parameters
// parms contains list of parameters
parms.P1 = fields.START_DATE.stringValue;
parms.P2 = fields.END_DATE.stringValue;
form.gotoForm("FORM2", parms);
/* P1 and P2 need to be:
1. in uppercase in the parameters object
2. fields in the called form
3. url parameters in the called form
*/
Issuing Messages
msgText
stopProcessing
msgNo
Examples:
event.owner.addErrorMessage("Please try
event.owner.addErrorMessage("Please try
event.owner.addErrorMessage(1001);
event.owner.addErrorMessage(1001, ["Msg
event.owner.addErrorMessage(1001, ["Msg
again...");
again...", false);
Param1"]);
Param1", fields.F1.value], false);
Validation
if ( !fields.LAST_NAME.value ){
event.owner.addErrorMessage("Last name is mandatory", false);
error = true;
}
//
//
//
//
if
Validation
Library Scripts
return true;
}
Configure the script as a Library script, using the form Events tab (Library scripts are
also configurable for Integration services and workflow processes)
Fields of type Object can be used to store complex objects that are not
supported by any of the other types
Values can only be read and set via the scripting API using a language such as
Javascript
Sometimes there is a need to create an object in one script and then use it later
in another script or another form
This is achieved by using a form field of type Object, OBJ1 in the following
example
// In another script
Error Handling
Exceptions thrown by Java methods, including the Ebase API, can be caught
and processed by JavaScript code using try, catch and finally statements
try {
resources.CUSTOMER_EMAIL.sendmail();
// no such resource
}
catch (e) {
event.owner.addErrorMessage("Email failed",false);
log (e);
}
Changing Texts
Sometimes it is desirable to set a form text, such as a text control or a field label
or a page header, at run time.
Best practice
Write functions
Use consistent styling for indentation, if/else blocks, for blocks etc.
Module Summary
Module Review
1.
2.
3.
4.
5.
6.
7.
8.
What makes form elements such as fields and controls available to server-side javascript?
9.
controls.fieldcontrol12.hidden=true;
14. What is the mechanism for passing parameters from one form to another?
15. When is displayValue useful? How about stringValue?
16. What does the following command do?
event.owner.addErrorMessage(1001, ["Msg Param1", fields.F1.value]);
ADP Fundamentals - Module 9 - 29
Lab Exercise
Ebase Xi Version 4
ADP Fundamentals
Module 10
External Resources
Module Objectives
Upon completion of this module, you will be able to:
Understand the concept of external resources
Understand the functions of business views and mappings
External Resources
Ebase has rich built in features to integrate with the following external
resources:
Databases
Email
PDF Printing
Stored Procedures
Web Services
XML
Enable Ebase form applications to read data from and/or write data to
these external resources, for example:
An HR application which retrieves employee data from a back-end
database
An inventory application which sends out email notifications when
inventory is low
External Resources
All external
resources listed here
ADP Fundamentals Module 10 - 4
Resource Fields
Mappings
IT Separation
Mappings
Mappings
Click on the
mappings icon to
access mappings
Select the
fields to
import
Business Views
Name of current business view
Business Views
To import fields from a resource or to set up or maintain mappings, the
form must be told to which external resource(s) it has access
Upon creation, a form does not yet have access to any external
resources
The only way to give the form access to external resources is to
associate the form with a business view
A business view is a collection of external resources
A form has access to all of the external resources contained in its
associated business view
External resources can belong to one or many business views
A form is associated with exactly one business view which grants the
form access to the resources in that business view
A business view can be associated with any number of forms
Business Views
Business Views
Module Summary
Ebase has rich built in features for integrating with external resources
such as databases, email servers, XML, print, and Web services
Module Review
1. What is the difference between a resource field and a form field?
2. What is the difference between a business view and an external
resource?
3. What are the two ways to map form fields to resource fields?
4. How many business views can be associated with a form? How many
forms can be associated with a business view?
5. What is the advantage of creating mappings between resource fields
and form fields as compared to putting resource fields directly onto a
form?
Lab Exercise
Ebase Xi Version 4
ADP Fundamentals
Module 11
Database Resources
Module Objectives
Database
Pooled Connection
/>
Database
Ebase
Database
connection
Datasource
Database Resources
Database
resource
Database
connection
Database
Database Resources
IT Separation
Form
Form Field
Resource Field
Database Resources
Database Resources
e.g.
select * from applicants where NI_NUMBER=&&NI_NUMBER
Ebase will replace &&NI_NUMBER with the appropriate field at
runtime before issuing the SQL query to the database
Database Resources
A database resource can read from, write to, update and delete from
database tables
Importing Resource
fields into the form
Form
Form Field
ADP Fundamentals Module 11 - 13
Resource Field
Select database
connection to import
database resources
ADP Fundamentals Module 11 - 14
2
3
5
ADP Fundamentals Module 11 - 15
Database resource
created for the
selected table
ADP Fundamentals Module 11 - 16
Adds the new resource to the business view for this form
Creates the mappings between form fields and database resource
fields
Select which
Database
Select which
form fields to
include in the
new database
resource
Select which
form field(s) to
include in the
resource where
clause
Database resource fields are the database columns returned by the SQL
statement associated with the database resource
If the field is required the SQL statement will not be executed until the
required field has a value
Required field
Commands (continued)
resources.RESOURCE_NAME.insert()
Inserts a single record into the database
e.g. resources.TEST_DB_RESOURCE.insert();
If a field is required and has no value when executing the command,
a runtime error will occur and the insert will fail
resources.RESOURCE_NAME.update()
Updates data in database
e.g. resources.TEST_DB_RESOURCE.update();
Caution! Will update all rows that match the where clause; if there is
no where clause all rows will be updated
Commands (continued)
resources.RESOURCE_NAME.delete()
deletes data from database
e.g. resources.TEST_DB_RESOURCE.delete();
If there is no where clause, the command is ignored. i.e. no records
are deleted
System variables
system.variables.$FOUND.value
system.variables.$UPDATE_COUNT.value
Available after delete, insert, update or updatetable
commands
Contains the number of affected records
ADP Fundamentals Module 11 - 27
Sequence
e.g. Insert a new order into the database with a new order id
Use Ebase sequence to supply the new order id
Sequence
Available sequences
Sequence
Usage example
fields.ORDER_ID.value =
system.sequenceManager.sequence("ORDER_SEQUENCE");
// insert new customer record
resources.ORDER_DB_RESOURCE.insert();
Sequence
Module Summary
The mapping between form fields and database resource fields can be
established with a bottom-up or a top-down methodology
Module Review
1. What are the relationships between a database, datasource, and Ebase
database connection element?
2. Is it better to import database resources from a database schema or to
create them from a form?
3. How does a database resource to form field mapping handle the case
where multiple rows are returned from the database?
4. What actions might you take after examining $FETCH_COUNT after a
fetch?
Lab Exercise
Ebase Xi Version 4
ADP Fundamentals
Module 12
Lists
Module Objectives
What is a List
A list is a shared element and can be used by all forms in all projects
What is a List
Lists can be
associated with
different form
fields. These
values come from
separate lists
defined within
Ebase
List Types
Static List
Dynamic List
For values that do not change when For values that change when running
running forms
forms
Values entered in designer at
development time
Multi
lingual
Sequence can
be changed
Display text is
shown to user
Return value is
stored in the field
Dynamic Lists
Can return different sets of values based on input parameters in the SQL
query
Add a dynamic list to a form field just like a static list, using field
properties
When assigning a dynamic list to a form field you need to know which
column (list field) to use for the form field
Ebase automatically creates mappings if the list field and the form field
have the same name
You can also specify mappings between other list fields and form fields
code:
log ('NAME='+fields.NAME.value);
2.
3.
Never
Database resource
Dynamic list
Yes
Yes
When is database
accessed?
Yes
No
Yes
No
Yes
Yes
Can be created
automatically?
No
Yes
Form
Business view
Import
Create external resource
mappings
Database resource
+ fields
Field
Build list
Import
Dynamic list
+ fields
Database
DB
Linked Lists
A linked list is a dynamic list whose values are dependent on the input in
a preceding field
Most common case is one list (static or dynamic) driving a second list
(dynamic)
e.g. A departments selection drop-down controlling which values are
displayed for an employees selection drop-down
Linked Lists
Two dynamic drop-down lists; the second list is initially not populated or
displayed
Upon selection of a value from the first list, the second list is populated
and displayed
Linked Lists
If user selects a different item from the first list, the values in the second
list change automatically
Linked Lists
Department_ID field
comes from first list
First dynamic list
ADP Fundamentals Module 12 - 22
Linked Lists
Department_ID =&&Department_ID
Linked Lists
Turn on immediate
validation for the first list
Module Summary
Ebase supports both dynamic and static lists to create user selections
for pull down lists, radio buttons, and checkboxes
Dynamic lists can return multiple columns from the database which can
be mapped to various form fields
Both dynamic lists and database resources access the database but
they differ in their applications and abilities
The most common usage of a linked list is a static or dynamic list that
populates the values of a related second dynamic list
Module Review
1. Can dynamic or static lists be re-used across different projects?
2. Is a list specified as a form field property or a field control property?
3. Why might you want to return multiple database columns when
displaying a dynamic list?
Lab Exercise
Ebase Xi Version 4
ADP Fundamentals
Module 13
Components
Module Objectives
What is a Component?
Global and Library projects always appear at the bottom of the Business
projects section
Component Types
There are 3 types of components in Ebase
A fields-only component is a set of fields and/or tables which can be inserted
into a form. It has no visible elements
Note: No controls
Component Types
Component Types
Add a fields-only
component
Insert a one-or-more-pages
component
ADP Fundamentals Module 13 - 8
Insert a part-page
component
Component fields and controls are added to the form page, at the
specified location on the page
Name prefix and link / embed options covered later
Upon completion of actions on slide 11, field, page and control names
created in the form will be prefixed by HR_ADDR_PAGE__ (note
double underscores)
Linking
The form acquires a reference to the component
The form designer may not change any aspect of the component in
situ, i.e. while changing the form
Global Scripts
Scripts placed in the Global project are available to all forms
Only global scripts may be associated with components
Global Scripts
Global Scripts
Question
What happens when the same field name appears both in a
component and in a form into which the component is inserted?
Answer
The component fields have a prefix, so the 2 can co-exist
If a script is called from a component event, the fields it refers to are
prefixed with that component instances prefix. When a field can
not be found, the script looks for that field name without the prefix
If the script is called from a non-component field or page, no prefix is
attached to fields or controls or pages it refers to
Global Scripts
Ebase will always look for a script in the local project first and, if not
found, it will then look in the global project
Global messages
Module Summary
Module Summary
Module Review
1. What is the difference between a part-page component and a one-ormore-pages component?
2. What happens when a fields-only component is inserted onto a page of
a form?
3. What type of events can each component type have?
4. When a component is changed, how does this impact forms linked to
the component?
5. What is the purpose of having a name prefix when adding a component
to a form?
6. Whats the effect of including name prefixes within a global script? How
would this work when attached to different instances of the same
component?
Lab Exercise
Ebase Xi Version 4
ADP Fundamentals
Module 14
Tables
Module Objectives
What is a table?
What is a table?
Each column
is a form field
Table name is
used in scriprts
Resource must be
a Table resource
and must be in the
Business View
Click to create
table columns
ADP Fundamentals - Module 14 - 7
Imported
resource
fields are also
mapped to
corresponding
table columns
in the form
If the table was created using the New table icon in the Tables panel, it
needs to be dragged into a container
Table Controls
Table Control
is used to display a table
allows configuration of most table properties
Loading a table
Need a before table script to read the data into the table
How to:
Scroll icons
added
automatically
otherwise, an on click event can be specified which is executed when the user
clicks on the image
How to:
Fix column(s) for scrolling right click column header, fix column
control
Module Summary
A table can have its data loaded from an underlying database table using
a database resource, or form an xml document using an xml resource
Module Review
1. Can a table be re-used in different forms?
2. What does a field within a table represent?
3. What are the steps to enable data from a database table to be loaded
into a form table?
4. What are some of the differences and similarities between a database
resource for single row processing and one for table use?
5. Does a table need to be tied to an external resource?
6. Can a table have a mixture of external resource fields and fields which
are not linked to a resource?
Contd
Module Review
7. How does Ebase present a table which is too wide?
8. How do you change a column heading?
9. How do you introduce horizontal scrolling?
10. Can a table exist in a form, without being on a page?
11. Can a table on page be set to display only, hidden, mandatory,
immediate validation?
12. Can a table column be set to display only, hidden, mandatory, immediate
validation?
Lab Exercise
Ebase Xi Version 4
ADP Fundamentals
Module 15
Repeater Control
Module Objectives
Upon completion of this module, you will:
Learn about Repeater Control, which provides an alternate way of
presenting repeating data
Repeating data
Data from an Ebase table can be displayed in one of 2 ways:
1. Tabular format using Table control
Repeating data
Data from an Ebase table can be displayed in one of 2 ways:
2. Repeater format using Repeater Control
Each of these is
from ONE row of a
table
Repeater Control
A Repeater Control provides a flexible way of displaying data from an
Ebase table
Repeater Control
A Repeater Row Control is a container, therefore:
it can have any layout
it and can include any other control as a child
Module Summary
The Repeater Control provides a alternative way of displaying data from
an Ebase table
The layout of the both Repeater control and Repeater Row control are
significant in the way data is presented
Module Review
1. What are the 2 controls used for showing repeating data?
2. Does a repeater control have to be backed by a resource?
Lab Exercise
Ebase Xi Version 4
ADP Fundamentals
Module 16
Email Resources
Module Objectives
Upon completion of this module, you will be able to:
Create and edit an email resource
Understand the interaction between a form and an email resource
Before an Ebase form can send out email, Ebase server must be
connected to an email server
Configured in file UfsSetup.properties
(in directory <ebase>\UfsServer\tomcat\webapps\ufs\WEB-INF\classes\
where <ebase> is the Ebase installation directory)
e.g. Ufs.emailHostId=localhost
Your email server
name or IP address
Email Resources
Are the interface between Ebase and the connected email server
Enable Ebase to send out emails containing a mixture of static and
dynamic content
Can be created manually or automatically by the create external
resource feature (available for several types of external resources, not
just email resources)
Contain the following properties:
From
To
CC, BCC
Subject
Message
ADP Fundamentals Module 16 - 4
Email Resources
Authentication
details
Email Details
List of
email
resources
Resource fields
&&EMAIL_ADDRESS
Will be substituted with
mapped form field value
Email Resources
Each email resource represents one email template
The content within an email resource can be static and/or dynamic
Dynamic content is achieved by substitution, using the && notation
Substitution must be with a resource field, as per all other resources
Example of static content:
To: John.smith@yahoo.co.uk
To: &&EMAIL_ADDRESS
Email Resources
Build Fields button can be used to automatically create resource fields
Ebase looks at the email resource and ensures that a resource field
exists for each && variable
e.g. If in an email resource, there are two substitutable fields,
&&TO_EMAIL and &&TO_NAME, clicking the Build Fields button
will create two resource fields, TO_EMAIL and TO_NAME, if they do
not already exist
ADP Fundamentals Module 16 - 7
Simple example
resources.CUSTOMER_EMAIL.sendmail();
Module Summary
Ebase email resources are the interface between Ebase and email
server software connected to Ebase
Ebase email resources can be used to generate dynamic content email
messages
Typically, Ebase email resources are initially configured by IT personnel
and subsequently administered by business users
Creating external email resources automatically is useful to ensure that
no steps are missed
Once configured, FPL is used to control and initiate the distribution of
email, possibly with attachments
Module Review
1. What are the 6 sections within an email resource?
3. Which of these must contain values, both at design and at run time?
4. Can the sendmail method include attachments?
Lab Exercise
Ebase Xi Version 4
ADP Fundamentals
Module 17
Printing
Module Objectives
Option A
Print pages as designed within Ebase
Option B
Use Adobe PDF forms and Ebase print resources
or to a PDF
or to both
This means that the same page designer is used to create both web and
print pages
There is no explicit declaration that a particular page is a print page any page can be output as a PDF
PDF Scripting
By default this will display the current page of the form as a PDF
document in a popup window, but includes options to:
Option name
display
save
filePath
popup
reportMode
pages
opts.display = true;
opts.save = true;
opts.popup = true;
opts.reportMode = true;
opts.filePath = "C:/temp/pdf123.pdf";
opts.popupWindowName = "pdf1";
opts.pages = [pages.PAGE_2, pages.PAGE_4];
var fileName = form.generatePdf(opts);
Returns the file path of the saved document when the save option is
selected, or null
Dynamic Expansion
Display only input fields and text areas will expand dynamically to
include all data
Editable input fields and text areas will be displayed in boxes that have
a fixed width and height and will not expand dynamically
Width of a field is controlled by the display length property
Height (text areas only) is controlled by the number of rows property
Dynamic Expansion
Lists
when displayed as radio buttons or checkboxes, will dynamically expand
when displayed as a dropdown, only the current value will be displayed
reportMode option
When set to true, all fields and table columns will be displayed as if they
were display only, and therefore all content will expand dynamically
reportMode option
To configure a header:
Set a top margin for the Page Control using PDF style property
Configure a header text - you can enter HTML into this text
To configure a footer:
Repeat for corresponding bottom and footer properties
Page numbering
is displayed as:
Page 1 of 2, Page 2 of 2 etc.
A print resource:
Is used when the requirement is to write to a pre-designed PDF
document
Is the interface between an Ebase form and a PDF document
Allows an Ebase application to exchange data with a PDF document
Can import field definitions from a PDF to an Ebase form
Can populate a PDF document with form data
false);
URL or filename to
access PDF
source document
from the server
Module Summary
Any page created in the Form Designer can be output to a web browser,
or to a PDF, or to both
There is no explicit declaration that a particular page is a print page
At runtime, generated PDF content is adjusted to fit within the width of the
page
Generally, a page will expand dynamically to accommodate its contents
Input fields and text areas will behave differently depending on whether
they are enterable or display only
reportMode option of the generatePdf() method causes all content of all
fields and table columns to expand dynamically
An Ebase application may be integrated with an Adobe PDF document
using a print resource
This allows a pre-designed PDF document to be populated by form data
Module Review
1. What Ebase resources which may be created by importing from external
resources?
2. When is it appropriate to use a print resource?
3. What is the command for printing to a print resource?
4. Do you need to design pages specifically for printing?
5. Does generatePdf() include all the pages of a form by default?
6. What happens when the page being output includes a textarea
containing more data than allowed by its number of rows property?
7. What do you need to do to ensure dynamic expansion of all data being
output?
8. What would you need to do to ensure dynamic expansion of all data
being output, without using the report option?
9. What happens to table data when it doesnt fit on one page?
10. How are lists presented in a PDF?
Lab Exercise