Give me your Poor, Your Misunderstood, Your Component Interfaces EIS Developer Forum March 8, 2007
Nov 18, 2014
Give me your Poor, Your Misunderstood, Your Component Interfaces
Give me your Poor, Your Misunderstood, Your Component Interfaces
EIS Developer Forum
March 8, 2007
EIS Developer Forum
March 8, 2007
Component InterfacesComponent Interfaces
AgendaAgenda
What is a Component Interface?Why would I want to use a CI?Component Interface ArchitectureProgramming CI in PeopleCodeUsing the Excel to CI Utility
What is a Component Interface?Why would I want to use a CI?Component Interface ArchitectureProgramming CI in PeopleCodeUsing the Excel to CI Utility
What is a CI?What is a CI?
A component interface (CI) enables exposure of a PeopleSoft component (a set of pages grouped together for a business purpose) for synchronous access from another application -- such as PeopleCode, Java, C/C++, COM, or XML.
A component interface (CI) enables exposure of a PeopleSoft component (a set of pages grouped together for a business purpose) for synchronous access from another application -- such as PeopleCode, Java, C/C++, COM, or XML.
What is a CI?What is a CI?
Component interfaces can be viewed as "black boxes" that encapsulate PeopleSoft data and business processes, and hide the details of the underlying page and data.
Component interfaces can be viewed as "black boxes" that encapsulate PeopleSoft data and business processes, and hide the details of the underlying page and data.
What is a CI?What is a CI?
A CI maps to one, and only one, PeopleSoft component.
CIs are created in Application Designer.
Record fields on the component are mapped to the keys and properties of the CI.
Methods are used to find, create, modify, or delete data.
A CI maps to one, and only one, PeopleSoft component.
CIs are created in Application Designer.
Record fields on the component are mapped to the keys and properties of the CI.
Methods are used to find, create, modify, or delete data.
Why would I want to use a CI?
Why would I want to use a CI?
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.
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?
Why would I want to use a CI?
Let’s suppose that we need a way to add email addresses for employees in a batch mode.
Let’s suppose that we need a way to add email addresses for employees in a batch mode.
Why would I want to use a CI?
Why would I want to use a CI?
PeopleCode behind the EMAIL_ADDRESSES record does some editing (SaveEdit event)
Personal Data
Back
Why would I want to use a CI?
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; /* Make sure that the second part after the @ contains . */ &str_Host = Substring(&str_Email, &nbr_Loc + 1, Len(&str_Email) - &nbr_Loc); &nbr_Loc = Find(".", &str_Host); If (&nbr_Loc = 0 Or &nbr_Loc = Len(&str_Email)) Then Error MsgGet(1000, 1420, "The e-mail address shall contain the . character after the host name."); End-If;End-If;
/* 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; /* Make sure that the second part after the @ contains . */ &str_Host = Substring(&str_Email, &nbr_Loc + 1, Len(&str_Email) - &nbr_Loc); &nbr_Loc = Find(".", &str_Host); If (&nbr_Loc = 0 Or &nbr_Loc = Len(&str_Email)) Then Error MsgGet(1000, 1420, "The e-mail address shall contain the . character after the host name."); End-If;End-If;
Why would I want to use a CI?
Why would I want to use a CI?
• Doing a straight SQL insert or update would not validate the email address format…allowing bad data into the database.
• Using a CI, the underlying edits would be performed!
• Doing a straight SQL insert or update would not validate the email address format…allowing bad data into the database.
• Using a CI, the underlying edits would be performed!
Component Interface Architecture
Component Interface Architecture
Component View CI View
Component Interface Architecture
Component Interface Architecture
Every component interface has the following attributes:NameKeys (get keys, create keys, and find
keys)Properties and collections (fields and
records)Methods
Every component interface has the following attributes:NameKeys (get keys, create keys, and find
keys)Properties and collections (fields and
records)Methods
Component Interface Architecture
Component Interface Architecture
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.
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
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.
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 Interface Architecture
Component View CI View
Keys
Component Interface Architecture
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.
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 Interface Architecture
Component View CI View
Properties
Component Interface Architecture
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.
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
Component Interface Architecture
CI View
Collections – based on scroll areas
Underlying Component
Component Interface Architecture
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.
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
Component Interface Architecture
CI View
Methods
Programming CI in PeopleCode
Programming CI in PeopleCode
PeopleCode events and functions that relate exclusively to GUI and online processing cannot be used by CI. These include:Search dialog processingMenu PeopleCode and pop-up menusTransfers between componentsDoSave() and DoSaveNow()
PeopleCode events and functions that relate exclusively to GUI and online processing cannot be used by CI. These include:Search dialog processingMenu PeopleCode and pop-up menusTransfers between componentsDoSave() and DoSaveNow()
Programming CI in PeopleCode
Programming CI in PeopleCode
Application Designer can generate a template in the form of boilerplate PeopleCode that you can adapt to your purposes.
Application Designer also provides a built-in function that allows you to test the CI.
Application Designer can generate a template in the form of boilerplate PeopleCode that you can adapt to your purposes.
Application Designer also provides a built-in function that allows you to test the CI.
Using the Excel to CI Utility
Using the Excel to CI Utility
Used to upload data from Microsoft Excel into a PeopleSoft database.
A template is used to create worksheets that are specific to the business logic that you need to use when you are uploading data.
Used to upload data from Microsoft Excel into a PeopleSoft database.
A template is used to create worksheets that are specific to the business logic that you need to use when you are uploading data.
Using the Excel to CI Utility
Using the Excel to CI Utility
Uses Visual Basic and a DOM (Document Object Model) structure to submit data to a CI where all necessary PeopleCode events and field-level edits occur.
Based on results from saving the CI, another DOM is created that returns success, warnings, and/or errors to the Excel document.
Records in error can be corrected and resubmitted.
Uses Visual Basic and a DOM (Document Object Model) structure to submit data to a CI where all necessary PeopleCode events and field-level edits occur.
Based on results from saving the CI, another DOM is created that returns success, warnings, and/or errors to the Excel document.
Records in error can be corrected and resubmitted.
Using the Excel to CI Utility
Using the Excel to CI Utility
Restrictions/GuidelinesAn 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.
Restrictions/GuidelinesAn 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.
For more information on this topic, sign up for one of the workshops to be held tomorrow
9:00 am – 12:00 pm (full)
1:00 pm – 4:00 pm (2 spots available)
RP - EIS Training Room 1
Workshop TomorrowWorkshop Tomorrow
The End