Professional Documents
Culture Documents
March 8, 2007
Because…
Component interfaces execute the business
logic built into the component and as a
result, they provide a higher level of data
validation than a simple SQL
insert/update/delete.
That includes any fields that use prompt
tables to limit values as well as any “editing”
of data with PeopleCode logic.
Why would I want to use a CI?
Back
Why would I want to use a CI?
/* ICE Incident ID 1248970002: Validate that the email is in the correct format <username>@<hostname> */
Local string &str_Email, &str_Host;
Local number &nbr_Loc;
&str_Email = RTrim(LTrim(EMAIL_ADDRESSES.EMAIL_ADDR));
If All(&str_Email) Then
&nbr_Loc = Find("@", &str_Email);
/* Make sure that @ sign exists and it is not the last character in the email address */
If &nbr_Loc = 0 Then
Error MsgGet(1500, 169, "Email address must contain the @ character.");
Else
If &nbr_Loc = Len(&str_Email) Then
Error MsgGet(1000, 1419, "The e-mail address shall not contain @ at the last character.");
End-If;
End-If;
Name
Each CI requires a unique name that is
specified when the CI is created. The
calling program uses the name of the
CI to access properties and methods.
Component Interface
Architecture
Keys
Keys are special properties containing values
that retrieve an instance (get keys) or a list
of instances (find keys) of the CI.
Get and find keys are based on the search
record definition for the underlying
component.
Create keys are included for components that
have the “Add” action enabled.
Component Interface
Architecture
Component View CI View
Keys
Component Interface
Architecture
Properties
Standard properties are assigned
automatically when the CI is created and can
be set to true or false. Examples include
InteractiveMode, GetHistoryItems, and
EditHistoryItems.
User-defined properties map to record fields
on the component.
You have control over which user-defined
properties are included in the CI.
Component Interface
Architecture
Component View CI View
Properties
Component Interface
Architecture
Collections
A special type of property that corresponds
to a scroll.
Contains fields and subordinate scrolls as
defined in the underlying component.
Component Interface
Architecture
CI View
Collections – based on
scroll areas
Underlying Component
Component Interface
Architecture
Methods
A function that performs a specific task on a
CI at runtime.
Standard methods are those available for all
CIs such as Find, Get, Save, and Cancel.
User-defined methods provide added
functionality to the CI. These methods are
functions that are made accessible through
the CI. Each function maps to a user-defined
method.
Component Interface
Architecture
CI View
Methods
Programming CI in PeopleCode
Restrictions/Guidelines
An Excel spreadsheet has a physical
limitation of 252 columns and 65,000
rows.
This utility is best used with small to
medium-complexity CIs. For large CIs,
other methods of uploading data like
File Layout and AppEngine, may be
more appropriate.
Workshop Tomorrow