Top Banner
Give me your Poor, Your Misunderstood, Your Component Interfaces EIS Developer Forum March 8, 2007
29
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: PeopleSoft Component Interfaces

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

Page 2: PeopleSoft Component Interfaces

Component InterfacesComponent Interfaces

Page 3: PeopleSoft Component 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

Page 4: PeopleSoft Component Interfaces

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.

Page 5: PeopleSoft Component Interfaces

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.

Page 6: PeopleSoft Component Interfaces

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.

Page 7: PeopleSoft Component Interfaces

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.

Page 8: PeopleSoft Component Interfaces

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.

Page 9: PeopleSoft Component Interfaces

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

Page 10: PeopleSoft Component Interfaces

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;

Page 11: PeopleSoft Component Interfaces

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!

Page 12: PeopleSoft Component Interfaces

Component Interface Architecture

Component Interface Architecture

Component View CI View

Page 13: PeopleSoft Component Interfaces

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

Page 14: PeopleSoft Component Interfaces

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.

Page 15: PeopleSoft Component Interfaces

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.

Page 16: PeopleSoft Component Interfaces

Component Interface Architecture

Component Interface Architecture

Component View CI View

Keys

Page 17: PeopleSoft Component Interfaces

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.

Page 18: PeopleSoft Component Interfaces

Component Interface Architecture

Component Interface Architecture

Component View CI View

Properties

Page 19: PeopleSoft Component Interfaces

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.

Page 20: PeopleSoft Component Interfaces

Component Interface Architecture

Component Interface Architecture

CI View

Collections – based on scroll areas

Underlying Component

Page 21: PeopleSoft Component Interfaces

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.

Page 22: PeopleSoft Component Interfaces

Component Interface Architecture

Component Interface Architecture

CI View

Methods

Page 23: PeopleSoft Component Interfaces

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()

Page 24: PeopleSoft Component Interfaces

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.

Page 25: PeopleSoft Component Interfaces

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.

Page 26: PeopleSoft Component Interfaces

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.

Page 27: PeopleSoft Component Interfaces

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.

Page 28: PeopleSoft Component Interfaces

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

Page 29: PeopleSoft Component Interfaces

The End